13147Sxc151355 /* 23147Sxc151355 * CDDL HEADER START 33147Sxc151355 * 43147Sxc151355 * The contents of this file are subject to the terms of the 53147Sxc151355 * Common Development and Distribution License (the "License"). 63147Sxc151355 * You may not use this file except in compliance with the License. 73147Sxc151355 * 83147Sxc151355 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93147Sxc151355 * or http://www.opensolaris.org/os/licensing. 103147Sxc151355 * See the License for the specific language governing permissions 113147Sxc151355 * and limitations under the License. 123147Sxc151355 * 133147Sxc151355 * When distributing Covered Code, include this CDDL HEADER in each 143147Sxc151355 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153147Sxc151355 * If applicable, add the following below this CDDL HEADER, with the 163147Sxc151355 * fields enclosed by brackets "[]" replaced with your own identifying 173147Sxc151355 * information: Portions Copyright [yyyy] [name of copyright owner] 183147Sxc151355 * 193147Sxc151355 * CDDL HEADER END 203147Sxc151355 */ 213147Sxc151355 /* 22*4126Szf162725 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 233147Sxc151355 * Use is subject to license terms. 243147Sxc151355 */ 253147Sxc151355 263147Sxc151355 #ifndef _SYS_MAC_WIFI_H 273147Sxc151355 #define _SYS_MAC_WIFI_H 283147Sxc151355 293147Sxc151355 #pragma ident "%Z%%M% %I% %E% SMI" 303147Sxc151355 313147Sxc151355 /* 323147Sxc151355 * WiFi MAC-Type Plugin 333147Sxc151355 */ 343147Sxc151355 353147Sxc151355 #ifdef __cplusplus 363147Sxc151355 extern "C" { 373147Sxc151355 #endif 383147Sxc151355 393147Sxc151355 #include <sys/types.h> 403147Sxc151355 #include <sys/net80211_proto.h> 413147Sxc151355 423147Sxc151355 #ifdef _KERNEL 433147Sxc151355 443147Sxc151355 #define MAC_PLUGIN_IDENT_WIFI "mac_wifi" 453147Sxc151355 463147Sxc151355 /* 473147Sxc151355 * Maximum size of a WiFi header based on current implementation. 483147Sxc151355 * May change in the future as new features are added. 493147Sxc151355 */ 503147Sxc151355 #define WIFI_HDRSIZE (sizeof (struct ieee80211_frame) + \ 51*4126Szf162725 IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_EXTIVLEN + \ 52*4126Szf162725 sizeof (struct ieee80211_llc)) 533147Sxc151355 543147Sxc151355 enum wifi_stat { 553147Sxc151355 /* statistics described in ieee802.11(5) */ 563147Sxc151355 WIFI_STAT_TX_FRAGS = MACTYPE_STAT_MIN, 573147Sxc151355 WIFI_STAT_MCAST_TX, 583147Sxc151355 WIFI_STAT_TX_FAILED, 593147Sxc151355 WIFI_STAT_TX_RETRANS, 603147Sxc151355 WIFI_STAT_TX_RERETRANS, 613147Sxc151355 WIFI_STAT_RTS_SUCCESS, 623147Sxc151355 WIFI_STAT_RTS_FAILURE, 633147Sxc151355 WIFI_STAT_ACK_FAILURE, 643147Sxc151355 WIFI_STAT_RX_FRAGS, 653147Sxc151355 WIFI_STAT_MCAST_RX, 663147Sxc151355 WIFI_STAT_FCS_ERRORS, 673147Sxc151355 WIFI_STAT_WEP_ERRORS, 683147Sxc151355 WIFI_STAT_RX_DUPS 693147Sxc151355 }; 703147Sxc151355 713147Sxc151355 /* 723147Sxc151355 * WiFi security modes recognized by the plugin. 733147Sxc151355 */ 743147Sxc151355 enum wifi_secmode { 753147Sxc151355 WIFI_SEC_NONE, 76*4126Szf162725 WIFI_SEC_WEP, 77*4126Szf162725 WIFI_SEC_WPA 783147Sxc151355 }; 793147Sxc151355 803147Sxc151355 /* 813147Sxc151355 * WiFi data passed between the drivers and the plugin. 823147Sxc151355 * 833147Sxc151355 * Field definitions: 843147Sxc151355 * 853147Sxc151355 * wd_opts Currently set to 0. If new features require the 863147Sxc151355 * introduction of new wifi_data_t fields, then the 873147Sxc151355 * presence of those fields must be indicated to the 883147Sxc151355 * plugin via wd_opts flags. This allows the drivers 893147Sxc151355 * and the plugin to evolve independently. 903147Sxc151355 * 913147Sxc151355 * wd_bssid Current associated BSSID (or IBSSID), used when 923147Sxc151355 * generating data packet headers for transmission. 933147Sxc151355 * 943147Sxc151355 * wd_opmode Current operation mode; any ieee80211_opmode is 953147Sxc151355 * supported. 963147Sxc151355 * 973147Sxc151355 * wd_secalloc Current allocation policy for security-related 983147Sxc151355 * WiFi headers, used when generating packets for 993147Sxc151355 * transmission. The plugin will allocate header 1003147Sxc151355 * space for the security portion, and fill in any 1013147Sxc151355 * fixed-contents fields. 1023147Sxc151355 */ 1033147Sxc151355 typedef struct wifi_data { 1043147Sxc151355 uint_t wd_opts; 1053147Sxc151355 uint8_t wd_bssid[IEEE80211_ADDR_LEN]; 1063147Sxc151355 enum ieee80211_opmode wd_opmode; 1073147Sxc151355 enum wifi_secmode wd_secalloc; 1083147Sxc151355 } wifi_data_t; 1093147Sxc151355 1103147Sxc151355 extern uint8_t wifi_bcastaddr[]; 1113147Sxc151355 1123147Sxc151355 #endif /* _KERNEL */ 1133147Sxc151355 1143147Sxc151355 #ifdef __cplusplus 1153147Sxc151355 } 1163147Sxc151355 #endif 1173147Sxc151355 1183147Sxc151355 #endif /* _SYS_MAC_WIFI_H */ 119