fw.h 52 KB

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