acx.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2008-2010 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 __ACX_H__
  25. #define __ACX_H__
  26. #include "wlcore.h"
  27. #include "cmd.h"
  28. /*************************************************************************
  29. Host Interrupt Register (WiLink -> Host)
  30. **************************************************************************/
  31. /* HW Initiated interrupt Watchdog timer expiration */
  32. #define WL1271_ACX_INTR_WATCHDOG BIT(0)
  33. /* Init sequence is done (masked interrupt, detection through polling only ) */
  34. #define WL1271_ACX_INTR_INIT_COMPLETE BIT(1)
  35. /* Event was entered to Event MBOX #A*/
  36. #define WL1271_ACX_INTR_EVENT_A BIT(2)
  37. /* Event was entered to Event MBOX #B*/
  38. #define WL1271_ACX_INTR_EVENT_B BIT(3)
  39. /* Command processing completion*/
  40. #define WL1271_ACX_INTR_CMD_COMPLETE BIT(4)
  41. /* Signaling the host on HW wakeup */
  42. #define WL1271_ACX_INTR_HW_AVAILABLE BIT(5)
  43. /* The MISC bit is used for aggregation of RX, TxComplete and TX rate update */
  44. #define WL1271_ACX_INTR_DATA BIT(6)
  45. /* Trace message on MBOX #A */
  46. #define WL1271_ACX_INTR_TRACE_A BIT(7)
  47. /* Trace message on MBOX #B */
  48. #define WL1271_ACX_INTR_TRACE_B BIT(8)
  49. /* SW FW Initiated interrupt Watchdog timer expiration */
  50. #define WL1271_ACX_SW_INTR_WATCHDOG BIT(9)
  51. #define WL1271_ACX_INTR_ALL 0xFFFFFFFF
  52. /* all possible interrupts - only appropriate ones will be masked in */
  53. #define WLCORE_ALL_INTR_MASK (WL1271_ACX_INTR_WATCHDOG | \
  54. WL1271_ACX_INTR_EVENT_A | \
  55. WL1271_ACX_INTR_EVENT_B | \
  56. WL1271_ACX_INTR_HW_AVAILABLE | \
  57. WL1271_ACX_INTR_DATA | \
  58. WL1271_ACX_SW_INTR_WATCHDOG)
  59. /* Target's information element */
  60. struct acx_header {
  61. struct wl1271_cmd_header cmd;
  62. /* acx (or information element) header */
  63. __le16 id;
  64. /* payload length (not including headers */
  65. __le16 len;
  66. } __packed;
  67. struct acx_error_counter {
  68. struct acx_header header;
  69. /* The number of PLCP errors since the last time this */
  70. /* information element was interrogated. This field is */
  71. /* automatically cleared when it is interrogated.*/
  72. __le32 PLCP_error;
  73. /* The number of FCS errors since the last time this */
  74. /* information element was interrogated. This field is */
  75. /* automatically cleared when it is interrogated.*/
  76. __le32 FCS_error;
  77. /* The number of MPDUs without PLCP header errors received*/
  78. /* since the last time this information element was interrogated. */
  79. /* This field is automatically cleared when it is interrogated.*/
  80. __le32 valid_frame;
  81. /* the number of missed sequence numbers in the squentially */
  82. /* values of frames seq numbers */
  83. __le32 seq_num_miss;
  84. } __packed;
  85. enum wl12xx_role {
  86. WL1271_ROLE_STA = 0,
  87. WL1271_ROLE_IBSS,
  88. WL1271_ROLE_AP,
  89. WL1271_ROLE_DEVICE,
  90. WL1271_ROLE_P2P_CL,
  91. WL1271_ROLE_P2P_GO,
  92. WL12XX_INVALID_ROLE_TYPE = 0xff
  93. };
  94. enum wl1271_psm_mode {
  95. /* Active mode */
  96. WL1271_PSM_CAM = 0,
  97. /* Power save mode */
  98. WL1271_PSM_PS = 1,
  99. /* Extreme low power */
  100. WL1271_PSM_ELP = 2,
  101. };
  102. struct acx_sleep_auth {
  103. struct acx_header header;
  104. /* The sleep level authorization of the device. */
  105. /* 0 - Always active*/
  106. /* 1 - Power down mode: light / fast sleep*/
  107. /* 2 - ELP mode: Deep / Max sleep*/
  108. u8 sleep_auth;
  109. u8 padding[3];
  110. } __packed;
  111. enum {
  112. HOSTIF_PCI_MASTER_HOST_INDIRECT,
  113. HOSTIF_PCI_MASTER_HOST_DIRECT,
  114. HOSTIF_SLAVE,
  115. HOSTIF_PKT_RING,
  116. HOSTIF_DONTCARE = 0xFF
  117. };
  118. #define DEFAULT_UCAST_PRIORITY 0
  119. #define DEFAULT_RX_Q_PRIORITY 0
  120. #define DEFAULT_RXQ_PRIORITY 0 /* low 0 .. 15 high */
  121. #define DEFAULT_RXQ_TYPE 0x07 /* All frames, Data/Ctrl/Mgmt */
  122. #define TRACE_BUFFER_MAX_SIZE 256
  123. #define DP_RX_PACKET_RING_CHUNK_SIZE 1600
  124. #define DP_TX_PACKET_RING_CHUNK_SIZE 1600
  125. #define DP_RX_PACKET_RING_CHUNK_NUM 2
  126. #define DP_TX_PACKET_RING_CHUNK_NUM 2
  127. #define DP_TX_COMPLETE_TIME_OUT 20
  128. #define TX_MSDU_LIFETIME_MIN 0
  129. #define TX_MSDU_LIFETIME_MAX 3000
  130. #define TX_MSDU_LIFETIME_DEF 512
  131. #define RX_MSDU_LIFETIME_MIN 0
  132. #define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF
  133. #define RX_MSDU_LIFETIME_DEF 512000
  134. struct acx_rx_msdu_lifetime {
  135. struct acx_header header;
  136. /*
  137. * The maximum amount of time, in TU, before the
  138. * firmware discards the MSDU.
  139. */
  140. __le32 lifetime;
  141. } __packed;
  142. enum acx_slot_type {
  143. SLOT_TIME_LONG = 0,
  144. SLOT_TIME_SHORT = 1,
  145. DEFAULT_SLOT_TIME = SLOT_TIME_SHORT,
  146. MAX_SLOT_TIMES = 0xFF
  147. };
  148. #define STATION_WONE_INDEX 0
  149. struct acx_slot {
  150. struct acx_header header;
  151. u8 role_id;
  152. u8 wone_index; /* Reserved */
  153. u8 slot_time;
  154. u8 reserved[5];
  155. } __packed;
  156. #define ACX_MC_ADDRESS_GROUP_MAX (8)
  157. #define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ACX_MC_ADDRESS_GROUP_MAX)
  158. struct acx_dot11_grp_addr_tbl {
  159. struct acx_header header;
  160. u8 role_id;
  161. u8 enabled;
  162. u8 num_groups;
  163. u8 pad[1];
  164. u8 mac_table[ADDRESS_GROUP_MAX_LEN];
  165. } __packed;
  166. struct acx_rx_timeout {
  167. struct acx_header header;
  168. u8 role_id;
  169. u8 reserved;
  170. __le16 ps_poll_timeout;
  171. __le16 upsd_timeout;
  172. u8 padding[2];
  173. } __packed;
  174. struct acx_rts_threshold {
  175. struct acx_header header;
  176. u8 role_id;
  177. u8 reserved;
  178. __le16 threshold;
  179. } __packed;
  180. struct acx_beacon_filter_option {
  181. struct acx_header header;
  182. u8 role_id;
  183. u8 enable;
  184. /*
  185. * The number of beacons without the unicast TIM
  186. * bit set that the firmware buffers before
  187. * signaling the host about ready frames.
  188. * When set to 0 and the filter is enabled, beacons
  189. * without the unicast TIM bit set are dropped.
  190. */
  191. u8 max_num_beacons;
  192. u8 pad[1];
  193. } __packed;
  194. /*
  195. * ACXBeaconFilterEntry (not 221)
  196. * Byte Offset Size (Bytes) Definition
  197. * =========== ============ ==========
  198. * 0 1 IE identifier
  199. * 1 1 Treatment bit mask
  200. *
  201. * ACXBeaconFilterEntry (221)
  202. * Byte Offset Size (Bytes) Definition
  203. * =========== ============ ==========
  204. * 0 1 IE identifier
  205. * 1 1 Treatment bit mask
  206. * 2 3 OUI
  207. * 5 1 Type
  208. * 6 2 Version
  209. *
  210. *
  211. * Treatment bit mask - The information element handling:
  212. * bit 0 - The information element is compared and transferred
  213. * in case of change.
  214. * bit 1 - The information element is transferred to the host
  215. * with each appearance or disappearance.
  216. * Note that both bits can be set at the same time.
  217. */
  218. #define BEACON_FILTER_TABLE_MAX_IE_NUM (32)
  219. #define BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM (6)
  220. #define BEACON_FILTER_TABLE_IE_ENTRY_SIZE (2)
  221. #define BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE (6)
  222. #define BEACON_FILTER_TABLE_MAX_SIZE ((BEACON_FILTER_TABLE_MAX_IE_NUM * \
  223. BEACON_FILTER_TABLE_IE_ENTRY_SIZE) + \
  224. (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
  225. BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))
  226. struct acx_beacon_filter_ie_table {
  227. struct acx_header header;
  228. u8 role_id;
  229. u8 num_ie;
  230. u8 pad[2];
  231. u8 table[BEACON_FILTER_TABLE_MAX_SIZE];
  232. } __packed;
  233. struct acx_conn_monit_params {
  234. struct acx_header header;
  235. u8 role_id;
  236. u8 padding[3];
  237. __le32 synch_fail_thold; /* number of beacons missed */
  238. __le32 bss_lose_timeout; /* number of TU's from synch fail */
  239. } __packed;
  240. struct acx_bt_wlan_coex {
  241. struct acx_header header;
  242. u8 enable;
  243. u8 pad[3];
  244. } __packed;
  245. struct acx_bt_wlan_coex_param {
  246. struct acx_header header;
  247. __le32 params[CONF_SG_PARAMS_MAX];
  248. u8 param_idx;
  249. u8 padding[3];
  250. } __packed;
  251. struct acx_dco_itrim_params {
  252. struct acx_header header;
  253. u8 enable;
  254. u8 padding[3];
  255. __le32 timeout;
  256. } __packed;
  257. struct acx_energy_detection {
  258. struct acx_header header;
  259. /* The RX Clear Channel Assessment threshold in the PHY */
  260. __le16 rx_cca_threshold;
  261. u8 tx_energy_detection;
  262. u8 pad;
  263. } __packed;
  264. struct acx_beacon_broadcast {
  265. struct acx_header header;
  266. u8 role_id;
  267. /* Enables receiving of broadcast packets in PS mode */
  268. u8 rx_broadcast_in_ps;
  269. __le16 beacon_rx_timeout;
  270. __le16 broadcast_timeout;
  271. /* Consecutive PS Poll failures before updating the host */
  272. u8 ps_poll_threshold;
  273. u8 pad[1];
  274. } __packed;
  275. struct acx_event_mask {
  276. struct acx_header header;
  277. __le32 event_mask;
  278. __le32 high_event_mask; /* Unused */
  279. } __packed;
  280. #define SCAN_PASSIVE BIT(0)
  281. #define SCAN_5GHZ_BAND BIT(1)
  282. #define SCAN_TRIGGERED BIT(2)
  283. #define SCAN_PRIORITY_HIGH BIT(3)
  284. /* When set, disable HW encryption */
  285. #define DF_ENCRYPTION_DISABLE 0x01
  286. #define DF_SNIFF_MODE_ENABLE 0x80
  287. struct acx_feature_config {
  288. struct acx_header header;
  289. u8 role_id;
  290. u8 padding[3];
  291. __le32 options;
  292. __le32 data_flow_options;
  293. } __packed;
  294. struct acx_current_tx_power {
  295. struct acx_header header;
  296. u8 role_id;
  297. u8 current_tx_power;
  298. u8 padding[2];
  299. } __packed;
  300. struct acx_wake_up_condition {
  301. struct acx_header header;
  302. u8 role_id;
  303. u8 wake_up_event; /* Only one bit can be set */
  304. u8 listen_interval;
  305. u8 pad[1];
  306. } __packed;
  307. struct acx_aid {
  308. struct acx_header header;
  309. /*
  310. * To be set when associated with an AP.
  311. */
  312. u8 role_id;
  313. u8 reserved;
  314. __le16 aid;
  315. } __packed;
  316. enum acx_preamble_type {
  317. ACX_PREAMBLE_LONG = 0,
  318. ACX_PREAMBLE_SHORT = 1
  319. };
  320. struct acx_preamble {
  321. struct acx_header header;
  322. /*
  323. * When set, the WiLink transmits the frames with a short preamble and
  324. * when cleared, the WiLink transmits the frames with a long preamble.
  325. */
  326. u8 role_id;
  327. u8 preamble;
  328. u8 padding[2];
  329. } __packed;
  330. enum acx_ctsprotect_type {
  331. CTSPROTECT_DISABLE = 0,
  332. CTSPROTECT_ENABLE = 1
  333. };
  334. struct acx_ctsprotect {
  335. struct acx_header header;
  336. u8 role_id;
  337. u8 ctsprotect;
  338. u8 padding[2];
  339. } __packed;
  340. struct acx_rate_class {
  341. __le32 enabled_rates;
  342. u8 short_retry_limit;
  343. u8 long_retry_limit;
  344. u8 aflags;
  345. u8 reserved;
  346. };
  347. struct acx_rate_policy {
  348. struct acx_header header;
  349. __le32 rate_policy_idx;
  350. struct acx_rate_class rate_policy;
  351. } __packed;
  352. struct acx_ac_cfg {
  353. struct acx_header header;
  354. u8 role_id;
  355. u8 ac;
  356. u8 aifsn;
  357. u8 cw_min;
  358. __le16 cw_max;
  359. __le16 tx_op_limit;
  360. } __packed;
  361. struct acx_tid_config {
  362. struct acx_header header;
  363. u8 role_id;
  364. u8 queue_id;
  365. u8 channel_type;
  366. u8 tsid;
  367. u8 ps_scheme;
  368. u8 ack_policy;
  369. u8 padding[2];
  370. __le32 apsd_conf[2];
  371. } __packed;
  372. struct acx_frag_threshold {
  373. struct acx_header header;
  374. __le16 frag_threshold;
  375. u8 padding[2];
  376. } __packed;
  377. struct acx_tx_config_options {
  378. struct acx_header header;
  379. __le16 tx_compl_timeout; /* msec */
  380. __le16 tx_compl_threshold; /* number of packets */
  381. } __packed;
  382. struct wl12xx_acx_config_memory {
  383. struct acx_header header;
  384. u8 rx_mem_block_num;
  385. u8 tx_min_mem_block_num;
  386. u8 num_stations;
  387. u8 num_ssid_profiles;
  388. __le32 total_tx_descriptors;
  389. u8 dyn_mem_enable;
  390. u8 tx_free_req;
  391. u8 rx_free_req;
  392. u8 tx_min;
  393. u8 fwlog_blocks;
  394. u8 padding[3];
  395. } __packed;
  396. struct wl1271_acx_mem_map {
  397. struct acx_header header;
  398. __le32 code_start;
  399. __le32 code_end;
  400. __le32 wep_defkey_start;
  401. __le32 wep_defkey_end;
  402. __le32 sta_table_start;
  403. __le32 sta_table_end;
  404. __le32 packet_template_start;
  405. __le32 packet_template_end;
  406. /* Address of the TX result interface (control block) */
  407. __le32 tx_result;
  408. __le32 tx_result_queue_start;
  409. __le32 queue_memory_start;
  410. __le32 queue_memory_end;
  411. __le32 packet_memory_pool_start;
  412. __le32 packet_memory_pool_end;
  413. __le32 debug_buffer1_start;
  414. __le32 debug_buffer1_end;
  415. __le32 debug_buffer2_start;
  416. __le32 debug_buffer2_end;
  417. /* Number of blocks FW allocated for TX packets */
  418. __le32 num_tx_mem_blocks;
  419. /* Number of blocks FW allocated for RX packets */
  420. __le32 num_rx_mem_blocks;
  421. /* the following 4 fields are valid in SLAVE mode only */
  422. u8 *tx_cbuf;
  423. u8 *rx_cbuf;
  424. __le32 rx_ctrl;
  425. __le32 tx_ctrl;
  426. } __packed;
  427. struct wl1271_acx_rx_config_opt {
  428. struct acx_header header;
  429. __le16 mblk_threshold;
  430. __le16 threshold;
  431. __le16 timeout;
  432. u8 queue_type;
  433. u8 reserved;
  434. } __packed;
  435. struct wl1271_acx_bet_enable {
  436. struct acx_header header;
  437. u8 role_id;
  438. u8 enable;
  439. u8 max_consecutive;
  440. u8 padding[1];
  441. } __packed;
  442. #define ACX_IPV4_VERSION 4
  443. #define ACX_IPV6_VERSION 6
  444. #define ACX_IPV4_ADDR_SIZE 4
  445. /* bitmap of enabled arp_filter features */
  446. #define ACX_ARP_FILTER_ARP_FILTERING BIT(0)
  447. #define ACX_ARP_FILTER_AUTO_ARP BIT(1)
  448. struct wl1271_acx_arp_filter {
  449. struct acx_header header;
  450. u8 role_id;
  451. u8 version; /* ACX_IPV4_VERSION, ACX_IPV6_VERSION */
  452. u8 enable; /* bitmap of enabled ARP filtering features */
  453. u8 padding[1];
  454. u8 address[16]; /* The configured device IP address - all ARP
  455. requests directed to this IP address will pass
  456. through. For IPv4, the first four bytes are
  457. used. */
  458. } __packed;
  459. struct wl1271_acx_pm_config {
  460. struct acx_header header;
  461. __le32 host_clk_settling_time;
  462. u8 host_fast_wakeup_support;
  463. u8 padding[3];
  464. } __packed;
  465. struct wl1271_acx_keep_alive_mode {
  466. struct acx_header header;
  467. u8 role_id;
  468. u8 enabled;
  469. u8 padding[2];
  470. } __packed;
  471. enum {
  472. ACX_KEEP_ALIVE_NO_TX = 0,
  473. ACX_KEEP_ALIVE_PERIOD_ONLY
  474. };
  475. enum {
  476. ACX_KEEP_ALIVE_TPL_INVALID = 0,
  477. ACX_KEEP_ALIVE_TPL_VALID
  478. };
  479. struct wl1271_acx_keep_alive_config {
  480. struct acx_header header;
  481. u8 role_id;
  482. u8 index;
  483. u8 tpl_validation;
  484. u8 trigger;
  485. __le32 period;
  486. } __packed;
  487. /* TODO: maybe this needs to be moved somewhere else? */
  488. #define HOST_IF_CFG_RX_FIFO_ENABLE BIT(0)
  489. #define HOST_IF_CFG_TX_EXTRA_BLKS_SWAP BIT(1)
  490. #define HOST_IF_CFG_TX_PAD_TO_SDIO_BLK BIT(3)
  491. #define HOST_IF_CFG_RX_PAD_TO_SDIO_BLK BIT(4)
  492. #define HOST_IF_CFG_ADD_RX_ALIGNMENT BIT(6)
  493. enum {
  494. WL1271_ACX_TRIG_TYPE_LEVEL = 0,
  495. WL1271_ACX_TRIG_TYPE_EDGE,
  496. };
  497. enum {
  498. WL1271_ACX_TRIG_DIR_LOW = 0,
  499. WL1271_ACX_TRIG_DIR_HIGH,
  500. WL1271_ACX_TRIG_DIR_BIDIR,
  501. };
  502. enum {
  503. WL1271_ACX_TRIG_ENABLE = 1,
  504. WL1271_ACX_TRIG_DISABLE,
  505. };
  506. enum {
  507. WL1271_ACX_TRIG_METRIC_RSSI_BEACON = 0,
  508. WL1271_ACX_TRIG_METRIC_RSSI_DATA,
  509. WL1271_ACX_TRIG_METRIC_SNR_BEACON,
  510. WL1271_ACX_TRIG_METRIC_SNR_DATA,
  511. };
  512. enum {
  513. WL1271_ACX_TRIG_IDX_RSSI = 0,
  514. WL1271_ACX_TRIG_COUNT = 8,
  515. };
  516. struct wl1271_acx_rssi_snr_trigger {
  517. struct acx_header header;
  518. u8 role_id;
  519. u8 metric;
  520. u8 type;
  521. u8 dir;
  522. __le16 threshold;
  523. __le16 pacing; /* 0 - 60000 ms */
  524. u8 hysteresis;
  525. u8 index;
  526. u8 enable;
  527. u8 padding[1];
  528. };
  529. struct wl1271_acx_rssi_snr_avg_weights {
  530. struct acx_header header;
  531. u8 role_id;
  532. u8 padding[3];
  533. u8 rssi_beacon;
  534. u8 rssi_data;
  535. u8 snr_beacon;
  536. u8 snr_data;
  537. };
  538. /* special capability bit (not employed by the 802.11n spec) */
  539. #define WL12XX_HT_CAP_HT_OPERATION BIT(16)
  540. /*
  541. * ACX_PEER_HT_CAP
  542. * Configure HT capabilities - declare the capabilities of the peer
  543. * we are connected to.
  544. */
  545. struct wl1271_acx_ht_capabilities {
  546. struct acx_header header;
  547. /* bitmask of capability bits supported by the peer */
  548. __le32 ht_capabilites;
  549. /* Indicates to which link these capabilities apply. */
  550. u8 hlid;
  551. /*
  552. * This the maximum A-MPDU length supported by the AP. The FW may not
  553. * exceed this length when sending A-MPDUs
  554. */
  555. u8 ampdu_max_length;
  556. /* This is the minimal spacing required when sending A-MPDUs to the AP*/
  557. u8 ampdu_min_spacing;
  558. u8 padding;
  559. } __packed;
  560. /*
  561. * ACX_HT_BSS_OPERATION
  562. * Configure HT capabilities - AP rules for behavior in the BSS.
  563. */
  564. struct wl1271_acx_ht_information {
  565. struct acx_header header;
  566. u8 role_id;
  567. /* Values: 0 - RIFS not allowed, 1 - RIFS allowed */
  568. u8 rifs_mode;
  569. /* Values: 0 - 3 like in spec */
  570. u8 ht_protection;
  571. /* Values: 0 - GF protection not required, 1 - GF protection required */
  572. u8 gf_protection;
  573. /*Values: 0 - TX Burst limit not required, 1 - TX Burst Limit required*/
  574. u8 ht_tx_burst_limit;
  575. /*
  576. * Values: 0 - Dual CTS protection not required,
  577. * 1 - Dual CTS Protection required
  578. * Note: When this value is set to 1 FW will protect all TXOP with RTS
  579. * frame and will not use CTS-to-self regardless of the value of the
  580. * ACX_CTS_PROTECTION information element
  581. */
  582. u8 dual_cts_protection;
  583. u8 padding[2];
  584. } __packed;
  585. #define RX_BA_MAX_SESSIONS 3
  586. struct wl1271_acx_ba_initiator_policy {
  587. struct acx_header header;
  588. /* Specifies role Id, Range 0-7, 0xFF means ANY role. */
  589. u8 role_id;
  590. /*
  591. * Per TID setting for allowing TX BA. Set a bit to 1 to allow
  592. * TX BA sessions for the corresponding TID.
  593. */
  594. u8 tid_bitmap;
  595. /* Windows size in number of packets */
  596. u8 win_size;
  597. u8 padding1[1];
  598. /* As initiator inactivity timeout in time units(TU) of 1024us */
  599. u16 inactivity_timeout;
  600. u8 padding[2];
  601. } __packed;
  602. struct wl1271_acx_ba_receiver_setup {
  603. struct acx_header header;
  604. /* Specifies link id, range 0-31 */
  605. u8 hlid;
  606. u8 tid;
  607. u8 enable;
  608. /* Windows size in number of packets */
  609. u8 win_size;
  610. /* BA session starting sequence number. RANGE 0-FFF */
  611. u16 ssn;
  612. u8 padding[2];
  613. } __packed;
  614. struct wl12xx_acx_fw_tsf_information {
  615. struct acx_header header;
  616. u8 role_id;
  617. u8 padding1[3];
  618. __le32 current_tsf_high;
  619. __le32 current_tsf_low;
  620. __le32 last_bttt_high;
  621. __le32 last_tbtt_low;
  622. u8 last_dtim_count;
  623. u8 padding2[3];
  624. } __packed;
  625. struct wl1271_acx_ps_rx_streaming {
  626. struct acx_header header;
  627. u8 role_id;
  628. u8 tid;
  629. u8 enable;
  630. /* interval between triggers (10-100 msec) */
  631. u8 period;
  632. /* timeout before first trigger (0-200 msec) */
  633. u8 timeout;
  634. u8 padding[3];
  635. } __packed;
  636. struct wl1271_acx_ap_max_tx_retry {
  637. struct acx_header header;
  638. u8 role_id;
  639. u8 padding_1;
  640. /*
  641. * the number of frames transmission failures before
  642. * issuing the aging event.
  643. */
  644. __le16 max_tx_retry;
  645. } __packed;
  646. struct wl1271_acx_config_ps {
  647. struct acx_header header;
  648. u8 exit_retries;
  649. u8 enter_retries;
  650. u8 padding[2];
  651. __le32 null_data_rate;
  652. } __packed;
  653. struct wl1271_acx_inconnection_sta {
  654. struct acx_header header;
  655. u8 addr[ETH_ALEN];
  656. u8 padding1[2];
  657. } __packed;
  658. /*
  659. * ACX_FM_COEX_CFG
  660. * set the FM co-existence parameters.
  661. */
  662. struct wl1271_acx_fm_coex {
  663. struct acx_header header;
  664. /* enable(1) / disable(0) the FM Coex feature */
  665. u8 enable;
  666. /*
  667. * Swallow period used in COEX PLL swallowing mechanism.
  668. * 0xFF = use FW default
  669. */
  670. u8 swallow_period;
  671. /*
  672. * The N divider used in COEX PLL swallowing mechanism for Fref of
  673. * 38.4/19.2 Mhz. 0xFF = use FW default
  674. */
  675. u8 n_divider_fref_set_1;
  676. /*
  677. * The N divider used in COEX PLL swallowing mechanism for Fref of
  678. * 26/52 Mhz. 0xFF = use FW default
  679. */
  680. u8 n_divider_fref_set_2;
  681. /*
  682. * The M divider used in COEX PLL swallowing mechanism for Fref of
  683. * 38.4/19.2 Mhz. 0xFFFF = use FW default
  684. */
  685. __le16 m_divider_fref_set_1;
  686. /*
  687. * The M divider used in COEX PLL swallowing mechanism for Fref of
  688. * 26/52 Mhz. 0xFFFF = use FW default
  689. */
  690. __le16 m_divider_fref_set_2;
  691. /*
  692. * The time duration in uSec required for COEX PLL to stabilize.
  693. * 0xFFFFFFFF = use FW default
  694. */
  695. __le32 coex_pll_stabilization_time;
  696. /*
  697. * The time duration in uSec required for LDO to stabilize.
  698. * 0xFFFFFFFF = use FW default
  699. */
  700. __le16 ldo_stabilization_time;
  701. /*
  702. * The disturbed frequency band margin around the disturbed frequency
  703. * center (single sided).
  704. * For example, if 2 is configured, the following channels will be
  705. * considered disturbed channel:
  706. * 80 +- 0.1 MHz, 91 +- 0.1 MHz, 98 +- 0.1 MHz, 102 +- 0.1 MH
  707. * 0xFF = use FW default
  708. */
  709. u8 fm_disturbed_band_margin;
  710. /*
  711. * The swallow clock difference of the swallowing mechanism.
  712. * 0xFF = use FW default
  713. */
  714. u8 swallow_clk_diff;
  715. } __packed;
  716. #define ACX_RATE_MGMT_ALL_PARAMS 0xff
  717. struct wl12xx_acx_set_rate_mgmt_params {
  718. struct acx_header header;
  719. u8 index; /* 0xff to configure all params */
  720. u8 padding1;
  721. __le16 rate_retry_score;
  722. __le16 per_add;
  723. __le16 per_th1;
  724. __le16 per_th2;
  725. __le16 max_per;
  726. u8 inverse_curiosity_factor;
  727. u8 tx_fail_low_th;
  728. u8 tx_fail_high_th;
  729. u8 per_alpha_shift;
  730. u8 per_add_shift;
  731. u8 per_beta1_shift;
  732. u8 per_beta2_shift;
  733. u8 rate_check_up;
  734. u8 rate_check_down;
  735. u8 rate_retry_policy[ACX_RATE_MGMT_NUM_OF_RATES];
  736. u8 padding2[2];
  737. } __packed;
  738. struct wl12xx_acx_config_hangover {
  739. struct acx_header header;
  740. __le32 recover_time;
  741. u8 hangover_period;
  742. u8 dynamic_mode;
  743. u8 early_termination_mode;
  744. u8 max_period;
  745. u8 min_period;
  746. u8 increase_delta;
  747. u8 decrease_delta;
  748. u8 quiet_time;
  749. u8 increase_time;
  750. u8 window_size;
  751. u8 padding[2];
  752. } __packed;
  753. struct acx_default_rx_filter {
  754. struct acx_header header;
  755. u8 enable;
  756. /* action of type FILTER_XXX */
  757. u8 default_action;
  758. u8 pad[2];
  759. } __packed;
  760. struct acx_rx_filter_cfg {
  761. struct acx_header header;
  762. u8 enable;
  763. /* 0 - WL1271_MAX_RX_FILTERS-1 */
  764. u8 index;
  765. u8 action;
  766. u8 num_fields;
  767. u8 fields[0];
  768. } __packed;
  769. enum {
  770. ACX_WAKE_UP_CONDITIONS = 0x0000,
  771. ACX_MEM_CFG = 0x0001,
  772. ACX_SLOT = 0x0002,
  773. ACX_AC_CFG = 0x0003,
  774. ACX_MEM_MAP = 0x0004,
  775. ACX_AID = 0x0005,
  776. ACX_MEDIUM_USAGE = 0x0006,
  777. ACX_STATISTICS = 0x0007,
  778. ACX_PWR_CONSUMPTION_STATISTICS = 0x0008,
  779. ACX_TID_CFG = 0x0009,
  780. ACX_PS_RX_STREAMING = 0x000A,
  781. ACX_BEACON_FILTER_OPT = 0x000B,
  782. ACX_NOISE_HIST = 0x000C,
  783. ACX_HDK_VERSION = 0x000D,
  784. ACX_PD_THRESHOLD = 0x000E,
  785. ACX_TX_CONFIG_OPT = 0x000F,
  786. ACX_CCA_THRESHOLD = 0x0010,
  787. ACX_EVENT_MBOX_MASK = 0x0011,
  788. ACX_CONN_MONIT_PARAMS = 0x0012,
  789. ACX_DISABLE_BROADCASTS = 0x0013,
  790. ACX_BCN_DTIM_OPTIONS = 0x0014,
  791. ACX_SG_ENABLE = 0x0015,
  792. ACX_SG_CFG = 0x0016,
  793. ACX_FM_COEX_CFG = 0x0017,
  794. ACX_BEACON_FILTER_TABLE = 0x0018,
  795. ACX_ARP_IP_FILTER = 0x0019,
  796. ACX_ROAMING_STATISTICS_TBL = 0x001A,
  797. ACX_RATE_POLICY = 0x001B,
  798. ACX_CTS_PROTECTION = 0x001C,
  799. ACX_SLEEP_AUTH = 0x001D,
  800. ACX_PREAMBLE_TYPE = 0x001E,
  801. ACX_ERROR_CNT = 0x001F,
  802. ACX_IBSS_FILTER = 0x0020,
  803. ACX_SERVICE_PERIOD_TIMEOUT = 0x0021,
  804. ACX_TSF_INFO = 0x0022,
  805. ACX_CONFIG_PS_WMM = 0x0023,
  806. ACX_ENABLE_RX_DATA_FILTER = 0x0024,
  807. ACX_SET_RX_DATA_FILTER = 0x0025,
  808. ACX_GET_DATA_FILTER_STATISTICS = 0x0026,
  809. ACX_RX_CONFIG_OPT = 0x0027,
  810. ACX_FRAG_CFG = 0x0028,
  811. ACX_BET_ENABLE = 0x0029,
  812. ACX_RSSI_SNR_TRIGGER = 0x002A,
  813. ACX_RSSI_SNR_WEIGHTS = 0x002B,
  814. ACX_KEEP_ALIVE_MODE = 0x002C,
  815. ACX_SET_KEEP_ALIVE_CONFIG = 0x002D,
  816. ACX_BA_SESSION_INIT_POLICY = 0x002E,
  817. ACX_BA_SESSION_RX_SETUP = 0x002F,
  818. ACX_PEER_HT_CAP = 0x0030,
  819. ACX_HT_BSS_OPERATION = 0x0031,
  820. ACX_COEX_ACTIVITY = 0x0032,
  821. ACX_BURST_MODE = 0x0033,
  822. ACX_SET_RATE_MGMT_PARAMS = 0x0034,
  823. ACX_GET_RATE_MGMT_PARAMS = 0x0035,
  824. ACX_SET_RATE_ADAPT_PARAMS = 0x0036,
  825. ACX_SET_DCO_ITRIM_PARAMS = 0x0037,
  826. ACX_GEN_FW_CMD = 0x0038,
  827. ACX_HOST_IF_CFG_BITMAP = 0x0039,
  828. ACX_MAX_TX_FAILURE = 0x003A,
  829. ACX_UPDATE_INCONNECTION_STA_LIST = 0x003B,
  830. DOT11_RX_MSDU_LIFE_TIME = 0x003C,
  831. DOT11_CUR_TX_PWR = 0x003D,
  832. DOT11_RTS_THRESHOLD = 0x003E,
  833. DOT11_GROUP_ADDRESS_TBL = 0x003F,
  834. ACX_PM_CONFIG = 0x0040,
  835. ACX_CONFIG_PS = 0x0041,
  836. ACX_CONFIG_HANGOVER = 0x0042,
  837. ACX_FEATURE_CFG = 0x0043,
  838. ACX_PROTECTION_CFG = 0x0044,
  839. ACX_CHECKSUM_CONFIG = 0x0045,
  840. };
  841. int wl1271_acx_wake_up_conditions(struct wl1271 *wl,
  842. struct wl12xx_vif *wlvif,
  843. u8 wake_up_event, u8 listen_interval);
  844. int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth);
  845. int wl1271_acx_tx_power(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  846. int power);
  847. int wl1271_acx_feature_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  848. int wl1271_acx_mem_map(struct wl1271 *wl,
  849. struct acx_header *mem_map, size_t len);
  850. int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl);
  851. int wl1271_acx_slot(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  852. enum acx_slot_type slot_time);
  853. int wl1271_acx_group_address_tbl(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  854. bool enable, void *mc_list, u32 mc_list_len);
  855. int wl1271_acx_service_period_timeout(struct wl1271 *wl,
  856. struct wl12xx_vif *wlvif);
  857. int wl1271_acx_rts_threshold(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  858. u32 rts_threshold);
  859. int wl1271_acx_dco_itrim_params(struct wl1271 *wl);
  860. int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  861. bool enable_filter);
  862. int wl1271_acx_beacon_filter_table(struct wl1271 *wl,
  863. struct wl12xx_vif *wlvif);
  864. int wl1271_acx_conn_monit_params(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  865. bool enable);
  866. int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable);
  867. int wl12xx_acx_sg_cfg(struct wl1271 *wl);
  868. int wl1271_acx_cca_threshold(struct wl1271 *wl);
  869. int wl1271_acx_bcn_dtim_options(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  870. int wl1271_acx_aid(struct wl1271 *wl, struct wl12xx_vif *wlvif, u16 aid);
  871. int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask);
  872. int wl1271_acx_set_preamble(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  873. enum acx_preamble_type preamble);
  874. int wl1271_acx_cts_protect(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  875. enum acx_ctsprotect_type ctsprotect);
  876. int wl1271_acx_statistics(struct wl1271 *wl, void *stats);
  877. int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  878. int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c,
  879. u8 idx);
  880. int wl1271_acx_ac_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  881. u8 ac, u8 cw_min, u16 cw_max, u8 aifsn, u16 txop);
  882. int wl1271_acx_tid_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  883. u8 queue_id, u8 channel_type,
  884. u8 tsid, u8 ps_scheme, u8 ack_policy,
  885. u32 apsd_conf0, u32 apsd_conf1);
  886. int wl1271_acx_frag_threshold(struct wl1271 *wl, u32 frag_threshold);
  887. int wl1271_acx_tx_config_options(struct wl1271 *wl);
  888. int wl12xx_acx_mem_cfg(struct wl1271 *wl);
  889. int wl1271_acx_init_mem_config(struct wl1271 *wl);
  890. int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
  891. int wl1271_acx_smart_reflex(struct wl1271 *wl);
  892. int wl1271_acx_bet_enable(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  893. bool enable);
  894. int wl1271_acx_arp_ip_filter(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  895. u8 enable, __be32 address);
  896. int wl1271_acx_pm_config(struct wl1271 *wl);
  897. int wl1271_acx_keep_alive_mode(struct wl1271 *wl, struct wl12xx_vif *vif,
  898. bool enable);
  899. int wl1271_acx_keep_alive_config(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  900. u8 index, u8 tpl_valid);
  901. int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  902. bool enable, s16 thold, u8 hyst);
  903. int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl,
  904. struct wl12xx_vif *wlvif);
  905. int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
  906. struct ieee80211_sta_ht_cap *ht_cap,
  907. bool allow_ht_operation, u8 hlid);
  908. int wl1271_acx_set_ht_information(struct wl1271 *wl,
  909. struct wl12xx_vif *wlvif,
  910. u16 ht_operation_mode);
  911. int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl,
  912. struct wl12xx_vif *wlvif);
  913. int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index,
  914. u16 ssn, bool enable, u8 peer_hlid);
  915. int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  916. u64 *mactime);
  917. int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif,
  918. bool enable);
  919. int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  920. int wl12xx_acx_config_ps(struct wl1271 *wl, struct wl12xx_vif *wlvif);
  921. int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr);
  922. int wl1271_acx_fm_coex(struct wl1271 *wl);
  923. int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl);
  924. int wl12xx_acx_config_hangover(struct wl1271 *wl);
  925. #ifdef CONFIG_PM
  926. int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable,
  927. enum rx_filter_action action);
  928. int wl1271_acx_set_rx_filter(struct wl1271 *wl, u8 index, bool enable,
  929. struct wl12xx_rx_filter *filter);
  930. #endif /* CONFIG_PM */
  931. #endif /* __WL1271_ACX_H__ */