/drivers/staging/rtl8712/wlan_bssdef.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 242 lines · 183 code · 33 blank · 26 comment · 0 complexity · 0524999baecc3dbef61772cfbe3ef6bf MD5 · raw file

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