ieee802_11_defs.h 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  1. /*
  2. * IEEE 802.11 Frame type definitions
  3. * Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2007-2008 Intel Corporation
  5. *
  6. * This software may be distributed under the terms of the BSD license.
  7. * See README for more details.
  8. */
  9. #ifndef IEEE802_11_DEFS_H
  10. #define IEEE802_11_DEFS_H
  11. /* IEEE 802.11 defines */
  12. #define WLAN_FC_PVER 0x0003
  13. #define WLAN_FC_TODS 0x0100
  14. #define WLAN_FC_FROMDS 0x0200
  15. #define WLAN_FC_MOREFRAG 0x0400
  16. #define WLAN_FC_RETRY 0x0800
  17. #define WLAN_FC_PWRMGT 0x1000
  18. #define WLAN_FC_MOREDATA 0x2000
  19. #define WLAN_FC_ISWEP 0x4000
  20. #define WLAN_FC_ORDER 0x8000
  21. #define WLAN_FC_GET_TYPE(fc) (((fc) & 0x000c) >> 2)
  22. #define WLAN_FC_GET_STYPE(fc) (((fc) & 0x00f0) >> 4)
  23. #define WLAN_INVALID_MGMT_SEQ 0xFFFF
  24. #define WLAN_GET_SEQ_FRAG(seq) ((seq) & (BIT(3) | BIT(2) | BIT(1) | BIT(0)))
  25. #define WLAN_GET_SEQ_SEQ(seq) \
  26. (((seq) & (~(BIT(3) | BIT(2) | BIT(1) | BIT(0)))) >> 4)
  27. #define WLAN_FC_TYPE_MGMT 0
  28. #define WLAN_FC_TYPE_CTRL 1
  29. #define WLAN_FC_TYPE_DATA 2
  30. /* management */
  31. #define WLAN_FC_STYPE_ASSOC_REQ 0
  32. #define WLAN_FC_STYPE_ASSOC_RESP 1
  33. #define WLAN_FC_STYPE_REASSOC_REQ 2
  34. #define WLAN_FC_STYPE_REASSOC_RESP 3
  35. #define WLAN_FC_STYPE_PROBE_REQ 4
  36. #define WLAN_FC_STYPE_PROBE_RESP 5
  37. #define WLAN_FC_STYPE_BEACON 8
  38. #define WLAN_FC_STYPE_ATIM 9
  39. #define WLAN_FC_STYPE_DISASSOC 10
  40. #define WLAN_FC_STYPE_AUTH 11
  41. #define WLAN_FC_STYPE_DEAUTH 12
  42. #define WLAN_FC_STYPE_ACTION 13
  43. /* control */
  44. #define WLAN_FC_STYPE_PSPOLL 10
  45. #define WLAN_FC_STYPE_RTS 11
  46. #define WLAN_FC_STYPE_CTS 12
  47. #define WLAN_FC_STYPE_ACK 13
  48. #define WLAN_FC_STYPE_CFEND 14
  49. #define WLAN_FC_STYPE_CFENDACK 15
  50. /* data */
  51. #define WLAN_FC_STYPE_DATA 0
  52. #define WLAN_FC_STYPE_DATA_CFACK 1
  53. #define WLAN_FC_STYPE_DATA_CFPOLL 2
  54. #define WLAN_FC_STYPE_DATA_CFACKPOLL 3
  55. #define WLAN_FC_STYPE_NULLFUNC 4
  56. #define WLAN_FC_STYPE_CFACK 5
  57. #define WLAN_FC_STYPE_CFPOLL 6
  58. #define WLAN_FC_STYPE_CFACKPOLL 7
  59. #define WLAN_FC_STYPE_QOS_DATA 8
  60. #define WLAN_FC_STYPE_QOS_DATA_CFACK 9
  61. #define WLAN_FC_STYPE_QOS_DATA_CFPOLL 10
  62. #define WLAN_FC_STYPE_QOS_DATA_CFACKPOLL 11
  63. #define WLAN_FC_STYPE_QOS_NULL 12
  64. #define WLAN_FC_STYPE_QOS_CFPOLL 14
  65. #define WLAN_FC_STYPE_QOS_CFACKPOLL 15
  66. /* Authentication algorithms */
  67. #define WLAN_AUTH_OPEN 0
  68. #define WLAN_AUTH_SHARED_KEY 1
  69. #define WLAN_AUTH_FT 2
  70. #define WLAN_AUTH_SAE 3
  71. #define WLAN_AUTH_LEAP 128
  72. #define WLAN_AUTH_CHALLENGE_LEN 128
  73. #define WLAN_CAPABILITY_ESS BIT(0)
  74. #define WLAN_CAPABILITY_IBSS BIT(1)
  75. #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
  76. #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
  77. #define WLAN_CAPABILITY_PRIVACY BIT(4)
  78. #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
  79. #define WLAN_CAPABILITY_PBCC BIT(6)
  80. #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
  81. #define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
  82. #define WLAN_CAPABILITY_SHORT_SLOT_TIME BIT(10)
  83. #define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
  84. /* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */
  85. #define WLAN_STATUS_SUCCESS 0
  86. #define WLAN_STATUS_UNSPECIFIED_FAILURE 1
  87. #define WLAN_STATUS_TDLS_WAKEUP_ALTERNATE 2
  88. #define WLAN_STATUS_TDLS_WAKEUP_REJECT 3
  89. #define WLAN_STATUS_SECURITY_DISABLED 5
  90. #define WLAN_STATUS_UNACCEPTABLE_LIFETIME 6
  91. #define WLAN_STATUS_NOT_IN_SAME_BSS 7
  92. #define WLAN_STATUS_CAPS_UNSUPPORTED 10
  93. #define WLAN_STATUS_REASSOC_NO_ASSOC 11
  94. #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
  95. #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
  96. #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
  97. #define WLAN_STATUS_CHALLENGE_FAIL 15
  98. #define WLAN_STATUS_AUTH_TIMEOUT 16
  99. #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
  100. #define WLAN_STATUS_ASSOC_DENIED_RATES 18
  101. /* IEEE 802.11b */
  102. #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
  103. #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
  104. #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
  105. /* IEEE 802.11h */
  106. #define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
  107. #define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
  108. #define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
  109. /* IEEE 802.11g */
  110. #define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
  111. #define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 26
  112. #define WLAN_STATUS_ASSOC_DENIED_NO_HT 27
  113. #define WLAN_STATUS_R0KH_UNREACHABLE 28
  114. #define WLAN_STATUS_ASSOC_DENIED_NO_PCO 29
  115. /* IEEE 802.11w */
  116. #define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
  117. #define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
  118. #define WLAN_STATUS_UNSPECIFIED_QOS_FAILURE 32
  119. #define WLAN_STATUS_REQUEST_DECLINED 37
  120. #define WLAN_STATUS_INVALID_PARAMETERS 38
  121. /* IEEE 802.11i */
  122. #define WLAN_STATUS_INVALID_IE 40
  123. #define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
  124. #define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
  125. #define WLAN_STATUS_AKMP_NOT_VALID 43
  126. #define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
  127. #define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
  128. #define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
  129. #define WLAN_STATUS_TS_NOT_CREATED 47
  130. #define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
  131. #define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
  132. #define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
  133. #define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
  134. /* IEEE 802.11r */
  135. #define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
  136. #define WLAN_STATUS_INVALID_PMKID 53
  137. #define WLAN_STATUS_INVALID_MDIE 54
  138. #define WLAN_STATUS_INVALID_FTIE 55
  139. #define WLAN_STATUS_GAS_ADV_PROTO_NOT_SUPPORTED 59
  140. #define WLAN_STATUS_NO_OUTSTANDING_GAS_REQ 60
  141. #define WLAN_STATUS_GAS_RESP_NOT_RECEIVED 61
  142. #define WLAN_STATUS_STA_TIMED_OUT_WAITING_FOR_GAS_RESP 62
  143. #define WLAN_STATUS_GAS_RESP_LARGER_THAN_LIMIT 63
  144. #define WLAN_STATUS_REQ_REFUSED_HOME 64
  145. #define WLAN_STATUS_ADV_SRV_UNREACHABLE 65
  146. #define WLAN_STATUS_REQ_REFUSED_SSPN 67
  147. #define WLAN_STATUS_REQ_REFUSED_UNAUTH_ACCESS 68
  148. #define WLAN_STATUS_INVALID_RSNIE 72
  149. #define WLAN_STATUS_ANTI_CLOGGING_TOKEN_REQ 76
  150. #define WLAN_STATUS_FINITE_CYCLIC_GROUP_NOT_SUPPORTED 77
  151. #define WLAN_STATUS_TRANSMISSION_FAILURE 79
  152. #define WLAN_STATUS_QUERY_RESP_OUTSTANDING 95
  153. #define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104
  154. /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */
  155. #define WLAN_REASON_UNSPECIFIED 1
  156. #define WLAN_REASON_PREV_AUTH_NOT_VALID 2
  157. #define WLAN_REASON_DEAUTH_LEAVING 3
  158. #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
  159. #define WLAN_REASON_DISASSOC_AP_BUSY 5
  160. #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
  161. #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
  162. #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
  163. #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
  164. /* IEEE 802.11h */
  165. #define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
  166. #define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
  167. /* IEEE 802.11i */
  168. #define WLAN_REASON_INVALID_IE 13
  169. #define WLAN_REASON_MICHAEL_MIC_FAILURE 14
  170. #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
  171. #define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
  172. #define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
  173. #define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
  174. #define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
  175. #define WLAN_REASON_AKMP_NOT_VALID 20
  176. #define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
  177. #define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
  178. #define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
  179. #define WLAN_REASON_CIPHER_SUITE_REJECTED 24
  180. #define WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE 25
  181. #define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26
  182. /* IEEE 802.11e */
  183. #define WLAN_REASON_DISASSOC_LOW_ACK 34
  184. /* IEEE 802.11s */
  185. #define WLAN_REASON_MESH_PEERING_CANCELLED 52
  186. #define WLAN_REASON_MESH_MAX_PEERS 53
  187. #define WLAN_REASON_MESH_CONFIG_POLICY_VIOLATION 54
  188. #define WLAN_REASON_MESH_CLOSE_RCVD 55
  189. #define WLAN_REASON_MESH_MAX_RETRIES 56
  190. #define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57
  191. #define WLAN_REASON_MESH_INVALID_GTK 58
  192. #define WLAN_REASON_MESH_INCONSISTENT_PARAMS 59
  193. #define WLAN_REASON_MESH_INVALID_SECURITY_CAP 60
  194. /* Information Element IDs */
  195. #define WLAN_EID_SSID 0
  196. #define WLAN_EID_SUPP_RATES 1
  197. #define WLAN_EID_FH_PARAMS 2
  198. #define WLAN_EID_DS_PARAMS 3
  199. #define WLAN_EID_CF_PARAMS 4
  200. #define WLAN_EID_TIM 5
  201. #define WLAN_EID_IBSS_PARAMS 6
  202. #define WLAN_EID_COUNTRY 7
  203. #define WLAN_EID_BSS_LOAD 11
  204. #define WLAN_EID_CHALLENGE 16
  205. /* EIDs defined by IEEE 802.11h - START */
  206. #define WLAN_EID_PWR_CONSTRAINT 32
  207. #define WLAN_EID_PWR_CAPABILITY 33
  208. #define WLAN_EID_TPC_REQUEST 34
  209. #define WLAN_EID_TPC_REPORT 35
  210. #define WLAN_EID_SUPPORTED_CHANNELS 36
  211. #define WLAN_EID_CHANNEL_SWITCH 37
  212. #define WLAN_EID_MEASURE_REQUEST 38
  213. #define WLAN_EID_MEASURE_REPORT 39
  214. #define WLAN_EID_QUITE 40
  215. #define WLAN_EID_IBSS_DFS 41
  216. /* EIDs defined by IEEE 802.11h - END */
  217. #define WLAN_EID_ERP_INFO 42
  218. #define WLAN_EID_HT_CAP 45
  219. #define WLAN_EID_QOS 46
  220. #define WLAN_EID_RSN 48
  221. #define WLAN_EID_EXT_SUPP_RATES 50
  222. #define WLAN_EID_NEIGHBOR_REPORT 52
  223. #define WLAN_EID_MOBILITY_DOMAIN 54
  224. #define WLAN_EID_FAST_BSS_TRANSITION 55
  225. #define WLAN_EID_TIMEOUT_INTERVAL 56
  226. #define WLAN_EID_RIC_DATA 57
  227. #define WLAN_EID_SUPPORTED_OPERATING_CLASSES 59
  228. #define WLAN_EID_HT_OPERATION 61
  229. #define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
  230. #define WLAN_EID_WAPI 68
  231. #define WLAN_EID_TIME_ADVERTISEMENT 69
  232. #define WLAN_EID_RRM_ENABLED_CAPABILITIES 70
  233. #define WLAN_EID_20_40_BSS_COEXISTENCE 72
  234. #define WLAN_EID_20_40_BSS_INTOLERANT 73
  235. #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
  236. #define WLAN_EID_MMIE 76
  237. #define WLAN_EID_SSID_LIST 84
  238. #define WLAN_EID_BSS_MAX_IDLE_PERIOD 90
  239. #define WLAN_EID_TFS_REQ 91
  240. #define WLAN_EID_TFS_RESP 92
  241. #define WLAN_EID_WNMSLEEP 93
  242. #define WLAN_EID_TIME_ZONE 98
  243. #define WLAN_EID_LINK_ID 101
  244. #define WLAN_EID_INTERWORKING 107
  245. #define WLAN_EID_ADV_PROTO 108
  246. #define WLAN_EID_QOS_MAP_SET 110
  247. #define WLAN_EID_ROAMING_CONSORTIUM 111
  248. #define WLAN_EID_MESH_CONFIG 113
  249. #define WLAN_EID_MESH_ID 114
  250. #define WLAN_EID_PEER_MGMT 117
  251. #define WLAN_EID_EXT_CAPAB 127
  252. #define WLAN_EID_AMPE 139
  253. #define WLAN_EID_MIC 140
  254. #define WLAN_EID_CCKM 156
  255. #define WLAN_EID_VHT_CAP 191
  256. #define WLAN_EID_VHT_OPERATION 192
  257. #define WLAN_EID_VHT_EXTENDED_BSS_LOAD 193
  258. #define WLAN_EID_VHT_WIDE_BW_CHSWITCH 194
  259. #define WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE 195
  260. #define WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER 196
  261. #define WLAN_EID_VHT_AID 197
  262. #define WLAN_EID_VHT_QUIET_CHANNEL 198
  263. #define WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION 199
  264. #define WLAN_EID_VENDOR_SPECIFIC 221
  265. /* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */
  266. #define WLAN_ACTION_SPECTRUM_MGMT 0
  267. #define WLAN_ACTION_QOS 1
  268. #define WLAN_ACTION_DLS 2
  269. #define WLAN_ACTION_BLOCK_ACK 3
  270. #define WLAN_ACTION_PUBLIC 4
  271. #define WLAN_ACTION_RADIO_MEASUREMENT 5
  272. #define WLAN_ACTION_FT 6
  273. #define WLAN_ACTION_HT 7
  274. #define WLAN_ACTION_SA_QUERY 8
  275. #define WLAN_ACTION_PROTECTED_DUAL 9
  276. #define WLAN_ACTION_WNM 10
  277. #define WLAN_ACTION_UNPROTECTED_WNM 11
  278. #define WLAN_ACTION_TDLS 12
  279. #define WLAN_ACTION_SELF_PROTECTED 15
  280. #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
  281. #define WLAN_ACTION_VENDOR_SPECIFIC 127
  282. /* Public action codes */
  283. #define WLAN_PA_20_40_BSS_COEX 0
  284. #define WLAN_PA_VENDOR_SPECIFIC 9
  285. #define WLAN_PA_GAS_INITIAL_REQ 10
  286. #define WLAN_PA_GAS_INITIAL_RESP 11
  287. #define WLAN_PA_GAS_COMEBACK_REQ 12
  288. #define WLAN_PA_GAS_COMEBACK_RESP 13
  289. #define WLAN_TDLS_DISCOVERY_RESPONSE 14
  290. /* Protected Dual of Public Action frames */
  291. #define WLAN_PROT_DSE_ENABLEMENT 1
  292. #define WLAN_PROT_DSE_DEENABLEMENT 2
  293. #define WLAN_PROT_EXT_CSA 4
  294. #define WLAN_PROT_MEASUREMENT_REQ 5
  295. #define WLAN_PROT_MEASUREMENT_REPORT 6
  296. #define WLAN_PROT_DSE_POWER_CONSTRAINT 8
  297. #define WLAN_PROT_VENDOR_SPECIFIC 9
  298. #define WLAN_PROT_GAS_INITIAL_REQ 10
  299. #define WLAN_PROT_GAS_INITIAL_RESP 11
  300. #define WLAN_PROT_GAS_COMEBACK_REQ 12
  301. #define WLAN_PROT_GAS_COMEBACK_RESP 13
  302. /* SA Query Action frame (IEEE 802.11w/D8.0, 7.4.9) */
  303. #define WLAN_SA_QUERY_REQUEST 0
  304. #define WLAN_SA_QUERY_RESPONSE 1
  305. #define WLAN_SA_QUERY_TR_ID_LEN 2
  306. /* TDLS action codes */
  307. #define WLAN_TDLS_SETUP_REQUEST 0
  308. #define WLAN_TDLS_SETUP_RESPONSE 1
  309. #define WLAN_TDLS_SETUP_CONFIRM 2
  310. #define WLAN_TDLS_TEARDOWN 3
  311. #define WLAN_TDLS_PEER_TRAFFIC_INDICATION 4
  312. #define WLAN_TDLS_CHANNEL_SWITCH_REQUEST 5
  313. #define WLAN_TDLS_CHANNEL_SWITCH_RESPONSE 6
  314. #define WLAN_TDLS_PEER_PSM_REQUEST 7
  315. #define WLAN_TDLS_PEER_PSM_RESPONSE 8
  316. #define WLAN_TDLS_PEER_TRAFFIC_RESPONSE 9
  317. #define WLAN_TDLS_DISCOVERY_REQUEST 10
  318. /* Radio Measurement Action codes */
  319. #define WLAN_RRM_RADIO_MEASUREMENT_REQUEST 0
  320. #define WLAN_RRM_RADIO_MEASUREMENT_REPORT 1
  321. #define WLAN_RRM_LINK_MEASUREMENT_REQUEST 2
  322. #define WLAN_RRM_LINK_MEASUREMENT_REPORT 3
  323. #define WLAN_RRM_NEIGHBOR_REPORT_REQUEST 4
  324. #define WLAN_RRM_NEIGHBOR_REPORT_RESPONSE 5
  325. /* Radio Measurement capabilities (from RRM Capabilities IE) */
  326. /* byte 1 (out of 5) */
  327. #define WLAN_RRM_CAPS_LINK_MEASUREMENT BIT(0)
  328. #define WLAN_RRM_CAPS_NEIGHBOR_REPORT BIT(1)
  329. /* Timeout Interval Type */
  330. #define WLAN_TIMEOUT_REASSOC_DEADLINE 1
  331. #define WLAN_TIMEOUT_KEY_LIFETIME 2
  332. #define WLAN_TIMEOUT_ASSOC_COMEBACK 3
  333. /* Interworking element (IEEE 802.11u) - Access Network Options */
  334. #define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
  335. #define INTERWORKING_ANO_INTERNET 0x10
  336. #define INTERWORKING_ANO_ASRA 0x20
  337. #define INTERWORKING_ANO_ESR 0x40
  338. #define INTERWORKING_ANO_UESA 0x80
  339. #define INTERWORKING_ANT_PRIVATE 0
  340. #define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
  341. #define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
  342. #define INTERWORKING_ANT_FREE_PUBLIC 3
  343. #define INTERWORKING_ANT_PERSONAL_DEVICE 4
  344. #define INTERWORKING_ANT_EMERGENCY_SERVICES 5
  345. #define INTERWORKING_ANT_TEST 6
  346. #define INTERWORKING_ANT_WILDCARD 15
  347. /* Advertisement Protocol ID definitions (IEEE Std 802.11u-2011) */
  348. enum adv_proto_id {
  349. ACCESS_NETWORK_QUERY_PROTOCOL = 0,
  350. MIH_INFO_SERVICE = 1,
  351. MIH_CMD_AND_EVENT_DISCOVERY = 2,
  352. EMERGENCY_ALERT_SYSTEM = 3,
  353. ADV_PROTO_VENDOR_SPECIFIC = 221
  354. };
  355. /* Access Network Query Protocol info ID definitions (IEEE Std 802.11u-2011) */
  356. enum anqp_info_id {
  357. ANQP_QUERY_LIST = 256,
  358. ANQP_CAPABILITY_LIST = 257,
  359. ANQP_VENUE_NAME = 258,
  360. ANQP_EMERGENCY_CALL_NUMBER = 259,
  361. ANQP_NETWORK_AUTH_TYPE = 260,
  362. ANQP_ROAMING_CONSORTIUM = 261,
  363. ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
  364. ANQP_NAI_REALM = 263,
  365. ANQP_3GPP_CELLULAR_NETWORK = 264,
  366. ANQP_AP_GEOSPATIAL_LOCATION = 265,
  367. ANQP_AP_CIVIC_LOCATION = 266,
  368. ANQP_AP_LOCATION_PUBLIC_URI = 267,
  369. ANQP_DOMAIN_NAME = 268,
  370. ANQP_EMERGENCY_ALERT_URI = 269,
  371. ANQP_EMERGENCY_NAI = 271,
  372. ANQP_VENDOR_SPECIFIC = 56797
  373. };
  374. /* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
  375. enum nai_realm_eap_auth_param {
  376. NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
  377. NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
  378. NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
  379. NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
  380. NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
  381. NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
  382. NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
  383. };
  384. enum nai_realm_eap_auth_inner_non_eap {
  385. NAI_REALM_INNER_NON_EAP_PAP = 1,
  386. NAI_REALM_INNER_NON_EAP_CHAP = 2,
  387. NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
  388. NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
  389. };
  390. enum nai_realm_eap_cred_type {
  391. NAI_REALM_CRED_TYPE_SIM = 1,
  392. NAI_REALM_CRED_TYPE_USIM = 2,
  393. NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
  394. NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
  395. NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
  396. NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
  397. NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
  398. NAI_REALM_CRED_TYPE_NONE = 8,
  399. NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
  400. NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
  401. };
  402. #ifdef _MSC_VER
  403. #pragma pack(push, 1)
  404. #endif /* _MSC_VER */
  405. struct ieee80211_hdr {
  406. le16 frame_control;
  407. le16 duration_id;
  408. u8 addr1[6];
  409. u8 addr2[6];
  410. u8 addr3[6];
  411. le16 seq_ctrl;
  412. /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
  413. */
  414. } STRUCT_PACKED;
  415. #define IEEE80211_DA_FROMDS addr1
  416. #define IEEE80211_BSSID_FROMDS addr2
  417. #define IEEE80211_SA_FROMDS addr3
  418. #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
  419. #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
  420. struct ieee80211_mgmt {
  421. le16 frame_control;
  422. le16 duration;
  423. u8 da[6];
  424. u8 sa[6];
  425. u8 bssid[6];
  426. le16 seq_ctrl;
  427. union {
  428. struct {
  429. le16 auth_alg;
  430. le16 auth_transaction;
  431. le16 status_code;
  432. /* possibly followed by Challenge text */
  433. u8 variable[0];
  434. } STRUCT_PACKED auth;
  435. struct {
  436. le16 reason_code;
  437. u8 variable[0];
  438. } STRUCT_PACKED deauth;
  439. struct {
  440. le16 capab_info;
  441. le16 listen_interval;
  442. /* followed by SSID and Supported rates */
  443. u8 variable[0];
  444. } STRUCT_PACKED assoc_req;
  445. struct {
  446. le16 capab_info;
  447. le16 status_code;
  448. le16 aid;
  449. /* followed by Supported rates */
  450. u8 variable[0];
  451. } STRUCT_PACKED assoc_resp, reassoc_resp;
  452. struct {
  453. le16 capab_info;
  454. le16 listen_interval;
  455. u8 current_ap[6];
  456. /* followed by SSID and Supported rates */
  457. u8 variable[0];
  458. } STRUCT_PACKED reassoc_req;
  459. struct {
  460. le16 reason_code;
  461. u8 variable[0];
  462. } STRUCT_PACKED disassoc;
  463. struct {
  464. u8 timestamp[8];
  465. le16 beacon_int;
  466. le16 capab_info;
  467. /* followed by some of SSID, Supported rates,
  468. * FH Params, DS Params, CF Params, IBSS Params, TIM */
  469. u8 variable[0];
  470. } STRUCT_PACKED beacon;
  471. struct {
  472. /* only variable items: SSID, Supported rates */
  473. u8 variable[0];
  474. } STRUCT_PACKED probe_req;
  475. struct {
  476. u8 timestamp[8];
  477. le16 beacon_int;
  478. le16 capab_info;
  479. /* followed by some of SSID, Supported rates,
  480. * FH Params, DS Params, CF Params, IBSS Params */
  481. u8 variable[0];
  482. } STRUCT_PACKED probe_resp;
  483. struct {
  484. u8 category;
  485. union {
  486. struct {
  487. u8 action_code;
  488. u8 dialog_token;
  489. u8 status_code;
  490. u8 variable[0];
  491. } STRUCT_PACKED wmm_action;
  492. struct{
  493. u8 action_code;
  494. u8 element_id;
  495. u8 length;
  496. u8 switch_mode;
  497. u8 new_chan;
  498. u8 switch_count;
  499. } STRUCT_PACKED chan_switch;
  500. struct {
  501. u8 action;
  502. u8 sta_addr[ETH_ALEN];
  503. u8 target_ap_addr[ETH_ALEN];
  504. u8 variable[0]; /* FT Request */
  505. } STRUCT_PACKED ft_action_req;
  506. struct {
  507. u8 action;
  508. u8 sta_addr[ETH_ALEN];
  509. u8 target_ap_addr[ETH_ALEN];
  510. le16 status_code;
  511. u8 variable[0]; /* FT Request */
  512. } STRUCT_PACKED ft_action_resp;
  513. struct {
  514. u8 action;
  515. u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
  516. } STRUCT_PACKED sa_query_req;
  517. struct {
  518. u8 action; /* */
  519. u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
  520. } STRUCT_PACKED sa_query_resp;
  521. struct {
  522. u8 action;
  523. u8 dialogtoken;
  524. u8 variable[0];
  525. } STRUCT_PACKED wnm_sleep_req;
  526. struct {
  527. u8 action;
  528. u8 dialogtoken;
  529. le16 keydata_len;
  530. u8 variable[0];
  531. } STRUCT_PACKED wnm_sleep_resp;
  532. struct {
  533. u8 action;
  534. u8 variable[0];
  535. } STRUCT_PACKED public_action;
  536. struct {
  537. u8 action; /* 9 */
  538. u8 oui[3];
  539. /* Vendor-specific content */
  540. u8 variable[0];
  541. } STRUCT_PACKED vs_public_action;
  542. struct {
  543. u8 action; /* 7 */
  544. u8 dialog_token;
  545. u8 req_mode;
  546. le16 disassoc_timer;
  547. u8 validity_interval;
  548. /* BSS Termination Duration (optional),
  549. * Session Information URL (optional),
  550. * BSS Transition Candidate List
  551. * Entries */
  552. u8 variable[0];
  553. } STRUCT_PACKED bss_tm_req;
  554. struct {
  555. u8 action; /* 8 */
  556. u8 dialog_token;
  557. u8 status_code;
  558. u8 bss_termination_delay;
  559. /* Target BSSID (optional),
  560. * BSS Transition Candidate List
  561. * Entries (optional) */
  562. u8 variable[0];
  563. } STRUCT_PACKED bss_tm_resp;
  564. struct {
  565. u8 action; /* 6 */
  566. u8 dialog_token;
  567. u8 query_reason;
  568. /* BSS Transition Candidate List
  569. * Entries (optional) */
  570. u8 variable[0];
  571. } STRUCT_PACKED bss_tm_query;
  572. struct {
  573. u8 action; /* 15 */
  574. u8 variable[0];
  575. } STRUCT_PACKED slf_prot_action;
  576. } u;
  577. } STRUCT_PACKED action;
  578. } u;
  579. } STRUCT_PACKED;
  580. /* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
  581. #define IEEE80211_HT_MCS_MASK_LEN 10
  582. /* HT Capabilities element */
  583. struct ieee80211_ht_capabilities {
  584. le16 ht_capabilities_info;
  585. u8 a_mpdu_params; /* Maximum A-MPDU Length Exponent B0..B1
  586. * Minimum MPDU Start Spacing B2..B4
  587. * Reserved B5..B7 */
  588. u8 supported_mcs_set[16];
  589. le16 ht_extended_capabilities;
  590. le32 tx_bf_capability_info;
  591. u8 asel_capabilities;
  592. } STRUCT_PACKED;
  593. /* HT Operation element */
  594. struct ieee80211_ht_operation {
  595. u8 primary_chan;
  596. /* Five octets of HT Operation Information */
  597. u8 ht_param; /* B0..B7 */
  598. le16 operation_mode; /* B8..B23 */
  599. le16 param; /* B24..B39 */
  600. u8 basic_mcs_set[16];
  601. } STRUCT_PACKED;
  602. struct ieee80211_obss_scan_parameters {
  603. le16 scan_passive_dwell;
  604. le16 scan_active_dwell;
  605. le16 width_trigger_scan_interval;
  606. le16 scan_passive_total_per_channel;
  607. le16 scan_active_total_per_channel;
  608. le16 channel_transition_delay_factor;
  609. le16 scan_activity_threshold;
  610. } STRUCT_PACKED;
  611. struct ieee80211_vht_capabilities {
  612. le32 vht_capabilities_info;
  613. struct {
  614. le16 rx_map;
  615. le16 rx_highest;
  616. le16 tx_map;
  617. le16 tx_highest;
  618. } vht_supported_mcs_set;
  619. } STRUCT_PACKED;
  620. struct ieee80211_vht_operation {
  621. u8 vht_op_info_chwidth;
  622. u8 vht_op_info_chan_center_freq_seg0_idx;
  623. u8 vht_op_info_chan_center_freq_seg1_idx;
  624. le16 vht_basic_mcs_set;
  625. } STRUCT_PACKED;
  626. struct ieee80211_ampe_ie {
  627. u8 selected_pairwise_suite[4];
  628. u8 local_nonce[32];
  629. u8 peer_nonce[32];
  630. u8 mgtk[16];
  631. u8 key_rsc[8];
  632. u8 key_expiration[4];
  633. } STRUCT_PACKED;
  634. #ifdef _MSC_VER
  635. #pragma pack(pop)
  636. #endif /* _MSC_VER */
  637. #define ERP_INFO_NON_ERP_PRESENT BIT(0)
  638. #define ERP_INFO_USE_PROTECTION BIT(1)
  639. #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
  640. #define OVERLAPPING_BSS_TRANS_DELAY_FACTOR 5
  641. /* HT Capabilities Info field within HT Capabilities element */
  642. #define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0))
  643. #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1))
  644. #define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3)))
  645. #define HT_CAP_INFO_SMPS_STATIC ((u16) 0)
  646. #define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2))
  647. #define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3)))
  648. #define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4))
  649. #define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5))
  650. #define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6))
  651. #define HT_CAP_INFO_TX_STBC ((u16) BIT(7))
  652. #define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9)))
  653. #define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8))
  654. #define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9))
  655. #define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9)))
  656. #define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10))
  657. #define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11))
  658. #define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12))
  659. /* B13 - Reserved (was PSMP support during P802.11n development) */
  660. #define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14))
  661. #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
  662. /* HT Extended Capabilities field within HT Capabilities element */
  663. #define EXT_HT_CAP_INFO_PCO ((u16) BIT(0))
  664. #define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK ((u16) (BIT(1) | BIT(2)))
  665. #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1
  666. /* B3..B7 - Reserved */
  667. #define EXT_HT_CAP_INFO_MCS_FEEDBACK_MASK ((u16) (BIT(8) | BIT(9)))
  668. #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8
  669. #define EXT_HT_CAP_INFO_HTC_SUPPORT ((u16) BIT(10))
  670. #define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11))
  671. /* B12..B15 - Reserved */
  672. /* Transmit Beanforming Capabilities within HT Capabilities element */
  673. #define TX_BF_CAP_IMPLICIT_TXBF_RX_CAP ((u32) BIT(0))
  674. #define TX_BF_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
  675. #define TX_BF_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
  676. #define TX_BF_CAP_RX_NDP_CAP ((u32) BIT(3))
  677. #define TX_BF_CAP_TX_NDP_CAP ((u32) BIT(4))
  678. #define TX_BF_CAP_IMPLICIT_TX_BF_CAP ((u32) BIT(5))
  679. #define TX_BF_CAP_CALIBRATION_MASK ((u32) (BIT(6) | BIT(7))
  680. #define TX_BF_CAP_CALIB_OFFSET 6
  681. #define TX_BF_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
  682. #define TX_BF_CAP_EXPLICIT_NONCOMPR_STEERING_CAP ((u32) BIT(9))
  683. #define TX_BF_CAP_EXPLICIT_COMPR_STEERING_CAP ((u32) BIT(10))
  684. #define TX_BF_CAP_EXPLICIT_TX_BF_CSI_FEEDBACK_MASK ((u32) (BIT(10) | BIT(11)))
  685. #define TX_BF_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
  686. #define TX_BF_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
  687. #define TX_BF_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
  688. #define TX_BF_CAP_MINIMAL_GROUPING_OFFSET 17
  689. #define TX_BF_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
  690. #define TX_BF_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
  691. #define TX_BF_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
  692. #define TX_BF_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
  693. #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_MASK ((u32) (BIT(27) | BIT(28)))
  694. #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_OFFSET 27
  695. /* B29..B31 - Reserved */
  696. /* ASEL Capability field within HT Capabilities element */
  697. #define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0))
  698. #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
  699. #define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
  700. #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
  701. #define ASEL_CAP_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
  702. #define ASEL_CAP_RX_AS_CAP ((u8) BIT(5))
  703. #define ASEL_CAP_TX_SOUNDING_PPDUS_CAP ((u8) BIT(6))
  704. /* B7 - Reserved */
  705. /* First octet of HT Operation Information within HT Operation element */
  706. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1))
  707. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0))
  708. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1))
  709. #define HT_INFO_HT_PARAM_STA_CHNL_WIDTH ((u8) BIT(2))
  710. #define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3))
  711. /* B4..B7 - Reserved */
  712. /* HT Protection (B8..B9 of HT Operation Information) */
  713. #define HT_PROT_NO_PROTECTION 0
  714. #define HT_PROT_NONMEMBER_PROTECTION 1
  715. #define HT_PROT_20MHZ_PROTECTION 2
  716. #define HT_PROT_NON_HT_MIXED 3
  717. /* Bits within ieee80211_ht_operation::operation_mode (BIT(0) maps to B8 in
  718. * HT Operation Information) */
  719. #define HT_OPER_OP_MODE_HT_PROT_MASK ((u16) (BIT(0) | BIT(1))) /* B8..B9 */
  720. #define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT ((u16) BIT(2)) /* B10 */
  721. /* BIT(3), i.e., B11 in HT Operation Information field - Reserved */
  722. #define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT ((u16) BIT(4)) /* B12 */
  723. /* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */
  724. /* Last two octets of HT Operation Information (BIT(0) = B24) */
  725. /* B24..B29 - Reserved */
  726. #define HT_OPER_PARAM_DUAL_BEACON ((u16) BIT(6))
  727. #define HT_OPER_PARAM_DUAL_CTS_PROTECTION ((u16) BIT(7))
  728. #define HT_OPER_PARAM_STBC_BEACON ((u16) BIT(8))
  729. #define HT_OPER_PARAM_LSIG_TXOP_PROT_FULL_SUPP ((u16) BIT(9))
  730. #define HT_OPER_PARAM_PCO_ACTIVE ((u16) BIT(10))
  731. #define HT_OPER_PARAM_PCO_PHASE ((u16) BIT(11))
  732. /* B36..B39 - Reserved */
  733. #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
  734. #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
  735. /* VHT Defines */
  736. #define VHT_CAP_MAX_MPDU_LENGTH_7991 ((u32) BIT(0))
  737. #define VHT_CAP_MAX_MPDU_LENGTH_11454 ((u32) BIT(1))
  738. #define VHT_CAP_MAX_MPDU_LENGTH_MASK ((u32) BIT(0) | BIT(1))
  739. #define VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT 0
  740. #define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ ((u32) BIT(2))
  741. #define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ ((u32) BIT(3))
  742. #define VHT_CAP_SUPP_CHAN_WIDTH_MASK ((u32) BIT(2) | BIT(3))
  743. #define VHT_CAP_RXLDPC ((u32) BIT(4))
  744. #define VHT_CAP_SHORT_GI_80 ((u32) BIT(5))
  745. #define VHT_CAP_SHORT_GI_160 ((u32) BIT(6))
  746. #define VHT_CAP_TXSTBC ((u32) BIT(7))
  747. #define VHT_CAP_RXSTBC_1 ((u32) BIT(8))
  748. #define VHT_CAP_RXSTBC_2 ((u32) BIT(9))
  749. #define VHT_CAP_RXSTBC_3 ((u32) BIT(8) | BIT(9))
  750. #define VHT_CAP_RXSTBC_4 ((u32) BIT(10))
  751. #define VHT_CAP_RXSTBC_MASK ((u32) BIT(8) | BIT(9) | \
  752. BIT(10))
  753. #define VHT_CAP_RXSTBC_MASK_SHIFT 8
  754. #define VHT_CAP_SU_BEAMFORMER_CAPABLE ((u32) BIT(11))
  755. #define VHT_CAP_SU_BEAMFORMEE_CAPABLE ((u32) BIT(12))
  756. #define VHT_CAP_BEAMFORMEE_STS_MAX ((u32) BIT(13) | \
  757. BIT(14) | BIT(15))
  758. #define VHT_CAP_BEAMFORMEE_STS_MAX_SHIFT 13
  759. #define VHT_CAP_BEAMFORMEE_STS_OFFSET 13
  760. #define VHT_CAP_SOUNDING_DIMENSION_MAX ((u32) BIT(16) | \
  761. BIT(17) | BIT(18))
  762. #define VHT_CAP_SOUNDING_DIMENSION_MAX_SHIFT 16
  763. #define VHT_CAP_SOUNDING_DIMENSION_OFFSET 16
  764. #define VHT_CAP_MU_BEAMFORMER_CAPABLE ((u32) BIT(19))
  765. #define VHT_CAP_MU_BEAMFORMEE_CAPABLE ((u32) BIT(20))
  766. #define VHT_CAP_VHT_TXOP_PS ((u32) BIT(21))
  767. #define VHT_CAP_HTC_VHT ((u32) BIT(22))
  768. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_1 ((u32) BIT(23))
  769. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_2 ((u32) BIT(24))
  770. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_3 ((u32) BIT(23) | BIT(24))
  771. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_4 ((u32) BIT(25))
  772. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_5 ((u32) BIT(23) | BIT(25))
  773. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_6 ((u32) BIT(24) | BIT(25))
  774. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX ((u32) BIT(23) | \
  775. BIT(24) | BIT(25))
  776. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT 23
  777. #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB ((u32) BIT(27))
  778. #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27))
  779. #define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28))
  780. #define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29))
  781. #define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1))
  782. #define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \
  783. BIT(6))
  784. #define VHT_OPMODE_NOTIF_RX_NSS_SHIFT 4
  785. #define VHT_RX_NSS_MAX_STREAMS 8
  786. /* VHT channel widths */
  787. #define VHT_CHANWIDTH_USE_HT 0
  788. #define VHT_CHANWIDTH_80MHZ 1
  789. #define VHT_CHANWIDTH_160MHZ 2
  790. #define VHT_CHANWIDTH_80P80MHZ 3
  791. #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
  792. * 00:50:F2 */
  793. #define WPA_IE_VENDOR_TYPE 0x0050f201
  794. #define WMM_IE_VENDOR_TYPE 0x0050f202
  795. #define WPS_IE_VENDOR_TYPE 0x0050f204
  796. #define OUI_WFA 0x506f9a
  797. #define P2P_IE_VENDOR_TYPE 0x506f9a09
  798. #define WFD_IE_VENDOR_TYPE 0x506f9a0a
  799. #define WFD_OUI_TYPE 10
  800. #define HS20_IE_VENDOR_TYPE 0x506f9a10
  801. #define OSEN_IE_VENDOR_TYPE 0x506f9a12
  802. #define WMM_OUI_TYPE 2
  803. #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
  804. #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
  805. #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
  806. #define WMM_VERSION 1
  807. #define WMM_ACTION_CODE_ADDTS_REQ 0
  808. #define WMM_ACTION_CODE_ADDTS_RESP 1
  809. #define WMM_ACTION_CODE_DELTS 2
  810. #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
  811. #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
  812. /* 2 - Reserved */
  813. #define WMM_ADDTS_STATUS_REFUSED 3
  814. /* 4-255 - Reserved */
  815. /* WMM TSPEC Direction Field Values */
  816. #define WMM_TSPEC_DIRECTION_UPLINK 0
  817. #define WMM_TSPEC_DIRECTION_DOWNLINK 1
  818. /* 2 - Reserved */
  819. #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
  820. /*
  821. * WMM Information Element (used in (Re)Association Request frames; may also be
  822. * used in Beacon frames)
  823. */
  824. struct wmm_information_element {
  825. /* Element ID: 221 (0xdd); Length: 7 */
  826. /* required fields for WMM version 1 */
  827. u8 oui[3]; /* 00:50:f2 */
  828. u8 oui_type; /* 2 */
  829. u8 oui_subtype; /* 0 */
  830. u8 version; /* 1 for WMM version 1.0 */
  831. u8 qos_info; /* AP/STA specific QoS info */
  832. } STRUCT_PACKED;
  833. #define WMM_QOSINFO_AP_UAPSD 0x80
  834. #define WMM_QOSINFO_STA_AC_MASK 0x0f
  835. #define WMM_QOSINFO_STA_SP_MASK 0x03
  836. #define WMM_QOSINFO_STA_SP_SHIFT 5
  837. #define WMM_AC_AIFSN_MASK 0x0f
  838. #define WMM_AC_AIFNS_SHIFT 0
  839. #define WMM_AC_ACM 0x10
  840. #define WMM_AC_ACI_MASK 0x60
  841. #define WMM_AC_ACI_SHIFT 5
  842. #define WMM_AC_ECWMIN_MASK 0x0f
  843. #define WMM_AC_ECWMIN_SHIFT 0
  844. #define WMM_AC_ECWMAX_MASK 0xf0
  845. #define WMM_AC_ECWMAX_SHIFT 4
  846. struct wmm_ac_parameter {
  847. u8 aci_aifsn; /* AIFSN, ACM, ACI */
  848. u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
  849. le16 txop_limit;
  850. } STRUCT_PACKED;
  851. /*
  852. * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
  853. * Response frmaes)
  854. */
  855. struct wmm_parameter_element {
  856. /* Element ID: 221 (0xdd); Length: 24 */
  857. /* required fields for WMM version 1 */
  858. u8 oui[3]; /* 00:50:f2 */
  859. u8 oui_type; /* 2 */
  860. u8 oui_subtype; /* 1 */
  861. u8 version; /* 1 for WMM version 1.0 */
  862. u8 qos_info; /* AP/STA specific QoS info */
  863. u8 reserved; /* 0 */
  864. struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
  865. } STRUCT_PACKED;
  866. /* WMM TSPEC Element */
  867. struct wmm_tspec_element {
  868. u8 eid; /* 221 = 0xdd */
  869. u8 length; /* 6 + 55 = 61 */
  870. u8 oui[3]; /* 00:50:f2 */
  871. u8 oui_type; /* 2 */
  872. u8 oui_subtype; /* 2 */
  873. u8 version; /* 1 */
  874. /* WMM TSPEC body (55 octets): */
  875. u8 ts_info[3];
  876. le16 nominal_msdu_size;
  877. le16 maximum_msdu_size;
  878. le32 minimum_service_interval;
  879. le32 maximum_service_interval;
  880. le32 inactivity_interval;
  881. le32 suspension_interval;
  882. le32 service_start_time;
  883. le32 minimum_data_rate;
  884. le32 mean_data_rate;
  885. le32 peak_data_rate;
  886. le32 maximum_burst_size;
  887. le32 delay_bound;
  888. le32 minimum_phy_rate;
  889. le16 surplus_bandwidth_allowance;
  890. le16 medium_time;
  891. } STRUCT_PACKED;
  892. /* Access Categories / ACI to AC coding */
  893. enum wmm_ac {
  894. WMM_AC_BE = 0 /* Best Effort */,
  895. WMM_AC_BK = 1 /* Background */,
  896. WMM_AC_VI = 2 /* Video */,
  897. WMM_AC_VO = 3 /* Voice */,
  898. WMM_AC_NUM = 4
  899. };
  900. #define HS20_INDICATION_OUI_TYPE 16
  901. #define HS20_ANQP_OUI_TYPE 17
  902. #define HS20_OSEN_OUI_TYPE 18
  903. #define HS20_STYPE_QUERY_LIST 1
  904. #define HS20_STYPE_CAPABILITY_LIST 2
  905. #define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3
  906. #define HS20_STYPE_WAN_METRICS 4
  907. #define HS20_STYPE_CONNECTION_CAPABILITY 5
  908. #define HS20_STYPE_NAI_HOME_REALM_QUERY 6
  909. #define HS20_STYPE_OPERATING_CLASS 7
  910. #define HS20_STYPE_OSU_PROVIDERS_LIST 8
  911. #define HS20_STYPE_ICON_REQUEST 10
  912. #define HS20_STYPE_ICON_BINARY_FILE 11
  913. #define HS20_DGAF_DISABLED 0x01
  914. #define HS20_PPS_MO_ID_PRESENT 0x02
  915. #define HS20_ANQP_DOMAIN_ID_PRESENT 0x04
  916. #define HS20_VERSION 0x10 /* Release 2 */
  917. /* WNM-Notification WFA vendors specific subtypes */
  918. #define HS20_WNM_SUB_REM_NEEDED 0
  919. #define HS20_WNM_DEAUTH_IMMINENT_NOTICE 1
  920. #define HS20_DEAUTH_REASON_CODE_BSS 0
  921. #define HS20_DEAUTH_REASON_CODE_ESS 1
  922. /* Wi-Fi Direct (P2P) */
  923. #define P2P_OUI_TYPE 9
  924. enum p2p_attr_id {
  925. P2P_ATTR_STATUS = 0,
  926. P2P_ATTR_MINOR_REASON_CODE = 1,
  927. P2P_ATTR_CAPABILITY = 2,
  928. P2P_ATTR_DEVICE_ID = 3,
  929. P2P_ATTR_GROUP_OWNER_INTENT = 4,
  930. P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
  931. P2P_ATTR_LISTEN_CHANNEL = 6,
  932. P2P_ATTR_GROUP_BSSID = 7,
  933. P2P_ATTR_EXT_LISTEN_TIMING = 8,
  934. P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
  935. P2P_ATTR_MANAGEABILITY = 10,
  936. P2P_ATTR_CHANNEL_LIST = 11,
  937. P2P_ATTR_NOTICE_OF_ABSENCE = 12,
  938. P2P_ATTR_DEVICE_INFO = 13,
  939. P2P_ATTR_GROUP_INFO = 14,
  940. P2P_ATTR_GROUP_ID = 15,
  941. P2P_ATTR_INTERFACE = 16,
  942. P2P_ATTR_OPERATING_CHANNEL = 17,
  943. P2P_ATTR_INVITATION_FLAGS = 18,
  944. P2P_ATTR_OOB_GO_NEG_CHANNEL = 19,
  945. P2P_ATTR_SERVICE_HASH = 21,
  946. P2P_ATTR_SESSION_INFORMATION_DATA = 22,
  947. P2P_ATTR_CONNECTION_CAPABILITY = 23,
  948. P2P_ATTR_ADVERTISEMENT_ID = 24,
  949. P2P_ATTR_ADVERTISED_SERVICE = 25,
  950. P2P_ATTR_SESSION_ID = 26,
  951. P2P_ATTR_FEATURE_CAPABILITY = 27,
  952. P2P_ATTR_PERSISTENT_GROUP = 28,
  953. P2P_ATTR_VENDOR_SPECIFIC = 221
  954. };
  955. #define P2P_MAX_GO_INTENT 15
  956. /* P2P Capability - Device Capability bitmap */
  957. #define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
  958. #define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
  959. #define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
  960. #define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
  961. #define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
  962. #define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
  963. /* P2P Capability - Group Capability bitmap */
  964. #define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
  965. #define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
  966. #define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
  967. #define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
  968. #define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
  969. #define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
  970. #define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
  971. #define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7)
  972. /* Invitation Flags */
  973. #define P2P_INVITATION_FLAGS_TYPE BIT(0)
  974. /* P2P Manageability */
  975. #define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
  976. #define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
  977. #define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
  978. enum p2p_status_code {
  979. P2P_SC_SUCCESS = 0,
  980. P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
  981. P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
  982. P2P_SC_FAIL_LIMIT_REACHED = 3,
  983. P2P_SC_FAIL_INVALID_PARAMS = 4,
  984. P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
  985. P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
  986. P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
  987. P2P_SC_FAIL_UNKNOWN_GROUP = 8,
  988. P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
  989. P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
  990. P2P_SC_FAIL_REJECTED_BY_USER = 11,
  991. P2P_SC_SUCCESS_DEFERRED = 12,
  992. };
  993. enum p2p_role_indication {
  994. P2P_DEVICE_NOT_IN_GROUP = 0x00,
  995. P2P_CLIENT_IN_A_GROUP = 0x01,
  996. P2P_GO_IN_A_GROUP = 0x02,
  997. };
  998. #define P2P_WILDCARD_SSID "DIRECT-"
  999. #define P2P_WILDCARD_SSID_LEN 7
  1000. /* P2P action frames */
  1001. enum p2p_act_frame_type {
  1002. P2P_NOA = 0,
  1003. P2P_PRESENCE_REQ = 1,
  1004. P2P_PRESENCE_RESP = 2,
  1005. P2P_GO_DISC_REQ = 3
  1006. };
  1007. /* P2P public action frames */
  1008. enum p2p_action_frame_type {
  1009. P2P_GO_NEG_REQ = 0,
  1010. P2P_GO_NEG_RESP = 1,
  1011. P2P_GO_NEG_CONF = 2,
  1012. P2P_INVITATION_REQ = 3,
  1013. P2P_INVITATION_RESP = 4,
  1014. P2P_DEV_DISC_REQ = 5,
  1015. P2P_DEV_DISC_RESP = 6,
  1016. P2P_PROV_DISC_REQ = 7,
  1017. P2P_PROV_DISC_RESP = 8
  1018. };
  1019. enum p2p_service_protocol_type {
  1020. P2P_SERV_ALL_SERVICES = 0,
  1021. P2P_SERV_BONJOUR = 1,
  1022. P2P_SERV_UPNP = 2,
  1023. P2P_SERV_WS_DISCOVERY = 3,
  1024. P2P_SERV_WIFI_DISPLAY = 4,
  1025. P2P_SERV_P2PS = 11,
  1026. P2P_SERV_VENDOR_SPECIFIC = 255
  1027. };
  1028. enum p2p_sd_status {
  1029. P2P_SD_SUCCESS = 0,
  1030. P2P_SD_PROTO_NOT_AVAILABLE = 1,
  1031. P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
  1032. P2P_SD_BAD_REQUEST = 3
  1033. };
  1034. enum wifi_display_subelem {
  1035. WFD_SUBELEM_DEVICE_INFO = 0,
  1036. WFD_SUBELEM_ASSOCIATED_BSSID = 1,
  1037. WFD_SUBELEM_AUDIO_FORMATS = 2,
  1038. WFD_SUBELEM_VIDEO_FORMATS = 3,
  1039. WFD_SUBELEM_3D_VIDEO_FORMATS = 4,
  1040. WFD_SUBELEM_CONTENT_PROTECTION = 5,
  1041. WFD_SUBELEM_COUPLED_SINK = 6,
  1042. WFD_SUBELEM_EXT_CAPAB = 7,
  1043. WFD_SUBELEM_LOCAL_IP_ADDRESS = 8,
  1044. WFD_SUBELEM_SESSION_INFO = 9
  1045. };
  1046. /* 802.11s */
  1047. #define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1
  1048. #define MESH_SYNC_METHOD_VENDOR 255
  1049. #define MESH_PATH_PROTOCOL_HWMP 1
  1050. #define MESH_PATH_PROTOCOL_VENDOR 255
  1051. #define MESH_PATH_METRIC_AIRTIME 1
  1052. #define MESH_PATH_METRIC_VENDOR 255
  1053. enum plink_action_field {
  1054. PLINK_OPEN = 1,
  1055. PLINK_CONFIRM,
  1056. PLINK_CLOSE
  1057. };
  1058. #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
  1059. #define VENDOR_VHT_TYPE 0x04
  1060. #define VENDOR_VHT_SUBTYPE 0x08
  1061. #define VENDOR_VHT_SUBTYPE2 0x00
  1062. #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
  1063. /* cipher suite selectors */
  1064. #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
  1065. #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
  1066. #define WLAN_CIPHER_SUITE_TKIP 0x000FAC02
  1067. /* reserved: 0x000FAC03 */
  1068. #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
  1069. #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
  1070. #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
  1071. #define WLAN_CIPHER_SUITE_NO_GROUP_ADDR 0x000FAC07
  1072. #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
  1073. #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09
  1074. #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A
  1075. #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B
  1076. #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C
  1077. #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D
  1078. #define WLAN_CIPHER_SUITE_SMS4 0x00147201
  1079. #define WLAN_CIPHER_SUITE_CKIP 0x00409600
  1080. #define WLAN_CIPHER_SUITE_CKIP_CMIC 0x00409601
  1081. #define WLAN_CIPHER_SUITE_CMIC 0x00409602
  1082. #define WLAN_CIPHER_SUITE_KRK 0x004096FF /* for nl80211 use only */
  1083. /* AKM suite selectors */
  1084. #define WLAN_AKM_SUITE_8021X 0x000FAC01
  1085. #define WLAN_AKM_SUITE_PSK 0x000FAC02
  1086. #define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
  1087. #define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
  1088. #define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05
  1089. #define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06
  1090. #define WLAN_AKM_SUITE_8021X_SUITE_B 0x000FAC11
  1091. #define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC12
  1092. #define WLAN_AKM_SUITE_CCKM 0x00409600
  1093. #define WLAN_AKM_SUITE_OSEN 0x506f9a01
  1094. /* IEEE 802.11v - WNM Action field values */
  1095. enum wnm_action {
  1096. WNM_EVENT_REQ = 0,
  1097. WNM_EVENT_REPORT = 1,
  1098. WNM_DIAGNOSTIC_REQ = 2,
  1099. WNM_DIAGNOSTIC_REPORT = 3,
  1100. WNM_LOCATION_CFG_REQ = 4,
  1101. WNM_LOCATION_CFG_RESP = 5,
  1102. WNM_BSS_TRANS_MGMT_QUERY = 6,
  1103. WNM_BSS_TRANS_MGMT_REQ = 7,
  1104. WNM_BSS_TRANS_MGMT_RESP = 8,
  1105. WNM_FMS_REQ = 9,
  1106. WNM_FMS_RESP = 10,
  1107. WNM_COLLOCATED_INTERFERENCE_REQ = 11,
  1108. WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
  1109. WNM_TFS_REQ = 13,
  1110. WNM_TFS_RESP = 14,
  1111. WNM_TFS_NOTIFY = 15,
  1112. WNM_SLEEP_MODE_REQ = 16,
  1113. WNM_SLEEP_MODE_RESP = 17,
  1114. WNM_TIM_BROADCAST_REQ = 18,
  1115. WNM_TIM_BROADCAST_RESP = 19,
  1116. WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
  1117. WNM_CHANNEL_USAGE_REQ = 21,
  1118. WNM_CHANNEL_USAGE_RESP = 22,
  1119. WNM_DMS_REQ = 23,
  1120. WNM_DMS_RESP = 24,
  1121. WNM_TIMING_MEASUREMENT_REQ = 25,
  1122. WNM_NOTIFICATION_REQ = 26,
  1123. WNM_NOTIFICATION_RESP = 27
  1124. };
  1125. /* IEEE 802.11v - BSS Transition Management Request - Request Mode */
  1126. #define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
  1127. #define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
  1128. #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
  1129. #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
  1130. #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
  1131. /* IEEE Std 802.11-2012 - Table 8-253 */
  1132. enum bss_trans_mgmt_status_code {
  1133. WNM_BSS_TM_ACCEPT = 0,
  1134. WNM_BSS_TM_REJECT_UNSPECIFIED = 1,
  1135. WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2,
  1136. WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3,
  1137. WNM_BSS_TM_REJECT_UNDESIRED = 4,
  1138. WNM_BSS_TM_REJECT_DELAY_REQUEST = 5,
  1139. WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
  1140. WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7,
  1141. WNM_BSS_TM_REJECT_LEAVING_ESS = 8
  1142. };
  1143. #define WNM_NEIGHBOR_TSF 1
  1144. #define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING 2
  1145. #define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE 3
  1146. #define WNM_NEIGHBOR_BSS_TERMINATION_DURATION 4
  1147. #define WNM_NEIGHBOR_BEARING 5
  1148. #define WNM_NEIGHBOR_MEASUREMENT_PILOT 66
  1149. #define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES 70
  1150. #define WNM_NEIGHBOR_MULTIPLE_BSSID 71
  1151. /* QoS action */
  1152. enum qos_action {
  1153. QOS_ADDTS_REQ = 0,
  1154. QOS_ADDTS_RESP = 1,
  1155. QOS_DELTS = 2,
  1156. QOS_SCHEDULE = 3,
  1157. QOS_QOS_MAP_CONFIG = 4,
  1158. };
  1159. /* IEEE Std 802.11-2012, 8.4.2.62 20/40 BSS Coexistence element */
  1160. #define WLAN_20_40_BSS_COEX_INFO_REQ BIT(0)
  1161. #define WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1)
  1162. #define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ BIT(2)
  1163. #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3)
  1164. #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT BIT(4)
  1165. struct ieee80211_2040_bss_coex_ie {
  1166. u8 element_id;
  1167. u8 length;
  1168. u8 coex_param;
  1169. } STRUCT_PACKED;
  1170. struct ieee80211_2040_intol_chan_report {
  1171. u8 element_id;
  1172. u8 length;
  1173. u8 op_class;
  1174. u8 variable[0]; /* Channel List */
  1175. } STRUCT_PACKED;
  1176. /* IEEE 802.11v - WNM-Sleep Mode element */
  1177. struct wnm_sleep_element {
  1178. u8 eid; /* WLAN_EID_WNMSLEEP */
  1179. u8 len;
  1180. u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */
  1181. u8 status;
  1182. le16 intval;
  1183. } STRUCT_PACKED;
  1184. #define WNM_SLEEP_MODE_ENTER 0
  1185. #define WNM_SLEEP_MODE_EXIT 1
  1186. enum wnm_sleep_mode_response_status {
  1187. WNM_STATUS_SLEEP_ACCEPT = 0,
  1188. WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1,
  1189. WNM_STATUS_DENIED_ACTION = 2,
  1190. WNM_STATUS_DENIED_TMP = 3,
  1191. WNM_STATUS_DENIED_KEY = 4,
  1192. WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5
  1193. };
  1194. /* WNM-Sleep Mode subelement IDs */
  1195. enum wnm_sleep_mode_subelement_id {
  1196. WNM_SLEEP_SUBELEM_GTK = 0,
  1197. WNM_SLEEP_SUBELEM_IGTK = 1
  1198. };
  1199. /* Channel Switch modes (802.11h) */
  1200. #define CHAN_SWITCH_MODE_ALLOW_TX 0
  1201. #define CHAN_SWITCH_MODE_BLOCK_TX 1
  1202. struct tpc_report {
  1203. u8 eid;
  1204. u8 len;
  1205. u8 tx_power;
  1206. u8 link_margin;
  1207. } STRUCT_PACKED;
  1208. /* IEEE Std 802.11-2012, 8.5.7.4 - Link Measurement Request frame format */
  1209. struct rrm_link_measurement_request {
  1210. u8 dialog_token;
  1211. s8 tx_power;
  1212. s8 max_tp;
  1213. u8 variable[0];
  1214. } STRUCT_PACKED;
  1215. /* IEEE Std 802.11-2012, 8.5.7.5 - Link Measurement Report frame format */
  1216. struct rrm_link_measurement_report {
  1217. u8 dialog_token;
  1218. struct tpc_report tpc;
  1219. u8 rx_ant_id;
  1220. u8 tx_ant_id;
  1221. u8 rcpi;
  1222. u8 rsni;
  1223. u8 variable[0];
  1224. } STRUCT_PACKED;
  1225. #endif /* IEEE802_11_DEFS_H */