ieee802_11_defs.h 52 KB

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