wlan_bssdef.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. ******************************************************************************/
  26. #ifndef __WLAN_BSSDEF_H__
  27. #define __WLAN_BSSDEF_H__
  28. #define MAX_IE_SZ 768
  29. #define NDIS_802_11_LENGTH_SSID 32
  30. #define NDIS_802_11_LENGTH_RATES 8
  31. #define NDIS_802_11_LENGTH_RATES_EX 16
  32. struct ndis_802_11_ssid {
  33. u32 SsidLength;
  34. u8 Ssid[32];
  35. };
  36. enum NDIS_802_11_NETWORK_TYPE {
  37. Ndis802_11FH,
  38. Ndis802_11DS,
  39. Ndis802_11OFDM5,
  40. Ndis802_11OFDM24,
  41. Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound*/
  42. };
  43. struct NDIS_802_11_CONFIGURATION_FH {
  44. u32 Length; /* Length of structure */
  45. u32 HopPattern; /* As defined by 802.11, MSB set */
  46. u32 HopSet; /* to one if non-802.11 */
  47. u32 DwellTime; /* units are Kusec */
  48. };
  49. /*
  50. FW will only save the channel number in DSConfig.
  51. ODI Handler will convert the channel number to freq. number.
  52. */
  53. struct NDIS_802_11_CONFIGURATION {
  54. u32 Length; /* Length of structure */
  55. u32 BeaconPeriod; /* units are Kusec */
  56. u32 ATIMWindow; /* units are Kusec */
  57. u32 DSConfig; /* Frequency, units are kHz */
  58. struct NDIS_802_11_CONFIGURATION_FH FHConfig;
  59. };
  60. enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
  61. Ndis802_11IBSS,
  62. Ndis802_11Infrastructure,
  63. Ndis802_11AutoUnknown,
  64. Ndis802_11InfrastructureMax, /*Not a real value,defined as upper bound*/
  65. Ndis802_11APMode
  66. };
  67. struct NDIS_802_11_FIXED_IEs {
  68. u8 Timestamp[8];
  69. u16 BeaconInterval;
  70. u16 Capabilities;
  71. };
  72. struct wlan_bssid_ex {
  73. u32 Length;
  74. unsigned char MacAddress[6];
  75. u8 Reserved[2];
  76. struct ndis_802_11_ssid Ssid;
  77. u32 Privacy;
  78. s32 Rssi;
  79. enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
  80. struct NDIS_802_11_CONFIGURATION Configuration;
  81. enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
  82. u8 rates[NDIS_802_11_LENGTH_RATES_EX];
  83. /* number of content bytes in EIs, which varies */
  84. u32 IELength;
  85. /*(timestamp, beacon interval, and capability information) */
  86. u8 IEs[MAX_IE_SZ];
  87. };
  88. enum NDIS_802_11_AUTHENTICATION_MODE {
  89. Ndis802_11AuthModeOpen,
  90. Ndis802_11AuthModeShared,
  91. Ndis802_11AuthModeAutoSwitch,
  92. Ndis802_11AuthModeWPA,
  93. Ndis802_11AuthModeWPAPSK,
  94. Ndis802_11AuthModeWPANone,
  95. Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
  96. };
  97. enum {
  98. Ndis802_11WEPEnabled,
  99. Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
  100. Ndis802_11WEPDisabled,
  101. Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
  102. Ndis802_11WEPKeyAbsent,
  103. Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
  104. Ndis802_11WEPNotSupported,
  105. Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
  106. Ndis802_11Encryption2Enabled,
  107. Ndis802_11Encryption2KeyAbsent,
  108. Ndis802_11Encryption3Enabled,
  109. Ndis802_11Encryption3KeyAbsent
  110. };
  111. #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
  112. #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
  113. #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
  114. #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
  115. #define NDIS_802_11_AI_RESFI_STATUSCODE 2
  116. #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
  117. struct NDIS_802_11_AI_REQFI {
  118. u16 Capabilities;
  119. u16 ListenInterval;
  120. unsigned char CurrentAPAddress[6];
  121. };
  122. struct NDIS_802_11_AI_RESFI {
  123. u16 Capabilities;
  124. u16 StatusCode;
  125. u16 AssociationId;
  126. };
  127. struct NDIS_802_11_ASSOCIATION_INFORMATION {
  128. u32 Length;
  129. u16 AvailableRequestFixedIEs;
  130. struct NDIS_802_11_AI_REQFI RequestFixedIEs;
  131. u32 RequestIELength;
  132. u32 OffsetRequestIEs;
  133. u16 AvailableResponseFixedIEs;
  134. struct NDIS_802_11_AI_RESFI ResponseFixedIEs;
  135. u32 ResponseIELength;
  136. u32 OffsetResponseIEs;
  137. };
  138. /* Key mapping keys require a BSSID*/
  139. struct NDIS_802_11_KEY {
  140. u32 Length; /* Length of this structure */
  141. u32 KeyIndex;
  142. u32 KeyLength; /* length of key in bytes */
  143. unsigned char BSSID[6];
  144. unsigned long long KeyRSC;
  145. u8 KeyMaterial[32]; /* variable length */
  146. };
  147. struct NDIS_802_11_REMOVE_KEY {
  148. u32 Length; /* Length of this structure */
  149. u32 KeyIndex;
  150. unsigned char BSSID[6];
  151. };
  152. struct NDIS_802_11_WEP {
  153. u32 Length; /* Length of this structure */
  154. u32 KeyIndex; /* 0 is the per-client key,
  155. * 1-N are the global keys */
  156. u32 KeyLength; /* length of key in bytes */
  157. u8 KeyMaterial[16]; /* variable length depending on above field */
  158. };
  159. /* mask for authentication/integrity fields */
  160. #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
  161. #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
  162. #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
  163. #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
  164. #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
  165. /* MIC check time, 60 seconds. */
  166. #define MIC_CHECK_TIME 60000000
  167. #ifndef Ndis802_11APMode
  168. #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
  169. #endif
  170. struct wlan_network {
  171. struct list_head list;
  172. int network_type; /*refer to ieee80211.h for WIRELESS_11A/B/G */
  173. int fixed; /* set to fixed when not to be removed asi
  174. * site-surveying */
  175. unsigned int last_scanned; /*timestamp for the network */
  176. int aid; /*will only be valid when a BSS is joined. */
  177. int join_res;
  178. struct wlan_bssid_ex network; /*must be the last item */
  179. };
  180. enum VRTL_CARRIER_SENSE {
  181. DISABLE_VCS,
  182. ENABLE_VCS,
  183. AUTO_VCS
  184. };
  185. enum VCS_TYPE {
  186. NONE_VCS,
  187. RTS_CTS,
  188. CTS_TO_SELF
  189. };
  190. #define PWR_CAM 0
  191. #define PWR_MINPS 1
  192. #define PWR_MAXPS 2
  193. #define PWR_UAPSD 3
  194. #define PWR_VOIP 4
  195. enum UAPSD_MAX_SP {
  196. NO_LIMIT,
  197. TWO_MSDU,
  198. FOUR_MSDU,
  199. SIX_MSDU
  200. };
  201. #define NUM_PRE_AUTH_KEY 16
  202. #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
  203. #endif /* #ifndef WLAN_BSSDEF_H_ */