wmi.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024
  1. /*
  2. * Copyright (c) 2010-2011 Atheros Communications Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /*
  17. * This file contains the definitions of the WMI protocol specified in the
  18. * Wireless Module Interface (WMI). It includes definitions of all the
  19. * commands and events. Commands are messages from the host to the WM.
  20. * Events and Replies are messages from the WM to the host.
  21. */
  22. #ifndef WMI_H
  23. #define WMI_H
  24. #include <linux/ieee80211.h>
  25. #include "htc.h"
  26. #define HTC_PROTOCOL_VERSION 0x0002
  27. #define WMI_PROTOCOL_VERSION 0x0002
  28. #define WMI_CONTROL_MSG_MAX_LEN 256
  29. #define is_ethertype(type_or_len) ((type_or_len) >= 0x0600)
  30. #define IP_ETHERTYPE 0x0800
  31. #define WMI_IMPLICIT_PSTREAM 0xFF
  32. #define WMI_MAX_THINSTREAM 15
  33. #define SSID_IE_LEN_INDEX 13
  34. /* Host side link management data structures */
  35. #define SIG_QUALITY_THRESH_LVLS 6
  36. #define SIG_QUALITY_UPPER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  37. #define SIG_QUALITY_LOWER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  38. #define A_BAND_24GHZ 0
  39. #define A_BAND_5GHZ 1
  40. #define A_NUM_BANDS 2
  41. /* in ms */
  42. #define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000
  43. /*
  44. * There are no signed versions of __le16 and __le32, so for a temporary
  45. * solution come up with our own version. The idea is from fs/ntfs/types.h.
  46. *
  47. * Use a_ prefix so that it doesn't conflict if we get proper support to
  48. * linux/types.h.
  49. */
  50. typedef __s16 __bitwise a_sle16;
  51. typedef __s32 __bitwise a_sle32;
  52. static inline a_sle32 a_cpu_to_sle32(s32 val)
  53. {
  54. return (__force a_sle32) cpu_to_le32(val);
  55. }
  56. static inline s32 a_sle32_to_cpu(a_sle32 val)
  57. {
  58. return le32_to_cpu((__force __le32) val);
  59. }
  60. static inline a_sle16 a_cpu_to_sle16(s16 val)
  61. {
  62. return (__force a_sle16) cpu_to_le16(val);
  63. }
  64. static inline s16 a_sle16_to_cpu(a_sle16 val)
  65. {
  66. return le16_to_cpu((__force __le16) val);
  67. }
  68. struct sq_threshold_params {
  69. s16 upper_threshold[SIG_QUALITY_UPPER_THRESH_LVLS];
  70. s16 lower_threshold[SIG_QUALITY_LOWER_THRESH_LVLS];
  71. u32 upper_threshold_valid_count;
  72. u32 lower_threshold_valid_count;
  73. u32 polling_interval;
  74. u8 weight;
  75. u8 last_rssi;
  76. u8 last_rssi_poll_event;
  77. };
  78. struct wmi_stats {
  79. u32 cmd_len_err;
  80. u32 cmd_id_err;
  81. };
  82. struct wmi_data_sync_bufs {
  83. u8 traffic_class;
  84. struct sk_buff *skb;
  85. };
  86. /* WMM stream classes */
  87. #define WMM_NUM_AC 4
  88. #define WMM_AC_BE 0 /* best effort */
  89. #define WMM_AC_BK 1 /* background */
  90. #define WMM_AC_VI 2 /* video */
  91. #define WMM_AC_VO 3 /* voice */
  92. struct wmi {
  93. bool ready;
  94. u16 stream_exist_for_ac[WMM_NUM_AC];
  95. u8 fat_pipe_exist;
  96. void *parent_dev;
  97. struct wmi_stats stat;
  98. struct ath6kl_node_table scan_table;
  99. u8 bssid[ETH_ALEN];
  100. u8 pwr_mode;
  101. u8 phy_mode;
  102. u8 keep_alive_intvl;
  103. spinlock_t lock;
  104. enum htc_endpoint_id ep_id;
  105. struct sq_threshold_params
  106. sq_threshld[SIGNAL_QUALITY_METRICS_NUM_MAX];
  107. enum crypto_type pair_crypto_type;
  108. enum crypto_type grp_crypto_type;
  109. bool is_wmm_enabled;
  110. u8 ht_allowed[A_NUM_BANDS];
  111. u8 traffic_class;
  112. bool is_probe_ssid;
  113. };
  114. struct host_app_area {
  115. u32 wmi_protocol_ver;
  116. };
  117. enum wmi_msg_type {
  118. DATA_MSGTYPE = 0x0,
  119. CNTL_MSGTYPE,
  120. SYNC_MSGTYPE,
  121. OPT_MSGTYPE,
  122. };
  123. /*
  124. * Macros for operating on WMI_DATA_HDR (info) field
  125. */
  126. #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
  127. #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
  128. #define WMI_DATA_HDR_UP_MASK 0x07
  129. #define WMI_DATA_HDR_UP_SHIFT 2
  130. /* In AP mode, the same bit (b5) is used to indicate Power save state in
  131. * the Rx dir and More data bit state in the tx direction.
  132. */
  133. #define WMI_DATA_HDR_PS_MASK 0x1
  134. #define WMI_DATA_HDR_PS_SHIFT 5
  135. #define WMI_DATA_HDR_MORE_MASK 0x1
  136. #define WMI_DATA_HDR_MORE_SHIFT 5
  137. enum wmi_data_hdr_data_type {
  138. WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
  139. WMI_DATA_HDR_DATA_TYPE_802_11,
  140. /* used to be used for the PAL */
  141. WMI_DATA_HDR_DATA_TYPE_ACL,
  142. };
  143. #define WMI_DATA_HDR_DATA_TYPE_MASK 0x3
  144. #define WMI_DATA_HDR_DATA_TYPE_SHIFT 6
  145. /* Macros for operating on WMI_DATA_HDR (info2) field */
  146. #define WMI_DATA_HDR_SEQNO_MASK 0xFFF
  147. #define WMI_DATA_HDR_SEQNO_SHIFT 0
  148. #define WMI_DATA_HDR_AMSDU_MASK 0x1
  149. #define WMI_DATA_HDR_AMSDU_SHIFT 12
  150. #define WMI_DATA_HDR_META_MASK 0x7
  151. #define WMI_DATA_HDR_META_SHIFT 13
  152. struct wmi_data_hdr {
  153. s8 rssi;
  154. /*
  155. * usage of 'info' field(8-bit):
  156. *
  157. * b1:b0 - WMI_MSG_TYPE
  158. * b4:b3:b2 - UP(tid)
  159. * b5 - Used in AP mode.
  160. * More-data in tx dir, PS in rx.
  161. * b7:b6 - Dot3 header(0),
  162. * Dot11 Header(1),
  163. * ACL data(2)
  164. */
  165. u8 info;
  166. /*
  167. * usage of 'info2' field(16-bit):
  168. *
  169. * b11:b0 - seq_no
  170. * b12 - A-MSDU?
  171. * b15:b13 - META_DATA_VERSION 0 - 7
  172. */
  173. __le16 info2;
  174. __le16 info3;
  175. } __packed;
  176. static inline u8 wmi_data_hdr_get_up(struct wmi_data_hdr *dhdr)
  177. {
  178. return (dhdr->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK;
  179. }
  180. static inline void wmi_data_hdr_set_up(struct wmi_data_hdr *dhdr,
  181. u8 usr_pri)
  182. {
  183. dhdr->info &= ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT);
  184. dhdr->info |= usr_pri << WMI_DATA_HDR_UP_SHIFT;
  185. }
  186. static inline u8 wmi_data_hdr_get_dot11(struct wmi_data_hdr *dhdr)
  187. {
  188. u8 data_type;
  189. data_type = (dhdr->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) &
  190. WMI_DATA_HDR_DATA_TYPE_MASK;
  191. return (data_type == WMI_DATA_HDR_DATA_TYPE_802_11);
  192. }
  193. static inline u16 wmi_data_hdr_get_seqno(struct wmi_data_hdr *dhdr)
  194. {
  195. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_SEQNO_SHIFT) &
  196. WMI_DATA_HDR_SEQNO_MASK;
  197. }
  198. static inline u8 wmi_data_hdr_is_amsdu(struct wmi_data_hdr *dhdr)
  199. {
  200. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_AMSDU_SHIFT) &
  201. WMI_DATA_HDR_AMSDU_MASK;
  202. }
  203. static inline u8 wmi_data_hdr_get_meta(struct wmi_data_hdr *dhdr)
  204. {
  205. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_META_SHIFT) &
  206. WMI_DATA_HDR_META_MASK;
  207. }
  208. /* Tx meta version definitions */
  209. #define WMI_MAX_TX_META_SZ 12
  210. #define WMI_META_VERSION_1 0x01
  211. #define WMI_META_VERSION_2 0x02
  212. struct wmi_tx_meta_v1 {
  213. /* packet ID to identify the tx request */
  214. u8 pkt_id;
  215. /* rate policy to be used for the tx of this frame */
  216. u8 rate_plcy_id;
  217. } __packed;
  218. struct wmi_tx_meta_v2 {
  219. /*
  220. * Offset from start of the WMI header for csum calculation to
  221. * begin.
  222. */
  223. u8 csum_start;
  224. /* offset from start of WMI header where final csum goes */
  225. u8 csum_dest;
  226. /* no of bytes over which csum is calculated */
  227. u8 csum_flags;
  228. } __packed;
  229. struct wmi_rx_meta_v1 {
  230. u8 status;
  231. /* rate index mapped to rate at which this packet was received. */
  232. u8 rix;
  233. /* rssi of packet */
  234. u8 rssi;
  235. /* rf channel during packet reception */
  236. u8 channel;
  237. __le16 flags;
  238. } __packed;
  239. struct wmi_rx_meta_v2 {
  240. __le16 csum;
  241. /* bit 0 set -partial csum valid bit 1 set -test mode */
  242. u8 csum_flags;
  243. } __packed;
  244. /* Control Path */
  245. struct wmi_cmd_hdr {
  246. __le16 cmd_id;
  247. /* info1 - 16 bits
  248. * b03:b00 - id
  249. * b15:b04 - unused */
  250. __le16 info1;
  251. /* for alignment */
  252. __le16 reserved;
  253. } __packed;
  254. /* List of WMI commands */
  255. enum wmi_cmd_id {
  256. WMI_CONNECT_CMDID = 0x0001,
  257. WMI_RECONNECT_CMDID,
  258. WMI_DISCONNECT_CMDID,
  259. WMI_SYNCHRONIZE_CMDID,
  260. WMI_CREATE_PSTREAM_CMDID,
  261. WMI_DELETE_PSTREAM_CMDID,
  262. WMI_START_SCAN_CMDID,
  263. WMI_SET_SCAN_PARAMS_CMDID,
  264. WMI_SET_BSS_FILTER_CMDID,
  265. WMI_SET_PROBED_SSID_CMDID, /* 10 */
  266. WMI_SET_LISTEN_INT_CMDID,
  267. WMI_SET_BMISS_TIME_CMDID,
  268. WMI_SET_DISC_TIMEOUT_CMDID,
  269. WMI_GET_CHANNEL_LIST_CMDID,
  270. WMI_SET_BEACON_INT_CMDID,
  271. WMI_GET_STATISTICS_CMDID,
  272. WMI_SET_CHANNEL_PARAMS_CMDID,
  273. WMI_SET_POWER_MODE_CMDID,
  274. WMI_SET_IBSS_PM_CAPS_CMDID,
  275. WMI_SET_POWER_PARAMS_CMDID, /* 20 */
  276. WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
  277. WMI_ADD_CIPHER_KEY_CMDID,
  278. WMI_DELETE_CIPHER_KEY_CMDID,
  279. WMI_ADD_KRK_CMDID,
  280. WMI_DELETE_KRK_CMDID,
  281. WMI_SET_PMKID_CMDID,
  282. WMI_SET_TX_PWR_CMDID,
  283. WMI_GET_TX_PWR_CMDID,
  284. WMI_SET_ASSOC_INFO_CMDID,
  285. WMI_ADD_BAD_AP_CMDID, /* 30 */
  286. WMI_DELETE_BAD_AP_CMDID,
  287. WMI_SET_TKIP_COUNTERMEASURES_CMDID,
  288. WMI_RSSI_THRESHOLD_PARAMS_CMDID,
  289. WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
  290. WMI_SET_ACCESS_PARAMS_CMDID,
  291. WMI_SET_RETRY_LIMITS_CMDID,
  292. WMI_SET_OPT_MODE_CMDID,
  293. WMI_OPT_TX_FRAME_CMDID,
  294. WMI_SET_VOICE_PKT_SIZE_CMDID,
  295. WMI_SET_MAX_SP_LEN_CMDID, /* 40 */
  296. WMI_SET_ROAM_CTRL_CMDID,
  297. WMI_GET_ROAM_TBL_CMDID,
  298. WMI_GET_ROAM_DATA_CMDID,
  299. WMI_ENABLE_RM_CMDID,
  300. WMI_SET_MAX_OFFHOME_DURATION_CMDID,
  301. WMI_EXTENSION_CMDID, /* Non-wireless extensions */
  302. WMI_SNR_THRESHOLD_PARAMS_CMDID,
  303. WMI_LQ_THRESHOLD_PARAMS_CMDID,
  304. WMI_SET_LPREAMBLE_CMDID,
  305. WMI_SET_RTS_CMDID, /* 50 */
  306. WMI_CLR_RSSI_SNR_CMDID,
  307. WMI_SET_FIXRATES_CMDID,
  308. WMI_GET_FIXRATES_CMDID,
  309. WMI_SET_AUTH_MODE_CMDID,
  310. WMI_SET_REASSOC_MODE_CMDID,
  311. WMI_SET_WMM_CMDID,
  312. WMI_SET_WMM_TXOP_CMDID,
  313. WMI_TEST_CMDID,
  314. /* COEX AR6002 only */
  315. WMI_SET_BT_STATUS_CMDID,
  316. WMI_SET_BT_PARAMS_CMDID, /* 60 */
  317. WMI_SET_KEEPALIVE_CMDID,
  318. WMI_GET_KEEPALIVE_CMDID,
  319. WMI_SET_APPIE_CMDID,
  320. WMI_GET_APPIE_CMDID,
  321. WMI_SET_WSC_STATUS_CMDID,
  322. /* Wake on Wireless */
  323. WMI_SET_HOST_SLEEP_MODE_CMDID,
  324. WMI_SET_WOW_MODE_CMDID,
  325. WMI_GET_WOW_LIST_CMDID,
  326. WMI_ADD_WOW_PATTERN_CMDID,
  327. WMI_DEL_WOW_PATTERN_CMDID, /* 70 */
  328. WMI_SET_FRAMERATES_CMDID,
  329. WMI_SET_AP_PS_CMDID,
  330. WMI_SET_QOS_SUPP_CMDID,
  331. /* WMI_THIN_RESERVED_... mark the start and end
  332. * values for WMI_THIN_RESERVED command IDs. These
  333. * command IDs can be found in wmi_thin.h */
  334. WMI_THIN_RESERVED_START = 0x8000,
  335. WMI_THIN_RESERVED_END = 0x8fff,
  336. /* Developer commands starts at 0xF000 */
  337. WMI_SET_BITRATE_CMDID = 0xF000,
  338. WMI_GET_BITRATE_CMDID,
  339. WMI_SET_WHALPARAM_CMDID,
  340. WMI_SET_MAC_ADDRESS_CMDID,
  341. WMI_SET_AKMP_PARAMS_CMDID,
  342. WMI_SET_PMKID_LIST_CMDID,
  343. WMI_GET_PMKID_LIST_CMDID,
  344. WMI_ABORT_SCAN_CMDID,
  345. WMI_SET_TARGET_EVENT_REPORT_CMDID,
  346. /* Unused */
  347. WMI_UNUSED1,
  348. WMI_UNUSED2,
  349. /* AP mode commands */
  350. WMI_AP_HIDDEN_SSID_CMDID,
  351. WMI_AP_SET_NUM_STA_CMDID,
  352. WMI_AP_ACL_POLICY_CMDID,
  353. WMI_AP_ACL_MAC_LIST_CMDID,
  354. WMI_AP_CONFIG_COMMIT_CMDID,
  355. WMI_AP_SET_MLME_CMDID,
  356. WMI_AP_SET_PVB_CMDID,
  357. WMI_AP_CONN_INACT_CMDID,
  358. WMI_AP_PROT_SCAN_TIME_CMDID,
  359. WMI_AP_SET_COUNTRY_CMDID,
  360. WMI_AP_SET_DTIM_CMDID,
  361. WMI_AP_MODE_STAT_CMDID,
  362. WMI_SET_IP_CMDID,
  363. WMI_SET_PARAMS_CMDID,
  364. WMI_SET_MCAST_FILTER_CMDID,
  365. WMI_DEL_MCAST_FILTER_CMDID,
  366. WMI_ALLOW_AGGR_CMDID,
  367. WMI_ADDBA_REQ_CMDID,
  368. WMI_DELBA_REQ_CMDID,
  369. WMI_SET_HT_CAP_CMDID,
  370. WMI_SET_HT_OP_CMDID,
  371. WMI_SET_TX_SELECT_RATES_CMDID,
  372. WMI_SET_TX_SGI_PARAM_CMDID,
  373. WMI_SET_RATE_POLICY_CMDID,
  374. WMI_HCI_CMD_CMDID,
  375. WMI_RX_FRAME_FORMAT_CMDID,
  376. WMI_SET_THIN_MODE_CMDID,
  377. WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
  378. WMI_AP_SET_11BG_RATESET_CMDID,
  379. WMI_SET_PMK_CMDID,
  380. WMI_MCAST_FILTER_CMDID,
  381. /* COEX CMDID AR6003 */
  382. WMI_SET_BTCOEX_FE_ANT_CMDID,
  383. WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
  384. WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
  385. WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
  386. WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
  387. WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
  388. WMI_SET_BTCOEX_DEBUG_CMDID,
  389. WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
  390. WMI_GET_BTCOEX_STATS_CMDID,
  391. WMI_GET_BTCOEX_CONFIG_CMDID,
  392. WMI_SET_DFS_ENABLE_CMDID, /* F034 */
  393. WMI_SET_DFS_MINRSSITHRESH_CMDID,
  394. WMI_SET_DFS_MAXPULSEDUR_CMDID,
  395. WMI_DFS_RADAR_DETECTED_CMDID,
  396. /* P2P commands */
  397. WMI_P2P_SET_CONFIG_CMDID, /* F038 */
  398. WMI_WPS_SET_CONFIG_CMDID,
  399. WMI_SET_REQ_DEV_ATTR_CMDID,
  400. WMI_P2P_FIND_CMDID,
  401. WMI_P2P_STOP_FIND_CMDID,
  402. WMI_P2P_GO_NEG_START_CMDID,
  403. WMI_P2P_LISTEN_CMDID,
  404. WMI_CONFIG_TX_MAC_RULES_CMDID, /* F040 */
  405. WMI_SET_PROMISCUOUS_MODE_CMDID,
  406. WMI_RX_FRAME_FILTER_CMDID,
  407. WMI_SET_CHANNEL_CMDID,
  408. /* WAC commands */
  409. WMI_ENABLE_WAC_CMDID,
  410. WMI_WAC_SCAN_REPLY_CMDID,
  411. WMI_WAC_CTRL_REQ_CMDID,
  412. WMI_SET_DIV_PARAMS_CMDID,
  413. WMI_GET_PMK_CMDID,
  414. WMI_SET_PASSPHRASE_CMDID,
  415. WMI_SEND_ASSOC_RES_CMDID,
  416. WMI_SET_ASSOC_REQ_RELAY_CMDID,
  417. WMI_GET_RFKILL_MODE_CMDID,
  418. /* ACS command, consists of sub-commands */
  419. WMI_ACS_CTRL_CMDID,
  420. /* Ultra low power store / recall commands */
  421. WMI_STORERECALL_CONFIGURE_CMDID,
  422. WMI_STORERECALL_RECALL_CMDID,
  423. WMI_STORERECALL_HOST_READY_CMDID,
  424. WMI_FORCE_TARGET_ASSERT_CMDID,
  425. WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
  426. };
  427. /* WMI_CONNECT_CMDID */
  428. enum network_type {
  429. INFRA_NETWORK = 0x01,
  430. ADHOC_NETWORK = 0x02,
  431. ADHOC_CREATOR = 0x04,
  432. AP_NETWORK = 0x10,
  433. };
  434. enum dot11_auth_mode {
  435. OPEN_AUTH = 0x01,
  436. SHARED_AUTH = 0x02,
  437. /* different from IEEE_AUTH_MODE definitions */
  438. LEAP_AUTH = 0x04,
  439. };
  440. enum {
  441. AUTH_IDLE,
  442. AUTH_OPEN_IN_PROGRESS,
  443. };
  444. enum auth_mode {
  445. NONE_AUTH = 0x01,
  446. WPA_AUTH = 0x02,
  447. WPA2_AUTH = 0x04,
  448. WPA_PSK_AUTH = 0x08,
  449. WPA2_PSK_AUTH = 0x10,
  450. WPA_AUTH_CCKM = 0x20,
  451. WPA2_AUTH_CCKM = 0x40,
  452. };
  453. #define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
  454. #define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
  455. #define WMI_MIN_KEY_INDEX 0
  456. #define WMI_MAX_KEY_INDEX 3
  457. #define WMI_MAX_KEY_LEN 32
  458. /*
  459. * NB: these values are ordered carefully; there are lots of
  460. * of implications in any reordering. In particular beware
  461. * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
  462. */
  463. #define ATH6KL_CIPHER_WEP 0
  464. #define ATH6KL_CIPHER_TKIP 1
  465. #define ATH6KL_CIPHER_AES_OCB 2
  466. #define ATH6KL_CIPHER_AES_CCM 3
  467. #define ATH6KL_CIPHER_CKIP 5
  468. #define ATH6KL_CIPHER_CCKM_KRK 6
  469. #define ATH6KL_CIPHER_NONE 7 /* pseudo value */
  470. /*
  471. * 802.11 rate set.
  472. */
  473. #define ATH6KL_RATE_MAXSIZE 15 /* max rates we'll handle */
  474. #define ATH_OUI_TYPE 0x01
  475. #define WPA_OUI_TYPE 0x01
  476. #define WMM_PARAM_OUI_SUBTYPE 0x01
  477. #define WMM_OUI_TYPE 0x02
  478. #define WSC_OUT_TYPE 0x04
  479. enum wmi_connect_ctrl_flags_bits {
  480. CONNECT_ASSOC_POLICY_USER = 0x0001,
  481. CONNECT_SEND_REASSOC = 0x0002,
  482. CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
  483. CONNECT_PROFILE_MATCH_DONE = 0x0008,
  484. CONNECT_IGNORE_AAC_BEACON = 0x0010,
  485. CONNECT_CSA_FOLLOW_BSS = 0x0020,
  486. CONNECT_DO_WPA_OFFLOAD = 0x0040,
  487. CONNECT_DO_NOT_DEAUTH = 0x0080,
  488. };
  489. struct wmi_connect_cmd {
  490. u8 nw_type;
  491. u8 dot11_auth_mode;
  492. u8 auth_mode;
  493. u8 prwise_crypto_type;
  494. u8 prwise_crypto_len;
  495. u8 grp_crypto_type;
  496. u8 grp_crypto_len;
  497. u8 ssid_len;
  498. u8 ssid[IEEE80211_MAX_SSID_LEN];
  499. __le16 ch;
  500. u8 bssid[ETH_ALEN];
  501. __le32 ctrl_flags;
  502. } __packed;
  503. /* WMI_RECONNECT_CMDID */
  504. struct wmi_reconnect_cmd {
  505. /* channel hint */
  506. __le16 channel;
  507. /* mandatory if set */
  508. u8 bssid[ETH_ALEN];
  509. } __packed;
  510. /* WMI_ADD_CIPHER_KEY_CMDID */
  511. enum key_usage {
  512. PAIRWISE_USAGE = 0x00,
  513. GROUP_USAGE = 0x01,
  514. /* default Tx Key - static WEP only */
  515. TX_USAGE = 0x02,
  516. };
  517. /*
  518. * Bit Flag
  519. * Bit 0 - Initialise TSC - default is Initialize
  520. */
  521. #define KEY_OP_INIT_TSC 0x01
  522. #define KEY_OP_INIT_RSC 0x02
  523. /* default initialise the TSC & RSC */
  524. #define KEY_OP_INIT_VAL 0x03
  525. #define KEY_OP_VALID_MASK 0x03
  526. struct wmi_add_cipher_key_cmd {
  527. u8 key_index;
  528. u8 key_type;
  529. /* enum key_usage */
  530. u8 key_usage;
  531. u8 key_len;
  532. /* key replay sequence counter */
  533. u8 key_rsc[8];
  534. u8 key[WLAN_MAX_KEY_LEN];
  535. /* additional key control info */
  536. u8 key_op_ctrl;
  537. u8 key_mac_addr[ETH_ALEN];
  538. } __packed;
  539. /* WMI_DELETE_CIPHER_KEY_CMDID */
  540. struct wmi_delete_cipher_key_cmd {
  541. u8 key_index;
  542. } __packed;
  543. #define WMI_KRK_LEN 16
  544. /* WMI_ADD_KRK_CMDID */
  545. struct wmi_add_krk_cmd {
  546. u8 krk[WMI_KRK_LEN];
  547. } __packed;
  548. /* WMI_SETPMKID_CMDID */
  549. #define WMI_PMKID_LEN 16
  550. enum pmkid_enable_flg {
  551. PMKID_DISABLE = 0,
  552. PMKID_ENABLE = 1,
  553. };
  554. struct wmi_setpmkid_cmd {
  555. u8 bssid[ETH_ALEN];
  556. /* enum pmkid_enable_flg */
  557. u8 enable;
  558. u8 pmkid[WMI_PMKID_LEN];
  559. } __packed;
  560. /* WMI_START_SCAN_CMD */
  561. enum wmi_scan_type {
  562. WMI_LONG_SCAN = 0,
  563. WMI_SHORT_SCAN = 1,
  564. };
  565. struct wmi_start_scan_cmd {
  566. __le32 force_fg_scan;
  567. /* for legacy cisco AP compatibility */
  568. __le32 is_legacy;
  569. /* max duration in the home channel(msec) */
  570. __le32 home_dwell_time;
  571. /* time interval between scans (msec) */
  572. __le32 force_scan_intvl;
  573. /* enum wmi_scan_type */
  574. u8 scan_type;
  575. /* how many channels follow */
  576. u8 num_ch;
  577. /* channels in Mhz */
  578. __le16 ch_list[1];
  579. } __packed;
  580. /* WMI_SET_SCAN_PARAMS_CMDID */
  581. #define WMI_SHORTSCANRATIO_DEFAULT 3
  582. /*
  583. * Warning: scan control flag value of 0xFF is used to disable
  584. * all flags in WMI_SCAN_PARAMS_CMD. Do not add any more
  585. * flags here
  586. */
  587. enum wmi_scan_ctrl_flags_bits {
  588. /* set if can scan in the connect cmd */
  589. CONNECT_SCAN_CTRL_FLAGS = 0x01,
  590. /* set if scan for the SSID it is already connected to */
  591. SCAN_CONNECTED_CTRL_FLAGS = 0x02,
  592. /* set if enable active scan */
  593. ACTIVE_SCAN_CTRL_FLAGS = 0x04,
  594. /* set if enable roam scan when bmiss and lowrssi */
  595. ROAM_SCAN_CTRL_FLAGS = 0x08,
  596. /* set if follows customer BSSINFO reporting rule */
  597. REPORT_BSSINFO_CTRL_FLAGS = 0x10,
  598. /* if disabled, target doesn't scan after a disconnect event */
  599. ENABLE_AUTO_CTRL_FLAGS = 0x20,
  600. /*
  601. * Scan complete event with canceled status will be generated when
  602. * a scan is prempted before it gets completed.
  603. */
  604. ENABLE_SCAN_ABORT_EVENT = 0x40
  605. };
  606. #define DEFAULT_SCAN_CTRL_FLAGS \
  607. (CONNECT_SCAN_CTRL_FLAGS | \
  608. SCAN_CONNECTED_CTRL_FLAGS | \
  609. ACTIVE_SCAN_CTRL_FLAGS | \
  610. ROAM_SCAN_CTRL_FLAGS | \
  611. ENABLE_AUTO_CTRL_FLAGS)
  612. struct wmi_scan_params_cmd {
  613. /* sec */
  614. __le16 fg_start_period;
  615. /* sec */
  616. __le16 fg_end_period;
  617. /* sec */
  618. __le16 bg_period;
  619. /* msec */
  620. __le16 maxact_chdwell_time;
  621. /* msec */
  622. __le16 pas_chdwell_time;
  623. /* how many shorts scan for one long */
  624. u8 short_scan_ratio;
  625. u8 scan_ctrl_flags;
  626. /* msec */
  627. __le16 minact_chdwell_time;
  628. /* max active scans per ssid */
  629. __le16 maxact_scan_per_ssid;
  630. /* msecs */
  631. __le32 max_dfsch_act_time;
  632. } __packed;
  633. /* WMI_SET_BSS_FILTER_CMDID */
  634. enum wmi_bss_filter {
  635. /* no beacons forwarded */
  636. NONE_BSS_FILTER = 0x0,
  637. /* all beacons forwarded */
  638. ALL_BSS_FILTER,
  639. /* only beacons matching profile */
  640. PROFILE_FILTER,
  641. /* all but beacons matching profile */
  642. ALL_BUT_PROFILE_FILTER,
  643. /* only beacons matching current BSS */
  644. CURRENT_BSS_FILTER,
  645. /* all but beacons matching BSS */
  646. ALL_BUT_BSS_FILTER,
  647. /* beacons matching probed ssid */
  648. PROBED_SSID_FILTER,
  649. /* marker only */
  650. LAST_BSS_FILTER,
  651. };
  652. struct wmi_bss_filter_cmd {
  653. /* see, enum wmi_bss_filter */
  654. u8 bss_filter;
  655. /* for alignment */
  656. u8 reserved1;
  657. /* for alignment */
  658. __le16 reserved2;
  659. __le32 ie_mask;
  660. } __packed;
  661. /* WMI_SET_PROBED_SSID_CMDID */
  662. #define MAX_PROBED_SSID_INDEX 9
  663. enum wmi_ssid_flag {
  664. /* disables entry */
  665. DISABLE_SSID_FLAG = 0,
  666. /* probes specified ssid */
  667. SPECIFIC_SSID_FLAG = 0x01,
  668. /* probes for any ssid */
  669. ANY_SSID_FLAG = 0x02,
  670. };
  671. struct wmi_probed_ssid_cmd {
  672. /* 0 to MAX_PROBED_SSID_INDEX */
  673. u8 entry_index;
  674. /* see, enum wmi_ssid_flg */
  675. u8 flag;
  676. u8 ssid_len;
  677. u8 ssid[IEEE80211_MAX_SSID_LEN];
  678. } __packed;
  679. /*
  680. * WMI_SET_LISTEN_INT_CMDID
  681. * The Listen interval is between 15 and 3000 TUs
  682. */
  683. struct wmi_listen_int_cmd {
  684. __le16 listen_intvl;
  685. __le16 num_beacons;
  686. } __packed;
  687. /* WMI_SET_POWER_MODE_CMDID */
  688. enum wmi_power_mode {
  689. REC_POWER = 0x01,
  690. MAX_PERF_POWER,
  691. };
  692. struct wmi_power_mode_cmd {
  693. /* see, enum wmi_power_mode */
  694. u8 pwr_mode;
  695. } __packed;
  696. /*
  697. * Policy to determnine whether power save failure event should be sent to
  698. * host during scanning
  699. */
  700. enum power_save_fail_event_policy {
  701. SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
  702. IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN = 2,
  703. };
  704. struct wmi_power_params_cmd {
  705. /* msec */
  706. __le16 idle_period;
  707. __le16 pspoll_number;
  708. __le16 dtim_policy;
  709. __le16 tx_wakeup_policy;
  710. __le16 num_tx_to_wakeup;
  711. __le16 ps_fail_event_policy;
  712. } __packed;
  713. /* WMI_SET_DISC_TIMEOUT_CMDID */
  714. struct wmi_disc_timeout_cmd {
  715. /* seconds */
  716. u8 discon_timeout;
  717. } __packed;
  718. enum dir_type {
  719. UPLINK_TRAFFIC = 0,
  720. DNLINK_TRAFFIC = 1,
  721. BIDIR_TRAFFIC = 2,
  722. };
  723. enum voiceps_cap_type {
  724. DISABLE_FOR_THIS_AC = 0,
  725. ENABLE_FOR_THIS_AC = 1,
  726. ENABLE_FOR_ALL_AC = 2,
  727. };
  728. enum traffic_type {
  729. TRAFFIC_TYPE_APERIODIC = 0,
  730. TRAFFIC_TYPE_PERIODIC = 1,
  731. };
  732. /* WMI_SYNCHRONIZE_CMDID */
  733. struct wmi_sync_cmd {
  734. u8 data_sync_map;
  735. } __packed;
  736. /* WMI_CREATE_PSTREAM_CMDID */
  737. struct wmi_create_pstream_cmd {
  738. /* msec */
  739. __le32 min_service_int;
  740. /* msec */
  741. __le32 max_service_int;
  742. /* msec */
  743. __le32 inactivity_int;
  744. /* msec */
  745. __le32 suspension_int;
  746. __le32 service_start_time;
  747. /* in bps */
  748. __le32 min_data_rate;
  749. /* in bps */
  750. __le32 mean_data_rate;
  751. /* in bps */
  752. __le32 peak_data_rate;
  753. __le32 max_burst_size;
  754. __le32 delay_bound;
  755. /* in bps */
  756. __le32 min_phy_rate;
  757. __le32 sba;
  758. __le32 medium_time;
  759. /* in octects */
  760. __le16 nominal_msdu;
  761. /* in octects */
  762. __le16 max_msdu;
  763. u8 traffic_class;
  764. /* see, enum dir_type */
  765. u8 traffic_direc;
  766. u8 rx_queue_num;
  767. /* see, enum traffic_type */
  768. u8 traffic_type;
  769. /* see, enum voiceps_cap_type */
  770. u8 voice_psc_cap;
  771. u8 tsid;
  772. /* 802.1D user priority */
  773. u8 user_pri;
  774. /* nominal phy rate */
  775. u8 nominal_phy;
  776. } __packed;
  777. /* WMI_DELETE_PSTREAM_CMDID */
  778. struct wmi_delete_pstream_cmd {
  779. u8 tx_queue_num;
  780. u8 rx_queue_num;
  781. u8 traffic_direc;
  782. u8 traffic_class;
  783. u8 tsid;
  784. } __packed;
  785. /* WMI_SET_CHANNEL_PARAMS_CMDID */
  786. enum wmi_phy_mode {
  787. WMI_11A_MODE = 0x1,
  788. WMI_11G_MODE = 0x2,
  789. WMI_11AG_MODE = 0x3,
  790. WMI_11B_MODE = 0x4,
  791. WMI_11GONLY_MODE = 0x5,
  792. };
  793. #define WMI_MAX_CHANNELS 32
  794. /*
  795. * WMI_RSSI_THRESHOLD_PARAMS_CMDID
  796. * Setting the polltime to 0 would disable polling. Threshold values are
  797. * in the ascending order, and should agree to:
  798. * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
  799. * < highThreshold_upperVal)
  800. */
  801. struct wmi_rssi_threshold_params_cmd {
  802. /* polling time as a factor of LI */
  803. __le32 poll_time;
  804. /* lowest of upper */
  805. a_sle16 thresh_above1_val;
  806. a_sle16 thresh_above2_val;
  807. a_sle16 thresh_above3_val;
  808. a_sle16 thresh_above4_val;
  809. a_sle16 thresh_above5_val;
  810. /* highest of upper */
  811. a_sle16 thresh_above6_val;
  812. /* lowest of bellow */
  813. a_sle16 thresh_below1_val;
  814. a_sle16 thresh_below2_val;
  815. a_sle16 thresh_below3_val;
  816. a_sle16 thresh_below4_val;
  817. a_sle16 thresh_below5_val;
  818. /* highest of bellow */
  819. a_sle16 thresh_below6_val;
  820. /* "alpha" */
  821. u8 weight;
  822. u8 reserved[3];
  823. } __packed;
  824. /*
  825. * WMI_SNR_THRESHOLD_PARAMS_CMDID
  826. * Setting the polltime to 0 would disable polling.
  827. */
  828. struct wmi_snr_threshold_params_cmd {
  829. /* polling time as a factor of LI */
  830. __le32 poll_time;
  831. /* "alpha" */
  832. u8 weight;
  833. /* lowest of uppper */
  834. u8 thresh_above1_val;
  835. u8 thresh_above2_val;
  836. u8 thresh_above3_val;
  837. /* highest of upper */
  838. u8 thresh_above4_val;
  839. /* lowest of bellow */
  840. u8 thresh_below1_val;
  841. u8 thresh_below2_val;
  842. u8 thresh_below3_val;
  843. /* highest of bellow */
  844. u8 thresh_below4_val;
  845. u8 reserved[3];
  846. } __packed;
  847. enum wmi_preamble_policy {
  848. WMI_IGNORE_BARKER_IN_ERP = 0,
  849. WMI_DONOT_IGNORE_BARKER_IN_ERP
  850. };
  851. struct wmi_set_lpreamble_cmd {
  852. u8 status;
  853. u8 preamble_policy;
  854. } __packed;
  855. struct wmi_set_rts_cmd {
  856. __le16 threshold;
  857. } __packed;
  858. /* WMI_SET_TX_PWR_CMDID */
  859. struct wmi_set_tx_pwr_cmd {
  860. /* in dbM units */
  861. u8 dbM;
  862. } __packed;
  863. struct wmi_tx_pwr_reply {
  864. /* in dbM units */
  865. u8 dbM;
  866. } __packed;
  867. struct wmi_report_sleep_state_event {
  868. __le32 sleep_state;
  869. };
  870. enum wmi_report_sleep_status {
  871. WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP = 0,
  872. WMI_REPORT_SLEEP_STATUS_IS_AWAKE
  873. };
  874. enum target_event_report_config {
  875. /* default */
  876. DISCONN_EVT_IN_RECONN = 0,
  877. NO_DISCONN_EVT_IN_RECONN
  878. };
  879. /* Command Replies */
  880. /* WMI_GET_CHANNEL_LIST_CMDID reply */
  881. struct wmi_channel_list_reply {
  882. u8 reserved;
  883. /* number of channels in reply */
  884. u8 num_ch;
  885. /* channel in Mhz */
  886. __le16 ch_list[1];
  887. } __packed;
  888. /* List of Events (target to host) */
  889. enum wmi_event_id {
  890. WMI_READY_EVENTID = 0x1001,
  891. WMI_CONNECT_EVENTID,
  892. WMI_DISCONNECT_EVENTID,
  893. WMI_BSSINFO_EVENTID,
  894. WMI_CMDERROR_EVENTID,
  895. WMI_REGDOMAIN_EVENTID,
  896. WMI_PSTREAM_TIMEOUT_EVENTID,
  897. WMI_NEIGHBOR_REPORT_EVENTID,
  898. WMI_TKIP_MICERR_EVENTID,
  899. WMI_SCAN_COMPLETE_EVENTID, /* 0x100a */
  900. WMI_REPORT_STATISTICS_EVENTID,
  901. WMI_RSSI_THRESHOLD_EVENTID,
  902. WMI_ERROR_REPORT_EVENTID,
  903. WMI_OPT_RX_FRAME_EVENTID,
  904. WMI_REPORT_ROAM_TBL_EVENTID,
  905. WMI_EXTENSION_EVENTID,
  906. WMI_CAC_EVENTID,
  907. WMI_SNR_THRESHOLD_EVENTID,
  908. WMI_LQ_THRESHOLD_EVENTID,
  909. WMI_TX_RETRY_ERR_EVENTID, /* 0x1014 */
  910. WMI_REPORT_ROAM_DATA_EVENTID,
  911. WMI_TEST_EVENTID,
  912. WMI_APLIST_EVENTID,
  913. WMI_GET_WOW_LIST_EVENTID,
  914. WMI_GET_PMKID_LIST_EVENTID,
  915. WMI_CHANNEL_CHANGE_EVENTID,
  916. WMI_PEER_NODE_EVENTID,
  917. WMI_PSPOLL_EVENTID,
  918. WMI_DTIMEXPIRY_EVENTID,
  919. WMI_WLAN_VERSION_EVENTID,
  920. WMI_SET_PARAMS_REPLY_EVENTID,
  921. WMI_ADDBA_REQ_EVENTID, /*0x1020 */
  922. WMI_ADDBA_RESP_EVENTID,
  923. WMI_DELBA_REQ_EVENTID,
  924. WMI_TX_COMPLETE_EVENTID,
  925. WMI_HCI_EVENT_EVENTID,
  926. WMI_ACL_DATA_EVENTID,
  927. WMI_REPORT_SLEEP_STATE_EVENTID,
  928. WMI_REPORT_BTCOEX_STATS_EVENTID,
  929. WMI_REPORT_BTCOEX_CONFIG_EVENTID,
  930. WMI_GET_PMK_EVENTID,
  931. /* DFS Events */
  932. WMI_DFS_HOST_ATTACH_EVENTID,
  933. WMI_DFS_HOST_INIT_EVENTID,
  934. WMI_DFS_RESET_DELAYLINES_EVENTID,
  935. WMI_DFS_RESET_RADARQ_EVENTID,
  936. WMI_DFS_RESET_AR_EVENTID,
  937. WMI_DFS_RESET_ARQ_EVENTID,
  938. WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
  939. WMI_DFS_SET_BANGRADAR_EVENTID,
  940. WMI_DFS_SET_DEBUGLEVEL_EVENTID,
  941. WMI_DFS_PHYERR_EVENTID,
  942. /* CCX Evants */
  943. WMI_CCX_RM_STATUS_EVENTID,
  944. /* P2P Events */
  945. WMI_P2P_GO_NEG_RESULT_EVENTID,
  946. WMI_WAC_SCAN_DONE_EVENTID,
  947. WMI_WAC_REPORT_BSS_EVENTID,
  948. WMI_WAC_START_WPS_EVENTID,
  949. WMI_WAC_CTRL_REQ_REPLY_EVENTID,
  950. /* RFKILL Events */
  951. WMI_RFKILL_STATE_CHANGE_EVENTID,
  952. WMI_RFKILL_GET_MODE_CMD_EVENTID,
  953. WMI_THIN_RESERVED_START_EVENTID = 0x8000,
  954. /*
  955. * Events in this range are reserved for thinmode
  956. * See wmi_thin.h for actual definitions
  957. */
  958. WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
  959. WMI_SET_CHANNEL_EVENTID,
  960. WMI_ASSOC_REQ_EVENTID,
  961. /* Generic ACS event */
  962. WMI_ACS_EVENTID,
  963. WMI_REPORT_WMM_PARAMS_EVENTID
  964. };
  965. struct wmi_ready_event_2 {
  966. __le32 sw_version;
  967. __le32 abi_version;
  968. u8 mac_addr[ETH_ALEN];
  969. u8 phy_cap;
  970. } __packed;
  971. /* Connect Event */
  972. struct wmi_connect_event {
  973. __le16 ch;
  974. u8 bssid[ETH_ALEN];
  975. __le16 listen_intvl;
  976. __le16 beacon_intvl;
  977. __le32 nw_type;
  978. u8 beacon_ie_len;
  979. u8 assoc_req_len;
  980. u8 assoc_resp_len;
  981. u8 assoc_info[1];
  982. } __packed;
  983. /* Disconnect Event */
  984. enum wmi_disconnect_reason {
  985. NO_NETWORK_AVAIL = 0x01,
  986. /* bmiss */
  987. LOST_LINK = 0x02,
  988. DISCONNECT_CMD = 0x03,
  989. BSS_DISCONNECTED = 0x04,
  990. AUTH_FAILED = 0x05,
  991. ASSOC_FAILED = 0x06,
  992. NO_RESOURCES_AVAIL = 0x07,
  993. CSERV_DISCONNECT = 0x08,
  994. INVALID_PROFILE = 0x0a,
  995. DOT11H_CHANNEL_SWITCH = 0x0b,
  996. PROFILE_MISMATCH = 0x0c,
  997. CONNECTION_EVICTED = 0x0d,
  998. IBSS_MERGE = 0xe,
  999. };
  1000. struct wmi_disconnect_event {
  1001. /* reason code, see 802.11 spec. */
  1002. __le16 proto_reason_status;
  1003. /* set if known */
  1004. u8 bssid[ETH_ALEN];
  1005. /* see WMI_DISCONNECT_REASON */
  1006. u8 disconn_reason;
  1007. u8 assoc_resp_len;
  1008. u8 assoc_info[1];
  1009. } __packed;
  1010. /*
  1011. * BSS Info Event.
  1012. * Mechanism used to inform host of the presence and characteristic of
  1013. * wireless networks present. Consists of bss info header followed by
  1014. * the beacon or probe-response frame body. The 802.11 header is no included.
  1015. */
  1016. enum wmi_bi_ftype {
  1017. BEACON_FTYPE = 0x1,
  1018. PROBERESP_FTYPE,
  1019. ACTION_MGMT_FTYPE,
  1020. PROBEREQ_FTYPE,
  1021. };
  1022. struct wmi_bss_info_hdr {
  1023. __le16 ch;
  1024. /* see, enum wmi_bi_ftype */
  1025. u8 frame_type;
  1026. u8 snr;
  1027. a_sle16 rssi;
  1028. u8 bssid[ETH_ALEN];
  1029. __le32 ie_mask;
  1030. } __packed;
  1031. /*
  1032. * BSS INFO HDR version 2.0
  1033. * With 6 bytes HTC header and 6 bytes of WMI header
  1034. * WMI_BSS_INFO_HDR cannot be accommodated in the removed 802.11 management
  1035. * header space.
  1036. * - Reduce the ie_mask to 2 bytes as only two bit flags are used
  1037. * - Remove rssi and compute it on the host. rssi = snr - 95
  1038. */
  1039. struct wmi_bss_info_hdr2 {
  1040. __le16 ch;
  1041. /* see, enum wmi_bi_ftype */
  1042. u8 frame_type;
  1043. u8 snr;
  1044. u8 bssid[ETH_ALEN];
  1045. __le16 ie_mask;
  1046. } __packed;
  1047. /* Command Error Event */
  1048. enum wmi_error_code {
  1049. INVALID_PARAM = 0x01,
  1050. ILLEGAL_STATE = 0x02,
  1051. INTERNAL_ERROR = 0x03,
  1052. };
  1053. struct wmi_cmd_error_event {
  1054. __le16 cmd_id;
  1055. u8 err_code;
  1056. } __packed;
  1057. struct wmi_pstream_timeout_event {
  1058. u8 tx_queue_num;
  1059. u8 rx_queue_num;
  1060. u8 traffic_direc;
  1061. u8 traffic_class;
  1062. } __packed;
  1063. /*
  1064. * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
  1065. * the host of BSS's it has found that matches the current profile.
  1066. * It can be used by the host to cache PMKs and/to initiate pre-authentication
  1067. * if the BSS supports it. The first bssid is always the current associated
  1068. * BSS.
  1069. * The bssid and bssFlags information repeats according to the number
  1070. * or APs reported.
  1071. */
  1072. enum wmi_bss_flags {
  1073. WMI_DEFAULT_BSS_FLAGS = 0x00,
  1074. WMI_PREAUTH_CAPABLE_BSS = 0x01,
  1075. WMI_PMKID_VALID_BSS = 0x02,
  1076. };
  1077. /* TKIP MIC Error Event */
  1078. struct wmi_tkip_micerr_event {
  1079. u8 key_id;
  1080. u8 is_mcast;
  1081. } __packed;
  1082. /* WMI_SCAN_COMPLETE_EVENTID */
  1083. struct wmi_scan_complete_event {
  1084. a_sle32 status;
  1085. } __packed;
  1086. #define MAX_OPT_DATA_LEN 1400
  1087. /*
  1088. * Special frame receive Event.
  1089. * Mechanism used to inform host of the receiption of the special frames.
  1090. * Consists of special frame info header followed by special frame body.
  1091. * The 802.11 header is not included.
  1092. */
  1093. struct wmi_opt_rx_info_hdr {
  1094. __le16 ch;
  1095. u8 frame_type;
  1096. s8 snr;
  1097. u8 src_addr[ETH_ALEN];
  1098. u8 bssid[ETH_ALEN];
  1099. } __packed;
  1100. /* Reporting statistic */
  1101. struct tx_stats {
  1102. __le32 pkt;
  1103. __le32 byte;
  1104. __le32 ucast_pkt;
  1105. __le32 ucast_byte;
  1106. __le32 mcast_pkt;
  1107. __le32 mcast_byte;
  1108. __le32 bcast_pkt;
  1109. __le32 bcast_byte;
  1110. __le32 rts_success_cnt;
  1111. __le32 pkt_per_ac[4];
  1112. __le32 err_per_ac[4];
  1113. __le32 err;
  1114. __le32 fail_cnt;
  1115. __le32 retry_cnt;
  1116. __le32 mult_retry_cnt;
  1117. __le32 rts_fail_cnt;
  1118. a_sle32 ucast_rate;
  1119. } __packed;
  1120. struct rx_stats {
  1121. __le32 pkt;
  1122. __le32 byte;
  1123. __le32 ucast_pkt;
  1124. __le32 ucast_byte;
  1125. __le32 mcast_pkt;
  1126. __le32 mcast_byte;
  1127. __le32 bcast_pkt;
  1128. __le32 bcast_byte;
  1129. __le32 frgment_pkt;
  1130. __le32 err;
  1131. __le32 crc_err;
  1132. __le32 key_cache_miss;
  1133. __le32 decrypt_err;
  1134. __le32 dupl_frame;
  1135. a_sle32 ucast_rate;
  1136. } __packed;
  1137. struct tkip_ccmp_stats {
  1138. __le32 tkip_local_mic_fail;
  1139. __le32 tkip_cnter_measures_invoked;
  1140. __le32 tkip_replays;
  1141. __le32 tkip_fmt_err;
  1142. __le32 ccmp_fmt_err;
  1143. __le32 ccmp_replays;
  1144. } __packed;
  1145. struct pm_stats {
  1146. __le32 pwr_save_failure_cnt;
  1147. __le16 stop_tx_failure_cnt;
  1148. __le16 atim_tx_failure_cnt;
  1149. __le16 atim_rx_failure_cnt;
  1150. __le16 bcn_rx_failure_cnt;
  1151. } __packed;
  1152. struct cserv_stats {
  1153. __le32 cs_bmiss_cnt;
  1154. __le32 cs_low_rssi_cnt;
  1155. __le16 cs_connect_cnt;
  1156. __le16 cs_discon_cnt;
  1157. a_sle16 cs_ave_beacon_rssi;
  1158. __le16 cs_roam_count;
  1159. a_sle16 cs_rssi;
  1160. u8 cs_snr;
  1161. u8 cs_ave_beacon_snr;
  1162. u8 cs_last_roam_msec;
  1163. } __packed;
  1164. struct wlan_net_stats {
  1165. struct tx_stats tx;
  1166. struct rx_stats rx;
  1167. struct tkip_ccmp_stats tkip_ccmp_stats;
  1168. } __packed;
  1169. struct arp_stats {
  1170. __le32 arp_received;
  1171. __le32 arp_matched;
  1172. __le32 arp_replied;
  1173. } __packed;
  1174. struct wlan_wow_stats {
  1175. __le32 wow_pkt_dropped;
  1176. __le16 wow_evt_discarded;
  1177. u8 wow_host_pkt_wakeups;
  1178. u8 wow_host_evt_wakeups;
  1179. } __packed;
  1180. struct wmi_target_stats {
  1181. __le32 lq_val;
  1182. a_sle32 noise_floor_calib;
  1183. struct pm_stats pm_stats;
  1184. struct wlan_net_stats stats;
  1185. struct wlan_wow_stats wow_stats;
  1186. struct arp_stats arp_stats;
  1187. struct cserv_stats cserv_stats;
  1188. } __packed;
  1189. /*
  1190. * WMI_RSSI_THRESHOLD_EVENTID.
  1191. * Indicate the RSSI events to host. Events are indicated when we breach a
  1192. * thresold value.
  1193. */
  1194. enum wmi_rssi_threshold_val {
  1195. WMI_RSSI_THRESHOLD1_ABOVE = 0,
  1196. WMI_RSSI_THRESHOLD2_ABOVE,
  1197. WMI_RSSI_THRESHOLD3_ABOVE,
  1198. WMI_RSSI_THRESHOLD4_ABOVE,
  1199. WMI_RSSI_THRESHOLD5_ABOVE,
  1200. WMI_RSSI_THRESHOLD6_ABOVE,
  1201. WMI_RSSI_THRESHOLD1_BELOW,
  1202. WMI_RSSI_THRESHOLD2_BELOW,
  1203. WMI_RSSI_THRESHOLD3_BELOW,
  1204. WMI_RSSI_THRESHOLD4_BELOW,
  1205. WMI_RSSI_THRESHOLD5_BELOW,
  1206. WMI_RSSI_THRESHOLD6_BELOW
  1207. };
  1208. struct wmi_rssi_threshold_event {
  1209. a_sle16 rssi;
  1210. u8 range;
  1211. } __packed;
  1212. enum wmi_snr_threshold_val {
  1213. WMI_SNR_THRESHOLD1_ABOVE = 1,
  1214. WMI_SNR_THRESHOLD1_BELOW,
  1215. WMI_SNR_THRESHOLD2_ABOVE,
  1216. WMI_SNR_THRESHOLD2_BELOW,
  1217. WMI_SNR_THRESHOLD3_ABOVE,
  1218. WMI_SNR_THRESHOLD3_BELOW,
  1219. WMI_SNR_THRESHOLD4_ABOVE,
  1220. WMI_SNR_THRESHOLD4_BELOW
  1221. };
  1222. struct wmi_snr_threshold_event {
  1223. /* see, enum wmi_snr_threshold_val */
  1224. u8 range;
  1225. u8 snr;
  1226. } __packed;
  1227. /* WMI_REPORT_ROAM_TBL_EVENTID */
  1228. #define MAX_ROAM_TBL_CAND 5
  1229. struct wmi_bss_roam_info {
  1230. a_sle32 roam_util;
  1231. u8 bssid[ETH_ALEN];
  1232. s8 rssi;
  1233. s8 rssidt;
  1234. s8 last_rssi;
  1235. s8 util;
  1236. s8 bias;
  1237. /* for alignment */
  1238. u8 reserved;
  1239. } __packed;
  1240. /* WMI_CAC_EVENTID */
  1241. enum cac_indication {
  1242. CAC_INDICATION_ADMISSION = 0x00,
  1243. CAC_INDICATION_ADMISSION_RESP = 0x01,
  1244. CAC_INDICATION_DELETE = 0x02,
  1245. CAC_INDICATION_NO_RESP = 0x03,
  1246. };
  1247. #define WMM_TSPEC_IE_LEN 63
  1248. struct wmi_cac_event {
  1249. u8 ac;
  1250. u8 cac_indication;
  1251. u8 status_code;
  1252. u8 tspec_suggestion[WMM_TSPEC_IE_LEN];
  1253. } __packed;
  1254. /* WMI_APLIST_EVENTID */
  1255. enum aplist_ver {
  1256. APLIST_VER1 = 1,
  1257. };
  1258. struct wmi_ap_info_v1 {
  1259. u8 bssid[ETH_ALEN];
  1260. __le16 channel;
  1261. } __packed;
  1262. union wmi_ap_info {
  1263. struct wmi_ap_info_v1 ap_info_v1;
  1264. } __packed;
  1265. struct wmi_aplist_event {
  1266. u8 ap_list_ver;
  1267. u8 num_ap;
  1268. union wmi_ap_info ap_list[1];
  1269. } __packed;
  1270. /* Developer Commands */
  1271. /*
  1272. * WMI_SET_BITRATE_CMDID
  1273. *
  1274. * Get bit rate cmd uses same definition as set bit rate cmd
  1275. */
  1276. enum wmi_bit_rate {
  1277. RATE_AUTO = -1,
  1278. RATE_1Mb = 0,
  1279. RATE_2Mb = 1,
  1280. RATE_5_5Mb = 2,
  1281. RATE_11Mb = 3,
  1282. RATE_6Mb = 4,
  1283. RATE_9Mb = 5,
  1284. RATE_12Mb = 6,
  1285. RATE_18Mb = 7,
  1286. RATE_24Mb = 8,
  1287. RATE_36Mb = 9,
  1288. RATE_48Mb = 10,
  1289. RATE_54Mb = 11,
  1290. RATE_MCS_0_20 = 12,
  1291. RATE_MCS_1_20 = 13,
  1292. RATE_MCS_2_20 = 14,
  1293. RATE_MCS_3_20 = 15,
  1294. RATE_MCS_4_20 = 16,
  1295. RATE_MCS_5_20 = 17,
  1296. RATE_MCS_6_20 = 18,
  1297. RATE_MCS_7_20 = 19,
  1298. RATE_MCS_0_40 = 20,
  1299. RATE_MCS_1_40 = 21,
  1300. RATE_MCS_2_40 = 22,
  1301. RATE_MCS_3_40 = 23,
  1302. RATE_MCS_4_40 = 24,
  1303. RATE_MCS_5_40 = 25,
  1304. RATE_MCS_6_40 = 26,
  1305. RATE_MCS_7_40 = 27,
  1306. };
  1307. struct wmi_bit_rate_reply {
  1308. /* see, enum wmi_bit_rate */
  1309. s8 rate_index;
  1310. } __packed;
  1311. /*
  1312. * WMI_SET_FIXRATES_CMDID
  1313. *
  1314. * Get fix rates cmd uses same definition as set fix rates cmd
  1315. */
  1316. struct wmi_fix_rates_reply {
  1317. /* see wmi_bit_rate */
  1318. __le32 fix_rate_mask;
  1319. } __packed;
  1320. enum roam_data_type {
  1321. /* get the roam time data */
  1322. ROAM_DATA_TIME = 1,
  1323. };
  1324. struct wmi_target_roam_time {
  1325. __le32 disassoc_time;
  1326. __le32 no_txrx_time;
  1327. __le32 assoc_time;
  1328. __le32 allow_txrx_time;
  1329. u8 disassoc_bssid[ETH_ALEN];
  1330. s8 disassoc_bss_rssi;
  1331. u8 assoc_bssid[ETH_ALEN];
  1332. s8 assoc_bss_rssi;
  1333. } __packed;
  1334. enum wmi_txop_cfg {
  1335. WMI_TXOP_DISABLED = 0,
  1336. WMI_TXOP_ENABLED
  1337. };
  1338. struct wmi_set_wmm_txop_cmd {
  1339. u8 txop_enable;
  1340. } __packed;
  1341. struct wmi_set_keepalive_cmd {
  1342. u8 keep_alive_intvl;
  1343. } __packed;
  1344. struct wmi_get_keepalive_cmd {
  1345. __le32 configured;
  1346. u8 keep_alive_intvl;
  1347. } __packed;
  1348. /* Notify the WSC registration status to the target */
  1349. #define WSC_REG_ACTIVE 1
  1350. #define WSC_REG_INACTIVE 0
  1351. #define WOW_MAX_FILTER_LISTS 1
  1352. #define WOW_MAX_FILTERS_PER_LIST 4
  1353. #define WOW_PATTERN_SIZE 64
  1354. #define WOW_MASK_SIZE 64
  1355. #define MAC_MAX_FILTERS_PER_LIST 4
  1356. struct wow_filter {
  1357. u8 wow_valid_filter;
  1358. u8 wow_filter_id;
  1359. u8 wow_filter_size;
  1360. u8 wow_filter_offset;
  1361. u8 wow_filter_mask[WOW_MASK_SIZE];
  1362. u8 wow_filter_pattern[WOW_PATTERN_SIZE];
  1363. } __packed;
  1364. #define MAX_IP_ADDRS 2
  1365. struct wmi_set_ip_cmd {
  1366. /* IP in network byte order */
  1367. __le32 ips[MAX_IP_ADDRS];
  1368. } __packed;
  1369. /* WMI_GET_WOW_LIST_CMD reply */
  1370. struct wmi_get_wow_list_reply {
  1371. /* number of patterns in reply */
  1372. u8 num_filters;
  1373. /* this is filter # x of total num_filters */
  1374. u8 this_filter_num;
  1375. u8 wow_mode;
  1376. u8 host_mode;
  1377. struct wow_filter wow_filters[1];
  1378. } __packed;
  1379. /* WMI_SET_AKMP_PARAMS_CMD */
  1380. struct wmi_pmkid {
  1381. u8 pmkid[WMI_PMKID_LEN];
  1382. } __packed;
  1383. /* WMI_GET_PMKID_LIST_CMD Reply */
  1384. struct wmi_pmkid_list_reply {
  1385. __le32 num_pmkid;
  1386. u8 bssid_list[ETH_ALEN][1];
  1387. struct wmi_pmkid pmkid_list[1];
  1388. } __packed;
  1389. /* WMI_ADDBA_REQ_EVENTID */
  1390. struct wmi_addba_req_event {
  1391. u8 tid;
  1392. u8 win_sz;
  1393. __le16 st_seq_no;
  1394. /* f/w response for ADDBA Req; OK (0) or failure (!=0) */
  1395. u8 status;
  1396. } __packed;
  1397. /* WMI_ADDBA_RESP_EVENTID */
  1398. struct wmi_addba_resp_event {
  1399. u8 tid;
  1400. /* OK (0), failure (!=0) */
  1401. u8 status;
  1402. /* three values: not supported(0), 3839, 8k */
  1403. __le16 amsdu_sz;
  1404. } __packed;
  1405. /* WMI_DELBA_EVENTID
  1406. * f/w received a DELBA for peer and processed it.
  1407. * Host is notified of this
  1408. */
  1409. struct wmi_delba_event {
  1410. u8 tid;
  1411. u8 is_peer_initiator;
  1412. __le16 reason_code;
  1413. } __packed;
  1414. #define PEER_NODE_JOIN_EVENT 0x00
  1415. #define PEER_NODE_LEAVE_EVENT 0x01
  1416. #define PEER_FIRST_NODE_JOIN_EVENT 0x10
  1417. #define PEER_LAST_NODE_LEAVE_EVENT 0x11
  1418. struct wmi_peer_node_event {
  1419. u8 event_code;
  1420. u8 peer_mac_addr[ETH_ALEN];
  1421. } __packed;
  1422. /* Transmit complete event data structure(s) */
  1423. /* version 1 of tx complete msg */
  1424. struct tx_complete_msg_v1 {
  1425. #define TX_COMPLETE_STATUS_SUCCESS 0
  1426. #define TX_COMPLETE_STATUS_RETRIES 1
  1427. #define TX_COMPLETE_STATUS_NOLINK 2
  1428. #define TX_COMPLETE_STATUS_TIMEOUT 3
  1429. #define TX_COMPLETE_STATUS_OTHER 4
  1430. u8 status;
  1431. /* packet ID to identify parent packet */
  1432. u8 pkt_id;
  1433. /* rate index on successful transmission */
  1434. u8 rate_idx;
  1435. /* number of ACK failures in tx attempt */
  1436. u8 ack_failures;
  1437. } __packed;
  1438. struct wmi_tx_complete_event {
  1439. /* no of tx comp msgs following this struct */
  1440. u8 num_msg;
  1441. /* length in bytes for each individual msg following this struct */
  1442. u8 msg_len;
  1443. /* version of tx complete msg data following this struct */
  1444. u8 msg_type;
  1445. /* individual messages follow this header */
  1446. u8 reserved;
  1447. } __packed;
  1448. /*
  1449. * ------- AP Mode definitions --------------
  1450. */
  1451. /*
  1452. * !!! Warning !!!
  1453. * -Changing the following values needs compilation of both driver and firmware
  1454. */
  1455. #define AP_MAX_NUM_STA 8
  1456. /* Spl. AID used to set DTIM flag in the beacons */
  1457. #define MCAST_AID 0xFF
  1458. #define DEF_AP_COUNTRY_CODE "US "
  1459. /* Used with WMI_AP_SET_NUM_STA_CMDID */
  1460. struct wmi_ap_set_pvb_cmd {
  1461. __le32 flag;
  1462. __le16 aid;
  1463. } __packed;
  1464. struct wmi_rx_frame_format_cmd {
  1465. /* version of meta data for rx packets <0 = default> (0-7 = valid) */
  1466. u8 meta_ver;
  1467. /*
  1468. * 1 == leave .11 header intact,
  1469. * 0 == replace .11 header with .3 <default>
  1470. */
  1471. u8 dot11_hdr;
  1472. /*
  1473. * 1 == defragmentation is performed by host,
  1474. * 0 == performed by target <default>
  1475. */
  1476. u8 defrag_on_host;
  1477. /* for alignment */
  1478. u8 reserved[1];
  1479. } __packed;
  1480. /* AP mode events */
  1481. /* WMI_PS_POLL_EVENT */
  1482. struct wmi_pspoll_event {
  1483. __le16 aid;
  1484. } __packed;
  1485. struct wmi_per_sta_stat {
  1486. __le32 tx_bytes;
  1487. __le32 tx_pkts;
  1488. __le32 tx_error;
  1489. __le32 tx_discard;
  1490. __le32 rx_bytes;
  1491. __le32 rx_pkts;
  1492. __le32 rx_error;
  1493. __le32 rx_discard;
  1494. __le32 aid;
  1495. } __packed;
  1496. struct wmi_ap_mode_stat {
  1497. __le32 action;
  1498. struct wmi_per_sta_stat sta[AP_MAX_NUM_STA + 1];
  1499. } __packed;
  1500. /* End of AP mode definitions */
  1501. /* Extended WMI (WMIX)
  1502. *
  1503. * Extended WMIX commands are encapsulated in a WMI message with
  1504. * cmd=WMI_EXTENSION_CMD.
  1505. *
  1506. * Extended WMI commands are those that are needed during wireless
  1507. * operation, but which are not really wireless commands. This allows,
  1508. * for instance, platform-specific commands. Extended WMI commands are
  1509. * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
  1510. * Extended WMI events are similarly embedded in a WMI event message with
  1511. * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
  1512. */
  1513. struct wmix_cmd_hdr {
  1514. __le32 cmd_id;
  1515. } __packed;
  1516. enum wmix_command_id {
  1517. WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
  1518. WMIX_DSETDATA_REPLY_CMDID,
  1519. WMIX_GPIO_OUTPUT_SET_CMDID,
  1520. WMIX_GPIO_INPUT_GET_CMDID,
  1521. WMIX_GPIO_REGISTER_SET_CMDID,
  1522. WMIX_GPIO_REGISTER_GET_CMDID,
  1523. WMIX_GPIO_INTR_ACK_CMDID,
  1524. WMIX_HB_CHALLENGE_RESP_CMDID,
  1525. WMIX_DBGLOG_CFG_MODULE_CMDID,
  1526. WMIX_PROF_CFG_CMDID, /* 0x200a */
  1527. WMIX_PROF_ADDR_SET_CMDID,
  1528. WMIX_PROF_START_CMDID,
  1529. WMIX_PROF_STOP_CMDID,
  1530. WMIX_PROF_COUNT_GET_CMDID,
  1531. };
  1532. enum wmix_event_id {
  1533. WMIX_DSETOPENREQ_EVENTID = 0x3001,
  1534. WMIX_DSETCLOSE_EVENTID,
  1535. WMIX_DSETDATAREQ_EVENTID,
  1536. WMIX_GPIO_INTR_EVENTID,
  1537. WMIX_GPIO_DATA_EVENTID,
  1538. WMIX_GPIO_ACK_EVENTID,
  1539. WMIX_HB_CHALLENGE_RESP_EVENTID,
  1540. WMIX_DBGLOG_EVENTID,
  1541. WMIX_PROF_COUNT_EVENTID,
  1542. };
  1543. /*
  1544. * ------Error Detection support-------
  1545. */
  1546. /*
  1547. * WMIX_HB_CHALLENGE_RESP_CMDID
  1548. * Heartbeat Challenge Response command
  1549. */
  1550. struct wmix_hb_challenge_resp_cmd {
  1551. __le32 cookie;
  1552. __le32 source;
  1553. } __packed;
  1554. /* End of Extended WMI (WMIX) */
  1555. enum wmi_sync_flag {
  1556. NO_SYNC_WMIFLAG = 0,
  1557. /* transmit all queued data before cmd */
  1558. SYNC_BEFORE_WMIFLAG,
  1559. /* any new data waits until cmd execs */
  1560. SYNC_AFTER_WMIFLAG,
  1561. SYNC_BOTH_WMIFLAG,
  1562. /* end marker */
  1563. END_WMIFLAG
  1564. };
  1565. enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi);
  1566. void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id);
  1567. int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb);
  1568. int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
  1569. u8 msg_type, bool more_data,
  1570. enum wmi_data_hdr_data_type data_type,
  1571. u8 meta_ver, void *tx_meta_info);
  1572. int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
  1573. int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb);
  1574. int ath6kl_wmi_data_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
  1575. int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, struct sk_buff *skb,
  1576. u32 layer2_priority, bool wmm_enabled,
  1577. u8 *ac);
  1578. int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb);
  1579. void ath6kl_wmi_iterate_nodes(struct wmi *wmi,
  1580. void (*f) (void *arg, struct bss *),
  1581. void *arg);
  1582. struct bss *ath6kl_wmi_find_node(struct wmi *wmi, const u8 *mac_addr);
  1583. void ath6kl_wmi_node_free(struct wmi *wmi, const u8 *mac_addr);
  1584. int ath6kl_wmi_cmd_send(struct wmi *wmi, struct sk_buff *skb,
  1585. enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag);
  1586. int ath6kl_wmi_connect_cmd(struct wmi *wmi, enum network_type nw_type,
  1587. enum dot11_auth_mode dot11_auth_mode,
  1588. enum auth_mode auth_mode,
  1589. enum crypto_type pairwise_crypto,
  1590. u8 pairwise_crypto_len,
  1591. enum crypto_type group_crypto,
  1592. u8 group_crypto_len, int ssid_len, u8 *ssid,
  1593. u8 *bssid, u16 channel, u32 ctrl_flags);
  1594. int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 *bssid, u16 channel);
  1595. int ath6kl_wmi_disconnect_cmd(struct wmi *wmi);
  1596. int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
  1597. u32 force_fgscan, u32 is_legacy,
  1598. u32 home_dwell_time, u32 force_scan_interval,
  1599. s8 num_chan, u16 *ch_list);
  1600. int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u16 fg_start_sec,
  1601. u16 fg_end_sec, u16 bg_sec,
  1602. u16 minact_chdw_msec, u16 maxact_chdw_msec,
  1603. u16 pas_chdw_msec, u8 short_scan_ratio,
  1604. u8 scan_ctrl_flag, u32 max_dfsch_act_time,
  1605. u16 maxact_scan_per_ssid);
  1606. int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 filter, u32 ie_mask);
  1607. int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 index, u8 flag,
  1608. u8 ssid_len, u8 *ssid);
  1609. int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u16 listen_interval,
  1610. u16 listen_beacons);
  1611. int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 pwr_mode);
  1612. int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u16 idle_period,
  1613. u16 ps_poll_num, u16 dtim_policy,
  1614. u16 tx_wakup_policy, u16 num_tx_to_wakeup,
  1615. u16 ps_fail_event_policy);
  1616. int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 timeout);
  1617. int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi,
  1618. struct wmi_create_pstream_cmd *pstream);
  1619. int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 traffic_class, u8 tsid);
  1620. int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold);
  1621. int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 status,
  1622. u8 preamble_policy);
  1623. int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
  1624. int ath6kl_wmi_get_stats_cmd(struct wmi *wmi);
  1625. int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 key_index,
  1626. enum crypto_type key_type,
  1627. u8 key_usage, u8 key_len,
  1628. u8 *key_rsc, u8 *key_material,
  1629. u8 key_op_ctrl, u8 *mac_addr,
  1630. enum wmi_sync_flag sync_flag);
  1631. int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 *krk);
  1632. int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 key_index);
  1633. int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, const u8 *bssid,
  1634. const u8 *pmkid, bool set);
  1635. int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 dbM);
  1636. int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi);
  1637. void ath6kl_wmi_get_current_bssid(struct wmi *wmi, u8 *bssid);
  1638. int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, enum wmi_txop_cfg cfg);
  1639. int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 keep_alive_intvl);
  1640. s32 ath6kl_wmi_get_rate(s8 rate_index);
  1641. int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, struct wmi_set_ip_cmd *ip_cmd);
  1642. struct bss *ath6kl_wmi_find_ssid_node(struct wmi *wmi, u8 *ssid,
  1643. u32 ssid_len, bool is_wpa2,
  1644. bool match_ssid);
  1645. void ath6kl_wmi_node_return(struct wmi *wmi, struct bss *bss);
  1646. /* AP mode */
  1647. int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u16 aid, bool flag);
  1648. int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 rx_meta_version,
  1649. bool rx_dot11_hdr, bool defrag_on_host);
  1650. void *ath6kl_wmi_init(void *devt);
  1651. void ath6kl_wmi_shutdown(struct wmi *wmi);
  1652. #endif /* WMI_H */