Ali Bahar | cf3e688 | 2011-09-04 03:14:04 +0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of version 2 of the GNU General Public License as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
| 17 | * |
| 18 | * Modifications for inclusion into the Linux staging tree are |
| 19 | * Copyright(c) 2010 Larry Finger. All rights reserved. |
| 20 | * |
| 21 | * Contact information: |
| 22 | * WLAN FAE <wlanfae@realtek.com> |
| 23 | * Larry Finger <Larry.Finger@lwfinger.net> |
| 24 | * |
| 25 | ******************************************************************************/ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 26 | #ifndef __WLAN_BSSDEF_H__ |
| 27 | #define __WLAN_BSSDEF_H__ |
| 28 | |
| 29 | #define MAX_IE_SZ 768 |
| 30 | |
| 31 | #define NDIS_802_11_LENGTH_SSID 32 |
| 32 | #define NDIS_802_11_LENGTH_RATES 8 |
| 33 | #define NDIS_802_11_LENGTH_RATES_EX 16 |
| 34 | |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 35 | struct ndis_802_11_ssid { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 36 | u32 SsidLength; |
| 37 | u8 Ssid[32]; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | enum NDIS_802_11_NETWORK_TYPE { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 41 | Ndis802_11FH, |
| 42 | Ndis802_11DS, |
| 43 | Ndis802_11OFDM5, |
| 44 | Ndis802_11OFDM24, |
| 45 | Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound*/ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | struct NDIS_802_11_CONFIGURATION_FH { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 49 | u32 Length; /* Length of structure */ |
| 50 | u32 HopPattern; /* As defined by 802.11, MSB set */ |
| 51 | u32 HopSet; /* to one if non-802.11 */ |
| 52 | u32 DwellTime; /* units are Kusec */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | /* |
| 56 | FW will only save the channel number in DSConfig. |
| 57 | ODI Handler will convert the channel number to freq. number. |
| 58 | */ |
| 59 | struct NDIS_802_11_CONFIGURATION { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 60 | u32 Length; /* Length of structure */ |
| 61 | u32 BeaconPeriod; /* units are Kusec */ |
| 62 | u32 ATIMWindow; /* units are Kusec */ |
| 63 | u32 DSConfig; /* Frequency, units are kHz */ |
| 64 | struct NDIS_802_11_CONFIGURATION_FH FHConfig; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | enum NDIS_802_11_NETWORK_INFRASTRUCTURE { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 68 | Ndis802_11IBSS, |
| 69 | Ndis802_11Infrastructure, |
| 70 | Ndis802_11AutoUnknown, |
| 71 | Ndis802_11InfrastructureMax, /*Not a real value,defined as upper bound*/ |
| 72 | Ndis802_11APMode |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | struct NDIS_802_11_FIXED_IEs { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 76 | u8 Timestamp[8]; |
| 77 | u16 BeaconInterval; |
| 78 | u16 Capabilities; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 79 | }; |
| 80 | |
Joshua Clayton | 4436787 | 2015-08-05 17:17:18 -0700 | [diff] [blame] | 81 | struct wlan_bssid_ex { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 82 | u32 Length; |
| 83 | unsigned char MacAddress[6]; |
| 84 | u8 Reserved[2]; |
| 85 | struct ndis_802_11_ssid Ssid; |
| 86 | u32 Privacy; |
| 87 | s32 Rssi; |
| 88 | enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; |
| 89 | struct NDIS_802_11_CONFIGURATION Configuration; |
| 90 | enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; |
Joshua Clayton | 7fb539e | 2015-08-05 17:17:21 -0700 | [diff] [blame] | 91 | u8 rates[NDIS_802_11_LENGTH_RATES_EX]; |
Joshua Clayton | 9bdb70e | 2015-08-05 17:17:16 -0700 | [diff] [blame] | 92 | /* number of content bytes in EIs, which varies */ |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 93 | u32 IELength; |
| 94 | /*(timestamp, beacon interval, and capability information) */ |
| 95 | u8 IEs[MAX_IE_SZ]; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 96 | }; |
| 97 | |
| 98 | enum NDIS_802_11_AUTHENTICATION_MODE { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 99 | Ndis802_11AuthModeOpen, |
| 100 | Ndis802_11AuthModeShared, |
| 101 | Ndis802_11AuthModeAutoSwitch, |
| 102 | Ndis802_11AuthModeWPA, |
| 103 | Ndis802_11AuthModeWPAPSK, |
| 104 | Ndis802_11AuthModeWPANone, |
| 105 | Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 106 | }; |
| 107 | |
| 108 | enum { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 109 | Ndis802_11WEPEnabled, |
| 110 | Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, |
| 111 | Ndis802_11WEPDisabled, |
| 112 | Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, |
| 113 | Ndis802_11WEPKeyAbsent, |
| 114 | Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, |
| 115 | Ndis802_11WEPNotSupported, |
| 116 | Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, |
| 117 | Ndis802_11Encryption2Enabled, |
| 118 | Ndis802_11Encryption2KeyAbsent, |
| 119 | Ndis802_11Encryption3Enabled, |
| 120 | Ndis802_11Encryption3KeyAbsent |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 121 | }; |
| 122 | |
| 123 | #define NDIS_802_11_AI_REQFI_CAPABILITIES 1 |
| 124 | #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2 |
| 125 | #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4 |
| 126 | |
| 127 | #define NDIS_802_11_AI_RESFI_CAPABILITIES 1 |
| 128 | #define NDIS_802_11_AI_RESFI_STATUSCODE 2 |
| 129 | #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4 |
| 130 | |
| 131 | struct NDIS_802_11_AI_REQFI { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 132 | u16 Capabilities; |
| 133 | u16 ListenInterval; |
| 134 | unsigned char CurrentAPAddress[6]; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 135 | }; |
| 136 | |
| 137 | struct NDIS_802_11_AI_RESFI { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 138 | u16 Capabilities; |
| 139 | u16 StatusCode; |
| 140 | u16 AssociationId; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 141 | }; |
| 142 | |
| 143 | struct NDIS_802_11_ASSOCIATION_INFORMATION { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 144 | u32 Length; |
| 145 | u16 AvailableRequestFixedIEs; |
| 146 | struct NDIS_802_11_AI_REQFI RequestFixedIEs; |
| 147 | u32 RequestIELength; |
| 148 | u32 OffsetRequestIEs; |
| 149 | u16 AvailableResponseFixedIEs; |
| 150 | struct NDIS_802_11_AI_RESFI ResponseFixedIEs; |
| 151 | u32 ResponseIELength; |
| 152 | u32 OffsetResponseIEs; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 153 | }; |
| 154 | |
| 155 | /* Key mapping keys require a BSSID*/ |
| 156 | struct NDIS_802_11_KEY { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 157 | u32 Length; /* Length of this structure */ |
| 158 | u32 KeyIndex; |
| 159 | u32 KeyLength; /* length of key in bytes */ |
| 160 | unsigned char BSSID[6]; |
| 161 | unsigned long long KeyRSC; |
| 162 | u8 KeyMaterial[32]; /* variable length */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 163 | }; |
| 164 | |
| 165 | struct NDIS_802_11_REMOVE_KEY { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 166 | u32 Length; /* Length of this structure */ |
| 167 | u32 KeyIndex; |
| 168 | unsigned char BSSID[6]; |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | struct NDIS_802_11_WEP { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 172 | u32 Length; /* Length of this structure */ |
| 173 | u32 KeyIndex; /* 0 is the per-client key, |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 174 | * 1-N are the global keys |
| 175 | */ |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 176 | u32 KeyLength; /* length of key in bytes */ |
| 177 | u8 KeyMaterial[16]; /* variable length depending on above field */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | /* mask for authentication/integrity fields */ |
| 181 | #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f |
| 182 | #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01 |
| 183 | #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02 |
| 184 | #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06 |
| 185 | #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E |
| 186 | |
| 187 | /* MIC check time, 60 seconds. */ |
| 188 | #define MIC_CHECK_TIME 60000000 |
| 189 | |
| 190 | #ifndef Ndis802_11APMode |
| 191 | #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) |
| 192 | #endif |
| 193 | |
| 194 | struct wlan_network { |
| 195 | struct list_head list; |
| 196 | int network_type; /*refer to ieee80211.h for WIRELESS_11A/B/G */ |
| 197 | int fixed; /* set to fixed when not to be removed asi |
Raphaël Beamonte | bef611a | 2016-09-09 11:31:45 -0400 | [diff] [blame] | 198 | * site-surveying |
| 199 | */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 200 | unsigned int last_scanned; /*timestamp for the network */ |
| 201 | int aid; /*will only be valid when a BSS is joined. */ |
| 202 | int join_res; |
Joshua Clayton | 4436787 | 2015-08-05 17:17:18 -0700 | [diff] [blame] | 203 | struct wlan_bssid_ex network; /*must be the last item */ |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 204 | }; |
| 205 | |
| 206 | enum VRTL_CARRIER_SENSE { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 207 | DISABLE_VCS, |
| 208 | ENABLE_VCS, |
| 209 | AUTO_VCS |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 210 | }; |
| 211 | |
| 212 | enum VCS_TYPE { |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 213 | NONE_VCS, |
| 214 | RTS_CTS, |
| 215 | CTS_TO_SELF |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | #define PWR_CAM 0 |
| 219 | #define PWR_MINPS 1 |
| 220 | #define PWR_MAXPS 2 |
| 221 | #define PWR_UAPSD 3 |
| 222 | #define PWR_VOIP 4 |
| 223 | |
| 224 | enum UAPSD_MAX_SP { |
| 225 | NO_LIMIT, |
Javier M. Mellid | 0593758 | 2011-04-02 03:01:49 +0200 | [diff] [blame] | 226 | TWO_MSDU, |
| 227 | FOUR_MSDU, |
| 228 | SIX_MSDU |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 229 | }; |
| 230 | |
| 231 | #define NUM_PRE_AUTH_KEY 16 |
| 232 | #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY |
| 233 | |
Larry Finger | 2865d42c | 2010-08-20 10:15:30 -0500 | [diff] [blame] | 234 | #endif /* #ifndef WLAN_BSSDEF_H_ */ |
| 235 | |