fw.h 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * NXP Wireless LAN device driver: Firmware specific macros & structures
  4. *
  5. * Copyright 2011-2020 NXP
  6. */
  7. #ifndef _MWIFIEX_FW_H_
  8. #define _MWIFIEX_FW_H_
  9. #include <linux/if_ether.h>
  10. #define INTF_HEADER_LEN 4
  11. struct rfc_1042_hdr {
  12. u8 llc_dsap;
  13. u8 llc_ssap;
  14. u8 llc_ctrl;
  15. u8 snap_oui[3];
  16. __be16 snap_type;
  17. } __packed;
  18. struct rx_packet_hdr {
  19. struct ethhdr eth803_hdr;
  20. struct rfc_1042_hdr rfc1042_hdr;
  21. } __packed;
  22. struct tx_packet_hdr {
  23. struct ethhdr eth803_hdr;
  24. struct rfc_1042_hdr rfc1042_hdr;
  25. } __packed;
  26. struct mwifiex_fw_header {
  27. __le32 dnld_cmd;
  28. __le32 base_addr;
  29. __le32 data_length;
  30. __le32 crc;
  31. } __packed;
  32. struct mwifiex_fw_data {
  33. struct mwifiex_fw_header header;
  34. __le32 seq_num;
  35. u8 data[1];
  36. } __packed;
  37. struct mwifiex_fw_dump_header {
  38. __le16 seq_num;
  39. __le16 reserved;
  40. __le16 type;
  41. __le16 len;
  42. } __packed;
  43. #define FW_DUMP_INFO_ENDED 0x0002
  44. #define MWIFIEX_FW_DNLD_CMD_1 0x1
  45. #define MWIFIEX_FW_DNLD_CMD_5 0x5
  46. #define MWIFIEX_FW_DNLD_CMD_6 0x6
  47. #define MWIFIEX_FW_DNLD_CMD_7 0x7
  48. #define B_SUPPORTED_RATES 5
  49. #define G_SUPPORTED_RATES 9
  50. #define BG_SUPPORTED_RATES 13
  51. #define A_SUPPORTED_RATES 9
  52. #define HOSTCMD_SUPPORTED_RATES 14
  53. #define N_SUPPORTED_RATES 3
  54. #define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN | \
  55. BAND_AN | BAND_AAC)
  56. #define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11) | \
  57. BIT(13))
  58. #define IS_SUPPORT_MULTI_BANDS(adapter) \
  59. (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
  60. /* bit 13: 11ac BAND_AAC
  61. * bit 12: reserved for lab testing, will be reused for BAND_AN
  62. * bit 11: 11n BAND_GN
  63. * bit 10: 11a BAND_A
  64. * bit 9: 11g BAND_G
  65. * bit 8: 11b BAND_B
  66. * Map these bits to band capability by right shifting 8 bits.
  67. */
  68. #define GET_FW_DEFAULT_BANDS(adapter) \
  69. (((adapter->fw_cap_info & 0x2f00) >> 8) & \
  70. ALL_802_11_BANDS)
  71. #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  72. #define KEY_INFO_ENABLED 0x01
  73. enum KEY_TYPE_ID {
  74. KEY_TYPE_ID_WEP = 0,
  75. KEY_TYPE_ID_TKIP,
  76. KEY_TYPE_ID_AES,
  77. KEY_TYPE_ID_WAPI,
  78. KEY_TYPE_ID_AES_CMAC,
  79. KEY_TYPE_ID_AES_CMAC_DEF,
  80. };
  81. #define WPA_PN_SIZE 8
  82. #define KEY_PARAMS_FIXED_LEN 10
  83. #define KEY_INDEX_MASK 0xf
  84. #define KEY_API_VER_MAJOR_V2 2
  85. #define KEY_MCAST BIT(0)
  86. #define KEY_UNICAST BIT(1)
  87. #define KEY_ENABLED BIT(2)
  88. #define KEY_DEFAULT BIT(3)
  89. #define KEY_TX_KEY BIT(4)
  90. #define KEY_RX_KEY BIT(5)
  91. #define KEY_IGTK BIT(10)
  92. #define WAPI_KEY_LEN (WLAN_KEY_LEN_SMS4 + PN_LEN + 2)
  93. #define MAX_POLL_TRIES 100
  94. #define MAX_FIRMWARE_POLL_TRIES 150
  95. #define FIRMWARE_READY_SDIO 0xfedc
  96. #define FIRMWARE_READY_PCIE 0xfedcba00
  97. #define MWIFIEX_COEX_MODE_TIMESHARE 0x01
  98. #define MWIFIEX_COEX_MODE_SPATIAL 0x82
  99. enum mwifiex_usb_ep {
  100. MWIFIEX_USB_EP_CMD_EVENT = 1,
  101. MWIFIEX_USB_EP_DATA = 2,
  102. MWIFIEX_USB_EP_DATA_CH2 = 3,
  103. };
  104. enum MWIFIEX_802_11_PRIVACY_FILTER {
  105. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  106. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  107. };
  108. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  109. #define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
  110. #define UAP_BSS_PARAMS_I 0
  111. #define UAP_CUSTOM_IE_I 1
  112. #define MWIFIEX_AUTO_IDX_MASK 0xffff
  113. #define MWIFIEX_DELETE_MASK 0x0000
  114. #define MGMT_MASK_ASSOC_REQ 0x01
  115. #define MGMT_MASK_REASSOC_REQ 0x04
  116. #define MGMT_MASK_ASSOC_RESP 0x02
  117. #define MGMT_MASK_REASSOC_RESP 0x08
  118. #define MGMT_MASK_PROBE_REQ 0x10
  119. #define MGMT_MASK_PROBE_RESP 0x20
  120. #define MGMT_MASK_BEACON 0x100
  121. #define TLV_TYPE_UAP_SSID 0x0000
  122. #define TLV_TYPE_UAP_RATES 0x0001
  123. #define TLV_TYPE_PWR_CONSTRAINT 0x0020
  124. #define PROPRIETARY_TLV_BASE_ID 0x0100
  125. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  126. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  127. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  128. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  129. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  130. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  131. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  132. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  133. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  134. #define TLV_TYPE_BGSCAN_START_LATER (PROPRIETARY_TLV_BASE_ID + 30)
  135. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  136. #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
  137. #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
  138. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  139. #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
  140. #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
  141. #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
  142. #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
  143. #define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
  144. #define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
  145. #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
  146. #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
  147. #define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
  148. #define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
  149. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  150. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  151. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  152. #define TLV_TYPE_BSS_SCAN_RSP (PROPRIETARY_TLV_BASE_ID + 86)
  153. #define TLV_TYPE_BSS_SCAN_INFO (PROPRIETARY_TLV_BASE_ID + 87)
  154. #define TLV_TYPE_CHANRPT_11H_BASIC (PROPRIETARY_TLV_BASE_ID + 91)
  155. #define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
  156. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  157. #define TLV_TYPE_ROBUST_COEX (PROPRIETARY_TLV_BASE_ID + 96)
  158. #define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
  159. #define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
  160. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  161. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  162. #define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
  163. #define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
  164. #define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
  165. #define TLV_TYPE_TX_PAUSE (PROPRIETARY_TLV_BASE_ID + 148)
  166. #define TLV_TYPE_RXBA_SYNC (PROPRIETARY_TLV_BASE_ID + 153)
  167. #define TLV_TYPE_COALESCE_RULE (PROPRIETARY_TLV_BASE_ID + 154)
  168. #define TLV_TYPE_KEY_PARAM_V2 (PROPRIETARY_TLV_BASE_ID + 156)
  169. #define TLV_TYPE_REPEAT_COUNT (PROPRIETARY_TLV_BASE_ID + 176)
  170. #define TLV_TYPE_PS_PARAMS_IN_HS (PROPRIETARY_TLV_BASE_ID + 181)
  171. #define TLV_TYPE_MULTI_CHAN_INFO (PROPRIETARY_TLV_BASE_ID + 183)
  172. #define TLV_TYPE_MC_GROUP_INFO (PROPRIETARY_TLV_BASE_ID + 184)
  173. #define TLV_TYPE_TDLS_IDLE_TIMEOUT (PROPRIETARY_TLV_BASE_ID + 194)
  174. #define TLV_TYPE_SCAN_CHANNEL_GAP (PROPRIETARY_TLV_BASE_ID + 197)
  175. #define TLV_TYPE_API_REV (PROPRIETARY_TLV_BASE_ID + 199)
  176. #define TLV_TYPE_CHANNEL_STATS (PROPRIETARY_TLV_BASE_ID + 198)
  177. #define TLV_BTCOEX_WL_AGGR_WINSIZE (PROPRIETARY_TLV_BASE_ID + 202)
  178. #define TLV_BTCOEX_WL_SCANTIME (PROPRIETARY_TLV_BASE_ID + 203)
  179. #define TLV_TYPE_BSS_MODE (PROPRIETARY_TLV_BASE_ID + 206)
  180. #define TLV_TYPE_RANDOM_MAC (PROPRIETARY_TLV_BASE_ID + 236)
  181. #define TLV_TYPE_CHAN_ATTR_CFG (PROPRIETARY_TLV_BASE_ID + 237)
  182. #define TLV_TYPE_MAX_CONN (PROPRIETARY_TLV_BASE_ID + 279)
  183. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  184. #define SSN_MASK 0xfff0
  185. #define BA_RESULT_SUCCESS 0x0
  186. #define BA_RESULT_TIMEOUT 0x2
  187. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  188. #define BA_STREAM_NOT_ALLOWED 0xff
  189. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  190. priv->adapter->config_bands & BAND_AN) && \
  191. priv->curr_bss_params.bss_descriptor.bcn_ht_cap && \
  192. !priv->curr_bss_params.bss_descriptor.disable_11n)
  193. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  194. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  195. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  196. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  197. #define MWIFIEX_TX_DATA_BUF_SIZE_12K 12288
  198. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  199. #define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14))
  200. #define ISSUPP_DRCS_ENABLED(FwCapInfo) (FwCapInfo & BIT(15))
  201. #define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16))
  202. #define ISSUPP_ADHOC_ENABLED(FwCapInfo) (FwCapInfo & BIT(25))
  203. #define ISSUPP_RANDOM_MAC(FwCapInfo) (FwCapInfo & BIT(27))
  204. #define ISSUPP_FIRMWARE_SUPPLICANT(FwCapInfo) (FwCapInfo & BIT(21))
  205. #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
  206. (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
  207. IEEE80211_HT_CAP_SM_PS)
  208. #define MWIFIEX_DEF_11N_TX_BF_CAP 0x09E1E008
  209. #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
  210. /* dev_cap bitmap
  211. * BIT
  212. * 0-16 reserved
  213. * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
  214. * 18-22 reserved
  215. * 23 IEEE80211_HT_CAP_SGI_20
  216. * 24 IEEE80211_HT_CAP_SGI_40
  217. * 25 IEEE80211_HT_CAP_TX_STBC
  218. * 26 IEEE80211_HT_CAP_RX_STBC
  219. * 27-28 reserved
  220. * 29 IEEE80211_HT_CAP_GRN_FLD
  221. * 30-31 reserved
  222. */
  223. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  224. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  225. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  226. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  227. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  228. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  229. #define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
  230. #define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
  231. #define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & BIT(30))
  232. #define ISALLOWED_CHANWIDTH40(ht_param) (ht_param & BIT(2))
  233. #define GETSUPP_TXBASTREAMS(Dot11nDevCap) ((Dot11nDevCap >> 18) & 0xF)
  234. /* httxcfg bitmap
  235. * 0 reserved
  236. * 1 20/40 Mhz enable(1)/disable(0)
  237. * 2-3 reserved
  238. * 4 green field enable(1)/disable(0)
  239. * 5 short GI in 20 Mhz enable(1)/disable(0)
  240. * 6 short GI in 40 Mhz enable(1)/disable(0)
  241. * 7-15 reserved
  242. */
  243. #define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
  244. /* 11AC Tx and Rx MCS map for 1x1 mode:
  245. * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1
  246. * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 7 streams
  247. */
  248. #define MWIFIEX_11AC_MCS_MAP_1X1 0xfffefffe
  249. /* 11AC Tx and Rx MCS map for 2x2 mode:
  250. * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1 and 2
  251. * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 6 streams
  252. */
  253. #define MWIFIEX_11AC_MCS_MAP_2X2 0xfffafffa
  254. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  255. #define SETHT_MCS32(x) (x[4] |= 1)
  256. #define HT_STREAM_1X1 0x11
  257. #define HT_STREAM_2X2 0x22
  258. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  259. #define LLC_SNAP_LEN 8
  260. /* HW_SPEC fw_cap_info */
  261. #define ISSUPP_11ACENABLED(fw_cap_info) (fw_cap_info & BIT(13))
  262. #define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
  263. #define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
  264. #define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
  265. (2 * (nss - 1)))
  266. #define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
  267. #define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
  268. /* Clear SU Beanformer, MU beanformer, MU beanformee and
  269. * sounding dimensions bits
  270. */
  271. #define MWIFIEX_DEF_11AC_CAP_BF_RESET_MASK \
  272. (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | \
  273. IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE | \
  274. IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE | \
  275. IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK)
  276. #define MOD_CLASS_HR_DSSS 0x03
  277. #define MOD_CLASS_OFDM 0x07
  278. #define MOD_CLASS_HT 0x08
  279. #define HT_BW_20 0
  280. #define HT_BW_40 1
  281. #define DFS_CHAN_MOVE_TIME 10000
  282. #define HostCmd_CMD_GET_HW_SPEC 0x0003
  283. #define HostCmd_CMD_802_11_SCAN 0x0006
  284. #define HostCmd_CMD_802_11_GET_LOG 0x000b
  285. #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
  286. #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
  287. #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
  288. #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
  289. #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
  290. #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
  291. #define HostCmd_CMD_RF_REG_ACCESS 0x001b
  292. #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
  293. #define HostCmd_CMD_RF_TX_PWR 0x001e
  294. #define HostCmd_CMD_RF_ANTENNA 0x0020
  295. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  296. #define HostCmd_CMD_MAC_CONTROL 0x0028
  297. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  298. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  299. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  300. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  301. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  302. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  303. #define HostCmd_CMD_802_11_BG_SCAN_CONFIG 0x006b
  304. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  305. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  306. #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
  307. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  308. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  309. #define HostCmd_CMD_MEM_ACCESS 0x0086
  310. #define HostCmd_CMD_CFG_DATA 0x008f
  311. #define HostCmd_CMD_VERSION_EXT 0x0097
  312. #define HostCmd_CMD_MEF_CFG 0x009a
  313. #define HostCmd_CMD_RSSI_INFO 0x00a4
  314. #define HostCmd_CMD_FUNC_INIT 0x00a9
  315. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  316. #define HOST_CMD_APCMD_SYS_RESET 0x00af
  317. #define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
  318. #define HostCmd_CMD_UAP_BSS_START 0x00b1
  319. #define HostCmd_CMD_UAP_BSS_STOP 0x00b2
  320. #define HOST_CMD_APCMD_STA_LIST 0x00b3
  321. #define HostCmd_CMD_UAP_STA_DEAUTH 0x00b5
  322. #define HostCmd_CMD_11N_CFG 0x00cd
  323. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  324. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  325. #define HostCmd_CMD_11N_DELBA 0x00d0
  326. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  327. #define HostCmd_CMD_CHAN_REPORT_REQUEST 0x00dd
  328. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  329. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  330. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  331. #define HostCmd_CMD_ROBUST_COEX 0x00e0
  332. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  333. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  334. #define HostCmd_CMD_P2P_MODE_CFG 0x00eb
  335. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  336. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  337. #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
  338. #define HostCmd_CMD_802_11_SCAN_EXT 0x0107
  339. #define HostCmd_CMD_COALESCE_CFG 0x010a
  340. #define HostCmd_CMD_MGMT_FRAME_REG 0x010c
  341. #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
  342. #define HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG 0x010f
  343. #define HostCmd_CMD_11AC_CFG 0x0112
  344. #define HostCmd_CMD_HS_WAKEUP_REASON 0x0116
  345. #define HostCmd_CMD_TDLS_CONFIG 0x0100
  346. #define HostCmd_CMD_MC_POLICY 0x0121
  347. #define HostCmd_CMD_TDLS_OPER 0x0122
  348. #define HostCmd_CMD_FW_DUMP_EVENT 0x0125
  349. #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223
  350. #define HostCmd_CMD_STA_CONFIGURE 0x023f
  351. #define HostCmd_CMD_CHAN_REGION_CFG 0x0242
  352. #define HostCmd_CMD_PACKET_AGGR_CTRL 0x0251
  353. #define PROTOCOL_NO_SECURITY 0x01
  354. #define PROTOCOL_STATIC_WEP 0x02
  355. #define PROTOCOL_WPA 0x08
  356. #define PROTOCOL_WPA2 0x20
  357. #define PROTOCOL_WPA2_MIXED 0x28
  358. #define PROTOCOL_EAP 0x40
  359. #define KEY_MGMT_NONE 0x04
  360. #define KEY_MGMT_PSK 0x02
  361. #define KEY_MGMT_EAP 0x01
  362. #define CIPHER_TKIP 0x04
  363. #define CIPHER_AES_CCMP 0x08
  364. #define VALID_CIPHER_BITMAP 0x0c
  365. enum ENH_PS_MODES {
  366. EN_PS = 1,
  367. DIS_PS = 2,
  368. EN_AUTO_DS = 3,
  369. DIS_AUTO_DS = 4,
  370. SLEEP_CONFIRM = 5,
  371. GET_PS = 0,
  372. EN_AUTO_PS = 0xff,
  373. DIS_AUTO_PS = 0xfe,
  374. };
  375. enum P2P_MODES {
  376. P2P_MODE_DISABLE = 0,
  377. P2P_MODE_DEVICE = 1,
  378. P2P_MODE_GO = 2,
  379. P2P_MODE_CLIENT = 3,
  380. };
  381. enum mwifiex_channel_flags {
  382. MWIFIEX_CHANNEL_PASSIVE = BIT(0),
  383. MWIFIEX_CHANNEL_DFS = BIT(1),
  384. MWIFIEX_CHANNEL_NOHT40 = BIT(2),
  385. MWIFIEX_CHANNEL_NOHT80 = BIT(3),
  386. MWIFIEX_CHANNEL_DISABLED = BIT(7),
  387. };
  388. #define HostCmd_RET_BIT 0x8000
  389. #define HostCmd_ACT_GEN_GET 0x0000
  390. #define HostCmd_ACT_GEN_SET 0x0001
  391. #define HostCmd_ACT_GEN_REMOVE 0x0004
  392. #define HostCmd_ACT_BITWISE_SET 0x0002
  393. #define HostCmd_ACT_BITWISE_CLR 0x0003
  394. #define HostCmd_RESULT_OK 0x0000
  395. #define HostCmd_ACT_MAC_RX_ON BIT(0)
  396. #define HostCmd_ACT_MAC_TX_ON BIT(1)
  397. #define HostCmd_ACT_MAC_WEP_ENABLE BIT(3)
  398. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE BIT(4)
  399. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE BIT(7)
  400. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE BIT(8)
  401. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON BIT(13)
  402. #define HostCmd_ACT_MAC_DYNAMIC_BW_ENABLE BIT(16)
  403. #define HostCmd_BSS_MODE_IBSS 0x0002
  404. #define HostCmd_BSS_MODE_ANY 0x0003
  405. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  406. #define HostCmd_SCAN_RADIO_TYPE_A 1
  407. #define HS_CFG_CANCEL 0xffffffff
  408. #define HS_CFG_COND_DEF 0x00000000
  409. #define HS_CFG_GPIO_DEF 0xff
  410. #define HS_CFG_GAP_DEF 0xff
  411. #define HS_CFG_COND_BROADCAST_DATA 0x00000001
  412. #define HS_CFG_COND_UNICAST_DATA 0x00000002
  413. #define HS_CFG_COND_MAC_EVENT 0x00000004
  414. #define HS_CFG_COND_MULTICAST_DATA 0x00000008
  415. #define CONNECT_ERR_AUTH_ERR_STA_FAILURE 0xFFFB
  416. #define CONNECT_ERR_ASSOC_ERR_TIMEOUT 0xFFFC
  417. #define CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED 0xFFFD
  418. #define CONNECT_ERR_AUTH_MSG_UNHANDLED 0xFFFE
  419. #define CONNECT_ERR_STA_FAILURE 0xFFFF
  420. #define CMD_F_HOSTCMD (1 << 0)
  421. #define HostCmd_CMD_ID_MASK 0x0fff
  422. #define HostCmd_SEQ_NUM_MASK 0x00ff
  423. #define HostCmd_BSS_NUM_MASK 0x0f00
  424. #define HostCmd_BSS_TYPE_MASK 0xf000
  425. #define HostCmd_ACT_SET_RX 0x0001
  426. #define HostCmd_ACT_SET_TX 0x0002
  427. #define HostCmd_ACT_SET_BOTH 0x0003
  428. #define HostCmd_ACT_GET_RX 0x0004
  429. #define HostCmd_ACT_GET_TX 0x0008
  430. #define HostCmd_ACT_GET_BOTH 0x000c
  431. #define RF_ANTENNA_AUTO 0xFFFF
  432. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
  433. ((((seq) & 0x00ff) | \
  434. (((num) & 0x000f) << 8)) | \
  435. (((type) & 0x000f) << 12))
  436. #define HostCmd_GET_SEQ_NO(seq) \
  437. ((seq) & HostCmd_SEQ_NUM_MASK)
  438. #define HostCmd_GET_BSS_NO(seq) \
  439. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  440. #define HostCmd_GET_BSS_TYPE(seq) \
  441. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  442. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  443. #define EVENT_LINK_LOST 0x00000003
  444. #define EVENT_LINK_SENSED 0x00000004
  445. #define EVENT_MIB_CHANGED 0x00000006
  446. #define EVENT_INIT_DONE 0x00000007
  447. #define EVENT_DEAUTHENTICATED 0x00000008
  448. #define EVENT_DISASSOCIATED 0x00000009
  449. #define EVENT_PS_AWAKE 0x0000000a
  450. #define EVENT_PS_SLEEP 0x0000000b
  451. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  452. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  453. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  454. #define EVENT_ADHOC_BCN_LOST 0x00000011
  455. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  456. #define EVENT_BG_SCAN_REPORT 0x00000018
  457. #define EVENT_RSSI_LOW 0x00000019
  458. #define EVENT_SNR_LOW 0x0000001a
  459. #define EVENT_MAX_FAIL 0x0000001b
  460. #define EVENT_RSSI_HIGH 0x0000001c
  461. #define EVENT_SNR_HIGH 0x0000001d
  462. #define EVENT_IBSS_COALESCED 0x0000001e
  463. #define EVENT_IBSS_STA_CONNECT 0x00000020
  464. #define EVENT_IBSS_STA_DISCONNECT 0x00000021
  465. #define EVENT_DATA_RSSI_LOW 0x00000024
  466. #define EVENT_DATA_SNR_LOW 0x00000025
  467. #define EVENT_DATA_RSSI_HIGH 0x00000026
  468. #define EVENT_DATA_SNR_HIGH 0x00000027
  469. #define EVENT_LINK_QUALITY 0x00000028
  470. #define EVENT_PORT_RELEASE 0x0000002b
  471. #define EVENT_UAP_STA_DEAUTH 0x0000002c
  472. #define EVENT_UAP_STA_ASSOC 0x0000002d
  473. #define EVENT_UAP_BSS_START 0x0000002e
  474. #define EVENT_PRE_BEACON_LOST 0x00000031
  475. #define EVENT_ADDBA 0x00000033
  476. #define EVENT_DELBA 0x00000034
  477. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  478. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  479. #define EVENT_UAP_BSS_IDLE 0x00000043
  480. #define EVENT_UAP_BSS_ACTIVE 0x00000044
  481. #define EVENT_WEP_ICV_ERR 0x00000046
  482. #define EVENT_HS_ACT_REQ 0x00000047
  483. #define EVENT_BW_CHANGE 0x00000048
  484. #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
  485. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  486. #define EVENT_CHANNEL_SWITCH_ANN 0x00000050
  487. #define EVENT_TDLS_GENERIC_EVENT 0x00000052
  488. #define EVENT_RADAR_DETECTED 0x00000053
  489. #define EVENT_CHANNEL_REPORT_RDY 0x00000054
  490. #define EVENT_TX_DATA_PAUSE 0x00000055
  491. #define EVENT_EXT_SCAN_REPORT 0x00000058
  492. #define EVENT_RXBA_SYNC 0x00000059
  493. #define EVENT_UNKNOWN_DEBUG 0x00000063
  494. #define EVENT_BG_SCAN_STOPPED 0x00000065
  495. #define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
  496. #define EVENT_MULTI_CHAN_INFO 0x0000006a
  497. #define EVENT_FW_DUMP_INFO 0x00000073
  498. #define EVENT_TX_STATUS_REPORT 0x00000074
  499. #define EVENT_BT_COEX_WLAN_PARA_CHANGE 0X00000076
  500. #define EVENT_ID_MASK 0xffff
  501. #define BSS_NUM_MASK 0xf
  502. #define EVENT_GET_BSS_NUM(event_cause) \
  503. (((event_cause) >> 16) & BSS_NUM_MASK)
  504. #define EVENT_GET_BSS_TYPE(event_cause) \
  505. (((event_cause) >> 24) & 0x00ff)
  506. #define MWIFIEX_MAX_PATTERN_LEN 40
  507. #define MWIFIEX_MAX_OFFSET_LEN 100
  508. #define MWIFIEX_MAX_ND_MATCH_SETS 10
  509. #define STACK_NBYTES 100
  510. #define TYPE_DNUM 1
  511. #define TYPE_BYTESEQ 2
  512. #define MAX_OPERAND 0x40
  513. #define TYPE_EQ (MAX_OPERAND+1)
  514. #define TYPE_EQ_DNUM (MAX_OPERAND+2)
  515. #define TYPE_EQ_BIT (MAX_OPERAND+3)
  516. #define TYPE_AND (MAX_OPERAND+4)
  517. #define TYPE_OR (MAX_OPERAND+5)
  518. #define MEF_MODE_HOST_SLEEP 1
  519. #define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
  520. #define MEF_ACTION_AUTO_ARP 0x10
  521. #define MWIFIEX_CRITERIA_BROADCAST BIT(0)
  522. #define MWIFIEX_CRITERIA_UNICAST BIT(1)
  523. #define MWIFIEX_CRITERIA_MULTICAST BIT(3)
  524. #define MWIFIEX_MAX_SUPPORTED_IPADDR 4
  525. #define ACT_TDLS_DELETE 0x00
  526. #define ACT_TDLS_CREATE 0x01
  527. #define ACT_TDLS_CONFIG 0x02
  528. #define TDLS_EVENT_LINK_TEAR_DOWN 3
  529. #define TDLS_EVENT_CHAN_SWITCH_RESULT 7
  530. #define TDLS_EVENT_START_CHAN_SWITCH 8
  531. #define TDLS_EVENT_CHAN_SWITCH_STOPPED 9
  532. #define TDLS_BASE_CHANNEL 0
  533. #define TDLS_OFF_CHANNEL 1
  534. #define ACT_TDLS_CS_ENABLE_CONFIG 0x00
  535. #define ACT_TDLS_CS_INIT 0x06
  536. #define ACT_TDLS_CS_STOP 0x07
  537. #define ACT_TDLS_CS_PARAMS 0x08
  538. #define MWIFIEX_DEF_CS_UNIT_TIME 2
  539. #define MWIFIEX_DEF_CS_THR_OTHERLINK 10
  540. #define MWIFIEX_DEF_THR_DIRECTLINK 0
  541. #define MWIFIEX_DEF_CS_TIME 10
  542. #define MWIFIEX_DEF_CS_TIMEOUT 16
  543. #define MWIFIEX_DEF_CS_REG_CLASS 12
  544. #define MWIFIEX_DEF_CS_PERIODICITY 1
  545. #define MWIFIEX_FW_V15 15
  546. #define MWIFIEX_MASTER_RADAR_DET_MASK BIT(1)
  547. struct mwifiex_ie_types_header {
  548. __le16 type;
  549. __le16 len;
  550. } __packed;
  551. struct mwifiex_ie_types_data {
  552. struct mwifiex_ie_types_header header;
  553. u8 data[1];
  554. } __packed;
  555. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  556. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  557. #define MWIFIEX_TXPD_FLAGS_TDLS_PACKET 0x10
  558. #define MWIFIEX_RXPD_FLAGS_TDLS_PACKET 0x01
  559. #define MWIFIEX_TXPD_FLAGS_REQ_TX_STATUS 0x20
  560. enum HS_WAKEUP_REASON {
  561. NO_HSWAKEUP_REASON = 0,
  562. BCAST_DATA_MATCHED,
  563. MCAST_DATA_MATCHED,
  564. UCAST_DATA_MATCHED,
  565. MASKTABLE_EVENT_MATCHED,
  566. NON_MASKABLE_EVENT_MATCHED,
  567. NON_MASKABLE_CONDITION_MATCHED,
  568. MAGIC_PATTERN_MATCHED,
  569. CONTROL_FRAME_MATCHED,
  570. MANAGEMENT_FRAME_MATCHED,
  571. GTK_REKEY_FAILURE,
  572. RESERVED
  573. };
  574. struct txpd {
  575. u8 bss_type;
  576. u8 bss_num;
  577. __le16 tx_pkt_length;
  578. __le16 tx_pkt_offset;
  579. __le16 tx_pkt_type;
  580. __le32 tx_control;
  581. u8 priority;
  582. u8 flags;
  583. u8 pkt_delay_2ms;
  584. u8 reserved1[2];
  585. u8 tx_token_id;
  586. u8 reserved[2];
  587. } __packed;
  588. struct rxpd {
  589. u8 bss_type;
  590. u8 bss_num;
  591. __le16 rx_pkt_length;
  592. __le16 rx_pkt_offset;
  593. __le16 rx_pkt_type;
  594. __le16 seq_num;
  595. u8 priority;
  596. u8 rx_rate;
  597. s8 snr;
  598. s8 nf;
  599. /* For: Non-802.11 AC cards
  600. *
  601. * Ht Info [Bit 0] RxRate format: LG=0, HT=1
  602. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  603. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
  604. *
  605. * For: 802.11 AC cards
  606. * [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
  607. * [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01
  608. * BW80 = 10 BW160 = 11
  609. * [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
  610. * [Bit 5] STBC support Enabled = 1
  611. * [Bit 6] LDPC support Enabled = 1
  612. * [Bit 7] Reserved
  613. */
  614. u8 ht_info;
  615. u8 reserved[3];
  616. u8 flags;
  617. } __packed;
  618. struct uap_txpd {
  619. u8 bss_type;
  620. u8 bss_num;
  621. __le16 tx_pkt_length;
  622. __le16 tx_pkt_offset;
  623. __le16 tx_pkt_type;
  624. __le32 tx_control;
  625. u8 priority;
  626. u8 flags;
  627. u8 pkt_delay_2ms;
  628. u8 reserved1[2];
  629. u8 tx_token_id;
  630. u8 reserved[2];
  631. } __packed;
  632. struct uap_rxpd {
  633. u8 bss_type;
  634. u8 bss_num;
  635. __le16 rx_pkt_length;
  636. __le16 rx_pkt_offset;
  637. __le16 rx_pkt_type;
  638. __le16 seq_num;
  639. u8 priority;
  640. u8 rx_rate;
  641. s8 snr;
  642. s8 nf;
  643. u8 ht_info;
  644. u8 reserved[3];
  645. u8 flags;
  646. } __packed;
  647. struct mwifiex_fw_chan_stats {
  648. u8 chan_num;
  649. u8 bandcfg;
  650. u8 flags;
  651. s8 noise;
  652. __le16 total_bss;
  653. __le16 cca_scan_dur;
  654. __le16 cca_busy_dur;
  655. } __packed;
  656. enum mwifiex_chan_scan_mode_bitmasks {
  657. MWIFIEX_PASSIVE_SCAN = BIT(0),
  658. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  659. MWIFIEX_HIDDEN_SSID_REPORT = BIT(4),
  660. };
  661. struct mwifiex_chan_scan_param_set {
  662. u8 radio_type;
  663. u8 chan_number;
  664. u8 chan_scan_mode_bitmap;
  665. __le16 min_scan_time;
  666. __le16 max_scan_time;
  667. } __packed;
  668. struct mwifiex_ie_types_chan_list_param_set {
  669. struct mwifiex_ie_types_header header;
  670. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  671. } __packed;
  672. struct mwifiex_ie_types_rxba_sync {
  673. struct mwifiex_ie_types_header header;
  674. u8 mac[ETH_ALEN];
  675. u8 tid;
  676. u8 reserved;
  677. __le16 seq_num;
  678. __le16 bitmap_len;
  679. u8 bitmap[1];
  680. } __packed;
  681. struct chan_band_param_set {
  682. u8 radio_type;
  683. u8 chan_number;
  684. };
  685. struct mwifiex_ie_types_chan_band_list_param_set {
  686. struct mwifiex_ie_types_header header;
  687. struct chan_band_param_set chan_band_param[1];
  688. } __packed;
  689. struct mwifiex_ie_types_rates_param_set {
  690. struct mwifiex_ie_types_header header;
  691. u8 rates[1];
  692. } __packed;
  693. struct mwifiex_ie_types_ssid_param_set {
  694. struct mwifiex_ie_types_header header;
  695. u8 ssid[1];
  696. } __packed;
  697. struct mwifiex_ie_types_num_probes {
  698. struct mwifiex_ie_types_header header;
  699. __le16 num_probes;
  700. } __packed;
  701. struct mwifiex_ie_types_repeat_count {
  702. struct mwifiex_ie_types_header header;
  703. __le16 repeat_count;
  704. } __packed;
  705. struct mwifiex_ie_types_min_rssi_threshold {
  706. struct mwifiex_ie_types_header header;
  707. __le16 rssi_threshold;
  708. } __packed;
  709. struct mwifiex_ie_types_bgscan_start_later {
  710. struct mwifiex_ie_types_header header;
  711. __le16 start_later;
  712. } __packed;
  713. struct mwifiex_ie_types_scan_chan_gap {
  714. struct mwifiex_ie_types_header header;
  715. /* time gap in TUs to be used between two consecutive channels scan */
  716. __le16 chan_gap;
  717. } __packed;
  718. struct mwifiex_ie_types_random_mac {
  719. struct mwifiex_ie_types_header header;
  720. u8 mac[ETH_ALEN];
  721. } __packed;
  722. struct mwifiex_ietypes_chanstats {
  723. struct mwifiex_ie_types_header header;
  724. struct mwifiex_fw_chan_stats chanstats[];
  725. } __packed;
  726. struct mwifiex_ie_types_wildcard_ssid_params {
  727. struct mwifiex_ie_types_header header;
  728. u8 max_ssid_length;
  729. u8 ssid[1];
  730. } __packed;
  731. #define TSF_DATA_SIZE 8
  732. struct mwifiex_ie_types_tsf_timestamp {
  733. struct mwifiex_ie_types_header header;
  734. u8 tsf_data[1];
  735. } __packed;
  736. struct mwifiex_cf_param_set {
  737. u8 cfp_cnt;
  738. u8 cfp_period;
  739. __le16 cfp_max_duration;
  740. __le16 cfp_duration_remaining;
  741. } __packed;
  742. struct mwifiex_ibss_param_set {
  743. __le16 atim_window;
  744. } __packed;
  745. struct mwifiex_ie_types_ss_param_set {
  746. struct mwifiex_ie_types_header header;
  747. union {
  748. struct mwifiex_cf_param_set cf_param_set[1];
  749. struct mwifiex_ibss_param_set ibss_param_set[1];
  750. } cf_ibss;
  751. } __packed;
  752. struct mwifiex_fh_param_set {
  753. __le16 dwell_time;
  754. u8 hop_set;
  755. u8 hop_pattern;
  756. u8 hop_index;
  757. } __packed;
  758. struct mwifiex_ds_param_set {
  759. u8 current_chan;
  760. } __packed;
  761. struct mwifiex_ie_types_phy_param_set {
  762. struct mwifiex_ie_types_header header;
  763. union {
  764. struct mwifiex_fh_param_set fh_param_set[1];
  765. struct mwifiex_ds_param_set ds_param_set[1];
  766. } fh_ds;
  767. } __packed;
  768. struct mwifiex_ie_types_auth_type {
  769. struct mwifiex_ie_types_header header;
  770. __le16 auth_type;
  771. } __packed;
  772. struct mwifiex_ie_types_vendor_param_set {
  773. struct mwifiex_ie_types_header header;
  774. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  775. };
  776. #define MWIFIEX_TDLS_IDLE_TIMEOUT_IN_SEC 60
  777. struct mwifiex_ie_types_tdls_idle_timeout {
  778. struct mwifiex_ie_types_header header;
  779. __le16 value;
  780. } __packed;
  781. struct mwifiex_ie_types_rsn_param_set {
  782. struct mwifiex_ie_types_header header;
  783. u8 rsn_ie[1];
  784. } __packed;
  785. #define KEYPARAMSET_FIXED_LEN 6
  786. struct mwifiex_ie_type_key_param_set {
  787. __le16 type;
  788. __le16 length;
  789. __le16 key_type_id;
  790. __le16 key_info;
  791. __le16 key_len;
  792. u8 key[50];
  793. } __packed;
  794. #define IGTK_PN_LEN 8
  795. struct mwifiex_cmac_param {
  796. u8 ipn[IGTK_PN_LEN];
  797. u8 key[WLAN_KEY_LEN_AES_CMAC];
  798. } __packed;
  799. struct mwifiex_wep_param {
  800. __le16 key_len;
  801. u8 key[WLAN_KEY_LEN_WEP104];
  802. } __packed;
  803. struct mwifiex_tkip_param {
  804. u8 pn[WPA_PN_SIZE];
  805. __le16 key_len;
  806. u8 key[WLAN_KEY_LEN_TKIP];
  807. } __packed;
  808. struct mwifiex_aes_param {
  809. u8 pn[WPA_PN_SIZE];
  810. __le16 key_len;
  811. u8 key[WLAN_KEY_LEN_CCMP_256];
  812. } __packed;
  813. struct mwifiex_wapi_param {
  814. u8 pn[PN_LEN];
  815. __le16 key_len;
  816. u8 key[WLAN_KEY_LEN_SMS4];
  817. } __packed;
  818. struct mwifiex_cmac_aes_param {
  819. u8 ipn[IGTK_PN_LEN];
  820. __le16 key_len;
  821. u8 key[WLAN_KEY_LEN_AES_CMAC];
  822. } __packed;
  823. struct mwifiex_ie_type_key_param_set_v2 {
  824. __le16 type;
  825. __le16 len;
  826. u8 mac_addr[ETH_ALEN];
  827. u8 key_idx;
  828. u8 key_type;
  829. __le16 key_info;
  830. union {
  831. struct mwifiex_wep_param wep;
  832. struct mwifiex_tkip_param tkip;
  833. struct mwifiex_aes_param aes;
  834. struct mwifiex_wapi_param wapi;
  835. struct mwifiex_cmac_aes_param cmac_aes;
  836. } key_params;
  837. } __packed;
  838. struct host_cmd_ds_802_11_key_material_v2 {
  839. __le16 action;
  840. struct mwifiex_ie_type_key_param_set_v2 key_param_set;
  841. } __packed;
  842. struct host_cmd_ds_802_11_key_material {
  843. __le16 action;
  844. struct mwifiex_ie_type_key_param_set key_param_set;
  845. } __packed;
  846. struct host_cmd_ds_802_11_key_material_wep {
  847. __le16 action;
  848. struct mwifiex_ie_type_key_param_set key_param_set[NUM_WEP_KEYS];
  849. } __packed;
  850. struct host_cmd_ds_gen {
  851. __le16 command;
  852. __le16 size;
  853. __le16 seq_num;
  854. __le16 result;
  855. };
  856. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  857. enum sleep_resp_ctrl {
  858. RESP_NOT_NEEDED = 0,
  859. RESP_NEEDED,
  860. };
  861. struct mwifiex_ps_param {
  862. __le16 null_pkt_interval;
  863. __le16 multiple_dtims;
  864. __le16 bcn_miss_timeout;
  865. __le16 local_listen_interval;
  866. __le16 adhoc_wake_period;
  867. __le16 mode;
  868. __le16 delay_to_ps;
  869. } __packed;
  870. #define HS_DEF_WAKE_INTERVAL 100
  871. #define HS_DEF_INACTIVITY_TIMEOUT 50
  872. struct mwifiex_ps_param_in_hs {
  873. struct mwifiex_ie_types_header header;
  874. __le32 hs_wake_int;
  875. __le32 hs_inact_timeout;
  876. } __packed;
  877. #define BITMAP_AUTO_DS 0x01
  878. #define BITMAP_STA_PS 0x10
  879. struct mwifiex_ie_types_auto_ds_param {
  880. struct mwifiex_ie_types_header header;
  881. __le16 deep_sleep_timeout;
  882. } __packed;
  883. struct mwifiex_ie_types_ps_param {
  884. struct mwifiex_ie_types_header header;
  885. struct mwifiex_ps_param param;
  886. } __packed;
  887. struct host_cmd_ds_802_11_ps_mode_enh {
  888. __le16 action;
  889. union {
  890. struct mwifiex_ps_param opt_ps;
  891. __le16 ps_bitmap;
  892. } params;
  893. } __packed;
  894. enum API_VER_ID {
  895. KEY_API_VER_ID = 1,
  896. FW_API_VER_ID = 2,
  897. UAP_FW_API_VER_ID = 3,
  898. CHANRPT_API_VER_ID = 4,
  899. };
  900. struct hw_spec_api_rev {
  901. struct mwifiex_ie_types_header header;
  902. __le16 api_id;
  903. u8 major_ver;
  904. u8 minor_ver;
  905. } __packed;
  906. struct host_cmd_ds_get_hw_spec {
  907. __le16 hw_if_version;
  908. __le16 version;
  909. __le16 reserved;
  910. __le16 num_of_mcast_adr;
  911. u8 permanent_addr[ETH_ALEN];
  912. __le16 region_code;
  913. __le16 number_of_antenna;
  914. __le32 fw_release_number;
  915. __le32 reserved_1;
  916. __le32 reserved_2;
  917. __le32 reserved_3;
  918. __le32 fw_cap_info;
  919. __le32 dot_11n_dev_cap;
  920. u8 dev_mcs_support;
  921. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  922. __le16 mgmt_buf_count; /* mgmt IE buffer count */
  923. __le32 reserved_5;
  924. __le32 reserved_6;
  925. __le32 dot_11ac_dev_cap;
  926. __le32 dot_11ac_mcs_support;
  927. u8 tlvs[];
  928. } __packed;
  929. struct host_cmd_ds_802_11_rssi_info {
  930. __le16 action;
  931. __le16 ndata;
  932. __le16 nbcn;
  933. __le16 reserved[9];
  934. long long reserved_1;
  935. } __packed;
  936. struct host_cmd_ds_802_11_rssi_info_rsp {
  937. __le16 action;
  938. __le16 ndata;
  939. __le16 nbcn;
  940. __le16 data_rssi_last;
  941. __le16 data_nf_last;
  942. __le16 data_rssi_avg;
  943. __le16 data_nf_avg;
  944. __le16 bcn_rssi_last;
  945. __le16 bcn_nf_last;
  946. __le16 bcn_rssi_avg;
  947. __le16 bcn_nf_avg;
  948. long long tsf_bcn;
  949. } __packed;
  950. struct host_cmd_ds_802_11_mac_address {
  951. __le16 action;
  952. u8 mac_addr[ETH_ALEN];
  953. } __packed;
  954. struct host_cmd_ds_mac_control {
  955. __le32 action;
  956. };
  957. struct host_cmd_ds_mac_multicast_adr {
  958. __le16 action;
  959. __le16 num_of_adrs;
  960. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  961. } __packed;
  962. struct host_cmd_ds_802_11_deauthenticate {
  963. u8 mac_addr[ETH_ALEN];
  964. __le16 reason_code;
  965. } __packed;
  966. struct host_cmd_ds_802_11_associate {
  967. u8 peer_sta_addr[ETH_ALEN];
  968. __le16 cap_info_bitmap;
  969. __le16 listen_interval;
  970. __le16 beacon_period;
  971. u8 dtim_period;
  972. } __packed;
  973. struct ieee_types_assoc_rsp {
  974. __le16 cap_info_bitmap;
  975. __le16 status_code;
  976. __le16 a_id;
  977. u8 ie_buffer[];
  978. } __packed;
  979. struct host_cmd_ds_802_11_associate_rsp {
  980. struct ieee_types_assoc_rsp assoc_rsp;
  981. } __packed;
  982. struct ieee_types_cf_param_set {
  983. u8 element_id;
  984. u8 len;
  985. u8 cfp_cnt;
  986. u8 cfp_period;
  987. __le16 cfp_max_duration;
  988. __le16 cfp_duration_remaining;
  989. } __packed;
  990. struct ieee_types_ibss_param_set {
  991. u8 element_id;
  992. u8 len;
  993. __le16 atim_window;
  994. } __packed;
  995. union ieee_types_ss_param_set {
  996. struct ieee_types_cf_param_set cf_param_set;
  997. struct ieee_types_ibss_param_set ibss_param_set;
  998. } __packed;
  999. struct ieee_types_fh_param_set {
  1000. u8 element_id;
  1001. u8 len;
  1002. __le16 dwell_time;
  1003. u8 hop_set;
  1004. u8 hop_pattern;
  1005. u8 hop_index;
  1006. } __packed;
  1007. struct ieee_types_ds_param_set {
  1008. u8 element_id;
  1009. u8 len;
  1010. u8 current_chan;
  1011. } __packed;
  1012. union ieee_types_phy_param_set {
  1013. struct ieee_types_fh_param_set fh_param_set;
  1014. struct ieee_types_ds_param_set ds_param_set;
  1015. } __packed;
  1016. struct ieee_types_oper_mode_ntf {
  1017. u8 element_id;
  1018. u8 len;
  1019. u8 oper_mode;
  1020. } __packed;
  1021. struct host_cmd_ds_802_11_ad_hoc_start {
  1022. u8 ssid[IEEE80211_MAX_SSID_LEN];
  1023. u8 bss_mode;
  1024. __le16 beacon_period;
  1025. u8 dtim_period;
  1026. union ieee_types_ss_param_set ss_param_set;
  1027. union ieee_types_phy_param_set phy_param_set;
  1028. u16 reserved1;
  1029. __le16 cap_info_bitmap;
  1030. u8 data_rate[HOSTCMD_SUPPORTED_RATES];
  1031. } __packed;
  1032. struct host_cmd_ds_802_11_ad_hoc_start_result {
  1033. u8 pad[3];
  1034. u8 bssid[ETH_ALEN];
  1035. u8 pad2[2];
  1036. u8 result;
  1037. } __packed;
  1038. struct host_cmd_ds_802_11_ad_hoc_join_result {
  1039. u8 result;
  1040. } __packed;
  1041. struct adhoc_bss_desc {
  1042. u8 bssid[ETH_ALEN];
  1043. u8 ssid[IEEE80211_MAX_SSID_LEN];
  1044. u8 bss_mode;
  1045. __le16 beacon_period;
  1046. u8 dtim_period;
  1047. u8 time_stamp[8];
  1048. u8 local_time[8];
  1049. union ieee_types_phy_param_set phy_param_set;
  1050. union ieee_types_ss_param_set ss_param_set;
  1051. __le16 cap_info_bitmap;
  1052. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  1053. /*
  1054. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  1055. * It is used in the Adhoc join command and will cause a
  1056. * binary layout mismatch with the firmware
  1057. */
  1058. } __packed;
  1059. struct host_cmd_ds_802_11_ad_hoc_join {
  1060. struct adhoc_bss_desc bss_descriptor;
  1061. u16 reserved1;
  1062. u16 reserved2;
  1063. } __packed;
  1064. struct host_cmd_ds_802_11_get_log {
  1065. __le32 mcast_tx_frame;
  1066. __le32 failed;
  1067. __le32 retry;
  1068. __le32 multi_retry;
  1069. __le32 frame_dup;
  1070. __le32 rts_success;
  1071. __le32 rts_failure;
  1072. __le32 ack_failure;
  1073. __le32 rx_frag;
  1074. __le32 mcast_rx_frame;
  1075. __le32 fcs_error;
  1076. __le32 tx_frame;
  1077. __le32 reserved;
  1078. __le32 wep_icv_err_cnt[4];
  1079. __le32 bcn_rcv_cnt;
  1080. __le32 bcn_miss_cnt;
  1081. } __packed;
  1082. /* Enumeration for rate format */
  1083. enum _mwifiex_rate_format {
  1084. MWIFIEX_RATE_FORMAT_LG = 0,
  1085. MWIFIEX_RATE_FORMAT_HT,
  1086. MWIFIEX_RATE_FORMAT_VHT,
  1087. MWIFIEX_RATE_FORMAT_AUTO = 0xFF,
  1088. };
  1089. struct host_cmd_ds_tx_rate_query {
  1090. u8 tx_rate;
  1091. /* Tx Rate Info: For 802.11 AC cards
  1092. *
  1093. * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
  1094. * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
  1095. * [Bit 4] HT/VHT Guard Interval: LGI = 0, SGI = 1
  1096. *
  1097. * For non-802.11 AC cards
  1098. * Ht Info [Bit 0] RxRate format: LG=0, HT=1
  1099. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  1100. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
  1101. */
  1102. u8 ht_info;
  1103. } __packed;
  1104. struct mwifiex_tx_pause_tlv {
  1105. struct mwifiex_ie_types_header header;
  1106. u8 peermac[ETH_ALEN];
  1107. u8 tx_pause;
  1108. u8 pkt_cnt;
  1109. } __packed;
  1110. enum Host_Sleep_Action {
  1111. HS_CONFIGURE = 0x0001,
  1112. HS_ACTIVATE = 0x0002,
  1113. };
  1114. struct mwifiex_hs_config_param {
  1115. __le32 conditions;
  1116. u8 gpio;
  1117. u8 gap;
  1118. } __packed;
  1119. struct hs_activate_param {
  1120. __le16 resp_ctrl;
  1121. } __packed;
  1122. struct host_cmd_ds_802_11_hs_cfg_enh {
  1123. __le16 action;
  1124. union {
  1125. struct mwifiex_hs_config_param hs_config;
  1126. struct hs_activate_param hs_activate;
  1127. } params;
  1128. } __packed;
  1129. enum SNMP_MIB_INDEX {
  1130. OP_RATE_SET_I = 1,
  1131. DTIM_PERIOD_I = 3,
  1132. RTS_THRESH_I = 5,
  1133. SHORT_RETRY_LIM_I = 6,
  1134. LONG_RETRY_LIM_I = 7,
  1135. FRAG_THRESH_I = 8,
  1136. DOT11D_I = 9,
  1137. DOT11H_I = 10,
  1138. };
  1139. enum mwifiex_assocmd_failurepoint {
  1140. MWIFIEX_ASSOC_CMD_SUCCESS = 0,
  1141. MWIFIEX_ASSOC_CMD_FAILURE_ASSOC,
  1142. MWIFIEX_ASSOC_CMD_FAILURE_AUTH,
  1143. MWIFIEX_ASSOC_CMD_FAILURE_JOIN
  1144. };
  1145. #define MAX_SNMP_BUF_SIZE 128
  1146. struct host_cmd_ds_802_11_snmp_mib {
  1147. __le16 query_type;
  1148. __le16 oid;
  1149. __le16 buf_size;
  1150. u8 value[1];
  1151. } __packed;
  1152. struct mwifiex_rate_scope {
  1153. __le16 type;
  1154. __le16 length;
  1155. __le16 hr_dsss_rate_bitmap;
  1156. __le16 ofdm_rate_bitmap;
  1157. __le16 ht_mcs_rate_bitmap[8];
  1158. __le16 vht_mcs_rate_bitmap[8];
  1159. } __packed;
  1160. struct mwifiex_rate_drop_pattern {
  1161. __le16 type;
  1162. __le16 length;
  1163. __le32 rate_drop_mode;
  1164. } __packed;
  1165. struct host_cmd_ds_tx_rate_cfg {
  1166. __le16 action;
  1167. __le16 cfg_index;
  1168. } __packed;
  1169. struct mwifiex_power_group {
  1170. u8 modulation_class;
  1171. u8 first_rate_code;
  1172. u8 last_rate_code;
  1173. s8 power_step;
  1174. s8 power_min;
  1175. s8 power_max;
  1176. u8 ht_bandwidth;
  1177. u8 reserved;
  1178. } __packed;
  1179. struct mwifiex_types_power_group {
  1180. __le16 type;
  1181. __le16 length;
  1182. } __packed;
  1183. struct host_cmd_ds_txpwr_cfg {
  1184. __le16 action;
  1185. __le16 cfg_index;
  1186. __le32 mode;
  1187. } __packed;
  1188. struct host_cmd_ds_rf_tx_pwr {
  1189. __le16 action;
  1190. __le16 cur_level;
  1191. u8 max_power;
  1192. u8 min_power;
  1193. } __packed;
  1194. struct host_cmd_ds_rf_ant_mimo {
  1195. __le16 action_tx;
  1196. __le16 tx_ant_mode;
  1197. __le16 action_rx;
  1198. __le16 rx_ant_mode;
  1199. } __packed;
  1200. struct host_cmd_ds_rf_ant_siso {
  1201. __le16 action;
  1202. __le16 ant_mode;
  1203. } __packed;
  1204. struct host_cmd_ds_tdls_oper {
  1205. __le16 tdls_action;
  1206. __le16 reason;
  1207. u8 peer_mac[ETH_ALEN];
  1208. } __packed;
  1209. struct mwifiex_tdls_config {
  1210. __le16 enable;
  1211. } __packed;
  1212. struct mwifiex_tdls_config_cs_params {
  1213. u8 unit_time;
  1214. u8 thr_otherlink;
  1215. u8 thr_directlink;
  1216. } __packed;
  1217. struct mwifiex_tdls_init_cs_params {
  1218. u8 peer_mac[ETH_ALEN];
  1219. u8 primary_chan;
  1220. u8 second_chan_offset;
  1221. u8 band;
  1222. __le16 switch_time;
  1223. __le16 switch_timeout;
  1224. u8 reg_class;
  1225. u8 periodicity;
  1226. } __packed;
  1227. struct mwifiex_tdls_stop_cs_params {
  1228. u8 peer_mac[ETH_ALEN];
  1229. } __packed;
  1230. struct host_cmd_ds_tdls_config {
  1231. __le16 tdls_action;
  1232. u8 tdls_data[1];
  1233. } __packed;
  1234. struct mwifiex_chan_desc {
  1235. __le16 start_freq;
  1236. u8 chan_width;
  1237. u8 chan_num;
  1238. } __packed;
  1239. struct host_cmd_ds_chan_rpt_req {
  1240. struct mwifiex_chan_desc chan_desc;
  1241. __le32 msec_dwell_time;
  1242. } __packed;
  1243. struct host_cmd_ds_chan_rpt_event {
  1244. __le32 result;
  1245. __le64 start_tsf;
  1246. __le32 duration;
  1247. u8 tlvbuf[];
  1248. } __packed;
  1249. struct host_cmd_sdio_sp_rx_aggr_cfg {
  1250. u8 action;
  1251. u8 enable;
  1252. __le16 block_size;
  1253. } __packed;
  1254. struct mwifiex_fixed_bcn_param {
  1255. __le64 timestamp;
  1256. __le16 beacon_period;
  1257. __le16 cap_info_bitmap;
  1258. } __packed;
  1259. struct mwifiex_event_scan_result {
  1260. __le16 event_id;
  1261. u8 bss_index;
  1262. u8 bss_type;
  1263. u8 more_event;
  1264. u8 reserved[3];
  1265. __le16 buf_size;
  1266. u8 num_of_set;
  1267. } __packed;
  1268. struct tx_status_event {
  1269. u8 packet_type;
  1270. u8 tx_token_id;
  1271. u8 status;
  1272. } __packed;
  1273. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  1274. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  1275. struct mwifiex_scan_cmd_config {
  1276. /*
  1277. * BSS mode to be sent in the firmware command
  1278. */
  1279. u8 bss_mode;
  1280. /* Specific BSSID used to filter scan results in the firmware */
  1281. u8 specific_bssid[ETH_ALEN];
  1282. /* Length of TLVs sent in command starting at tlvBuffer */
  1283. u32 tlv_buf_len;
  1284. /*
  1285. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  1286. *
  1287. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  1288. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  1289. */
  1290. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  1291. here */
  1292. } __packed;
  1293. struct mwifiex_user_scan_chan {
  1294. u8 chan_number;
  1295. u8 radio_type;
  1296. u8 scan_type;
  1297. u8 reserved;
  1298. u32 scan_time;
  1299. } __packed;
  1300. struct mwifiex_user_scan_cfg {
  1301. /*
  1302. * BSS mode to be sent in the firmware command
  1303. */
  1304. u8 bss_mode;
  1305. /* Configure the number of probe requests for active chan scans */
  1306. u8 num_probes;
  1307. u8 reserved;
  1308. /* BSSID filter sent in the firmware command to limit the results */
  1309. u8 specific_bssid[ETH_ALEN];
  1310. /* SSID filter list used in the firmware to limit the scan results */
  1311. struct cfg80211_ssid *ssid_list;
  1312. u8 num_ssids;
  1313. /* Variable number (fixed maximum) of channels to scan up */
  1314. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  1315. u16 scan_chan_gap;
  1316. u8 random_mac[ETH_ALEN];
  1317. } __packed;
  1318. #define MWIFIEX_BG_SCAN_CHAN_MAX 38
  1319. #define MWIFIEX_BSS_MODE_INFRA 1
  1320. #define MWIFIEX_BGSCAN_ACT_GET 0x0000
  1321. #define MWIFIEX_BGSCAN_ACT_SET 0x0001
  1322. #define MWIFIEX_BGSCAN_ACT_SET_ALL 0xff01
  1323. /** ssid match */
  1324. #define MWIFIEX_BGSCAN_SSID_MATCH 0x0001
  1325. /** ssid match and RSSI exceeded */
  1326. #define MWIFIEX_BGSCAN_SSID_RSSI_MATCH 0x0004
  1327. /**wait for all channel scan to complete to report scan result*/
  1328. #define MWIFIEX_BGSCAN_WAIT_ALL_CHAN_DONE 0x80000000
  1329. struct mwifiex_bg_scan_cfg {
  1330. u16 action;
  1331. u8 enable;
  1332. u8 bss_type;
  1333. u8 chan_per_scan;
  1334. u32 scan_interval;
  1335. u32 report_condition;
  1336. u8 num_probes;
  1337. u8 rssi_threshold;
  1338. u8 snr_threshold;
  1339. u16 repeat_count;
  1340. u16 start_later;
  1341. struct cfg80211_match_set *ssid_list;
  1342. u8 num_ssids;
  1343. struct mwifiex_user_scan_chan chan_list[MWIFIEX_BG_SCAN_CHAN_MAX];
  1344. u16 scan_chan_gap;
  1345. } __packed;
  1346. struct ie_body {
  1347. u8 grp_key_oui[4];
  1348. u8 ptk_cnt[2];
  1349. u8 ptk_body[4];
  1350. } __packed;
  1351. struct host_cmd_ds_802_11_scan {
  1352. u8 bss_mode;
  1353. u8 bssid[ETH_ALEN];
  1354. u8 tlv_buffer[1];
  1355. } __packed;
  1356. struct host_cmd_ds_802_11_scan_rsp {
  1357. __le16 bss_descript_size;
  1358. u8 number_of_sets;
  1359. u8 bss_desc_and_tlv_buffer[1];
  1360. } __packed;
  1361. struct host_cmd_ds_802_11_scan_ext {
  1362. u32 reserved;
  1363. u8 tlv_buffer[1];
  1364. } __packed;
  1365. struct mwifiex_ie_types_bss_mode {
  1366. struct mwifiex_ie_types_header header;
  1367. u8 bss_mode;
  1368. } __packed;
  1369. struct mwifiex_ie_types_bss_scan_rsp {
  1370. struct mwifiex_ie_types_header header;
  1371. u8 bssid[ETH_ALEN];
  1372. u8 frame_body[1];
  1373. } __packed;
  1374. struct mwifiex_ie_types_bss_scan_info {
  1375. struct mwifiex_ie_types_header header;
  1376. __le16 rssi;
  1377. __le16 anpi;
  1378. u8 cca_busy_fraction;
  1379. u8 radio_type;
  1380. u8 channel;
  1381. u8 reserved;
  1382. __le64 tsf;
  1383. } __packed;
  1384. struct host_cmd_ds_802_11_bg_scan_config {
  1385. __le16 action;
  1386. u8 enable;
  1387. u8 bss_type;
  1388. u8 chan_per_scan;
  1389. u8 reserved;
  1390. __le16 reserved1;
  1391. __le32 scan_interval;
  1392. __le32 reserved2;
  1393. __le32 report_condition;
  1394. __le16 reserved3;
  1395. u8 tlv[];
  1396. } __packed;
  1397. struct host_cmd_ds_802_11_bg_scan_query {
  1398. u8 flush;
  1399. } __packed;
  1400. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  1401. __le32 report_condition;
  1402. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1403. } __packed;
  1404. struct mwifiex_ietypes_domain_param_set {
  1405. struct mwifiex_ie_types_header header;
  1406. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  1407. struct ieee80211_country_ie_triplet triplet[1];
  1408. } __packed;
  1409. struct host_cmd_ds_802_11d_domain_info {
  1410. __le16 action;
  1411. struct mwifiex_ietypes_domain_param_set domain;
  1412. } __packed;
  1413. struct host_cmd_ds_802_11d_domain_info_rsp {
  1414. __le16 action;
  1415. struct mwifiex_ietypes_domain_param_set domain;
  1416. } __packed;
  1417. struct host_cmd_ds_11n_addba_req {
  1418. u8 add_req_result;
  1419. u8 peer_mac_addr[ETH_ALEN];
  1420. u8 dialog_token;
  1421. __le16 block_ack_param_set;
  1422. __le16 block_ack_tmo;
  1423. __le16 ssn;
  1424. } __packed;
  1425. struct host_cmd_ds_11n_addba_rsp {
  1426. u8 add_rsp_result;
  1427. u8 peer_mac_addr[ETH_ALEN];
  1428. u8 dialog_token;
  1429. __le16 status_code;
  1430. __le16 block_ack_param_set;
  1431. __le16 block_ack_tmo;
  1432. __le16 ssn;
  1433. } __packed;
  1434. struct host_cmd_ds_11n_delba {
  1435. u8 del_result;
  1436. u8 peer_mac_addr[ETH_ALEN];
  1437. __le16 del_ba_param_set;
  1438. __le16 reason_code;
  1439. u8 reserved;
  1440. } __packed;
  1441. struct host_cmd_ds_11n_batimeout {
  1442. u8 tid;
  1443. u8 peer_mac_addr[ETH_ALEN];
  1444. u8 origninator;
  1445. } __packed;
  1446. struct host_cmd_ds_11n_cfg {
  1447. __le16 action;
  1448. __le16 ht_tx_cap;
  1449. __le16 ht_tx_info;
  1450. __le16 misc_config; /* Needed for 802.11AC cards only */
  1451. } __packed;
  1452. struct host_cmd_ds_txbuf_cfg {
  1453. __le16 action;
  1454. __le16 buff_size;
  1455. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  1456. __le16 reserved3;
  1457. } __packed;
  1458. struct host_cmd_ds_amsdu_aggr_ctrl {
  1459. __le16 action;
  1460. __le16 enable;
  1461. __le16 curr_buf_size;
  1462. } __packed;
  1463. struct host_cmd_ds_sta_deauth {
  1464. u8 mac[ETH_ALEN];
  1465. __le16 reason;
  1466. } __packed;
  1467. struct mwifiex_ie_types_sta_info {
  1468. struct mwifiex_ie_types_header header;
  1469. u8 mac[ETH_ALEN];
  1470. u8 power_mfg_status;
  1471. s8 rssi;
  1472. };
  1473. struct host_cmd_ds_sta_list {
  1474. __le16 sta_count;
  1475. u8 tlv[];
  1476. } __packed;
  1477. struct mwifiex_ie_types_pwr_capability {
  1478. struct mwifiex_ie_types_header header;
  1479. s8 min_pwr;
  1480. s8 max_pwr;
  1481. };
  1482. struct mwifiex_ie_types_local_pwr_constraint {
  1483. struct mwifiex_ie_types_header header;
  1484. u8 chan;
  1485. u8 constraint;
  1486. };
  1487. struct mwifiex_ie_types_wmm_param_set {
  1488. struct mwifiex_ie_types_header header;
  1489. u8 wmm_ie[1];
  1490. } __packed;
  1491. struct mwifiex_ie_types_mgmt_frame {
  1492. struct mwifiex_ie_types_header header;
  1493. __le16 frame_control;
  1494. u8 frame_contents[];
  1495. };
  1496. struct mwifiex_ie_types_wmm_queue_status {
  1497. struct mwifiex_ie_types_header header;
  1498. u8 queue_index;
  1499. u8 disabled;
  1500. __le16 medium_time;
  1501. u8 flow_required;
  1502. u8 flow_created;
  1503. u32 reserved;
  1504. };
  1505. struct ieee_types_vendor_header {
  1506. u8 element_id;
  1507. u8 len;
  1508. struct {
  1509. u8 oui[3];
  1510. u8 oui_type;
  1511. } __packed oui;
  1512. } __packed;
  1513. struct ieee_types_wmm_parameter {
  1514. /*
  1515. * WMM Parameter IE - Vendor Specific Header:
  1516. * element_id [221/0xdd]
  1517. * Len [24]
  1518. * Oui [00:50:f2]
  1519. * OuiType [2]
  1520. * OuiSubType [1]
  1521. * Version [1]
  1522. */
  1523. struct ieee_types_vendor_header vend_hdr;
  1524. u8 oui_subtype;
  1525. u8 version;
  1526. u8 qos_info_bitmap;
  1527. u8 reserved;
  1528. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
  1529. } __packed;
  1530. struct ieee_types_wmm_info {
  1531. /*
  1532. * WMM Info IE - Vendor Specific Header:
  1533. * element_id [221/0xdd]
  1534. * Len [7]
  1535. * Oui [00:50:f2]
  1536. * OuiType [2]
  1537. * OuiSubType [0]
  1538. * Version [1]
  1539. */
  1540. struct ieee_types_vendor_header vend_hdr;
  1541. u8 oui_subtype;
  1542. u8 version;
  1543. u8 qos_info_bitmap;
  1544. } __packed;
  1545. struct host_cmd_ds_wmm_get_status {
  1546. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  1547. IEEE80211_NUM_ACS];
  1548. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  1549. } __packed;
  1550. struct mwifiex_wmm_ac_status {
  1551. u8 disabled;
  1552. u8 flow_required;
  1553. u8 flow_created;
  1554. };
  1555. struct mwifiex_ie_types_htcap {
  1556. struct mwifiex_ie_types_header header;
  1557. struct ieee80211_ht_cap ht_cap;
  1558. } __packed;
  1559. struct mwifiex_ie_types_vhtcap {
  1560. struct mwifiex_ie_types_header header;
  1561. struct ieee80211_vht_cap vht_cap;
  1562. } __packed;
  1563. struct mwifiex_ie_types_aid {
  1564. struct mwifiex_ie_types_header header;
  1565. __le16 aid;
  1566. } __packed;
  1567. struct mwifiex_ie_types_oper_mode_ntf {
  1568. struct mwifiex_ie_types_header header;
  1569. u8 oper_mode;
  1570. } __packed;
  1571. /* VHT Operations IE */
  1572. struct mwifiex_ie_types_vht_oper {
  1573. struct mwifiex_ie_types_header header;
  1574. u8 chan_width;
  1575. u8 chan_center_freq_1;
  1576. u8 chan_center_freq_2;
  1577. /* Basic MCS set map, each 2 bits stands for a NSS */
  1578. __le16 basic_mcs_map;
  1579. } __packed;
  1580. struct mwifiex_ie_types_wmmcap {
  1581. struct mwifiex_ie_types_header header;
  1582. struct mwifiex_types_wmm_info wmm_info;
  1583. } __packed;
  1584. struct mwifiex_ie_types_htinfo {
  1585. struct mwifiex_ie_types_header header;
  1586. struct ieee80211_ht_operation ht_oper;
  1587. } __packed;
  1588. struct mwifiex_ie_types_2040bssco {
  1589. struct mwifiex_ie_types_header header;
  1590. u8 bss_co_2040;
  1591. } __packed;
  1592. struct mwifiex_ie_types_extcap {
  1593. struct mwifiex_ie_types_header header;
  1594. u8 ext_capab[];
  1595. } __packed;
  1596. struct host_cmd_ds_mem_access {
  1597. __le16 action;
  1598. __le16 reserved;
  1599. __le32 addr;
  1600. __le32 value;
  1601. } __packed;
  1602. struct mwifiex_ie_types_qos_info {
  1603. struct mwifiex_ie_types_header header;
  1604. u8 qos_info;
  1605. } __packed;
  1606. struct host_cmd_ds_mac_reg_access {
  1607. __le16 action;
  1608. __le16 offset;
  1609. __le32 value;
  1610. } __packed;
  1611. struct host_cmd_ds_bbp_reg_access {
  1612. __le16 action;
  1613. __le16 offset;
  1614. u8 value;
  1615. u8 reserved[3];
  1616. } __packed;
  1617. struct host_cmd_ds_rf_reg_access {
  1618. __le16 action;
  1619. __le16 offset;
  1620. u8 value;
  1621. u8 reserved[3];
  1622. } __packed;
  1623. struct host_cmd_ds_pmic_reg_access {
  1624. __le16 action;
  1625. __le16 offset;
  1626. u8 value;
  1627. u8 reserved[3];
  1628. } __packed;
  1629. struct host_cmd_ds_802_11_eeprom_access {
  1630. __le16 action;
  1631. __le16 offset;
  1632. __le16 byte_count;
  1633. u8 value;
  1634. } __packed;
  1635. struct mwifiex_assoc_event {
  1636. u8 sta_addr[ETH_ALEN];
  1637. __le16 type;
  1638. __le16 len;
  1639. __le16 frame_control;
  1640. __le16 cap_info;
  1641. __le16 listen_interval;
  1642. u8 data[];
  1643. } __packed;
  1644. struct host_cmd_ds_sys_config {
  1645. __le16 action;
  1646. u8 tlv[];
  1647. };
  1648. struct host_cmd_11ac_vht_cfg {
  1649. __le16 action;
  1650. u8 band_config;
  1651. u8 misc_config;
  1652. __le32 cap_info;
  1653. __le32 mcs_tx_set;
  1654. __le32 mcs_rx_set;
  1655. } __packed;
  1656. struct host_cmd_tlv_akmp {
  1657. struct mwifiex_ie_types_header header;
  1658. __le16 key_mgmt;
  1659. __le16 key_mgmt_operation;
  1660. } __packed;
  1661. struct host_cmd_tlv_pwk_cipher {
  1662. struct mwifiex_ie_types_header header;
  1663. __le16 proto;
  1664. u8 cipher;
  1665. u8 reserved;
  1666. } __packed;
  1667. struct host_cmd_tlv_gwk_cipher {
  1668. struct mwifiex_ie_types_header header;
  1669. u8 cipher;
  1670. u8 reserved;
  1671. } __packed;
  1672. struct host_cmd_tlv_passphrase {
  1673. struct mwifiex_ie_types_header header;
  1674. u8 passphrase[];
  1675. } __packed;
  1676. struct host_cmd_tlv_wep_key {
  1677. struct mwifiex_ie_types_header header;
  1678. u8 key_index;
  1679. u8 is_default;
  1680. u8 key[1];
  1681. };
  1682. struct host_cmd_tlv_auth_type {
  1683. struct mwifiex_ie_types_header header;
  1684. u8 auth_type;
  1685. } __packed;
  1686. struct host_cmd_tlv_encrypt_protocol {
  1687. struct mwifiex_ie_types_header header;
  1688. __le16 proto;
  1689. } __packed;
  1690. struct host_cmd_tlv_ssid {
  1691. struct mwifiex_ie_types_header header;
  1692. u8 ssid[];
  1693. } __packed;
  1694. struct host_cmd_tlv_rates {
  1695. struct mwifiex_ie_types_header header;
  1696. u8 rates[];
  1697. } __packed;
  1698. struct mwifiex_ie_types_bssid_list {
  1699. struct mwifiex_ie_types_header header;
  1700. u8 bssid[ETH_ALEN];
  1701. } __packed;
  1702. struct host_cmd_tlv_bcast_ssid {
  1703. struct mwifiex_ie_types_header header;
  1704. u8 bcast_ctl;
  1705. } __packed;
  1706. struct host_cmd_tlv_beacon_period {
  1707. struct mwifiex_ie_types_header header;
  1708. __le16 period;
  1709. } __packed;
  1710. struct host_cmd_tlv_dtim_period {
  1711. struct mwifiex_ie_types_header header;
  1712. u8 period;
  1713. } __packed;
  1714. struct host_cmd_tlv_frag_threshold {
  1715. struct mwifiex_ie_types_header header;
  1716. __le16 frag_thr;
  1717. } __packed;
  1718. struct host_cmd_tlv_rts_threshold {
  1719. struct mwifiex_ie_types_header header;
  1720. __le16 rts_thr;
  1721. } __packed;
  1722. struct host_cmd_tlv_retry_limit {
  1723. struct mwifiex_ie_types_header header;
  1724. u8 limit;
  1725. } __packed;
  1726. struct host_cmd_tlv_mac_addr {
  1727. struct mwifiex_ie_types_header header;
  1728. u8 mac_addr[ETH_ALEN];
  1729. } __packed;
  1730. struct host_cmd_tlv_channel_band {
  1731. struct mwifiex_ie_types_header header;
  1732. u8 band_config;
  1733. u8 channel;
  1734. } __packed;
  1735. struct host_cmd_tlv_ageout_timer {
  1736. struct mwifiex_ie_types_header header;
  1737. __le32 sta_ao_timer;
  1738. } __packed;
  1739. struct host_cmd_tlv_power_constraint {
  1740. struct mwifiex_ie_types_header header;
  1741. u8 constraint;
  1742. } __packed;
  1743. struct mwifiex_ie_types_btcoex_scan_time {
  1744. struct mwifiex_ie_types_header header;
  1745. u8 coex_scan;
  1746. u8 reserved;
  1747. __le16 min_scan_time;
  1748. __le16 max_scan_time;
  1749. } __packed;
  1750. struct mwifiex_ie_types_btcoex_aggr_win_size {
  1751. struct mwifiex_ie_types_header header;
  1752. u8 coex_win_size;
  1753. u8 tx_win_size;
  1754. u8 rx_win_size;
  1755. u8 reserved;
  1756. } __packed;
  1757. struct mwifiex_ie_types_robust_coex {
  1758. struct mwifiex_ie_types_header header;
  1759. __le32 mode;
  1760. } __packed;
  1761. #define MWIFIEX_VERSION_STR_LENGTH 128
  1762. struct host_cmd_ds_version_ext {
  1763. u8 version_str_sel;
  1764. char version_str[MWIFIEX_VERSION_STR_LENGTH];
  1765. } __packed;
  1766. struct host_cmd_ds_mgmt_frame_reg {
  1767. __le16 action;
  1768. __le32 mask;
  1769. } __packed;
  1770. struct host_cmd_ds_p2p_mode_cfg {
  1771. __le16 action;
  1772. __le16 mode;
  1773. } __packed;
  1774. struct host_cmd_ds_remain_on_chan {
  1775. __le16 action;
  1776. u8 status;
  1777. u8 reserved;
  1778. u8 band_cfg;
  1779. u8 channel;
  1780. __le32 duration;
  1781. } __packed;
  1782. struct host_cmd_ds_802_11_ibss_status {
  1783. __le16 action;
  1784. __le16 enable;
  1785. u8 bssid[ETH_ALEN];
  1786. __le16 beacon_interval;
  1787. __le16 atim_window;
  1788. __le16 use_g_rate_protect;
  1789. } __packed;
  1790. struct mwifiex_fw_mef_entry {
  1791. u8 mode;
  1792. u8 action;
  1793. __le16 exprsize;
  1794. u8 expr[];
  1795. } __packed;
  1796. struct host_cmd_ds_mef_cfg {
  1797. __le32 criteria;
  1798. __le16 num_entries;
  1799. u8 mef_entry_data[];
  1800. } __packed;
  1801. #define CONNECTION_TYPE_INFRA 0
  1802. #define CONNECTION_TYPE_ADHOC 1
  1803. #define CONNECTION_TYPE_AP 2
  1804. struct host_cmd_ds_set_bss_mode {
  1805. u8 con_type;
  1806. } __packed;
  1807. struct host_cmd_ds_pcie_details {
  1808. /* TX buffer descriptor ring address */
  1809. __le32 txbd_addr_lo;
  1810. __le32 txbd_addr_hi;
  1811. /* TX buffer descriptor ring count */
  1812. __le32 txbd_count;
  1813. /* RX buffer descriptor ring address */
  1814. __le32 rxbd_addr_lo;
  1815. __le32 rxbd_addr_hi;
  1816. /* RX buffer descriptor ring count */
  1817. __le32 rxbd_count;
  1818. /* Event buffer descriptor ring address */
  1819. __le32 evtbd_addr_lo;
  1820. __le32 evtbd_addr_hi;
  1821. /* Event buffer descriptor ring count */
  1822. __le32 evtbd_count;
  1823. /* Sleep cookie buffer physical address */
  1824. __le32 sleep_cookie_addr_lo;
  1825. __le32 sleep_cookie_addr_hi;
  1826. } __packed;
  1827. struct mwifiex_ie_types_rssi_threshold {
  1828. struct mwifiex_ie_types_header header;
  1829. u8 abs_value;
  1830. u8 evt_freq;
  1831. } __packed;
  1832. #define MWIFIEX_DFS_REC_HDR_LEN 8
  1833. #define MWIFIEX_DFS_REC_HDR_NUM 10
  1834. #define MWIFIEX_BIN_COUNTER_LEN 7
  1835. struct mwifiex_radar_det_event {
  1836. __le32 detect_count;
  1837. u8 reg_domain; /*1=fcc, 2=etsi, 3=mic*/
  1838. u8 det_type; /*0=none, 1=pw(chirp), 2=pri(radar)*/
  1839. __le16 pw_chirp_type;
  1840. u8 pw_chirp_idx;
  1841. u8 pw_value;
  1842. u8 pri_radar_type;
  1843. u8 pri_bincnt;
  1844. u8 bin_counter[MWIFIEX_BIN_COUNTER_LEN];
  1845. u8 num_dfs_records;
  1846. u8 dfs_record_hdr[MWIFIEX_DFS_REC_HDR_NUM][MWIFIEX_DFS_REC_HDR_LEN];
  1847. __le32 passed;
  1848. } __packed;
  1849. struct mwifiex_ie_types_multi_chan_info {
  1850. struct mwifiex_ie_types_header header;
  1851. __le16 status;
  1852. u8 tlv_buffer[];
  1853. } __packed;
  1854. struct mwifiex_ie_types_mc_group_info {
  1855. struct mwifiex_ie_types_header header;
  1856. u8 chan_group_id;
  1857. u8 chan_buf_weight;
  1858. u8 band_config;
  1859. u8 chan_num;
  1860. __le32 chan_time;
  1861. __le32 reserved;
  1862. union {
  1863. u8 sdio_func_num;
  1864. u8 usb_ep_num;
  1865. } hid_num;
  1866. u8 intf_num;
  1867. u8 bss_type_numlist[];
  1868. } __packed;
  1869. struct meas_rpt_map {
  1870. u8 rssi:3;
  1871. u8 unmeasured:1;
  1872. u8 radar:1;
  1873. u8 unidentified_sig:1;
  1874. u8 ofdm_preamble:1;
  1875. u8 bss:1;
  1876. } __packed;
  1877. struct mwifiex_ie_types_chan_rpt_data {
  1878. struct mwifiex_ie_types_header header;
  1879. struct meas_rpt_map map;
  1880. } __packed;
  1881. struct host_cmd_ds_802_11_subsc_evt {
  1882. __le16 action;
  1883. __le16 events;
  1884. } __packed;
  1885. struct chan_switch_result {
  1886. u8 cur_chan;
  1887. u8 status;
  1888. u8 reason;
  1889. } __packed;
  1890. struct mwifiex_tdls_generic_event {
  1891. __le16 type;
  1892. u8 peer_mac[ETH_ALEN];
  1893. union {
  1894. struct chan_switch_result switch_result;
  1895. u8 cs_stop_reason;
  1896. __le16 reason_code;
  1897. __le16 reserved;
  1898. } u;
  1899. } __packed;
  1900. struct mwifiex_ie {
  1901. __le16 ie_index;
  1902. __le16 mgmt_subtype_mask;
  1903. __le16 ie_length;
  1904. u8 ie_buffer[IEEE_MAX_IE_SIZE];
  1905. } __packed;
  1906. #define MAX_MGMT_IE_INDEX 16
  1907. struct mwifiex_ie_list {
  1908. __le16 type;
  1909. __le16 len;
  1910. struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
  1911. } __packed;
  1912. struct coalesce_filt_field_param {
  1913. u8 operation;
  1914. u8 operand_len;
  1915. __le16 offset;
  1916. u8 operand_byte_stream[4];
  1917. };
  1918. struct coalesce_receive_filt_rule {
  1919. struct mwifiex_ie_types_header header;
  1920. u8 num_of_fields;
  1921. u8 pkt_type;
  1922. __le16 max_coalescing_delay;
  1923. struct coalesce_filt_field_param params[];
  1924. } __packed;
  1925. struct host_cmd_ds_coalesce_cfg {
  1926. __le16 action;
  1927. __le16 num_of_rules;
  1928. u8 rule_data[];
  1929. } __packed;
  1930. struct host_cmd_ds_multi_chan_policy {
  1931. __le16 action;
  1932. __le16 policy;
  1933. } __packed;
  1934. struct host_cmd_ds_robust_coex {
  1935. __le16 action;
  1936. __le16 reserved;
  1937. } __packed;
  1938. struct host_cmd_ds_wakeup_reason {
  1939. __le16 wakeup_reason;
  1940. } __packed;
  1941. struct host_cmd_ds_gtk_rekey_params {
  1942. __le16 action;
  1943. u8 kck[NL80211_KCK_LEN];
  1944. u8 kek[NL80211_KEK_LEN];
  1945. __le32 replay_ctr_low;
  1946. __le32 replay_ctr_high;
  1947. } __packed;
  1948. struct host_cmd_ds_chan_region_cfg {
  1949. __le16 action;
  1950. } __packed;
  1951. struct host_cmd_ds_pkt_aggr_ctrl {
  1952. __le16 action;
  1953. __le16 enable;
  1954. __le16 tx_aggr_max_size;
  1955. __le16 tx_aggr_max_num;
  1956. __le16 tx_aggr_align;
  1957. } __packed;
  1958. struct host_cmd_ds_sta_configure {
  1959. __le16 action;
  1960. u8 tlv_buffer[];
  1961. } __packed;
  1962. struct host_cmd_ds_command {
  1963. __le16 command;
  1964. __le16 size;
  1965. __le16 seq_num;
  1966. __le16 result;
  1967. union {
  1968. struct host_cmd_ds_get_hw_spec hw_spec;
  1969. struct host_cmd_ds_mac_control mac_ctrl;
  1970. struct host_cmd_ds_802_11_mac_address mac_addr;
  1971. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1972. struct host_cmd_ds_802_11_get_log get_log;
  1973. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1974. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1975. struct host_cmd_ds_802_11_snmp_mib smib;
  1976. struct host_cmd_ds_tx_rate_query tx_rate;
  1977. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1978. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1979. struct host_cmd_ds_rf_tx_pwr txp;
  1980. struct host_cmd_ds_rf_ant_mimo ant_mimo;
  1981. struct host_cmd_ds_rf_ant_siso ant_siso;
  1982. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1983. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1984. struct host_cmd_ds_802_11_scan scan;
  1985. struct host_cmd_ds_802_11_scan_ext ext_scan;
  1986. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1987. struct host_cmd_ds_802_11_bg_scan_config bg_scan_config;
  1988. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1989. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1990. struct host_cmd_ds_802_11_associate associate;
  1991. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1992. struct host_cmd_ds_802_11_deauthenticate deauth;
  1993. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1994. struct host_cmd_ds_802_11_ad_hoc_start_result start_result;
  1995. struct host_cmd_ds_802_11_ad_hoc_join_result join_result;
  1996. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1997. struct host_cmd_ds_802_11d_domain_info domain_info;
  1998. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1999. struct host_cmd_ds_11n_addba_req add_ba_req;
  2000. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  2001. struct host_cmd_ds_11n_delba del_ba;
  2002. struct host_cmd_ds_txbuf_cfg tx_buf;
  2003. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  2004. struct host_cmd_ds_11n_cfg htcfg;
  2005. struct host_cmd_ds_wmm_get_status get_wmm_status;
  2006. struct host_cmd_ds_802_11_key_material key_material;
  2007. struct host_cmd_ds_802_11_key_material_v2 key_material_v2;
  2008. struct host_cmd_ds_802_11_key_material_wep key_material_wep;
  2009. struct host_cmd_ds_version_ext verext;
  2010. struct host_cmd_ds_mgmt_frame_reg reg_mask;
  2011. struct host_cmd_ds_remain_on_chan roc_cfg;
  2012. struct host_cmd_ds_p2p_mode_cfg mode_cfg;
  2013. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  2014. struct host_cmd_ds_mef_cfg mef_cfg;
  2015. struct host_cmd_ds_mem_access mem;
  2016. struct host_cmd_ds_mac_reg_access mac_reg;
  2017. struct host_cmd_ds_bbp_reg_access bbp_reg;
  2018. struct host_cmd_ds_rf_reg_access rf_reg;
  2019. struct host_cmd_ds_pmic_reg_access pmic_reg;
  2020. struct host_cmd_ds_set_bss_mode bss_mode;
  2021. struct host_cmd_ds_pcie_details pcie_host_spec;
  2022. struct host_cmd_ds_802_11_eeprom_access eeprom;
  2023. struct host_cmd_ds_802_11_subsc_evt subsc_evt;
  2024. struct host_cmd_ds_sys_config uap_sys_config;
  2025. struct host_cmd_ds_sta_deauth sta_deauth;
  2026. struct host_cmd_ds_sta_list sta_list;
  2027. struct host_cmd_11ac_vht_cfg vht_cfg;
  2028. struct host_cmd_ds_coalesce_cfg coalesce_cfg;
  2029. struct host_cmd_ds_tdls_config tdls_config;
  2030. struct host_cmd_ds_tdls_oper tdls_oper;
  2031. struct host_cmd_ds_chan_rpt_req chan_rpt_req;
  2032. struct host_cmd_sdio_sp_rx_aggr_cfg sdio_rx_aggr_cfg;
  2033. struct host_cmd_ds_multi_chan_policy mc_policy;
  2034. struct host_cmd_ds_robust_coex coex;
  2035. struct host_cmd_ds_wakeup_reason hs_wakeup_reason;
  2036. struct host_cmd_ds_gtk_rekey_params rekey;
  2037. struct host_cmd_ds_chan_region_cfg reg_cfg;
  2038. struct host_cmd_ds_pkt_aggr_ctrl pkt_aggr_ctrl;
  2039. struct host_cmd_ds_sta_configure sta_cfg;
  2040. } params;
  2041. } __packed;
  2042. struct mwifiex_opt_sleep_confirm {
  2043. __le16 command;
  2044. __le16 size;
  2045. __le16 seq_num;
  2046. __le16 result;
  2047. __le16 action;
  2048. __le16 resp_ctrl;
  2049. } __packed;
  2050. struct hw_spec_max_conn {
  2051. struct mwifiex_ie_types_header header;
  2052. u8 max_p2p_conn;
  2053. u8 max_sta_conn;
  2054. } __packed;
  2055. #endif /* !_MWIFIEX_FW_H_ */