wl1271_acx.h 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  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 __WL1271_ACX_H__
  25. #define __WL1271_ACX_H__
  26. #include "wl1271.h"
  27. #include "wl1271_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 meassge on MBOX #A */
  46. #define WL1271_ACX_INTR_TRACE_A BIT(7)
  47. /* Trace meassge on MBOX #B */
  48. #define WL1271_ACX_INTR_TRACE_B BIT(8)
  49. #define WL1271_ACX_INTR_ALL 0xFFFFFFFF
  50. #define WL1271_ACX_ALL_EVENTS_VECTOR (WL1271_ACX_INTR_WATCHDOG | \
  51. WL1271_ACX_INTR_INIT_COMPLETE | \
  52. WL1271_ACX_INTR_EVENT_A | \
  53. WL1271_ACX_INTR_EVENT_B | \
  54. WL1271_ACX_INTR_CMD_COMPLETE | \
  55. WL1271_ACX_INTR_HW_AVAILABLE | \
  56. WL1271_ACX_INTR_DATA)
  57. #define WL1271_INTR_MASK (WL1271_ACX_INTR_EVENT_A | \
  58. WL1271_ACX_INTR_EVENT_B | \
  59. WL1271_ACX_INTR_HW_AVAILABLE | \
  60. WL1271_ACX_INTR_DATA)
  61. /* Target's information element */
  62. struct acx_header {
  63. struct wl1271_cmd_header cmd;
  64. /* acx (or information element) header */
  65. __le16 id;
  66. /* payload length (not including headers */
  67. __le16 len;
  68. } __packed;
  69. struct acx_error_counter {
  70. struct acx_header header;
  71. /* The number of PLCP errors since the last time this */
  72. /* information element was interrogated. This field is */
  73. /* automatically cleared when it is interrogated.*/
  74. __le32 PLCP_error;
  75. /* The number of FCS errors since the last time this */
  76. /* information element was interrogated. This field is */
  77. /* automatically cleared when it is interrogated.*/
  78. __le32 FCS_error;
  79. /* The number of MPDUs without PLCP header errors received*/
  80. /* since the last time this information element was interrogated. */
  81. /* This field is automatically cleared when it is interrogated.*/
  82. __le32 valid_frame;
  83. /* the number of missed sequence numbers in the squentially */
  84. /* values of frames seq numbers */
  85. __le32 seq_num_miss;
  86. } __packed;
  87. struct acx_revision {
  88. struct acx_header header;
  89. /*
  90. * The WiLink firmware version, an ASCII string x.x.x.x,
  91. * that uniquely identifies the current firmware.
  92. * The left most digit is incremented each time a
  93. * significant change is made to the firmware, such as
  94. * code redesign or new platform support.
  95. * The second digit is incremented when major enhancements
  96. * are added or major fixes are made.
  97. * The third digit is incremented for each GA release.
  98. * The fourth digit is incremented for each build.
  99. * The first two digits identify a firmware release version,
  100. * in other words, a unique set of features.
  101. * The first three digits identify a GA release.
  102. */
  103. char fw_version[20];
  104. /*
  105. * This 4 byte field specifies the WiLink hardware version.
  106. * bits 0 - 15: Reserved.
  107. * bits 16 - 23: Version ID - The WiLink version ID
  108. * (1 = first spin, 2 = second spin, and so on).
  109. * bits 24 - 31: Chip ID - The WiLink chip ID.
  110. */
  111. __le32 hw_version;
  112. } __packed;
  113. enum wl1271_psm_mode {
  114. /* Active mode */
  115. WL1271_PSM_CAM = 0,
  116. /* Power save mode */
  117. WL1271_PSM_PS = 1,
  118. /* Extreme low power */
  119. WL1271_PSM_ELP = 2,
  120. };
  121. struct acx_sleep_auth {
  122. struct acx_header header;
  123. /* The sleep level authorization of the device. */
  124. /* 0 - Always active*/
  125. /* 1 - Power down mode: light / fast sleep*/
  126. /* 2 - ELP mode: Deep / Max sleep*/
  127. u8 sleep_auth;
  128. u8 padding[3];
  129. } __packed;
  130. enum {
  131. HOSTIF_PCI_MASTER_HOST_INDIRECT,
  132. HOSTIF_PCI_MASTER_HOST_DIRECT,
  133. HOSTIF_SLAVE,
  134. HOSTIF_PKT_RING,
  135. HOSTIF_DONTCARE = 0xFF
  136. };
  137. #define DEFAULT_UCAST_PRIORITY 0
  138. #define DEFAULT_RX_Q_PRIORITY 0
  139. #define DEFAULT_NUM_STATIONS 1
  140. #define DEFAULT_RXQ_PRIORITY 0 /* low 0 .. 15 high */
  141. #define DEFAULT_RXQ_TYPE 0x07 /* All frames, Data/Ctrl/Mgmt */
  142. #define TRACE_BUFFER_MAX_SIZE 256
  143. #define DP_RX_PACKET_RING_CHUNK_SIZE 1600
  144. #define DP_TX_PACKET_RING_CHUNK_SIZE 1600
  145. #define DP_RX_PACKET_RING_CHUNK_NUM 2
  146. #define DP_TX_PACKET_RING_CHUNK_NUM 2
  147. #define DP_TX_COMPLETE_TIME_OUT 20
  148. #define TX_MSDU_LIFETIME_MIN 0
  149. #define TX_MSDU_LIFETIME_MAX 3000
  150. #define TX_MSDU_LIFETIME_DEF 512
  151. #define RX_MSDU_LIFETIME_MIN 0
  152. #define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF
  153. #define RX_MSDU_LIFETIME_DEF 512000
  154. struct acx_rx_msdu_lifetime {
  155. struct acx_header header;
  156. /*
  157. * The maximum amount of time, in TU, before the
  158. * firmware discards the MSDU.
  159. */
  160. __le32 lifetime;
  161. } __packed;
  162. /*
  163. * RX Config Options Table
  164. * Bit Definition
  165. * === ==========
  166. * 31:14 Reserved
  167. * 13 Copy RX Status - when set, write three receive status words
  168. * to top of rx'd MPDUs.
  169. * When cleared, do not write three status words (added rev 1.5)
  170. * 12 Reserved
  171. * 11 RX Complete upon FCS error - when set, give rx complete
  172. * interrupt for FCS errors, after the rx filtering, e.g. unicast
  173. * frames not to us with FCS error will not generate an interrupt.
  174. * 10 SSID Filter Enable - When set, the WiLink discards all beacon,
  175. * probe request, and probe response frames with an SSID that does
  176. * not match the SSID specified by the host in the START/JOIN
  177. * command.
  178. * When clear, the WiLink receives frames with any SSID.
  179. * 9 Broadcast Filter Enable - When set, the WiLink discards all
  180. * broadcast frames. When clear, the WiLink receives all received
  181. * broadcast frames.
  182. * 8:6 Reserved
  183. * 5 BSSID Filter Enable - When set, the WiLink discards any frames
  184. * with a BSSID that does not match the BSSID specified by the
  185. * host.
  186. * When clear, the WiLink receives frames from any BSSID.
  187. * 4 MAC Addr Filter - When set, the WiLink discards any frames
  188. * with a destination address that does not match the MAC address
  189. * of the adaptor.
  190. * When clear, the WiLink receives frames destined to any MAC
  191. * address.
  192. * 3 Promiscuous - When set, the WiLink receives all valid frames
  193. * (i.e., all frames that pass the FCS check).
  194. * When clear, only frames that pass the other filters specified
  195. * are received.
  196. * 2 FCS - When set, the WiLink includes the FCS with the received
  197. * frame.
  198. * When cleared, the FCS is discarded.
  199. * 1 PLCP header - When set, write all data from baseband to frame
  200. * buffer including PHY header.
  201. * 0 Reserved - Always equal to 0.
  202. *
  203. * RX Filter Options Table
  204. * Bit Definition
  205. * === ==========
  206. * 31:12 Reserved - Always equal to 0.
  207. * 11 Association - When set, the WiLink receives all association
  208. * related frames (association request/response, reassocation
  209. * request/response, and disassociation). When clear, these frames
  210. * are discarded.
  211. * 10 Auth/De auth - When set, the WiLink receives all authentication
  212. * and de-authentication frames. When clear, these frames are
  213. * discarded.
  214. * 9 Beacon - When set, the WiLink receives all beacon frames.
  215. * When clear, these frames are discarded.
  216. * 8 Contention Free - When set, the WiLink receives all contention
  217. * free frames.
  218. * When clear, these frames are discarded.
  219. * 7 Control - When set, the WiLink receives all control frames.
  220. * When clear, these frames are discarded.
  221. * 6 Data - When set, the WiLink receives all data frames.
  222. * When clear, these frames are discarded.
  223. * 5 FCS Error - When set, the WiLink receives frames that have FCS
  224. * errors.
  225. * When clear, these frames are discarded.
  226. * 4 Management - When set, the WiLink receives all management
  227. * frames.
  228. * When clear, these frames are discarded.
  229. * 3 Probe Request - When set, the WiLink receives all probe request
  230. * frames.
  231. * When clear, these frames are discarded.
  232. * 2 Probe Response - When set, the WiLink receives all probe
  233. * response frames.
  234. * When clear, these frames are discarded.
  235. * 1 RTS/CTS/ACK - When set, the WiLink receives all RTS, CTS and ACK
  236. * frames.
  237. * When clear, these frames are discarded.
  238. * 0 Rsvd Type/Sub Type - When set, the WiLink receives all frames
  239. * that have reserved frame types and sub types as defined by the
  240. * 802.11 specification.
  241. * When clear, these frames are discarded.
  242. */
  243. struct acx_rx_config {
  244. struct acx_header header;
  245. __le32 config_options;
  246. __le32 filter_options;
  247. } __packed;
  248. struct acx_packet_detection {
  249. struct acx_header header;
  250. __le32 threshold;
  251. } __packed;
  252. enum acx_slot_type {
  253. SLOT_TIME_LONG = 0,
  254. SLOT_TIME_SHORT = 1,
  255. DEFAULT_SLOT_TIME = SLOT_TIME_SHORT,
  256. MAX_SLOT_TIMES = 0xFF
  257. };
  258. #define STATION_WONE_INDEX 0
  259. struct acx_slot {
  260. struct acx_header header;
  261. u8 wone_index; /* Reserved */
  262. u8 slot_time;
  263. u8 reserved[6];
  264. } __packed;
  265. #define ACX_MC_ADDRESS_GROUP_MAX (8)
  266. #define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ACX_MC_ADDRESS_GROUP_MAX)
  267. struct acx_dot11_grp_addr_tbl {
  268. struct acx_header header;
  269. u8 enabled;
  270. u8 num_groups;
  271. u8 pad[2];
  272. u8 mac_table[ADDRESS_GROUP_MAX_LEN];
  273. } __packed;
  274. struct acx_rx_timeout {
  275. struct acx_header header;
  276. __le16 ps_poll_timeout;
  277. __le16 upsd_timeout;
  278. } __packed;
  279. struct acx_rts_threshold {
  280. struct acx_header header;
  281. __le16 threshold;
  282. u8 pad[2];
  283. } __packed;
  284. struct acx_beacon_filter_option {
  285. struct acx_header header;
  286. u8 enable;
  287. /*
  288. * The number of beacons without the unicast TIM
  289. * bit set that the firmware buffers before
  290. * signaling the host about ready frames.
  291. * When set to 0 and the filter is enabled, beacons
  292. * without the unicast TIM bit set are dropped.
  293. */
  294. u8 max_num_beacons;
  295. u8 pad[2];
  296. } __packed;
  297. /*
  298. * ACXBeaconFilterEntry (not 221)
  299. * Byte Offset Size (Bytes) Definition
  300. * =========== ============ ==========
  301. * 0 1 IE identifier
  302. * 1 1 Treatment bit mask
  303. *
  304. * ACXBeaconFilterEntry (221)
  305. * Byte Offset Size (Bytes) Definition
  306. * =========== ============ ==========
  307. * 0 1 IE identifier
  308. * 1 1 Treatment bit mask
  309. * 2 3 OUI
  310. * 5 1 Type
  311. * 6 2 Version
  312. *
  313. *
  314. * Treatment bit mask - The information element handling:
  315. * bit 0 - The information element is compared and transferred
  316. * in case of change.
  317. * bit 1 - The information element is transferred to the host
  318. * with each appearance or disappearance.
  319. * Note that both bits can be set at the same time.
  320. */
  321. #define BEACON_FILTER_TABLE_MAX_IE_NUM (32)
  322. #define BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM (6)
  323. #define BEACON_FILTER_TABLE_IE_ENTRY_SIZE (2)
  324. #define BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE (6)
  325. #define BEACON_FILTER_TABLE_MAX_SIZE ((BEACON_FILTER_TABLE_MAX_IE_NUM * \
  326. BEACON_FILTER_TABLE_IE_ENTRY_SIZE) + \
  327. (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
  328. BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))
  329. struct acx_beacon_filter_ie_table {
  330. struct acx_header header;
  331. u8 num_ie;
  332. u8 pad[3];
  333. u8 table[BEACON_FILTER_TABLE_MAX_SIZE];
  334. } __packed;
  335. struct acx_conn_monit_params {
  336. struct acx_header header;
  337. __le32 synch_fail_thold; /* number of beacons missed */
  338. __le32 bss_lose_timeout; /* number of TU's from synch fail */
  339. } __packed;
  340. struct acx_bt_wlan_coex {
  341. struct acx_header header;
  342. u8 enable;
  343. u8 pad[3];
  344. } __packed;
  345. struct acx_bt_wlan_coex_param {
  346. struct acx_header header;
  347. __le32 params[CONF_SG_PARAMS_MAX];
  348. u8 param_idx;
  349. u8 padding[3];
  350. } __packed;
  351. struct acx_dco_itrim_params {
  352. struct acx_header header;
  353. u8 enable;
  354. u8 padding[3];
  355. __le32 timeout;
  356. } __packed;
  357. struct acx_energy_detection {
  358. struct acx_header header;
  359. /* The RX Clear Channel Assessment threshold in the PHY */
  360. __le16 rx_cca_threshold;
  361. u8 tx_energy_detection;
  362. u8 pad;
  363. } __packed;
  364. struct acx_beacon_broadcast {
  365. struct acx_header header;
  366. __le16 beacon_rx_timeout;
  367. __le16 broadcast_timeout;
  368. /* Enables receiving of broadcast packets in PS mode */
  369. u8 rx_broadcast_in_ps;
  370. /* Consecutive PS Poll failures before updating the host */
  371. u8 ps_poll_threshold;
  372. u8 pad[2];
  373. } __packed;
  374. struct acx_event_mask {
  375. struct acx_header header;
  376. __le32 event_mask;
  377. __le32 high_event_mask; /* Unused */
  378. } __packed;
  379. #define CFG_RX_FCS BIT(2)
  380. #define CFG_RX_ALL_GOOD BIT(3)
  381. #define CFG_UNI_FILTER_EN BIT(4)
  382. #define CFG_BSSID_FILTER_EN BIT(5)
  383. #define CFG_MC_FILTER_EN BIT(6)
  384. #define CFG_MC_ADDR0_EN BIT(7)
  385. #define CFG_MC_ADDR1_EN BIT(8)
  386. #define CFG_BC_REJECT_EN BIT(9)
  387. #define CFG_SSID_FILTER_EN BIT(10)
  388. #define CFG_RX_INT_FCS_ERROR BIT(11)
  389. #define CFG_RX_INT_ENCRYPTED BIT(12)
  390. #define CFG_RX_WR_RX_STATUS BIT(13)
  391. #define CFG_RX_FILTER_NULTI BIT(14)
  392. #define CFG_RX_RESERVE BIT(15)
  393. #define CFG_RX_TIMESTAMP_TSF BIT(16)
  394. #define CFG_RX_RSV_EN BIT(0)
  395. #define CFG_RX_RCTS_ACK BIT(1)
  396. #define CFG_RX_PRSP_EN BIT(2)
  397. #define CFG_RX_PREQ_EN BIT(3)
  398. #define CFG_RX_MGMT_EN BIT(4)
  399. #define CFG_RX_FCS_ERROR BIT(5)
  400. #define CFG_RX_DATA_EN BIT(6)
  401. #define CFG_RX_CTL_EN BIT(7)
  402. #define CFG_RX_CF_EN BIT(8)
  403. #define CFG_RX_BCN_EN BIT(9)
  404. #define CFG_RX_AUTH_EN BIT(10)
  405. #define CFG_RX_ASSOC_EN BIT(11)
  406. #define SCAN_PASSIVE BIT(0)
  407. #define SCAN_5GHZ_BAND BIT(1)
  408. #define SCAN_TRIGGERED BIT(2)
  409. #define SCAN_PRIORITY_HIGH BIT(3)
  410. /* When set, disable HW encryption */
  411. #define DF_ENCRYPTION_DISABLE 0x01
  412. #define DF_SNIFF_MODE_ENABLE 0x80
  413. struct acx_feature_config {
  414. struct acx_header header;
  415. __le32 options;
  416. __le32 data_flow_options;
  417. } __packed;
  418. struct acx_current_tx_power {
  419. struct acx_header header;
  420. u8 current_tx_power;
  421. u8 padding[3];
  422. } __packed;
  423. struct acx_wake_up_condition {
  424. struct acx_header header;
  425. u8 wake_up_event; /* Only one bit can be set */
  426. u8 listen_interval;
  427. u8 pad[2];
  428. } __packed;
  429. struct acx_aid {
  430. struct acx_header header;
  431. /*
  432. * To be set when associated with an AP.
  433. */
  434. __le16 aid;
  435. u8 pad[2];
  436. } __packed;
  437. enum acx_preamble_type {
  438. ACX_PREAMBLE_LONG = 0,
  439. ACX_PREAMBLE_SHORT = 1
  440. };
  441. struct acx_preamble {
  442. struct acx_header header;
  443. /*
  444. * When set, the WiLink transmits the frames with a short preamble and
  445. * when cleared, the WiLink transmits the frames with a long preamble.
  446. */
  447. u8 preamble;
  448. u8 padding[3];
  449. } __packed;
  450. enum acx_ctsprotect_type {
  451. CTSPROTECT_DISABLE = 0,
  452. CTSPROTECT_ENABLE = 1
  453. };
  454. struct acx_ctsprotect {
  455. struct acx_header header;
  456. u8 ctsprotect;
  457. u8 padding[3];
  458. } __packed;
  459. struct acx_tx_statistics {
  460. __le32 internal_desc_overflow;
  461. } __packed;
  462. struct acx_rx_statistics {
  463. __le32 out_of_mem;
  464. __le32 hdr_overflow;
  465. __le32 hw_stuck;
  466. __le32 dropped;
  467. __le32 fcs_err;
  468. __le32 xfr_hint_trig;
  469. __le32 path_reset;
  470. __le32 reset_counter;
  471. } __packed;
  472. struct acx_dma_statistics {
  473. __le32 rx_requested;
  474. __le32 rx_errors;
  475. __le32 tx_requested;
  476. __le32 tx_errors;
  477. } __packed;
  478. struct acx_isr_statistics {
  479. /* host command complete */
  480. __le32 cmd_cmplt;
  481. /* fiqisr() */
  482. __le32 fiqs;
  483. /* (INT_STS_ND & INT_TRIG_RX_HEADER) */
  484. __le32 rx_headers;
  485. /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
  486. __le32 rx_completes;
  487. /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
  488. __le32 rx_mem_overflow;
  489. /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
  490. __le32 rx_rdys;
  491. /* irqisr() */
  492. __le32 irqs;
  493. /* (INT_STS_ND & INT_TRIG_TX_PROC) */
  494. __le32 tx_procs;
  495. /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
  496. __le32 decrypt_done;
  497. /* (INT_STS_ND & INT_TRIG_DMA0) */
  498. __le32 dma0_done;
  499. /* (INT_STS_ND & INT_TRIG_DMA1) */
  500. __le32 dma1_done;
  501. /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
  502. __le32 tx_exch_complete;
  503. /* (INT_STS_ND & INT_TRIG_COMMAND) */
  504. __le32 commands;
  505. /* (INT_STS_ND & INT_TRIG_RX_PROC) */
  506. __le32 rx_procs;
  507. /* (INT_STS_ND & INT_TRIG_PM_802) */
  508. __le32 hw_pm_mode_changes;
  509. /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
  510. __le32 host_acknowledges;
  511. /* (INT_STS_ND & INT_TRIG_PM_PCI) */
  512. __le32 pci_pm;
  513. /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
  514. __le32 wakeups;
  515. /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
  516. __le32 low_rssi;
  517. } __packed;
  518. struct acx_wep_statistics {
  519. /* WEP address keys configured */
  520. __le32 addr_key_count;
  521. /* default keys configured */
  522. __le32 default_key_count;
  523. __le32 reserved;
  524. /* number of times that WEP key not found on lookup */
  525. __le32 key_not_found;
  526. /* number of times that WEP key decryption failed */
  527. __le32 decrypt_fail;
  528. /* WEP packets decrypted */
  529. __le32 packets;
  530. /* WEP decrypt interrupts */
  531. __le32 interrupt;
  532. } __packed;
  533. #define ACX_MISSED_BEACONS_SPREAD 10
  534. struct acx_pwr_statistics {
  535. /* the amount of enters into power save mode (both PD & ELP) */
  536. __le32 ps_enter;
  537. /* the amount of enters into ELP mode */
  538. __le32 elp_enter;
  539. /* the amount of missing beacon interrupts to the host */
  540. __le32 missing_bcns;
  541. /* the amount of wake on host-access times */
  542. __le32 wake_on_host;
  543. /* the amount of wake on timer-expire */
  544. __le32 wake_on_timer_exp;
  545. /* the number of packets that were transmitted with PS bit set */
  546. __le32 tx_with_ps;
  547. /* the number of packets that were transmitted with PS bit clear */
  548. __le32 tx_without_ps;
  549. /* the number of received beacons */
  550. __le32 rcvd_beacons;
  551. /* the number of entering into PowerOn (power save off) */
  552. __le32 power_save_off;
  553. /* the number of entries into power save mode */
  554. __le16 enable_ps;
  555. /*
  556. * the number of exits from power save, not including failed PS
  557. * transitions
  558. */
  559. __le16 disable_ps;
  560. /*
  561. * the number of times the TSF counter was adjusted because
  562. * of drift
  563. */
  564. __le32 fix_tsf_ps;
  565. /* Gives statistics about the spread continuous missed beacons.
  566. * The 16 LSB are dedicated for the PS mode.
  567. * The 16 MSB are dedicated for the PS mode.
  568. * cont_miss_bcns_spread[0] - single missed beacon.
  569. * cont_miss_bcns_spread[1] - two continuous missed beacons.
  570. * cont_miss_bcns_spread[2] - three continuous missed beacons.
  571. * ...
  572. * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
  573. */
  574. __le32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
  575. /* the number of beacons in awake mode */
  576. __le32 rcvd_awake_beacons;
  577. } __packed;
  578. struct acx_mic_statistics {
  579. __le32 rx_pkts;
  580. __le32 calc_failure;
  581. } __packed;
  582. struct acx_aes_statistics {
  583. __le32 encrypt_fail;
  584. __le32 decrypt_fail;
  585. __le32 encrypt_packets;
  586. __le32 decrypt_packets;
  587. __le32 encrypt_interrupt;
  588. __le32 decrypt_interrupt;
  589. } __packed;
  590. struct acx_event_statistics {
  591. __le32 heart_beat;
  592. __le32 calibration;
  593. __le32 rx_mismatch;
  594. __le32 rx_mem_empty;
  595. __le32 rx_pool;
  596. __le32 oom_late;
  597. __le32 phy_transmit_error;
  598. __le32 tx_stuck;
  599. } __packed;
  600. struct acx_ps_statistics {
  601. __le32 pspoll_timeouts;
  602. __le32 upsd_timeouts;
  603. __le32 upsd_max_sptime;
  604. __le32 upsd_max_apturn;
  605. __le32 pspoll_max_apturn;
  606. __le32 pspoll_utilization;
  607. __le32 upsd_utilization;
  608. } __packed;
  609. struct acx_rxpipe_statistics {
  610. __le32 rx_prep_beacon_drop;
  611. __le32 descr_host_int_trig_rx_data;
  612. __le32 beacon_buffer_thres_host_int_trig_rx_data;
  613. __le32 missed_beacon_host_int_trig_rx_data;
  614. __le32 tx_xfr_host_int_trig_rx_data;
  615. } __packed;
  616. struct acx_statistics {
  617. struct acx_header header;
  618. struct acx_tx_statistics tx;
  619. struct acx_rx_statistics rx;
  620. struct acx_dma_statistics dma;
  621. struct acx_isr_statistics isr;
  622. struct acx_wep_statistics wep;
  623. struct acx_pwr_statistics pwr;
  624. struct acx_aes_statistics aes;
  625. struct acx_mic_statistics mic;
  626. struct acx_event_statistics event;
  627. struct acx_ps_statistics ps;
  628. struct acx_rxpipe_statistics rxpipe;
  629. } __packed;
  630. struct acx_rate_class {
  631. __le32 enabled_rates;
  632. u8 short_retry_limit;
  633. u8 long_retry_limit;
  634. u8 aflags;
  635. u8 reserved;
  636. };
  637. #define ACX_TX_BASIC_RATE 0
  638. #define ACX_TX_AP_FULL_RATE 1
  639. #define ACX_TX_RATE_POLICY_CNT 2
  640. struct acx_rate_policy {
  641. struct acx_header header;
  642. __le32 rate_class_cnt;
  643. struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
  644. } __packed;
  645. struct acx_ac_cfg {
  646. struct acx_header header;
  647. u8 ac;
  648. u8 cw_min;
  649. __le16 cw_max;
  650. u8 aifsn;
  651. u8 reserved;
  652. __le16 tx_op_limit;
  653. } __packed;
  654. struct acx_tid_config {
  655. struct acx_header header;
  656. u8 queue_id;
  657. u8 channel_type;
  658. u8 tsid;
  659. u8 ps_scheme;
  660. u8 ack_policy;
  661. u8 padding[3];
  662. __le32 apsd_conf[2];
  663. } __packed;
  664. struct acx_frag_threshold {
  665. struct acx_header header;
  666. __le16 frag_threshold;
  667. u8 padding[2];
  668. } __packed;
  669. struct acx_tx_config_options {
  670. struct acx_header header;
  671. __le16 tx_compl_timeout; /* msec */
  672. __le16 tx_compl_threshold; /* number of packets */
  673. } __packed;
  674. #define ACX_RX_MEM_BLOCKS 70
  675. #define ACX_TX_MIN_MEM_BLOCKS 40
  676. #define ACX_TX_DESCRIPTORS 32
  677. #define ACX_NUM_SSID_PROFILES 1
  678. struct wl1271_acx_config_memory {
  679. struct acx_header header;
  680. u8 rx_mem_block_num;
  681. u8 tx_min_mem_block_num;
  682. u8 num_stations;
  683. u8 num_ssid_profiles;
  684. __le32 total_tx_descriptors;
  685. } __packed;
  686. struct wl1271_acx_mem_map {
  687. struct acx_header header;
  688. __le32 code_start;
  689. __le32 code_end;
  690. __le32 wep_defkey_start;
  691. __le32 wep_defkey_end;
  692. __le32 sta_table_start;
  693. __le32 sta_table_end;
  694. __le32 packet_template_start;
  695. __le32 packet_template_end;
  696. /* Address of the TX result interface (control block) */
  697. __le32 tx_result;
  698. __le32 tx_result_queue_start;
  699. __le32 queue_memory_start;
  700. __le32 queue_memory_end;
  701. __le32 packet_memory_pool_start;
  702. __le32 packet_memory_pool_end;
  703. __le32 debug_buffer1_start;
  704. __le32 debug_buffer1_end;
  705. __le32 debug_buffer2_start;
  706. __le32 debug_buffer2_end;
  707. /* Number of blocks FW allocated for TX packets */
  708. __le32 num_tx_mem_blocks;
  709. /* Number of blocks FW allocated for RX packets */
  710. __le32 num_rx_mem_blocks;
  711. /* the following 4 fields are valid in SLAVE mode only */
  712. u8 *tx_cbuf;
  713. u8 *rx_cbuf;
  714. __le32 rx_ctrl;
  715. __le32 tx_ctrl;
  716. } __packed;
  717. struct wl1271_acx_rx_config_opt {
  718. struct acx_header header;
  719. __le16 mblk_threshold;
  720. __le16 threshold;
  721. __le16 timeout;
  722. u8 queue_type;
  723. u8 reserved;
  724. } __packed;
  725. struct wl1271_acx_bet_enable {
  726. struct acx_header header;
  727. u8 enable;
  728. u8 max_consecutive;
  729. u8 padding[2];
  730. } __packed;
  731. #define ACX_IPV4_VERSION 4
  732. #define ACX_IPV6_VERSION 6
  733. #define ACX_IPV4_ADDR_SIZE 4
  734. struct wl1271_acx_arp_filter {
  735. struct acx_header header;
  736. u8 version; /* ACX_IPV4_VERSION, ACX_IPV6_VERSION */
  737. u8 enable; /* 1 to enable ARP filtering, 0 to disable */
  738. u8 padding[2];
  739. u8 address[16]; /* The configured device IP address - all ARP
  740. requests directed to this IP address will pass
  741. through. For IPv4, the first four bytes are
  742. used. */
  743. } __packed;
  744. struct wl1271_acx_pm_config {
  745. struct acx_header header;
  746. __le32 host_clk_settling_time;
  747. u8 host_fast_wakeup_support;
  748. u8 padding[3];
  749. } __packed;
  750. struct wl1271_acx_keep_alive_mode {
  751. struct acx_header header;
  752. u8 enabled;
  753. u8 padding[3];
  754. } __packed;
  755. enum {
  756. ACX_KEEP_ALIVE_NO_TX = 0,
  757. ACX_KEEP_ALIVE_PERIOD_ONLY
  758. };
  759. enum {
  760. ACX_KEEP_ALIVE_TPL_INVALID = 0,
  761. ACX_KEEP_ALIVE_TPL_VALID
  762. };
  763. struct wl1271_acx_keep_alive_config {
  764. struct acx_header header;
  765. __le32 period;
  766. u8 index;
  767. u8 tpl_validation;
  768. u8 trigger;
  769. u8 padding;
  770. } __packed;
  771. enum {
  772. WL1271_ACX_TRIG_TYPE_LEVEL = 0,
  773. WL1271_ACX_TRIG_TYPE_EDGE,
  774. };
  775. enum {
  776. WL1271_ACX_TRIG_DIR_LOW = 0,
  777. WL1271_ACX_TRIG_DIR_HIGH,
  778. WL1271_ACX_TRIG_DIR_BIDIR,
  779. };
  780. enum {
  781. WL1271_ACX_TRIG_ENABLE = 1,
  782. WL1271_ACX_TRIG_DISABLE,
  783. };
  784. enum {
  785. WL1271_ACX_TRIG_METRIC_RSSI_BEACON = 0,
  786. WL1271_ACX_TRIG_METRIC_RSSI_DATA,
  787. WL1271_ACX_TRIG_METRIC_SNR_BEACON,
  788. WL1271_ACX_TRIG_METRIC_SNR_DATA,
  789. };
  790. enum {
  791. WL1271_ACX_TRIG_IDX_RSSI = 0,
  792. WL1271_ACX_TRIG_COUNT = 8,
  793. };
  794. struct wl1271_acx_rssi_snr_trigger {
  795. struct acx_header header;
  796. __le16 threshold;
  797. __le16 pacing; /* 0 - 60000 ms */
  798. u8 metric;
  799. u8 type;
  800. u8 dir;
  801. u8 hysteresis;
  802. u8 index;
  803. u8 enable;
  804. u8 padding[2];
  805. };
  806. struct wl1271_acx_rssi_snr_avg_weights {
  807. struct acx_header header;
  808. u8 rssi_beacon;
  809. u8 rssi_data;
  810. u8 snr_beacon;
  811. u8 snr_data;
  812. };
  813. struct wl1271_acx_fw_tsf_information {
  814. struct acx_header header;
  815. __le32 current_tsf_high;
  816. __le32 current_tsf_low;
  817. __le32 last_bttt_high;
  818. __le32 last_tbtt_low;
  819. u8 last_dtim_count;
  820. u8 padding[3];
  821. } __packed;
  822. enum {
  823. ACX_WAKE_UP_CONDITIONS = 0x0002,
  824. ACX_MEM_CFG = 0x0003,
  825. ACX_SLOT = 0x0004,
  826. ACX_AC_CFG = 0x0007,
  827. ACX_MEM_MAP = 0x0008,
  828. ACX_AID = 0x000A,
  829. /* ACX_FW_REV is missing in the ref driver, but seems to work */
  830. ACX_FW_REV = 0x000D,
  831. ACX_MEDIUM_USAGE = 0x000F,
  832. ACX_RX_CFG = 0x0010,
  833. ACX_TX_QUEUE_CFG = 0x0011, /* FIXME: only used by wl1251 */
  834. ACX_STATISTICS = 0x0013, /* Debug API */
  835. ACX_PWR_CONSUMPTION_STATISTICS = 0x0014,
  836. ACX_FEATURE_CFG = 0x0015,
  837. ACX_TID_CFG = 0x001A,
  838. ACX_PS_RX_STREAMING = 0x001B,
  839. ACX_BEACON_FILTER_OPT = 0x001F,
  840. ACX_NOISE_HIST = 0x0021,
  841. ACX_HDK_VERSION = 0x0022, /* ??? */
  842. ACX_PD_THRESHOLD = 0x0023,
  843. ACX_TX_CONFIG_OPT = 0x0024,
  844. ACX_CCA_THRESHOLD = 0x0025,
  845. ACX_EVENT_MBOX_MASK = 0x0026,
  846. ACX_CONN_MONIT_PARAMS = 0x002D,
  847. ACX_CONS_TX_FAILURE = 0x002F,
  848. ACX_BCN_DTIM_OPTIONS = 0x0031,
  849. ACX_SG_ENABLE = 0x0032,
  850. ACX_SG_CFG = 0x0033,
  851. ACX_BEACON_FILTER_TABLE = 0x0038,
  852. ACX_ARP_IP_FILTER = 0x0039,
  853. ACX_ROAMING_STATISTICS_TBL = 0x003B,
  854. ACX_RATE_POLICY = 0x003D,
  855. ACX_CTS_PROTECTION = 0x003E,
  856. ACX_SLEEP_AUTH = 0x003F,
  857. ACX_PREAMBLE_TYPE = 0x0040,
  858. ACX_ERROR_CNT = 0x0041,
  859. ACX_IBSS_FILTER = 0x0044,
  860. ACX_SERVICE_PERIOD_TIMEOUT = 0x0045,
  861. ACX_TSF_INFO = 0x0046,
  862. ACX_CONFIG_PS_WMM = 0x0049,
  863. ACX_ENABLE_RX_DATA_FILTER = 0x004A,
  864. ACX_SET_RX_DATA_FILTER = 0x004B,
  865. ACX_GET_DATA_FILTER_STATISTICS = 0x004C,
  866. ACX_RX_CONFIG_OPT = 0x004E,
  867. ACX_FRAG_CFG = 0x004F,
  868. ACX_BET_ENABLE = 0x0050,
  869. ACX_RSSI_SNR_TRIGGER = 0x0051,
  870. ACX_RSSI_SNR_WEIGHTS = 0x0052,
  871. ACX_KEEP_ALIVE_MODE = 0x0053,
  872. ACX_SET_KEEP_ALIVE_CONFIG = 0x0054,
  873. ACX_BA_SESSION_RESPONDER_POLICY = 0x0055,
  874. ACX_BA_SESSION_INITIATOR_POLICY = 0x0056,
  875. ACX_PEER_HT_CAP = 0x0057,
  876. ACX_HT_BSS_OPERATION = 0x0058,
  877. ACX_COEX_ACTIVITY = 0x0059,
  878. ACX_SET_SMART_REFLEX_DEBUG = 0x005A,
  879. ACX_SET_DCO_ITRIM_PARAMS = 0x0061,
  880. DOT11_RX_MSDU_LIFE_TIME = 0x1004,
  881. DOT11_CUR_TX_PWR = 0x100D,
  882. DOT11_RX_DOT11_MODE = 0x1012,
  883. DOT11_RTS_THRESHOLD = 0x1013,
  884. DOT11_GROUP_ADDRESS_TBL = 0x1014,
  885. ACX_PM_CONFIG = 0x1016,
  886. MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL,
  887. MAX_IE = 0xFFFF
  888. };
  889. int wl1271_acx_wake_up_conditions(struct wl1271 *wl);
  890. int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth);
  891. int wl1271_acx_fw_version(struct wl1271 *wl, char *buf, size_t len);
  892. int wl1271_acx_tx_power(struct wl1271 *wl, int power);
  893. int wl1271_acx_feature_cfg(struct wl1271 *wl);
  894. int wl1271_acx_mem_map(struct wl1271 *wl,
  895. struct acx_header *mem_map, size_t len);
  896. int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl);
  897. int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter);
  898. int wl1271_acx_pd_threshold(struct wl1271 *wl);
  899. int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time);
  900. int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
  901. void *mc_list, u32 mc_list_len);
  902. int wl1271_acx_service_period_timeout(struct wl1271 *wl);
  903. int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold);
  904. int wl1271_acx_dco_itrim_params(struct wl1271 *wl);
  905. int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter);
  906. int wl1271_acx_beacon_filter_table(struct wl1271 *wl);
  907. int wl1271_acx_conn_monit_params(struct wl1271 *wl, bool enable);
  908. int wl1271_acx_sg_enable(struct wl1271 *wl, bool enable);
  909. int wl1271_acx_sg_cfg(struct wl1271 *wl);
  910. int wl1271_acx_cca_threshold(struct wl1271 *wl);
  911. int wl1271_acx_bcn_dtim_options(struct wl1271 *wl);
  912. int wl1271_acx_aid(struct wl1271 *wl, u16 aid);
  913. int wl1271_acx_event_mbox_mask(struct wl1271 *wl, u32 event_mask);
  914. int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble);
  915. int wl1271_acx_cts_protect(struct wl1271 *wl,
  916. enum acx_ctsprotect_type ctsprotect);
  917. int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats);
  918. int wl1271_acx_rate_policies(struct wl1271 *wl);
  919. int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
  920. u8 aifsn, u16 txop);
  921. int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
  922. u8 tsid, u8 ps_scheme, u8 ack_policy,
  923. u32 apsd_conf0, u32 apsd_conf1);
  924. int wl1271_acx_frag_threshold(struct wl1271 *wl);
  925. int wl1271_acx_tx_config_options(struct wl1271 *wl);
  926. int wl1271_acx_mem_cfg(struct wl1271 *wl);
  927. int wl1271_acx_init_mem_config(struct wl1271 *wl);
  928. int wl1271_acx_init_rx_interrupt(struct wl1271 *wl);
  929. int wl1271_acx_smart_reflex(struct wl1271 *wl);
  930. int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable);
  931. int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, __be32 address);
  932. int wl1271_acx_pm_config(struct wl1271 *wl);
  933. int wl1271_acx_keep_alive_mode(struct wl1271 *wl, bool enable);
  934. int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid);
  935. int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable,
  936. s16 thold, u8 hyst);
  937. int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl);
  938. int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
  939. #endif /* __WL1271_ACX_H__ */