acx.h 28 KB

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