fw.h 38 KB

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