ieee802_11_defs.h 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558
  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. /* Timeout Interval Type */
  343. #define WLAN_TIMEOUT_REASSOC_DEADLINE 1
  344. #define WLAN_TIMEOUT_KEY_LIFETIME 2
  345. #define WLAN_TIMEOUT_ASSOC_COMEBACK 3
  346. /* Interworking element (IEEE 802.11u) - Access Network Options */
  347. #define INTERWORKING_ANO_ACCESS_NETWORK_MASK 0x0f
  348. #define INTERWORKING_ANO_INTERNET 0x10
  349. #define INTERWORKING_ANO_ASRA 0x20
  350. #define INTERWORKING_ANO_ESR 0x40
  351. #define INTERWORKING_ANO_UESA 0x80
  352. #define INTERWORKING_ANT_PRIVATE 0
  353. #define INTERWORKING_ANT_PRIVATE_WITH_GUEST 1
  354. #define INTERWORKING_ANT_CHARGEABLE_PUBLIC 2
  355. #define INTERWORKING_ANT_FREE_PUBLIC 3
  356. #define INTERWORKING_ANT_PERSONAL_DEVICE 4
  357. #define INTERWORKING_ANT_EMERGENCY_SERVICES 5
  358. #define INTERWORKING_ANT_TEST 6
  359. #define INTERWORKING_ANT_WILDCARD 15
  360. /* Advertisement Protocol ID definitions (IEEE Std 802.11u-2011) */
  361. enum adv_proto_id {
  362. ACCESS_NETWORK_QUERY_PROTOCOL = 0,
  363. MIH_INFO_SERVICE = 1,
  364. MIH_CMD_AND_EVENT_DISCOVERY = 2,
  365. EMERGENCY_ALERT_SYSTEM = 3,
  366. ADV_PROTO_VENDOR_SPECIFIC = 221
  367. };
  368. /* Access Network Query Protocol info ID definitions (IEEE Std 802.11u-2011) */
  369. enum anqp_info_id {
  370. ANQP_QUERY_LIST = 256,
  371. ANQP_CAPABILITY_LIST = 257,
  372. ANQP_VENUE_NAME = 258,
  373. ANQP_EMERGENCY_CALL_NUMBER = 259,
  374. ANQP_NETWORK_AUTH_TYPE = 260,
  375. ANQP_ROAMING_CONSORTIUM = 261,
  376. ANQP_IP_ADDR_TYPE_AVAILABILITY = 262,
  377. ANQP_NAI_REALM = 263,
  378. ANQP_3GPP_CELLULAR_NETWORK = 264,
  379. ANQP_AP_GEOSPATIAL_LOCATION = 265,
  380. ANQP_AP_CIVIC_LOCATION = 266,
  381. ANQP_AP_LOCATION_PUBLIC_URI = 267,
  382. ANQP_DOMAIN_NAME = 268,
  383. ANQP_EMERGENCY_ALERT_URI = 269,
  384. ANQP_TDLS_CAPABILITY = 270,
  385. ANQP_EMERGENCY_NAI = 271,
  386. ANQP_NEIGHBOR_REPORT = 272,
  387. ANQP_VENUE_URL = 277,
  388. ANQP_ADVICE_OF_CHARGE = 278,
  389. ANQP_LOCAL_CONTENT = 279,
  390. ANQP_VENDOR_SPECIFIC = 56797
  391. };
  392. /* NAI Realm list - EAP Method subfield - Authentication Parameter ID */
  393. enum nai_realm_eap_auth_param {
  394. NAI_REALM_EAP_AUTH_EXPANDED_EAP_METHOD = 1,
  395. NAI_REALM_EAP_AUTH_NON_EAP_INNER_AUTH = 2,
  396. NAI_REALM_EAP_AUTH_INNER_AUTH_EAP_METHOD = 3,
  397. NAI_REALM_EAP_AUTH_EXPANDED_INNER_EAP_METHOD = 4,
  398. NAI_REALM_EAP_AUTH_CRED_TYPE = 5,
  399. NAI_REALM_EAP_AUTH_TUNNELED_CRED_TYPE = 6,
  400. NAI_REALM_EAP_AUTH_VENDOR_SPECIFIC = 221
  401. };
  402. enum nai_realm_eap_auth_inner_non_eap {
  403. NAI_REALM_INNER_NON_EAP_PAP = 1,
  404. NAI_REALM_INNER_NON_EAP_CHAP = 2,
  405. NAI_REALM_INNER_NON_EAP_MSCHAP = 3,
  406. NAI_REALM_INNER_NON_EAP_MSCHAPV2 = 4
  407. };
  408. enum nai_realm_eap_cred_type {
  409. NAI_REALM_CRED_TYPE_SIM = 1,
  410. NAI_REALM_CRED_TYPE_USIM = 2,
  411. NAI_REALM_CRED_TYPE_NFC_SECURE_ELEMENT = 3,
  412. NAI_REALM_CRED_TYPE_HARDWARE_TOKEN = 4,
  413. NAI_REALM_CRED_TYPE_SOFTOKEN = 5,
  414. NAI_REALM_CRED_TYPE_CERTIFICATE = 6,
  415. NAI_REALM_CRED_TYPE_USERNAME_PASSWORD = 7,
  416. NAI_REALM_CRED_TYPE_NONE = 8,
  417. NAI_REALM_CRED_TYPE_ANONYMOUS = 9,
  418. NAI_REALM_CRED_TYPE_VENDOR_SPECIFIC = 10
  419. };
  420. #ifdef _MSC_VER
  421. #pragma pack(push, 1)
  422. #endif /* _MSC_VER */
  423. struct ieee80211_hdr {
  424. le16 frame_control;
  425. le16 duration_id;
  426. u8 addr1[6];
  427. u8 addr2[6];
  428. u8 addr3[6];
  429. le16 seq_ctrl;
  430. /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
  431. */
  432. } STRUCT_PACKED;
  433. #define IEEE80211_DA_FROMDS addr1
  434. #define IEEE80211_BSSID_FROMDS addr2
  435. #define IEEE80211_SA_FROMDS addr3
  436. #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
  437. #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
  438. struct ieee80211_mgmt {
  439. le16 frame_control;
  440. le16 duration;
  441. u8 da[6];
  442. u8 sa[6];
  443. u8 bssid[6];
  444. le16 seq_ctrl;
  445. union {
  446. struct {
  447. le16 auth_alg;
  448. le16 auth_transaction;
  449. le16 status_code;
  450. /* possibly followed by Challenge text */
  451. u8 variable[];
  452. } STRUCT_PACKED auth;
  453. struct {
  454. le16 reason_code;
  455. u8 variable[];
  456. } STRUCT_PACKED deauth;
  457. struct {
  458. le16 capab_info;
  459. le16 listen_interval;
  460. /* followed by SSID and Supported rates */
  461. u8 variable[];
  462. } STRUCT_PACKED assoc_req;
  463. struct {
  464. le16 capab_info;
  465. le16 status_code;
  466. le16 aid;
  467. /* followed by Supported rates */
  468. u8 variable[];
  469. } STRUCT_PACKED assoc_resp, reassoc_resp;
  470. struct {
  471. le16 capab_info;
  472. le16 listen_interval;
  473. u8 current_ap[6];
  474. /* followed by SSID and Supported rates */
  475. u8 variable[];
  476. } STRUCT_PACKED reassoc_req;
  477. struct {
  478. le16 reason_code;
  479. u8 variable[];
  480. } STRUCT_PACKED disassoc;
  481. struct {
  482. u8 timestamp[8];
  483. le16 beacon_int;
  484. le16 capab_info;
  485. /* followed by some of SSID, Supported rates,
  486. * FH Params, DS Params, CF Params, IBSS Params, TIM */
  487. u8 variable[];
  488. } STRUCT_PACKED beacon;
  489. struct {
  490. /* only variable items: SSID, Supported rates */
  491. u8 variable[0];
  492. } STRUCT_PACKED probe_req;
  493. struct {
  494. u8 timestamp[8];
  495. le16 beacon_int;
  496. le16 capab_info;
  497. /* followed by some of SSID, Supported rates,
  498. * FH Params, DS Params, CF Params, IBSS Params */
  499. u8 variable[];
  500. } STRUCT_PACKED probe_resp;
  501. struct {
  502. u8 category;
  503. union {
  504. struct {
  505. u8 action_code;
  506. u8 dialog_token;
  507. u8 status_code;
  508. u8 variable[];
  509. } STRUCT_PACKED wmm_action;
  510. struct{
  511. u8 action_code;
  512. u8 element_id;
  513. u8 length;
  514. u8 switch_mode;
  515. u8 new_chan;
  516. u8 switch_count;
  517. } STRUCT_PACKED chan_switch;
  518. struct {
  519. u8 action;
  520. u8 sta_addr[ETH_ALEN];
  521. u8 target_ap_addr[ETH_ALEN];
  522. u8 variable[]; /* FT Request */
  523. } STRUCT_PACKED ft_action_req;
  524. struct {
  525. u8 action;
  526. u8 sta_addr[ETH_ALEN];
  527. u8 target_ap_addr[ETH_ALEN];
  528. le16 status_code;
  529. u8 variable[]; /* FT Request */
  530. } STRUCT_PACKED ft_action_resp;
  531. struct {
  532. u8 action;
  533. u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
  534. } STRUCT_PACKED sa_query_req;
  535. struct {
  536. u8 action; /* */
  537. u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
  538. } STRUCT_PACKED sa_query_resp;
  539. struct {
  540. u8 action;
  541. u8 dialogtoken;
  542. u8 variable[];
  543. } STRUCT_PACKED wnm_sleep_req;
  544. struct {
  545. u8 action;
  546. u8 dialogtoken;
  547. le16 keydata_len;
  548. u8 variable[];
  549. } STRUCT_PACKED wnm_sleep_resp;
  550. struct {
  551. u8 action;
  552. u8 variable[];
  553. } STRUCT_PACKED public_action;
  554. struct {
  555. u8 action; /* 9 */
  556. u8 oui[3];
  557. /* Vendor-specific content */
  558. u8 variable[];
  559. } STRUCT_PACKED vs_public_action;
  560. struct {
  561. u8 action; /* 7 */
  562. u8 dialog_token;
  563. u8 req_mode;
  564. le16 disassoc_timer;
  565. u8 validity_interval;
  566. /* BSS Termination Duration (optional),
  567. * Session Information URL (optional),
  568. * BSS Transition Candidate List
  569. * Entries */
  570. u8 variable[];
  571. } STRUCT_PACKED bss_tm_req;
  572. struct {
  573. u8 action; /* 8 */
  574. u8 dialog_token;
  575. u8 status_code;
  576. u8 bss_termination_delay;
  577. /* Target BSSID (optional),
  578. * BSS Transition Candidate List
  579. * Entries (optional) */
  580. u8 variable[];
  581. } STRUCT_PACKED bss_tm_resp;
  582. struct {
  583. u8 action; /* 6 */
  584. u8 dialog_token;
  585. u8 query_reason;
  586. /* BSS Transition Candidate List
  587. * Entries (optional) */
  588. u8 variable[];
  589. } STRUCT_PACKED bss_tm_query;
  590. struct {
  591. u8 action; /* 15 */
  592. u8 variable[];
  593. } STRUCT_PACKED slf_prot_action;
  594. struct {
  595. u8 action;
  596. u8 variable[];
  597. } STRUCT_PACKED fst_action;
  598. } u;
  599. } STRUCT_PACKED action;
  600. } u;
  601. } STRUCT_PACKED;
  602. /* Rx MCS bitmask is in the first 77 bits of supported_mcs_set */
  603. #define IEEE80211_HT_MCS_MASK_LEN 10
  604. /* HT Capabilities element */
  605. struct ieee80211_ht_capabilities {
  606. le16 ht_capabilities_info;
  607. u8 a_mpdu_params; /* Maximum A-MPDU Length Exponent B0..B1
  608. * Minimum MPDU Start Spacing B2..B4
  609. * Reserved B5..B7 */
  610. u8 supported_mcs_set[16];
  611. le16 ht_extended_capabilities;
  612. le32 tx_bf_capability_info;
  613. u8 asel_capabilities;
  614. } STRUCT_PACKED;
  615. /* HT Operation element */
  616. struct ieee80211_ht_operation {
  617. u8 primary_chan;
  618. /* Five octets of HT Operation Information */
  619. u8 ht_param; /* B0..B7 */
  620. le16 operation_mode; /* B8..B23 */
  621. le16 param; /* B24..B39 */
  622. u8 basic_mcs_set[16];
  623. } STRUCT_PACKED;
  624. struct ieee80211_obss_scan_parameters {
  625. le16 scan_passive_dwell;
  626. le16 scan_active_dwell;
  627. le16 width_trigger_scan_interval;
  628. le16 scan_passive_total_per_channel;
  629. le16 scan_active_total_per_channel;
  630. le16 channel_transition_delay_factor;
  631. le16 scan_activity_threshold;
  632. } STRUCT_PACKED;
  633. struct ieee80211_vht_capabilities {
  634. le32 vht_capabilities_info;
  635. struct {
  636. le16 rx_map;
  637. le16 rx_highest;
  638. le16 tx_map;
  639. le16 tx_highest;
  640. } vht_supported_mcs_set;
  641. } STRUCT_PACKED;
  642. struct ieee80211_vht_operation {
  643. u8 vht_op_info_chwidth;
  644. u8 vht_op_info_chan_center_freq_seg0_idx;
  645. u8 vht_op_info_chan_center_freq_seg1_idx;
  646. le16 vht_basic_mcs_set;
  647. } STRUCT_PACKED;
  648. struct ieee80211_ampe_ie {
  649. u8 selected_pairwise_suite[4];
  650. u8 local_nonce[32];
  651. u8 peer_nonce[32];
  652. u8 mgtk[16];
  653. u8 key_rsc[8];
  654. u8 key_expiration[4];
  655. } STRUCT_PACKED;
  656. #ifdef _MSC_VER
  657. #pragma pack(pop)
  658. #endif /* _MSC_VER */
  659. #define ERP_INFO_NON_ERP_PRESENT BIT(0)
  660. #define ERP_INFO_USE_PROTECTION BIT(1)
  661. #define ERP_INFO_BARKER_PREAMBLE_MODE BIT(2)
  662. #define OVERLAPPING_BSS_TRANS_DELAY_FACTOR 5
  663. /* HT Capabilities Info field within HT Capabilities element */
  664. #define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0))
  665. #define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1))
  666. #define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3)))
  667. #define HT_CAP_INFO_SMPS_STATIC ((u16) 0)
  668. #define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2))
  669. #define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3)))
  670. #define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4))
  671. #define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5))
  672. #define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6))
  673. #define HT_CAP_INFO_TX_STBC ((u16) BIT(7))
  674. #define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9)))
  675. #define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8))
  676. #define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9))
  677. #define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9)))
  678. #define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10))
  679. #define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11))
  680. #define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12))
  681. /* B13 - Reserved (was PSMP support during P802.11n development) */
  682. #define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14))
  683. #define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
  684. /* HT Extended Capabilities field within HT Capabilities element */
  685. #define EXT_HT_CAP_INFO_PCO ((u16) BIT(0))
  686. #define EXT_HT_CAP_INFO_PCO_TRANS_TIME_MASK ((u16) (BIT(1) | BIT(2)))
  687. #define EXT_HT_CAP_INFO_TRANS_TIME_OFFSET 1
  688. /* B3..B7 - Reserved */
  689. #define EXT_HT_CAP_INFO_MCS_FEEDBACK_MASK ((u16) (BIT(8) | BIT(9)))
  690. #define EXT_HT_CAP_INFO_MCS_FEEDBACK_OFFSET 8
  691. #define EXT_HT_CAP_INFO_HTC_SUPPORT ((u16) BIT(10))
  692. #define EXT_HT_CAP_INFO_RD_RESPONDER ((u16) BIT(11))
  693. /* B12..B15 - Reserved */
  694. /* Transmit Beanforming Capabilities within HT Capabilities element */
  695. #define TX_BF_CAP_IMPLICIT_TXBF_RX_CAP ((u32) BIT(0))
  696. #define TX_BF_CAP_RX_STAGGERED_SOUNDING_CAP ((u32) BIT(1))
  697. #define TX_BF_CAP_TX_STAGGERED_SOUNDING_CAP ((u32) BIT(2))
  698. #define TX_BF_CAP_RX_NDP_CAP ((u32) BIT(3))
  699. #define TX_BF_CAP_TX_NDP_CAP ((u32) BIT(4))
  700. #define TX_BF_CAP_IMPLICIT_TX_BF_CAP ((u32) BIT(5))
  701. #define TX_BF_CAP_CALIBRATION_MASK ((u32) (BIT(6) | BIT(7))
  702. #define TX_BF_CAP_CALIB_OFFSET 6
  703. #define TX_BF_CAP_EXPLICIT_CSI_TXBF_CAP ((u32) BIT(8))
  704. #define TX_BF_CAP_EXPLICIT_NONCOMPR_STEERING_CAP ((u32) BIT(9))
  705. #define TX_BF_CAP_EXPLICIT_COMPR_STEERING_CAP ((u32) BIT(10))
  706. #define TX_BF_CAP_EXPLICIT_TX_BF_CSI_FEEDBACK_MASK ((u32) (BIT(10) | BIT(11)))
  707. #define TX_BF_CAP_EXPLICIT_BF_CSI_FEEDBACK_OFFSET 11
  708. #define TX_BF_CAP_EXPLICIT_UNCOMPR_STEERING_MATRIX_FEEDBACK_OFFSET 13
  709. #define TX_BF_CAP_EXPLICIT_COMPRESSED_STEERING_MATRIX_FEEDBACK_OFFSET 15
  710. #define TX_BF_CAP_MINIMAL_GROUPING_OFFSET 17
  711. #define TX_BF_CAP_CSI_NUM_BEAMFORMER_ANT_OFFSET 19
  712. #define TX_BF_CAP_UNCOMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 21
  713. #define TX_BF_CAP_COMPRESSED_STEERING_MATRIX_BEAMFORMER_ANT_OFFSET 23
  714. #define TX_BF_CAP_SCI_MAX_OF_ROWS_BEANFORMER_SUPPORTED_OFFSET 25
  715. #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_MASK ((u32) (BIT(27) | BIT(28)))
  716. #define TX_BF_CAP_CHANNEL_ESTIMATION_CAP_OFFSET 27
  717. /* B29..B31 - Reserved */
  718. /* ASEL Capability field within HT Capabilities element */
  719. #define ASEL_CAP_ASEL_CAPABLE ((u8) BIT(0))
  720. #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(1))
  721. #define ASEL_CAP_ANT_INDICES_FEEDBACK_BASED_TX_AS_CAP ((u8) BIT(2))
  722. #define ASEL_CAP_EXPLICIT_CSI_FEEDBACK_CAP ((u8) BIT(3))
  723. #define ASEL_CAP_ANT_INDICES_FEEDBACK_CAP ((u8) BIT(4))
  724. #define ASEL_CAP_RX_AS_CAP ((u8) BIT(5))
  725. #define ASEL_CAP_TX_SOUNDING_PPDUS_CAP ((u8) BIT(6))
  726. /* B7 - Reserved */
  727. /* First octet of HT Operation Information within HT Operation element */
  728. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1))
  729. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0))
  730. #define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1))
  731. #define HT_INFO_HT_PARAM_STA_CHNL_WIDTH ((u8) BIT(2))
  732. #define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3))
  733. /* B4..B7 - Reserved */
  734. /* HT Protection (B8..B9 of HT Operation Information) */
  735. #define HT_PROT_NO_PROTECTION 0
  736. #define HT_PROT_NONMEMBER_PROTECTION 1
  737. #define HT_PROT_20MHZ_PROTECTION 2
  738. #define HT_PROT_NON_HT_MIXED 3
  739. /* Bits within ieee80211_ht_operation::operation_mode (BIT(0) maps to B8 in
  740. * HT Operation Information) */
  741. #define HT_OPER_OP_MODE_HT_PROT_MASK ((u16) (BIT(0) | BIT(1))) /* B8..B9 */
  742. #define HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT ((u16) BIT(2)) /* B10 */
  743. /* BIT(3), i.e., B11 in HT Operation Information field - Reserved */
  744. #define HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT ((u16) BIT(4)) /* B12 */
  745. /* BIT(5)..BIT(15), i.e., B13..B23 - Reserved */
  746. /* Last two octets of HT Operation Information (BIT(0) = B24) */
  747. /* B24..B29 - Reserved */
  748. #define HT_OPER_PARAM_DUAL_BEACON ((u16) BIT(6))
  749. #define HT_OPER_PARAM_DUAL_CTS_PROTECTION ((u16) BIT(7))
  750. #define HT_OPER_PARAM_STBC_BEACON ((u16) BIT(8))
  751. #define HT_OPER_PARAM_LSIG_TXOP_PROT_FULL_SUPP ((u16) BIT(9))
  752. #define HT_OPER_PARAM_PCO_ACTIVE ((u16) BIT(10))
  753. #define HT_OPER_PARAM_PCO_PHASE ((u16) BIT(11))
  754. /* B36..B39 - Reserved */
  755. #define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
  756. #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
  757. /* VHT Defines */
  758. #define VHT_CAP_MAX_MPDU_LENGTH_7991 ((u32) BIT(0))
  759. #define VHT_CAP_MAX_MPDU_LENGTH_11454 ((u32) BIT(1))
  760. #define VHT_CAP_MAX_MPDU_LENGTH_MASK ((u32) BIT(0) | BIT(1))
  761. #define VHT_CAP_MAX_MPDU_LENGTH_MASK_SHIFT 0
  762. #define VHT_CAP_SUPP_CHAN_WIDTH_160MHZ ((u32) BIT(2))
  763. #define VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ ((u32) BIT(3))
  764. #define VHT_CAP_SUPP_CHAN_WIDTH_MASK ((u32) BIT(2) | BIT(3))
  765. #define VHT_CAP_RXLDPC ((u32) BIT(4))
  766. #define VHT_CAP_SHORT_GI_80 ((u32) BIT(5))
  767. #define VHT_CAP_SHORT_GI_160 ((u32) BIT(6))
  768. #define VHT_CAP_TXSTBC ((u32) BIT(7))
  769. #define VHT_CAP_RXSTBC_1 ((u32) BIT(8))
  770. #define VHT_CAP_RXSTBC_2 ((u32) BIT(9))
  771. #define VHT_CAP_RXSTBC_3 ((u32) BIT(8) | BIT(9))
  772. #define VHT_CAP_RXSTBC_4 ((u32) BIT(10))
  773. #define VHT_CAP_RXSTBC_MASK ((u32) BIT(8) | BIT(9) | \
  774. BIT(10))
  775. #define VHT_CAP_RXSTBC_MASK_SHIFT 8
  776. #define VHT_CAP_SU_BEAMFORMER_CAPABLE ((u32) BIT(11))
  777. #define VHT_CAP_SU_BEAMFORMEE_CAPABLE ((u32) BIT(12))
  778. #define VHT_CAP_BEAMFORMEE_STS_MAX ((u32) BIT(13) | \
  779. BIT(14) | BIT(15))
  780. #define VHT_CAP_BEAMFORMEE_STS_MAX_SHIFT 13
  781. #define VHT_CAP_BEAMFORMEE_STS_OFFSET 13
  782. #define VHT_CAP_SOUNDING_DIMENSION_MAX ((u32) BIT(16) | \
  783. BIT(17) | BIT(18))
  784. #define VHT_CAP_SOUNDING_DIMENSION_MAX_SHIFT 16
  785. #define VHT_CAP_SOUNDING_DIMENSION_OFFSET 16
  786. #define VHT_CAP_MU_BEAMFORMER_CAPABLE ((u32) BIT(19))
  787. #define VHT_CAP_MU_BEAMFORMEE_CAPABLE ((u32) BIT(20))
  788. #define VHT_CAP_VHT_TXOP_PS ((u32) BIT(21))
  789. #define VHT_CAP_HTC_VHT ((u32) BIT(22))
  790. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_1 ((u32) BIT(23))
  791. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_2 ((u32) BIT(24))
  792. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_3 ((u32) BIT(23) | BIT(24))
  793. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_4 ((u32) BIT(25))
  794. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_5 ((u32) BIT(23) | BIT(25))
  795. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_6 ((u32) BIT(24) | BIT(25))
  796. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX ((u32) BIT(23) | \
  797. BIT(24) | BIT(25))
  798. #define VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MAX_SHIFT 23
  799. #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB ((u32) BIT(27))
  800. #define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27))
  801. #define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28))
  802. #define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29))
  803. #define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1))
  804. #define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \
  805. BIT(6))
  806. #define VHT_OPMODE_NOTIF_RX_NSS_SHIFT 4
  807. #define VHT_RX_NSS_MAX_STREAMS 8
  808. /* VHT channel widths */
  809. #define VHT_CHANWIDTH_USE_HT 0
  810. #define VHT_CHANWIDTH_80MHZ 1
  811. #define VHT_CHANWIDTH_160MHZ 2
  812. #define VHT_CHANWIDTH_80P80MHZ 3
  813. #define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
  814. * 00:50:F2 */
  815. #define WPA_IE_VENDOR_TYPE 0x0050f201
  816. #define WMM_IE_VENDOR_TYPE 0x0050f202
  817. #define WPS_IE_VENDOR_TYPE 0x0050f204
  818. #define OUI_WFA 0x506f9a
  819. #define P2P_IE_VENDOR_TYPE 0x506f9a09
  820. #define WFD_IE_VENDOR_TYPE 0x506f9a0a
  821. #define WFD_OUI_TYPE 10
  822. #define HS20_IE_VENDOR_TYPE 0x506f9a10
  823. #define OSEN_IE_VENDOR_TYPE 0x506f9a12
  824. #define MBO_IE_VENDOR_TYPE 0x506f9a16
  825. #define MBO_OUI_TYPE 22
  826. #define WMM_OUI_TYPE 2
  827. #define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
  828. #define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
  829. #define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
  830. #define WMM_VERSION 1
  831. #define WMM_ACTION_CODE_ADDTS_REQ 0
  832. #define WMM_ACTION_CODE_ADDTS_RESP 1
  833. #define WMM_ACTION_CODE_DELTS 2
  834. #define WMM_ADDTS_STATUS_ADMISSION_ACCEPTED 0
  835. #define WMM_ADDTS_STATUS_INVALID_PARAMETERS 1
  836. /* 2 - Reserved */
  837. #define WMM_ADDTS_STATUS_REFUSED 3
  838. /* 4-255 - Reserved */
  839. /* WMM TSPEC Direction Field Values */
  840. #define WMM_TSPEC_DIRECTION_UPLINK 0
  841. #define WMM_TSPEC_DIRECTION_DOWNLINK 1
  842. /* 2 - Reserved */
  843. #define WMM_TSPEC_DIRECTION_BI_DIRECTIONAL 3
  844. /*
  845. * WMM Information Element (used in (Re)Association Request frames; may also be
  846. * used in Beacon frames)
  847. */
  848. struct wmm_information_element {
  849. /* Element ID: 221 (0xdd); Length: 7 */
  850. /* required fields for WMM version 1 */
  851. u8 oui[3]; /* 00:50:f2 */
  852. u8 oui_type; /* 2 */
  853. u8 oui_subtype; /* 0 */
  854. u8 version; /* 1 for WMM version 1.0 */
  855. u8 qos_info; /* AP/STA specific QoS info */
  856. } STRUCT_PACKED;
  857. #define WMM_QOSINFO_AP_UAPSD 0x80
  858. #define WMM_QOSINFO_STA_AC_MASK 0x0f
  859. #define WMM_QOSINFO_STA_SP_MASK 0x03
  860. #define WMM_QOSINFO_STA_SP_SHIFT 5
  861. #define WMM_AC_AIFSN_MASK 0x0f
  862. #define WMM_AC_AIFNS_SHIFT 0
  863. #define WMM_AC_ACM 0x10
  864. #define WMM_AC_ACI_MASK 0x60
  865. #define WMM_AC_ACI_SHIFT 5
  866. #define WMM_AC_ECWMIN_MASK 0x0f
  867. #define WMM_AC_ECWMIN_SHIFT 0
  868. #define WMM_AC_ECWMAX_MASK 0xf0
  869. #define WMM_AC_ECWMAX_SHIFT 4
  870. struct wmm_ac_parameter {
  871. u8 aci_aifsn; /* AIFSN, ACM, ACI */
  872. u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
  873. le16 txop_limit;
  874. } STRUCT_PACKED;
  875. /*
  876. * WMM Parameter Element (used in Beacon, Probe Response, and (Re)Association
  877. * Response frmaes)
  878. */
  879. struct wmm_parameter_element {
  880. /* Element ID: 221 (0xdd); Length: 24 */
  881. /* required fields for WMM version 1 */
  882. u8 oui[3]; /* 00:50:f2 */
  883. u8 oui_type; /* 2 */
  884. u8 oui_subtype; /* 1 */
  885. u8 version; /* 1 for WMM version 1.0 */
  886. u8 qos_info; /* AP/STA specific QoS info */
  887. u8 reserved; /* 0 */
  888. struct wmm_ac_parameter ac[4]; /* AC_BE, AC_BK, AC_VI, AC_VO */
  889. } STRUCT_PACKED;
  890. /* WMM TSPEC Element */
  891. struct wmm_tspec_element {
  892. u8 eid; /* 221 = 0xdd */
  893. u8 length; /* 6 + 55 = 61 */
  894. u8 oui[3]; /* 00:50:f2 */
  895. u8 oui_type; /* 2 */
  896. u8 oui_subtype; /* 2 */
  897. u8 version; /* 1 */
  898. /* WMM TSPEC body (55 octets): */
  899. u8 ts_info[3];
  900. le16 nominal_msdu_size;
  901. le16 maximum_msdu_size;
  902. le32 minimum_service_interval;
  903. le32 maximum_service_interval;
  904. le32 inactivity_interval;
  905. le32 suspension_interval;
  906. le32 service_start_time;
  907. le32 minimum_data_rate;
  908. le32 mean_data_rate;
  909. le32 peak_data_rate;
  910. le32 maximum_burst_size;
  911. le32 delay_bound;
  912. le32 minimum_phy_rate;
  913. le16 surplus_bandwidth_allowance;
  914. le16 medium_time;
  915. } STRUCT_PACKED;
  916. /* Access Categories / ACI to AC coding */
  917. enum wmm_ac {
  918. WMM_AC_BE = 0 /* Best Effort */,
  919. WMM_AC_BK = 1 /* Background */,
  920. WMM_AC_VI = 2 /* Video */,
  921. WMM_AC_VO = 3 /* Voice */,
  922. WMM_AC_NUM = 4
  923. };
  924. #define HS20_INDICATION_OUI_TYPE 16
  925. #define HS20_ANQP_OUI_TYPE 17
  926. #define HS20_OSEN_OUI_TYPE 18
  927. #define HS20_STYPE_QUERY_LIST 1
  928. #define HS20_STYPE_CAPABILITY_LIST 2
  929. #define HS20_STYPE_OPERATOR_FRIENDLY_NAME 3
  930. #define HS20_STYPE_WAN_METRICS 4
  931. #define HS20_STYPE_CONNECTION_CAPABILITY 5
  932. #define HS20_STYPE_NAI_HOME_REALM_QUERY 6
  933. #define HS20_STYPE_OPERATING_CLASS 7
  934. #define HS20_STYPE_OSU_PROVIDERS_LIST 8
  935. #define HS20_STYPE_ICON_REQUEST 10
  936. #define HS20_STYPE_ICON_BINARY_FILE 11
  937. #define HS20_DGAF_DISABLED 0x01
  938. #define HS20_PPS_MO_ID_PRESENT 0x02
  939. #define HS20_ANQP_DOMAIN_ID_PRESENT 0x04
  940. #define HS20_VERSION 0x10 /* Release 2 */
  941. /* WNM-Notification WFA vendors specific subtypes */
  942. #define HS20_WNM_SUB_REM_NEEDED 0
  943. #define HS20_WNM_DEAUTH_IMMINENT_NOTICE 1
  944. #define HS20_DEAUTH_REASON_CODE_BSS 0
  945. #define HS20_DEAUTH_REASON_CODE_ESS 1
  946. /* MBO v0.0_r19, 4.2: MBO Attributes */
  947. /* Table 4-5: MBO Attributes */
  948. enum mbo_attr_id {
  949. MBO_ATTR_ID_AP_CAPA_IND = 1,
  950. MBO_ATTR_ID_NON_PREF_CHAN_REPORT = 2,
  951. MBO_ATTR_ID_CELL_DATA_CAPA = 3,
  952. MBO_ATTR_ID_ASSOC_DISALLOW = 4,
  953. MBO_ATTR_ID_CELL_DATA_PREF = 5,
  954. MBO_ATTR_ID_TRANSITION_REASON = 6,
  955. MBO_ATTR_ID_TRANSITION_REJECT_REASON = 7,
  956. MBO_ATTR_ID_ASSOC_RETRY_DELAY = 8,
  957. };
  958. /* MBO v0.0_r19, 4.2.1: MBO AP Capability Indication Attribute */
  959. /* Table 4-7: MBO AP Capability Indication Field Values */
  960. #define MBO_AP_CAPA_CELL_AWARE BIT(6)
  961. /* MBO v0.0_r19, 4.2.2: Non-preferred Channel Report Attribute */
  962. /* Table 4-10: Reason Code Field Values */
  963. enum mbo_non_pref_chan_reason {
  964. MBO_NON_PREF_CHAN_REASON_UNSPECIFIED = 0,
  965. MBO_NON_PREF_CHAN_REASON_RSSI = 1,
  966. MBO_NON_PREF_CHAN_REASON_EXT_INTERFERENCE = 2,
  967. MBO_NON_PREF_CHAN_REASON_INT_INTERFERENCE = 3,
  968. };
  969. /* MBO v0.0_r19, 4.2.3: Cellular Data Capabilities Attribute */
  970. /* Table 4-13: Cellular Data Connectivity Field */
  971. enum mbo_cellular_capa {
  972. MBO_CELL_CAPA_AVAILABLE = 1,
  973. MBO_CELL_CAPA_NOT_AVAILABLE = 2,
  974. MBO_CELL_CAPA_NOT_SUPPORTED = 3,
  975. };
  976. /* MBO v0.0_r19, 4.2.4: Association Disallowed Attribute */
  977. /* Table 4-15: Reason Code Field Values */
  978. enum mbo_assoc_disallow_reason {
  979. MBO_ASSOC_DISALLOW_REASON_UNSPECIFIED = 1,
  980. MBO_ASSOC_DISALLOW_REASON_MAX_STA = 2,
  981. MBO_ASSOC_DISALLOW_REASON_AIR_INTERFERENCE = 3,
  982. MBO_ASSOC_DISALLOW_REASON_AUTH_SERVER_OVERLOAD = 4,
  983. MBO_ASSOC_DISALLOW_REASON_LOW_RSSI = 5,
  984. };
  985. /* MBO v0.0_r19, 4.2.5: Cellular Data Connection Preference Attribute */
  986. /* Table 4-17: Cellular Preference Field Values */
  987. enum mbo_cell_pref {
  988. MBO_CELL_PREF_EXCLUDED = 0,
  989. MBO_CELL_PREF_NO_USE = 1,
  990. MBO_CELL_PREF_USE = 255
  991. };
  992. /* MBO v0.0_r19, 4.2.6: Transition Reason Code Attribute */
  993. /* Table 4-19: Transition Reason Code Field Values */
  994. enum mbo_transition_reason {
  995. MBO_TRANSITION_REASON_UNSPECIFIED = 0,
  996. MBO_TRANSITION_REASON_FRAME_LOSS = 1,
  997. MBO_TRANSITION_REASON_DELAY = 2,
  998. MBO_TRANSITION_REASON_BANDWIDTH = 3,
  999. MBO_TRANSITION_REASON_LOAD_BALANCE = 4,
  1000. MBO_TRANSITION_REASON_RSSI = 5,
  1001. MBO_TRANSITION_REASON_RETRANSMISSIONS = 6,
  1002. MBO_TRANSITION_REASON_INTERFERENCE = 7,
  1003. MBO_TRANSITION_REASON_GRAY_ZONE = 8,
  1004. MBO_TRANSITION_REASON_PREMIUM_AP = 9,
  1005. };
  1006. /* MBO v0.0_r19, 4.2.7: Transition Rejection Reason Code Attribute */
  1007. /* Table 4-21: Transition Rejection Reason Code Field Values */
  1008. enum mbo_transition_reject_reason {
  1009. MBO_TRANSITION_REJECT_REASON_UNSPECIFIED = 0,
  1010. MBO_TRANSITION_REJECT_REASON_FRAME_LOSS = 1,
  1011. MBO_TRANSITION_REJECT_REASON_DELAY = 2,
  1012. MBO_TRANSITION_REJECT_REASON_QOS_CAPACITY = 3,
  1013. MBO_TRANSITION_REJECT_REASON_RSSI = 4,
  1014. MBO_TRANSITION_REJECT_REASON_INTERFERENCE = 5,
  1015. MBO_TRANSITION_REJECT_REASON_SERVICES = 6,
  1016. };
  1017. /* Wi-Fi Direct (P2P) */
  1018. #define P2P_OUI_TYPE 9
  1019. enum p2p_attr_id {
  1020. P2P_ATTR_STATUS = 0,
  1021. P2P_ATTR_MINOR_REASON_CODE = 1,
  1022. P2P_ATTR_CAPABILITY = 2,
  1023. P2P_ATTR_DEVICE_ID = 3,
  1024. P2P_ATTR_GROUP_OWNER_INTENT = 4,
  1025. P2P_ATTR_CONFIGURATION_TIMEOUT = 5,
  1026. P2P_ATTR_LISTEN_CHANNEL = 6,
  1027. P2P_ATTR_GROUP_BSSID = 7,
  1028. P2P_ATTR_EXT_LISTEN_TIMING = 8,
  1029. P2P_ATTR_INTENDED_INTERFACE_ADDR = 9,
  1030. P2P_ATTR_MANAGEABILITY = 10,
  1031. P2P_ATTR_CHANNEL_LIST = 11,
  1032. P2P_ATTR_NOTICE_OF_ABSENCE = 12,
  1033. P2P_ATTR_DEVICE_INFO = 13,
  1034. P2P_ATTR_GROUP_INFO = 14,
  1035. P2P_ATTR_GROUP_ID = 15,
  1036. P2P_ATTR_INTERFACE = 16,
  1037. P2P_ATTR_OPERATING_CHANNEL = 17,
  1038. P2P_ATTR_INVITATION_FLAGS = 18,
  1039. P2P_ATTR_OOB_GO_NEG_CHANNEL = 19,
  1040. P2P_ATTR_SERVICE_HASH = 21,
  1041. P2P_ATTR_SESSION_INFORMATION_DATA = 22,
  1042. P2P_ATTR_CONNECTION_CAPABILITY = 23,
  1043. P2P_ATTR_ADVERTISEMENT_ID = 24,
  1044. P2P_ATTR_ADVERTISED_SERVICE = 25,
  1045. P2P_ATTR_SESSION_ID = 26,
  1046. P2P_ATTR_FEATURE_CAPABILITY = 27,
  1047. P2P_ATTR_PERSISTENT_GROUP = 28,
  1048. P2P_ATTR_VENDOR_SPECIFIC = 221
  1049. };
  1050. #define P2P_MAX_GO_INTENT 15
  1051. /* P2P Capability - Device Capability bitmap */
  1052. #define P2P_DEV_CAPAB_SERVICE_DISCOVERY BIT(0)
  1053. #define P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY BIT(1)
  1054. #define P2P_DEV_CAPAB_CONCURRENT_OPER BIT(2)
  1055. #define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
  1056. #define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
  1057. #define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
  1058. /* P2P Capability - Group Capability bitmap */
  1059. #define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)
  1060. #define P2P_GROUP_CAPAB_PERSISTENT_GROUP BIT(1)
  1061. #define P2P_GROUP_CAPAB_GROUP_LIMIT BIT(2)
  1062. #define P2P_GROUP_CAPAB_INTRA_BSS_DIST BIT(3)
  1063. #define P2P_GROUP_CAPAB_CROSS_CONN BIT(4)
  1064. #define P2P_GROUP_CAPAB_PERSISTENT_RECONN BIT(5)
  1065. #define P2P_GROUP_CAPAB_GROUP_FORMATION BIT(6)
  1066. #define P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION BIT(7)
  1067. /* P2PS Coordination Protocol Transport Bitmap */
  1068. #define P2PS_FEATURE_CAPAB_UDP_TRANSPORT BIT(0)
  1069. #define P2PS_FEATURE_CAPAB_MAC_TRANSPORT BIT(1)
  1070. struct p2ps_feature_capab {
  1071. u8 cpt;
  1072. u8 reserved;
  1073. } STRUCT_PACKED;
  1074. /* Invitation Flags */
  1075. #define P2P_INVITATION_FLAGS_TYPE BIT(0)
  1076. /* P2P Manageability */
  1077. #define P2P_MAN_DEVICE_MANAGEMENT BIT(0)
  1078. #define P2P_MAN_CROSS_CONNECTION_PERMITTED BIT(1)
  1079. #define P2P_MAN_COEXISTENCE_OPTIONAL BIT(2)
  1080. enum p2p_status_code {
  1081. P2P_SC_SUCCESS = 0,
  1082. P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
  1083. P2P_SC_FAIL_INCOMPATIBLE_PARAMS = 2,
  1084. P2P_SC_FAIL_LIMIT_REACHED = 3,
  1085. P2P_SC_FAIL_INVALID_PARAMS = 4,
  1086. P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE = 5,
  1087. P2P_SC_FAIL_PREV_PROTOCOL_ERROR = 6,
  1088. P2P_SC_FAIL_NO_COMMON_CHANNELS = 7,
  1089. P2P_SC_FAIL_UNKNOWN_GROUP = 8,
  1090. P2P_SC_FAIL_BOTH_GO_INTENT_15 = 9,
  1091. P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD = 10,
  1092. P2P_SC_FAIL_REJECTED_BY_USER = 11,
  1093. P2P_SC_SUCCESS_DEFERRED = 12,
  1094. };
  1095. enum p2p_role_indication {
  1096. P2P_DEVICE_NOT_IN_GROUP = 0x00,
  1097. P2P_CLIENT_IN_A_GROUP = 0x01,
  1098. P2P_GO_IN_A_GROUP = 0x02,
  1099. };
  1100. #define P2P_WILDCARD_SSID "DIRECT-"
  1101. #define P2P_WILDCARD_SSID_LEN 7
  1102. /* P2P action frames */
  1103. enum p2p_act_frame_type {
  1104. P2P_NOA = 0,
  1105. P2P_PRESENCE_REQ = 1,
  1106. P2P_PRESENCE_RESP = 2,
  1107. P2P_GO_DISC_REQ = 3
  1108. };
  1109. /* P2P public action frames */
  1110. enum p2p_action_frame_type {
  1111. P2P_GO_NEG_REQ = 0,
  1112. P2P_GO_NEG_RESP = 1,
  1113. P2P_GO_NEG_CONF = 2,
  1114. P2P_INVITATION_REQ = 3,
  1115. P2P_INVITATION_RESP = 4,
  1116. P2P_DEV_DISC_REQ = 5,
  1117. P2P_DEV_DISC_RESP = 6,
  1118. P2P_PROV_DISC_REQ = 7,
  1119. P2P_PROV_DISC_RESP = 8
  1120. };
  1121. enum p2p_service_protocol_type {
  1122. P2P_SERV_ALL_SERVICES = 0,
  1123. P2P_SERV_BONJOUR = 1,
  1124. P2P_SERV_UPNP = 2,
  1125. P2P_SERV_WS_DISCOVERY = 3,
  1126. P2P_SERV_WIFI_DISPLAY = 4,
  1127. P2P_SERV_P2PS = 11,
  1128. P2P_SERV_VENDOR_SPECIFIC = 255
  1129. };
  1130. enum p2p_sd_status {
  1131. P2P_SD_SUCCESS = 0,
  1132. P2P_SD_PROTO_NOT_AVAILABLE = 1,
  1133. P2P_SD_REQUESTED_INFO_NOT_AVAILABLE = 2,
  1134. P2P_SD_BAD_REQUEST = 3
  1135. };
  1136. enum wifi_display_subelem {
  1137. WFD_SUBELEM_DEVICE_INFO = 0,
  1138. WFD_SUBELEM_ASSOCIATED_BSSID = 1,
  1139. WFD_SUBELEM_AUDIO_FORMATS = 2,
  1140. WFD_SUBELEM_VIDEO_FORMATS = 3,
  1141. WFD_SUBELEM_3D_VIDEO_FORMATS = 4,
  1142. WFD_SUBELEM_CONTENT_PROTECTION = 5,
  1143. WFD_SUBELEM_COUPLED_SINK = 6,
  1144. WFD_SUBELEM_EXT_CAPAB = 7,
  1145. WFD_SUBELEM_LOCAL_IP_ADDRESS = 8,
  1146. WFD_SUBELEM_SESSION_INFO = 9
  1147. };
  1148. /* 802.11s */
  1149. #define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1
  1150. #define MESH_SYNC_METHOD_VENDOR 255
  1151. #define MESH_PATH_PROTOCOL_HWMP 1
  1152. #define MESH_PATH_PROTOCOL_VENDOR 255
  1153. #define MESH_PATH_METRIC_AIRTIME 1
  1154. #define MESH_PATH_METRIC_VENDOR 255
  1155. enum plink_action_field {
  1156. PLINK_OPEN = 1,
  1157. PLINK_CONFIRM,
  1158. PLINK_CLOSE
  1159. };
  1160. #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */
  1161. #define VENDOR_VHT_TYPE 0x04
  1162. #define VENDOR_VHT_SUBTYPE 0x08
  1163. #define VENDOR_VHT_SUBTYPE2 0x00
  1164. #define VENDOR_HT_CAPAB_OUI_TYPE 0x33 /* 00-90-4c:0x33 */
  1165. /* cipher suite selectors */
  1166. #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
  1167. #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
  1168. #define WLAN_CIPHER_SUITE_TKIP 0x000FAC02
  1169. /* reserved: 0x000FAC03 */
  1170. #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04
  1171. #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
  1172. #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
  1173. #define WLAN_CIPHER_SUITE_NO_GROUP_ADDR 0x000FAC07
  1174. #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08
  1175. #define WLAN_CIPHER_SUITE_GCMP_256 0x000FAC09
  1176. #define WLAN_CIPHER_SUITE_CCMP_256 0x000FAC0A
  1177. #define WLAN_CIPHER_SUITE_BIP_GMAC_128 0x000FAC0B
  1178. #define WLAN_CIPHER_SUITE_BIP_GMAC_256 0x000FAC0C
  1179. #define WLAN_CIPHER_SUITE_BIP_CMAC_256 0x000FAC0D
  1180. #define WLAN_CIPHER_SUITE_SMS4 0x00147201
  1181. #define WLAN_CIPHER_SUITE_CKIP 0x00409600
  1182. #define WLAN_CIPHER_SUITE_CKIP_CMIC 0x00409601
  1183. #define WLAN_CIPHER_SUITE_CMIC 0x00409602
  1184. #define WLAN_CIPHER_SUITE_KRK 0x004096FF /* for nl80211 use only */
  1185. /* AKM suite selectors */
  1186. #define WLAN_AKM_SUITE_8021X 0x000FAC01
  1187. #define WLAN_AKM_SUITE_PSK 0x000FAC02
  1188. #define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
  1189. #define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
  1190. #define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05
  1191. #define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06
  1192. #define WLAN_AKM_SUITE_8021X_SUITE_B 0x000FAC11
  1193. #define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC12
  1194. #define WLAN_AKM_SUITE_CCKM 0x00409600
  1195. #define WLAN_AKM_SUITE_OSEN 0x506f9a01
  1196. /* IEEE 802.11v - WNM Action field values */
  1197. enum wnm_action {
  1198. WNM_EVENT_REQ = 0,
  1199. WNM_EVENT_REPORT = 1,
  1200. WNM_DIAGNOSTIC_REQ = 2,
  1201. WNM_DIAGNOSTIC_REPORT = 3,
  1202. WNM_LOCATION_CFG_REQ = 4,
  1203. WNM_LOCATION_CFG_RESP = 5,
  1204. WNM_BSS_TRANS_MGMT_QUERY = 6,
  1205. WNM_BSS_TRANS_MGMT_REQ = 7,
  1206. WNM_BSS_TRANS_MGMT_RESP = 8,
  1207. WNM_FMS_REQ = 9,
  1208. WNM_FMS_RESP = 10,
  1209. WNM_COLLOCATED_INTERFERENCE_REQ = 11,
  1210. WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
  1211. WNM_TFS_REQ = 13,
  1212. WNM_TFS_RESP = 14,
  1213. WNM_TFS_NOTIFY = 15,
  1214. WNM_SLEEP_MODE_REQ = 16,
  1215. WNM_SLEEP_MODE_RESP = 17,
  1216. WNM_TIM_BROADCAST_REQ = 18,
  1217. WNM_TIM_BROADCAST_RESP = 19,
  1218. WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
  1219. WNM_CHANNEL_USAGE_REQ = 21,
  1220. WNM_CHANNEL_USAGE_RESP = 22,
  1221. WNM_DMS_REQ = 23,
  1222. WNM_DMS_RESP = 24,
  1223. WNM_TIMING_MEASUREMENT_REQ = 25,
  1224. WNM_NOTIFICATION_REQ = 26,
  1225. WNM_NOTIFICATION_RESP = 27
  1226. };
  1227. /* IEEE 802.11v - BSS Transition Management Request - Request Mode */
  1228. #define WNM_BSS_TM_REQ_PREF_CAND_LIST_INCLUDED BIT(0)
  1229. #define WNM_BSS_TM_REQ_ABRIDGED BIT(1)
  1230. #define WNM_BSS_TM_REQ_DISASSOC_IMMINENT BIT(2)
  1231. #define WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED BIT(3)
  1232. #define WNM_BSS_TM_REQ_ESS_DISASSOC_IMMINENT BIT(4)
  1233. /* IEEE Std 802.11-2012 - Table 8-253 */
  1234. enum bss_trans_mgmt_status_code {
  1235. WNM_BSS_TM_ACCEPT = 0,
  1236. WNM_BSS_TM_REJECT_UNSPECIFIED = 1,
  1237. WNM_BSS_TM_REJECT_INSUFFICIENT_BEACON = 2,
  1238. WNM_BSS_TM_REJECT_INSUFFICIENT_CAPABITY = 3,
  1239. WNM_BSS_TM_REJECT_UNDESIRED = 4,
  1240. WNM_BSS_TM_REJECT_DELAY_REQUEST = 5,
  1241. WNM_BSS_TM_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6,
  1242. WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES = 7,
  1243. WNM_BSS_TM_REJECT_LEAVING_ESS = 8
  1244. };
  1245. #define WNM_NEIGHBOR_TSF 1
  1246. #define WNM_NEIGHBOR_CONDENSED_COUNTRY_STRING 2
  1247. #define WNM_NEIGHBOR_BSS_TRANSITION_CANDIDATE 3
  1248. #define WNM_NEIGHBOR_BSS_TERMINATION_DURATION 4
  1249. #define WNM_NEIGHBOR_BEARING 5
  1250. #define WNM_NEIGHBOR_MEASUREMENT_PILOT 66
  1251. #define WNM_NEIGHBOR_RRM_ENABLED_CAPABILITIES 70
  1252. #define WNM_NEIGHBOR_MULTIPLE_BSSID 71
  1253. /* QoS action */
  1254. enum qos_action {
  1255. QOS_ADDTS_REQ = 0,
  1256. QOS_ADDTS_RESP = 1,
  1257. QOS_DELTS = 2,
  1258. QOS_SCHEDULE = 3,
  1259. QOS_QOS_MAP_CONFIG = 4,
  1260. };
  1261. /* IEEE Std 802.11-2012, 8.4.2.62 20/40 BSS Coexistence element */
  1262. #define WLAN_20_40_BSS_COEX_INFO_REQ BIT(0)
  1263. #define WLAN_20_40_BSS_COEX_40MHZ_INTOL BIT(1)
  1264. #define WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ BIT(2)
  1265. #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_REQ BIT(3)
  1266. #define WLAN_20_40_BSS_COEX_OBSS_EXEMPT_GRNT BIT(4)
  1267. struct ieee80211_2040_bss_coex_ie {
  1268. u8 element_id;
  1269. u8 length;
  1270. u8 coex_param;
  1271. } STRUCT_PACKED;
  1272. struct ieee80211_2040_intol_chan_report {
  1273. u8 element_id;
  1274. u8 length;
  1275. u8 op_class;
  1276. u8 variable[0]; /* Channel List */
  1277. } STRUCT_PACKED;
  1278. /* IEEE 802.11v - WNM-Sleep Mode element */
  1279. struct wnm_sleep_element {
  1280. u8 eid; /* WLAN_EID_WNMSLEEP */
  1281. u8 len;
  1282. u8 action_type; /* WNM_SLEEP_ENTER/WNM_SLEEP_MODE_EXIT */
  1283. u8 status;
  1284. le16 intval;
  1285. } STRUCT_PACKED;
  1286. #define WNM_SLEEP_MODE_ENTER 0
  1287. #define WNM_SLEEP_MODE_EXIT 1
  1288. enum wnm_sleep_mode_response_status {
  1289. WNM_STATUS_SLEEP_ACCEPT = 0,
  1290. WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE = 1,
  1291. WNM_STATUS_DENIED_ACTION = 2,
  1292. WNM_STATUS_DENIED_TMP = 3,
  1293. WNM_STATUS_DENIED_KEY = 4,
  1294. WNM_STATUS_DENIED_OTHER_WNM_SERVICE = 5
  1295. };
  1296. /* WNM-Sleep Mode subelement IDs */
  1297. enum wnm_sleep_mode_subelement_id {
  1298. WNM_SLEEP_SUBELEM_GTK = 0,
  1299. WNM_SLEEP_SUBELEM_IGTK = 1
  1300. };
  1301. /* Channel Switch modes (802.11h) */
  1302. #define CHAN_SWITCH_MODE_ALLOW_TX 0
  1303. #define CHAN_SWITCH_MODE_BLOCK_TX 1
  1304. struct tpc_report {
  1305. u8 eid;
  1306. u8 len;
  1307. u8 tx_power;
  1308. u8 link_margin;
  1309. } STRUCT_PACKED;
  1310. /* IEEE Std 802.11-2012, 8.5.7.4 - Link Measurement Request frame format */
  1311. struct rrm_link_measurement_request {
  1312. u8 dialog_token;
  1313. s8 tx_power;
  1314. s8 max_tp;
  1315. u8 variable[0];
  1316. } STRUCT_PACKED;
  1317. /* IEEE Std 802.11-2012, 8.5.7.5 - Link Measurement Report frame format */
  1318. struct rrm_link_measurement_report {
  1319. u8 dialog_token;
  1320. struct tpc_report tpc;
  1321. u8 rx_ant_id;
  1322. u8 tx_ant_id;
  1323. u8 rcpi;
  1324. u8 rsni;
  1325. u8 variable[0];
  1326. } STRUCT_PACKED;
  1327. #define SSID_MAX_LEN 32
  1328. /* IEEE Std 802.11ad-2012 - Multi-band element */
  1329. struct multi_band_ie {
  1330. u8 eid; /* WLAN_EID_MULTI_BAND */
  1331. u8 len;
  1332. u8 mb_ctrl;
  1333. u8 band_id;
  1334. u8 op_class;
  1335. u8 chan;
  1336. u8 bssid[ETH_ALEN];
  1337. le16 beacon_int;
  1338. u8 tsf_offs[8];
  1339. u8 mb_connection_capability;
  1340. u8 fst_session_tmout;
  1341. /* Optional:
  1342. * STA MAC Address
  1343. * Pairwise Cipher Suite Count
  1344. * Pairwise Cipher Suite List
  1345. */
  1346. u8 variable[0];
  1347. } STRUCT_PACKED;
  1348. enum mb_ctrl_sta_role {
  1349. MB_STA_ROLE_AP = 0,
  1350. MB_STA_ROLE_TDLS_STA = 1,
  1351. MB_STA_ROLE_IBSS_STA = 2,
  1352. MB_STA_ROLE_PCP = 3,
  1353. MB_STA_ROLE_NON_PCP_NON_AP = 4
  1354. };
  1355. #define MB_CTRL_ROLE_MASK (BIT(0) | BIT(1) | BIT(2))
  1356. #define MB_CTRL_ROLE(ctrl) ((u8) ((ctrl) & MB_CTRL_ROLE_MASK))
  1357. #define MB_CTRL_STA_MAC_PRESENT ((u8) (BIT(3)))
  1358. #define MB_CTRL_PAIRWISE_CIPHER_SUITE_PRESENT ((u8) (BIT(4)))
  1359. enum mb_band_id {
  1360. MB_BAND_ID_WIFI_2_4GHZ = 2, /* 2.4 GHz */
  1361. MB_BAND_ID_WIFI_5GHZ = 4, /* 4.9 and 5 GHz */
  1362. MB_BAND_ID_WIFI_60GHZ = 5, /* 60 GHz */
  1363. };
  1364. #define MB_CONNECTION_CAPABILITY_AP ((u8) (BIT(0)))
  1365. #define MB_CONNECTION_CAPABILITY_PCP ((u8) (BIT(1)))
  1366. #define MB_CONNECTION_CAPABILITY_DLS ((u8) (BIT(2)))
  1367. #define MB_CONNECTION_CAPABILITY_TDLS ((u8) (BIT(3)))
  1368. #define MB_CONNECTION_CAPABILITY_IBSS ((u8) (BIT(4)))
  1369. /* IEEE Std 802.11ad-2014 - FST Action field */
  1370. enum fst_action {
  1371. FST_ACTION_SETUP_REQUEST = 0,
  1372. FST_ACTION_SETUP_RESPONSE = 1,
  1373. FST_ACTION_TEAR_DOWN = 2,
  1374. FST_ACTION_ACK_REQUEST = 3,
  1375. FST_ACTION_ACK_RESPONSE = 4,
  1376. FST_ACTION_ON_CHANNEL_TUNNEL = 5,
  1377. };
  1378. /* IEEE Std 802.11ac-2013, Annex C - dot11PHYType */
  1379. enum phy_type {
  1380. PHY_TYPE_UNSPECIFIED = 0,
  1381. PHY_TYPE_FHSS = 1,
  1382. PHY_TYPE_DSSS = 2,
  1383. PHY_TYPE_IRBASEBAND = 3,
  1384. PHY_TYPE_OFDM = 4,
  1385. PHY_TYPE_HRDSSS = 5,
  1386. PHY_TYPE_ERP = 6,
  1387. PHY_TYPE_HT = 7,
  1388. PHY_TYPE_DMG = 8,
  1389. PHY_TYPE_VHT = 9,
  1390. };
  1391. /* IEEE Std 802.11-2012, 8.4.2.39 - Neighbor Report element */
  1392. /* BSSID Information Field */
  1393. #define NEI_REP_BSSID_INFO_AP_NOT_REACH BIT(0)
  1394. #define NEI_REP_BSSID_INFO_AP_UNKNOWN_REACH BIT(1)
  1395. #define NEI_REP_BSSID_INFO_AP_REACHABLE (BIT(0) | BIT(1))
  1396. #define NEI_REP_BSSID_INFO_SECURITY BIT(2)
  1397. #define NEI_REP_BSSID_INFO_KEY_SCOPE BIT(3)
  1398. #define NEI_REP_BSSID_INFO_SPECTRUM_MGMT BIT(4)
  1399. #define NEI_REP_BSSID_INFO_QOS BIT(5)
  1400. #define NEI_REP_BSSID_INFO_APSD BIT(6)
  1401. #define NEI_REP_BSSID_INFO_RM BIT(7)
  1402. #define NEI_REP_BSSID_INFO_DELAYED_BA BIT(8)
  1403. #define NEI_REP_BSSID_INFO_IMM_BA BIT(9)
  1404. #define NEI_REP_BSSID_INFO_MOBILITY_DOMAIN BIT(10)
  1405. #define NEI_REP_BSSID_INFO_HT BIT(11)
  1406. #endif /* IEEE802_11_DEFS_H */