cmd.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  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 "wl12xx.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 wl1271_cmd_general_parms(struct wl1271 *wl);
  31. int wl128x_cmd_general_parms(struct wl1271 *wl);
  32. int wl1271_cmd_radio_parms(struct wl1271 *wl);
  33. int wl128x_cmd_radio_parms(struct wl1271 *wl);
  34. int wl1271_cmd_ext_radio_parms(struct wl1271 *wl);
  35. int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type);
  36. int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
  37. int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
  38. int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
  39. int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
  40. int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode);
  41. int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
  42. size_t len);
  43. int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
  44. void *buf, size_t buf_len, int index, u32 rates);
  45. int wl1271_cmd_build_null_data(struct wl1271 *wl);
  46. int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid);
  47. int wl1271_cmd_build_probe_req(struct wl1271 *wl,
  48. const u8 *ssid, size_t ssid_len,
  49. const u8 *ie, size_t ie_len, u8 band);
  50. struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
  51. struct sk_buff *skb);
  52. int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr);
  53. int wl1271_build_qos_null_data(struct wl1271 *wl);
  54. int wl1271_cmd_build_klv_null_data(struct wl1271 *wl);
  55. int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id);
  56. int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id);
  57. int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
  58. u8 key_size, const u8 *key, const u8 *addr,
  59. u32 tx_seq_32, u16 tx_seq_16);
  60. int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
  61. u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
  62. u16 tx_seq_16);
  63. int wl1271_cmd_disconnect(struct wl1271 *wl);
  64. int wl1271_cmd_set_sta_state(struct wl1271 *wl);
  65. int wl1271_cmd_start_bss(struct wl1271 *wl);
  66. int wl1271_cmd_stop_bss(struct wl1271 *wl);
  67. int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid);
  68. int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid);
  69. int wl12xx_cmd_config_fwlog(struct wl1271 *wl);
  70. int wl12xx_cmd_start_fwlog(struct wl1271 *wl);
  71. int wl12xx_cmd_stop_fwlog(struct wl1271 *wl);
  72. enum wl1271_commands {
  73. CMD_INTERROGATE = 1, /*use this to read information elements*/
  74. CMD_CONFIGURE = 2, /*use this to write information elements*/
  75. CMD_ENABLE_RX = 3,
  76. CMD_ENABLE_TX = 4,
  77. CMD_DISABLE_RX = 5,
  78. CMD_DISABLE_TX = 6,
  79. CMD_SCAN = 8,
  80. CMD_STOP_SCAN = 9,
  81. CMD_START_JOIN = 11,
  82. CMD_SET_KEYS = 12,
  83. CMD_READ_MEMORY = 13,
  84. CMD_WRITE_MEMORY = 14,
  85. CMD_SET_TEMPLATE = 19,
  86. CMD_TEST = 23,
  87. CMD_NOISE_HIST = 28,
  88. CMD_LNA_CONTROL = 32,
  89. CMD_SET_BCN_MODE = 33,
  90. CMD_MEASUREMENT = 34,
  91. CMD_STOP_MEASUREMENT = 35,
  92. CMD_DISCONNECT = 36,
  93. CMD_SET_PS_MODE = 37,
  94. CMD_CHANNEL_SWITCH = 38,
  95. CMD_STOP_CHANNEL_SWICTH = 39,
  96. CMD_AP_DISCOVERY = 40,
  97. CMD_STOP_AP_DISCOVERY = 41,
  98. CMD_SPS_SCAN = 42,
  99. CMD_STOP_SPS_SCAN = 43,
  100. CMD_HEALTH_CHECK = 45,
  101. CMD_DEBUG = 46,
  102. CMD_TRIGGER_SCAN_TO = 47,
  103. CMD_CONNECTION_SCAN_CFG = 48,
  104. CMD_CONNECTION_SCAN_SSID_CFG = 49,
  105. CMD_START_PERIODIC_SCAN = 50,
  106. CMD_STOP_PERIODIC_SCAN = 51,
  107. CMD_SET_STA_STATE = 52,
  108. CMD_CONFIG_FWLOGGER = 53,
  109. CMD_START_FWLOGGER = 54,
  110. CMD_STOP_FWLOGGER = 55,
  111. /* AP mode commands */
  112. CMD_BSS_START = 60,
  113. CMD_BSS_STOP = 61,
  114. CMD_ADD_STA = 62,
  115. CMD_REMOVE_STA = 63,
  116. NUM_COMMANDS,
  117. MAX_COMMAND_ID = 0xFFFF,
  118. };
  119. #define MAX_CMD_PARAMS 572
  120. enum {
  121. CMD_TEMPL_KLV_IDX_NULL_DATA = 0,
  122. CMD_TEMPL_KLV_IDX_MAX = 4
  123. };
  124. enum cmd_templ {
  125. CMD_TEMPL_NULL_DATA = 0,
  126. CMD_TEMPL_BEACON,
  127. CMD_TEMPL_CFG_PROBE_REQ_2_4,
  128. CMD_TEMPL_CFG_PROBE_REQ_5,
  129. CMD_TEMPL_PROBE_RESPONSE,
  130. CMD_TEMPL_QOS_NULL_DATA,
  131. CMD_TEMPL_PS_POLL,
  132. CMD_TEMPL_KLV,
  133. CMD_TEMPL_DISCONNECT,
  134. CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */
  135. CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */
  136. CMD_TEMPL_BAR, /* for firmware internal use only */
  137. CMD_TEMPL_CTS, /*
  138. * For CTS-to-self (FastCTS) mechanism
  139. * for BT/WLAN coexistence (SoftGemini). */
  140. CMD_TEMPL_ARP_RSP,
  141. CMD_TEMPL_LINK_MEASUREMENT_REPORT,
  142. /* AP-mode specific */
  143. CMD_TEMPL_AP_BEACON = 13,
  144. CMD_TEMPL_AP_PROBE_RESPONSE,
  145. CMD_TEMPL_AP_ARP_RSP,
  146. CMD_TEMPL_DEAUTH_AP,
  147. CMD_TEMPL_MAX = 0xff
  148. };
  149. /* unit ms */
  150. #define WL1271_COMMAND_TIMEOUT 2000
  151. #define WL1271_CMD_TEMPL_MAX_SIZE 252
  152. #define WL1271_EVENT_TIMEOUT 750
  153. struct wl1271_cmd_header {
  154. __le16 id;
  155. __le16 status;
  156. /* payload */
  157. u8 data[0];
  158. } __packed;
  159. #define WL1271_CMD_MAX_PARAMS 572
  160. struct wl1271_command {
  161. struct wl1271_cmd_header header;
  162. u8 parameters[WL1271_CMD_MAX_PARAMS];
  163. } __packed;
  164. enum {
  165. CMD_MAILBOX_IDLE = 0,
  166. CMD_STATUS_SUCCESS = 1,
  167. CMD_STATUS_UNKNOWN_CMD = 2,
  168. CMD_STATUS_UNKNOWN_IE = 3,
  169. CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11,
  170. CMD_STATUS_RX_BUSY = 13,
  171. CMD_STATUS_INVALID_PARAM = 14,
  172. CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
  173. CMD_STATUS_OUT_OF_MEMORY = 16,
  174. CMD_STATUS_STA_TABLE_FULL = 17,
  175. CMD_STATUS_RADIO_ERROR = 18,
  176. CMD_STATUS_WRONG_NESTING = 19,
  177. CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/
  178. CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/
  179. MAX_COMMAND_STATUS = 0xff
  180. };
  181. #define CMDMBOX_HEADER_LEN 4
  182. #define CMDMBOX_INFO_ELEM_HEADER_LEN 4
  183. enum {
  184. BSS_TYPE_IBSS = 0,
  185. BSS_TYPE_STA_BSS = 2,
  186. BSS_TYPE_AP_BSS = 3,
  187. MAX_BSS_TYPE = 0xFF
  188. };
  189. #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
  190. #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
  191. #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
  192. struct wl1271_cmd_join {
  193. struct wl1271_cmd_header header;
  194. __le32 bssid_lsb;
  195. __le16 bssid_msb;
  196. __le16 beacon_interval; /* in TBTTs */
  197. __le32 rx_config_options;
  198. __le32 rx_filter_options;
  199. /*
  200. * The target uses this field to determine the rate at
  201. * which to transmit control frame responses (such as
  202. * ACK or CTS frames).
  203. */
  204. __le32 basic_rate_set;
  205. __le32 supported_rate_set;
  206. u8 dtim_interval;
  207. /*
  208. * bits 0-2: This bitwise field specifies the type
  209. * of BSS to start or join (BSS_TYPE_*).
  210. * bit 4: Band - The radio band in which to join
  211. * or start.
  212. * 0 - 2.4GHz band
  213. * 1 - 5GHz band
  214. * bits 3, 5-7: Reserved
  215. */
  216. u8 bss_type;
  217. u8 channel;
  218. u8 ssid_len;
  219. u8 ssid[IW_ESSID_MAX_SIZE];
  220. u8 ctrl; /* JOIN_CMD_CTRL_* */
  221. u8 reserved[3];
  222. } __packed;
  223. struct cmd_enabledisable_path {
  224. struct wl1271_cmd_header header;
  225. u8 channel;
  226. u8 padding[3];
  227. } __packed;
  228. #define WL1271_RATE_AUTOMATIC 0
  229. struct wl1271_cmd_template_set {
  230. struct wl1271_cmd_header header;
  231. __le16 len;
  232. u8 template_type;
  233. u8 index; /* relevant only for KLV_TEMPLATE type */
  234. __le32 enabled_rates;
  235. u8 short_retry_limit;
  236. u8 long_retry_limit;
  237. u8 aflags;
  238. u8 reserved;
  239. u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE];
  240. } __packed;
  241. #define TIM_ELE_ID 5
  242. #define PARTIAL_VBM_MAX 251
  243. struct wl1271_tim {
  244. u8 identity;
  245. u8 length;
  246. u8 dtim_count;
  247. u8 dtim_period;
  248. u8 bitmap_ctrl;
  249. u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */
  250. } __packed;
  251. enum wl1271_cmd_ps_mode {
  252. STATION_ACTIVE_MODE,
  253. STATION_POWER_SAVE_MODE
  254. };
  255. struct wl1271_cmd_ps_params {
  256. struct wl1271_cmd_header header;
  257. u8 ps_mode; /* STATION_* */
  258. u8 padding[3];
  259. } __packed;
  260. /* HW encryption keys */
  261. #define NUM_ACCESS_CATEGORIES_COPY 4
  262. enum wl1271_cmd_key_action {
  263. KEY_ADD_OR_REPLACE = 1,
  264. KEY_REMOVE = 2,
  265. KEY_SET_ID = 3,
  266. MAX_KEY_ACTION = 0xffff,
  267. };
  268. enum wl1271_cmd_key_type {
  269. KEY_NONE = 0,
  270. KEY_WEP = 1,
  271. KEY_TKIP = 2,
  272. KEY_AES = 3,
  273. KEY_GEM = 4,
  274. };
  275. /* FIXME: Add description for key-types */
  276. struct wl1271_cmd_set_sta_keys {
  277. struct wl1271_cmd_header header;
  278. /* Ignored for default WEP key */
  279. u8 addr[ETH_ALEN];
  280. /* key_action_e */
  281. __le16 key_action;
  282. __le16 reserved_1;
  283. /* key size in bytes */
  284. u8 key_size;
  285. /* key_type_e */
  286. u8 key_type;
  287. u8 ssid_profile;
  288. /*
  289. * TKIP, AES: frame's key id field.
  290. * For WEP default key: key id;
  291. */
  292. u8 id;
  293. u8 reserved_2[6];
  294. u8 key[MAX_KEY_SIZE];
  295. __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
  296. __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
  297. } __packed;
  298. enum wl1271_cmd_lid_key_type {
  299. UNICAST_LID_TYPE = 0,
  300. BROADCAST_LID_TYPE = 1,
  301. WEP_DEFAULT_LID_TYPE = 2
  302. };
  303. struct wl1271_cmd_set_ap_keys {
  304. struct wl1271_cmd_header header;
  305. /*
  306. * Indicates whether the HLID is a unicast key set
  307. * or broadcast key set. A special value 0xFF is
  308. * used to indicate that the HLID is on WEP-default
  309. * (multi-hlids). of type wl1271_cmd_lid_key_type.
  310. */
  311. u8 hlid;
  312. /*
  313. * In WEP-default network (hlid == 0xFF) used to
  314. * indicate which network STA/IBSS/AP role should be
  315. * changed
  316. */
  317. u8 lid_key_type;
  318. /*
  319. * Key ID - For TKIP and AES key types, this field
  320. * indicates the value that should be inserted into
  321. * the KeyID field of frames transmitted using this
  322. * key entry. For broadcast keys the index use as a
  323. * marker for TX/RX key.
  324. * For WEP default network (HLID=0xFF), this field
  325. * indicates the ID of the key to add or remove.
  326. */
  327. u8 key_id;
  328. u8 reserved_1;
  329. /* key_action_e */
  330. __le16 key_action;
  331. /* key size in bytes */
  332. u8 key_size;
  333. /* key_type_e */
  334. u8 key_type;
  335. /* This field holds the security key data to add to the STA table */
  336. u8 key[MAX_KEY_SIZE];
  337. __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY];
  338. __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY];
  339. } __packed;
  340. struct wl1271_cmd_test_header {
  341. u8 id;
  342. u8 padding[3];
  343. } __packed;
  344. enum wl1271_channel_tune_bands {
  345. WL1271_CHANNEL_TUNE_BAND_2_4,
  346. WL1271_CHANNEL_TUNE_BAND_5,
  347. WL1271_CHANNEL_TUNE_BAND_4_9
  348. };
  349. #define WL1271_PD_REFERENCE_POINT_BAND_B_G 0
  350. #define TEST_CMD_INI_FILE_RADIO_PARAM 0x19
  351. #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
  352. #define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26
  353. struct wl1271_general_parms_cmd {
  354. struct wl1271_cmd_header header;
  355. struct wl1271_cmd_test_header test;
  356. struct wl1271_ini_general_params general_params;
  357. u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
  358. u8 sr_sen_n_p;
  359. u8 sr_sen_n_p_gain;
  360. u8 sr_sen_nrn;
  361. u8 sr_sen_prn;
  362. u8 padding[3];
  363. } __packed;
  364. struct wl128x_general_parms_cmd {
  365. struct wl1271_cmd_header header;
  366. struct wl1271_cmd_test_header test;
  367. struct wl128x_ini_general_params general_params;
  368. u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM];
  369. u8 sr_sen_n_p;
  370. u8 sr_sen_n_p_gain;
  371. u8 sr_sen_nrn;
  372. u8 sr_sen_prn;
  373. u8 padding[3];
  374. } __packed;
  375. struct wl1271_radio_parms_cmd {
  376. struct wl1271_cmd_header header;
  377. struct wl1271_cmd_test_header test;
  378. /* Static radio parameters */
  379. struct wl1271_ini_band_params_2 static_params_2;
  380. struct wl1271_ini_band_params_5 static_params_5;
  381. /* Dynamic radio parameters */
  382. struct wl1271_ini_fem_params_2 dyn_params_2;
  383. u8 padding2;
  384. struct wl1271_ini_fem_params_5 dyn_params_5;
  385. u8 padding3[2];
  386. } __packed;
  387. struct wl128x_radio_parms_cmd {
  388. struct wl1271_cmd_header header;
  389. struct wl1271_cmd_test_header test;
  390. /* Static radio parameters */
  391. struct wl128x_ini_band_params_2 static_params_2;
  392. struct wl128x_ini_band_params_5 static_params_5;
  393. u8 fem_vendor_and_options;
  394. /* Dynamic radio parameters */
  395. struct wl128x_ini_fem_params_2 dyn_params_2;
  396. u8 padding2;
  397. struct wl128x_ini_fem_params_5 dyn_params_5;
  398. } __packed;
  399. struct wl1271_ext_radio_parms_cmd {
  400. struct wl1271_cmd_header header;
  401. struct wl1271_cmd_test_header test;
  402. u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
  403. u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
  404. u8 padding[3];
  405. } __packed;
  406. /*
  407. * There are three types of disconnections:
  408. *
  409. * DISCONNECT_IMMEDIATE: the fw doesn't send any frames
  410. * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason
  411. * we have passed
  412. * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason
  413. * we have passed
  414. */
  415. enum wl1271_disconnect_type {
  416. DISCONNECT_IMMEDIATE,
  417. DISCONNECT_DEAUTH,
  418. DISCONNECT_DISASSOC
  419. };
  420. struct wl1271_cmd_disconnect {
  421. struct wl1271_cmd_header header;
  422. __le32 rx_config_options;
  423. __le32 rx_filter_options;
  424. __le16 reason;
  425. u8 type;
  426. u8 padding;
  427. } __packed;
  428. #define WL1271_CMD_STA_STATE_CONNECTED 1
  429. struct wl1271_cmd_set_sta_state {
  430. struct wl1271_cmd_header header;
  431. u8 state;
  432. u8 padding[3];
  433. } __packed;
  434. enum wl1271_ssid_type {
  435. SSID_TYPE_PUBLIC = 0,
  436. SSID_TYPE_HIDDEN = 1
  437. };
  438. struct wl1271_cmd_bss_start {
  439. struct wl1271_cmd_header header;
  440. /* wl1271_ssid_type */
  441. u8 ssid_type;
  442. u8 ssid_len;
  443. u8 ssid[IW_ESSID_MAX_SIZE];
  444. u8 padding_1[2];
  445. /* Basic rate set */
  446. __le32 basic_rate_set;
  447. /* Aging period in seconds*/
  448. __le16 aging_period;
  449. /*
  450. * This field specifies the time between target beacon
  451. * transmission times (TBTTs), in time units (TUs).
  452. * Valid values are 1 to 1024.
  453. */
  454. __le16 beacon_interval;
  455. u8 bssid[ETH_ALEN];
  456. u8 bss_index;
  457. /* Radio band */
  458. u8 band;
  459. u8 channel;
  460. /* The host link id for the AP's global queue */
  461. u8 global_hlid;
  462. /* The host link id for the AP's broadcast queue */
  463. u8 broadcast_hlid;
  464. /* DTIM count */
  465. u8 dtim_interval;
  466. /* Beacon expiry time in ms */
  467. u8 beacon_expiry;
  468. u8 padding_2[3];
  469. } __packed;
  470. struct wl1271_cmd_add_sta {
  471. struct wl1271_cmd_header header;
  472. u8 addr[ETH_ALEN];
  473. u8 hlid;
  474. u8 aid;
  475. u8 psd_type[NUM_ACCESS_CATEGORIES_COPY];
  476. __le32 supported_rates;
  477. u8 bss_index;
  478. u8 sp_len;
  479. u8 wmm;
  480. u8 padding1;
  481. } __packed;
  482. struct wl1271_cmd_remove_sta {
  483. struct wl1271_cmd_header header;
  484. u8 hlid;
  485. u8 reason_opcode;
  486. u8 send_deauth_flag;
  487. u8 padding1;
  488. } __packed;
  489. /*
  490. * Continuous mode - packets are transferred to the host periodically
  491. * via the data path.
  492. * On demand - Log messages are stored in a cyclic buffer in the
  493. * firmware, and only transferred to the host when explicitly requested
  494. */
  495. enum wl12xx_fwlogger_log_mode {
  496. WL12XX_FWLOG_CONTINUOUS,
  497. WL12XX_FWLOG_ON_DEMAND
  498. };
  499. /* Include/exclude timestamps from the log messages */
  500. enum wl12xx_fwlogger_timestamp {
  501. WL12XX_FWLOG_TIMESTAMP_DISABLED,
  502. WL12XX_FWLOG_TIMESTAMP_ENABLED
  503. };
  504. /*
  505. * Logs can be routed to the debug pinouts (where available), to the host bus
  506. * (SDIO/SPI), or dropped
  507. */
  508. enum wl12xx_fwlogger_output {
  509. WL12XX_FWLOG_OUTPUT_NONE,
  510. WL12XX_FWLOG_OUTPUT_DBG_PINS,
  511. WL12XX_FWLOG_OUTPUT_HOST,
  512. };
  513. struct wl12xx_cmd_config_fwlog {
  514. struct wl1271_cmd_header header;
  515. /* See enum wl12xx_fwlogger_log_mode */
  516. u8 logger_mode;
  517. /* Minimum log level threshold */
  518. u8 log_severity;
  519. /* Include/exclude timestamps from the log messages */
  520. u8 timestamp;
  521. /* See enum wl1271_fwlogger_output */
  522. u8 output;
  523. /* Regulates the frequency of log messages */
  524. u8 threshold;
  525. u8 padding[3];
  526. } __packed;
  527. struct wl12xx_cmd_start_fwlog {
  528. struct wl1271_cmd_header header;
  529. } __packed;
  530. struct wl12xx_cmd_stop_fwlog {
  531. struct wl1271_cmd_header header;
  532. } __packed;
  533. #endif /* __WL1271_CMD_H__ */