cmd.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2009 Nokia Corporation
  6. *
  7. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #ifndef __CMD_H__
  25. #define __CMD_H__
  26. #include "wlcore.h"
  27. struct acx_header;
  28. int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
  29. size_t res_len);
  30. int wl12xx_cmd_role_enable(struct wl1271 *wl, u8 *addr, u8 role_type,
  31. u8 *role_id);
  32. int wl12xx_cmd_role_disable(struct wl1271 *wl, u8 *role_id);
  33. int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  34. int wl12xx_cmd_role_stop_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  35. int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  36. int wl12xx_cmd_role_stop_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  37. int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  38. int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  39. int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  40. int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
  41. int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
  42. int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
  43. int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
  44. int wl1271_cmd_ps_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  45. u8 ps_mode, u16 auto_ps_timeout);
  46. int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
  47. size_t len);
  48. int wl1271_cmd_template_set(struct wl1271 *wl, u8 role_id,
  49. u16 template_id, void *buf, size_t buf_len,
  50. int index, u32 rates);
  51. int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  52. int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  53. u16 aid);
  54. int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  55. u8 role_id, u8 band,
  56. const u8 *ssid, size_t ssid_len,
  57. const u8 *ie, size_t ie_len, bool sched_scan);
  58. struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
  59. struct wl12xx_vif *wlvif,
  60. struct sk_buff *skb);
  61. int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  62. int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif);
  63. int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
  64. struct wl12xx_vif *wlvif);
  65. int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid);
  66. int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  67. u16 action, u8 id, u8 key_type,
  68. u8 key_size, const u8 *key, const u8 *addr,
  69. u32 tx_seq_32, u16 tx_seq_16);
  70. int wl1271_cmd_set_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  71. u16 action, u8 id, u8 key_type,
  72. u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
  73. u16 tx_seq_16);
  74. int wl12xx_cmd_set_peer_state(struct wl1271 *wl, u8 hlid);
  75. int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id);
  76. int wl12xx_croc(struct wl1271 *wl, u8 role_id);
  77. int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  78. struct ieee80211_sta *sta, u8 hlid);
  79. int wl12xx_cmd_remove_peer(struct wl1271 *wl, u8 hlid);
  80. int wl12xx_cmd_config_fwlog(struct wl1271 *wl);
  81. int wl12xx_cmd_start_fwlog(struct wl1271 *wl);
  82. int wl12xx_cmd_stop_fwlog(struct wl1271 *wl);
  83. int wl12xx_cmd_channel_switch(struct wl1271 *wl,
  84. struct wl12xx_vif *wlvif,
  85. struct ieee80211_channel_switch *ch_switch);
  86. int wl12xx_cmd_stop_channel_switch(struct wl1271 *wl);
  87. int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  88. u8 *hlid);
  89. void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid);
  90. enum wl1271_commands {
  91. CMD_INTERROGATE = 1, /* use this to read information elements */
  92. CMD_CONFIGURE = 2, /* use this to write information elements */
  93. CMD_ENABLE_RX = 3,
  94. CMD_ENABLE_TX = 4,
  95. CMD_DISABLE_RX = 5,
  96. CMD_DISABLE_TX = 6,
  97. CMD_SCAN = 7,
  98. CMD_STOP_SCAN = 8,
  99. CMD_SET_KEYS = 9,
  100. CMD_READ_MEMORY = 10,
  101. CMD_WRITE_MEMORY = 11,
  102. CMD_SET_TEMPLATE = 12,
  103. CMD_TEST = 13,
  104. CMD_NOISE_HIST = 14,
  105. CMD_QUIET_ELEMENT_SET_STATE = 15,
  106. CMD_SET_BCN_MODE = 16,
  107. CMD_MEASUREMENT = 17,
  108. CMD_STOP_MEASUREMENT = 18,
  109. CMD_SET_PS_MODE = 19,
  110. CMD_CHANNEL_SWITCH = 20,
  111. CMD_STOP_CHANNEL_SWICTH = 21,
  112. CMD_AP_DISCOVERY = 22,
  113. CMD_STOP_AP_DISCOVERY = 23,
  114. CMD_HEALTH_CHECK = 24,
  115. CMD_DEBUG = 25,
  116. CMD_TRIGGER_SCAN_TO = 26,
  117. CMD_CONNECTION_SCAN_CFG = 27,
  118. CMD_CONNECTION_SCAN_SSID_CFG = 28,
  119. CMD_START_PERIODIC_SCAN = 29,
  120. CMD_STOP_PERIODIC_SCAN = 30,
  121. CMD_SET_PEER_STATE = 31,
  122. CMD_REMAIN_ON_CHANNEL = 32,
  123. CMD_CANCEL_REMAIN_ON_CHANNEL = 33,
  124. CMD_CONFIG_FWLOGGER = 34,
  125. CMD_START_FWLOGGER = 35,
  126. CMD_STOP_FWLOGGER = 36,
  127. /* Access point commands */
  128. CMD_ADD_PEER = 37,
  129. CMD_REMOVE_PEER = 38,
  130. /* Role API */
  131. CMD_ROLE_ENABLE = 39,
  132. CMD_ROLE_DISABLE = 40,
  133. CMD_ROLE_START = 41,
  134. CMD_ROLE_STOP = 42,
  135. /* DFS */
  136. CMD_START_RADAR_DETECTION = 43,
  137. CMD_STOP_RADAR_DETECTION = 44,
  138. /* WIFI Direct */
  139. CMD_WFD_START_DISCOVERY = 45,
  140. CMD_WFD_STOP_DISCOVERY = 46,
  141. CMD_WFD_ATTRIBUTE_CONFIG = 47,
  142. CMD_NOP = 48,
  143. CMD_LAST_COMMAND,
  144. MAX_COMMAND_ID = 0xFFFF,
  145. };
  146. #define MAX_CMD_PARAMS 572
  147. enum cmd_templ {
  148. CMD_TEMPL_NULL_DATA = 0,
  149. CMD_TEMPL_BEACON,
  150. CMD_TEMPL_CFG_PROBE_REQ_2_4,
  151. CMD_TEMPL_CFG_PROBE_REQ_5,
  152. CMD_TEMPL_PROBE_RESPONSE,
  153. CMD_TEMPL_QOS_NULL_DATA,
  154. CMD_TEMPL_PS_POLL,
  155. CMD_TEMPL_KLV,
  156. CMD_TEMPL_DISCONNECT,
  157. CMD_TEMPL_APP_PROBE_REQ_2_4,
  158. CMD_TEMPL_APP_PROBE_REQ_5,
  159. CMD_TEMPL_BAR, /* for firmware internal use only */
  160. CMD_TEMPL_CTS, /*
  161. * For CTS-to-self (FastCTS) mechanism
  162. * for BT/WLAN coexistence (SoftGemini). */
  163. CMD_TEMPL_AP_BEACON,
  164. CMD_TEMPL_AP_PROBE_RESPONSE,
  165. CMD_TEMPL_ARP_RSP,
  166. CMD_TEMPL_DEAUTH_AP,
  167. CMD_TEMPL_TEMPORARY,
  168. CMD_TEMPL_LINK_MEASUREMENT_REPORT,
  169. CMD_TEMPL_MAX = 0xff
  170. };
  171. /* unit ms */
  172. #define WL1271_COMMAND_TIMEOUT 2000
  173. #define WL1271_CMD_TEMPL_DFLT_SIZE 252
  174. #define WL1271_CMD_TEMPL_MAX_SIZE 512
  175. #define WL1271_EVENT_TIMEOUT 1500
  176. struct wl1271_cmd_header {
  177. __le16 id;
  178. __le16 status;
  179. /* payload */
  180. u8 data[0];
  181. } __packed;
  182. #define WL1271_CMD_MAX_PARAMS 572
  183. struct wl1271_command {
  184. struct wl1271_cmd_header header;
  185. u8 parameters[WL1271_CMD_MAX_PARAMS];
  186. } __packed;
  187. enum {
  188. CMD_MAILBOX_IDLE = 0,
  189. CMD_STATUS_SUCCESS = 1,
  190. CMD_STATUS_UNKNOWN_CMD = 2,
  191. CMD_STATUS_UNKNOWN_IE = 3,
  192. CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
  193. CMD_STATUS_RX_BUSY = 13,
  194. CMD_STATUS_INVALID_PARAM = 14,
  195. CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
  196. CMD_STATUS_OUT_OF_MEMORY = 16,
  197. CMD_STATUS_STA_TABLE_FULL = 17,
  198. CMD_STATUS_RADIO_ERROR = 18,
  199. CMD_STATUS_WRONG_NESTING = 19,
  200. CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
  201. CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
  202. CMD_STATUS_TEMPLATE_OOM = 23,
  203. CMD_STATUS_NO_RX_BA_SESSION = 24,
  204. MAX_COMMAND_STATUS = 0xff
  205. };
  206. #define CMDMBOX_HEADER_LEN 4
  207. #define CMDMBOX_INFO_ELEM_HEADER_LEN 4
  208. enum {
  209. BSS_TYPE_IBSS = 0,
  210. BSS_TYPE_STA_BSS = 2,
  211. BSS_TYPE_AP_BSS = 3,
  212. MAX_BSS_TYPE = 0xFF
  213. };
  214. #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
  215. #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
  216. #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
  217. struct wl12xx_cmd_role_enable {
  218. struct wl1271_cmd_header header;
  219. u8 role_id;
  220. u8 role_type;
  221. u8 mac_address[ETH_ALEN];
  222. } __packed;
  223. struct wl12xx_cmd_role_disable {
  224. struct wl1271_cmd_header header;
  225. u8 role_id;
  226. u8 padding[3];
  227. } __packed;
  228. enum wlcore_band {
  229. WLCORE_BAND_2_4GHZ = 0,
  230. WLCORE_BAND_5GHZ = 1,
  231. WLCORE_BAND_JAPAN_4_9_GHZ = 2,
  232. WLCORE_BAND_DEFAULT = WLCORE_BAND_2_4GHZ,
  233. WLCORE_BAND_INVALID = 0x7E,
  234. WLCORE_BAND_MAX_RADIO = 0x7F,
  235. };
  236. enum wlcore_channel_type {
  237. WLCORE_CHAN_NO_HT,
  238. WLCORE_CHAN_HT20,
  239. WLCORE_CHAN_HT40MINUS,
  240. WLCORE_CHAN_HT40PLUS
  241. };
  242. struct wl12xx_cmd_role_start {
  243. struct wl1271_cmd_header header;
  244. u8 role_id;
  245. u8 band;
  246. u8 channel;
  247. /* enum wlcore_channel_type */
  248. u8 channel_type;
  249. union {
  250. struct {
  251. u8 hlid;
  252. u8 session;
  253. u8 padding_1[54];
  254. } __packed device;
  255. /* sta & p2p_cli use the same struct */
  256. struct {
  257. u8 bssid[ETH_ALEN];
  258. u8 hlid; /* data hlid */
  259. u8 session;
  260. __le32 remote_rates; /* remote supported rates */
  261. /*
  262. * The target uses this field to determine the rate at
  263. * which to transmit control frame responses (such as
  264. * ACK or CTS frames).
  265. */
  266. __le32 basic_rate_set;
  267. __le32 local_rates; /* local supported rates */
  268. u8 ssid_type;
  269. u8 ssid_len;
  270. u8 ssid[IEEE80211_MAX_SSID_LEN];
  271. __le16 beacon_interval; /* in TBTTs */
  272. } __packed sta;
  273. struct {
  274. u8 bssid[ETH_ALEN];
  275. u8 hlid; /* data hlid */
  276. u8 dtim_interval;
  277. __le32 remote_rates; /* remote supported rates */
  278. __le32 basic_rate_set;
  279. __le32 local_rates; /* local supported rates */
  280. u8 ssid_type;
  281. u8 ssid_len;
  282. u8 ssid[IEEE80211_MAX_SSID_LEN];
  283. __le16 beacon_interval; /* in TBTTs */
  284. u8 padding_1[4];
  285. } __packed ibss;
  286. /* ap & p2p_go use the same struct */
  287. struct {
  288. __le16 aging_period; /* in secs */
  289. u8 beacon_expiry; /* in ms */
  290. u8 bss_index;
  291. /* The host link id for the AP's global queue */
  292. u8 global_hlid;
  293. /* The host link id for the AP's broadcast queue */
  294. u8 broadcast_hlid;
  295. __le16 beacon_interval; /* in TBTTs */
  296. __le32 basic_rate_set;
  297. __le32 local_rates; /* local supported rates */
  298. u8 dtim_interval;
  299. u8 ssid_type;
  300. u8 ssid_len;
  301. u8 ssid[IEEE80211_MAX_SSID_LEN];
  302. u8 reset_tsf;
  303. u8 padding_1[4];
  304. } __packed ap;
  305. };
  306. } __packed;
  307. struct wl12xx_cmd_role_stop {
  308. struct wl1271_cmd_header header;
  309. u8 role_id;
  310. u8 disc_type; /* only STA and P2P_CLI */
  311. __le16 reason; /* only STA and P2P_CLI */
  312. } __packed;
  313. struct cmd_enabledisable_path {
  314. struct wl1271_cmd_header header;
  315. u8 channel;
  316. u8 padding[3];
  317. } __packed;
  318. #define WL1271_RATE_AUTOMATIC 0
  319. struct wl1271_cmd_template_set {
  320. struct wl1271_cmd_header header;
  321. u8 role_id;
  322. u8 template_type;
  323. __le16 len;
  324. u8 index; /* relevant only for KLV_TEMPLATE type */
  325. u8 padding[3];
  326. __le32 enabled_rates;
  327. u8 short_retry_limit;
  328. u8 long_retry_limit;
  329. u8 aflags;
  330. u8 reserved;
  331. u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
  332. } __packed;
  333. #define TIM_ELE_ID 5
  334. #define PARTIAL_VBM_MAX 251
  335. struct wl1271_tim {
  336. u8 identity;
  337. u8 length;
  338. u8 dtim_count;
  339. u8 dtim_period;
  340. u8 bitmap_ctrl;
  341. u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
  342. } __packed;
  343. enum wl1271_cmd_ps_mode {
  344. STATION_AUTO_PS_MODE, /* Dynamic Power Save */
  345. STATION_ACTIVE_MODE,
  346. STATION_POWER_SAVE_MODE
  347. };
  348. struct wl1271_cmd_ps_params {
  349. struct wl1271_cmd_header header;
  350. u8 role_id;
  351. u8 ps_mode; /* STATION_* */
  352. u16 auto_ps_timeout;
  353. } __packed;
  354. /* HW encryption keys */
  355. #define NUM_ACCESS_CATEGORIES_COPY 4
  356. enum wl1271_cmd_key_action {
  357. KEY_ADD_OR_REPLACE = 1,
  358. KEY_REMOVE = 2,
  359. KEY_SET_ID = 3,
  360. MAX_KEY_ACTION = 0xffff,
  361. };
  362. enum wl1271_cmd_lid_key_type {
  363. UNICAST_LID_TYPE = 0,
  364. BROADCAST_LID_TYPE = 1,
  365. WEP_DEFAULT_LID_TYPE = 2
  366. };
  367. enum wl1271_cmd_key_type {
  368. KEY_NONE = 0,
  369. KEY_WEP = 1,
  370. KEY_TKIP = 2,
  371. KEY_AES = 3,
  372. KEY_GEM = 4,
  373. };
  374. struct wl1271_cmd_set_keys {
  375. struct wl1271_cmd_header header;
  376. /*
  377. * Indicates whether the HLID is a unicast key set
  378. * or broadcast key set. A special value 0xFF is
  379. * used to indicate that the HLID is on WEP-default
  380. * (multi-hlids). of type wl1271_cmd_lid_key_type.
  381. */
  382. u8 hlid;
  383. /*
  384. * In WEP-default network (hlid == 0xFF) used to
  385. * indicate which network STA/IBSS/AP role should be
  386. * changed
  387. */
  388. u8 lid_key_type;
  389. /*
  390. * Key ID - For TKIP and AES key types, this field
  391. * indicates the value that should be inserted into
  392. * the KeyID field of frames transmitted using this
  393. * key entry. For broadcast keys the index use as a
  394. * marker for TX/RX key.
  395. * For WEP default network (HLID=0xFF), this field
  396. * indicates the ID of the key to add or remove.
  397. */
  398. u8 key_id;
  399. u8 reserved_1;
  400. /* key_action_e */
  401. __le16 key_action;
  402. /* key size in bytes */
  403. u8 key_size;
  404. /* key_type_e */
  405. u8 key_type;
  406. /* This field holds the security key data to add to the STA table */
  407. u8 key[MAX_KEY_SIZE];
  408. __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
  409. __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
  410. } __packed;
  411. struct wl1271_cmd_test_header {
  412. u8 id;
  413. u8 padding[3];
  414. } __packed;
  415. enum wl1271_channel_tune_bands {
  416. WL1271_CHANNEL_TUNE_BAND_2_4,
  417. WL1271_CHANNEL_TUNE_BAND_5,
  418. WL1271_CHANNEL_TUNE_BAND_4_9
  419. };
  420. #define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
  421. /*
  422. * There are three types of disconnections:
  423. *
  424. * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
  425. * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
  426. * we have passed
  427. * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
  428. * we have passed
  429. */
  430. enum wl1271_disconnect_type {
  431. DISCONNECT_IMMEDIATE,
  432. DISCONNECT_DEAUTH,
  433. DISCONNECT_DISASSOC
  434. };
  435. #define WL1271_CMD_STA_STATE_CONNECTED 1
  436. struct wl12xx_cmd_set_peer_state {
  437. struct wl1271_cmd_header header;
  438. u8 hlid;
  439. u8 state;
  440. u8 padding[2];
  441. } __packed;
  442. struct wl12xx_cmd_roc {
  443. struct wl1271_cmd_header header;
  444. u8 role_id;
  445. u8 channel;
  446. u8 band;
  447. u8 padding;
  448. };
  449. struct wl12xx_cmd_croc {
  450. struct wl1271_cmd_header header;
  451. u8 role_id;
  452. u8 padding[3];
  453. };
  454. enum wl12xx_ssid_type {
  455. WL12XX_SSID_TYPE_PUBLIC = 0,
  456. WL12XX_SSID_TYPE_HIDDEN = 1,
  457. WL12XX_SSID_TYPE_ANY = 2,
  458. };
  459. enum wl1271_psd_type {
  460. WL1271_PSD_LEGACY = 0,
  461. WL1271_PSD_UPSD_TRIGGER = 1,
  462. WL1271_PSD_LEGACY_PSPOLL = 2,
  463. WL1271_PSD_SAPSD = 3
  464. };
  465. struct wl12xx_cmd_add_peer {
  466. struct wl1271_cmd_header header;
  467. u8 addr[ETH_ALEN];
  468. u8 hlid;
  469. u8 aid;
  470. u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
  471. __le32 supported_rates;
  472. u8 bss_index;
  473. u8 sp_len;
  474. u8 wmm;
  475. u8 padding1;
  476. } __packed;
  477. struct wl12xx_cmd_remove_peer {
  478. struct wl1271_cmd_header header;
  479. u8 hlid;
  480. u8 reason_opcode;
  481. u8 send_deauth_flag;
  482. u8 padding1;
  483. } __packed;
  484. /*
  485. * Continuous mode - packets are transferred to the host periodically
  486. * via the data path.
  487. * On demand - Log messages are stored in a cyclic buffer in the
  488. * firmware, and only transferred to the host when explicitly requested
  489. */
  490. enum wl12xx_fwlogger_log_mode {
  491. WL12XX_FWLOG_CONTINUOUS,
  492. WL12XX_FWLOG_ON_DEMAND
  493. };
  494. /* Include/exclude timestamps from the log messages */
  495. enum wl12xx_fwlogger_timestamp {
  496. WL12XX_FWLOG_TIMESTAMP_DISABLED,
  497. WL12XX_FWLOG_TIMESTAMP_ENABLED
  498. };
  499. /*
  500. * Logs can be routed to the debug pinouts (where available), to the host bus
  501. * (SDIO/SPI), or dropped
  502. */
  503. enum wl12xx_fwlogger_output {
  504. WL12XX_FWLOG_OUTPUT_NONE,
  505. WL12XX_FWLOG_OUTPUT_DBG_PINS,
  506. WL12XX_FWLOG_OUTPUT_HOST,
  507. };
  508. struct wl12xx_cmd_config_fwlog {
  509. struct wl1271_cmd_header header;
  510. /* See enum wl12xx_fwlogger_log_mode */
  511. u8 logger_mode;
  512. /* Minimum log level threshold */
  513. u8 log_severity;
  514. /* Include/exclude timestamps from the log messages */
  515. u8 timestamp;
  516. /* See enum wl1271_fwlogger_output */
  517. u8 output;
  518. /* Regulates the frequency of log messages */
  519. u8 threshold;
  520. u8 padding[3];
  521. } __packed;
  522. struct wl12xx_cmd_start_fwlog {
  523. struct wl1271_cmd_header header;
  524. } __packed;
  525. struct wl12xx_cmd_stop_fwlog {
  526. struct wl1271_cmd_header header;
  527. } __packed;
  528. struct wl12xx_cmd_channel_switch {
  529. struct wl1271_cmd_header header;
  530. u8 role_id;
  531. /* The new serving channel */
  532. u8 channel;
  533. /* Relative time of the serving channel switch in TBTT units */
  534. u8 switch_time;
  535. /* Stop the role TX, should expect it after radar detection */
  536. u8 stop_tx;
  537. /* The target channel tx status 1-stopped 0-open*/
  538. u8 post_switch_tx_disable;
  539. u8 padding[3];
  540. } __packed;
  541. struct wl12xx_cmd_stop_channel_switch {
  542. struct wl1271_cmd_header header;
  543. } __packed;
  544. /* Used to check radio status after calibration */
  545. #define MAX_TLV_LENGTH 500
  546. #define TEST_CMD_P2G_CAL 2 /* TX BiP */
  547. struct wl1271_cmd_cal_p2g {
  548. struct wl1271_cmd_header header;
  549. struct wl1271_cmd_test_header test;
  550. __le32 ver;
  551. __le16 len;
  552. u8 buf[MAX_TLV_LENGTH];
  553. u8 type;
  554. u8 padding;
  555. __le16 radio_status;
  556. u8 sub_band_mask;
  557. u8 padding2;
  558. } __packed;
  559. #endif /* __WL1271_CMD_H__ */