fw.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  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. extern u8 supported_rates_b[B_SUPPORTED_RATES];
  51. extern u8 supported_rates_g[G_SUPPORTED_RATES];
  52. extern u8 supported_rates_bg[BG_SUPPORTED_RATES];
  53. extern u8 supported_rates_a[A_SUPPORTED_RATES];
  54. extern u8 supported_rates_n[N_SUPPORTED_RATES];
  55. #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff
  56. #define KEY_INFO_ENABLED 0x01
  57. enum KEY_TYPE_ID {
  58. KEY_TYPE_ID_WEP = 0,
  59. KEY_TYPE_ID_TKIP,
  60. KEY_TYPE_ID_AES,
  61. KEY_TYPE_ID_WAPI,
  62. };
  63. enum KEY_INFO_WEP {
  64. KEY_INFO_WEP_MCAST = 0x01,
  65. KEY_INFO_WEP_UNICAST = 0x02,
  66. KEY_INFO_WEP_ENABLED = 0x04
  67. };
  68. enum KEY_INFO_TKIP {
  69. KEY_INFO_TKIP_MCAST = 0x01,
  70. KEY_INFO_TKIP_UNICAST = 0x02,
  71. KEY_INFO_TKIP_ENABLED = 0x04
  72. };
  73. enum KEY_INFO_AES {
  74. KEY_INFO_AES_MCAST = 0x01,
  75. KEY_INFO_AES_UNICAST = 0x02,
  76. KEY_INFO_AES_ENABLED = 0x04
  77. };
  78. #define WAPI_KEY_LEN 50
  79. enum KEY_INFO_WAPI {
  80. KEY_INFO_WAPI_MCAST = 0x01,
  81. KEY_INFO_WAPI_UNICAST = 0x02,
  82. KEY_INFO_WAPI_ENABLED = 0x04
  83. };
  84. #define MAX_POLL_TRIES 100
  85. #define MAX_MULTI_INTERFACE_POLL_TRIES 1000
  86. #define MAX_FIRMWARE_POLL_TRIES 100
  87. #define FIRMWARE_READY 0xfedc
  88. #define FIRMWARE_TRANSFER_NBLOCK 2
  89. enum MWIFIEX_802_11_PRIVACY_FILTER {
  90. MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL,
  91. MWIFIEX_802_11_PRIV_FILTER_8021X_WEP
  92. };
  93. enum MWIFIEX_802_11_WEP_STATUS {
  94. MWIFIEX_802_11_WEP_ENABLED,
  95. MWIFIEX_802_11_WEP_DISABLED,
  96. };
  97. #define CAL_SNR(RSSI, NF) ((s16)((s16)(RSSI)-(s16)(NF)))
  98. #define PROPRIETARY_TLV_BASE_ID 0x0100
  99. #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0)
  100. #define TLV_TYPE_CHANLIST (PROPRIETARY_TLV_BASE_ID + 1)
  101. #define TLV_TYPE_NUMPROBES (PROPRIETARY_TLV_BASE_ID + 2)
  102. #define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 4)
  103. #define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 5)
  104. #define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 6)
  105. #define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 7)
  106. #define TLV_TYPE_LEDBEHAVIOR (PROPRIETARY_TLV_BASE_ID + 9)
  107. #define TLV_TYPE_PASSTHROUGH (PROPRIETARY_TLV_BASE_ID + 10)
  108. #define TLV_TYPE_POWER_TBL_2_4GHZ (PROPRIETARY_TLV_BASE_ID + 12)
  109. #define TLV_TYPE_POWER_TBL_5GHZ (PROPRIETARY_TLV_BASE_ID + 13)
  110. #define TLV_TYPE_WMMQSTATUS (PROPRIETARY_TLV_BASE_ID + 16)
  111. #define TLV_TYPE_WILDCARDSSID (PROPRIETARY_TLV_BASE_ID + 18)
  112. #define TLV_TYPE_TSFTIMESTAMP (PROPRIETARY_TLV_BASE_ID + 19)
  113. #define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 22)
  114. #define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 23)
  115. #define TLV_TYPE_STARTBGSCANLATER (PROPRIETARY_TLV_BASE_ID + 30)
  116. #define TLV_TYPE_AUTH_TYPE (PROPRIETARY_TLV_BASE_ID + 31)
  117. #define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 36)
  118. #define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 38)
  119. #define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 39)
  120. #define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 40)
  121. #define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 41)
  122. #define TLV_TYPE_CHANNELBANDLIST (PROPRIETARY_TLV_BASE_ID + 42)
  123. #define TLV_TYPE_WAPI_IE (PROPRIETARY_TLV_BASE_ID + 94)
  124. #define TLV_TYPE_BSSID (PROPRIETARY_TLV_BASE_ID + 35)
  125. #define MWIFIEX_TX_DATA_BUF_SIZE_2K 2048
  126. #define TLV_TYPE_HT_CAP (PROPRIETARY_TLV_BASE_ID + 74)
  127. #define TLV_TYPE_HT_INFO (PROPRIETARY_TLV_BASE_ID + 75)
  128. #define TLV_SECONDARY_CHANNEL_OFFSET (PROPRIETARY_TLV_BASE_ID + 76)
  129. #define TLV_TYPE_2040BSS_COEXISTENCE (PROPRIETARY_TLV_BASE_ID + 77)
  130. #define TLV_TYPE_OVERLAP_BSS_SCAN_PARAM (PROPRIETARY_TLV_BASE_ID + 78)
  131. #define TLV_TYPE_EXTCAP (PROPRIETARY_TLV_BASE_ID + 79)
  132. #define TLV_TYPE_HT_OPERATIONAL_MCS_SET (PROPRIETARY_TLV_BASE_ID + 80)
  133. #define ADDBA_TID_MASK (BIT(2) | BIT(3) | BIT(4) | BIT(5))
  134. #define DELBA_TID_MASK (BIT(12) | BIT(13) | BIT(14) | BIT(15))
  135. #define SSN_MASK 0xfff0
  136. #define BA_RESULT_SUCCESS 0x0
  137. #define BA_RESULT_FAILURE 0x1
  138. #define BA_RESULT_TIMEOUT 0x2
  139. #define BA_RESULT_DATA_INVALID 0x3
  140. #define IS_BASTREAM_SETUP(ptr) (ptr->ba_status)
  141. #define BA_STREAM_NOT_ALLOWED 0xff
  142. #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
  143. priv->adapter->config_bands & BAND_AN) \
  144. && priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
  145. #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
  146. BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
  147. #define MWIFIEX_TX_DATA_BUF_SIZE_4K 4096
  148. #define MWIFIEX_TX_DATA_BUF_SIZE_8K 8192
  149. #define NON_GREENFIELD_STAS 0x04
  150. #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
  151. /* dev_cap bitmap
  152. * BIT
  153. * 0-16 reserved
  154. * 17 IEEE80211_HT_CAP_SUP_WIDTH_20_40
  155. * 18-22 reserved
  156. * 23 IEEE80211_HT_CAP_SGI_20
  157. * 24 IEEE80211_HT_CAP_SGI_40
  158. * 25 IEEE80211_HT_CAP_TX_STBC
  159. * 26 IEEE80211_HT_CAP_RX_STBC
  160. * 27-28 reserved
  161. * 29 IEEE80211_HT_CAP_GRN_FLD
  162. * 30-31 reserved
  163. */
  164. #define ISSUPP_CHANWIDTH40(Dot11nDevCap) (Dot11nDevCap & BIT(17))
  165. #define ISSUPP_SHORTGI20(Dot11nDevCap) (Dot11nDevCap & BIT(23))
  166. #define ISSUPP_SHORTGI40(Dot11nDevCap) (Dot11nDevCap & BIT(24))
  167. #define ISSUPP_TXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(25))
  168. #define ISSUPP_RXSTBC(Dot11nDevCap) (Dot11nDevCap & BIT(26))
  169. #define ISSUPP_GREENFIELD(Dot11nDevCap) (Dot11nDevCap & BIT(29))
  170. #define GET_RXMCSSUPP(DevMCSSupported) (DevMCSSupported & 0x0f)
  171. #define RESETHT_EXTCAP_RDG(HTExtCap) (HTExtCap &= ~BIT(11))
  172. #define SETHT_MCS32(x) (x[4] |= 1)
  173. #define SET_SECONDARYCHAN(RadioType, SECCHAN) (RadioType |= (SECCHAN << 4))
  174. #define LLC_SNAP_LEN 8
  175. #define TLV_TYPE_RATE_DROP_PATTERN (PROPRIETARY_TLV_BASE_ID + 81)
  176. #define TLV_TYPE_RATE_DROP_CONTROL (PROPRIETARY_TLV_BASE_ID + 82)
  177. #define TLV_TYPE_RATE_SCOPE (PROPRIETARY_TLV_BASE_ID + 83)
  178. #define TLV_TYPE_POWER_GROUP (PROPRIETARY_TLV_BASE_ID + 84)
  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_802_11_RF_CHANNEL 0x001d
  196. #define HostCmd_CMD_802_11_DEAUTHENTICATE 0x0024
  197. #define HostCmd_CMD_MAC_CONTROL 0x0028
  198. #define HostCmd_CMD_802_11_AD_HOC_START 0x002b
  199. #define HostCmd_CMD_802_11_AD_HOC_JOIN 0x002c
  200. #define HostCmd_CMD_802_11_AD_HOC_STOP 0x0040
  201. #define HostCmd_CMD_802_11_MAC_ADDRESS 0x004D
  202. #define HostCmd_CMD_802_11D_DOMAIN_INFO 0x005b
  203. #define HostCmd_CMD_802_11_KEY_MATERIAL 0x005e
  204. #define HostCmd_CMD_802_11_BG_SCAN_QUERY 0x006c
  205. #define HostCmd_CMD_WMM_GET_STATUS 0x0071
  206. #define HostCmd_CMD_802_11_TX_RATE_QUERY 0x007f
  207. #define HostCmd_CMD_802_11_IBSS_COALESCING_STATUS 0x0083
  208. #define HostCmd_CMD_VERSION_EXT 0x0097
  209. #define HostCmd_CMD_RSSI_INFO 0x00a4
  210. #define HostCmd_CMD_FUNC_INIT 0x00a9
  211. #define HostCmd_CMD_FUNC_SHUTDOWN 0x00aa
  212. #define HostCmd_CMD_11N_CFG 0x00cd
  213. #define HostCmd_CMD_11N_ADDBA_REQ 0x00ce
  214. #define HostCmd_CMD_11N_ADDBA_RSP 0x00cf
  215. #define HostCmd_CMD_11N_DELBA 0x00d0
  216. #define HostCmd_CMD_RECONFIGURE_TX_BUFF 0x00d9
  217. #define HostCmd_CMD_AMSDU_AGGR_CTRL 0x00df
  218. #define HostCmd_CMD_TXPWR_CFG 0x00d1
  219. #define HostCmd_CMD_TX_RATE_CFG 0x00d6
  220. #define HostCmd_CMD_802_11_PS_MODE_ENH 0x00e4
  221. #define HostCmd_CMD_802_11_HS_CFG_ENH 0x00e5
  222. #define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
  223. #define HostCmd_CMD_SET_BSS_MODE 0x00f7
  224. enum ENH_PS_MODES {
  225. EN_PS = 1,
  226. DIS_PS = 2,
  227. EN_AUTO_DS = 3,
  228. DIS_AUTO_DS = 4,
  229. SLEEP_CONFIRM = 5,
  230. GET_PS = 0,
  231. EN_AUTO_PS = 0xff,
  232. DIS_AUTO_PS = 0xfe,
  233. };
  234. #define HostCmd_RET_BIT 0x8000
  235. #define HostCmd_ACT_GEN_GET 0x0000
  236. #define HostCmd_ACT_GEN_SET 0x0001
  237. #define HostCmd_ACT_GEN_REMOVE 0x0004
  238. #define HostCmd_ACT_SET_BOTH 0x0003
  239. #define HostCmd_ACT_GET_BOTH 0x000c
  240. #define HostCmd_RESULT_OK 0x0000
  241. #define HostCmd_RESULT_ERROR 0x0001
  242. #define HostCmd_RESULT_NOT_SUPPORT 0x0002
  243. #define HostCmd_RESULT_PENDING 0x0003
  244. #define HostCmd_RESULT_BUSY 0x0004
  245. #define HostCmd_RESULT_PARTIAL_DATA 0x0005
  246. #define HostCmd_ACT_MAC_RX_ON 0x0001
  247. #define HostCmd_ACT_MAC_TX_ON 0x0002
  248. #define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
  249. #define HostCmd_ACT_MAC_ETHERNETII_ENABLE 0x0010
  250. #define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  251. #define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  252. #define HostCmd_ACT_MAC_RTS_CTS_ENABLE 0x0200
  253. #define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
  254. #define HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON 0x2000
  255. #define HostCmd_BSS_MODE_BSS 0x0001
  256. #define HostCmd_BSS_MODE_IBSS 0x0002
  257. #define HostCmd_BSS_MODE_ANY 0x0003
  258. #define HostCmd_SCAN_RADIO_TYPE_BG 0
  259. #define HostCmd_SCAN_RADIO_TYPE_A 1
  260. #define HOST_SLEEP_CFG_CANCEL 0xffffffff
  261. #define HOST_SLEEP_CFG_COND_DEF 0x0000000f
  262. #define HOST_SLEEP_CFG_GPIO_DEF 0xff
  263. #define HOST_SLEEP_CFG_GAP_DEF 0
  264. #define CMD_F_HOSTCMD (1 << 0)
  265. #define CMD_F_CANCELED (1 << 1)
  266. #define HostCmd_CMD_ID_MASK 0x0fff
  267. #define HostCmd_SEQ_NUM_MASK 0x00ff
  268. #define HostCmd_BSS_NUM_MASK 0x0f00
  269. #define HostCmd_BSS_TYPE_MASK 0xf000
  270. #define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
  271. (((seq) & 0x00ff) | \
  272. (((num) & 0x000f) << 8)) | \
  273. (((type) & 0x000f) << 12); }
  274. #define HostCmd_GET_SEQ_NO(seq) \
  275. ((seq) & HostCmd_SEQ_NUM_MASK)
  276. #define HostCmd_GET_BSS_NO(seq) \
  277. (((seq) & HostCmd_BSS_NUM_MASK) >> 8)
  278. #define HostCmd_GET_BSS_TYPE(seq) \
  279. (((seq) & HostCmd_BSS_TYPE_MASK) >> 12)
  280. #define EVENT_DUMMY_HOST_WAKEUP_SIGNAL 0x00000001
  281. #define EVENT_LINK_LOST 0x00000003
  282. #define EVENT_LINK_SENSED 0x00000004
  283. #define EVENT_MIB_CHANGED 0x00000006
  284. #define EVENT_INIT_DONE 0x00000007
  285. #define EVENT_DEAUTHENTICATED 0x00000008
  286. #define EVENT_DISASSOCIATED 0x00000009
  287. #define EVENT_PS_AWAKE 0x0000000a
  288. #define EVENT_PS_SLEEP 0x0000000b
  289. #define EVENT_MIC_ERR_MULTICAST 0x0000000d
  290. #define EVENT_MIC_ERR_UNICAST 0x0000000e
  291. #define EVENT_DEEP_SLEEP_AWAKE 0x00000010
  292. #define EVENT_ADHOC_BCN_LOST 0x00000011
  293. #define EVENT_WMM_STATUS_CHANGE 0x00000017
  294. #define EVENT_BG_SCAN_REPORT 0x00000018
  295. #define EVENT_RSSI_LOW 0x00000019
  296. #define EVENT_SNR_LOW 0x0000001a
  297. #define EVENT_MAX_FAIL 0x0000001b
  298. #define EVENT_RSSI_HIGH 0x0000001c
  299. #define EVENT_SNR_HIGH 0x0000001d
  300. #define EVENT_IBSS_COALESCED 0x0000001e
  301. #define EVENT_DATA_RSSI_LOW 0x00000024
  302. #define EVENT_DATA_SNR_LOW 0x00000025
  303. #define EVENT_DATA_RSSI_HIGH 0x00000026
  304. #define EVENT_DATA_SNR_HIGH 0x00000027
  305. #define EVENT_LINK_QUALITY 0x00000028
  306. #define EVENT_PORT_RELEASE 0x0000002b
  307. #define EVENT_PRE_BEACON_LOST 0x00000031
  308. #define EVENT_ADDBA 0x00000033
  309. #define EVENT_DELBA 0x00000034
  310. #define EVENT_BA_STREAM_TIEMOUT 0x00000037
  311. #define EVENT_AMSDU_AGGR_CTRL 0x00000042
  312. #define EVENT_WEP_ICV_ERR 0x00000046
  313. #define EVENT_HS_ACT_REQ 0x00000047
  314. #define EVENT_BW_CHANGE 0x00000048
  315. #define EVENT_HOSTWAKE_STAIE 0x0000004d
  316. #define EVENT_ID_MASK 0xffff
  317. #define BSS_NUM_MASK 0xf
  318. #define EVENT_GET_BSS_NUM(event_cause) \
  319. (((event_cause) >> 16) & BSS_NUM_MASK)
  320. #define EVENT_GET_BSS_TYPE(event_cause) \
  321. (((event_cause) >> 24) & 0x00ff)
  322. struct mwifiex_event_wep_icv_err {
  323. u16 reason_code;
  324. u8 src_mac_addr[ETH_ALEN];
  325. u8 wep_key_index;
  326. u8 wep_key_length;
  327. u8 key[WLAN_KEY_LEN_WEP104];
  328. };
  329. struct mwifiex_802_11_fixed_ies {
  330. u8 time_stamp[8];
  331. __le16 beacon_interval;
  332. __le16 capabilities;
  333. };
  334. struct mwifiex_ie_types_header {
  335. __le16 type;
  336. __le16 len;
  337. } __packed;
  338. struct mwifiex_ie_types_data {
  339. struct mwifiex_ie_types_header header;
  340. u8 data[1];
  341. } __packed;
  342. #define MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET 0x01
  343. #define MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET 0x08
  344. struct txpd {
  345. u8 bss_type;
  346. u8 bss_num;
  347. __le16 tx_pkt_length;
  348. __le16 tx_pkt_offset;
  349. __le16 tx_pkt_type;
  350. __le32 tx_control;
  351. u8 priority;
  352. u8 flags;
  353. u8 pkt_delay_2ms;
  354. u8 reserved1;
  355. } __packed;
  356. struct rxpd {
  357. u8 bss_type;
  358. u8 bss_num;
  359. u16 rx_pkt_length;
  360. u16 rx_pkt_offset;
  361. u16 rx_pkt_type;
  362. u16 seq_num;
  363. u8 priority;
  364. u8 rx_rate;
  365. s8 snr;
  366. s8 nf;
  367. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  368. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  369. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  370. u8 ht_info;
  371. u8 reserved;
  372. } __packed;
  373. enum mwifiex_chan_scan_mode_bitmasks {
  374. MWIFIEX_PASSIVE_SCAN = BIT(0),
  375. MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
  376. };
  377. #define SECOND_CHANNEL_BELOW 0x30
  378. #define SECOND_CHANNEL_ABOVE 0x10
  379. struct mwifiex_chan_scan_param_set {
  380. u8 radio_type;
  381. u8 chan_number;
  382. u8 chan_scan_mode_bitmap;
  383. __le16 min_scan_time;
  384. __le16 max_scan_time;
  385. } __packed;
  386. struct mwifiex_ie_types_chan_list_param_set {
  387. struct mwifiex_ie_types_header header;
  388. struct mwifiex_chan_scan_param_set chan_scan_param[1];
  389. } __packed;
  390. struct chan_band_param_set {
  391. u8 radio_type;
  392. u8 chan_number;
  393. };
  394. struct mwifiex_ie_types_chan_band_list_param_set {
  395. struct mwifiex_ie_types_header header;
  396. struct chan_band_param_set chan_band_param[1];
  397. } __packed;
  398. struct mwifiex_ie_types_rates_param_set {
  399. struct mwifiex_ie_types_header header;
  400. u8 rates[1];
  401. } __packed;
  402. struct mwifiex_ie_types_ssid_param_set {
  403. struct mwifiex_ie_types_header header;
  404. u8 ssid[1];
  405. } __packed;
  406. struct mwifiex_ie_types_num_probes {
  407. struct mwifiex_ie_types_header header;
  408. __le16 num_probes;
  409. } __packed;
  410. struct mwifiex_ie_types_wildcard_ssid_params {
  411. struct mwifiex_ie_types_header header;
  412. u8 max_ssid_length;
  413. u8 ssid[1];
  414. } __packed;
  415. #define TSF_DATA_SIZE 8
  416. struct mwifiex_ie_types_tsf_timestamp {
  417. struct mwifiex_ie_types_header header;
  418. u8 tsf_data[1];
  419. } __packed;
  420. struct mwifiex_cf_param_set {
  421. u8 cfp_cnt;
  422. u8 cfp_period;
  423. u16 cfp_max_duration;
  424. u16 cfp_duration_remaining;
  425. } __packed;
  426. struct mwifiex_ibss_param_set {
  427. u16 atim_window;
  428. } __packed;
  429. struct mwifiex_ie_types_ss_param_set {
  430. struct mwifiex_ie_types_header header;
  431. union {
  432. struct mwifiex_cf_param_set cf_param_set[1];
  433. struct mwifiex_ibss_param_set ibss_param_set[1];
  434. } cf_ibss;
  435. } __packed;
  436. struct mwifiex_fh_param_set {
  437. u16 dwell_time;
  438. u8 hop_set;
  439. u8 hop_pattern;
  440. u8 hop_index;
  441. } __packed;
  442. struct mwifiex_ds_param_set {
  443. u8 current_chan;
  444. } __packed;
  445. struct mwifiex_ie_types_phy_param_set {
  446. struct mwifiex_ie_types_header header;
  447. union {
  448. struct mwifiex_fh_param_set fh_param_set[1];
  449. struct mwifiex_ds_param_set ds_param_set[1];
  450. } fh_ds;
  451. } __packed;
  452. struct mwifiex_ie_types_auth_type {
  453. struct mwifiex_ie_types_header header;
  454. __le16 auth_type;
  455. } __packed;
  456. struct mwifiex_ie_types_vendor_param_set {
  457. struct mwifiex_ie_types_header header;
  458. u8 ie[MWIFIEX_MAX_VSIE_LEN];
  459. };
  460. struct mwifiex_ie_types_rsn_param_set {
  461. struct mwifiex_ie_types_header header;
  462. u8 rsn_ie[1];
  463. } __packed;
  464. #define KEYPARAMSET_FIXED_LEN 6
  465. struct mwifiex_ie_type_key_param_set {
  466. __le16 type;
  467. __le16 length;
  468. __le16 key_type_id;
  469. __le16 key_info;
  470. __le16 key_len;
  471. u8 key[50];
  472. } __packed;
  473. struct host_cmd_ds_802_11_key_material {
  474. __le16 action;
  475. struct mwifiex_ie_type_key_param_set key_param_set;
  476. } __packed;
  477. struct host_cmd_ds_gen {
  478. u16 command;
  479. u16 size;
  480. u16 seq_num;
  481. u16 result;
  482. };
  483. #define S_DS_GEN sizeof(struct host_cmd_ds_gen)
  484. enum sleep_resp_ctrl {
  485. RESP_NOT_NEEDED = 0,
  486. RESP_NEEDED,
  487. };
  488. struct mwifiex_ps_param {
  489. __le16 null_pkt_interval;
  490. __le16 multiple_dtims;
  491. __le16 bcn_miss_timeout;
  492. __le16 local_listen_interval;
  493. __le16 adhoc_wake_period;
  494. __le16 mode;
  495. __le16 delay_to_ps;
  496. };
  497. struct mwifiex_auto_ds_param {
  498. __le16 deep_sleep_timeout;
  499. };
  500. struct sleep_confirm_param {
  501. __le16 resp_ctrl;
  502. };
  503. #define BITMAP_AUTO_DS 0x01
  504. #define BITMAP_STA_PS 0x10
  505. #define BITMAP_UAP_INACT_PS 0x100
  506. #define BITMAP_UAP_DTIM_PS 0x200
  507. struct auto_ps_param {
  508. __le16 ps_bitmap;
  509. /* auto deep sleep parameter,
  510. * sta power save parameter
  511. * uap inactivity parameter
  512. * uap DTIM parameter */
  513. };
  514. #define AUTO_PS_FIX_SIZE 4
  515. #define TLV_TYPE_AUTO_DS_PARAM (PROPRIETARY_TLV_BASE_ID + 113)
  516. #define TLV_TYPE_PS_PARAM (PROPRIETARY_TLV_BASE_ID + 114)
  517. struct mwifiex_ie_types_auto_ds_param {
  518. struct mwifiex_ie_types_header header;
  519. struct mwifiex_auto_ds_param param;
  520. } __packed;
  521. struct mwifiex_ie_types_ps_param {
  522. struct mwifiex_ie_types_header header;
  523. struct mwifiex_ps_param param;
  524. } __packed;
  525. struct host_cmd_ds_802_11_ps_mode_enh {
  526. __le16 action;
  527. union {
  528. struct mwifiex_ps_param opt_ps;
  529. struct mwifiex_auto_ds_param auto_ds;
  530. struct sleep_confirm_param sleep_cfm;
  531. __le16 ps_bitmap;
  532. struct auto_ps_param auto_ps;
  533. } params;
  534. } __packed;
  535. struct host_cmd_ds_get_hw_spec {
  536. __le16 hw_if_version;
  537. __le16 version;
  538. __le16 reserved;
  539. __le16 num_of_mcast_adr;
  540. u8 permanent_addr[ETH_ALEN];
  541. __le16 region_code;
  542. __le16 number_of_antenna;
  543. __le32 fw_release_number;
  544. __le32 reserved_1;
  545. __le32 reserved_2;
  546. __le32 reserved_3;
  547. __le32 fw_cap_info;
  548. __le32 dot_11n_dev_cap;
  549. u8 dev_mcs_support;
  550. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  551. __le16 reserved_4;
  552. } __packed;
  553. struct host_cmd_ds_802_11_rssi_info {
  554. __le16 action;
  555. __le16 ndata;
  556. __le16 nbcn;
  557. __le16 reserved[9];
  558. long long reserved_1;
  559. };
  560. struct host_cmd_ds_802_11_rssi_info_rsp {
  561. __le16 action;
  562. __le16 ndata;
  563. __le16 nbcn;
  564. __le16 data_rssi_last;
  565. __le16 data_nf_last;
  566. __le16 data_rssi_avg;
  567. __le16 data_nf_avg;
  568. __le16 bcn_rssi_last;
  569. __le16 bcn_nf_last;
  570. __le16 bcn_rssi_avg;
  571. __le16 bcn_nf_avg;
  572. long long tsf_bcn;
  573. };
  574. struct host_cmd_ds_802_11_mac_address {
  575. __le16 action;
  576. u8 mac_addr[ETH_ALEN];
  577. };
  578. struct host_cmd_ds_mac_control {
  579. __le16 action;
  580. __le16 reserved;
  581. };
  582. struct host_cmd_ds_mac_multicast_adr {
  583. __le16 action;
  584. __le16 num_of_adrs;
  585. u8 mac_list[MWIFIEX_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
  586. } __packed;
  587. struct host_cmd_ds_802_11_deauthenticate {
  588. u8 mac_addr[ETH_ALEN];
  589. __le16 reason_code;
  590. } __packed;
  591. struct host_cmd_ds_802_11_associate {
  592. u8 peer_sta_addr[ETH_ALEN];
  593. __le16 cap_info_bitmap;
  594. __le16 listen_interval;
  595. __le16 beacon_period;
  596. u8 dtim_period;
  597. } __packed;
  598. struct ieee_types_assoc_rsp {
  599. __le16 cap_info_bitmap;
  600. __le16 status_code;
  601. __le16 a_id;
  602. u8 ie_buffer[1];
  603. } __packed;
  604. struct host_cmd_ds_802_11_associate_rsp {
  605. struct ieee_types_assoc_rsp assoc_rsp;
  606. } __packed;
  607. struct ieee_types_cf_param_set {
  608. u8 element_id;
  609. u8 len;
  610. u8 cfp_cnt;
  611. u8 cfp_period;
  612. u16 cfp_max_duration;
  613. u16 cfp_duration_remaining;
  614. } __packed;
  615. struct ieee_types_ibss_param_set {
  616. u8 element_id;
  617. u8 len;
  618. __le16 atim_window;
  619. } __packed;
  620. union ieee_types_ss_param_set {
  621. struct ieee_types_cf_param_set cf_param_set;
  622. struct ieee_types_ibss_param_set ibss_param_set;
  623. } __packed;
  624. struct ieee_types_fh_param_set {
  625. u8 element_id;
  626. u8 len;
  627. __le16 dwell_time;
  628. u8 hop_set;
  629. u8 hop_pattern;
  630. u8 hop_index;
  631. } __packed;
  632. struct ieee_types_ds_param_set {
  633. u8 element_id;
  634. u8 len;
  635. u8 current_chan;
  636. } __packed;
  637. union ieee_types_phy_param_set {
  638. struct ieee_types_fh_param_set fh_param_set;
  639. struct ieee_types_ds_param_set ds_param_set;
  640. } __packed;
  641. struct host_cmd_ds_802_11_ad_hoc_start {
  642. u8 ssid[IEEE80211_MAX_SSID_LEN];
  643. u8 bss_mode;
  644. __le16 beacon_period;
  645. u8 dtim_period;
  646. union ieee_types_ss_param_set ss_param_set;
  647. union ieee_types_phy_param_set phy_param_set;
  648. u16 reserved1;
  649. __le16 cap_info_bitmap;
  650. u8 DataRate[HOSTCMD_SUPPORTED_RATES];
  651. } __packed;
  652. struct host_cmd_ds_802_11_ad_hoc_result {
  653. u8 pad[3];
  654. u8 bssid[ETH_ALEN];
  655. } __packed;
  656. struct adhoc_bss_desc {
  657. u8 bssid[ETH_ALEN];
  658. u8 ssid[IEEE80211_MAX_SSID_LEN];
  659. u8 bss_mode;
  660. __le16 beacon_period;
  661. u8 dtim_period;
  662. u8 time_stamp[8];
  663. u8 local_time[8];
  664. union ieee_types_phy_param_set phy_param_set;
  665. union ieee_types_ss_param_set ss_param_set;
  666. __le16 cap_info_bitmap;
  667. u8 data_rates[HOSTCMD_SUPPORTED_RATES];
  668. /*
  669. * DO NOT ADD ANY FIELDS TO THIS STRUCTURE.
  670. * It is used in the Adhoc join command and will cause a
  671. * binary layout mismatch with the firmware
  672. */
  673. } __packed;
  674. struct host_cmd_ds_802_11_ad_hoc_join {
  675. struct adhoc_bss_desc bss_descriptor;
  676. u16 reserved1;
  677. u16 reserved2;
  678. } __packed;
  679. struct host_cmd_ds_802_11_get_log {
  680. __le32 mcast_tx_frame;
  681. __le32 failed;
  682. __le32 retry;
  683. __le32 multi_retry;
  684. __le32 frame_dup;
  685. __le32 rts_success;
  686. __le32 rts_failure;
  687. __le32 ack_failure;
  688. __le32 rx_frag;
  689. __le32 mcast_rx_frame;
  690. __le32 fcs_error;
  691. __le32 tx_frame;
  692. __le32 reserved;
  693. __le32 wep_icv_err_cnt[4];
  694. };
  695. struct host_cmd_ds_tx_rate_query {
  696. u8 tx_rate;
  697. /* Ht Info [Bit 0] RxRate format: LG=0, HT=1
  698. * [Bit 1] HT Bandwidth: BW20 = 0, BW40 = 1
  699. * [Bit 2] HT Guard Interval: LGI = 0, SGI = 1 */
  700. u8 ht_info;
  701. } __packed;
  702. enum Host_Sleep_Action {
  703. HS_CONFIGURE = 0x0001,
  704. HS_ACTIVATE = 0x0002,
  705. };
  706. struct mwifiex_hs_config_param {
  707. __le32 conditions;
  708. u8 gpio;
  709. u8 gap;
  710. } __packed;
  711. struct hs_activate_param {
  712. u16 resp_ctrl;
  713. } __packed;
  714. struct host_cmd_ds_802_11_hs_cfg_enh {
  715. __le16 action;
  716. union {
  717. struct mwifiex_hs_config_param hs_config;
  718. struct hs_activate_param hs_activate;
  719. } params;
  720. } __packed;
  721. enum SNMP_MIB_INDEX {
  722. OP_RATE_SET_I = 1,
  723. DTIM_PERIOD_I = 3,
  724. RTS_THRESH_I = 5,
  725. SHORT_RETRY_LIM_I = 6,
  726. LONG_RETRY_LIM_I = 7,
  727. FRAG_THRESH_I = 8,
  728. DOT11D_I = 9,
  729. };
  730. #define MAX_SNMP_BUF_SIZE 128
  731. struct host_cmd_ds_802_11_snmp_mib {
  732. __le16 query_type;
  733. __le16 oid;
  734. __le16 buf_size;
  735. u8 value[1];
  736. } __packed;
  737. struct mwifiex_rate_scope {
  738. __le16 type;
  739. __le16 length;
  740. __le16 hr_dsss_rate_bitmap;
  741. __le16 ofdm_rate_bitmap;
  742. __le16 ht_mcs_rate_bitmap[8];
  743. } __packed;
  744. struct mwifiex_rate_drop_pattern {
  745. __le16 type;
  746. __le16 length;
  747. __le32 rate_drop_mode;
  748. } __packed;
  749. struct host_cmd_ds_tx_rate_cfg {
  750. __le16 action;
  751. __le16 cfg_index;
  752. } __packed;
  753. struct mwifiex_power_group {
  754. u8 modulation_class;
  755. u8 first_rate_code;
  756. u8 last_rate_code;
  757. s8 power_step;
  758. s8 power_min;
  759. s8 power_max;
  760. u8 ht_bandwidth;
  761. u8 reserved;
  762. } __packed;
  763. struct mwifiex_types_power_group {
  764. u16 type;
  765. u16 length;
  766. } __packed;
  767. struct host_cmd_ds_txpwr_cfg {
  768. __le16 action;
  769. __le16 cfg_index;
  770. __le32 mode;
  771. } __packed;
  772. #define MWIFIEX_USER_SCAN_CHAN_MAX 50
  773. #define MWIFIEX_MAX_SSID_LIST_LENGTH 10
  774. struct mwifiex_scan_cmd_config {
  775. /*
  776. * BSS Type to be sent in the firmware command
  777. *
  778. * Field can be used to restrict the types of networks returned in the
  779. * scan. Valid settings are:
  780. *
  781. * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
  782. * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
  783. * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
  784. */
  785. u8 bss_mode;
  786. /* Specific BSSID used to filter scan results in the firmware */
  787. u8 specific_bssid[ETH_ALEN];
  788. /* Length of TLVs sent in command starting at tlvBuffer */
  789. u32 tlv_buf_len;
  790. /*
  791. * SSID TLV(s) and ChanList TLVs to be sent in the firmware command
  792. *
  793. * TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
  794. * WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
  795. */
  796. u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
  797. here */
  798. } __packed;
  799. struct mwifiex_user_scan_chan {
  800. u8 chan_number;
  801. u8 radio_type;
  802. u8 scan_type;
  803. u8 reserved;
  804. u32 scan_time;
  805. } __packed;
  806. struct mwifiex_user_scan_ssid {
  807. u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
  808. u8 max_len;
  809. } __packed;
  810. struct mwifiex_user_scan_cfg {
  811. /*
  812. * Flag set to keep the previous scan table intact
  813. *
  814. * If set, the scan results will accumulate, replacing any previous
  815. * matched entries for a BSS with the new scan data
  816. */
  817. u8 keep_previous_scan;
  818. /*
  819. * BSS mode to be sent in the firmware command
  820. *
  821. * Field can be used to restrict the types of networks returned in the
  822. * scan. Valid settings are:
  823. *
  824. * - MWIFIEX_SCAN_MODE_BSS (infrastructure)
  825. * - MWIFIEX_SCAN_MODE_IBSS (adhoc)
  826. * - MWIFIEX_SCAN_MODE_ANY (unrestricted, adhoc and infrastructure)
  827. */
  828. u8 bss_mode;
  829. /* Configure the number of probe requests for active chan scans */
  830. u8 num_probes;
  831. u8 reserved;
  832. /* BSSID filter sent in the firmware command to limit the results */
  833. u8 specific_bssid[ETH_ALEN];
  834. /* SSID filter list used in the to limit the scan results */
  835. struct mwifiex_user_scan_ssid ssid_list[MWIFIEX_MAX_SSID_LIST_LENGTH];
  836. /* Variable number (fixed maximum) of channels to scan up */
  837. struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX];
  838. } __packed;
  839. struct ie_body {
  840. u8 grp_key_oui[4];
  841. u8 ptk_cnt[2];
  842. u8 ptk_body[4];
  843. } __packed;
  844. struct host_cmd_ds_802_11_scan {
  845. u8 bss_mode;
  846. u8 bssid[ETH_ALEN];
  847. u8 tlv_buffer[1];
  848. } __packed;
  849. struct host_cmd_ds_802_11_scan_rsp {
  850. __le16 bss_descript_size;
  851. u8 number_of_sets;
  852. u8 bss_desc_and_tlv_buffer[1];
  853. } __packed;
  854. struct host_cmd_ds_802_11_bg_scan_query {
  855. u8 flush;
  856. } __packed;
  857. struct host_cmd_ds_802_11_bg_scan_query_rsp {
  858. u32 report_condition;
  859. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  860. } __packed;
  861. struct mwifiex_ietypes_domain_param_set {
  862. struct mwifiex_ie_types_header header;
  863. u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
  864. struct ieee80211_country_ie_triplet triplet[1];
  865. } __packed;
  866. struct host_cmd_ds_802_11d_domain_info {
  867. __le16 action;
  868. struct mwifiex_ietypes_domain_param_set domain;
  869. } __packed;
  870. struct host_cmd_ds_802_11d_domain_info_rsp {
  871. __le16 action;
  872. struct mwifiex_ietypes_domain_param_set domain;
  873. } __packed;
  874. struct host_cmd_ds_11n_addba_req {
  875. u8 add_req_result;
  876. u8 peer_mac_addr[ETH_ALEN];
  877. u8 dialog_token;
  878. __le16 block_ack_param_set;
  879. __le16 block_ack_tmo;
  880. __le16 ssn;
  881. } __packed;
  882. struct host_cmd_ds_11n_addba_rsp {
  883. u8 add_rsp_result;
  884. u8 peer_mac_addr[ETH_ALEN];
  885. u8 dialog_token;
  886. __le16 status_code;
  887. __le16 block_ack_param_set;
  888. __le16 block_ack_tmo;
  889. __le16 ssn;
  890. } __packed;
  891. struct host_cmd_ds_11n_delba {
  892. u8 del_result;
  893. u8 peer_mac_addr[ETH_ALEN];
  894. __le16 del_ba_param_set;
  895. __le16 reason_code;
  896. u8 reserved;
  897. } __packed;
  898. struct host_cmd_ds_11n_batimeout {
  899. u8 tid;
  900. u8 peer_mac_addr[ETH_ALEN];
  901. u8 origninator;
  902. } __packed;
  903. struct host_cmd_ds_11n_cfg {
  904. __le16 action;
  905. __le16 ht_tx_cap;
  906. __le16 ht_tx_info;
  907. } __packed;
  908. struct host_cmd_ds_txbuf_cfg {
  909. __le16 action;
  910. __le16 buff_size;
  911. __le16 mp_end_port; /* SDIO only, reserved for other interfacces */
  912. __le16 reserved3;
  913. } __packed;
  914. struct host_cmd_ds_amsdu_aggr_ctrl {
  915. __le16 action;
  916. __le16 enable;
  917. __le16 curr_buf_size;
  918. } __packed;
  919. struct mwifiex_ie_types_wmm_param_set {
  920. struct mwifiex_ie_types_header header;
  921. u8 wmm_ie[1];
  922. };
  923. struct mwifiex_ie_types_wmm_queue_status {
  924. struct mwifiex_ie_types_header header;
  925. u8 queue_index;
  926. u8 disabled;
  927. u16 medium_time;
  928. u8 flow_required;
  929. u8 flow_created;
  930. u32 reserved;
  931. };
  932. struct ieee_types_vendor_header {
  933. u8 element_id;
  934. u8 len;
  935. u8 oui[3];
  936. u8 oui_type;
  937. u8 oui_subtype;
  938. u8 version;
  939. } __packed;
  940. struct ieee_types_wmm_ac_parameters {
  941. u8 aci_aifsn_bitmap;
  942. u8 ecw_bitmap;
  943. __le16 tx_op_limit;
  944. } __packed;
  945. struct ieee_types_wmm_parameter {
  946. /*
  947. * WMM Parameter IE - Vendor Specific Header:
  948. * element_id [221/0xdd]
  949. * Len [24]
  950. * Oui [00:50:f2]
  951. * OuiType [2]
  952. * OuiSubType [1]
  953. * Version [1]
  954. */
  955. struct ieee_types_vendor_header vend_hdr;
  956. u8 qos_info_bitmap;
  957. u8 reserved;
  958. struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_MAX_QUEUES];
  959. } __packed;
  960. struct ieee_types_wmm_info {
  961. /*
  962. * WMM Info IE - Vendor Specific Header:
  963. * element_id [221/0xdd]
  964. * Len [7]
  965. * Oui [00:50:f2]
  966. * OuiType [2]
  967. * OuiSubType [0]
  968. * Version [1]
  969. */
  970. struct ieee_types_vendor_header vend_hdr;
  971. u8 qos_info_bitmap;
  972. } __packed;
  973. struct host_cmd_ds_wmm_get_status {
  974. u8 queue_status_tlv[sizeof(struct mwifiex_ie_types_wmm_queue_status) *
  975. IEEE80211_MAX_QUEUES];
  976. u8 wmm_param_tlv[sizeof(struct ieee_types_wmm_parameter) + 2];
  977. } __packed;
  978. struct mwifiex_wmm_ac_status {
  979. u8 disabled;
  980. u8 flow_required;
  981. u8 flow_created;
  982. };
  983. struct mwifiex_ie_types_htcap {
  984. struct mwifiex_ie_types_header header;
  985. struct ieee80211_ht_cap ht_cap;
  986. } __packed;
  987. struct mwifiex_ie_types_htinfo {
  988. struct mwifiex_ie_types_header header;
  989. struct ieee80211_ht_info ht_info;
  990. } __packed;
  991. struct mwifiex_ie_types_2040bssco {
  992. struct mwifiex_ie_types_header header;
  993. u8 bss_co_2040;
  994. } __packed;
  995. struct mwifiex_ie_types_extcap {
  996. struct mwifiex_ie_types_header header;
  997. u8 ext_cap;
  998. } __packed;
  999. struct host_cmd_ds_mac_reg_access {
  1000. __le16 action;
  1001. __le16 offset;
  1002. __le32 value;
  1003. } __packed;
  1004. struct host_cmd_ds_bbp_reg_access {
  1005. __le16 action;
  1006. __le16 offset;
  1007. u8 value;
  1008. u8 reserved[3];
  1009. } __packed;
  1010. struct host_cmd_ds_rf_reg_access {
  1011. __le16 action;
  1012. __le16 offset;
  1013. u8 value;
  1014. u8 reserved[3];
  1015. } __packed;
  1016. struct host_cmd_ds_pmic_reg_access {
  1017. __le16 action;
  1018. __le16 offset;
  1019. u8 value;
  1020. u8 reserved[3];
  1021. } __packed;
  1022. struct host_cmd_ds_802_11_eeprom_access {
  1023. __le16 action;
  1024. __le16 offset;
  1025. __le16 byte_count;
  1026. u8 value;
  1027. } __packed;
  1028. struct host_cmd_ds_802_11_rf_channel {
  1029. __le16 action;
  1030. __le16 current_channel;
  1031. __le16 rf_type;
  1032. __le16 reserved;
  1033. u8 reserved_1[32];
  1034. } __packed;
  1035. struct host_cmd_ds_version_ext {
  1036. u8 version_str_sel;
  1037. char version_str[128];
  1038. } __packed;
  1039. struct host_cmd_ds_802_11_ibss_status {
  1040. __le16 action;
  1041. __le16 enable;
  1042. u8 bssid[ETH_ALEN];
  1043. __le16 beacon_interval;
  1044. __le16 atim_window;
  1045. __le16 use_g_rate_protect;
  1046. } __packed;
  1047. #define CONNECTION_TYPE_INFRA 0
  1048. #define CONNECTION_TYPE_ADHOC 1
  1049. struct host_cmd_ds_set_bss_mode {
  1050. u8 con_type;
  1051. } __packed;
  1052. struct host_cmd_ds_command {
  1053. __le16 command;
  1054. __le16 size;
  1055. __le16 seq_num;
  1056. __le16 result;
  1057. union {
  1058. struct host_cmd_ds_get_hw_spec hw_spec;
  1059. struct host_cmd_ds_mac_control mac_ctrl;
  1060. struct host_cmd_ds_802_11_mac_address mac_addr;
  1061. struct host_cmd_ds_mac_multicast_adr mc_addr;
  1062. struct host_cmd_ds_802_11_get_log get_log;
  1063. struct host_cmd_ds_802_11_rssi_info rssi_info;
  1064. struct host_cmd_ds_802_11_rssi_info_rsp rssi_info_rsp;
  1065. struct host_cmd_ds_802_11_snmp_mib smib;
  1066. struct host_cmd_ds_802_11_rf_channel rf_channel;
  1067. struct host_cmd_ds_tx_rate_query tx_rate;
  1068. struct host_cmd_ds_tx_rate_cfg tx_rate_cfg;
  1069. struct host_cmd_ds_txpwr_cfg txp_cfg;
  1070. struct host_cmd_ds_802_11_ps_mode_enh psmode_enh;
  1071. struct host_cmd_ds_802_11_hs_cfg_enh opt_hs_cfg;
  1072. struct host_cmd_ds_802_11_scan scan;
  1073. struct host_cmd_ds_802_11_scan_rsp scan_resp;
  1074. struct host_cmd_ds_802_11_bg_scan_query bg_scan_query;
  1075. struct host_cmd_ds_802_11_bg_scan_query_rsp bg_scan_query_resp;
  1076. struct host_cmd_ds_802_11_associate associate;
  1077. struct host_cmd_ds_802_11_associate_rsp associate_rsp;
  1078. struct host_cmd_ds_802_11_deauthenticate deauth;
  1079. struct host_cmd_ds_802_11_ad_hoc_start adhoc_start;
  1080. struct host_cmd_ds_802_11_ad_hoc_result adhoc_result;
  1081. struct host_cmd_ds_802_11_ad_hoc_join adhoc_join;
  1082. struct host_cmd_ds_802_11d_domain_info domain_info;
  1083. struct host_cmd_ds_802_11d_domain_info_rsp domain_info_resp;
  1084. struct host_cmd_ds_11n_addba_req add_ba_req;
  1085. struct host_cmd_ds_11n_addba_rsp add_ba_rsp;
  1086. struct host_cmd_ds_11n_delba del_ba;
  1087. struct host_cmd_ds_txbuf_cfg tx_buf;
  1088. struct host_cmd_ds_amsdu_aggr_ctrl amsdu_aggr_ctrl;
  1089. struct host_cmd_ds_11n_cfg htcfg;
  1090. struct host_cmd_ds_wmm_get_status get_wmm_status;
  1091. struct host_cmd_ds_802_11_key_material key_material;
  1092. struct host_cmd_ds_version_ext verext;
  1093. struct host_cmd_ds_802_11_ibss_status ibss_coalescing;
  1094. struct host_cmd_ds_mac_reg_access mac_reg;
  1095. struct host_cmd_ds_bbp_reg_access bbp_reg;
  1096. struct host_cmd_ds_rf_reg_access rf_reg;
  1097. struct host_cmd_ds_pmic_reg_access pmic_reg;
  1098. struct host_cmd_ds_set_bss_mode bss_mode;
  1099. struct host_cmd_ds_802_11_eeprom_access eeprom;
  1100. } params;
  1101. } __packed;
  1102. struct mwifiex_opt_sleep_confirm {
  1103. __le16 command;
  1104. __le16 size;
  1105. __le16 seq_num;
  1106. __le16 result;
  1107. __le16 action;
  1108. struct sleep_confirm_param sleep_cfm;
  1109. } __packed;
  1110. struct mwifiex_opt_sleep_confirm_buffer {
  1111. u8 hdr[4];
  1112. struct mwifiex_opt_sleep_confirm ps_cfm_sleep;
  1113. } __packed;
  1114. #endif /* !_MWIFIEX_FW_H_ */