fw.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887
  1. /*
  2. * Marvell Wireless LAN device driver: Firmware specific macros & structures
  3. *
  4. * Copyright (C) 2011-2014, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #ifndef _MWIFIEX_FW_H_
  20. #define _MWIFIEX_FW_H_
  21. #include <linux/if_ether.h>
  22. #define INTF_HEADER_LEN 4
  23. struct rfc_1042_hdr {
  24. u8 llc_dsap;
  25. u8 llc_ssap;
  26. u8 llc_ctrl;
  27. u8 snap_oui[3];
  28. __be16 snap_type;
  29. };
  30. struct rx_packet_hdr {
  31. struct ethhdr eth803_hdr;
  32. struct rfc_1042_hdr rfc1042_hdr;
  33. };
  34. struct tx_packet_hdr {
  35. struct ethhdr eth803_hdr;
  36. struct rfc_1042_hdr rfc1042_hdr;
  37. };
  38. #define B_SUPPORTED_RATES 5
  39. #define G_SUPPORTED_RATES 9
  40. #define BG_SUPPORTED_RATES 13
  41. #define A_SUPPORTED_RATES 9
  42. #define HOSTCMD_SUPPORTED_RATES 14
  43. #define N_SUPPORTED_RATES 3
  44. #define ALL_802_11_BANDS (BAND_A | BAND_B | BAND_G | BAND_GN | \
  45. BAND_AN | BAND_AAC)
  46. #define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11) | \
  47. BIT(13))
  48. #define IS_SUPPORT_MULTI_BANDS(adapter) \
  49. (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
  50. /* bit 13: 11ac BAND_AAC
  51. * bit 12: reserved for lab testing, will be reused for BAND_AN
  52. * bit 11: 11n BAND_GN
  53. * bit 10: 11a BAND_A
  54. * bit 9: 11g BAND_G
  55. * bit 8: 11b BAND_B
  56. * Map these bits to band capability by right shifting 8 bits.
  57. */
  58. #define GET_FW_DEFAULT_BANDS(adapter) \
  59. (((adapter->fw_cap_info & 0x2f00) >> 8) & \
  60. ALL_802_11_BANDS)
  61. #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  62. #define KEY_INFO_ENABLED 0x01
  63. enum KEY_TYPE_ID {
  64. KEY_TYPE_ID_WEP = 0,
  65. KEY_TYPE_ID_TKIP,
  66. KEY_TYPE_ID_AES,
  67. KEY_TYPE_ID_WAPI,
  68. KEY_TYPE_ID_AES_CMAC,
  69. };
  70. #define WPA_PN_SIZE 8
  71. #define KEY_PARAMS_FIXED_LEN 10
  72. #define KEY_INDEX_MASK 0xf
  73. #define KEY_API_VER_MAJOR_V2 2
  74. #define KEY_MCAST BIT(0)
  75. #define KEY_UNICAST BIT(1)
  76. #define KEY_ENABLED BIT(2)
  77. #define KEY_DEFAULT BIT(3)
  78. #define KEY_TX_KEY BIT(4)
  79. #define KEY_RX_KEY BIT(5)
  80. #define KEY_IGTK BIT(10)
  81. #define WAPI_KEY_LEN (WLAN_KEY_LEN_SMS4 + PN_LEN + 2)
  82. #define MAX_POLL_TRIES 100
  83. #define MAX_FIRMWARE_POLL_TRIES 100
  84. #define FIRMWARE_READY_SDIO 0xfedc
  85. #define FIRMWARE_READY_PCIE 0xfedcba00
  86. enum mwifiex_usb_ep {
  87. MWIFIEX_USB_EP_CMD_EVENT = 1,
  88. MWIFIEX_USB_EP_DATA = 2,
  89. };
  90. enum MWIFIEX_802_11_PRIVACY_FILTER {
  91. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  92. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  93. };
  94. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  95. #define CAL_RSSI(SNR, NF) ((s16)((s16)(SNR)+(s16)(NF)))
  96. #define UAP_BSS_PARAMS_I 0
  97. #define UAP_CUSTOM_IE_I 1
  98. #define MWIFIEX_AUTO_IDX_MASK 0xffff
  99. #define MWIFIEX_DELETE_MASK 0x0000
  100. #define MGMT_MASK_ASSOC_REQ 0x01
  101. #define MGMT_MASK_REASSOC_REQ 0x04
  102. #define MGMT_MASK_ASSOC_RESP 0x02
  103. #define MGMT_MASK_REASSOC_RESP 0x08
  104. #define MGMT_MASK_PROBE_REQ 0x10
  105. #define MGMT_MASK_PROBE_RESP 0x20
  106. #define MGMT_MASK_BEACON 0x100
  107. #define TLV_TYPE_UAP_SSID 0x0000
  108. #define TLV_TYPE_UAP_RATES 0x0001
  109. #define PROPRIETARY_TLV_BASE_ID 0x0100
  110. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  111. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  112. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  113. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  114. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  115. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  116. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  117. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  118. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  119. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  120. #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
  121. #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
  122. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  123. #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
  124. #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
  125. #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
  126. #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
  127. #define TLV_TYPE_UAP_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 57)
  128. #define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
  129. #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
  130. #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
  131. #define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
  132. #define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
  133. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  134. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  135. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  136. #define TLV_TYPE_BSS_SCAN_RSP (PROPRIETARY_TLV_BASE_ID + 86)
  137. #define TLV_TYPE_BSS_SCAN_INFO (PROPRIETARY_TLV_BASE_ID + 87)
  138. #define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
  139. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  140. #define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
  141. #define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
  142. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  143. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  144. #define TLV_TYPE_UAP_PS_AO_TIMER (PROPRIETARY_TLV_BASE_ID + 123)
  145. #define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
  146. #define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
  147. #define TLV_TYPE_COALESCE_RULE (PROPRIETARY_TLV_BASE_ID + 154)
  148. #define TLV_TYPE_KEY_PARAM_V2 (PROPRIETARY_TLV_BASE_ID + 156)
  149. #define TLV_TYPE_TDLS_IDLE_TIMEOUT (PROPRIETARY_TLV_BASE_ID + 194)
  150. #define TLV_TYPE_SCAN_CHANNEL_GAP (PROPRIETARY_TLV_BASE_ID + 197)
  151. #define TLV_TYPE_API_REV (PROPRIETARY_TLV_BASE_ID + 199)
  152. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  153. #define SSN_MASK 0xfff0
  154. #define BA_RESULT_SUCCESS 0x0
  155. #define BA_RESULT_TIMEOUT 0x2
  156. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  157. #define BA_STREAM_NOT_ALLOWED 0xff
  158. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  159. priv->adapter->config_bands & BAND_AN) && \
  160. priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
  161. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  162. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  163. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  164. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  165. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  166. #define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14))
  167. #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
  168. (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
  169. IEEE80211_HT_CAP_SM_PS)
  170. #define MWIFIEX_DEF_11N_TX_BF_CAP 0x09E1E008
  171. #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
  172. #define GET_RXSTBC(x) (x & IEEE80211_HT_CAP_RX_STBC)
  173. #define MWIFIEX_RX_STBC1 0x0100
  174. #define MWIFIEX_RX_STBC12 0x0200
  175. #define MWIFIEX_RX_STBC123 0x0300
  176. /* dev_cap bitmap
  177. * BIT
  178. * 0-16 reserved
  179. * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
  180. * 18-22 reserved
  181. * 23 IEEE80211_HT_CAP_SGI_20
  182. * 24 IEEE80211_HT_CAP_SGI_40
  183. * 25 IEEE80211_HT_CAP_TX_STBC
  184. * 26 IEEE80211_HT_CAP_RX_STBC
  185. * 27-28 reserved
  186. * 29 IEEE80211_HT_CAP_GRN_FLD
  187. * 30-31 reserved
  188. */
  189. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  190. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  191. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  192. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  193. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  194. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  195. #define ISENABLED_40MHZ_INTOLERANT(Dot11nDevCap) (Dot11nDevCap & BIT(8))
  196. #define ISSUPP_RXLDPC(Dot11nDevCap) (Dot11nDevCap & BIT(22))
  197. #define ISSUPP_BEAMFORMING(Dot11nDevCap) (Dot11nDevCap & BIT(30))
  198. #define ISALLOWED_CHANWIDTH40(ht_param) (ht_param & BIT(2))
  199. /* httxcfg bitmap
  200. * 0 reserved
  201. * 1 20/40 Mhz enable(1)/disable(0)
  202. * 2-3 reserved
  203. * 4 green field enable(1)/disable(0)
  204. * 5 short GI in 20 Mhz enable(1)/disable(0)
  205. * 6 short GI in 40 Mhz enable(1)/disable(0)
  206. * 7-15 reserved
  207. */
  208. #define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
  209. /* 11AC Tx and Rx MCS map for 1x1 mode:
  210. * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1
  211. * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 7 streams
  212. */
  213. #define MWIFIEX_11AC_MCS_MAP_1X1 0xfffefffe
  214. /* 11AC Tx and Rx MCS map for 2x2 mode:
  215. * IEEE80211_VHT_MCS_SUPPORT_0_9 for stream 1 and 2
  216. * IEEE80211_VHT_MCS_NOT_SUPPORTED for remaining 6 streams
  217. */
  218. #define MWIFIEX_11AC_MCS_MAP_2X2 0xfffafffa
  219. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  220. #define SETHT_MCS32(x) (x[4] |= 1)
  221. #define HT_STREAM_1X1 0x11
  222. #define HT_STREAM_2X2 0x22
  223. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  224. #define LLC_SNAP_LEN 8
  225. /* HW_SPEC fw_cap_info */
  226. #define ISSUPP_11ACENABLED(fw_cap_info) (fw_cap_info & BIT(13))
  227. #define GET_VHTCAP_CHWDSET(vht_cap_info) ((vht_cap_info >> 2) & 0x3)
  228. #define GET_VHTNSSMCS(mcs_mapset, nss) ((mcs_mapset >> (2 * (nss - 1))) & 0x3)
  229. #define SET_VHTNSSMCS(mcs_mapset, nss, value) (mcs_mapset |= (value & 0x3) << \
  230. (2 * (nss - 1)))
  231. #define GET_DEVTXMCSMAP(dev_mcs_map) (dev_mcs_map >> 16)
  232. #define GET_DEVRXMCSMAP(dev_mcs_map) (dev_mcs_map & 0xFFFF)
  233. /* Clear SU Beanformer, MU beanformer, MU beanformee and
  234. * sounding dimensions bits
  235. */
  236. #define MWIFIEX_DEF_11AC_CAP_BF_RESET_MASK \
  237. (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | \
  238. IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE | \
  239. IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE | \
  240. IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK)
  241. #define MOD_CLASS_HR_DSSS 0x03
  242. #define MOD_CLASS_OFDM 0x07
  243. #define MOD_CLASS_HT 0x08
  244. #define HT_BW_20 0
  245. #define HT_BW_40 1
  246. #define DFS_CHAN_MOVE_TIME 10000
  247. #define HostCmd_CMD_GET_HW_SPEC 0x0003
  248. #define HostCmd_CMD_802_11_SCAN 0x0006
  249. #define HostCmd_CMD_802_11_GET_LOG 0x000b
  250. #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
  251. #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
  252. #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
  253. #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
  254. #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
  255. #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
  256. #define HostCmd_CMD_RF_REG_ACCESS 0x001b
  257. #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
  258. #define HostCmd_CMD_RF_TX_PWR 0x001e
  259. #define HostCmd_CMD_RF_ANTENNA 0x0020
  260. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  261. #define HostCmd_CMD_MAC_CONTROL 0x0028
  262. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  263. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  264. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  265. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  266. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  267. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  268. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  269. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  270. #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
  271. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  272. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  273. #define HostCmd_CMD_CFG_DATA 0x008f
  274. #define HostCmd_CMD_VERSION_EXT 0x0097
  275. #define HostCmd_CMD_MEF_CFG 0x009a
  276. #define HostCmd_CMD_RSSI_INFO 0x00a4
  277. #define HostCmd_CMD_FUNC_INIT 0x00a9
  278. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  279. #define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
  280. #define HostCmd_CMD_UAP_BSS_START 0x00b1
  281. #define HostCmd_CMD_UAP_BSS_STOP 0x00b2
  282. #define HostCmd_CMD_UAP_STA_DEAUTH 0x00b5
  283. #define HostCmd_CMD_11N_CFG 0x00cd
  284. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  285. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  286. #define HostCmd_CMD_11N_DELBA 0x00d0
  287. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  288. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  289. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  290. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  291. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  292. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  293. #define HostCmd_CMD_P2P_MODE_CFG 0x00eb
  294. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  295. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  296. #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
  297. #define HostCmd_CMD_802_11_SCAN_EXT 0x0107
  298. #define HostCmd_CMD_COALESCE_CFG 0x010a
  299. #define HostCmd_CMD_MGMT_FRAME_REG 0x010c
  300. #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
  301. #define HostCmd_CMD_11AC_CFG 0x0112
  302. #define HostCmd_CMD_TDLS_OPER 0x0122
  303. #define PROTOCOL_NO_SECURITY 0x01
  304. #define PROTOCOL_STATIC_WEP 0x02
  305. #define PROTOCOL_WPA 0x08
  306. #define PROTOCOL_WPA2 0x20
  307. #define PROTOCOL_WPA2_MIXED 0x28
  308. #define PROTOCOL_EAP 0x40
  309. #define KEY_MGMT_NONE 0x04
  310. #define KEY_MGMT_PSK 0x02
  311. #define KEY_MGMT_EAP 0x01
  312. #define CIPHER_TKIP 0x04
  313. #define CIPHER_AES_CCMP 0x08
  314. #define VALID_CIPHER_BITMAP 0x0c
  315. enum ENH_PS_MODES {
  316. EN_PS = 1,
  317. DIS_PS = 2,
  318. EN_AUTO_DS = 3,
  319. DIS_AUTO_DS = 4,
  320. SLEEP_CONFIRM = 5,
  321. GET_PS = 0,
  322. EN_AUTO_PS = 0xff,
  323. DIS_AUTO_PS = 0xfe,
  324. };
  325. enum P2P_MODES {
  326. P2P_MODE_DISABLE = 0,
  327. P2P_MODE_DEVICE = 1,
  328. P2P_MODE_GO = 2,
  329. P2P_MODE_CLIENT = 3,
  330. };
  331. #define HostCmd_RET_BIT 0x8000
  332. #define HostCmd_ACT_GEN_GET 0x0000
  333. #define HostCmd_ACT_GEN_SET 0x0001
  334. #define HostCmd_ACT_GEN_REMOVE 0x0004
  335. #define HostCmd_ACT_BITWISE_SET 0x0002
  336. #define HostCmd_ACT_BITWISE_CLR 0x0003
  337. #define HostCmd_RESULT_OK 0x0000
  338. #define HostCmd_ACT_MAC_RX_ON 0x0001
  339. #define HostCmd_ACT_MAC_TX_ON 0x0002
  340. #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
  341. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
  342. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  343. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  344. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
  345. #define HostCmd_BSS_MODE_IBSS 0x0002
  346. #define HostCmd_BSS_MODE_ANY 0x0003
  347. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  348. #define HostCmd_SCAN_RADIO_TYPE_A 1
  349. #define HS_CFG_CANCEL 0xffffffff
  350. #define HS_CFG_COND_DEF 0x00000000
  351. #define HS_CFG_GPIO_DEF 0xff
  352. #define HS_CFG_GAP_DEF 0xff
  353. #define HS_CFG_COND_BROADCAST_DATA 0x00000001
  354. #define HS_CFG_COND_UNICAST_DATA 0x00000002
  355. #define HS_CFG_COND_MAC_EVENT 0x00000004
  356. #define HS_CFG_COND_MULTICAST_DATA 0x00000008
  357. #define MWIFIEX_TIMEOUT_FOR_AP_RESP 0xfffc
  358. #define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT 2
  359. #define CMD_F_HOSTCMD (1 << 0)
  360. #define CMD_F_CANCELED (1 << 1)
  361. #define HostCmd_CMD_ID_MASK 0x0fff
  362. #define HostCmd_SEQ_NUM_MASK 0x00ff
  363. #define HostCmd_BSS_NUM_MASK 0x0f00
  364. #define HostCmd_BSS_TYPE_MASK 0xf000
  365. #define HostCmd_ACT_SET_RX 0x0001
  366. #define HostCmd_ACT_SET_TX 0x0002
  367. #define HostCmd_ACT_SET_BOTH 0x0003
  368. #define RF_ANTENNA_AUTO 0xFFFF
  369. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  370. (((seq) & 0x00ff) | \
  371. (((num) & 0x000f) << 8)) | \
  372. (((type) & 0x000f) << 12); }
  373. #define HostCmd_GET_SEQ_NO(seq) \
  374. ((seq) & HostCmd_SEQ_NUM_MASK)
  375. #define HostCmd_GET_BSS_NO(seq) \
  376. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  377. #define HostCmd_GET_BSS_TYPE(seq) \
  378. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  379. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  380. #define EVENT_LINK_LOST 0x00000003
  381. #define EVENT_LINK_SENSED 0x00000004
  382. #define EVENT_MIB_CHANGED 0x00000006
  383. #define EVENT_INIT_DONE 0x00000007
  384. #define EVENT_DEAUTHENTICATED 0x00000008
  385. #define EVENT_DISASSOCIATED 0x00000009
  386. #define EVENT_PS_AWAKE 0x0000000a
  387. #define EVENT_PS_SLEEP 0x0000000b
  388. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  389. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  390. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  391. #define EVENT_ADHOC_BCN_LOST 0x00000011
  392. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  393. #define EVENT_BG_SCAN_REPORT 0x00000018
  394. #define EVENT_RSSI_LOW 0x00000019
  395. #define EVENT_SNR_LOW 0x0000001a
  396. #define EVENT_MAX_FAIL 0x0000001b
  397. #define EVENT_RSSI_HIGH 0x0000001c
  398. #define EVENT_SNR_HIGH 0x0000001d
  399. #define EVENT_IBSS_COALESCED 0x0000001e
  400. #define EVENT_DATA_RSSI_LOW 0x00000024
  401. #define EVENT_DATA_SNR_LOW 0x00000025
  402. #define EVENT_DATA_RSSI_HIGH 0x00000026
  403. #define EVENT_DATA_SNR_HIGH 0x00000027
  404. #define EVENT_LINK_QUALITY 0x00000028
  405. #define EVENT_PORT_RELEASE 0x0000002b
  406. #define EVENT_UAP_STA_DEAUTH 0x0000002c
  407. #define EVENT_UAP_STA_ASSOC 0x0000002d
  408. #define EVENT_UAP_BSS_START 0x0000002e
  409. #define EVENT_PRE_BEACON_LOST 0x00000031
  410. #define EVENT_ADDBA 0x00000033
  411. #define EVENT_DELBA 0x00000034
  412. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  413. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  414. #define EVENT_UAP_BSS_IDLE 0x00000043
  415. #define EVENT_UAP_BSS_ACTIVE 0x00000044
  416. #define EVENT_WEP_ICV_ERR 0x00000046
  417. #define EVENT_HS_ACT_REQ 0x00000047
  418. #define EVENT_BW_CHANGE 0x00000048
  419. #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
  420. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  421. #define EVENT_CHANNEL_SWITCH_ANN 0x00000050
  422. #define EVENT_TDLS_GENERIC_EVENT 0x00000052
  423. #define EVENT_EXT_SCAN_REPORT 0x00000058
  424. #define EVENT_REMAIN_ON_CHAN_EXPIRED 0x0000005f
  425. #define EVENT_ID_MASK 0xffff
  426. #define BSS_NUM_MASK 0xf
  427. #define EVENT_GET_BSS_NUM(event_cause) \
  428. (((event_cause) >> 16) & BSS_NUM_MASK)
  429. #define EVENT_GET_BSS_TYPE(event_cause) \
  430. (((event_cause) >> 24) & 0x00ff)
  431. #define MWIFIEX_MAX_PATTERN_LEN 20
  432. #define MWIFIEX_MAX_OFFSET_LEN 100
  433. #define STACK_NBYTES 100
  434. #define TYPE_DNUM 1
  435. #define TYPE_BYTESEQ 2
  436. #define MAX_OPERAND 0x40
  437. #define TYPE_EQ (MAX_OPERAND+1)
  438. #define TYPE_EQ_DNUM (MAX_OPERAND+2)
  439. #define TYPE_EQ_BIT (MAX_OPERAND+3)
  440. #define TYPE_AND (MAX_OPERAND+4)
  441. #define TYPE_OR (MAX_OPERAND+5)
  442. #define MEF_MODE_HOST_SLEEP 1
  443. #define MEF_ACTION_ALLOW_AND_WAKEUP_HOST 3
  444. #define MWIFIEX_CRITERIA_BROADCAST BIT(0)
  445. #define MWIFIEX_CRITERIA_UNICAST BIT(1)
  446. #define MWIFIEX_CRITERIA_MULTICAST BIT(3)
  447. #define ACT_TDLS_DELETE 0x00
  448. #define ACT_TDLS_CREATE 0x01
  449. #define ACT_TDLS_CONFIG 0x02
  450. #define TDLS_EVENT_LINK_TEAR_DOWN 3
  451. #define MWIFIEX_FW_V15 15
  452. struct mwifiex_ie_types_header {
  453. __le16 type;
  454. __le16 len;
  455. } __packed;
  456. struct mwifiex_ie_types_data {
  457. struct mwifiex_ie_types_header header;
  458. u8 data[1];
  459. } __packed;
  460. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  461. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  462. #define MWIFIEX_TXPD_FLAGS_TDLS_PACKET 0x10
  463. #define MWIFIEX_RXPD_FLAGS_TDLS_PACKET 0x01
  464. struct txpd {
  465. u8 bss_type;
  466. u8 bss_num;
  467. __le16 tx_pkt_length;
  468. __le16 tx_pkt_offset;
  469. __le16 tx_pkt_type;
  470. __le32 tx_control;
  471. u8 priority;
  472. u8 flags;
  473. u8 pkt_delay_2ms;
  474. u8 reserved1;
  475. } __packed;
  476. struct rxpd {
  477. u8 bss_type;
  478. u8 bss_num;
  479. __le16 rx_pkt_length;
  480. __le16 rx_pkt_offset;
  481. __le16 rx_pkt_type;
  482. __le16 seq_num;
  483. u8 priority;
  484. u8 rx_rate;
  485. s8 snr;
  486. s8 nf;
  487. /* For: Non-802.11 AC cards
  488. *
  489. * Ht Info [Bit 0] RxRate format: LG=0, HT=1
  490. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  491. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
  492. *
  493. * For: 802.11 AC cards
  494. * [Bit 1] [Bit 0] RxRate format: legacy rate = 00 HT = 01 VHT = 10
  495. * [Bit 3] [Bit 2] HT/VHT Bandwidth BW20 = 00 BW40 = 01
  496. * BW80 = 10 BW160 = 11
  497. * [Bit 4] HT/VHT Guard interval LGI = 0 SGI = 1
  498. * [Bit 5] STBC support Enabled = 1
  499. * [Bit 6] LDPC support Enabled = 1
  500. * [Bit 7] Reserved
  501. */
  502. u8 ht_info;
  503. u8 flags;
  504. } __packed;
  505. struct uap_txpd {
  506. u8 bss_type;
  507. u8 bss_num;
  508. __le16 tx_pkt_length;
  509. __le16 tx_pkt_offset;
  510. __le16 tx_pkt_type;
  511. __le32 tx_control;
  512. u8 priority;
  513. u8 flags;
  514. u8 pkt_delay_2ms;
  515. u8 reserved1;
  516. __le32 reserved2;
  517. };
  518. struct uap_rxpd {
  519. u8 bss_type;
  520. u8 bss_num;
  521. __le16 rx_pkt_length;
  522. __le16 rx_pkt_offset;
  523. __le16 rx_pkt_type;
  524. __le16 seq_num;
  525. u8 priority;
  526. u8 reserved1;
  527. };
  528. enum mwifiex_chan_scan_mode_bitmasks {
  529. MWIFIEX_PASSIVE_SCAN = BIT(0),
  530. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  531. };
  532. struct mwifiex_chan_scan_param_set {
  533. u8 radio_type;
  534. u8 chan_number;
  535. u8 chan_scan_mode_bitmap;
  536. __le16 min_scan_time;
  537. __le16 max_scan_time;
  538. } __packed;
  539. struct mwifiex_ie_types_chan_list_param_set {
  540. struct mwifiex_ie_types_header header;
  541. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  542. } __packed;
  543. struct chan_band_param_set {
  544. u8 radio_type;
  545. u8 chan_number;
  546. };
  547. struct mwifiex_ie_types_chan_band_list_param_set {
  548. struct mwifiex_ie_types_header header;
  549. struct chan_band_param_set chan_band_param[1];
  550. } __packed;
  551. struct mwifiex_ie_types_rates_param_set {
  552. struct mwifiex_ie_types_header header;
  553. u8 rates[1];
  554. } __packed;
  555. struct mwifiex_ie_types_ssid_param_set {
  556. struct mwifiex_ie_types_header header;
  557. u8 ssid[1];
  558. } __packed;
  559. struct mwifiex_ie_types_num_probes {
  560. struct mwifiex_ie_types_header header;
  561. __le16 num_probes;
  562. } __packed;
  563. struct mwifiex_ie_types_scan_chan_gap {
  564. struct mwifiex_ie_types_header header;
  565. /* time gap in TUs to be used between two consecutive channels scan */
  566. __le16 chan_gap;
  567. } __packed;
  568. struct mwifiex_ie_types_wildcard_ssid_params {
  569. struct mwifiex_ie_types_header header;
  570. u8 max_ssid_length;
  571. u8 ssid[1];
  572. } __packed;
  573. #define TSF_DATA_SIZE 8
  574. struct mwifiex_ie_types_tsf_timestamp {
  575. struct mwifiex_ie_types_header header;
  576. u8 tsf_data[1];
  577. } __packed;
  578. struct mwifiex_cf_param_set {
  579. u8 cfp_cnt;
  580. u8 cfp_period;
  581. __le16 cfp_max_duration;
  582. __le16 cfp_duration_remaining;
  583. } __packed;
  584. struct mwifiex_ibss_param_set {
  585. __le16 atim_window;
  586. } __packed;
  587. struct mwifiex_ie_types_ss_param_set {
  588. struct mwifiex_ie_types_header header;
  589. union {
  590. struct mwifiex_cf_param_set cf_param_set[1];
  591. struct mwifiex_ibss_param_set ibss_param_set[1];
  592. } cf_ibss;
  593. } __packed;
  594. struct mwifiex_fh_param_set {
  595. __le16 dwell_time;
  596. u8 hop_set;
  597. u8 hop_pattern;
  598. u8 hop_index;
  599. } __packed;
  600. struct mwifiex_ds_param_set {
  601. u8 current_chan;
  602. } __packed;
  603. struct mwifiex_ie_types_phy_param_set {
  604. struct mwifiex_ie_types_header header;
  605. union {
  606. struct mwifiex_fh_param_set fh_param_set[1];
  607. struct mwifiex_ds_param_set ds_param_set[1];
  608. } fh_ds;
  609. } __packed;
  610. struct mwifiex_ie_types_auth_type {
  611. struct mwifiex_ie_types_header header;
  612. __le16 auth_type;
  613. } __packed;
  614. struct mwifiex_ie_types_vendor_param_set {
  615. struct mwifiex_ie_types_header header;
  616. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  617. };
  618. #define MWIFIEX_TDLS_IDLE_TIMEOUT_IN_SEC 60
  619. struct mwifiex_ie_types_tdls_idle_timeout {
  620. struct mwifiex_ie_types_header header;
  621. __le16 value;
  622. } __packed;
  623. struct mwifiex_ie_types_rsn_param_set {
  624. struct mwifiex_ie_types_header header;
  625. u8 rsn_ie[1];
  626. } __packed;
  627. #define KEYPARAMSET_FIXED_LEN 6
  628. struct mwifiex_ie_type_key_param_set {
  629. __le16 type;
  630. __le16 length;
  631. __le16 key_type_id;
  632. __le16 key_info;
  633. __le16 key_len;
  634. u8 key[50];
  635. } __packed;
  636. #define IGTK_PN_LEN 8
  637. struct mwifiex_cmac_param {
  638. u8 ipn[IGTK_PN_LEN];
  639. u8 key[WLAN_KEY_LEN_AES_CMAC];
  640. } __packed;
  641. struct mwifiex_wep_param {
  642. __le16 key_len;
  643. u8 key[WLAN_KEY_LEN_WEP104];
  644. } __packed;
  645. struct mwifiex_tkip_param {
  646. u8 pn[WPA_PN_SIZE];
  647. __le16 key_len;
  648. u8 key[WLAN_KEY_LEN_TKIP];
  649. } __packed;
  650. struct mwifiex_aes_param {
  651. u8 pn[WPA_PN_SIZE];
  652. __le16 key_len;
  653. u8 key[WLAN_KEY_LEN_CCMP];
  654. } __packed;
  655. struct mwifiex_wapi_param {
  656. u8 pn[PN_LEN];
  657. __le16 key_len;
  658. u8 key[WLAN_KEY_LEN_SMS4];
  659. } __packed;
  660. struct mwifiex_cmac_aes_param {
  661. u8 ipn[IGTK_PN_LEN];
  662. __le16 key_len;
  663. u8 key[WLAN_KEY_LEN_AES_CMAC];
  664. } __packed;
  665. struct mwifiex_ie_type_key_param_set_v2 {
  666. __le16 type;
  667. __le16 len;
  668. u8 mac_addr[ETH_ALEN];
  669. u8 key_idx;
  670. u8 key_type;
  671. __le16 key_info;
  672. union {
  673. struct mwifiex_wep_param wep;
  674. struct mwifiex_tkip_param tkip;
  675. struct mwifiex_aes_param aes;
  676. struct mwifiex_wapi_param wapi;
  677. struct mwifiex_cmac_aes_param cmac_aes;
  678. } key_params;
  679. } __packed;
  680. struct host_cmd_ds_802_11_key_material_v2 {
  681. __le16 action;
  682. struct mwifiex_ie_type_key_param_set_v2 key_param_set;
  683. } __packed;
  684. struct host_cmd_ds_802_11_key_material {
  685. __le16 action;
  686. struct mwifiex_ie_type_key_param_set key_param_set;
  687. } __packed;
  688. struct host_cmd_ds_gen {
  689. __le16 command;
  690. __le16 size;
  691. __le16 seq_num;
  692. __le16 result;
  693. };
  694. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  695. enum sleep_resp_ctrl {
  696. RESP_NOT_NEEDED = 0,
  697. RESP_NEEDED,
  698. };
  699. struct mwifiex_ps_param {
  700. __le16 null_pkt_interval;
  701. __le16 multiple_dtims;
  702. __le16 bcn_miss_timeout;
  703. __le16 local_listen_interval;
  704. __le16 adhoc_wake_period;
  705. __le16 mode;
  706. __le16 delay_to_ps;
  707. };
  708. #define BITMAP_AUTO_DS 0x01
  709. #define BITMAP_STA_PS 0x10
  710. struct mwifiex_ie_types_auto_ds_param {
  711. struct mwifiex_ie_types_header header;
  712. __le16 deep_sleep_timeout;
  713. } __packed;
  714. struct mwifiex_ie_types_ps_param {
  715. struct mwifiex_ie_types_header header;
  716. struct mwifiex_ps_param param;
  717. } __packed;
  718. struct host_cmd_ds_802_11_ps_mode_enh {
  719. __le16 action;
  720. union {
  721. struct mwifiex_ps_param opt_ps;
  722. __le16 ps_bitmap;
  723. } params;
  724. } __packed;
  725. enum API_VER_ID {
  726. KEY_API_VER_ID = 1,
  727. FW_API_VER_ID = 2,
  728. };
  729. struct hw_spec_api_rev {
  730. struct mwifiex_ie_types_header header;
  731. __le16 api_id;
  732. u8 major_ver;
  733. u8 minor_ver;
  734. } __packed;
  735. struct host_cmd_ds_get_hw_spec {
  736. __le16 hw_if_version;
  737. __le16 version;
  738. __le16 reserved;
  739. __le16 num_of_mcast_adr;
  740. u8 permanent_addr[ETH_ALEN];
  741. __le16 region_code;
  742. __le16 number_of_antenna;
  743. __le32 fw_release_number;
  744. __le32 reserved_1;
  745. __le32 reserved_2;
  746. __le32 reserved_3;
  747. __le32 fw_cap_info;
  748. __le32 dot_11n_dev_cap;
  749. u8 dev_mcs_support;
  750. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  751. __le16 mgmt_buf_count; /* mgmt IE buffer count */
  752. __le32 reserved_5;
  753. __le32 reserved_6;
  754. __le32 dot_11ac_dev_cap;
  755. __le32 dot_11ac_mcs_support;
  756. u8 tlvs[0];
  757. } __packed;
  758. struct host_cmd_ds_802_11_rssi_info {
  759. __le16 action;
  760. __le16 ndata;
  761. __le16 nbcn;
  762. __le16 reserved[9];
  763. long long reserved_1;
  764. };
  765. struct host_cmd_ds_802_11_rssi_info_rsp {
  766. __le16 action;
  767. __le16 ndata;
  768. __le16 nbcn;
  769. __le16 data_rssi_last;
  770. __le16 data_nf_last;
  771. __le16 data_rssi_avg;
  772. __le16 data_nf_avg;
  773. __le16 bcn_rssi_last;
  774. __le16 bcn_nf_last;
  775. __le16 bcn_rssi_avg;
  776. __le16 bcn_nf_avg;
  777. long long tsf_bcn;
  778. };
  779. struct host_cmd_ds_802_11_mac_address {
  780. __le16 action;
  781. u8 mac_addr[ETH_ALEN];
  782. };
  783. struct host_cmd_ds_mac_control {
  784. __le16 action;
  785. __le16 reserved;
  786. };
  787. struct host_cmd_ds_mac_multicast_adr {
  788. __le16 action;
  789. __le16 num_of_adrs;
  790. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  791. } __packed;
  792. struct host_cmd_ds_802_11_deauthenticate {
  793. u8 mac_addr[ETH_ALEN];
  794. __le16 reason_code;
  795. } __packed;
  796. struct host_cmd_ds_802_11_associate {
  797. u8 peer_sta_addr[ETH_ALEN];
  798. __le16 cap_info_bitmap;
  799. __le16 listen_interval;
  800. __le16 beacon_period;
  801. u8 dtim_period;
  802. } __packed;
  803. struct ieee_types_assoc_rsp {
  804. __le16 cap_info_bitmap;
  805. __le16 status_code;
  806. __le16 a_id;
  807. u8 ie_buffer[1];
  808. } __packed;
  809. struct host_cmd_ds_802_11_associate_rsp {
  810. struct ieee_types_assoc_rsp assoc_rsp;
  811. } __packed;
  812. struct ieee_types_cf_param_set {
  813. u8 element_id;
  814. u8 len;
  815. u8 cfp_cnt;
  816. u8 cfp_period;
  817. __le16 cfp_max_duration;
  818. __le16 cfp_duration_remaining;
  819. } __packed;
  820. struct ieee_types_ibss_param_set {
  821. u8 element_id;
  822. u8 len;
  823. __le16 atim_window;
  824. } __packed;
  825. union ieee_types_ss_param_set {
  826. struct ieee_types_cf_param_set cf_param_set;
  827. struct ieee_types_ibss_param_set ibss_param_set;
  828. } __packed;
  829. struct ieee_types_fh_param_set {
  830. u8 element_id;
  831. u8 len;
  832. __le16 dwell_time;
  833. u8 hop_set;
  834. u8 hop_pattern;
  835. u8 hop_index;
  836. } __packed;
  837. struct ieee_types_ds_param_set {
  838. u8 element_id;
  839. u8 len;
  840. u8 current_chan;
  841. } __packed;
  842. union ieee_types_phy_param_set {
  843. struct ieee_types_fh_param_set fh_param_set;
  844. struct ieee_types_ds_param_set ds_param_set;
  845. } __packed;
  846. struct ieee_types_oper_mode_ntf {
  847. u8 element_id;
  848. u8 len;
  849. u8 oper_mode;
  850. } __packed;
  851. struct host_cmd_ds_802_11_ad_hoc_start {
  852. u8 ssid[IEEE80211_MAX_SSID_LEN];
  853. u8 bss_mode;
  854. __le16 beacon_period;
  855. u8 dtim_period;
  856. union ieee_types_ss_param_set ss_param_set;
  857. union ieee_types_phy_param_set phy_param_set;
  858. u16 reserved1;
  859. __le16 cap_info_bitmap;
  860. u8 data_rate[HOSTCMD_SUPPORTED_RATES];
  861. } __packed;
  862. struct host_cmd_ds_802_11_ad_hoc_result {
  863. u8 pad[3];
  864. u8 bssid[ETH_ALEN];
  865. } __packed;
  866. struct adhoc_bss_desc {
  867. u8 bssid[ETH_ALEN];
  868. u8 ssid[IEEE80211_MAX_SSID_LEN];
  869. u8 bss_mode;
  870. __le16 beacon_period;
  871. u8 dtim_period;
  872. u8 time_stamp[8];
  873. u8 local_time[8];
  874. union ieee_types_phy_param_set phy_param_set;
  875. union ieee_types_ss_param_set ss_param_set;
  876. __le16 cap_info_bitmap;
  877. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  878. /*
  879. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  880. * It is used in the Adhoc join command and will cause a
  881. * binary layout mismatch with the firmware
  882. */
  883. } __packed;
  884. struct host_cmd_ds_802_11_ad_hoc_join {
  885. struct adhoc_bss_desc bss_descriptor;
  886. u16 reserved1;
  887. u16 reserved2;
  888. } __packed;
  889. struct host_cmd_ds_802_11_get_log {
  890. __le32 mcast_tx_frame;
  891. __le32 failed;
  892. __le32 retry;
  893. __le32 multi_retry;
  894. __le32 frame_dup;
  895. __le32 rts_success;
  896. __le32 rts_failure;
  897. __le32 ack_failure;
  898. __le32 rx_frag;
  899. __le32 mcast_rx_frame;
  900. __le32 fcs_error;
  901. __le32 tx_frame;
  902. __le32 reserved;
  903. __le32 wep_icv_err_cnt[4];
  904. };
  905. /* Enumeration for rate format */
  906. enum _mwifiex_rate_format {
  907. MWIFIEX_RATE_FORMAT_LG = 0,
  908. MWIFIEX_RATE_FORMAT_HT,
  909. MWIFIEX_RATE_FORMAT_VHT,
  910. MWIFIEX_RATE_FORMAT_AUTO = 0xFF,
  911. };
  912. struct host_cmd_ds_tx_rate_query {
  913. u8 tx_rate;
  914. /* Tx Rate Info: For 802.11 AC cards
  915. *
  916. * [Bit 0-1] tx rate formate: LG = 0, HT = 1, VHT = 2
  917. * [Bit 2-3] HT/VHT Bandwidth: BW20 = 0, BW40 = 1, BW80 = 2, BW160 = 3
  918. * [Bit 4] HT/VHT Guard Interval: LGI = 0, SGI = 1
  919. *
  920. * For non-802.11 AC cards
  921. * Ht Info [Bit 0] RxRate format: LG=0, HT=1
  922. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  923. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1
  924. */
  925. u8 ht_info;
  926. } __packed;
  927. enum Host_Sleep_Action {
  928. HS_CONFIGURE = 0x0001,
  929. HS_ACTIVATE = 0x0002,
  930. };
  931. struct mwifiex_hs_config_param {
  932. __le32 conditions;
  933. u8 gpio;
  934. u8 gap;
  935. } __packed;
  936. struct hs_activate_param {
  937. __le16 resp_ctrl;
  938. } __packed;
  939. struct host_cmd_ds_802_11_hs_cfg_enh {
  940. __le16 action;
  941. union {
  942. struct mwifiex_hs_config_param hs_config;
  943. struct hs_activate_param hs_activate;
  944. } params;
  945. } __packed;
  946. enum SNMP_MIB_INDEX {
  947. OP_RATE_SET_I = 1,
  948. DTIM_PERIOD_I = 3,
  949. RTS_THRESH_I = 5,
  950. SHORT_RETRY_LIM_I = 6,
  951. LONG_RETRY_LIM_I = 7,
  952. FRAG_THRESH_I = 8,
  953. DOT11D_I = 9,
  954. DOT11H_I = 10,
  955. };
  956. #define MAX_SNMP_BUF_SIZE 128
  957. struct host_cmd_ds_802_11_snmp_mib {
  958. __le16 query_type;
  959. __le16 oid;
  960. __le16 buf_size;
  961. u8 value[1];
  962. } __packed;
  963. struct mwifiex_rate_scope {
  964. __le16 type;
  965. __le16 length;
  966. __le16 hr_dsss_rate_bitmap;
  967. __le16 ofdm_rate_bitmap;
  968. __le16 ht_mcs_rate_bitmap[8];
  969. __le16 vht_mcs_rate_bitmap[8];
  970. } __packed;
  971. struct mwifiex_rate_drop_pattern {
  972. __le16 type;
  973. __le16 length;
  974. __le32 rate_drop_mode;
  975. } __packed;
  976. struct host_cmd_ds_tx_rate_cfg {
  977. __le16 action;
  978. __le16 cfg_index;
  979. } __packed;
  980. struct mwifiex_power_group {
  981. u8 modulation_class;
  982. u8 first_rate_code;
  983. u8 last_rate_code;
  984. s8 power_step;
  985. s8 power_min;
  986. s8 power_max;
  987. u8 ht_bandwidth;
  988. u8 reserved;
  989. } __packed;
  990. struct mwifiex_types_power_group {
  991. __le16 type;
  992. __le16 length;
  993. } __packed;
  994. struct host_cmd_ds_txpwr_cfg {
  995. __le16 action;
  996. __le16 cfg_index;
  997. __le32 mode;
  998. } __packed;
  999. struct host_cmd_ds_rf_tx_pwr {
  1000. __le16 action;
  1001. __le16 cur_level;
  1002. u8 max_power;
  1003. u8 min_power;
  1004. } __packed;
  1005. struct host_cmd_ds_rf_ant_mimo {
  1006. __le16 action_tx;
  1007. __le16 tx_ant_mode;
  1008. __le16 action_rx;
  1009. __le16 rx_ant_mode;
  1010. };
  1011. struct host_cmd_ds_rf_ant_siso {
  1012. __le16 action;
  1013. __le16 ant_mode;
  1014. };
  1015. struct host_cmd_ds_tdls_oper {
  1016. __le16 tdls_action;
  1017. __le16 reason;
  1018. u8 peer_mac[ETH_ALEN];
  1019. } __packed;
  1020. struct mwifiex_fixed_bcn_param {
  1021. __le64 timestamp;
  1022. __le16 beacon_period;
  1023. __le16 cap_info_bitmap;
  1024. } __packed;
  1025. struct mwifiex_event_scan_result {
  1026. __le16 event_id;
  1027. u8 bss_index;
  1028. u8 bss_type;
  1029. u8 more_event;
  1030. u8 reserved[3];
  1031. __le16 buf_size;
  1032. u8 num_of_set;
  1033. } __packed;
  1034. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  1035. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  1036. struct mwifiex_scan_cmd_config {
  1037. /*
  1038. * BSS mode to be sent in the firmware command
  1039. */
  1040. u8 bss_mode;
  1041. /* Specific BSSID used to filter scan results in the firmware */
  1042. u8 specific_bssid[ETH_ALEN];
  1043. /* Length of TLVs sent in command starting at tlvBuffer */
  1044. u32 tlv_buf_len;
  1045. /*
  1046. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  1047. *
  1048. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  1049. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  1050. */
  1051. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  1052. here */
  1053. } __packed;
  1054. struct mwifiex_user_scan_chan {
  1055. u8 chan_number;
  1056. u8 radio_type;
  1057. u8 scan_type;
  1058. u8 reserved;
  1059. u32 scan_time;
  1060. } __packed;
  1061. struct mwifiex_user_scan_cfg {
  1062. /*
  1063. * BSS mode to be sent in the firmware command
  1064. */
  1065. u8 bss_mode;
  1066. /* Configure the number of probe requests for active chan scans */
  1067. u8 num_probes;
  1068. u8 reserved;
  1069. /* BSSID filter sent in the firmware command to limit the results */
  1070. u8 specific_bssid[ETH_ALEN];
  1071. /* SSID filter list used in the firmware to limit the scan results */
  1072. struct cfg80211_ssid *ssid_list;
  1073. u8 num_ssids;
  1074. /* Variable number (fixed maximum) of channels to scan up */
  1075. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  1076. u16 scan_chan_gap;
  1077. } __packed;
  1078. struct ie_body {
  1079. u8 grp_key_oui[4];
  1080. u8 ptk_cnt[2];
  1081. u8 ptk_body[4];
  1082. } __packed;
  1083. struct host_cmd_ds_802_11_scan {
  1084. u8 bss_mode;
  1085. u8 bssid[ETH_ALEN];
  1086. u8 tlv_buffer[1];
  1087. } __packed;
  1088. struct host_cmd_ds_802_11_scan_rsp {
  1089. __le16 bss_descript_size;
  1090. u8 number_of_sets;
  1091. u8 bss_desc_and_tlv_buffer[1];
  1092. } __packed;
  1093. struct host_cmd_ds_802_11_scan_ext {
  1094. u32 reserved;
  1095. u8 tlv_buffer[1];
  1096. } __packed;
  1097. struct mwifiex_ie_types_bss_scan_rsp {
  1098. struct mwifiex_ie_types_header header;
  1099. u8 bssid[ETH_ALEN];
  1100. u8 frame_body[1];
  1101. } __packed;
  1102. struct mwifiex_ie_types_bss_scan_info {
  1103. struct mwifiex_ie_types_header header;
  1104. __le16 rssi;
  1105. __le16 anpi;
  1106. u8 cca_busy_fraction;
  1107. u8 radio_type;
  1108. u8 channel;
  1109. u8 reserved;
  1110. __le64 tsf;
  1111. } __packed;
  1112. struct host_cmd_ds_802_11_bg_scan_query {
  1113. u8 flush;
  1114. } __packed;
  1115. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  1116. __le32 report_condition;
  1117. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1118. } __packed;
  1119. struct mwifiex_ietypes_domain_param_set {
  1120. struct mwifiex_ie_types_header header;
  1121. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  1122. struct ieee80211_country_ie_triplet triplet[1];
  1123. } __packed;
  1124. struct host_cmd_ds_802_11d_domain_info {
  1125. __le16 action;
  1126. struct mwifiex_ietypes_domain_param_set domain;
  1127. } __packed;
  1128. struct host_cmd_ds_802_11d_domain_info_rsp {
  1129. __le16 action;
  1130. struct mwifiex_ietypes_domain_param_set domain;
  1131. } __packed;
  1132. struct host_cmd_ds_11n_addba_req {
  1133. u8 add_req_result;
  1134. u8 peer_mac_addr[ETH_ALEN];
  1135. u8 dialog_token;
  1136. __le16 block_ack_param_set;
  1137. __le16 block_ack_tmo;
  1138. __le16 ssn;
  1139. } __packed;
  1140. struct host_cmd_ds_11n_addba_rsp {
  1141. u8 add_rsp_result;
  1142. u8 peer_mac_addr[ETH_ALEN];
  1143. u8 dialog_token;
  1144. __le16 status_code;
  1145. __le16 block_ack_param_set;
  1146. __le16 block_ack_tmo;
  1147. __le16 ssn;
  1148. } __packed;
  1149. struct host_cmd_ds_11n_delba {
  1150. u8 del_result;
  1151. u8 peer_mac_addr[ETH_ALEN];
  1152. __le16 del_ba_param_set;
  1153. __le16 reason_code;
  1154. u8 reserved;
  1155. } __packed;
  1156. struct host_cmd_ds_11n_batimeout {
  1157. u8 tid;
  1158. u8 peer_mac_addr[ETH_ALEN];
  1159. u8 origninator;
  1160. } __packed;
  1161. struct host_cmd_ds_11n_cfg {
  1162. __le16 action;
  1163. __le16 ht_tx_cap;
  1164. __le16 ht_tx_info;
  1165. __le16 misc_config; /* Needed for 802.11AC cards only */
  1166. } __packed;
  1167. struct host_cmd_ds_txbuf_cfg {
  1168. __le16 action;
  1169. __le16 buff_size;
  1170. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  1171. __le16 reserved3;
  1172. } __packed;
  1173. struct host_cmd_ds_amsdu_aggr_ctrl {
  1174. __le16 action;
  1175. __le16 enable;
  1176. __le16 curr_buf_size;
  1177. } __packed;
  1178. struct host_cmd_ds_sta_deauth {
  1179. u8 mac[ETH_ALEN];
  1180. __le16 reason;
  1181. } __packed;
  1182. struct mwifiex_ie_types_pwr_capability {
  1183. struct mwifiex_ie_types_header header;
  1184. s8 min_pwr;
  1185. s8 max_pwr;
  1186. };
  1187. struct mwifiex_ie_types_local_pwr_constraint {
  1188. struct mwifiex_ie_types_header header;
  1189. u8 chan;
  1190. u8 constraint;
  1191. };
  1192. struct mwifiex_ie_types_wmm_param_set {
  1193. struct mwifiex_ie_types_header header;
  1194. u8 wmm_ie[1];
  1195. };
  1196. struct mwifiex_ie_types_wmm_queue_status {
  1197. struct mwifiex_ie_types_header header;
  1198. u8 queue_index;
  1199. u8 disabled;
  1200. __le16 medium_time;
  1201. u8 flow_required;
  1202. u8 flow_created;
  1203. u32 reserved;
  1204. };
  1205. struct ieee_types_vendor_header {
  1206. u8 element_id;
  1207. u8 len;
  1208. u8 oui[4]; /* 0~2: oui, 3: oui_type */
  1209. u8 oui_subtype;
  1210. u8 version;
  1211. } __packed;
  1212. struct ieee_types_wmm_parameter {
  1213. /*
  1214. * WMM Parameter IE - Vendor Specific Header:
  1215. * element_id [221/0xdd]
  1216. * Len [24]
  1217. * Oui [00:50:f2]
  1218. * OuiType [2]
  1219. * OuiSubType [1]
  1220. * Version [1]
  1221. */
  1222. struct ieee_types_vendor_header vend_hdr;
  1223. u8 qos_info_bitmap;
  1224. u8 reserved;
  1225. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
  1226. } __packed;
  1227. struct ieee_types_wmm_info {
  1228. /*
  1229. * WMM Info IE - Vendor Specific Header:
  1230. * element_id [221/0xdd]
  1231. * Len [7]
  1232. * Oui [00:50:f2]
  1233. * OuiType [2]
  1234. * OuiSubType [0]
  1235. * Version [1]
  1236. */
  1237. struct ieee_types_vendor_header vend_hdr;
  1238. u8 qos_info_bitmap;
  1239. } __packed;
  1240. struct host_cmd_ds_wmm_get_status {
  1241. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  1242. IEEE80211_NUM_ACS];
  1243. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  1244. } __packed;
  1245. struct mwifiex_wmm_ac_status {
  1246. u8 disabled;
  1247. u8 flow_required;
  1248. u8 flow_created;
  1249. };
  1250. struct mwifiex_ie_types_htcap {
  1251. struct mwifiex_ie_types_header header;
  1252. struct ieee80211_ht_cap ht_cap;
  1253. } __packed;
  1254. struct mwifiex_ie_types_vhtcap {
  1255. struct mwifiex_ie_types_header header;
  1256. struct ieee80211_vht_cap vht_cap;
  1257. } __packed;
  1258. struct mwifiex_ie_types_aid {
  1259. struct mwifiex_ie_types_header header;
  1260. __le16 aid;
  1261. } __packed;
  1262. struct mwifiex_ie_types_oper_mode_ntf {
  1263. struct mwifiex_ie_types_header header;
  1264. u8 oper_mode;
  1265. } __packed;
  1266. /* VHT Operations IE */
  1267. struct mwifiex_ie_types_vht_oper {
  1268. struct mwifiex_ie_types_header header;
  1269. u8 chan_width;
  1270. u8 chan_center_freq_1;
  1271. u8 chan_center_freq_2;
  1272. /* Basic MCS set map, each 2 bits stands for a NSS */
  1273. __le16 basic_mcs_map;
  1274. } __packed;
  1275. struct mwifiex_ie_types_wmmcap {
  1276. struct mwifiex_ie_types_header header;
  1277. struct mwifiex_types_wmm_info wmm_info;
  1278. } __packed;
  1279. struct mwifiex_ie_types_htinfo {
  1280. struct mwifiex_ie_types_header header;
  1281. struct ieee80211_ht_operation ht_oper;
  1282. } __packed;
  1283. struct mwifiex_ie_types_2040bssco {
  1284. struct mwifiex_ie_types_header header;
  1285. u8 bss_co_2040;
  1286. } __packed;
  1287. struct mwifiex_ie_types_extcap {
  1288. struct mwifiex_ie_types_header header;
  1289. u8 ext_capab[0];
  1290. } __packed;
  1291. struct mwifiex_ie_types_qos_info {
  1292. struct mwifiex_ie_types_header header;
  1293. u8 qos_info;
  1294. } __packed;
  1295. struct host_cmd_ds_mac_reg_access {
  1296. __le16 action;
  1297. __le16 offset;
  1298. __le32 value;
  1299. } __packed;
  1300. struct host_cmd_ds_bbp_reg_access {
  1301. __le16 action;
  1302. __le16 offset;
  1303. u8 value;
  1304. u8 reserved[3];
  1305. } __packed;
  1306. struct host_cmd_ds_rf_reg_access {
  1307. __le16 action;
  1308. __le16 offset;
  1309. u8 value;
  1310. u8 reserved[3];
  1311. } __packed;
  1312. struct host_cmd_ds_pmic_reg_access {
  1313. __le16 action;
  1314. __le16 offset;
  1315. u8 value;
  1316. u8 reserved[3];
  1317. } __packed;
  1318. struct host_cmd_ds_802_11_eeprom_access {
  1319. __le16 action;
  1320. __le16 offset;
  1321. __le16 byte_count;
  1322. u8 value;
  1323. } __packed;
  1324. struct mwifiex_assoc_event {
  1325. u8 sta_addr[ETH_ALEN];
  1326. __le16 type;
  1327. __le16 len;
  1328. __le16 frame_control;
  1329. __le16 cap_info;
  1330. __le16 listen_interval;
  1331. u8 data[0];
  1332. } __packed;
  1333. struct host_cmd_ds_sys_config {
  1334. __le16 action;
  1335. u8 tlv[0];
  1336. };
  1337. struct host_cmd_11ac_vht_cfg {
  1338. __le16 action;
  1339. u8 band_config;
  1340. u8 misc_config;
  1341. __le32 cap_info;
  1342. __le32 mcs_tx_set;
  1343. __le32 mcs_rx_set;
  1344. } __packed;
  1345. struct host_cmd_tlv_akmp {
  1346. struct mwifiex_ie_types_header header;
  1347. __le16 key_mgmt;
  1348. __le16 key_mgmt_operation;
  1349. } __packed;
  1350. struct host_cmd_tlv_pwk_cipher {
  1351. struct mwifiex_ie_types_header header;
  1352. __le16 proto;
  1353. u8 cipher;
  1354. u8 reserved;
  1355. } __packed;
  1356. struct host_cmd_tlv_gwk_cipher {
  1357. struct mwifiex_ie_types_header header;
  1358. u8 cipher;
  1359. u8 reserved;
  1360. } __packed;
  1361. struct host_cmd_tlv_passphrase {
  1362. struct mwifiex_ie_types_header header;
  1363. u8 passphrase[0];
  1364. } __packed;
  1365. struct host_cmd_tlv_wep_key {
  1366. struct mwifiex_ie_types_header header;
  1367. u8 key_index;
  1368. u8 is_default;
  1369. u8 key[1];
  1370. };
  1371. struct host_cmd_tlv_auth_type {
  1372. struct mwifiex_ie_types_header header;
  1373. u8 auth_type;
  1374. } __packed;
  1375. struct host_cmd_tlv_encrypt_protocol {
  1376. struct mwifiex_ie_types_header header;
  1377. __le16 proto;
  1378. } __packed;
  1379. struct host_cmd_tlv_ssid {
  1380. struct mwifiex_ie_types_header header;
  1381. u8 ssid[0];
  1382. } __packed;
  1383. struct host_cmd_tlv_rates {
  1384. struct mwifiex_ie_types_header header;
  1385. u8 rates[0];
  1386. } __packed;
  1387. struct mwifiex_ie_types_bssid_list {
  1388. struct mwifiex_ie_types_header header;
  1389. u8 bssid[ETH_ALEN];
  1390. } __packed;
  1391. struct host_cmd_tlv_bcast_ssid {
  1392. struct mwifiex_ie_types_header header;
  1393. u8 bcast_ctl;
  1394. } __packed;
  1395. struct host_cmd_tlv_beacon_period {
  1396. struct mwifiex_ie_types_header header;
  1397. __le16 period;
  1398. } __packed;
  1399. struct host_cmd_tlv_dtim_period {
  1400. struct mwifiex_ie_types_header header;
  1401. u8 period;
  1402. } __packed;
  1403. struct host_cmd_tlv_frag_threshold {
  1404. struct mwifiex_ie_types_header header;
  1405. __le16 frag_thr;
  1406. } __packed;
  1407. struct host_cmd_tlv_rts_threshold {
  1408. struct mwifiex_ie_types_header header;
  1409. __le16 rts_thr;
  1410. } __packed;
  1411. struct host_cmd_tlv_retry_limit {
  1412. struct mwifiex_ie_types_header header;
  1413. u8 limit;
  1414. } __packed;
  1415. struct host_cmd_tlv_mac_addr {
  1416. struct mwifiex_ie_types_header header;
  1417. u8 mac_addr[ETH_ALEN];
  1418. } __packed;
  1419. struct host_cmd_tlv_channel_band {
  1420. struct mwifiex_ie_types_header header;
  1421. u8 band_config;
  1422. u8 channel;
  1423. } __packed;
  1424. struct host_cmd_tlv_ageout_timer {
  1425. struct mwifiex_ie_types_header header;
  1426. __le32 sta_ao_timer;
  1427. } __packed;
  1428. struct host_cmd_ds_version_ext {
  1429. u8 version_str_sel;
  1430. char version_str[128];
  1431. } __packed;
  1432. struct host_cmd_ds_mgmt_frame_reg {
  1433. __le16 action;
  1434. __le32 mask;
  1435. } __packed;
  1436. struct host_cmd_ds_p2p_mode_cfg {
  1437. __le16 action;
  1438. __le16 mode;
  1439. } __packed;
  1440. struct host_cmd_ds_remain_on_chan {
  1441. __le16 action;
  1442. u8 status;
  1443. u8 reserved;
  1444. u8 band_cfg;
  1445. u8 channel;
  1446. __le32 duration;
  1447. } __packed;
  1448. struct host_cmd_ds_802_11_ibss_status {
  1449. __le16 action;
  1450. __le16 enable;
  1451. u8 bssid[ETH_ALEN];
  1452. __le16 beacon_interval;
  1453. __le16 atim_window;
  1454. __le16 use_g_rate_protect;
  1455. } __packed;
  1456. struct mwifiex_fw_mef_entry {
  1457. u8 mode;
  1458. u8 action;
  1459. __le16 exprsize;
  1460. u8 expr[0];
  1461. } __packed;
  1462. struct host_cmd_ds_mef_cfg {
  1463. __le32 criteria;
  1464. __le16 num_entries;
  1465. struct mwifiex_fw_mef_entry mef_entry[0];
  1466. } __packed;
  1467. #define CONNECTION_TYPE_INFRA 0
  1468. #define CONNECTION_TYPE_ADHOC 1
  1469. #define CONNECTION_TYPE_AP 2
  1470. struct host_cmd_ds_set_bss_mode {
  1471. u8 con_type;
  1472. } __packed;
  1473. struct host_cmd_ds_pcie_details {
  1474. /* TX buffer descriptor ring address */
  1475. u32 txbd_addr_lo;
  1476. u32 txbd_addr_hi;
  1477. /* TX buffer descriptor ring count */
  1478. u32 txbd_count;
  1479. /* RX buffer descriptor ring address */
  1480. u32 rxbd_addr_lo;
  1481. u32 rxbd_addr_hi;
  1482. /* RX buffer descriptor ring count */
  1483. u32 rxbd_count;
  1484. /* Event buffer descriptor ring address */
  1485. u32 evtbd_addr_lo;
  1486. u32 evtbd_addr_hi;
  1487. /* Event buffer descriptor ring count */
  1488. u32 evtbd_count;
  1489. /* Sleep cookie buffer physical address */
  1490. u32 sleep_cookie_addr_lo;
  1491. u32 sleep_cookie_addr_hi;
  1492. } __packed;
  1493. struct mwifiex_ie_types_rssi_threshold {
  1494. struct mwifiex_ie_types_header header;
  1495. u8 abs_value;
  1496. u8 evt_freq;
  1497. } __packed;
  1498. struct host_cmd_ds_802_11_subsc_evt {
  1499. __le16 action;
  1500. __le16 events;
  1501. } __packed;
  1502. struct mwifiex_tdls_generic_event {
  1503. __le16 type;
  1504. u8 peer_mac[ETH_ALEN];
  1505. union {
  1506. __le16 reason_code;
  1507. __le16 reserved;
  1508. } u;
  1509. } __packed;
  1510. struct mwifiex_ie {
  1511. __le16 ie_index;
  1512. __le16 mgmt_subtype_mask;
  1513. __le16 ie_length;
  1514. u8 ie_buffer[IEEE_MAX_IE_SIZE];
  1515. } __packed;
  1516. #define MAX_MGMT_IE_INDEX 16
  1517. struct mwifiex_ie_list {
  1518. __le16 type;
  1519. __le16 len;
  1520. struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
  1521. } __packed;
  1522. struct coalesce_filt_field_param {
  1523. u8 operation;
  1524. u8 operand_len;
  1525. __le16 offset;
  1526. u8 operand_byte_stream[4];
  1527. };
  1528. struct coalesce_receive_filt_rule {
  1529. struct mwifiex_ie_types_header header;
  1530. u8 num_of_fields;
  1531. u8 pkt_type;
  1532. __le16 max_coalescing_delay;
  1533. struct coalesce_filt_field_param params[0];
  1534. } __packed;
  1535. struct host_cmd_ds_coalesce_cfg {
  1536. __le16 action;
  1537. __le16 num_of_rules;
  1538. struct coalesce_receive_filt_rule rule[0];
  1539. } __packed;
  1540. struct host_cmd_ds_command {
  1541. __le16 command;
  1542. __le16 size;
  1543. __le16 seq_num;
  1544. __le16 result;
  1545. union {
  1546. struct host_cmd_ds_get_hw_spec hw_spec;
  1547. struct host_cmd_ds_mac_control mac_ctrl;
  1548. struct host_cmd_ds_802_11_mac_address mac_addr;
  1549. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1550. struct host_cmd_ds_802_11_get_log get_log;
  1551. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1552. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1553. struct host_cmd_ds_802_11_snmp_mib smib;
  1554. struct host_cmd_ds_tx_rate_query tx_rate;
  1555. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1556. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1557. struct host_cmd_ds_rf_tx_pwr txp;
  1558. struct host_cmd_ds_rf_ant_mimo ant_mimo;
  1559. struct host_cmd_ds_rf_ant_siso ant_siso;
  1560. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1561. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1562. struct host_cmd_ds_802_11_scan scan;
  1563. struct host_cmd_ds_802_11_scan_ext ext_scan;
  1564. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1565. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1566. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1567. struct host_cmd_ds_802_11_associate associate;
  1568. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1569. struct host_cmd_ds_802_11_deauthenticate deauth;
  1570. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1571. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1572. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1573. struct host_cmd_ds_802_11d_domain_info domain_info;
  1574. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1575. struct host_cmd_ds_11n_addba_req add_ba_req;
  1576. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1577. struct host_cmd_ds_11n_delba del_ba;
  1578. struct host_cmd_ds_txbuf_cfg tx_buf;
  1579. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1580. struct host_cmd_ds_11n_cfg htcfg;
  1581. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1582. struct host_cmd_ds_802_11_key_material key_material;
  1583. struct host_cmd_ds_802_11_key_material_v2 key_material_v2;
  1584. struct host_cmd_ds_version_ext verext;
  1585. struct host_cmd_ds_mgmt_frame_reg reg_mask;
  1586. struct host_cmd_ds_remain_on_chan roc_cfg;
  1587. struct host_cmd_ds_p2p_mode_cfg mode_cfg;
  1588. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1589. struct host_cmd_ds_mef_cfg mef_cfg;
  1590. struct host_cmd_ds_mac_reg_access mac_reg;
  1591. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1592. struct host_cmd_ds_rf_reg_access rf_reg;
  1593. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1594. struct host_cmd_ds_set_bss_mode bss_mode;
  1595. struct host_cmd_ds_pcie_details pcie_host_spec;
  1596. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1597. struct host_cmd_ds_802_11_subsc_evt subsc_evt;
  1598. struct host_cmd_ds_sys_config uap_sys_config;
  1599. struct host_cmd_ds_sta_deauth sta_deauth;
  1600. struct host_cmd_11ac_vht_cfg vht_cfg;
  1601. struct host_cmd_ds_coalesce_cfg coalesce_cfg;
  1602. struct host_cmd_ds_tdls_oper tdls_oper;
  1603. } params;
  1604. } __packed;
  1605. struct mwifiex_opt_sleep_confirm {
  1606. __le16 command;
  1607. __le16 size;
  1608. __le16 seq_num;
  1609. __le16 result;
  1610. __le16 action;
  1611. __le16 resp_ctrl;
  1612. } __packed;
  1613. #endif /* !_MWIFIEX_FW_H_ */