wlan_bssdef.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 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. *
  19. ******************************************************************************/
  20. #ifndef __WLAN_BSSDEF_H__
  21. #define __WLAN_BSSDEF_H__
  22. #define MAX_IE_SZ 768
  23. #ifdef PLATFORM_LINUX
  24. #define NDIS_802_11_LENGTH_SSID 32
  25. #define NDIS_802_11_LENGTH_RATES 8
  26. #define NDIS_802_11_LENGTH_RATES_EX 16
  27. typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
  28. typedef long NDIS_802_11_RSSI; // in dBm
  29. typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates
  30. typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates
  31. typedef ULONG NDIS_802_11_KEY_INDEX;
  32. typedef unsigned long long NDIS_802_11_KEY_RSC;
  33. typedef struct _NDIS_802_11_SSID
  34. {
  35. ULONG SsidLength;
  36. UCHAR Ssid[32];
  37. } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
  38. typedef enum _NDIS_802_11_NETWORK_TYPE
  39. {
  40. Ndis802_11FH,
  41. Ndis802_11DS,
  42. Ndis802_11OFDM5,
  43. Ndis802_11OFDM24,
  44. Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound
  45. } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
  46. typedef struct _NDIS_802_11_CONFIGURATION_FH
  47. {
  48. ULONG Length; // Length of structure
  49. ULONG HopPattern; // As defined by 802.11, MSB set
  50. ULONG HopSet; // to one if non-802.11
  51. ULONG DwellTime; // units are Kusec
  52. } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
  53. /*
  54. FW will only save the channel number in DSConfig.
  55. ODI Handler will convert the channel number to freq. number.
  56. */
  57. typedef struct _NDIS_802_11_CONFIGURATION
  58. {
  59. ULONG Length; // Length of structure
  60. ULONG BeaconPeriod; // units are Kusec
  61. ULONG ATIMWindow; // units are Kusec
  62. ULONG DSConfig; // Frequency, units are kHz
  63. NDIS_802_11_CONFIGURATION_FH FHConfig;
  64. } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
  65. typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
  66. {
  67. Ndis802_11IBSS,
  68. Ndis802_11Infrastructure,
  69. Ndis802_11AutoUnknown,
  70. Ndis802_11InfrastructureMax, // Not a real value, defined as upper bound
  71. Ndis802_11APMode
  72. } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
  73. typedef struct _NDIS_802_11_FIXED_IEs
  74. {
  75. UCHAR Timestamp[8];
  76. USHORT BeaconInterval;
  77. USHORT Capabilities;
  78. } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
  79. typedef struct _NDIS_802_11_VARIABLE_IEs
  80. {
  81. UCHAR ElementID;
  82. UCHAR Length;
  83. UCHAR data[1];
  84. } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
  85. /*
  86. Length is the 4 bytes multiples of the sume of
  87. sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG)
  88. + sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION)
  89. + sizeof (NDIS_802_11_RATES_EX) + IELength
  90. Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the
  91. partial sum.
  92. */
  93. #if 0
  94. typedef struct _NDIS_WLAN_BSSID_EX
  95. {
  96. ULONG Length;
  97. NDIS_802_11_MAC_ADDRESS MacAddress;
  98. UCHAR Reserved[2];//[0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity;
  99. NDIS_802_11_SSID Ssid;
  100. ULONG Privacy;
  101. NDIS_802_11_RSSI Rssi;
  102. NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
  103. NDIS_802_11_CONFIGURATION Configuration;
  104. NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
  105. NDIS_802_11_RATES_EX SupportedRates;
  106. ULONG IELength;
  107. UCHAR IEs[MAX_IE_SZ]; //(timestamp, beacon interval, and capability information)
  108. } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
  109. typedef struct _NDIS_802_11_BSSID_LIST_EX
  110. {
  111. ULONG NumberOfItems;
  112. NDIS_WLAN_BSSID_EX Bssid[1];
  113. } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
  114. #endif
  115. typedef enum _NDIS_802_11_AUTHENTICATION_MODE
  116. {
  117. Ndis802_11AuthModeOpen,
  118. Ndis802_11AuthModeShared,
  119. Ndis802_11AuthModeAutoSwitch,
  120. Ndis802_11AuthModeWPA,
  121. Ndis802_11AuthModeWPAPSK,
  122. Ndis802_11AuthModeWPANone,
  123. Ndis802_11AuthModeWAPI,
  124. Ndis802_11AuthModeMax // Not a real mode, defined as upper bound
  125. } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
  126. typedef enum _NDIS_802_11_WEP_STATUS
  127. {
  128. Ndis802_11WEPEnabled,
  129. Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
  130. Ndis802_11WEPDisabled,
  131. Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
  132. Ndis802_11WEPKeyAbsent,
  133. Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
  134. Ndis802_11WEPNotSupported,
  135. Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
  136. Ndis802_11Encryption2Enabled,
  137. Ndis802_11Encryption2KeyAbsent,
  138. Ndis802_11Encryption3Enabled,
  139. Ndis802_11Encryption3KeyAbsent,
  140. Ndis802_11_EncrypteionWAPI
  141. } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
  142. NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
  143. #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
  144. #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
  145. #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
  146. #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
  147. #define NDIS_802_11_AI_RESFI_STATUSCODE 2
  148. #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
  149. typedef struct _NDIS_802_11_AI_REQFI
  150. {
  151. USHORT Capabilities;
  152. USHORT ListenInterval;
  153. NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
  154. } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
  155. typedef struct _NDIS_802_11_AI_RESFI
  156. {
  157. USHORT Capabilities;
  158. USHORT StatusCode;
  159. USHORT AssociationId;
  160. } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
  161. typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
  162. {
  163. ULONG Length;
  164. USHORT AvailableRequestFixedIEs;
  165. NDIS_802_11_AI_REQFI RequestFixedIEs;
  166. ULONG RequestIELength;
  167. ULONG OffsetRequestIEs;
  168. USHORT AvailableResponseFixedIEs;
  169. NDIS_802_11_AI_RESFI ResponseFixedIEs;
  170. ULONG ResponseIELength;
  171. ULONG OffsetResponseIEs;
  172. } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
  173. typedef enum _NDIS_802_11_RELOAD_DEFAULTS
  174. {
  175. Ndis802_11ReloadWEPKeys
  176. } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
  177. // Key mapping keys require a BSSID
  178. typedef struct _NDIS_802_11_KEY
  179. {
  180. ULONG Length; // Length of this structure
  181. ULONG KeyIndex;
  182. ULONG KeyLength; // length of key in bytes
  183. NDIS_802_11_MAC_ADDRESS BSSID;
  184. NDIS_802_11_KEY_RSC KeyRSC;
  185. UCHAR KeyMaterial[32]; // variable length depending on above field
  186. } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
  187. typedef struct _NDIS_802_11_REMOVE_KEY
  188. {
  189. ULONG Length; // Length of this structure
  190. ULONG KeyIndex;
  191. NDIS_802_11_MAC_ADDRESS BSSID;
  192. } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
  193. typedef struct _NDIS_802_11_WEP
  194. {
  195. ULONG Length; // Length of this structure
  196. ULONG KeyIndex; // 0 is the per-client key, 1-N are the global keys
  197. ULONG KeyLength; // length of key in bytes
  198. UCHAR KeyMaterial[16];// variable length depending on above field
  199. } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
  200. typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
  201. {
  202. ULONG Length; // Length of structure
  203. NDIS_802_11_MAC_ADDRESS Bssid;
  204. ULONG Flags;
  205. } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
  206. typedef enum _NDIS_802_11_STATUS_TYPE
  207. {
  208. Ndis802_11StatusType_Authentication,
  209. Ndis802_11StatusType_MediaStreamMode,
  210. Ndis802_11StatusType_PMKID_CandidateList,
  211. Ndis802_11StatusTypeMax // not a real type, defined as an upper bound
  212. } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
  213. typedef struct _NDIS_802_11_STATUS_INDICATION
  214. {
  215. NDIS_802_11_STATUS_TYPE StatusType;
  216. } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
  217. // mask for authentication/integrity fields
  218. #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
  219. #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
  220. #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
  221. #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
  222. #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
  223. // MIC check time, 60 seconds.
  224. #define MIC_CHECK_TIME 60000000
  225. typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
  226. {
  227. NDIS_802_11_STATUS_INDICATION Status;
  228. NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
  229. } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
  230. typedef struct _NDIS_802_11_TEST
  231. {
  232. ULONG Length;
  233. ULONG Type;
  234. union
  235. {
  236. NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
  237. NDIS_802_11_RSSI RssiTrigger;
  238. }tt;
  239. } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
  240. #endif //end of #ifdef PLATFORM_LINUX
  241. #ifdef PLATFORM_FREEBSD
  242. #define NDIS_802_11_LENGTH_SSID 32
  243. #define NDIS_802_11_LENGTH_RATES 8
  244. #define NDIS_802_11_LENGTH_RATES_EX 16
  245. typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
  246. typedef long NDIS_802_11_RSSI; // in dBm
  247. typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates
  248. typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates
  249. typedef ULONG NDIS_802_11_KEY_INDEX;
  250. typedef unsigned long long NDIS_802_11_KEY_RSC;
  251. typedef struct _NDIS_802_11_SSID
  252. {
  253. ULONG SsidLength;
  254. UCHAR Ssid[32];
  255. } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
  256. typedef enum _NDIS_802_11_NETWORK_TYPE
  257. {
  258. Ndis802_11FH,
  259. Ndis802_11DS,
  260. Ndis802_11OFDM5,
  261. Ndis802_11OFDM24,
  262. Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound
  263. } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
  264. typedef struct _NDIS_802_11_CONFIGURATION_FH
  265. {
  266. ULONG Length; // Length of structure
  267. ULONG HopPattern; // As defined by 802.11, MSB set
  268. ULONG HopSet; // to one if non-802.11
  269. ULONG DwellTime; // units are Kusec
  270. } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
  271. /*
  272. FW will only save the channel number in DSConfig.
  273. ODI Handler will convert the channel number to freq. number.
  274. */
  275. typedef struct _NDIS_802_11_CONFIGURATION
  276. {
  277. ULONG Length; // Length of structure
  278. ULONG BeaconPeriod; // units are Kusec
  279. ULONG ATIMWindow; // units are Kusec
  280. ULONG DSConfig; // Frequency, units are kHz
  281. NDIS_802_11_CONFIGURATION_FH FHConfig;
  282. } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
  283. typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
  284. {
  285. Ndis802_11IBSS,
  286. Ndis802_11Infrastructure,
  287. Ndis802_11AutoUnknown,
  288. Ndis802_11InfrastructureMax, // Not a real value, defined as upper bound
  289. Ndis802_11APMode
  290. } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
  291. typedef struct _NDIS_802_11_FIXED_IEs
  292. {
  293. UCHAR Timestamp[8];
  294. USHORT BeaconInterval;
  295. USHORT Capabilities;
  296. } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
  297. typedef struct _NDIS_802_11_VARIABLE_IEs
  298. {
  299. UCHAR ElementID;
  300. UCHAR Length;
  301. UCHAR data[1];
  302. } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
  303. /*
  304. Length is the 4 bytes multiples of the sume of
  305. sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG)
  306. + sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION)
  307. + sizeof (NDIS_802_11_RATES_EX) + IELength
  308. Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the
  309. partial sum.
  310. */
  311. #if 0
  312. typedef struct _NDIS_WLAN_BSSID_EX
  313. {
  314. ULONG Length;
  315. NDIS_802_11_MAC_ADDRESS MacAddress;
  316. UCHAR Reserved[2];//[0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity;
  317. NDIS_802_11_SSID Ssid;
  318. ULONG Privacy;
  319. NDIS_802_11_RSSI Rssi;
  320. NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
  321. NDIS_802_11_CONFIGURATION Configuration;
  322. NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
  323. NDIS_802_11_RATES_EX SupportedRates;
  324. ULONG IELength;
  325. UCHAR IEs[MAX_IE_SZ]; //(timestamp, beacon interval, and capability information)
  326. } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
  327. typedef struct _NDIS_802_11_BSSID_LIST_EX
  328. {
  329. ULONG NumberOfItems;
  330. NDIS_WLAN_BSSID_EX Bssid[1];
  331. } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
  332. #endif
  333. typedef enum _NDIS_802_11_AUTHENTICATION_MODE
  334. {
  335. Ndis802_11AuthModeOpen,
  336. Ndis802_11AuthModeShared,
  337. Ndis802_11AuthModeAutoSwitch,
  338. Ndis802_11AuthModeWPA,
  339. Ndis802_11AuthModeWPAPSK,
  340. Ndis802_11AuthModeWPANone,
  341. Ndis802_11AuthModeMax // Not a real mode, defined as upper bound
  342. } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
  343. typedef enum _NDIS_802_11_WEP_STATUS
  344. {
  345. Ndis802_11WEPEnabled,
  346. Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
  347. Ndis802_11WEPDisabled,
  348. Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
  349. Ndis802_11WEPKeyAbsent,
  350. Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
  351. Ndis802_11WEPNotSupported,
  352. Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
  353. Ndis802_11Encryption2Enabled,
  354. Ndis802_11Encryption2KeyAbsent,
  355. Ndis802_11Encryption3Enabled,
  356. Ndis802_11Encryption3KeyAbsent
  357. } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
  358. NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
  359. #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
  360. #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
  361. #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
  362. #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
  363. #define NDIS_802_11_AI_RESFI_STATUSCODE 2
  364. #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
  365. typedef struct _NDIS_802_11_AI_REQFI
  366. {
  367. USHORT Capabilities;
  368. USHORT ListenInterval;
  369. NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
  370. } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
  371. typedef struct _NDIS_802_11_AI_RESFI
  372. {
  373. USHORT Capabilities;
  374. USHORT StatusCode;
  375. USHORT AssociationId;
  376. } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
  377. typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
  378. {
  379. ULONG Length;
  380. USHORT AvailableRequestFixedIEs;
  381. NDIS_802_11_AI_REQFI RequestFixedIEs;
  382. ULONG RequestIELength;
  383. ULONG OffsetRequestIEs;
  384. USHORT AvailableResponseFixedIEs;
  385. NDIS_802_11_AI_RESFI ResponseFixedIEs;
  386. ULONG ResponseIELength;
  387. ULONG OffsetResponseIEs;
  388. } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
  389. typedef enum _NDIS_802_11_RELOAD_DEFAULTS
  390. {
  391. Ndis802_11ReloadWEPKeys
  392. } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
  393. // Key mapping keys require a BSSID
  394. typedef struct _NDIS_802_11_KEY
  395. {
  396. ULONG Length; // Length of this structure
  397. ULONG KeyIndex;
  398. ULONG KeyLength; // length of key in bytes
  399. NDIS_802_11_MAC_ADDRESS BSSID;
  400. NDIS_802_11_KEY_RSC KeyRSC;
  401. UCHAR KeyMaterial[32]; // variable length depending on above field
  402. } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
  403. typedef struct _NDIS_802_11_REMOVE_KEY
  404. {
  405. ULONG Length; // Length of this structure
  406. ULONG KeyIndex;
  407. NDIS_802_11_MAC_ADDRESS BSSID;
  408. } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
  409. typedef struct _NDIS_802_11_WEP
  410. {
  411. ULONG Length; // Length of this structure
  412. ULONG KeyIndex; // 0 is the per-client key, 1-N are the global keys
  413. ULONG KeyLength; // length of key in bytes
  414. UCHAR KeyMaterial[16];// variable length depending on above field
  415. } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
  416. typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
  417. {
  418. ULONG Length; // Length of structure
  419. NDIS_802_11_MAC_ADDRESS Bssid;
  420. ULONG Flags;
  421. } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
  422. typedef enum _NDIS_802_11_STATUS_TYPE
  423. {
  424. Ndis802_11StatusType_Authentication,
  425. Ndis802_11StatusType_MediaStreamMode,
  426. Ndis802_11StatusType_PMKID_CandidateList,
  427. Ndis802_11StatusTypeMax // not a real type, defined as an upper bound
  428. } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
  429. typedef struct _NDIS_802_11_STATUS_INDICATION
  430. {
  431. NDIS_802_11_STATUS_TYPE StatusType;
  432. } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
  433. // mask for authentication/integrity fields
  434. #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
  435. #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
  436. #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
  437. #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
  438. #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
  439. // MIC check time, 60 seconds.
  440. #define MIC_CHECK_TIME 60000000
  441. typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
  442. {
  443. NDIS_802_11_STATUS_INDICATION Status;
  444. NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
  445. } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
  446. typedef struct _NDIS_802_11_TEST
  447. {
  448. ULONG Length;
  449. ULONG Type;
  450. union
  451. {
  452. NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
  453. NDIS_802_11_RSSI RssiTrigger;
  454. }tt;
  455. } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
  456. #endif //PLATFORM_FREEBSD
  457. #ifndef Ndis802_11APMode
  458. #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
  459. #endif
  460. typedef struct _WLAN_PHY_INFO
  461. {
  462. u8 SignalStrength;//(in percentage)
  463. u8 SignalQuality;//(in percentage)
  464. u8 Optimum_antenna; //for Antenna diversity
  465. u8 Reserved_0;
  466. }WLAN_PHY_INFO,*PWLAN_PHY_INFO;
  467. typedef struct _WLAN_BCN_INFO
  468. {
  469. /* these infor get from rtw_get_encrypt_info when
  470. * * translate scan to UI */
  471. u8 encryp_protocol;//ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2/WAPI
  472. int group_cipher; //WPA/WPA2 group cipher
  473. int pairwise_cipher;////WPA/WPA2/WEP pairwise cipher
  474. int is_8021x;
  475. /* bwmode 20/40 and ch_offset UP/LOW */
  476. unsigned short ht_cap_info;
  477. unsigned char ht_info_infos_0;
  478. }WLAN_BCN_INFO,*PWLAN_BCN_INFO;
  479. /* temporally add #pragma pack for structure alignment issue of
  480. * WLAN_BSSID_EX and get_WLAN_BSSID_EX_sz()
  481. */
  482. #ifdef PLATFORM_WINDOWS
  483. #pragma pack(push)
  484. #pragma pack(1)
  485. #endif
  486. typedef struct _WLAN_BSSID_EX
  487. {
  488. ULONG Length;
  489. NDIS_802_11_MAC_ADDRESS MacAddress;
  490. UCHAR Reserved[2];//[0]: IS beacon frame
  491. NDIS_802_11_SSID Ssid;
  492. ULONG Privacy;
  493. NDIS_802_11_RSSI Rssi;//(in dBM,raw data ,get from PHY)
  494. NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
  495. NDIS_802_11_CONFIGURATION Configuration;
  496. NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
  497. NDIS_802_11_RATES_EX SupportedRates;
  498. WLAN_PHY_INFO PhyInfo;
  499. ULONG IELength;
  500. UCHAR IEs[MAX_IE_SZ]; //(timestamp, beacon interval, and capability information)
  501. }
  502. #ifndef PLATFORM_WINDOWS
  503. __attribute__((packed))
  504. #endif
  505. WLAN_BSSID_EX, *PWLAN_BSSID_EX;
  506. #ifdef PLATFORM_WINDOWS
  507. #pragma pack(pop)
  508. #endif
  509. __inline static uint get_WLAN_BSSID_EX_sz(WLAN_BSSID_EX *bss)
  510. {
  511. #if 0
  512. uint t_len;
  513. t_len = sizeof (ULONG)
  514. + sizeof (NDIS_802_11_MAC_ADDRESS)
  515. + 2
  516. + sizeof (NDIS_802_11_SSID)
  517. + sizeof (ULONG)
  518. + sizeof (NDIS_802_11_RSSI)
  519. + sizeof (NDIS_802_11_NETWORK_TYPE)
  520. + sizeof (NDIS_802_11_CONFIGURATION)
  521. + sizeof (NDIS_802_11_NETWORK_INFRASTRUCTURE)
  522. + sizeof (NDIS_802_11_RATES_EX)
  523. //all new member add here
  524. + sizeof(WLAN_PHY_INFO)
  525. //all new member add here
  526. + sizeof (ULONG)
  527. + bss->IELength;
  528. return t_len;
  529. #else
  530. return (sizeof(WLAN_BSSID_EX) -MAX_IE_SZ + bss->IELength);
  531. #endif
  532. }
  533. struct wlan_network {
  534. _list list;
  535. int network_type; //refer to ieee80211.h for WIRELESS_11A/B/G
  536. int fixed; // set to fixed when not to be removed as site-surveying
  537. unsigned long last_scanned; //timestamp for the network
  538. int aid; //will only be valid when a BSS is joinned.
  539. int join_res;
  540. WLAN_BSSID_EX network; //must be the last item
  541. WLAN_BCN_INFO BcnInfo;
  542. #ifdef PLATFORM_WINDOWS
  543. unsigned char iebuf[MAX_IE_SZ];
  544. #endif
  545. };
  546. enum VRTL_CARRIER_SENSE
  547. {
  548. DISABLE_VCS,
  549. ENABLE_VCS,
  550. AUTO_VCS
  551. };
  552. enum VCS_TYPE
  553. {
  554. NONE_VCS,
  555. RTS_CTS,
  556. CTS_TO_SELF
  557. };
  558. #define PWR_CAM 0
  559. #define PWR_MINPS 1
  560. #define PWR_MAXPS 2
  561. #define PWR_UAPSD 3
  562. #define PWR_VOIP 4
  563. enum UAPSD_MAX_SP
  564. {
  565. NO_LIMIT,
  566. TWO_MSDU,
  567. FOUR_MSDU,
  568. SIX_MSDU
  569. };
  570. //john
  571. #define NUM_PRE_AUTH_KEY 16
  572. #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
  573. /*
  574. * WPA2
  575. */
  576. #ifndef PLATFORM_OS_CE
  577. typedef struct _PMKID_CANDIDATE {
  578. NDIS_802_11_MAC_ADDRESS BSSID;
  579. ULONG Flags;
  580. } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
  581. typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST
  582. {
  583. ULONG Version; // Version of the structure
  584. ULONG NumCandidates; // No. of pmkid candidates
  585. PMKID_CANDIDATE CandidateList[1];
  586. } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
  587. typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION
  588. {
  589. NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
  590. NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
  591. } NDIS_802_11_AUTHENTICATION_ENCRYPTION, *PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
  592. typedef struct _NDIS_802_11_CAPABILITY
  593. {
  594. ULONG Length;
  595. ULONG Version;
  596. ULONG NoOfPMKIDs;
  597. ULONG NoOfAuthEncryptPairsSupported;
  598. NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
  599. } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
  600. #endif
  601. #endif //#ifndef WLAN_BSSDEF_H_