cmd.h 17 KB

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