fw.h 60 KB

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