wmi.h 44 KB

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