wmi.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612
  1. /*
  2. * Copyright (c) 2010-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /*
  18. * This file contains the definitions of the WMI protocol specified in the
  19. * Wireless Module Interface (WMI). It includes definitions of all the
  20. * commands and events. Commands are messages from the host to the WM.
  21. * Events and Replies are messages from the WM to the host.
  22. */
  23. #ifndef WMI_H
  24. #define WMI_H
  25. #include <linux/ieee80211.h>
  26. #include "htc.h"
  27. #define HTC_PROTOCOL_VERSION 0x0002
  28. #define WMI_PROTOCOL_VERSION 0x0002
  29. #define WMI_CONTROL_MSG_MAX_LEN 256
  30. #define is_ethertype(type_or_len) ((type_or_len) >= 0x0600)
  31. #define IP_ETHERTYPE 0x0800
  32. #define WMI_IMPLICIT_PSTREAM 0xFF
  33. #define WMI_MAX_THINSTREAM 15
  34. #define SSID_IE_LEN_INDEX 13
  35. /* Host side link management data structures */
  36. #define SIG_QUALITY_THRESH_LVLS 6
  37. #define SIG_QUALITY_UPPER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  38. #define SIG_QUALITY_LOWER_THRESH_LVLS SIG_QUALITY_THRESH_LVLS
  39. #define A_BAND_24GHZ 0
  40. #define A_BAND_5GHZ 1
  41. #define A_NUM_BANDS 2
  42. /* in ms */
  43. #define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000
  44. /*
  45. * There are no signed versions of __le16 and __le32, so for a temporary
  46. * solution come up with our own version. The idea is from fs/ntfs/types.h.
  47. *
  48. * Use a_ prefix so that it doesn't conflict if we get proper support to
  49. * linux/types.h.
  50. */
  51. typedef __s16 __bitwise a_sle16;
  52. typedef __s32 __bitwise a_sle32;
  53. static inline a_sle32 a_cpu_to_sle32(s32 val)
  54. {
  55. return (__force a_sle32) cpu_to_le32(val);
  56. }
  57. static inline s32 a_sle32_to_cpu(a_sle32 val)
  58. {
  59. return le32_to_cpu((__force __le32) val);
  60. }
  61. static inline a_sle16 a_cpu_to_sle16(s16 val)
  62. {
  63. return (__force a_sle16) cpu_to_le16(val);
  64. }
  65. static inline s16 a_sle16_to_cpu(a_sle16 val)
  66. {
  67. return le16_to_cpu((__force __le16) val);
  68. }
  69. struct sq_threshold_params {
  70. s16 upper_threshold[SIG_QUALITY_UPPER_THRESH_LVLS];
  71. s16 lower_threshold[SIG_QUALITY_LOWER_THRESH_LVLS];
  72. u32 upper_threshold_valid_count;
  73. u32 lower_threshold_valid_count;
  74. u32 polling_interval;
  75. u8 weight;
  76. u8 last_rssi;
  77. u8 last_rssi_poll_event;
  78. };
  79. struct wmi_data_sync_bufs {
  80. u8 traffic_class;
  81. struct sk_buff *skb;
  82. };
  83. /* WMM stream classes */
  84. #define WMM_NUM_AC 4
  85. #define WMM_AC_BE 0 /* best effort */
  86. #define WMM_AC_BK 1 /* background */
  87. #define WMM_AC_VI 2 /* video */
  88. #define WMM_AC_VO 3 /* voice */
  89. #define WMI_VOICE_USER_PRIORITY 0x7
  90. struct wmi {
  91. u16 stream_exist_for_ac[WMM_NUM_AC];
  92. u8 fat_pipe_exist;
  93. struct ath6kl *parent_dev;
  94. u8 pwr_mode;
  95. /* protects fat_pipe_exist and stream_exist_for_ac */
  96. spinlock_t lock;
  97. enum htc_endpoint_id ep_id;
  98. struct sq_threshold_params
  99. sq_threshld[SIGNAL_QUALITY_METRICS_NUM_MAX];
  100. bool is_wmm_enabled;
  101. u8 traffic_class;
  102. bool is_probe_ssid;
  103. u8 *last_mgmt_tx_frame;
  104. size_t last_mgmt_tx_frame_len;
  105. u8 saved_pwr_mode;
  106. };
  107. struct host_app_area {
  108. __le32 wmi_protocol_ver;
  109. } __packed;
  110. enum wmi_msg_type {
  111. DATA_MSGTYPE = 0x0,
  112. CNTL_MSGTYPE,
  113. SYNC_MSGTYPE,
  114. OPT_MSGTYPE,
  115. };
  116. /*
  117. * Macros for operating on WMI_DATA_HDR (info) field
  118. */
  119. #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
  120. #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
  121. #define WMI_DATA_HDR_UP_MASK 0x07
  122. #define WMI_DATA_HDR_UP_SHIFT 2
  123. /* In AP mode, the same bit (b5) is used to indicate Power save state in
  124. * the Rx dir and More data bit state in the tx direction.
  125. */
  126. #define WMI_DATA_HDR_PS_MASK 0x1
  127. #define WMI_DATA_HDR_PS_SHIFT 5
  128. #define WMI_DATA_HDR_MORE 0x20
  129. enum wmi_data_hdr_data_type {
  130. WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
  131. WMI_DATA_HDR_DATA_TYPE_802_11,
  132. /* used to be used for the PAL */
  133. WMI_DATA_HDR_DATA_TYPE_ACL,
  134. };
  135. /* Bitmap of data header flags */
  136. enum wmi_data_hdr_flags {
  137. WMI_DATA_HDR_FLAGS_MORE = 0x1,
  138. WMI_DATA_HDR_FLAGS_EOSP = 0x2,
  139. WMI_DATA_HDR_FLAGS_UAPSD = 0x4,
  140. };
  141. #define WMI_DATA_HDR_DATA_TYPE_MASK 0x3
  142. #define WMI_DATA_HDR_DATA_TYPE_SHIFT 6
  143. /* Macros for operating on WMI_DATA_HDR (info2) field */
  144. #define WMI_DATA_HDR_SEQNO_MASK 0xFFF
  145. #define WMI_DATA_HDR_SEQNO_SHIFT 0
  146. #define WMI_DATA_HDR_AMSDU_MASK 0x1
  147. #define WMI_DATA_HDR_AMSDU_SHIFT 12
  148. #define WMI_DATA_HDR_META_MASK 0x7
  149. #define WMI_DATA_HDR_META_SHIFT 13
  150. #define WMI_DATA_HDR_PAD_BEFORE_DATA_MASK 0xFF
  151. #define WMI_DATA_HDR_PAD_BEFORE_DATA_SHIFT 0x8
  152. /* Macros for operating on WMI_DATA_HDR (info3) field */
  153. #define WMI_DATA_HDR_IF_IDX_MASK 0xF
  154. #define WMI_DATA_HDR_TRIG 0x10
  155. #define WMI_DATA_HDR_EOSP 0x10
  156. struct wmi_data_hdr {
  157. s8 rssi;
  158. /*
  159. * usage of 'info' field(8-bit):
  160. *
  161. * b1:b0 - WMI_MSG_TYPE
  162. * b4:b3:b2 - UP(tid)
  163. * b5 - Used in AP mode.
  164. * More-data in tx dir, PS in rx.
  165. * b7:b6 - Dot3 header(0),
  166. * Dot11 Header(1),
  167. * ACL data(2)
  168. */
  169. u8 info;
  170. /*
  171. * usage of 'info2' field(16-bit):
  172. *
  173. * b11:b0 - seq_no
  174. * b12 - A-MSDU?
  175. * b15:b13 - META_DATA_VERSION 0 - 7
  176. */
  177. __le16 info2;
  178. /*
  179. * usage of info3, 16-bit:
  180. * b3:b0 - Interface index
  181. * b4 - uAPSD trigger in rx & EOSP in tx
  182. * b15:b5 - Reserved
  183. */
  184. __le16 info3;
  185. } __packed;
  186. static inline u8 wmi_data_hdr_get_up(struct wmi_data_hdr *dhdr)
  187. {
  188. return (dhdr->info >> WMI_DATA_HDR_UP_SHIFT) & WMI_DATA_HDR_UP_MASK;
  189. }
  190. static inline void wmi_data_hdr_set_up(struct wmi_data_hdr *dhdr,
  191. u8 usr_pri)
  192. {
  193. dhdr->info &= ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT);
  194. dhdr->info |= usr_pri << WMI_DATA_HDR_UP_SHIFT;
  195. }
  196. static inline u8 wmi_data_hdr_get_dot11(struct wmi_data_hdr *dhdr)
  197. {
  198. u8 data_type;
  199. data_type = (dhdr->info >> WMI_DATA_HDR_DATA_TYPE_SHIFT) &
  200. WMI_DATA_HDR_DATA_TYPE_MASK;
  201. return (data_type == WMI_DATA_HDR_DATA_TYPE_802_11);
  202. }
  203. static inline u16 wmi_data_hdr_get_seqno(struct wmi_data_hdr *dhdr)
  204. {
  205. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_SEQNO_SHIFT) &
  206. WMI_DATA_HDR_SEQNO_MASK;
  207. }
  208. static inline u8 wmi_data_hdr_is_amsdu(struct wmi_data_hdr *dhdr)
  209. {
  210. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_AMSDU_SHIFT) &
  211. WMI_DATA_HDR_AMSDU_MASK;
  212. }
  213. static inline u8 wmi_data_hdr_get_meta(struct wmi_data_hdr *dhdr)
  214. {
  215. return (le16_to_cpu(dhdr->info2) >> WMI_DATA_HDR_META_SHIFT) &
  216. WMI_DATA_HDR_META_MASK;
  217. }
  218. static inline u8 wmi_data_hdr_get_if_idx(struct wmi_data_hdr *dhdr)
  219. {
  220. return le16_to_cpu(dhdr->info3) & WMI_DATA_HDR_IF_IDX_MASK;
  221. }
  222. /* Tx meta version definitions */
  223. #define WMI_MAX_TX_META_SZ 12
  224. #define WMI_META_VERSION_1 0x01
  225. #define WMI_META_VERSION_2 0x02
  226. /* Flag to signal to FW to calculate TCP checksum */
  227. #define WMI_META_V2_FLAG_CSUM_OFFLOAD 0x01
  228. struct wmi_tx_meta_v1 {
  229. /* packet ID to identify the tx request */
  230. u8 pkt_id;
  231. /* rate policy to be used for the tx of this frame */
  232. u8 rate_plcy_id;
  233. } __packed;
  234. struct wmi_tx_meta_v2 {
  235. /*
  236. * Offset from start of the WMI header for csum calculation to
  237. * begin.
  238. */
  239. u8 csum_start;
  240. /* offset from start of WMI header where final csum goes */
  241. u8 csum_dest;
  242. /* no of bytes over which csum is calculated */
  243. u8 csum_flags;
  244. } __packed;
  245. struct wmi_rx_meta_v1 {
  246. u8 status;
  247. /* rate index mapped to rate at which this packet was received. */
  248. u8 rix;
  249. /* rssi of packet */
  250. u8 rssi;
  251. /* rf channel during packet reception */
  252. u8 channel;
  253. __le16 flags;
  254. } __packed;
  255. struct wmi_rx_meta_v2 {
  256. __le16 csum;
  257. /* bit 0 set -partial csum valid bit 1 set -test mode */
  258. u8 csum_flags;
  259. } __packed;
  260. #define WMI_CMD_HDR_IF_ID_MASK 0xF
  261. /* Control Path */
  262. struct wmi_cmd_hdr {
  263. __le16 cmd_id;
  264. /* info1 - 16 bits
  265. * b03:b00 - id
  266. * b15:b04 - unused */
  267. __le16 info1;
  268. /* for alignment */
  269. __le16 reserved;
  270. } __packed;
  271. static inline u8 wmi_cmd_hdr_get_if_idx(struct wmi_cmd_hdr *chdr)
  272. {
  273. return le16_to_cpu(chdr->info1) & WMI_CMD_HDR_IF_ID_MASK;
  274. }
  275. /* List of WMI commands */
  276. enum wmi_cmd_id {
  277. WMI_CONNECT_CMDID = 0x0001,
  278. WMI_RECONNECT_CMDID,
  279. WMI_DISCONNECT_CMDID,
  280. WMI_SYNCHRONIZE_CMDID,
  281. WMI_CREATE_PSTREAM_CMDID,
  282. WMI_DELETE_PSTREAM_CMDID,
  283. /* WMI_START_SCAN_CMDID is to be deprecated. Use
  284. * WMI_BEGIN_SCAN_CMDID instead. The new cmd supports P2P mgmt
  285. * operations using station interface.
  286. */
  287. WMI_START_SCAN_CMDID,
  288. WMI_SET_SCAN_PARAMS_CMDID,
  289. WMI_SET_BSS_FILTER_CMDID,
  290. WMI_SET_PROBED_SSID_CMDID, /* 10 */
  291. WMI_SET_LISTEN_INT_CMDID,
  292. WMI_SET_BMISS_TIME_CMDID,
  293. WMI_SET_DISC_TIMEOUT_CMDID,
  294. WMI_GET_CHANNEL_LIST_CMDID,
  295. WMI_SET_BEACON_INT_CMDID,
  296. WMI_GET_STATISTICS_CMDID,
  297. WMI_SET_CHANNEL_PARAMS_CMDID,
  298. WMI_SET_POWER_MODE_CMDID,
  299. WMI_SET_IBSS_PM_CAPS_CMDID,
  300. WMI_SET_POWER_PARAMS_CMDID, /* 20 */
  301. WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
  302. WMI_ADD_CIPHER_KEY_CMDID,
  303. WMI_DELETE_CIPHER_KEY_CMDID,
  304. WMI_ADD_KRK_CMDID,
  305. WMI_DELETE_KRK_CMDID,
  306. WMI_SET_PMKID_CMDID,
  307. WMI_SET_TX_PWR_CMDID,
  308. WMI_GET_TX_PWR_CMDID,
  309. WMI_SET_ASSOC_INFO_CMDID,
  310. WMI_ADD_BAD_AP_CMDID, /* 30 */
  311. WMI_DELETE_BAD_AP_CMDID,
  312. WMI_SET_TKIP_COUNTERMEASURES_CMDID,
  313. WMI_RSSI_THRESHOLD_PARAMS_CMDID,
  314. WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
  315. WMI_SET_ACCESS_PARAMS_CMDID,
  316. WMI_SET_RETRY_LIMITS_CMDID,
  317. WMI_SET_OPT_MODE_CMDID,
  318. WMI_OPT_TX_FRAME_CMDID,
  319. WMI_SET_VOICE_PKT_SIZE_CMDID,
  320. WMI_SET_MAX_SP_LEN_CMDID, /* 40 */
  321. WMI_SET_ROAM_CTRL_CMDID,
  322. WMI_GET_ROAM_TBL_CMDID,
  323. WMI_GET_ROAM_DATA_CMDID,
  324. WMI_ENABLE_RM_CMDID,
  325. WMI_SET_MAX_OFFHOME_DURATION_CMDID,
  326. WMI_EXTENSION_CMDID, /* Non-wireless extensions */
  327. WMI_SNR_THRESHOLD_PARAMS_CMDID,
  328. WMI_LQ_THRESHOLD_PARAMS_CMDID,
  329. WMI_SET_LPREAMBLE_CMDID,
  330. WMI_SET_RTS_CMDID, /* 50 */
  331. WMI_CLR_RSSI_SNR_CMDID,
  332. WMI_SET_FIXRATES_CMDID,
  333. WMI_GET_FIXRATES_CMDID,
  334. WMI_SET_AUTH_MODE_CMDID,
  335. WMI_SET_REASSOC_MODE_CMDID,
  336. WMI_SET_WMM_CMDID,
  337. WMI_SET_WMM_TXOP_CMDID,
  338. WMI_TEST_CMDID,
  339. /* COEX AR6002 only */
  340. WMI_SET_BT_STATUS_CMDID,
  341. WMI_SET_BT_PARAMS_CMDID, /* 60 */
  342. WMI_SET_KEEPALIVE_CMDID,
  343. WMI_GET_KEEPALIVE_CMDID,
  344. WMI_SET_APPIE_CMDID,
  345. WMI_GET_APPIE_CMDID,
  346. WMI_SET_WSC_STATUS_CMDID,
  347. /* Wake on Wireless */
  348. WMI_SET_HOST_SLEEP_MODE_CMDID,
  349. WMI_SET_WOW_MODE_CMDID,
  350. WMI_GET_WOW_LIST_CMDID,
  351. WMI_ADD_WOW_PATTERN_CMDID,
  352. WMI_DEL_WOW_PATTERN_CMDID, /* 70 */
  353. WMI_SET_FRAMERATES_CMDID,
  354. WMI_SET_AP_PS_CMDID,
  355. WMI_SET_QOS_SUPP_CMDID,
  356. WMI_SET_IE_CMDID,
  357. /* WMI_THIN_RESERVED_... mark the start and end
  358. * values for WMI_THIN_RESERVED command IDs. These
  359. * command IDs can be found in wmi_thin.h */
  360. WMI_THIN_RESERVED_START = 0x8000,
  361. WMI_THIN_RESERVED_END = 0x8fff,
  362. /* Developer commands starts at 0xF000 */
  363. WMI_SET_BITRATE_CMDID = 0xF000,
  364. WMI_GET_BITRATE_CMDID,
  365. WMI_SET_WHALPARAM_CMDID,
  366. WMI_SET_MAC_ADDRESS_CMDID,
  367. WMI_SET_AKMP_PARAMS_CMDID,
  368. WMI_SET_PMKID_LIST_CMDID,
  369. WMI_GET_PMKID_LIST_CMDID,
  370. WMI_ABORT_SCAN_CMDID,
  371. WMI_SET_TARGET_EVENT_REPORT_CMDID,
  372. /* Unused */
  373. WMI_UNUSED1,
  374. WMI_UNUSED2,
  375. /* AP mode commands */
  376. WMI_AP_HIDDEN_SSID_CMDID,
  377. WMI_AP_SET_NUM_STA_CMDID,
  378. WMI_AP_ACL_POLICY_CMDID,
  379. WMI_AP_ACL_MAC_LIST_CMDID,
  380. WMI_AP_CONFIG_COMMIT_CMDID,
  381. WMI_AP_SET_MLME_CMDID,
  382. WMI_AP_SET_PVB_CMDID,
  383. WMI_AP_CONN_INACT_CMDID,
  384. WMI_AP_PROT_SCAN_TIME_CMDID,
  385. WMI_AP_SET_COUNTRY_CMDID,
  386. WMI_AP_SET_DTIM_CMDID,
  387. WMI_AP_MODE_STAT_CMDID,
  388. WMI_SET_IP_CMDID,
  389. WMI_SET_PARAMS_CMDID,
  390. WMI_SET_MCAST_FILTER_CMDID,
  391. WMI_DEL_MCAST_FILTER_CMDID,
  392. WMI_ALLOW_AGGR_CMDID,
  393. WMI_ADDBA_REQ_CMDID,
  394. WMI_DELBA_REQ_CMDID,
  395. WMI_SET_HT_CAP_CMDID,
  396. WMI_SET_HT_OP_CMDID,
  397. WMI_SET_TX_SELECT_RATES_CMDID,
  398. WMI_SET_TX_SGI_PARAM_CMDID,
  399. WMI_SET_RATE_POLICY_CMDID,
  400. WMI_HCI_CMD_CMDID,
  401. WMI_RX_FRAME_FORMAT_CMDID,
  402. WMI_SET_THIN_MODE_CMDID,
  403. WMI_SET_BT_WLAN_CONN_PRECEDENCE_CMDID,
  404. WMI_AP_SET_11BG_RATESET_CMDID,
  405. WMI_SET_PMK_CMDID,
  406. WMI_MCAST_FILTER_CMDID,
  407. /* COEX CMDID AR6003 */
  408. WMI_SET_BTCOEX_FE_ANT_CMDID,
  409. WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
  410. WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
  411. WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
  412. WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
  413. WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
  414. WMI_SET_BTCOEX_DEBUG_CMDID,
  415. WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
  416. WMI_GET_BTCOEX_STATS_CMDID,
  417. WMI_GET_BTCOEX_CONFIG_CMDID,
  418. WMI_SET_DFS_ENABLE_CMDID, /* F034 */
  419. WMI_SET_DFS_MINRSSITHRESH_CMDID,
  420. WMI_SET_DFS_MAXPULSEDUR_CMDID,
  421. WMI_DFS_RADAR_DETECTED_CMDID,
  422. /* P2P commands */
  423. WMI_P2P_SET_CONFIG_CMDID, /* F038 */
  424. WMI_WPS_SET_CONFIG_CMDID,
  425. WMI_SET_REQ_DEV_ATTR_CMDID,
  426. WMI_P2P_FIND_CMDID,
  427. WMI_P2P_STOP_FIND_CMDID,
  428. WMI_P2P_GO_NEG_START_CMDID,
  429. WMI_P2P_LISTEN_CMDID,
  430. WMI_CONFIG_TX_MAC_RULES_CMDID, /* F040 */
  431. WMI_SET_PROMISCUOUS_MODE_CMDID,
  432. WMI_RX_FRAME_FILTER_CMDID,
  433. WMI_SET_CHANNEL_CMDID,
  434. /* WAC commands */
  435. WMI_ENABLE_WAC_CMDID,
  436. WMI_WAC_SCAN_REPLY_CMDID,
  437. WMI_WAC_CTRL_REQ_CMDID,
  438. WMI_SET_DIV_PARAMS_CMDID,
  439. WMI_GET_PMK_CMDID,
  440. WMI_SET_PASSPHRASE_CMDID,
  441. WMI_SEND_ASSOC_RES_CMDID,
  442. WMI_SET_ASSOC_REQ_RELAY_CMDID,
  443. /* ACS command, consists of sub-commands */
  444. WMI_ACS_CTRL_CMDID,
  445. WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
  446. WMI_SET_TBD_TIME_CMDID, /*added for wmiconfig command for TBD */
  447. /* Pktlog cmds */
  448. WMI_PKTLOG_ENABLE_CMDID,
  449. WMI_PKTLOG_DISABLE_CMDID,
  450. /* More P2P Cmds */
  451. WMI_P2P_GO_NEG_REQ_RSP_CMDID,
  452. WMI_P2P_GRP_INIT_CMDID,
  453. WMI_P2P_GRP_FORMATION_DONE_CMDID,
  454. WMI_P2P_INVITE_CMDID,
  455. WMI_P2P_INVITE_REQ_RSP_CMDID,
  456. WMI_P2P_PROV_DISC_REQ_CMDID,
  457. WMI_P2P_SET_CMDID,
  458. WMI_GET_RFKILL_MODE_CMDID,
  459. WMI_SET_RFKILL_MODE_CMDID,
  460. WMI_AP_SET_APSD_CMDID,
  461. WMI_AP_APSD_BUFFERED_TRAFFIC_CMDID,
  462. WMI_P2P_SDPD_TX_CMDID, /* F05C */
  463. WMI_P2P_STOP_SDPD_CMDID,
  464. WMI_P2P_CANCEL_CMDID,
  465. /* Ultra low power store / recall commands */
  466. WMI_STORERECALL_CONFIGURE_CMDID,
  467. WMI_STORERECALL_RECALL_CMDID,
  468. WMI_STORERECALL_HOST_READY_CMDID,
  469. WMI_FORCE_TARGET_ASSERT_CMDID,
  470. WMI_SET_PROBED_SSID_EX_CMDID,
  471. WMI_SET_NETWORK_LIST_OFFLOAD_CMDID,
  472. WMI_SET_ARP_NS_OFFLOAD_CMDID,
  473. WMI_ADD_WOW_EXT_PATTERN_CMDID,
  474. WMI_GTK_OFFLOAD_OP_CMDID,
  475. WMI_REMAIN_ON_CHNL_CMDID,
  476. WMI_CANCEL_REMAIN_ON_CHNL_CMDID,
  477. /* WMI_SEND_ACTION_CMDID is to be deprecated. Use
  478. * WMI_SEND_MGMT_CMDID instead. The new cmd supports P2P mgmt
  479. * operations using station interface.
  480. */
  481. WMI_SEND_ACTION_CMDID,
  482. WMI_PROBE_REQ_REPORT_CMDID,
  483. WMI_DISABLE_11B_RATES_CMDID,
  484. WMI_SEND_PROBE_RESPONSE_CMDID,
  485. WMI_GET_P2P_INFO_CMDID,
  486. WMI_AP_JOIN_BSS_CMDID,
  487. WMI_SMPS_ENABLE_CMDID,
  488. WMI_SMPS_CONFIG_CMDID,
  489. WMI_SET_RATECTRL_PARM_CMDID,
  490. /* LPL specific commands*/
  491. WMI_LPL_FORCE_ENABLE_CMDID,
  492. WMI_LPL_SET_POLICY_CMDID,
  493. WMI_LPL_GET_POLICY_CMDID,
  494. WMI_LPL_GET_HWSTATE_CMDID,
  495. WMI_LPL_SET_PARAMS_CMDID,
  496. WMI_LPL_GET_PARAMS_CMDID,
  497. WMI_SET_BUNDLE_PARAM_CMDID,
  498. /*GreenTx specific commands*/
  499. WMI_GREENTX_PARAMS_CMDID,
  500. WMI_RTT_MEASREQ_CMDID,
  501. WMI_RTT_CAPREQ_CMDID,
  502. WMI_RTT_STATUSREQ_CMDID,
  503. /* WPS Commands */
  504. WMI_WPS_START_CMDID,
  505. WMI_GET_WPS_STATUS_CMDID,
  506. /* More P2P commands */
  507. WMI_SET_NOA_CMDID,
  508. WMI_GET_NOA_CMDID,
  509. WMI_SET_OPPPS_CMDID,
  510. WMI_GET_OPPPS_CMDID,
  511. WMI_ADD_PORT_CMDID,
  512. WMI_DEL_PORT_CMDID,
  513. /* 802.11w cmd */
  514. WMI_SET_RSN_CAP_CMDID,
  515. WMI_GET_RSN_CAP_CMDID,
  516. WMI_SET_IGTK_CMDID,
  517. WMI_RX_FILTER_COALESCE_FILTER_OP_CMDID,
  518. WMI_RX_FILTER_SET_FRAME_TEST_LIST_CMDID,
  519. WMI_SEND_MGMT_CMDID,
  520. WMI_BEGIN_SCAN_CMDID,
  521. };
  522. enum wmi_mgmt_frame_type {
  523. WMI_FRAME_BEACON = 0,
  524. WMI_FRAME_PROBE_REQ,
  525. WMI_FRAME_PROBE_RESP,
  526. WMI_FRAME_ASSOC_REQ,
  527. WMI_FRAME_ASSOC_RESP,
  528. WMI_NUM_MGMT_FRAME
  529. };
  530. enum wmi_ie_field_type {
  531. WMI_RSN_IE_CAPB = 0x1,
  532. WMI_IE_FULL = 0xFF, /* indicats full IE */
  533. };
  534. /* WMI_CONNECT_CMDID */
  535. enum network_type {
  536. INFRA_NETWORK = 0x01,
  537. ADHOC_NETWORK = 0x02,
  538. ADHOC_CREATOR = 0x04,
  539. AP_NETWORK = 0x10,
  540. };
  541. enum network_subtype {
  542. SUBTYPE_NONE,
  543. SUBTYPE_BT,
  544. SUBTYPE_P2PDEV,
  545. SUBTYPE_P2PCLIENT,
  546. SUBTYPE_P2PGO,
  547. };
  548. enum dot11_auth_mode {
  549. OPEN_AUTH = 0x01,
  550. SHARED_AUTH = 0x02,
  551. /* different from IEEE_AUTH_MODE definitions */
  552. LEAP_AUTH = 0x04,
  553. };
  554. enum auth_mode {
  555. NONE_AUTH = 0x01,
  556. WPA_AUTH = 0x02,
  557. WPA2_AUTH = 0x04,
  558. WPA_PSK_AUTH = 0x08,
  559. WPA2_PSK_AUTH = 0x10,
  560. WPA_AUTH_CCKM = 0x20,
  561. WPA2_AUTH_CCKM = 0x40,
  562. };
  563. #define WMI_MAX_KEY_INDEX 3
  564. #define WMI_MAX_KEY_LEN 32
  565. /*
  566. * NB: these values are ordered carefully; there are lots of
  567. * of implications in any reordering. In particular beware
  568. * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
  569. */
  570. #define ATH6KL_CIPHER_WEP 0
  571. #define ATH6KL_CIPHER_TKIP 1
  572. #define ATH6KL_CIPHER_AES_OCB 2
  573. #define ATH6KL_CIPHER_AES_CCM 3
  574. #define ATH6KL_CIPHER_CKIP 5
  575. #define ATH6KL_CIPHER_CCKM_KRK 6
  576. #define ATH6KL_CIPHER_NONE 7 /* pseudo value */
  577. /*
  578. * 802.11 rate set.
  579. */
  580. #define ATH6KL_RATE_MAXSIZE 15 /* max rates we'll handle */
  581. #define ATH_OUI_TYPE 0x01
  582. #define WPA_OUI_TYPE 0x01
  583. #define WMM_PARAM_OUI_SUBTYPE 0x01
  584. #define WMM_OUI_TYPE 0x02
  585. #define WSC_OUT_TYPE 0x04
  586. enum wmi_connect_ctrl_flags_bits {
  587. CONNECT_ASSOC_POLICY_USER = 0x0001,
  588. CONNECT_SEND_REASSOC = 0x0002,
  589. CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
  590. CONNECT_PROFILE_MATCH_DONE = 0x0008,
  591. CONNECT_IGNORE_AAC_BEACON = 0x0010,
  592. CONNECT_CSA_FOLLOW_BSS = 0x0020,
  593. CONNECT_DO_WPA_OFFLOAD = 0x0040,
  594. CONNECT_DO_NOT_DEAUTH = 0x0080,
  595. CONNECT_WPS_FLAG = 0x0100,
  596. };
  597. struct wmi_connect_cmd {
  598. u8 nw_type;
  599. u8 dot11_auth_mode;
  600. u8 auth_mode;
  601. u8 prwise_crypto_type;
  602. u8 prwise_crypto_len;
  603. u8 grp_crypto_type;
  604. u8 grp_crypto_len;
  605. u8 ssid_len;
  606. u8 ssid[IEEE80211_MAX_SSID_LEN];
  607. __le16 ch;
  608. u8 bssid[ETH_ALEN];
  609. __le32 ctrl_flags;
  610. u8 nw_subtype;
  611. } __packed;
  612. /* WMI_RECONNECT_CMDID */
  613. struct wmi_reconnect_cmd {
  614. /* channel hint */
  615. __le16 channel;
  616. /* mandatory if set */
  617. u8 bssid[ETH_ALEN];
  618. } __packed;
  619. /* WMI_ADD_CIPHER_KEY_CMDID */
  620. enum key_usage {
  621. PAIRWISE_USAGE = 0x00,
  622. GROUP_USAGE = 0x01,
  623. /* default Tx Key - static WEP only */
  624. TX_USAGE = 0x02,
  625. };
  626. /*
  627. * Bit Flag
  628. * Bit 0 - Initialise TSC - default is Initialize
  629. */
  630. #define KEY_OP_INIT_TSC 0x01
  631. #define KEY_OP_INIT_RSC 0x02
  632. /* default initialise the TSC & RSC */
  633. #define KEY_OP_INIT_VAL 0x03
  634. #define KEY_OP_VALID_MASK 0x03
  635. struct wmi_add_cipher_key_cmd {
  636. u8 key_index;
  637. u8 key_type;
  638. /* enum key_usage */
  639. u8 key_usage;
  640. u8 key_len;
  641. /* key replay sequence counter */
  642. u8 key_rsc[8];
  643. u8 key[WLAN_MAX_KEY_LEN];
  644. /* additional key control info */
  645. u8 key_op_ctrl;
  646. u8 key_mac_addr[ETH_ALEN];
  647. } __packed;
  648. /* WMI_DELETE_CIPHER_KEY_CMDID */
  649. struct wmi_delete_cipher_key_cmd {
  650. u8 key_index;
  651. } __packed;
  652. #define WMI_KRK_LEN 16
  653. /* WMI_ADD_KRK_CMDID */
  654. struct wmi_add_krk_cmd {
  655. u8 krk[WMI_KRK_LEN];
  656. } __packed;
  657. /* WMI_SETPMKID_CMDID */
  658. #define WMI_PMKID_LEN 16
  659. enum pmkid_enable_flg {
  660. PMKID_DISABLE = 0,
  661. PMKID_ENABLE = 1,
  662. };
  663. struct wmi_setpmkid_cmd {
  664. u8 bssid[ETH_ALEN];
  665. /* enum pmkid_enable_flg */
  666. u8 enable;
  667. u8 pmkid[WMI_PMKID_LEN];
  668. } __packed;
  669. /* WMI_START_SCAN_CMD */
  670. enum wmi_scan_type {
  671. WMI_LONG_SCAN = 0,
  672. WMI_SHORT_SCAN = 1,
  673. };
  674. struct wmi_supp_rates {
  675. u8 nrates;
  676. u8 rates[ATH6KL_RATE_MAXSIZE];
  677. };
  678. struct wmi_begin_scan_cmd {
  679. __le32 force_fg_scan;
  680. /* for legacy cisco AP compatibility */
  681. __le32 is_legacy;
  682. /* max duration in the home channel(msec) */
  683. __le32 home_dwell_time;
  684. /* time interval between scans (msec) */
  685. __le32 force_scan_intvl;
  686. /* no CCK rates */
  687. __le32 no_cck;
  688. /* enum wmi_scan_type */
  689. u8 scan_type;
  690. /* Supported rates to advertise in the probe request frames */
  691. struct wmi_supp_rates supp_rates[IEEE80211_NUM_BANDS];
  692. /* how many channels follow */
  693. u8 num_ch;
  694. /* channels in Mhz */
  695. __le16 ch_list[1];
  696. } __packed;
  697. /* wmi_start_scan_cmd is to be deprecated. Use
  698. * wmi_begin_scan_cmd instead. The new structure supports P2P mgmt
  699. * operations using station interface.
  700. */
  701. struct wmi_start_scan_cmd {
  702. __le32 force_fg_scan;
  703. /* for legacy cisco AP compatibility */
  704. __le32 is_legacy;
  705. /* max duration in the home channel(msec) */
  706. __le32 home_dwell_time;
  707. /* time interval between scans (msec) */
  708. __le32 force_scan_intvl;
  709. /* enum wmi_scan_type */
  710. u8 scan_type;
  711. /* how many channels follow */
  712. u8 num_ch;
  713. /* channels in Mhz */
  714. __le16 ch_list[1];
  715. } __packed;
  716. /*
  717. * Warning: scan control flag value of 0xFF is used to disable
  718. * all flags in WMI_SCAN_PARAMS_CMD. Do not add any more
  719. * flags here
  720. */
  721. enum wmi_scan_ctrl_flags_bits {
  722. /* set if can scan in the connect cmd */
  723. CONNECT_SCAN_CTRL_FLAGS = 0x01,
  724. /* set if scan for the SSID it is already connected to */
  725. SCAN_CONNECTED_CTRL_FLAGS = 0x02,
  726. /* set if enable active scan */
  727. ACTIVE_SCAN_CTRL_FLAGS = 0x04,
  728. /* set if enable roam scan when bmiss and lowrssi */
  729. ROAM_SCAN_CTRL_FLAGS = 0x08,
  730. /* set if follows customer BSSINFO reporting rule */
  731. REPORT_BSSINFO_CTRL_FLAGS = 0x10,
  732. /* if disabled, target doesn't scan after a disconnect event */
  733. ENABLE_AUTO_CTRL_FLAGS = 0x20,
  734. /*
  735. * Scan complete event with canceled status will be generated when
  736. * a scan is prempted before it gets completed.
  737. */
  738. ENABLE_SCAN_ABORT_EVENT = 0x40
  739. };
  740. struct wmi_scan_params_cmd {
  741. /* sec */
  742. __le16 fg_start_period;
  743. /* sec */
  744. __le16 fg_end_period;
  745. /* sec */
  746. __le16 bg_period;
  747. /* msec */
  748. __le16 maxact_chdwell_time;
  749. /* msec */
  750. __le16 pas_chdwell_time;
  751. /* how many shorts scan for one long */
  752. u8 short_scan_ratio;
  753. u8 scan_ctrl_flags;
  754. /* msec */
  755. __le16 minact_chdwell_time;
  756. /* max active scans per ssid */
  757. __le16 maxact_scan_per_ssid;
  758. /* msecs */
  759. __le32 max_dfsch_act_time;
  760. } __packed;
  761. /* WMI_SET_BSS_FILTER_CMDID */
  762. enum wmi_bss_filter {
  763. /* no beacons forwarded */
  764. NONE_BSS_FILTER = 0x0,
  765. /* all beacons forwarded */
  766. ALL_BSS_FILTER,
  767. /* only beacons matching profile */
  768. PROFILE_FILTER,
  769. /* all but beacons matching profile */
  770. ALL_BUT_PROFILE_FILTER,
  771. /* only beacons matching current BSS */
  772. CURRENT_BSS_FILTER,
  773. /* all but beacons matching BSS */
  774. ALL_BUT_BSS_FILTER,
  775. /* beacons matching probed ssid */
  776. PROBED_SSID_FILTER,
  777. /* marker only */
  778. LAST_BSS_FILTER,
  779. };
  780. struct wmi_bss_filter_cmd {
  781. /* see, enum wmi_bss_filter */
  782. u8 bss_filter;
  783. /* for alignment */
  784. u8 reserved1;
  785. /* for alignment */
  786. __le16 reserved2;
  787. __le32 ie_mask;
  788. } __packed;
  789. /* WMI_SET_PROBED_SSID_CMDID */
  790. #define MAX_PROBED_SSID_INDEX 9
  791. enum wmi_ssid_flag {
  792. /* disables entry */
  793. DISABLE_SSID_FLAG = 0,
  794. /* probes specified ssid */
  795. SPECIFIC_SSID_FLAG = 0x01,
  796. /* probes for any ssid */
  797. ANY_SSID_FLAG = 0x02,
  798. };
  799. struct wmi_probed_ssid_cmd {
  800. /* 0 to MAX_PROBED_SSID_INDEX */
  801. u8 entry_index;
  802. /* see, enum wmi_ssid_flg */
  803. u8 flag;
  804. u8 ssid_len;
  805. u8 ssid[IEEE80211_MAX_SSID_LEN];
  806. } __packed;
  807. /*
  808. * WMI_SET_LISTEN_INT_CMDID
  809. * The Listen interval is between 15 and 3000 TUs
  810. */
  811. struct wmi_listen_int_cmd {
  812. __le16 listen_intvl;
  813. __le16 num_beacons;
  814. } __packed;
  815. /* WMI_SET_BMISS_TIME_CMDID */
  816. struct wmi_bmiss_time_cmd {
  817. __le16 bmiss_time;
  818. __le16 num_beacons;
  819. };
  820. /* WMI_SET_POWER_MODE_CMDID */
  821. enum wmi_power_mode {
  822. REC_POWER = 0x01,
  823. MAX_PERF_POWER,
  824. };
  825. struct wmi_power_mode_cmd {
  826. /* see, enum wmi_power_mode */
  827. u8 pwr_mode;
  828. } __packed;
  829. /*
  830. * Policy to determnine whether power save failure event should be sent to
  831. * host during scanning
  832. */
  833. enum power_save_fail_event_policy {
  834. SEND_POWER_SAVE_FAIL_EVENT_ALWAYS = 1,
  835. IGNORE_PS_FAIL_DURING_SCAN = 2,
  836. };
  837. struct wmi_power_params_cmd {
  838. /* msec */
  839. __le16 idle_period;
  840. __le16 pspoll_number;
  841. __le16 dtim_policy;
  842. __le16 tx_wakeup_policy;
  843. __le16 num_tx_to_wakeup;
  844. __le16 ps_fail_event_policy;
  845. } __packed;
  846. /* WMI_SET_DISC_TIMEOUT_CMDID */
  847. struct wmi_disc_timeout_cmd {
  848. /* seconds */
  849. u8 discon_timeout;
  850. } __packed;
  851. enum dir_type {
  852. UPLINK_TRAFFIC = 0,
  853. DNLINK_TRAFFIC = 1,
  854. BIDIR_TRAFFIC = 2,
  855. };
  856. enum voiceps_cap_type {
  857. DISABLE_FOR_THIS_AC = 0,
  858. ENABLE_FOR_THIS_AC = 1,
  859. ENABLE_FOR_ALL_AC = 2,
  860. };
  861. enum traffic_type {
  862. TRAFFIC_TYPE_APERIODIC = 0,
  863. TRAFFIC_TYPE_PERIODIC = 1,
  864. };
  865. /* WMI_SYNCHRONIZE_CMDID */
  866. struct wmi_sync_cmd {
  867. u8 data_sync_map;
  868. } __packed;
  869. /* WMI_CREATE_PSTREAM_CMDID */
  870. struct wmi_create_pstream_cmd {
  871. /* msec */
  872. __le32 min_service_int;
  873. /* msec */
  874. __le32 max_service_int;
  875. /* msec */
  876. __le32 inactivity_int;
  877. /* msec */
  878. __le32 suspension_int;
  879. __le32 service_start_time;
  880. /* in bps */
  881. __le32 min_data_rate;
  882. /* in bps */
  883. __le32 mean_data_rate;
  884. /* in bps */
  885. __le32 peak_data_rate;
  886. __le32 max_burst_size;
  887. __le32 delay_bound;
  888. /* in bps */
  889. __le32 min_phy_rate;
  890. __le32 sba;
  891. __le32 medium_time;
  892. /* in octects */
  893. __le16 nominal_msdu;
  894. /* in octects */
  895. __le16 max_msdu;
  896. u8 traffic_class;
  897. /* see, enum dir_type */
  898. u8 traffic_direc;
  899. u8 rx_queue_num;
  900. /* see, enum traffic_type */
  901. u8 traffic_type;
  902. /* see, enum voiceps_cap_type */
  903. u8 voice_psc_cap;
  904. u8 tsid;
  905. /* 802.1D user priority */
  906. u8 user_pri;
  907. /* nominal phy rate */
  908. u8 nominal_phy;
  909. } __packed;
  910. /* WMI_DELETE_PSTREAM_CMDID */
  911. struct wmi_delete_pstream_cmd {
  912. u8 tx_queue_num;
  913. u8 rx_queue_num;
  914. u8 traffic_direc;
  915. u8 traffic_class;
  916. u8 tsid;
  917. } __packed;
  918. /* WMI_SET_CHANNEL_PARAMS_CMDID */
  919. enum wmi_phy_mode {
  920. WMI_11A_MODE = 0x1,
  921. WMI_11G_MODE = 0x2,
  922. WMI_11AG_MODE = 0x3,
  923. WMI_11B_MODE = 0x4,
  924. WMI_11GONLY_MODE = 0x5,
  925. WMI_11G_HT20 = 0x6,
  926. };
  927. #define WMI_MAX_CHANNELS 32
  928. /*
  929. * WMI_RSSI_THRESHOLD_PARAMS_CMDID
  930. * Setting the polltime to 0 would disable polling. Threshold values are
  931. * in the ascending order, and should agree to:
  932. * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
  933. * < highThreshold_upperVal)
  934. */
  935. struct wmi_rssi_threshold_params_cmd {
  936. /* polling time as a factor of LI */
  937. __le32 poll_time;
  938. /* lowest of upper */
  939. a_sle16 thresh_above1_val;
  940. a_sle16 thresh_above2_val;
  941. a_sle16 thresh_above3_val;
  942. a_sle16 thresh_above4_val;
  943. a_sle16 thresh_above5_val;
  944. /* highest of upper */
  945. a_sle16 thresh_above6_val;
  946. /* lowest of bellow */
  947. a_sle16 thresh_below1_val;
  948. a_sle16 thresh_below2_val;
  949. a_sle16 thresh_below3_val;
  950. a_sle16 thresh_below4_val;
  951. a_sle16 thresh_below5_val;
  952. /* highest of bellow */
  953. a_sle16 thresh_below6_val;
  954. /* "alpha" */
  955. u8 weight;
  956. u8 reserved[3];
  957. } __packed;
  958. /*
  959. * WMI_SNR_THRESHOLD_PARAMS_CMDID
  960. * Setting the polltime to 0 would disable polling.
  961. */
  962. struct wmi_snr_threshold_params_cmd {
  963. /* polling time as a factor of LI */
  964. __le32 poll_time;
  965. /* "alpha" */
  966. u8 weight;
  967. /* lowest of uppper */
  968. u8 thresh_above1_val;
  969. u8 thresh_above2_val;
  970. u8 thresh_above3_val;
  971. /* highest of upper */
  972. u8 thresh_above4_val;
  973. /* lowest of bellow */
  974. u8 thresh_below1_val;
  975. u8 thresh_below2_val;
  976. u8 thresh_below3_val;
  977. /* highest of bellow */
  978. u8 thresh_below4_val;
  979. u8 reserved[3];
  980. } __packed;
  981. enum wmi_preamble_policy {
  982. WMI_IGNORE_BARKER_IN_ERP = 0,
  983. WMI_FOLLOW_BARKER_IN_ERP,
  984. };
  985. struct wmi_set_lpreamble_cmd {
  986. u8 status;
  987. u8 preamble_policy;
  988. } __packed;
  989. struct wmi_set_rts_cmd {
  990. __le16 threshold;
  991. } __packed;
  992. /* WMI_SET_TX_PWR_CMDID */
  993. struct wmi_set_tx_pwr_cmd {
  994. /* in dbM units */
  995. u8 dbM;
  996. } __packed;
  997. struct wmi_tx_pwr_reply {
  998. /* in dbM units */
  999. u8 dbM;
  1000. } __packed;
  1001. struct wmi_report_sleep_state_event {
  1002. __le32 sleep_state;
  1003. };
  1004. enum wmi_report_sleep_status {
  1005. WMI_REPORT_SLEEP_STATUS_IS_DEEP_SLEEP = 0,
  1006. WMI_REPORT_SLEEP_STATUS_IS_AWAKE
  1007. };
  1008. enum target_event_report_config {
  1009. /* default */
  1010. DISCONN_EVT_IN_RECONN = 0,
  1011. NO_DISCONN_EVT_IN_RECONN
  1012. };
  1013. struct wmi_mcast_filter_cmd {
  1014. u8 mcast_all_enable;
  1015. } __packed;
  1016. #define ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE 6
  1017. struct wmi_mcast_filter_add_del_cmd {
  1018. u8 mcast_mac[ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE];
  1019. } __packed;
  1020. struct wmi_set_htcap_cmd {
  1021. u8 band;
  1022. u8 ht_enable;
  1023. u8 ht40_supported;
  1024. u8 ht20_sgi;
  1025. u8 ht40_sgi;
  1026. u8 intolerant_40mhz;
  1027. u8 max_ampdu_len_exp;
  1028. } __packed;
  1029. /* Command Replies */
  1030. /* WMI_GET_CHANNEL_LIST_CMDID reply */
  1031. struct wmi_channel_list_reply {
  1032. u8 reserved;
  1033. /* number of channels in reply */
  1034. u8 num_ch;
  1035. /* channel in Mhz */
  1036. __le16 ch_list[1];
  1037. } __packed;
  1038. /* List of Events (target to host) */
  1039. enum wmi_event_id {
  1040. WMI_READY_EVENTID = 0x1001,
  1041. WMI_CONNECT_EVENTID,
  1042. WMI_DISCONNECT_EVENTID,
  1043. WMI_BSSINFO_EVENTID,
  1044. WMI_CMDERROR_EVENTID,
  1045. WMI_REGDOMAIN_EVENTID,
  1046. WMI_PSTREAM_TIMEOUT_EVENTID,
  1047. WMI_NEIGHBOR_REPORT_EVENTID,
  1048. WMI_TKIP_MICERR_EVENTID,
  1049. WMI_SCAN_COMPLETE_EVENTID, /* 0x100a */
  1050. WMI_REPORT_STATISTICS_EVENTID,
  1051. WMI_RSSI_THRESHOLD_EVENTID,
  1052. WMI_ERROR_REPORT_EVENTID,
  1053. WMI_OPT_RX_FRAME_EVENTID,
  1054. WMI_REPORT_ROAM_TBL_EVENTID,
  1055. WMI_EXTENSION_EVENTID,
  1056. WMI_CAC_EVENTID,
  1057. WMI_SNR_THRESHOLD_EVENTID,
  1058. WMI_LQ_THRESHOLD_EVENTID,
  1059. WMI_TX_RETRY_ERR_EVENTID, /* 0x1014 */
  1060. WMI_REPORT_ROAM_DATA_EVENTID,
  1061. WMI_TEST_EVENTID,
  1062. WMI_APLIST_EVENTID,
  1063. WMI_GET_WOW_LIST_EVENTID,
  1064. WMI_GET_PMKID_LIST_EVENTID,
  1065. WMI_CHANNEL_CHANGE_EVENTID,
  1066. WMI_PEER_NODE_EVENTID,
  1067. WMI_PSPOLL_EVENTID,
  1068. WMI_DTIMEXPIRY_EVENTID,
  1069. WMI_WLAN_VERSION_EVENTID,
  1070. WMI_SET_PARAMS_REPLY_EVENTID,
  1071. WMI_ADDBA_REQ_EVENTID, /*0x1020 */
  1072. WMI_ADDBA_RESP_EVENTID,
  1073. WMI_DELBA_REQ_EVENTID,
  1074. WMI_TX_COMPLETE_EVENTID,
  1075. WMI_HCI_EVENT_EVENTID,
  1076. WMI_ACL_DATA_EVENTID,
  1077. WMI_REPORT_SLEEP_STATE_EVENTID,
  1078. WMI_REPORT_BTCOEX_STATS_EVENTID,
  1079. WMI_REPORT_BTCOEX_CONFIG_EVENTID,
  1080. WMI_GET_PMK_EVENTID,
  1081. /* DFS Events */
  1082. WMI_DFS_HOST_ATTACH_EVENTID,
  1083. WMI_DFS_HOST_INIT_EVENTID,
  1084. WMI_DFS_RESET_DELAYLINES_EVENTID,
  1085. WMI_DFS_RESET_RADARQ_EVENTID,
  1086. WMI_DFS_RESET_AR_EVENTID,
  1087. WMI_DFS_RESET_ARQ_EVENTID,
  1088. WMI_DFS_SET_DUR_MULTIPLIER_EVENTID,
  1089. WMI_DFS_SET_BANGRADAR_EVENTID,
  1090. WMI_DFS_SET_DEBUGLEVEL_EVENTID,
  1091. WMI_DFS_PHYERR_EVENTID,
  1092. /* CCX Evants */
  1093. WMI_CCX_RM_STATUS_EVENTID,
  1094. /* P2P Events */
  1095. WMI_P2P_GO_NEG_RESULT_EVENTID,
  1096. WMI_WAC_SCAN_DONE_EVENTID,
  1097. WMI_WAC_REPORT_BSS_EVENTID,
  1098. WMI_WAC_START_WPS_EVENTID,
  1099. WMI_WAC_CTRL_REQ_REPLY_EVENTID,
  1100. WMI_REPORT_WMM_PARAMS_EVENTID,
  1101. WMI_WAC_REJECT_WPS_EVENTID,
  1102. /* More P2P Events */
  1103. WMI_P2P_GO_NEG_REQ_EVENTID,
  1104. WMI_P2P_INVITE_REQ_EVENTID,
  1105. WMI_P2P_INVITE_RCVD_RESULT_EVENTID,
  1106. WMI_P2P_INVITE_SENT_RESULT_EVENTID,
  1107. WMI_P2P_PROV_DISC_RESP_EVENTID,
  1108. WMI_P2P_PROV_DISC_REQ_EVENTID,
  1109. /* RFKILL Events */
  1110. WMI_RFKILL_STATE_CHANGE_EVENTID,
  1111. WMI_RFKILL_GET_MODE_CMD_EVENTID,
  1112. WMI_P2P_START_SDPD_EVENTID,
  1113. WMI_P2P_SDPD_RX_EVENTID,
  1114. WMI_SET_HOST_SLEEP_MODE_CMD_PROCESSED_EVENTID = 0x1047,
  1115. WMI_THIN_RESERVED_START_EVENTID = 0x8000,
  1116. /* Events in this range are reserved for thinmode */
  1117. WMI_THIN_RESERVED_END_EVENTID = 0x8fff,
  1118. WMI_SET_CHANNEL_EVENTID,
  1119. WMI_ASSOC_REQ_EVENTID,
  1120. /* Generic ACS event */
  1121. WMI_ACS_EVENTID,
  1122. WMI_STORERECALL_STORE_EVENTID,
  1123. WMI_WOW_EXT_WAKE_EVENTID,
  1124. WMI_GTK_OFFLOAD_STATUS_EVENTID,
  1125. WMI_NETWORK_LIST_OFFLOAD_EVENTID,
  1126. WMI_REMAIN_ON_CHNL_EVENTID,
  1127. WMI_CANCEL_REMAIN_ON_CHNL_EVENTID,
  1128. WMI_TX_STATUS_EVENTID,
  1129. WMI_RX_PROBE_REQ_EVENTID,
  1130. WMI_P2P_CAPABILITIES_EVENTID,
  1131. WMI_RX_ACTION_EVENTID,
  1132. WMI_P2P_INFO_EVENTID,
  1133. };
  1134. struct wmi_ready_event_2 {
  1135. __le32 sw_version;
  1136. __le32 abi_version;
  1137. u8 mac_addr[ETH_ALEN];
  1138. u8 phy_cap;
  1139. } __packed;
  1140. /* WMI_PHY_CAPABILITY */
  1141. enum wmi_phy_cap {
  1142. WMI_11A_CAP = 0x01,
  1143. WMI_11G_CAP = 0x02,
  1144. WMI_11AG_CAP = 0x03,
  1145. WMI_11AN_CAP = 0x04,
  1146. WMI_11GN_CAP = 0x05,
  1147. WMI_11AGN_CAP = 0x06,
  1148. };
  1149. /* Connect Event */
  1150. struct wmi_connect_event {
  1151. union {
  1152. struct {
  1153. __le16 ch;
  1154. u8 bssid[ETH_ALEN];
  1155. __le16 listen_intvl;
  1156. __le16 beacon_intvl;
  1157. __le32 nw_type;
  1158. } sta;
  1159. struct {
  1160. u8 phymode;
  1161. u8 aid;
  1162. u8 mac_addr[ETH_ALEN];
  1163. u8 auth;
  1164. u8 keymgmt;
  1165. __le16 cipher;
  1166. u8 apsd_info;
  1167. u8 unused[3];
  1168. } ap_sta;
  1169. struct {
  1170. __le16 ch;
  1171. u8 bssid[ETH_ALEN];
  1172. u8 unused[8];
  1173. } ap_bss;
  1174. } u;
  1175. u8 beacon_ie_len;
  1176. u8 assoc_req_len;
  1177. u8 assoc_resp_len;
  1178. u8 assoc_info[1];
  1179. } __packed;
  1180. /* Disconnect Event */
  1181. enum wmi_disconnect_reason {
  1182. NO_NETWORK_AVAIL = 0x01,
  1183. /* bmiss */
  1184. LOST_LINK = 0x02,
  1185. DISCONNECT_CMD = 0x03,
  1186. BSS_DISCONNECTED = 0x04,
  1187. AUTH_FAILED = 0x05,
  1188. ASSOC_FAILED = 0x06,
  1189. NO_RESOURCES_AVAIL = 0x07,
  1190. CSERV_DISCONNECT = 0x08,
  1191. INVALID_PROFILE = 0x0a,
  1192. DOT11H_CHANNEL_SWITCH = 0x0b,
  1193. PROFILE_MISMATCH = 0x0c,
  1194. CONNECTION_EVICTED = 0x0d,
  1195. IBSS_MERGE = 0xe,
  1196. };
  1197. /* AP mode disconnect proto_reasons */
  1198. enum ap_disconnect_reason {
  1199. WMI_AP_REASON_STA_LEFT = 101,
  1200. WMI_AP_REASON_FROM_HOST = 102,
  1201. WMI_AP_REASON_COMM_TIMEOUT = 103,
  1202. WMI_AP_REASON_MAX_STA = 104,
  1203. WMI_AP_REASON_ACL = 105,
  1204. WMI_AP_REASON_STA_ROAM = 106,
  1205. WMI_AP_REASON_DFS_CHANNEL = 107,
  1206. };
  1207. #define ATH6KL_COUNTRY_RD_SHIFT 16
  1208. struct ath6kl_wmi_regdomain {
  1209. __le32 reg_code;
  1210. };
  1211. struct wmi_disconnect_event {
  1212. /* reason code, see 802.11 spec. */
  1213. __le16 proto_reason_status;
  1214. /* set if known */
  1215. u8 bssid[ETH_ALEN];
  1216. /* see WMI_DISCONNECT_REASON */
  1217. u8 disconn_reason;
  1218. u8 assoc_resp_len;
  1219. u8 assoc_info[1];
  1220. } __packed;
  1221. /*
  1222. * BSS Info Event.
  1223. * Mechanism used to inform host of the presence and characteristic of
  1224. * wireless networks present. Consists of bss info header followed by
  1225. * the beacon or probe-response frame body. The 802.11 header is no included.
  1226. */
  1227. enum wmi_bi_ftype {
  1228. BEACON_FTYPE = 0x1,
  1229. PROBERESP_FTYPE,
  1230. ACTION_MGMT_FTYPE,
  1231. PROBEREQ_FTYPE,
  1232. };
  1233. #define DEF_LRSSI_SCAN_PERIOD 5
  1234. #define DEF_LRSSI_ROAM_THRESHOLD 20
  1235. #define DEF_LRSSI_ROAM_FLOOR 60
  1236. #define DEF_SCAN_FOR_ROAM_INTVL 2
  1237. enum wmi_roam_ctrl {
  1238. WMI_FORCE_ROAM = 1,
  1239. WMI_SET_ROAM_MODE,
  1240. WMI_SET_HOST_BIAS,
  1241. WMI_SET_LRSSI_SCAN_PARAMS,
  1242. };
  1243. enum wmi_roam_mode {
  1244. WMI_DEFAULT_ROAM_MODE = 1, /* RSSI based roam */
  1245. WMI_HOST_BIAS_ROAM_MODE = 2, /* Host bias based roam */
  1246. WMI_LOCK_BSS_MODE = 3, /* Lock to the current BSS */
  1247. };
  1248. struct bss_bias {
  1249. u8 bssid[ETH_ALEN];
  1250. s8 bias;
  1251. } __packed;
  1252. struct bss_bias_info {
  1253. u8 num_bss;
  1254. struct bss_bias bss_bias[0];
  1255. } __packed;
  1256. struct low_rssi_scan_params {
  1257. __le16 lrssi_scan_period;
  1258. a_sle16 lrssi_scan_threshold;
  1259. a_sle16 lrssi_roam_threshold;
  1260. u8 roam_rssi_floor;
  1261. u8 reserved[1];
  1262. } __packed;
  1263. struct roam_ctrl_cmd {
  1264. union {
  1265. u8 bssid[ETH_ALEN]; /* WMI_FORCE_ROAM */
  1266. u8 roam_mode; /* WMI_SET_ROAM_MODE */
  1267. struct bss_bias_info bss; /* WMI_SET_HOST_BIAS */
  1268. struct low_rssi_scan_params params; /* WMI_SET_LRSSI_SCAN_PARAMS
  1269. */
  1270. } __packed info;
  1271. u8 roam_ctrl;
  1272. } __packed;
  1273. /* BSS INFO HDR version 2.0 */
  1274. struct wmi_bss_info_hdr2 {
  1275. __le16 ch; /* frequency in MHz */
  1276. /* see, enum wmi_bi_ftype */
  1277. u8 frame_type;
  1278. u8 snr; /* note: rssi = snr - 95 dBm */
  1279. u8 bssid[ETH_ALEN];
  1280. __le16 ie_mask;
  1281. } __packed;
  1282. /* Command Error Event */
  1283. enum wmi_error_code {
  1284. INVALID_PARAM = 0x01,
  1285. ILLEGAL_STATE = 0x02,
  1286. INTERNAL_ERROR = 0x03,
  1287. };
  1288. struct wmi_cmd_error_event {
  1289. __le16 cmd_id;
  1290. u8 err_code;
  1291. } __packed;
  1292. struct wmi_pstream_timeout_event {
  1293. u8 tx_queue_num;
  1294. u8 rx_queue_num;
  1295. u8 traffic_direc;
  1296. u8 traffic_class;
  1297. } __packed;
  1298. /*
  1299. * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
  1300. * the host of BSS's it has found that matches the current profile.
  1301. * It can be used by the host to cache PMKs and/to initiate pre-authentication
  1302. * if the BSS supports it. The first bssid is always the current associated
  1303. * BSS.
  1304. * The bssid and bssFlags information repeats according to the number
  1305. * or APs reported.
  1306. */
  1307. enum wmi_bss_flags {
  1308. WMI_DEFAULT_BSS_FLAGS = 0x00,
  1309. WMI_PREAUTH_CAPABLE_BSS = 0x01,
  1310. WMI_PMKID_VALID_BSS = 0x02,
  1311. };
  1312. struct wmi_neighbor_info {
  1313. u8 bssid[ETH_ALEN];
  1314. u8 bss_flags; /* enum wmi_bss_flags */
  1315. } __packed;
  1316. struct wmi_neighbor_report_event {
  1317. u8 num_neighbors;
  1318. struct wmi_neighbor_info neighbor[0];
  1319. } __packed;
  1320. /* TKIP MIC Error Event */
  1321. struct wmi_tkip_micerr_event {
  1322. u8 key_id;
  1323. u8 is_mcast;
  1324. } __packed;
  1325. enum wmi_scan_status {
  1326. WMI_SCAN_STATUS_SUCCESS = 0,
  1327. };
  1328. /* WMI_SCAN_COMPLETE_EVENTID */
  1329. struct wmi_scan_complete_event {
  1330. a_sle32 status;
  1331. } __packed;
  1332. #define MAX_OPT_DATA_LEN 1400
  1333. /*
  1334. * Special frame receive Event.
  1335. * Mechanism used to inform host of the receiption of the special frames.
  1336. * Consists of special frame info header followed by special frame body.
  1337. * The 802.11 header is not included.
  1338. */
  1339. struct wmi_opt_rx_info_hdr {
  1340. __le16 ch;
  1341. u8 frame_type;
  1342. s8 snr;
  1343. u8 src_addr[ETH_ALEN];
  1344. u8 bssid[ETH_ALEN];
  1345. } __packed;
  1346. /* Reporting statistic */
  1347. struct tx_stats {
  1348. __le32 pkt;
  1349. __le32 byte;
  1350. __le32 ucast_pkt;
  1351. __le32 ucast_byte;
  1352. __le32 mcast_pkt;
  1353. __le32 mcast_byte;
  1354. __le32 bcast_pkt;
  1355. __le32 bcast_byte;
  1356. __le32 rts_success_cnt;
  1357. __le32 pkt_per_ac[4];
  1358. __le32 err_per_ac[4];
  1359. __le32 err;
  1360. __le32 fail_cnt;
  1361. __le32 retry_cnt;
  1362. __le32 mult_retry_cnt;
  1363. __le32 rts_fail_cnt;
  1364. a_sle32 ucast_rate;
  1365. } __packed;
  1366. struct rx_stats {
  1367. __le32 pkt;
  1368. __le32 byte;
  1369. __le32 ucast_pkt;
  1370. __le32 ucast_byte;
  1371. __le32 mcast_pkt;
  1372. __le32 mcast_byte;
  1373. __le32 bcast_pkt;
  1374. __le32 bcast_byte;
  1375. __le32 frgment_pkt;
  1376. __le32 err;
  1377. __le32 crc_err;
  1378. __le32 key_cache_miss;
  1379. __le32 decrypt_err;
  1380. __le32 dupl_frame;
  1381. a_sle32 ucast_rate;
  1382. } __packed;
  1383. struct tkip_ccmp_stats {
  1384. __le32 tkip_local_mic_fail;
  1385. __le32 tkip_cnter_measures_invoked;
  1386. __le32 tkip_replays;
  1387. __le32 tkip_fmt_err;
  1388. __le32 ccmp_fmt_err;
  1389. __le32 ccmp_replays;
  1390. } __packed;
  1391. struct pm_stats {
  1392. __le32 pwr_save_failure_cnt;
  1393. __le16 stop_tx_failure_cnt;
  1394. __le16 atim_tx_failure_cnt;
  1395. __le16 atim_rx_failure_cnt;
  1396. __le16 bcn_rx_failure_cnt;
  1397. } __packed;
  1398. struct cserv_stats {
  1399. __le32 cs_bmiss_cnt;
  1400. __le32 cs_low_rssi_cnt;
  1401. __le16 cs_connect_cnt;
  1402. __le16 cs_discon_cnt;
  1403. a_sle16 cs_ave_beacon_rssi;
  1404. __le16 cs_roam_count;
  1405. a_sle16 cs_rssi;
  1406. u8 cs_snr;
  1407. u8 cs_ave_beacon_snr;
  1408. u8 cs_last_roam_msec;
  1409. } __packed;
  1410. struct wlan_net_stats {
  1411. struct tx_stats tx;
  1412. struct rx_stats rx;
  1413. struct tkip_ccmp_stats tkip_ccmp_stats;
  1414. } __packed;
  1415. struct arp_stats {
  1416. __le32 arp_received;
  1417. __le32 arp_matched;
  1418. __le32 arp_replied;
  1419. } __packed;
  1420. struct wlan_wow_stats {
  1421. __le32 wow_pkt_dropped;
  1422. __le16 wow_evt_discarded;
  1423. u8 wow_host_pkt_wakeups;
  1424. u8 wow_host_evt_wakeups;
  1425. } __packed;
  1426. struct wmi_target_stats {
  1427. __le32 lq_val;
  1428. a_sle32 noise_floor_calib;
  1429. struct pm_stats pm_stats;
  1430. struct wlan_net_stats stats;
  1431. struct wlan_wow_stats wow_stats;
  1432. struct arp_stats arp_stats;
  1433. struct cserv_stats cserv_stats;
  1434. } __packed;
  1435. /*
  1436. * WMI_RSSI_THRESHOLD_EVENTID.
  1437. * Indicate the RSSI events to host. Events are indicated when we breach a
  1438. * thresold value.
  1439. */
  1440. enum wmi_rssi_threshold_val {
  1441. WMI_RSSI_THRESHOLD1_ABOVE = 0,
  1442. WMI_RSSI_THRESHOLD2_ABOVE,
  1443. WMI_RSSI_THRESHOLD3_ABOVE,
  1444. WMI_RSSI_THRESHOLD4_ABOVE,
  1445. WMI_RSSI_THRESHOLD5_ABOVE,
  1446. WMI_RSSI_THRESHOLD6_ABOVE,
  1447. WMI_RSSI_THRESHOLD1_BELOW,
  1448. WMI_RSSI_THRESHOLD2_BELOW,
  1449. WMI_RSSI_THRESHOLD3_BELOW,
  1450. WMI_RSSI_THRESHOLD4_BELOW,
  1451. WMI_RSSI_THRESHOLD5_BELOW,
  1452. WMI_RSSI_THRESHOLD6_BELOW
  1453. };
  1454. struct wmi_rssi_threshold_event {
  1455. a_sle16 rssi;
  1456. u8 range;
  1457. } __packed;
  1458. enum wmi_snr_threshold_val {
  1459. WMI_SNR_THRESHOLD1_ABOVE = 1,
  1460. WMI_SNR_THRESHOLD1_BELOW,
  1461. WMI_SNR_THRESHOLD2_ABOVE,
  1462. WMI_SNR_THRESHOLD2_BELOW,
  1463. WMI_SNR_THRESHOLD3_ABOVE,
  1464. WMI_SNR_THRESHOLD3_BELOW,
  1465. WMI_SNR_THRESHOLD4_ABOVE,
  1466. WMI_SNR_THRESHOLD4_BELOW
  1467. };
  1468. struct wmi_snr_threshold_event {
  1469. /* see, enum wmi_snr_threshold_val */
  1470. u8 range;
  1471. u8 snr;
  1472. } __packed;
  1473. /* WMI_REPORT_ROAM_TBL_EVENTID */
  1474. #define MAX_ROAM_TBL_CAND 5
  1475. struct wmi_bss_roam_info {
  1476. a_sle32 roam_util;
  1477. u8 bssid[ETH_ALEN];
  1478. s8 rssi;
  1479. s8 rssidt;
  1480. s8 last_rssi;
  1481. s8 util;
  1482. s8 bias;
  1483. /* for alignment */
  1484. u8 reserved;
  1485. } __packed;
  1486. struct wmi_target_roam_tbl {
  1487. __le16 roam_mode;
  1488. __le16 num_entries;
  1489. struct wmi_bss_roam_info info[];
  1490. } __packed;
  1491. /* WMI_CAC_EVENTID */
  1492. enum cac_indication {
  1493. CAC_INDICATION_ADMISSION = 0x00,
  1494. CAC_INDICATION_ADMISSION_RESP = 0x01,
  1495. CAC_INDICATION_DELETE = 0x02,
  1496. CAC_INDICATION_NO_RESP = 0x03,
  1497. };
  1498. #define WMM_TSPEC_IE_LEN 63
  1499. struct wmi_cac_event {
  1500. u8 ac;
  1501. u8 cac_indication;
  1502. u8 status_code;
  1503. u8 tspec_suggestion[WMM_TSPEC_IE_LEN];
  1504. } __packed;
  1505. /* WMI_APLIST_EVENTID */
  1506. enum aplist_ver {
  1507. APLIST_VER1 = 1,
  1508. };
  1509. struct wmi_ap_info_v1 {
  1510. u8 bssid[ETH_ALEN];
  1511. __le16 channel;
  1512. } __packed;
  1513. union wmi_ap_info {
  1514. struct wmi_ap_info_v1 ap_info_v1;
  1515. } __packed;
  1516. struct wmi_aplist_event {
  1517. u8 ap_list_ver;
  1518. u8 num_ap;
  1519. union wmi_ap_info ap_list[1];
  1520. } __packed;
  1521. /* Developer Commands */
  1522. /*
  1523. * WMI_SET_BITRATE_CMDID
  1524. *
  1525. * Get bit rate cmd uses same definition as set bit rate cmd
  1526. */
  1527. enum wmi_bit_rate {
  1528. RATE_AUTO = -1,
  1529. RATE_1Mb = 0,
  1530. RATE_2Mb = 1,
  1531. RATE_5_5Mb = 2,
  1532. RATE_11Mb = 3,
  1533. RATE_6Mb = 4,
  1534. RATE_9Mb = 5,
  1535. RATE_12Mb = 6,
  1536. RATE_18Mb = 7,
  1537. RATE_24Mb = 8,
  1538. RATE_36Mb = 9,
  1539. RATE_48Mb = 10,
  1540. RATE_54Mb = 11,
  1541. RATE_MCS_0_20 = 12,
  1542. RATE_MCS_1_20 = 13,
  1543. RATE_MCS_2_20 = 14,
  1544. RATE_MCS_3_20 = 15,
  1545. RATE_MCS_4_20 = 16,
  1546. RATE_MCS_5_20 = 17,
  1547. RATE_MCS_6_20 = 18,
  1548. RATE_MCS_7_20 = 19,
  1549. RATE_MCS_0_40 = 20,
  1550. RATE_MCS_1_40 = 21,
  1551. RATE_MCS_2_40 = 22,
  1552. RATE_MCS_3_40 = 23,
  1553. RATE_MCS_4_40 = 24,
  1554. RATE_MCS_5_40 = 25,
  1555. RATE_MCS_6_40 = 26,
  1556. RATE_MCS_7_40 = 27,
  1557. };
  1558. struct wmi_bit_rate_reply {
  1559. /* see, enum wmi_bit_rate */
  1560. s8 rate_index;
  1561. } __packed;
  1562. /*
  1563. * WMI_SET_FIXRATES_CMDID
  1564. *
  1565. * Get fix rates cmd uses same definition as set fix rates cmd
  1566. */
  1567. struct wmi_fix_rates_reply {
  1568. /* see wmi_bit_rate */
  1569. __le32 fix_rate_mask;
  1570. } __packed;
  1571. enum roam_data_type {
  1572. /* get the roam time data */
  1573. ROAM_DATA_TIME = 1,
  1574. };
  1575. struct wmi_target_roam_time {
  1576. __le32 disassoc_time;
  1577. __le32 no_txrx_time;
  1578. __le32 assoc_time;
  1579. __le32 allow_txrx_time;
  1580. u8 disassoc_bssid[ETH_ALEN];
  1581. s8 disassoc_bss_rssi;
  1582. u8 assoc_bssid[ETH_ALEN];
  1583. s8 assoc_bss_rssi;
  1584. } __packed;
  1585. enum wmi_txop_cfg {
  1586. WMI_TXOP_DISABLED = 0,
  1587. WMI_TXOP_ENABLED
  1588. };
  1589. struct wmi_set_wmm_txop_cmd {
  1590. u8 txop_enable;
  1591. } __packed;
  1592. struct wmi_set_keepalive_cmd {
  1593. u8 keep_alive_intvl;
  1594. } __packed;
  1595. struct wmi_get_keepalive_cmd {
  1596. __le32 configured;
  1597. u8 keep_alive_intvl;
  1598. } __packed;
  1599. struct wmi_set_appie_cmd {
  1600. u8 mgmt_frm_type; /* enum wmi_mgmt_frame_type */
  1601. u8 ie_len;
  1602. u8 ie_info[0];
  1603. } __packed;
  1604. struct wmi_set_ie_cmd {
  1605. u8 ie_id;
  1606. u8 ie_field; /* enum wmi_ie_field_type */
  1607. u8 ie_len;
  1608. u8 reserved;
  1609. u8 ie_info[0];
  1610. } __packed;
  1611. /* Notify the WSC registration status to the target */
  1612. #define WSC_REG_ACTIVE 1
  1613. #define WSC_REG_INACTIVE 0
  1614. #define WOW_MAX_FILTERS_PER_LIST 4
  1615. #define WOW_PATTERN_SIZE 64
  1616. #define WOW_MASK_SIZE 64
  1617. #define MAC_MAX_FILTERS_PER_LIST 4
  1618. struct wow_filter {
  1619. u8 wow_valid_filter;
  1620. u8 wow_filter_id;
  1621. u8 wow_filter_size;
  1622. u8 wow_filter_offset;
  1623. u8 wow_filter_mask[WOW_MASK_SIZE];
  1624. u8 wow_filter_pattern[WOW_PATTERN_SIZE];
  1625. } __packed;
  1626. #define MAX_IP_ADDRS 2
  1627. struct wmi_set_ip_cmd {
  1628. /* IP in network byte order */
  1629. __be32 ips[MAX_IP_ADDRS];
  1630. } __packed;
  1631. enum ath6kl_wow_filters {
  1632. WOW_FILTER_SSID = BIT(1),
  1633. WOW_FILTER_OPTION_MAGIC_PACKET = BIT(2),
  1634. WOW_FILTER_OPTION_EAP_REQ = BIT(3),
  1635. WOW_FILTER_OPTION_PATTERNS = BIT(4),
  1636. WOW_FILTER_OPTION_OFFLOAD_ARP = BIT(5),
  1637. WOW_FILTER_OPTION_OFFLOAD_NS = BIT(6),
  1638. WOW_FILTER_OPTION_OFFLOAD_GTK = BIT(7),
  1639. WOW_FILTER_OPTION_8021X_4WAYHS = BIT(8),
  1640. WOW_FILTER_OPTION_NLO_DISCVRY = BIT(9),
  1641. WOW_FILTER_OPTION_NWK_DISASSOC = BIT(10),
  1642. WOW_FILTER_OPTION_GTK_ERROR = BIT(11),
  1643. WOW_FILTER_OPTION_TEST_MODE = BIT(15),
  1644. };
  1645. enum ath6kl_host_mode {
  1646. ATH6KL_HOST_MODE_AWAKE,
  1647. ATH6KL_HOST_MODE_ASLEEP,
  1648. };
  1649. struct wmi_set_host_sleep_mode_cmd {
  1650. __le32 awake;
  1651. __le32 asleep;
  1652. } __packed;
  1653. enum ath6kl_wow_mode {
  1654. ATH6KL_WOW_MODE_DISABLE,
  1655. ATH6KL_WOW_MODE_ENABLE,
  1656. };
  1657. struct wmi_set_wow_mode_cmd {
  1658. __le32 enable_wow;
  1659. __le32 filter;
  1660. __le16 host_req_delay;
  1661. } __packed;
  1662. struct wmi_add_wow_pattern_cmd {
  1663. u8 filter_list_id;
  1664. u8 filter_size;
  1665. u8 filter_offset;
  1666. u8 filter[0];
  1667. } __packed;
  1668. struct wmi_del_wow_pattern_cmd {
  1669. __le16 filter_list_id;
  1670. __le16 filter_id;
  1671. } __packed;
  1672. /* WMI_SET_AKMP_PARAMS_CMD */
  1673. struct wmi_pmkid {
  1674. u8 pmkid[WMI_PMKID_LEN];
  1675. } __packed;
  1676. /* WMI_GET_PMKID_LIST_CMD Reply */
  1677. struct wmi_pmkid_list_reply {
  1678. __le32 num_pmkid;
  1679. u8 bssid_list[ETH_ALEN][1];
  1680. struct wmi_pmkid pmkid_list[1];
  1681. } __packed;
  1682. /* WMI_ADDBA_REQ_EVENTID */
  1683. struct wmi_addba_req_event {
  1684. u8 tid;
  1685. u8 win_sz;
  1686. __le16 st_seq_no;
  1687. /* f/w response for ADDBA Req; OK (0) or failure (!=0) */
  1688. u8 status;
  1689. } __packed;
  1690. /* WMI_ADDBA_RESP_EVENTID */
  1691. struct wmi_addba_resp_event {
  1692. u8 tid;
  1693. /* OK (0), failure (!=0) */
  1694. u8 status;
  1695. /* three values: not supported(0), 3839, 8k */
  1696. __le16 amsdu_sz;
  1697. } __packed;
  1698. /* WMI_DELBA_EVENTID
  1699. * f/w received a DELBA for peer and processed it.
  1700. * Host is notified of this
  1701. */
  1702. struct wmi_delba_event {
  1703. u8 tid;
  1704. u8 is_peer_initiator;
  1705. __le16 reason_code;
  1706. } __packed;
  1707. #define PEER_NODE_JOIN_EVENT 0x00
  1708. #define PEER_NODE_LEAVE_EVENT 0x01
  1709. #define PEER_FIRST_NODE_JOIN_EVENT 0x10
  1710. #define PEER_LAST_NODE_LEAVE_EVENT 0x11
  1711. struct wmi_peer_node_event {
  1712. u8 event_code;
  1713. u8 peer_mac_addr[ETH_ALEN];
  1714. } __packed;
  1715. /* Transmit complete event data structure(s) */
  1716. /* version 1 of tx complete msg */
  1717. struct tx_complete_msg_v1 {
  1718. #define TX_COMPLETE_STATUS_SUCCESS 0
  1719. #define TX_COMPLETE_STATUS_RETRIES 1
  1720. #define TX_COMPLETE_STATUS_NOLINK 2
  1721. #define TX_COMPLETE_STATUS_TIMEOUT 3
  1722. #define TX_COMPLETE_STATUS_OTHER 4
  1723. u8 status;
  1724. /* packet ID to identify parent packet */
  1725. u8 pkt_id;
  1726. /* rate index on successful transmission */
  1727. u8 rate_idx;
  1728. /* number of ACK failures in tx attempt */
  1729. u8 ack_failures;
  1730. } __packed;
  1731. struct wmi_tx_complete_event {
  1732. /* no of tx comp msgs following this struct */
  1733. u8 num_msg;
  1734. /* length in bytes for each individual msg following this struct */
  1735. u8 msg_len;
  1736. /* version of tx complete msg data following this struct */
  1737. u8 msg_type;
  1738. /* individual messages follow this header */
  1739. u8 reserved;
  1740. } __packed;
  1741. /*
  1742. * ------- AP Mode definitions --------------
  1743. */
  1744. /*
  1745. * !!! Warning !!!
  1746. * -Changing the following values needs compilation of both driver and firmware
  1747. */
  1748. #define AP_MAX_NUM_STA 10
  1749. /* Spl. AID used to set DTIM flag in the beacons */
  1750. #define MCAST_AID 0xFF
  1751. #define DEF_AP_COUNTRY_CODE "US "
  1752. /* Used with WMI_AP_SET_NUM_STA_CMDID */
  1753. /*
  1754. * Used with WMI_AP_SET_MLME_CMDID
  1755. */
  1756. /* MLME Commands */
  1757. #define WMI_AP_MLME_ASSOC 1 /* associate station */
  1758. #define WMI_AP_DISASSOC 2 /* disassociate station */
  1759. #define WMI_AP_DEAUTH 3 /* deauthenticate station */
  1760. #define WMI_AP_MLME_AUTHORIZE 4 /* authorize station */
  1761. #define WMI_AP_MLME_UNAUTHORIZE 5 /* unauthorize station */
  1762. struct wmi_ap_set_mlme_cmd {
  1763. u8 mac[ETH_ALEN];
  1764. __le16 reason; /* 802.11 reason code */
  1765. u8 cmd; /* operation to perform (WMI_AP_*) */
  1766. } __packed;
  1767. struct wmi_ap_set_pvb_cmd {
  1768. __le32 flag;
  1769. __le16 rsvd;
  1770. __le16 aid;
  1771. } __packed;
  1772. struct wmi_rx_frame_format_cmd {
  1773. /* version of meta data for rx packets <0 = default> (0-7 = valid) */
  1774. u8 meta_ver;
  1775. /*
  1776. * 1 == leave .11 header intact,
  1777. * 0 == replace .11 header with .3 <default>
  1778. */
  1779. u8 dot11_hdr;
  1780. /*
  1781. * 1 == defragmentation is performed by host,
  1782. * 0 == performed by target <default>
  1783. */
  1784. u8 defrag_on_host;
  1785. /* for alignment */
  1786. u8 reserved[1];
  1787. } __packed;
  1788. struct wmi_ap_hidden_ssid_cmd {
  1789. u8 hidden_ssid;
  1790. } __packed;
  1791. struct wmi_set_inact_period_cmd {
  1792. __le32 inact_period;
  1793. u8 num_null_func;
  1794. } __packed;
  1795. /* AP mode events */
  1796. struct wmi_ap_set_apsd_cmd {
  1797. u8 enable;
  1798. } __packed;
  1799. enum wmi_ap_apsd_buffered_traffic_flags {
  1800. WMI_AP_APSD_NO_DELIVERY_FRAMES = 0x1,
  1801. };
  1802. struct wmi_ap_apsd_buffered_traffic_cmd {
  1803. __le16 aid;
  1804. __le16 bitmap;
  1805. __le32 flags;
  1806. } __packed;
  1807. /* WMI_PS_POLL_EVENT */
  1808. struct wmi_pspoll_event {
  1809. __le16 aid;
  1810. } __packed;
  1811. struct wmi_per_sta_stat {
  1812. __le32 tx_bytes;
  1813. __le32 tx_pkts;
  1814. __le32 tx_error;
  1815. __le32 tx_discard;
  1816. __le32 rx_bytes;
  1817. __le32 rx_pkts;
  1818. __le32 rx_error;
  1819. __le32 rx_discard;
  1820. __le32 aid;
  1821. } __packed;
  1822. struct wmi_ap_mode_stat {
  1823. __le32 action;
  1824. struct wmi_per_sta_stat sta[AP_MAX_NUM_STA + 1];
  1825. } __packed;
  1826. /* End of AP mode definitions */
  1827. struct wmi_remain_on_chnl_cmd {
  1828. __le32 freq;
  1829. __le32 duration;
  1830. } __packed;
  1831. /* wmi_send_action_cmd is to be deprecated. Use
  1832. * wmi_send_mgmt_cmd instead. The new structure supports P2P mgmt
  1833. * operations using station interface.
  1834. */
  1835. struct wmi_send_action_cmd {
  1836. __le32 id;
  1837. __le32 freq;
  1838. __le32 wait;
  1839. __le16 len;
  1840. u8 data[0];
  1841. } __packed;
  1842. struct wmi_send_mgmt_cmd {
  1843. __le32 id;
  1844. __le32 freq;
  1845. __le32 wait;
  1846. __le32 no_cck;
  1847. __le16 len;
  1848. u8 data[0];
  1849. } __packed;
  1850. struct wmi_tx_status_event {
  1851. __le32 id;
  1852. u8 ack_status;
  1853. } __packed;
  1854. struct wmi_probe_req_report_cmd {
  1855. u8 enable;
  1856. } __packed;
  1857. struct wmi_disable_11b_rates_cmd {
  1858. u8 disable;
  1859. } __packed;
  1860. struct wmi_set_appie_extended_cmd {
  1861. u8 role_id;
  1862. u8 mgmt_frm_type;
  1863. u8 ie_len;
  1864. u8 ie_info[0];
  1865. } __packed;
  1866. struct wmi_remain_on_chnl_event {
  1867. __le32 freq;
  1868. __le32 duration;
  1869. } __packed;
  1870. struct wmi_cancel_remain_on_chnl_event {
  1871. __le32 freq;
  1872. __le32 duration;
  1873. u8 status;
  1874. } __packed;
  1875. struct wmi_rx_action_event {
  1876. __le32 freq;
  1877. __le16 len;
  1878. u8 data[0];
  1879. } __packed;
  1880. struct wmi_p2p_capabilities_event {
  1881. __le16 len;
  1882. u8 data[0];
  1883. } __packed;
  1884. struct wmi_p2p_rx_probe_req_event {
  1885. __le32 freq;
  1886. __le16 len;
  1887. u8 data[0];
  1888. } __packed;
  1889. #define P2P_FLAG_CAPABILITIES_REQ (0x00000001)
  1890. #define P2P_FLAG_MACADDR_REQ (0x00000002)
  1891. #define P2P_FLAG_HMODEL_REQ (0x00000002)
  1892. struct wmi_get_p2p_info {
  1893. __le32 info_req_flags;
  1894. } __packed;
  1895. struct wmi_p2p_info_event {
  1896. __le32 info_req_flags;
  1897. __le16 len;
  1898. u8 data[0];
  1899. } __packed;
  1900. struct wmi_p2p_capabilities {
  1901. u8 go_power_save;
  1902. } __packed;
  1903. struct wmi_p2p_macaddr {
  1904. u8 mac_addr[ETH_ALEN];
  1905. } __packed;
  1906. struct wmi_p2p_hmodel {
  1907. u8 p2p_model;
  1908. } __packed;
  1909. struct wmi_p2p_probe_response_cmd {
  1910. __le32 freq;
  1911. u8 destination_addr[ETH_ALEN];
  1912. __le16 len;
  1913. u8 data[0];
  1914. } __packed;
  1915. /* Extended WMI (WMIX)
  1916. *
  1917. * Extended WMIX commands are encapsulated in a WMI message with
  1918. * cmd=WMI_EXTENSION_CMD.
  1919. *
  1920. * Extended WMI commands are those that are needed during wireless
  1921. * operation, but which are not really wireless commands. This allows,
  1922. * for instance, platform-specific commands. Extended WMI commands are
  1923. * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
  1924. * Extended WMI events are similarly embedded in a WMI event message with
  1925. * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
  1926. */
  1927. struct wmix_cmd_hdr {
  1928. __le32 cmd_id;
  1929. } __packed;
  1930. enum wmix_command_id {
  1931. WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
  1932. WMIX_DSETDATA_REPLY_CMDID,
  1933. WMIX_GPIO_OUTPUT_SET_CMDID,
  1934. WMIX_GPIO_INPUT_GET_CMDID,
  1935. WMIX_GPIO_REGISTER_SET_CMDID,
  1936. WMIX_GPIO_REGISTER_GET_CMDID,
  1937. WMIX_GPIO_INTR_ACK_CMDID,
  1938. WMIX_HB_CHALLENGE_RESP_CMDID,
  1939. WMIX_DBGLOG_CFG_MODULE_CMDID,
  1940. WMIX_PROF_CFG_CMDID, /* 0x200a */
  1941. WMIX_PROF_ADDR_SET_CMDID,
  1942. WMIX_PROF_START_CMDID,
  1943. WMIX_PROF_STOP_CMDID,
  1944. WMIX_PROF_COUNT_GET_CMDID,
  1945. };
  1946. enum wmix_event_id {
  1947. WMIX_DSETOPENREQ_EVENTID = 0x3001,
  1948. WMIX_DSETCLOSE_EVENTID,
  1949. WMIX_DSETDATAREQ_EVENTID,
  1950. WMIX_GPIO_INTR_EVENTID,
  1951. WMIX_GPIO_DATA_EVENTID,
  1952. WMIX_GPIO_ACK_EVENTID,
  1953. WMIX_HB_CHALLENGE_RESP_EVENTID,
  1954. WMIX_DBGLOG_EVENTID,
  1955. WMIX_PROF_COUNT_EVENTID,
  1956. };
  1957. /*
  1958. * ------Error Detection support-------
  1959. */
  1960. /*
  1961. * WMIX_HB_CHALLENGE_RESP_CMDID
  1962. * Heartbeat Challenge Response command
  1963. */
  1964. struct wmix_hb_challenge_resp_cmd {
  1965. __le32 cookie;
  1966. __le32 source;
  1967. } __packed;
  1968. struct ath6kl_wmix_dbglog_cfg_module_cmd {
  1969. __le32 valid;
  1970. __le32 config;
  1971. } __packed;
  1972. /* End of Extended WMI (WMIX) */
  1973. enum wmi_sync_flag {
  1974. NO_SYNC_WMIFLAG = 0,
  1975. /* transmit all queued data before cmd */
  1976. SYNC_BEFORE_WMIFLAG,
  1977. /* any new data waits until cmd execs */
  1978. SYNC_AFTER_WMIFLAG,
  1979. SYNC_BOTH_WMIFLAG,
  1980. /* end marker */
  1981. END_WMIFLAG
  1982. };
  1983. enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi);
  1984. void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id);
  1985. int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb);
  1986. int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
  1987. u8 msg_type, u32 flags,
  1988. enum wmi_data_hdr_data_type data_type,
  1989. u8 meta_ver, void *tx_meta_info, u8 if_idx);
  1990. int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb);
  1991. int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb);
  1992. int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, u8 if_idx,
  1993. struct sk_buff *skb, u32 layer2_priority,
  1994. bool wmm_enabled, u8 *ac);
  1995. int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb);
  1996. int ath6kl_wmi_cmd_send(struct wmi *wmi, u8 if_idx, struct sk_buff *skb,
  1997. enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag);
  1998. int ath6kl_wmi_connect_cmd(struct wmi *wmi, u8 if_idx,
  1999. enum network_type nw_type,
  2000. enum dot11_auth_mode dot11_auth_mode,
  2001. enum auth_mode auth_mode,
  2002. enum crypto_type pairwise_crypto,
  2003. u8 pairwise_crypto_len,
  2004. enum crypto_type group_crypto,
  2005. u8 group_crypto_len, int ssid_len, u8 *ssid,
  2006. u8 *bssid, u16 channel, u32 ctrl_flags,
  2007. u8 nw_subtype);
  2008. int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid,
  2009. u16 channel);
  2010. int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx);
  2011. int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
  2012. enum wmi_scan_type scan_type,
  2013. u32 force_fgscan, u32 is_legacy,
  2014. u32 home_dwell_time, u32 force_scan_interval,
  2015. s8 num_chan, u16 *ch_list);
  2016. int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
  2017. enum wmi_scan_type scan_type,
  2018. u32 force_fgscan, u32 is_legacy,
  2019. u32 home_dwell_time, u32 force_scan_interval,
  2020. s8 num_chan, u16 *ch_list, u32 no_cck,
  2021. u32 *rates);
  2022. int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u8 if_idx, u16 fg_start_sec,
  2023. u16 fg_end_sec, u16 bg_sec,
  2024. u16 minact_chdw_msec, u16 maxact_chdw_msec,
  2025. u16 pas_chdw_msec, u8 short_scan_ratio,
  2026. u8 scan_ctrl_flag, u32 max_dfsch_act_time,
  2027. u16 maxact_scan_per_ssid);
  2028. int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 if_idx, u8 filter,
  2029. u32 ie_mask);
  2030. int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 if_idx, u8 index, u8 flag,
  2031. u8 ssid_len, u8 *ssid);
  2032. int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
  2033. u16 listen_interval,
  2034. u16 listen_beacons);
  2035. int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
  2036. u16 bmiss_time, u16 num_beacons);
  2037. int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode);
  2038. int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period,
  2039. u16 ps_poll_num, u16 dtim_policy,
  2040. u16 tx_wakup_policy, u16 num_tx_to_wakeup,
  2041. u16 ps_fail_event_policy);
  2042. int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi, u8 if_idx,
  2043. struct wmi_create_pstream_cmd *pstream);
  2044. int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
  2045. u8 tsid);
  2046. int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 if_idx, u8 timeout);
  2047. int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold);
  2048. int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 if_idx, u8 status,
  2049. u8 preamble_policy);
  2050. int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source);
  2051. int ath6kl_wmi_config_debug_module_cmd(struct wmi *wmi, u32 valid, u32 config);
  2052. int ath6kl_wmi_get_stats_cmd(struct wmi *wmi, u8 if_idx);
  2053. int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index,
  2054. enum crypto_type key_type,
  2055. u8 key_usage, u8 key_len,
  2056. u8 *key_rsc, unsigned int key_rsc_len,
  2057. u8 *key_material,
  2058. u8 key_op_ctrl, u8 *mac_addr,
  2059. enum wmi_sync_flag sync_flag);
  2060. int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, u8 *krk);
  2061. int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index);
  2062. int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid,
  2063. const u8 *pmkid, bool set);
  2064. int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 if_idx, u8 dbM);
  2065. int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi, u8 if_idx);
  2066. int ath6kl_wmi_get_roam_tbl_cmd(struct wmi *wmi);
  2067. int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, u8 if_idx, enum wmi_txop_cfg cfg);
  2068. int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 if_idx,
  2069. u8 keep_alive_intvl);
  2070. int ath6kl_wmi_set_htcap_cmd(struct wmi *wmi, u8 if_idx,
  2071. enum ieee80211_band band,
  2072. struct ath6kl_htcap *htcap);
  2073. int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len);
  2074. s32 ath6kl_wmi_get_rate(s8 rate_index);
  2075. int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx,
  2076. __be32 ips0, __be32 ips1);
  2077. int ath6kl_wmi_set_host_sleep_mode_cmd(struct wmi *wmi, u8 if_idx,
  2078. enum ath6kl_host_mode host_mode);
  2079. int ath6kl_wmi_set_wow_mode_cmd(struct wmi *wmi, u8 if_idx,
  2080. enum ath6kl_wow_mode wow_mode,
  2081. u32 filter, u16 host_req_delay);
  2082. int ath6kl_wmi_add_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
  2083. u8 list_id, u8 filter_size,
  2084. u8 filter_offset, const u8 *filter,
  2085. const u8 *mask);
  2086. int ath6kl_wmi_del_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
  2087. u16 list_id, u16 filter_id);
  2088. int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi);
  2089. int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid);
  2090. int ath6kl_wmi_set_roam_mode_cmd(struct wmi *wmi, enum wmi_roam_mode mode);
  2091. int ath6kl_wmi_mcast_filter_cmd(struct wmi *wmi, u8 if_idx, bool mc_all_on);
  2092. int ath6kl_wmi_add_del_mcast_filter_cmd(struct wmi *wmi, u8 if_idx,
  2093. u8 *filter, bool add_filter);
  2094. /* AP mode uAPSD */
  2095. int ath6kl_wmi_ap_set_apsd(struct wmi *wmi, u8 if_idx, u8 enable);
  2096. int ath6kl_wmi_set_apsd_bfrd_traf(struct wmi *wmi,
  2097. u8 if_idx, u16 aid,
  2098. u16 bitmap, u32 flags);
  2099. u8 ath6kl_wmi_get_traffic_class(u8 user_priority);
  2100. u8 ath6kl_wmi_determine_user_priority(u8 *pkt, u32 layer2_pri);
  2101. /* AP mode */
  2102. int ath6kl_wmi_ap_hidden_ssid(struct wmi *wmi, u8 if_idx, bool enable);
  2103. int ath6kl_wmi_ap_profile_commit(struct wmi *wmip, u8 if_idx,
  2104. struct wmi_connect_cmd *p);
  2105. int ath6kl_wmi_ap_set_mlme(struct wmi *wmip, u8 if_idx, u8 cmd,
  2106. const u8 *mac, u16 reason);
  2107. int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u8 if_idx, u16 aid, bool flag);
  2108. int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx,
  2109. u8 rx_meta_version,
  2110. bool rx_dot11_hdr, bool defrag_on_host);
  2111. int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
  2112. const u8 *ie, u8 ie_len);
  2113. int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field,
  2114. const u8 *ie_info, u8 ie_len);
  2115. /* P2P */
  2116. int ath6kl_wmi_disable_11b_rates_cmd(struct wmi *wmi, bool disable);
  2117. int ath6kl_wmi_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
  2118. u32 dur);
  2119. int ath6kl_wmi_send_mgmt_cmd(struct wmi *wmi, u8 if_idx, u32 id, u32 freq,
  2120. u32 wait, const u8 *data, u16 data_len,
  2121. u32 no_cck);
  2122. int ath6kl_wmi_send_probe_response_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
  2123. const u8 *dst, const u8 *data,
  2124. u16 data_len);
  2125. int ath6kl_wmi_probe_report_req_cmd(struct wmi *wmi, u8 if_idx, bool enable);
  2126. int ath6kl_wmi_info_req_cmd(struct wmi *wmi, u8 if_idx, u32 info_req_flags);
  2127. int ath6kl_wmi_cancel_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx);
  2128. int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
  2129. const u8 *ie, u8 ie_len);
  2130. int ath6kl_wmi_set_inact_period(struct wmi *wmi, u8 if_idx, int inact_timeout);
  2131. void ath6kl_wmi_sscan_timer(unsigned long ptr);
  2132. struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx);
  2133. void *ath6kl_wmi_init(struct ath6kl *devt);
  2134. void ath6kl_wmi_shutdown(struct wmi *wmi);
  2135. void ath6kl_wmi_reset(struct wmi *wmi);
  2136. #endif /* WMI_H */