wmi.h 49 KB

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