fw.h 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. /*
  2. * Marvell Wireless LAN device driver: Firmware specific macros & structures
  3. *
  4. * Copyright (C) 2011, 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. u16 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. #define FW_MULTI_BANDS_SUPPORT (BIT(8) | BIT(9) | BIT(10) | BIT(11))
  46. #define IS_SUPPORT_MULTI_BANDS(adapter) \
  47. (adapter->fw_cap_info & FW_MULTI_BANDS_SUPPORT)
  48. #define GET_FW_DEFAULT_BANDS(adapter) \
  49. ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS)
  50. #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  51. #define KEY_INFO_ENABLED 0x01
  52. enum KEY_TYPE_ID {
  53. KEY_TYPE_ID_WEP = 0,
  54. KEY_TYPE_ID_TKIP,
  55. KEY_TYPE_ID_AES,
  56. KEY_TYPE_ID_WAPI,
  57. KEY_TYPE_ID_AES_CMAC,
  58. };
  59. #define KEY_MCAST BIT(0)
  60. #define KEY_UNICAST BIT(1)
  61. #define KEY_ENABLED BIT(2)
  62. #define KEY_IGTK BIT(10)
  63. #define WAPI_KEY_LEN 50
  64. #define MAX_POLL_TRIES 100
  65. #define MAX_MULTI_INTERFACE_POLL_TRIES 1000
  66. #define MAX_FIRMWARE_POLL_TRIES 100
  67. #define FIRMWARE_READY_SDIO 0xfedc
  68. #define FIRMWARE_READY_PCIE 0xfedcba00
  69. enum mwifiex_usb_ep {
  70. MWIFIEX_USB_EP_CMD_EVENT = 1,
  71. MWIFIEX_USB_EP_DATA = 2,
  72. };
  73. enum MWIFIEX_802_11_PRIVACY_FILTER {
  74. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  75. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  76. };
  77. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  78. #define UAP_BSS_PARAMS_I 0
  79. #define UAP_CUSTOM_IE_I 1
  80. #define MWIFIEX_AUTO_IDX_MASK 0xffff
  81. #define MWIFIEX_DELETE_MASK 0x0000
  82. #define MGMT_MASK_ASSOC_REQ 0x01
  83. #define MGMT_MASK_REASSOC_REQ 0x04
  84. #define MGMT_MASK_ASSOC_RESP 0x02
  85. #define MGMT_MASK_REASSOC_RESP 0x08
  86. #define MGMT_MASK_PROBE_REQ 0x10
  87. #define MGMT_MASK_PROBE_RESP 0x20
  88. #define MGMT_MASK_BEACON 0x100
  89. #define TLV_TYPE_UAP_SSID 0x0000
  90. #define TLV_TYPE_UAP_RATES 0x0001
  91. #define PROPRIETARY_TLV_BASE_ID 0x0100
  92. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  93. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  94. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  95. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  96. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  97. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  98. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  99. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  100. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  101. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  102. #define TLV_TYPE_STA_MAC_ADDR (PROPRIETARY_TLV_BASE_ID + 32)
  103. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  104. #define TLV_TYPE_UAP_BEACON_PERIOD (PROPRIETARY_TLV_BASE_ID + 44)
  105. #define TLV_TYPE_UAP_DTIM_PERIOD (PROPRIETARY_TLV_BASE_ID + 45)
  106. #define TLV_TYPE_UAP_BCAST_SSID (PROPRIETARY_TLV_BASE_ID + 48)
  107. #define TLV_TYPE_UAP_RTS_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 51)
  108. #define TLV_TYPE_UAP_WEP_KEY (PROPRIETARY_TLV_BASE_ID + 59)
  109. #define TLV_TYPE_UAP_WPA_PASSPHRASE (PROPRIETARY_TLV_BASE_ID + 60)
  110. #define TLV_TYPE_UAP_ENCRY_PROTOCOL (PROPRIETARY_TLV_BASE_ID + 64)
  111. #define TLV_TYPE_UAP_AKMP (PROPRIETARY_TLV_BASE_ID + 65)
  112. #define TLV_TYPE_UAP_FRAG_THRESHOLD (PROPRIETARY_TLV_BASE_ID + 70)
  113. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  114. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  115. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  116. #define TLV_TYPE_UAP_RETRY_LIMIT (PROPRIETARY_TLV_BASE_ID + 93)
  117. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  118. #define TLV_TYPE_UAP_MGMT_FRAME (PROPRIETARY_TLV_BASE_ID + 104)
  119. #define TLV_TYPE_MGMT_IE (PROPRIETARY_TLV_BASE_ID + 105)
  120. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  121. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  122. #define TLV_TYPE_PWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 145)
  123. #define TLV_TYPE_GWK_CIPHER (PROPRIETARY_TLV_BASE_ID + 146)
  124. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  125. #define SSN_MASK 0xfff0
  126. #define BA_RESULT_SUCCESS 0x0
  127. #define BA_RESULT_TIMEOUT 0x2
  128. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  129. #define BA_STREAM_NOT_ALLOWED 0xff
  130. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  131. priv->adapter->config_bands & BAND_AN) && \
  132. priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
  133. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  134. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  135. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  136. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  137. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  138. #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
  139. (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
  140. IEEE80211_HT_CAP_SM_PS)
  141. #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR
  142. /* dev_cap bitmap
  143. * BIT
  144. * 0-16 reserved
  145. * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
  146. * 18-22 reserved
  147. * 23 IEEE80211_HT_CAP_SGI_20
  148. * 24 IEEE80211_HT_CAP_SGI_40
  149. * 25 IEEE80211_HT_CAP_TX_STBC
  150. * 26 IEEE80211_HT_CAP_RX_STBC
  151. * 27-28 reserved
  152. * 29 IEEE80211_HT_CAP_GRN_FLD
  153. * 30-31 reserved
  154. */
  155. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  156. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  157. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  158. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  159. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  160. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  161. /* httxcfg bitmap
  162. * 0 reserved
  163. * 1 20/40 Mhz enable(1)/disable(0)
  164. * 2-3 reserved
  165. * 4 green field enable(1)/disable(0)
  166. * 5 short GI in 20 Mhz enable(1)/disable(0)
  167. * 6 short GI in 40 Mhz enable(1)/disable(0)
  168. * 7-15 reserved
  169. */
  170. #define MWIFIEX_FW_DEF_HTTXCFG (BIT(1) | BIT(4) | BIT(5) | BIT(6))
  171. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  172. #define SETHT_MCS32(x) (x[4] |= 1)
  173. #define HT_STREAM_2X2 0x22
  174. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  175. #define LLC_SNAP_LEN 8
  176. #define MOD_CLASS_HR_DSSS 0x03
  177. #define MOD_CLASS_OFDM 0x07
  178. #define MOD_CLASS_HT 0x08
  179. #define HT_BW_20 0
  180. #define HT_BW_40 1
  181. #define HostCmd_CMD_GET_HW_SPEC 0x0003
  182. #define HostCmd_CMD_802_11_SCAN 0x0006
  183. #define HostCmd_CMD_802_11_GET_LOG 0x000b
  184. #define HostCmd_CMD_MAC_MULTICAST_ADR 0x0010
  185. #define HostCmd_CMD_802_11_EEPROM_ACCESS 0x0059
  186. #define HostCmd_CMD_802_11_ASSOCIATE 0x0012
  187. #define HostCmd_CMD_802_11_SNMP_MIB 0x0016
  188. #define HostCmd_CMD_MAC_REG_ACCESS 0x0019
  189. #define HostCmd_CMD_BBP_REG_ACCESS 0x001a
  190. #define HostCmd_CMD_RF_REG_ACCESS 0x001b
  191. #define HostCmd_CMD_PMIC_REG_ACCESS 0x00ad
  192. #define HostCmd_CMD_RF_TX_PWR 0x001e
  193. #define HostCmd_CMD_RF_ANTENNA 0x0020
  194. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  195. #define HostCmd_CMD_MAC_CONTROL 0x0028
  196. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  197. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  198. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  199. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  200. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  201. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  202. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  203. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  204. #define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
  205. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  206. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  207. #define HostCmd_CMD_VERSION_EXT 0x0097
  208. #define HostCmd_CMD_RSSI_INFO 0x00a4
  209. #define HostCmd_CMD_FUNC_INIT 0x00a9
  210. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  211. #define HostCmd_CMD_UAP_SYS_CONFIG 0x00b0
  212. #define HostCmd_CMD_UAP_BSS_START 0x00b1
  213. #define HostCmd_CMD_UAP_BSS_STOP 0x00b2
  214. #define HostCmd_CMD_11N_CFG 0x00cd
  215. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  216. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  217. #define HostCmd_CMD_11N_DELBA 0x00d0
  218. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  219. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  220. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  221. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  222. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  223. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  224. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  225. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  226. #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa
  227. #define HostCmd_CMD_MGMT_FRAME_REG 0x010c
  228. #define PROTOCOL_NO_SECURITY 0x01
  229. #define PROTOCOL_STATIC_WEP 0x02
  230. #define PROTOCOL_WPA 0x08
  231. #define PROTOCOL_WPA2 0x20
  232. #define PROTOCOL_WPA2_MIXED 0x28
  233. #define PROTOCOL_EAP 0x40
  234. #define KEY_MGMT_NONE 0x04
  235. #define KEY_MGMT_PSK 0x02
  236. #define KEY_MGMT_EAP 0x01
  237. #define CIPHER_TKIP 0x04
  238. #define CIPHER_AES_CCMP 0x08
  239. #define VALID_CIPHER_BITMAP 0x0c
  240. enum ENH_PS_MODES {
  241. EN_PS = 1,
  242. DIS_PS = 2,
  243. EN_AUTO_DS = 3,
  244. DIS_AUTO_DS = 4,
  245. SLEEP_CONFIRM = 5,
  246. GET_PS = 0,
  247. EN_AUTO_PS = 0xff,
  248. DIS_AUTO_PS = 0xfe,
  249. };
  250. #define HostCmd_RET_BIT 0x8000
  251. #define HostCmd_ACT_GEN_GET 0x0000
  252. #define HostCmd_ACT_GEN_SET 0x0001
  253. #define HostCmd_ACT_BITWISE_SET 0x0002
  254. #define HostCmd_ACT_BITWISE_CLR 0x0003
  255. #define HostCmd_RESULT_OK 0x0000
  256. #define HostCmd_ACT_MAC_RX_ON 0x0001
  257. #define HostCmd_ACT_MAC_TX_ON 0x0002
  258. #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
  259. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
  260. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  261. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  262. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
  263. #define HostCmd_BSS_MODE_IBSS 0x0002
  264. #define HostCmd_BSS_MODE_ANY 0x0003
  265. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  266. #define HostCmd_SCAN_RADIO_TYPE_A 1
  267. #define HOST_SLEEP_CFG_CANCEL 0xffffffff
  268. #define HOST_SLEEP_CFG_COND_DEF 0x00000000
  269. #define HOST_SLEEP_CFG_GPIO_DEF 0xff
  270. #define HOST_SLEEP_CFG_GAP_DEF 0
  271. #define CMD_F_HOSTCMD (1 << 0)
  272. #define CMD_F_CANCELED (1 << 1)
  273. #define HostCmd_CMD_ID_MASK 0x0fff
  274. #define HostCmd_SEQ_NUM_MASK 0x00ff
  275. #define HostCmd_BSS_NUM_MASK 0x0f00
  276. #define HostCmd_BSS_TYPE_MASK 0xf000
  277. #define HostCmd_ACT_SET_RX 0x0001
  278. #define HostCmd_ACT_SET_TX 0x0002
  279. #define HostCmd_ACT_SET_BOTH 0x0003
  280. #define RF_ANTENNA_AUTO 0xFFFF
  281. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  282. (((seq) & 0x00ff) | \
  283. (((num) & 0x000f) << 8)) | \
  284. (((type) & 0x000f) << 12); }
  285. #define HostCmd_GET_SEQ_NO(seq) \
  286. ((seq) & HostCmd_SEQ_NUM_MASK)
  287. #define HostCmd_GET_BSS_NO(seq) \
  288. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  289. #define HostCmd_GET_BSS_TYPE(seq) \
  290. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  291. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  292. #define EVENT_LINK_LOST 0x00000003
  293. #define EVENT_LINK_SENSED 0x00000004
  294. #define EVENT_MIB_CHANGED 0x00000006
  295. #define EVENT_INIT_DONE 0x00000007
  296. #define EVENT_DEAUTHENTICATED 0x00000008
  297. #define EVENT_DISASSOCIATED 0x00000009
  298. #define EVENT_PS_AWAKE 0x0000000a
  299. #define EVENT_PS_SLEEP 0x0000000b
  300. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  301. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  302. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  303. #define EVENT_ADHOC_BCN_LOST 0x00000011
  304. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  305. #define EVENT_BG_SCAN_REPORT 0x00000018
  306. #define EVENT_RSSI_LOW 0x00000019
  307. #define EVENT_SNR_LOW 0x0000001a
  308. #define EVENT_MAX_FAIL 0x0000001b
  309. #define EVENT_RSSI_HIGH 0x0000001c
  310. #define EVENT_SNR_HIGH 0x0000001d
  311. #define EVENT_IBSS_COALESCED 0x0000001e
  312. #define EVENT_DATA_RSSI_LOW 0x00000024
  313. #define EVENT_DATA_SNR_LOW 0x00000025
  314. #define EVENT_DATA_RSSI_HIGH 0x00000026
  315. #define EVENT_DATA_SNR_HIGH 0x00000027
  316. #define EVENT_LINK_QUALITY 0x00000028
  317. #define EVENT_PORT_RELEASE 0x0000002b
  318. #define EVENT_UAP_STA_DEAUTH 0x0000002c
  319. #define EVENT_UAP_STA_ASSOC 0x0000002d
  320. #define EVENT_UAP_BSS_START 0x0000002e
  321. #define EVENT_PRE_BEACON_LOST 0x00000031
  322. #define EVENT_ADDBA 0x00000033
  323. #define EVENT_DELBA 0x00000034
  324. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  325. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  326. #define EVENT_UAP_BSS_IDLE 0x00000043
  327. #define EVENT_UAP_BSS_ACTIVE 0x00000044
  328. #define EVENT_WEP_ICV_ERR 0x00000046
  329. #define EVENT_HS_ACT_REQ 0x00000047
  330. #define EVENT_BW_CHANGE 0x00000048
  331. #define EVENT_UAP_MIC_COUNTERMEASURES 0x0000004c
  332. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  333. #define EVENT_ID_MASK 0xffff
  334. #define BSS_NUM_MASK 0xf
  335. #define EVENT_GET_BSS_NUM(event_cause) \
  336. (((event_cause) >> 16) & BSS_NUM_MASK)
  337. #define EVENT_GET_BSS_TYPE(event_cause) \
  338. (((event_cause) >> 24) & 0x00ff)
  339. struct mwifiex_ie_types_header {
  340. __le16 type;
  341. __le16 len;
  342. } __packed;
  343. struct mwifiex_ie_types_data {
  344. struct mwifiex_ie_types_header header;
  345. u8 data[1];
  346. } __packed;
  347. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  348. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  349. struct txpd {
  350. u8 bss_type;
  351. u8 bss_num;
  352. __le16 tx_pkt_length;
  353. __le16 tx_pkt_offset;
  354. __le16 tx_pkt_type;
  355. __le32 tx_control;
  356. u8 priority;
  357. u8 flags;
  358. u8 pkt_delay_2ms;
  359. u8 reserved1;
  360. } __packed;
  361. struct rxpd {
  362. u8 bss_type;
  363. u8 bss_num;
  364. __le16 rx_pkt_length;
  365. __le16 rx_pkt_offset;
  366. __le16 rx_pkt_type;
  367. __le16 seq_num;
  368. u8 priority;
  369. u8 rx_rate;
  370. s8 snr;
  371. s8 nf;
  372. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  373. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  374. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  375. u8 ht_info;
  376. u8 reserved;
  377. } __packed;
  378. struct uap_txpd {
  379. u8 bss_type;
  380. u8 bss_num;
  381. __le16 tx_pkt_length;
  382. __le16 tx_pkt_offset;
  383. __le16 tx_pkt_type;
  384. __le32 tx_control;
  385. u8 priority;
  386. u8 flags;
  387. u8 pkt_delay_2ms;
  388. u8 reserved1;
  389. __le32 reserved2;
  390. };
  391. struct uap_rxpd {
  392. u8 bss_type;
  393. u8 bss_num;
  394. __le16 rx_pkt_length;
  395. __le16 rx_pkt_offset;
  396. __le16 rx_pkt_type;
  397. __le16 seq_num;
  398. u8 priority;
  399. u8 reserved1;
  400. };
  401. enum mwifiex_chan_scan_mode_bitmasks {
  402. MWIFIEX_PASSIVE_SCAN = BIT(0),
  403. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  404. };
  405. struct mwifiex_chan_scan_param_set {
  406. u8 radio_type;
  407. u8 chan_number;
  408. u8 chan_scan_mode_bitmap;
  409. __le16 min_scan_time;
  410. __le16 max_scan_time;
  411. } __packed;
  412. struct mwifiex_ie_types_chan_list_param_set {
  413. struct mwifiex_ie_types_header header;
  414. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  415. } __packed;
  416. struct chan_band_param_set {
  417. u8 radio_type;
  418. u8 chan_number;
  419. };
  420. struct mwifiex_ie_types_chan_band_list_param_set {
  421. struct mwifiex_ie_types_header header;
  422. struct chan_band_param_set chan_band_param[1];
  423. } __packed;
  424. struct mwifiex_ie_types_rates_param_set {
  425. struct mwifiex_ie_types_header header;
  426. u8 rates[1];
  427. } __packed;
  428. struct mwifiex_ie_types_ssid_param_set {
  429. struct mwifiex_ie_types_header header;
  430. u8 ssid[1];
  431. } __packed;
  432. struct mwifiex_ie_types_num_probes {
  433. struct mwifiex_ie_types_header header;
  434. __le16 num_probes;
  435. } __packed;
  436. struct mwifiex_ie_types_wildcard_ssid_params {
  437. struct mwifiex_ie_types_header header;
  438. u8 max_ssid_length;
  439. u8 ssid[1];
  440. } __packed;
  441. #define TSF_DATA_SIZE 8
  442. struct mwifiex_ie_types_tsf_timestamp {
  443. struct mwifiex_ie_types_header header;
  444. u8 tsf_data[1];
  445. } __packed;
  446. struct mwifiex_cf_param_set {
  447. u8 cfp_cnt;
  448. u8 cfp_period;
  449. u16 cfp_max_duration;
  450. u16 cfp_duration_remaining;
  451. } __packed;
  452. struct mwifiex_ibss_param_set {
  453. u16 atim_window;
  454. } __packed;
  455. struct mwifiex_ie_types_ss_param_set {
  456. struct mwifiex_ie_types_header header;
  457. union {
  458. struct mwifiex_cf_param_set cf_param_set[1];
  459. struct mwifiex_ibss_param_set ibss_param_set[1];
  460. } cf_ibss;
  461. } __packed;
  462. struct mwifiex_fh_param_set {
  463. u16 dwell_time;
  464. u8 hop_set;
  465. u8 hop_pattern;
  466. u8 hop_index;
  467. } __packed;
  468. struct mwifiex_ds_param_set {
  469. u8 current_chan;
  470. } __packed;
  471. struct mwifiex_ie_types_phy_param_set {
  472. struct mwifiex_ie_types_header header;
  473. union {
  474. struct mwifiex_fh_param_set fh_param_set[1];
  475. struct mwifiex_ds_param_set ds_param_set[1];
  476. } fh_ds;
  477. } __packed;
  478. struct mwifiex_ie_types_auth_type {
  479. struct mwifiex_ie_types_header header;
  480. __le16 auth_type;
  481. } __packed;
  482. struct mwifiex_ie_types_vendor_param_set {
  483. struct mwifiex_ie_types_header header;
  484. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  485. };
  486. struct mwifiex_ie_types_rsn_param_set {
  487. struct mwifiex_ie_types_header header;
  488. u8 rsn_ie[1];
  489. } __packed;
  490. #define KEYPARAMSET_FIXED_LEN 6
  491. struct mwifiex_ie_type_key_param_set {
  492. __le16 type;
  493. __le16 length;
  494. __le16 key_type_id;
  495. __le16 key_info;
  496. __le16 key_len;
  497. u8 key[50];
  498. } __packed;
  499. #define IGTK_PN_LEN 8
  500. struct mwifiex_cmac_param {
  501. u8 ipn[IGTK_PN_LEN];
  502. u8 key[WLAN_KEY_LEN_AES_CMAC];
  503. } __packed;
  504. struct host_cmd_ds_802_11_key_material {
  505. __le16 action;
  506. struct mwifiex_ie_type_key_param_set key_param_set;
  507. } __packed;
  508. struct host_cmd_ds_gen {
  509. u16 command;
  510. u16 size;
  511. u16 seq_num;
  512. u16 result;
  513. };
  514. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  515. enum sleep_resp_ctrl {
  516. RESP_NOT_NEEDED = 0,
  517. RESP_NEEDED,
  518. };
  519. struct mwifiex_ps_param {
  520. __le16 null_pkt_interval;
  521. __le16 multiple_dtims;
  522. __le16 bcn_miss_timeout;
  523. __le16 local_listen_interval;
  524. __le16 adhoc_wake_period;
  525. __le16 mode;
  526. __le16 delay_to_ps;
  527. };
  528. #define BITMAP_AUTO_DS 0x01
  529. #define BITMAP_STA_PS 0x10
  530. struct mwifiex_ie_types_auto_ds_param {
  531. struct mwifiex_ie_types_header header;
  532. __le16 deep_sleep_timeout;
  533. } __packed;
  534. struct mwifiex_ie_types_ps_param {
  535. struct mwifiex_ie_types_header header;
  536. struct mwifiex_ps_param param;
  537. } __packed;
  538. struct host_cmd_ds_802_11_ps_mode_enh {
  539. __le16 action;
  540. union {
  541. struct mwifiex_ps_param opt_ps;
  542. __le16 ps_bitmap;
  543. } params;
  544. } __packed;
  545. struct host_cmd_ds_get_hw_spec {
  546. __le16 hw_if_version;
  547. __le16 version;
  548. __le16 reserved;
  549. __le16 num_of_mcast_adr;
  550. u8 permanent_addr[ETH_ALEN];
  551. __le16 region_code;
  552. __le16 number_of_antenna;
  553. __le32 fw_release_number;
  554. __le32 reserved_1;
  555. __le32 reserved_2;
  556. __le32 reserved_3;
  557. __le32 fw_cap_info;
  558. __le32 dot_11n_dev_cap;
  559. u8 dev_mcs_support;
  560. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  561. __le16 reserved_4;
  562. } __packed;
  563. struct host_cmd_ds_802_11_rssi_info {
  564. __le16 action;
  565. __le16 ndata;
  566. __le16 nbcn;
  567. __le16 reserved[9];
  568. long long reserved_1;
  569. };
  570. struct host_cmd_ds_802_11_rssi_info_rsp {
  571. __le16 action;
  572. __le16 ndata;
  573. __le16 nbcn;
  574. __le16 data_rssi_last;
  575. __le16 data_nf_last;
  576. __le16 data_rssi_avg;
  577. __le16 data_nf_avg;
  578. __le16 bcn_rssi_last;
  579. __le16 bcn_nf_last;
  580. __le16 bcn_rssi_avg;
  581. __le16 bcn_nf_avg;
  582. long long tsf_bcn;
  583. };
  584. struct host_cmd_ds_802_11_mac_address {
  585. __le16 action;
  586. u8 mac_addr[ETH_ALEN];
  587. };
  588. struct host_cmd_ds_mac_control {
  589. __le16 action;
  590. __le16 reserved;
  591. };
  592. struct host_cmd_ds_mac_multicast_adr {
  593. __le16 action;
  594. __le16 num_of_adrs;
  595. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  596. } __packed;
  597. struct host_cmd_ds_802_11_deauthenticate {
  598. u8 mac_addr[ETH_ALEN];
  599. __le16 reason_code;
  600. } __packed;
  601. struct host_cmd_ds_802_11_associate {
  602. u8 peer_sta_addr[ETH_ALEN];
  603. __le16 cap_info_bitmap;
  604. __le16 listen_interval;
  605. __le16 beacon_period;
  606. u8 dtim_period;
  607. } __packed;
  608. struct ieee_types_assoc_rsp {
  609. __le16 cap_info_bitmap;
  610. __le16 status_code;
  611. __le16 a_id;
  612. u8 ie_buffer[1];
  613. } __packed;
  614. struct host_cmd_ds_802_11_associate_rsp {
  615. struct ieee_types_assoc_rsp assoc_rsp;
  616. } __packed;
  617. struct ieee_types_cf_param_set {
  618. u8 element_id;
  619. u8 len;
  620. u8 cfp_cnt;
  621. u8 cfp_period;
  622. u16 cfp_max_duration;
  623. u16 cfp_duration_remaining;
  624. } __packed;
  625. struct ieee_types_ibss_param_set {
  626. u8 element_id;
  627. u8 len;
  628. __le16 atim_window;
  629. } __packed;
  630. union ieee_types_ss_param_set {
  631. struct ieee_types_cf_param_set cf_param_set;
  632. struct ieee_types_ibss_param_set ibss_param_set;
  633. } __packed;
  634. struct ieee_types_fh_param_set {
  635. u8 element_id;
  636. u8 len;
  637. __le16 dwell_time;
  638. u8 hop_set;
  639. u8 hop_pattern;
  640. u8 hop_index;
  641. } __packed;
  642. struct ieee_types_ds_param_set {
  643. u8 element_id;
  644. u8 len;
  645. u8 current_chan;
  646. } __packed;
  647. union ieee_types_phy_param_set {
  648. struct ieee_types_fh_param_set fh_param_set;
  649. struct ieee_types_ds_param_set ds_param_set;
  650. } __packed;
  651. struct host_cmd_ds_802_11_ad_hoc_start {
  652. u8 ssid[IEEE80211_MAX_SSID_LEN];
  653. u8 bss_mode;
  654. __le16 beacon_period;
  655. u8 dtim_period;
  656. union ieee_types_ss_param_set ss_param_set;
  657. union ieee_types_phy_param_set phy_param_set;
  658. u16 reserved1;
  659. __le16 cap_info_bitmap;
  660. u8 data_rate[HOSTCMD_SUPPORTED_RATES];
  661. } __packed;
  662. struct host_cmd_ds_802_11_ad_hoc_result {
  663. u8 pad[3];
  664. u8 bssid[ETH_ALEN];
  665. } __packed;
  666. struct adhoc_bss_desc {
  667. u8 bssid[ETH_ALEN];
  668. u8 ssid[IEEE80211_MAX_SSID_LEN];
  669. u8 bss_mode;
  670. __le16 beacon_period;
  671. u8 dtim_period;
  672. u8 time_stamp[8];
  673. u8 local_time[8];
  674. union ieee_types_phy_param_set phy_param_set;
  675. union ieee_types_ss_param_set ss_param_set;
  676. __le16 cap_info_bitmap;
  677. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  678. /*
  679. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  680. * It is used in the Adhoc join command and will cause a
  681. * binary layout mismatch with the firmware
  682. */
  683. } __packed;
  684. struct host_cmd_ds_802_11_ad_hoc_join {
  685. struct adhoc_bss_desc bss_descriptor;
  686. u16 reserved1;
  687. u16 reserved2;
  688. } __packed;
  689. struct host_cmd_ds_802_11_get_log {
  690. __le32 mcast_tx_frame;
  691. __le32 failed;
  692. __le32 retry;
  693. __le32 multi_retry;
  694. __le32 frame_dup;
  695. __le32 rts_success;
  696. __le32 rts_failure;
  697. __le32 ack_failure;
  698. __le32 rx_frag;
  699. __le32 mcast_rx_frame;
  700. __le32 fcs_error;
  701. __le32 tx_frame;
  702. __le32 reserved;
  703. __le32 wep_icv_err_cnt[4];
  704. };
  705. struct host_cmd_ds_tx_rate_query {
  706. u8 tx_rate;
  707. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  708. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  709. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  710. u8 ht_info;
  711. } __packed;
  712. enum Host_Sleep_Action {
  713. HS_CONFIGURE = 0x0001,
  714. HS_ACTIVATE = 0x0002,
  715. };
  716. struct mwifiex_hs_config_param {
  717. __le32 conditions;
  718. u8 gpio;
  719. u8 gap;
  720. } __packed;
  721. struct hs_activate_param {
  722. u16 resp_ctrl;
  723. } __packed;
  724. struct host_cmd_ds_802_11_hs_cfg_enh {
  725. __le16 action;
  726. union {
  727. struct mwifiex_hs_config_param hs_config;
  728. struct hs_activate_param hs_activate;
  729. } params;
  730. } __packed;
  731. enum SNMP_MIB_INDEX {
  732. OP_RATE_SET_I = 1,
  733. DTIM_PERIOD_I = 3,
  734. RTS_THRESH_I = 5,
  735. SHORT_RETRY_LIM_I = 6,
  736. LONG_RETRY_LIM_I = 7,
  737. FRAG_THRESH_I = 8,
  738. DOT11D_I = 9,
  739. };
  740. #define MAX_SNMP_BUF_SIZE 128
  741. struct host_cmd_ds_802_11_snmp_mib {
  742. __le16 query_type;
  743. __le16 oid;
  744. __le16 buf_size;
  745. u8 value[1];
  746. } __packed;
  747. struct mwifiex_rate_scope {
  748. __le16 type;
  749. __le16 length;
  750. __le16 hr_dsss_rate_bitmap;
  751. __le16 ofdm_rate_bitmap;
  752. __le16 ht_mcs_rate_bitmap[8];
  753. } __packed;
  754. struct mwifiex_rate_drop_pattern {
  755. __le16 type;
  756. __le16 length;
  757. __le32 rate_drop_mode;
  758. } __packed;
  759. struct host_cmd_ds_tx_rate_cfg {
  760. __le16 action;
  761. __le16 cfg_index;
  762. } __packed;
  763. struct mwifiex_power_group {
  764. u8 modulation_class;
  765. u8 first_rate_code;
  766. u8 last_rate_code;
  767. s8 power_step;
  768. s8 power_min;
  769. s8 power_max;
  770. u8 ht_bandwidth;
  771. u8 reserved;
  772. } __packed;
  773. struct mwifiex_types_power_group {
  774. u16 type;
  775. u16 length;
  776. } __packed;
  777. struct host_cmd_ds_txpwr_cfg {
  778. __le16 action;
  779. __le16 cfg_index;
  780. __le32 mode;
  781. } __packed;
  782. struct host_cmd_ds_rf_tx_pwr {
  783. __le16 action;
  784. __le16 cur_level;
  785. u8 max_power;
  786. u8 min_power;
  787. } __packed;
  788. struct host_cmd_ds_rf_ant_mimo {
  789. __le16 action_tx;
  790. __le16 tx_ant_mode;
  791. __le16 action_rx;
  792. __le16 rx_ant_mode;
  793. };
  794. struct host_cmd_ds_rf_ant_siso {
  795. __le16 action;
  796. __le16 ant_mode;
  797. };
  798. struct mwifiex_bcn_param {
  799. u8 bssid[ETH_ALEN];
  800. u8 rssi;
  801. __le64 timestamp;
  802. __le16 beacon_period;
  803. __le16 cap_info_bitmap;
  804. } __packed;
  805. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  806. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  807. struct mwifiex_scan_cmd_config {
  808. /*
  809. * BSS mode to be sent in the firmware command
  810. */
  811. u8 bss_mode;
  812. /* Specific BSSID used to filter scan results in the firmware */
  813. u8 specific_bssid[ETH_ALEN];
  814. /* Length of TLVs sent in command starting at tlvBuffer */
  815. u32 tlv_buf_len;
  816. /*
  817. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  818. *
  819. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  820. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  821. */
  822. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  823. here */
  824. } __packed;
  825. struct mwifiex_user_scan_chan {
  826. u8 chan_number;
  827. u8 radio_type;
  828. u8 scan_type;
  829. u8 reserved;
  830. u32 scan_time;
  831. } __packed;
  832. struct mwifiex_user_scan_cfg {
  833. /*
  834. * BSS mode to be sent in the firmware command
  835. */
  836. u8 bss_mode;
  837. /* Configure the number of probe requests for active chan scans */
  838. u8 num_probes;
  839. u8 reserved;
  840. /* BSSID filter sent in the firmware command to limit the results */
  841. u8 specific_bssid[ETH_ALEN];
  842. /* SSID filter list used in the firmware to limit the scan results */
  843. struct cfg80211_ssid *ssid_list;
  844. u8 num_ssids;
  845. /* Variable number (fixed maximum) of channels to scan up */
  846. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  847. } __packed;
  848. struct ie_body {
  849. u8 grp_key_oui[4];
  850. u8 ptk_cnt[2];
  851. u8 ptk_body[4];
  852. } __packed;
  853. struct host_cmd_ds_802_11_scan {
  854. u8 bss_mode;
  855. u8 bssid[ETH_ALEN];
  856. u8 tlv_buffer[1];
  857. } __packed;
  858. struct host_cmd_ds_802_11_scan_rsp {
  859. __le16 bss_descript_size;
  860. u8 number_of_sets;
  861. u8 bss_desc_and_tlv_buffer[1];
  862. } __packed;
  863. struct host_cmd_ds_802_11_bg_scan_query {
  864. u8 flush;
  865. } __packed;
  866. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  867. u32 report_condition;
  868. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  869. } __packed;
  870. struct mwifiex_ietypes_domain_param_set {
  871. struct mwifiex_ie_types_header header;
  872. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  873. struct ieee80211_country_ie_triplet triplet[1];
  874. } __packed;
  875. struct host_cmd_ds_802_11d_domain_info {
  876. __le16 action;
  877. struct mwifiex_ietypes_domain_param_set domain;
  878. } __packed;
  879. struct host_cmd_ds_802_11d_domain_info_rsp {
  880. __le16 action;
  881. struct mwifiex_ietypes_domain_param_set domain;
  882. } __packed;
  883. struct host_cmd_ds_11n_addba_req {
  884. u8 add_req_result;
  885. u8 peer_mac_addr[ETH_ALEN];
  886. u8 dialog_token;
  887. __le16 block_ack_param_set;
  888. __le16 block_ack_tmo;
  889. __le16 ssn;
  890. } __packed;
  891. struct host_cmd_ds_11n_addba_rsp {
  892. u8 add_rsp_result;
  893. u8 peer_mac_addr[ETH_ALEN];
  894. u8 dialog_token;
  895. __le16 status_code;
  896. __le16 block_ack_param_set;
  897. __le16 block_ack_tmo;
  898. __le16 ssn;
  899. } __packed;
  900. struct host_cmd_ds_11n_delba {
  901. u8 del_result;
  902. u8 peer_mac_addr[ETH_ALEN];
  903. __le16 del_ba_param_set;
  904. __le16 reason_code;
  905. u8 reserved;
  906. } __packed;
  907. struct host_cmd_ds_11n_batimeout {
  908. u8 tid;
  909. u8 peer_mac_addr[ETH_ALEN];
  910. u8 origninator;
  911. } __packed;
  912. struct host_cmd_ds_11n_cfg {
  913. __le16 action;
  914. __le16 ht_tx_cap;
  915. __le16 ht_tx_info;
  916. } __packed;
  917. struct host_cmd_ds_txbuf_cfg {
  918. __le16 action;
  919. __le16 buff_size;
  920. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  921. __le16 reserved3;
  922. } __packed;
  923. struct host_cmd_ds_amsdu_aggr_ctrl {
  924. __le16 action;
  925. __le16 enable;
  926. __le16 curr_buf_size;
  927. } __packed;
  928. struct mwifiex_ie_types_wmm_param_set {
  929. struct mwifiex_ie_types_header header;
  930. u8 wmm_ie[1];
  931. };
  932. struct mwifiex_ie_types_wmm_queue_status {
  933. struct mwifiex_ie_types_header header;
  934. u8 queue_index;
  935. u8 disabled;
  936. u16 medium_time;
  937. u8 flow_required;
  938. u8 flow_created;
  939. u32 reserved;
  940. };
  941. struct ieee_types_vendor_header {
  942. u8 element_id;
  943. u8 len;
  944. u8 oui[4]; /* 0~2: oui, 3: oui_type */
  945. u8 oui_subtype;
  946. u8 version;
  947. } __packed;
  948. struct ieee_types_wmm_ac_parameters {
  949. u8 aci_aifsn_bitmap;
  950. u8 ecw_bitmap;
  951. __le16 tx_op_limit;
  952. } __packed;
  953. struct ieee_types_wmm_parameter {
  954. /*
  955. * WMM Parameter IE - Vendor Specific Header:
  956. * element_id [221/0xdd]
  957. * Len [24]
  958. * Oui [00:50:f2]
  959. * OuiType [2]
  960. * OuiSubType [1]
  961. * Version [1]
  962. */
  963. struct ieee_types_vendor_header vend_hdr;
  964. u8 qos_info_bitmap;
  965. u8 reserved;
  966. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS];
  967. } __packed;
  968. struct ieee_types_wmm_info {
  969. /*
  970. * WMM Info IE - Vendor Specific Header:
  971. * element_id [221/0xdd]
  972. * Len [7]
  973. * Oui [00:50:f2]
  974. * OuiType [2]
  975. * OuiSubType [0]
  976. * Version [1]
  977. */
  978. struct ieee_types_vendor_header vend_hdr;
  979. u8 qos_info_bitmap;
  980. } __packed;
  981. struct host_cmd_ds_wmm_get_status {
  982. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  983. IEEE80211_NUM_ACS];
  984. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  985. } __packed;
  986. struct mwifiex_wmm_ac_status {
  987. u8 disabled;
  988. u8 flow_required;
  989. u8 flow_created;
  990. };
  991. struct mwifiex_ie_types_htcap {
  992. struct mwifiex_ie_types_header header;
  993. struct ieee80211_ht_cap ht_cap;
  994. } __packed;
  995. struct mwifiex_ie_types_htinfo {
  996. struct mwifiex_ie_types_header header;
  997. struct ieee80211_ht_operation ht_oper;
  998. } __packed;
  999. struct mwifiex_ie_types_2040bssco {
  1000. struct mwifiex_ie_types_header header;
  1001. u8 bss_co_2040;
  1002. } __packed;
  1003. struct mwifiex_ie_types_extcap {
  1004. struct mwifiex_ie_types_header header;
  1005. u8 ext_cap;
  1006. } __packed;
  1007. struct host_cmd_ds_mac_reg_access {
  1008. __le16 action;
  1009. __le16 offset;
  1010. __le32 value;
  1011. } __packed;
  1012. struct host_cmd_ds_bbp_reg_access {
  1013. __le16 action;
  1014. __le16 offset;
  1015. u8 value;
  1016. u8 reserved[3];
  1017. } __packed;
  1018. struct host_cmd_ds_rf_reg_access {
  1019. __le16 action;
  1020. __le16 offset;
  1021. u8 value;
  1022. u8 reserved[3];
  1023. } __packed;
  1024. struct host_cmd_ds_pmic_reg_access {
  1025. __le16 action;
  1026. __le16 offset;
  1027. u8 value;
  1028. u8 reserved[3];
  1029. } __packed;
  1030. struct host_cmd_ds_802_11_eeprom_access {
  1031. __le16 action;
  1032. __le16 offset;
  1033. __le16 byte_count;
  1034. u8 value;
  1035. } __packed;
  1036. struct host_cmd_tlv {
  1037. __le16 type;
  1038. __le16 len;
  1039. } __packed;
  1040. struct mwifiex_assoc_event {
  1041. u8 sta_addr[ETH_ALEN];
  1042. __le16 type;
  1043. __le16 len;
  1044. __le16 frame_control;
  1045. __le16 cap_info;
  1046. __le16 listen_interval;
  1047. u8 data[0];
  1048. } __packed;
  1049. struct host_cmd_ds_sys_config {
  1050. __le16 action;
  1051. u8 tlv[0];
  1052. };
  1053. struct host_cmd_tlv_akmp {
  1054. struct host_cmd_tlv tlv;
  1055. __le16 key_mgmt;
  1056. __le16 key_mgmt_operation;
  1057. } __packed;
  1058. struct host_cmd_tlv_pwk_cipher {
  1059. struct host_cmd_tlv tlv;
  1060. __le16 proto;
  1061. u8 cipher;
  1062. u8 reserved;
  1063. } __packed;
  1064. struct host_cmd_tlv_gwk_cipher {
  1065. struct host_cmd_tlv tlv;
  1066. u8 cipher;
  1067. u8 reserved;
  1068. } __packed;
  1069. struct host_cmd_tlv_passphrase {
  1070. struct host_cmd_tlv tlv;
  1071. u8 passphrase[0];
  1072. } __packed;
  1073. struct host_cmd_tlv_wep_key {
  1074. struct host_cmd_tlv tlv;
  1075. u8 key_index;
  1076. u8 is_default;
  1077. u8 key[1];
  1078. };
  1079. struct host_cmd_tlv_auth_type {
  1080. struct host_cmd_tlv tlv;
  1081. u8 auth_type;
  1082. } __packed;
  1083. struct host_cmd_tlv_encrypt_protocol {
  1084. struct host_cmd_tlv tlv;
  1085. __le16 proto;
  1086. } __packed;
  1087. struct host_cmd_tlv_ssid {
  1088. struct host_cmd_tlv tlv;
  1089. u8 ssid[0];
  1090. } __packed;
  1091. struct host_cmd_tlv_rates {
  1092. struct host_cmd_tlv tlv;
  1093. u8 rates[0];
  1094. } __packed;
  1095. struct host_cmd_tlv_bcast_ssid {
  1096. struct host_cmd_tlv tlv;
  1097. u8 bcast_ctl;
  1098. } __packed;
  1099. struct host_cmd_tlv_beacon_period {
  1100. struct host_cmd_tlv tlv;
  1101. __le16 period;
  1102. } __packed;
  1103. struct host_cmd_tlv_dtim_period {
  1104. struct host_cmd_tlv tlv;
  1105. u8 period;
  1106. } __packed;
  1107. struct host_cmd_tlv_frag_threshold {
  1108. struct host_cmd_tlv tlv;
  1109. __le16 frag_thr;
  1110. } __packed;
  1111. struct host_cmd_tlv_rts_threshold {
  1112. struct host_cmd_tlv tlv;
  1113. __le16 rts_thr;
  1114. } __packed;
  1115. struct host_cmd_tlv_retry_limit {
  1116. struct host_cmd_tlv tlv;
  1117. u8 limit;
  1118. } __packed;
  1119. struct host_cmd_tlv_mac_addr {
  1120. struct host_cmd_tlv tlv;
  1121. u8 mac_addr[ETH_ALEN];
  1122. } __packed;
  1123. struct host_cmd_tlv_channel_band {
  1124. struct host_cmd_tlv tlv;
  1125. u8 band_config;
  1126. u8 channel;
  1127. } __packed;
  1128. struct host_cmd_ds_version_ext {
  1129. u8 version_str_sel;
  1130. char version_str[128];
  1131. } __packed;
  1132. struct host_cmd_ds_mgmt_frame_reg {
  1133. __le16 action;
  1134. __le32 mask;
  1135. } __packed;
  1136. struct host_cmd_ds_802_11_ibss_status {
  1137. __le16 action;
  1138. __le16 enable;
  1139. u8 bssid[ETH_ALEN];
  1140. __le16 beacon_interval;
  1141. __le16 atim_window;
  1142. __le16 use_g_rate_protect;
  1143. } __packed;
  1144. #define CONNECTION_TYPE_INFRA 0
  1145. #define CONNECTION_TYPE_ADHOC 1
  1146. struct host_cmd_ds_set_bss_mode {
  1147. u8 con_type;
  1148. } __packed;
  1149. struct host_cmd_ds_pcie_details {
  1150. /* TX buffer descriptor ring address */
  1151. u32 txbd_addr_lo;
  1152. u32 txbd_addr_hi;
  1153. /* TX buffer descriptor ring count */
  1154. u32 txbd_count;
  1155. /* RX buffer descriptor ring address */
  1156. u32 rxbd_addr_lo;
  1157. u32 rxbd_addr_hi;
  1158. /* RX buffer descriptor ring count */
  1159. u32 rxbd_count;
  1160. /* Event buffer descriptor ring address */
  1161. u32 evtbd_addr_lo;
  1162. u32 evtbd_addr_hi;
  1163. /* Event buffer descriptor ring count */
  1164. u32 evtbd_count;
  1165. /* Sleep cookie buffer physical address */
  1166. u32 sleep_cookie_addr_lo;
  1167. u32 sleep_cookie_addr_hi;
  1168. } __packed;
  1169. struct mwifiex_ie_types_rssi_threshold {
  1170. struct mwifiex_ie_types_header header;
  1171. u8 abs_value;
  1172. u8 evt_freq;
  1173. } __packed;
  1174. struct host_cmd_ds_802_11_subsc_evt {
  1175. __le16 action;
  1176. __le16 events;
  1177. } __packed;
  1178. struct mwifiex_ie {
  1179. __le16 ie_index;
  1180. __le16 mgmt_subtype_mask;
  1181. __le16 ie_length;
  1182. u8 ie_buffer[IEEE_MAX_IE_SIZE];
  1183. } __packed;
  1184. #define MAX_MGMT_IE_INDEX 16
  1185. struct mwifiex_ie_list {
  1186. __le16 type;
  1187. __le16 len;
  1188. struct mwifiex_ie ie_list[MAX_MGMT_IE_INDEX];
  1189. } __packed;
  1190. struct host_cmd_ds_command {
  1191. __le16 command;
  1192. __le16 size;
  1193. __le16 seq_num;
  1194. __le16 result;
  1195. union {
  1196. struct host_cmd_ds_get_hw_spec hw_spec;
  1197. struct host_cmd_ds_mac_control mac_ctrl;
  1198. struct host_cmd_ds_802_11_mac_address mac_addr;
  1199. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1200. struct host_cmd_ds_802_11_get_log get_log;
  1201. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1202. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1203. struct host_cmd_ds_802_11_snmp_mib smib;
  1204. struct host_cmd_ds_tx_rate_query tx_rate;
  1205. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1206. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1207. struct host_cmd_ds_rf_tx_pwr txp;
  1208. struct host_cmd_ds_rf_ant_mimo ant_mimo;
  1209. struct host_cmd_ds_rf_ant_siso ant_siso;
  1210. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1211. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1212. struct host_cmd_ds_802_11_scan scan;
  1213. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1214. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1215. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1216. struct host_cmd_ds_802_11_associate associate;
  1217. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1218. struct host_cmd_ds_802_11_deauthenticate deauth;
  1219. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1220. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1221. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1222. struct host_cmd_ds_802_11d_domain_info domain_info;
  1223. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1224. struct host_cmd_ds_11n_addba_req add_ba_req;
  1225. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1226. struct host_cmd_ds_11n_delba del_ba;
  1227. struct host_cmd_ds_txbuf_cfg tx_buf;
  1228. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1229. struct host_cmd_ds_11n_cfg htcfg;
  1230. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1231. struct host_cmd_ds_802_11_key_material key_material;
  1232. struct host_cmd_ds_version_ext verext;
  1233. struct host_cmd_ds_mgmt_frame_reg reg_mask;
  1234. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1235. struct host_cmd_ds_mac_reg_access mac_reg;
  1236. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1237. struct host_cmd_ds_rf_reg_access rf_reg;
  1238. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1239. struct host_cmd_ds_set_bss_mode bss_mode;
  1240. struct host_cmd_ds_pcie_details pcie_host_spec;
  1241. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1242. struct host_cmd_ds_802_11_subsc_evt subsc_evt;
  1243. struct host_cmd_ds_sys_config uap_sys_config;
  1244. } params;
  1245. } __packed;
  1246. struct mwifiex_opt_sleep_confirm {
  1247. __le16 command;
  1248. __le16 size;
  1249. __le16 seq_num;
  1250. __le16 result;
  1251. __le16 action;
  1252. __le16 resp_ctrl;
  1253. } __packed;
  1254. #endif /* !_MWIFIEX_FW_H_ */