acx.h 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * This file is part of wl1251
  4. *
  5. * Copyright (c) 1998-2007 Texas Instruments Incorporated
  6. * Copyright (C) 2008 Nokia Corporation
  7. */
  8. #ifndef __WL1251_ACX_H__
  9. #define __WL1251_ACX_H__
  10. #include "wl1251.h"
  11. #include "cmd.h"
  12. /* Target's information element */
  13. struct acx_header {
  14. struct wl1251_cmd_header cmd;
  15. /* acx (or information element) header */
  16. u16 id;
  17. /* payload length (not including headers */
  18. u16 len;
  19. } __packed;
  20. struct acx_error_counter {
  21. struct acx_header header;
  22. /* The number of PLCP errors since the last time this */
  23. /* information element was interrogated. This field is */
  24. /* automatically cleared when it is interrogated.*/
  25. u32 PLCP_error;
  26. /* The number of FCS errors since the last time this */
  27. /* information element was interrogated. This field is */
  28. /* automatically cleared when it is interrogated.*/
  29. u32 FCS_error;
  30. /* The number of MPDUs without PLCP header errors received*/
  31. /* since the last time this information element was interrogated. */
  32. /* This field is automatically cleared when it is interrogated.*/
  33. u32 valid_frame;
  34. /* the number of missed sequence numbers in the squentially */
  35. /* values of frames seq numbers */
  36. u32 seq_num_miss;
  37. } __packed;
  38. struct acx_revision {
  39. struct acx_header header;
  40. /*
  41. * The WiLink firmware version, an ASCII string x.x.x.x,
  42. * that uniquely identifies the current firmware.
  43. * The left most digit is incremented each time a
  44. * significant change is made to the firmware, such as
  45. * code redesign or new platform support.
  46. * The second digit is incremented when major enhancements
  47. * are added or major fixes are made.
  48. * The third digit is incremented for each GA release.
  49. * The fourth digit is incremented for each build.
  50. * The first two digits identify a firmware release version,
  51. * in other words, a unique set of features.
  52. * The first three digits identify a GA release.
  53. */
  54. char fw_version[20];
  55. /*
  56. * This 4 byte field specifies the WiLink hardware version.
  57. * bits 0 - 15: Reserved.
  58. * bits 16 - 23: Version ID - The WiLink version ID
  59. * (1 = first spin, 2 = second spin, and so on).
  60. * bits 24 - 31: Chip ID - The WiLink chip ID.
  61. */
  62. u32 hw_version;
  63. } __packed;
  64. enum wl1251_psm_mode {
  65. /* Active mode */
  66. WL1251_PSM_CAM = 0,
  67. /* Power save mode */
  68. WL1251_PSM_PS = 1,
  69. /* Extreme low power */
  70. WL1251_PSM_ELP = 2,
  71. };
  72. struct acx_sleep_auth {
  73. struct acx_header header;
  74. /* The sleep level authorization of the device. */
  75. /* 0 - Always active*/
  76. /* 1 - Power down mode: light / fast sleep*/
  77. /* 2 - ELP mode: Deep / Max sleep*/
  78. u8 sleep_auth;
  79. u8 padding[3];
  80. } __packed;
  81. enum {
  82. HOSTIF_PCI_MASTER_HOST_INDIRECT,
  83. HOSTIF_PCI_MASTER_HOST_DIRECT,
  84. HOSTIF_SLAVE,
  85. HOSTIF_PKT_RING,
  86. HOSTIF_DONTCARE = 0xFF
  87. };
  88. #define DEFAULT_UCAST_PRIORITY 0
  89. #define DEFAULT_RX_Q_PRIORITY 0
  90. #define DEFAULT_NUM_STATIONS 1
  91. #define DEFAULT_RXQ_PRIORITY 0 /* low 0 .. 15 high */
  92. #define DEFAULT_RXQ_TYPE 0x07 /* All frames, Data/Ctrl/Mgmt */
  93. #define TRACE_BUFFER_MAX_SIZE 256
  94. #define DP_RX_PACKET_RING_CHUNK_SIZE 1600
  95. #define DP_TX_PACKET_RING_CHUNK_SIZE 1600
  96. #define DP_RX_PACKET_RING_CHUNK_NUM 2
  97. #define DP_TX_PACKET_RING_CHUNK_NUM 2
  98. #define DP_TX_COMPLETE_TIME_OUT 20
  99. #define FW_TX_CMPLT_BLOCK_SIZE 16
  100. struct acx_data_path_params {
  101. struct acx_header header;
  102. u16 rx_packet_ring_chunk_size;
  103. u16 tx_packet_ring_chunk_size;
  104. u8 rx_packet_ring_chunk_num;
  105. u8 tx_packet_ring_chunk_num;
  106. /*
  107. * Maximum number of packets that can be gathered
  108. * in the TX complete ring before an interrupt
  109. * is generated.
  110. */
  111. u8 tx_complete_threshold;
  112. /* Number of pending TX complete entries in cyclic ring.*/
  113. u8 tx_complete_ring_depth;
  114. /*
  115. * Max num microseconds since a packet enters the TX
  116. * complete ring until an interrupt is generated.
  117. */
  118. u32 tx_complete_timeout;
  119. } __packed;
  120. struct acx_data_path_params_resp {
  121. struct acx_header header;
  122. u16 rx_packet_ring_chunk_size;
  123. u16 tx_packet_ring_chunk_size;
  124. u8 rx_packet_ring_chunk_num;
  125. u8 tx_packet_ring_chunk_num;
  126. u8 pad[2];
  127. u32 rx_packet_ring_addr;
  128. u32 tx_packet_ring_addr;
  129. u32 rx_control_addr;
  130. u32 tx_control_addr;
  131. u32 tx_complete_addr;
  132. } __packed;
  133. #define TX_MSDU_LIFETIME_MIN 0
  134. #define TX_MSDU_LIFETIME_MAX 3000
  135. #define TX_MSDU_LIFETIME_DEF 512
  136. #define RX_MSDU_LIFETIME_MIN 0
  137. #define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF
  138. #define RX_MSDU_LIFETIME_DEF 512000
  139. struct acx_rx_msdu_lifetime {
  140. struct acx_header header;
  141. /*
  142. * The maximum amount of time, in TU, before the
  143. * firmware discards the MSDU.
  144. */
  145. u32 lifetime;
  146. } __packed;
  147. /*
  148. * RX Config Options Table
  149. * Bit Definition
  150. * === ==========
  151. * 31:14 Reserved
  152. * 13 Copy RX Status - when set, write three receive status words
  153. * to top of rx'd MPDUs.
  154. * When cleared, do not write three status words (added rev 1.5)
  155. * 12 Reserved
  156. * 11 RX Complete upon FCS error - when set, give rx complete
  157. * interrupt for FCS errors, after the rx filtering, e.g. unicast
  158. * frames not to us with FCS error will not generate an interrupt.
  159. * 10 SSID Filter Enable - When set, the WiLink discards all beacon,
  160. * probe request, and probe response frames with an SSID that does
  161. * not match the SSID specified by the host in the START/JOIN
  162. * command.
  163. * When clear, the WiLink receives frames with any SSID.
  164. * 9 Broadcast Filter Enable - When set, the WiLink discards all
  165. * broadcast frames. When clear, the WiLink receives all received
  166. * broadcast frames.
  167. * 8:6 Reserved
  168. * 5 BSSID Filter Enable - When set, the WiLink discards any frames
  169. * with a BSSID that does not match the BSSID specified by the
  170. * host.
  171. * When clear, the WiLink receives frames from any BSSID.
  172. * 4 MAC Addr Filter - When set, the WiLink discards any frames
  173. * with a destination address that does not match the MAC address
  174. * of the adaptor.
  175. * When clear, the WiLink receives frames destined to any MAC
  176. * address.
  177. * 3 Promiscuous - When set, the WiLink receives all valid frames
  178. * (i.e., all frames that pass the FCS check).
  179. * When clear, only frames that pass the other filters specified
  180. * are received.
  181. * 2 FCS - When set, the WiLink includes the FCS with the received
  182. * frame.
  183. * When cleared, the FCS is discarded.
  184. * 1 PLCP header - When set, write all data from baseband to frame
  185. * buffer including PHY header.
  186. * 0 Reserved - Always equal to 0.
  187. *
  188. * RX Filter Options Table
  189. * Bit Definition
  190. * === ==========
  191. * 31:12 Reserved - Always equal to 0.
  192. * 11 Association - When set, the WiLink receives all association
  193. * related frames (association request/response, reassocation
  194. * request/response, and disassociation). When clear, these frames
  195. * are discarded.
  196. * 10 Auth/De auth - When set, the WiLink receives all authentication
  197. * and de-authentication frames. When clear, these frames are
  198. * discarded.
  199. * 9 Beacon - When set, the WiLink receives all beacon frames.
  200. * When clear, these frames are discarded.
  201. * 8 Contention Free - When set, the WiLink receives all contention
  202. * free frames.
  203. * When clear, these frames are discarded.
  204. * 7 Control - When set, the WiLink receives all control frames.
  205. * When clear, these frames are discarded.
  206. * 6 Data - When set, the WiLink receives all data frames.
  207. * When clear, these frames are discarded.
  208. * 5 FCS Error - When set, the WiLink receives frames that have FCS
  209. * errors.
  210. * When clear, these frames are discarded.
  211. * 4 Management - When set, the WiLink receives all management
  212. * frames.
  213. * When clear, these frames are discarded.
  214. * 3 Probe Request - When set, the WiLink receives all probe request
  215. * frames.
  216. * When clear, these frames are discarded.
  217. * 2 Probe Response - When set, the WiLink receives all probe
  218. * response frames.
  219. * When clear, these frames are discarded.
  220. * 1 RTS/CTS/ACK - When set, the WiLink receives all RTS, CTS and ACK
  221. * frames.
  222. * When clear, these frames are discarded.
  223. * 0 Rsvd Type/Sub Type - When set, the WiLink receives all frames
  224. * that have reserved frame types and sub types as defined by the
  225. * 802.11 specification.
  226. * When clear, these frames are discarded.
  227. */
  228. struct acx_rx_config {
  229. struct acx_header header;
  230. u32 config_options;
  231. u32 filter_options;
  232. } __packed;
  233. enum {
  234. QOS_AC_BE = 0,
  235. QOS_AC_BK,
  236. QOS_AC_VI,
  237. QOS_AC_VO,
  238. QOS_HIGHEST_AC_INDEX = QOS_AC_VO,
  239. };
  240. #define MAX_NUM_OF_AC (QOS_HIGHEST_AC_INDEX+1)
  241. #define FIRST_AC_INDEX QOS_AC_BE
  242. #define MAX_NUM_OF_802_1d_TAGS 8
  243. #define AC_PARAMS_MAX_TSID 15
  244. #define MAX_APSD_CONF 0xffff
  245. #define QOS_TX_HIGH_MIN (0)
  246. #define QOS_TX_HIGH_MAX (100)
  247. #define QOS_TX_HIGH_BK_DEF (25)
  248. #define QOS_TX_HIGH_BE_DEF (35)
  249. #define QOS_TX_HIGH_VI_DEF (35)
  250. #define QOS_TX_HIGH_VO_DEF (35)
  251. #define QOS_TX_LOW_BK_DEF (15)
  252. #define QOS_TX_LOW_BE_DEF (25)
  253. #define QOS_TX_LOW_VI_DEF (25)
  254. #define QOS_TX_LOW_VO_DEF (25)
  255. struct acx_tx_queue_qos_config {
  256. struct acx_header header;
  257. u8 qid;
  258. u8 pad[3];
  259. /* Max number of blocks allowd in the queue */
  260. u16 high_threshold;
  261. /* Lowest memory blocks guaranteed for this queue */
  262. u16 low_threshold;
  263. } __packed;
  264. struct acx_packet_detection {
  265. struct acx_header header;
  266. u32 threshold;
  267. } __packed;
  268. enum acx_slot_type {
  269. SLOT_TIME_LONG = 0,
  270. SLOT_TIME_SHORT = 1,
  271. DEFAULT_SLOT_TIME = SLOT_TIME_SHORT,
  272. MAX_SLOT_TIMES = 0xFF
  273. };
  274. #define STATION_WONE_INDEX 0
  275. struct acx_slot {
  276. struct acx_header header;
  277. u8 wone_index; /* Reserved */
  278. u8 slot_time;
  279. u8 reserved[6];
  280. } __packed;
  281. #define ACX_MC_ADDRESS_GROUP_MAX (8)
  282. #define ACX_MC_ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ACX_MC_ADDRESS_GROUP_MAX)
  283. struct acx_dot11_grp_addr_tbl {
  284. struct acx_header header;
  285. u8 enabled;
  286. u8 num_groups;
  287. u8 pad[2];
  288. u8 mac_table[ACX_MC_ADDRESS_GROUP_MAX_LEN];
  289. } __packed;
  290. #define RX_TIMEOUT_PS_POLL_MIN 0
  291. #define RX_TIMEOUT_PS_POLL_MAX (200000)
  292. #define RX_TIMEOUT_PS_POLL_DEF (15)
  293. #define RX_TIMEOUT_UPSD_MIN 0
  294. #define RX_TIMEOUT_UPSD_MAX (200000)
  295. #define RX_TIMEOUT_UPSD_DEF (15)
  296. struct acx_rx_timeout {
  297. struct acx_header header;
  298. /*
  299. * The longest time the STA will wait to receive
  300. * traffic from the AP after a PS-poll has been
  301. * transmitted.
  302. */
  303. u16 ps_poll_timeout;
  304. /*
  305. * The longest time the STA will wait to receive
  306. * traffic from the AP after a frame has been sent
  307. * from an UPSD enabled queue.
  308. */
  309. u16 upsd_timeout;
  310. } __packed;
  311. #define RTS_THRESHOLD_MIN 0
  312. #define RTS_THRESHOLD_MAX 4096
  313. #define RTS_THRESHOLD_DEF 2347
  314. struct acx_rts_threshold {
  315. struct acx_header header;
  316. u16 threshold;
  317. u8 pad[2];
  318. } __packed;
  319. enum wl1251_acx_low_rssi_type {
  320. /*
  321. * The event is a "Level" indication which keeps triggering
  322. * as long as the average RSSI is below the threshold.
  323. */
  324. WL1251_ACX_LOW_RSSI_TYPE_LEVEL = 0,
  325. /*
  326. * The event is an "Edge" indication which triggers
  327. * only when the RSSI threshold is crossed from above.
  328. */
  329. WL1251_ACX_LOW_RSSI_TYPE_EDGE = 1,
  330. };
  331. struct acx_low_rssi {
  332. struct acx_header header;
  333. /*
  334. * The threshold (in dBm) below (or above after low rssi
  335. * indication) which the firmware generates an interrupt to the
  336. * host. This parameter is signed.
  337. */
  338. s8 threshold;
  339. /*
  340. * The weight of the current RSSI sample, before adding the new
  341. * sample, that is used to calculate the average RSSI.
  342. */
  343. u8 weight;
  344. /*
  345. * The number of Beacons/Probe response frames that will be
  346. * received before issuing the Low or Regained RSSI event.
  347. */
  348. u8 depth;
  349. /*
  350. * Configures how the Low RSSI Event is triggered. Refer to
  351. * enum wl1251_acx_low_rssi_type for more.
  352. */
  353. u8 type;
  354. } __packed;
  355. struct acx_beacon_filter_option {
  356. struct acx_header header;
  357. u8 enable;
  358. /*
  359. * The number of beacons without the unicast TIM
  360. * bit set that the firmware buffers before
  361. * signaling the host about ready frames.
  362. * When set to 0 and the filter is enabled, beacons
  363. * without the unicast TIM bit set are dropped.
  364. */
  365. u8 max_num_beacons;
  366. u8 pad[2];
  367. } __packed;
  368. /*
  369. * ACXBeaconFilterEntry (not 221)
  370. * Byte Offset Size (Bytes) Definition
  371. * =========== ============ ==========
  372. * 0 1 IE identifier
  373. * 1 1 Treatment bit mask
  374. *
  375. * ACXBeaconFilterEntry (221)
  376. * Byte Offset Size (Bytes) Definition
  377. * =========== ============ ==========
  378. * 0 1 IE identifier
  379. * 1 1 Treatment bit mask
  380. * 2 3 OUI
  381. * 5 1 Type
  382. * 6 2 Version
  383. *
  384. *
  385. * Treatment bit mask - The information element handling:
  386. * bit 0 - The information element is compared and transferred
  387. * in case of change.
  388. * bit 1 - The information element is transferred to the host
  389. * with each appearance or disappearance.
  390. * Note that both bits can be set at the same time.
  391. */
  392. #define BEACON_FILTER_TABLE_MAX_IE_NUM (32)
  393. #define BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM (6)
  394. #define BEACON_FILTER_TABLE_IE_ENTRY_SIZE (2)
  395. #define BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE (6)
  396. #define BEACON_FILTER_TABLE_MAX_SIZE ((BEACON_FILTER_TABLE_MAX_IE_NUM * \
  397. BEACON_FILTER_TABLE_IE_ENTRY_SIZE) + \
  398. (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
  399. BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))
  400. #define BEACON_RULE_PASS_ON_CHANGE BIT(0)
  401. #define BEACON_RULE_PASS_ON_APPEARANCE BIT(1)
  402. #define BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN (37)
  403. struct acx_beacon_filter_ie_table {
  404. struct acx_header header;
  405. u8 num_ie;
  406. u8 pad[3];
  407. u8 table[BEACON_FILTER_TABLE_MAX_SIZE];
  408. } __packed;
  409. #define SYNCH_FAIL_DEFAULT_THRESHOLD 10 /* number of beacons */
  410. #define NO_BEACON_DEFAULT_TIMEOUT (500) /* in microseconds */
  411. struct acx_conn_monit_params {
  412. struct acx_header header;
  413. u32 synch_fail_thold; /* number of beacons missed */
  414. u32 bss_lose_timeout; /* number of TU's from synch fail */
  415. } __packed;
  416. enum {
  417. SG_ENABLE = 0,
  418. SG_DISABLE,
  419. SG_SENSE_NO_ACTIVITY,
  420. SG_SENSE_ACTIVE
  421. };
  422. struct acx_bt_wlan_coex {
  423. struct acx_header header;
  424. /*
  425. * 0 -> PTA enabled
  426. * 1 -> PTA disabled
  427. * 2 -> sense no active mode, i.e.
  428. * an interrupt is sent upon
  429. * BT activity.
  430. * 3 -> PTA is switched on in response
  431. * to the interrupt sending.
  432. */
  433. u8 enable;
  434. u8 pad[3];
  435. } __packed;
  436. #define PTA_ANTENNA_TYPE_DEF (0)
  437. #define PTA_BT_HP_MAXTIME_DEF (2000)
  438. #define PTA_WLAN_HP_MAX_TIME_DEF (5000)
  439. #define PTA_SENSE_DISABLE_TIMER_DEF (1350)
  440. #define PTA_PROTECTIVE_RX_TIME_DEF (1500)
  441. #define PTA_PROTECTIVE_TX_TIME_DEF (1500)
  442. #define PTA_TIMEOUT_NEXT_BT_LP_PACKET_DEF (3000)
  443. #define PTA_SIGNALING_TYPE_DEF (1)
  444. #define PTA_AFH_LEVERAGE_ON_DEF (0)
  445. #define PTA_NUMBER_QUIET_CYCLE_DEF (0)
  446. #define PTA_MAX_NUM_CTS_DEF (3)
  447. #define PTA_NUMBER_OF_WLAN_PACKETS_DEF (2)
  448. #define PTA_NUMBER_OF_BT_PACKETS_DEF (2)
  449. #define PTA_PROTECTIVE_RX_TIME_FAST_DEF (1500)
  450. #define PTA_PROTECTIVE_TX_TIME_FAST_DEF (3000)
  451. #define PTA_CYCLE_TIME_FAST_DEF (8700)
  452. #define PTA_RX_FOR_AVALANCHE_DEF (5)
  453. #define PTA_ELP_HP_DEF (0)
  454. #define PTA_ANTI_STARVE_PERIOD_DEF (500)
  455. #define PTA_ANTI_STARVE_NUM_CYCLE_DEF (4)
  456. #define PTA_ALLOW_PA_SD_DEF (1)
  457. #define PTA_TIME_BEFORE_BEACON_DEF (6300)
  458. #define PTA_HPDM_MAX_TIME_DEF (1600)
  459. #define PTA_TIME_OUT_NEXT_WLAN_DEF (2550)
  460. #define PTA_AUTO_MODE_NO_CTS_DEF (0)
  461. #define PTA_BT_HP_RESPECTED_DEF (3)
  462. #define PTA_WLAN_RX_MIN_RATE_DEF (24)
  463. #define PTA_ACK_MODE_DEF (1)
  464. struct acx_bt_wlan_coex_param {
  465. struct acx_header header;
  466. /*
  467. * The minimum rate of a received WLAN packet in the STA,
  468. * during protective mode, of which a new BT-HP request
  469. * during this Rx will always be respected and gain the antenna.
  470. */
  471. u32 min_rate;
  472. /* Max time the BT HP will be respected. */
  473. u16 bt_hp_max_time;
  474. /* Max time the WLAN HP will be respected. */
  475. u16 wlan_hp_max_time;
  476. /*
  477. * The time between the last BT activity
  478. * and the moment when the sense mode returns
  479. * to SENSE_INACTIVE.
  480. */
  481. u16 sense_disable_timer;
  482. /* Time before the next BT HP instance */
  483. u16 rx_time_bt_hp;
  484. u16 tx_time_bt_hp;
  485. /* range: 10-20000 default: 1500 */
  486. u16 rx_time_bt_hp_fast;
  487. u16 tx_time_bt_hp_fast;
  488. /* range: 2000-65535 default: 8700 */
  489. u16 wlan_cycle_fast;
  490. /* range: 0 - 15000 (Msec) default: 1000 */
  491. u16 bt_anti_starvation_period;
  492. /* range 400-10000(Usec) default: 3000 */
  493. u16 next_bt_lp_packet;
  494. /* Deafult: worst case for BT DH5 traffic */
  495. u16 wake_up_beacon;
  496. /* range: 0-50000(Usec) default: 1050 */
  497. u16 hp_dm_max_guard_time;
  498. /*
  499. * This is to prevent both BT & WLAN antenna
  500. * starvation.
  501. * Range: 100-50000(Usec) default:2550
  502. */
  503. u16 next_wlan_packet;
  504. /* 0 -> shared antenna */
  505. u8 antenna_type;
  506. /*
  507. * 0 -> TI legacy
  508. * 1 -> Palau
  509. */
  510. u8 signal_type;
  511. /*
  512. * BT AFH status
  513. * 0 -> no AFH
  514. * 1 -> from dedicated GPIO
  515. * 2 -> AFH on (from host)
  516. */
  517. u8 afh_leverage_on;
  518. /*
  519. * The number of cycles during which no
  520. * TX will be sent after 1 cycle of RX
  521. * transaction in protective mode
  522. */
  523. u8 quiet_cycle_num;
  524. /*
  525. * The maximum number of CTSs that will
  526. * be sent for receiving RX packet in
  527. * protective mode
  528. */
  529. u8 max_cts;
  530. /*
  531. * The number of WLAN packets
  532. * transferred in common mode before
  533. * switching to BT.
  534. */
  535. u8 wlan_packets_num;
  536. /*
  537. * The number of BT packets
  538. * transferred in common mode before
  539. * switching to WLAN.
  540. */
  541. u8 bt_packets_num;
  542. /* range: 1-255 default: 5 */
  543. u8 missed_rx_avalanche;
  544. /* range: 0-1 default: 1 */
  545. u8 wlan_elp_hp;
  546. /* range: 0 - 15 default: 4 */
  547. u8 bt_anti_starvation_cycles;
  548. u8 ack_mode_dual_ant;
  549. /*
  550. * Allow PA_SD assertion/de-assertion
  551. * during enabled BT activity.
  552. */
  553. u8 pa_sd_enable;
  554. /*
  555. * Enable/Disable PTA in auto mode:
  556. * Support Both Active & P.S modes
  557. */
  558. u8 pta_auto_mode_enable;
  559. /* range: 0 - 20 default: 1 */
  560. u8 bt_hp_respected_num;
  561. } __packed;
  562. #define CCA_THRSH_ENABLE_ENERGY_D 0x140A
  563. #define CCA_THRSH_DISABLE_ENERGY_D 0xFFEF
  564. struct acx_energy_detection {
  565. struct acx_header header;
  566. /* The RX Clear Channel Assessment threshold in the PHY */
  567. u16 rx_cca_threshold;
  568. u8 tx_energy_detection;
  569. u8 pad;
  570. } __packed;
  571. #define BCN_RX_TIMEOUT_DEF_VALUE 10000
  572. #define BROADCAST_RX_TIMEOUT_DEF_VALUE 20000
  573. #define RX_BROADCAST_IN_PS_DEF_VALUE 1
  574. #define CONSECUTIVE_PS_POLL_FAILURE_DEF 4
  575. struct acx_beacon_broadcast {
  576. struct acx_header header;
  577. u16 beacon_rx_timeout;
  578. u16 broadcast_timeout;
  579. /* Enables receiving of broadcast packets in PS mode */
  580. u8 rx_broadcast_in_ps;
  581. /* Consecutive PS Poll failures before updating the host */
  582. u8 ps_poll_threshold;
  583. u8 pad[2];
  584. } __packed;
  585. struct acx_event_mask {
  586. struct acx_header header;
  587. u32 event_mask;
  588. u32 high_event_mask; /* Unused */
  589. } __packed;
  590. #define CFG_RX_FCS BIT(2)
  591. #define CFG_RX_ALL_GOOD BIT(3)
  592. #define CFG_UNI_FILTER_EN BIT(4)
  593. #define CFG_BSSID_FILTER_EN BIT(5)
  594. #define CFG_MC_FILTER_EN BIT(6)
  595. #define CFG_MC_ADDR0_EN BIT(7)
  596. #define CFG_MC_ADDR1_EN BIT(8)
  597. #define CFG_BC_REJECT_EN BIT(9)
  598. #define CFG_SSID_FILTER_EN BIT(10)
  599. #define CFG_RX_INT_FCS_ERROR BIT(11)
  600. #define CFG_RX_INT_ENCRYPTED BIT(12)
  601. #define CFG_RX_WR_RX_STATUS BIT(13)
  602. #define CFG_RX_FILTER_NULTI BIT(14)
  603. #define CFG_RX_RESERVE BIT(15)
  604. #define CFG_RX_TIMESTAMP_TSF BIT(16)
  605. #define CFG_RX_RSV_EN BIT(0)
  606. #define CFG_RX_RCTS_ACK BIT(1)
  607. #define CFG_RX_PRSP_EN BIT(2)
  608. #define CFG_RX_PREQ_EN BIT(3)
  609. #define CFG_RX_MGMT_EN BIT(4)
  610. #define CFG_RX_FCS_ERROR BIT(5)
  611. #define CFG_RX_DATA_EN BIT(6)
  612. #define CFG_RX_CTL_EN BIT(7)
  613. #define CFG_RX_CF_EN BIT(8)
  614. #define CFG_RX_BCN_EN BIT(9)
  615. #define CFG_RX_AUTH_EN BIT(10)
  616. #define CFG_RX_ASSOC_EN BIT(11)
  617. #define SCAN_PASSIVE BIT(0)
  618. #define SCAN_5GHZ_BAND BIT(1)
  619. #define SCAN_TRIGGERED BIT(2)
  620. #define SCAN_PRIORITY_HIGH BIT(3)
  621. struct acx_fw_gen_frame_rates {
  622. struct acx_header header;
  623. u8 tx_ctrl_frame_rate; /* RATE_* */
  624. u8 tx_ctrl_frame_mod; /* CCK_* or PBCC_* */
  625. u8 tx_mgt_frame_rate;
  626. u8 tx_mgt_frame_mod;
  627. } __packed;
  628. /* STA MAC */
  629. struct acx_dot11_station_id {
  630. struct acx_header header;
  631. u8 mac[ETH_ALEN];
  632. u8 pad[2];
  633. } __packed;
  634. struct acx_feature_config {
  635. struct acx_header header;
  636. u32 options;
  637. u32 data_flow_options;
  638. } __packed;
  639. struct acx_current_tx_power {
  640. struct acx_header header;
  641. u8 current_tx_power;
  642. u8 padding[3];
  643. } __packed;
  644. struct acx_dot11_default_key {
  645. struct acx_header header;
  646. u8 id;
  647. u8 pad[3];
  648. } __packed;
  649. struct acx_tsf_info {
  650. struct acx_header header;
  651. u32 current_tsf_msb;
  652. u32 current_tsf_lsb;
  653. u32 last_TBTT_msb;
  654. u32 last_TBTT_lsb;
  655. u8 last_dtim_count;
  656. u8 pad[3];
  657. } __packed;
  658. enum acx_wake_up_event {
  659. WAKE_UP_EVENT_BEACON_BITMAP = 0x01, /* Wake on every Beacon*/
  660. WAKE_UP_EVENT_DTIM_BITMAP = 0x02, /* Wake on every DTIM*/
  661. WAKE_UP_EVENT_N_DTIM_BITMAP = 0x04, /* Wake on every Nth DTIM */
  662. WAKE_UP_EVENT_N_BEACONS_BITMAP = 0x08, /* Wake on every Nth Beacon */
  663. WAKE_UP_EVENT_BITS_MASK = 0x0F
  664. };
  665. struct acx_wake_up_condition {
  666. struct acx_header header;
  667. u8 wake_up_event; /* Only one bit can be set */
  668. u8 listen_interval;
  669. u8 pad[2];
  670. } __packed;
  671. struct acx_aid {
  672. struct acx_header header;
  673. /*
  674. * To be set when associated with an AP.
  675. */
  676. u16 aid;
  677. u8 pad[2];
  678. } __packed;
  679. enum acx_preamble_type {
  680. ACX_PREAMBLE_LONG = 0,
  681. ACX_PREAMBLE_SHORT = 1
  682. };
  683. struct acx_preamble {
  684. struct acx_header header;
  685. /*
  686. * When set, the WiLink transmits the frames with a short preamble and
  687. * when cleared, the WiLink transmits the frames with a long preamble.
  688. */
  689. u8 preamble;
  690. u8 padding[3];
  691. } __packed;
  692. enum acx_ctsprotect_type {
  693. CTSPROTECT_DISABLE = 0,
  694. CTSPROTECT_ENABLE = 1
  695. };
  696. struct acx_ctsprotect {
  697. struct acx_header header;
  698. u8 ctsprotect;
  699. u8 padding[3];
  700. } __packed;
  701. struct acx_tx_statistics {
  702. u32 internal_desc_overflow;
  703. } __packed;
  704. struct acx_rx_statistics {
  705. u32 out_of_mem;
  706. u32 hdr_overflow;
  707. u32 hw_stuck;
  708. u32 dropped;
  709. u32 fcs_err;
  710. u32 xfr_hint_trig;
  711. u32 path_reset;
  712. u32 reset_counter;
  713. } __packed;
  714. struct acx_dma_statistics {
  715. u32 rx_requested;
  716. u32 rx_errors;
  717. u32 tx_requested;
  718. u32 tx_errors;
  719. } __packed;
  720. struct acx_isr_statistics {
  721. /* host command complete */
  722. u32 cmd_cmplt;
  723. /* fiqisr() */
  724. u32 fiqs;
  725. /* (INT_STS_ND & INT_TRIG_RX_HEADER) */
  726. u32 rx_headers;
  727. /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
  728. u32 rx_completes;
  729. /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
  730. u32 rx_mem_overflow;
  731. /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
  732. u32 rx_rdys;
  733. /* irqisr() */
  734. u32 irqs;
  735. /* (INT_STS_ND & INT_TRIG_TX_PROC) */
  736. u32 tx_procs;
  737. /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
  738. u32 decrypt_done;
  739. /* (INT_STS_ND & INT_TRIG_DMA0) */
  740. u32 dma0_done;
  741. /* (INT_STS_ND & INT_TRIG_DMA1) */
  742. u32 dma1_done;
  743. /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
  744. u32 tx_exch_complete;
  745. /* (INT_STS_ND & INT_TRIG_COMMAND) */
  746. u32 commands;
  747. /* (INT_STS_ND & INT_TRIG_RX_PROC) */
  748. u32 rx_procs;
  749. /* (INT_STS_ND & INT_TRIG_PM_802) */
  750. u32 hw_pm_mode_changes;
  751. /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
  752. u32 host_acknowledges;
  753. /* (INT_STS_ND & INT_TRIG_PM_PCI) */
  754. u32 pci_pm;
  755. /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
  756. u32 wakeups;
  757. /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
  758. u32 low_rssi;
  759. } __packed;
  760. struct acx_wep_statistics {
  761. /* WEP address keys configured */
  762. u32 addr_key_count;
  763. /* default keys configured */
  764. u32 default_key_count;
  765. u32 reserved;
  766. /* number of times that WEP key not found on lookup */
  767. u32 key_not_found;
  768. /* number of times that WEP key decryption failed */
  769. u32 decrypt_fail;
  770. /* WEP packets decrypted */
  771. u32 packets;
  772. /* WEP decrypt interrupts */
  773. u32 interrupt;
  774. } __packed;
  775. #define ACX_MISSED_BEACONS_SPREAD 10
  776. struct acx_pwr_statistics {
  777. /* the amount of enters into power save mode (both PD & ELP) */
  778. u32 ps_enter;
  779. /* the amount of enters into ELP mode */
  780. u32 elp_enter;
  781. /* the amount of missing beacon interrupts to the host */
  782. u32 missing_bcns;
  783. /* the amount of wake on host-access times */
  784. u32 wake_on_host;
  785. /* the amount of wake on timer-expire */
  786. u32 wake_on_timer_exp;
  787. /* the number of packets that were transmitted with PS bit set */
  788. u32 tx_with_ps;
  789. /* the number of packets that were transmitted with PS bit clear */
  790. u32 tx_without_ps;
  791. /* the number of received beacons */
  792. u32 rcvd_beacons;
  793. /* the number of entering into PowerOn (power save off) */
  794. u32 power_save_off;
  795. /* the number of entries into power save mode */
  796. u16 enable_ps;
  797. /*
  798. * the number of exits from power save, not including failed PS
  799. * transitions
  800. */
  801. u16 disable_ps;
  802. /*
  803. * the number of times the TSF counter was adjusted because
  804. * of drift
  805. */
  806. u32 fix_tsf_ps;
  807. /* Gives statistics about the spread continuous missed beacons.
  808. * The 16 LSB are dedicated for the PS mode.
  809. * The 16 MSB are dedicated for the PS mode.
  810. * cont_miss_bcns_spread[0] - single missed beacon.
  811. * cont_miss_bcns_spread[1] - two continuous missed beacons.
  812. * cont_miss_bcns_spread[2] - three continuous missed beacons.
  813. * ...
  814. * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
  815. */
  816. u32 cont_miss_bcns_spread[ACX_MISSED_BEACONS_SPREAD];
  817. /* the number of beacons in awake mode */
  818. u32 rcvd_awake_beacons;
  819. } __packed;
  820. struct acx_mic_statistics {
  821. u32 rx_pkts;
  822. u32 calc_failure;
  823. } __packed;
  824. struct acx_aes_statistics {
  825. u32 encrypt_fail;
  826. u32 decrypt_fail;
  827. u32 encrypt_packets;
  828. u32 decrypt_packets;
  829. u32 encrypt_interrupt;
  830. u32 decrypt_interrupt;
  831. } __packed;
  832. struct acx_event_statistics {
  833. u32 heart_beat;
  834. u32 calibration;
  835. u32 rx_mismatch;
  836. u32 rx_mem_empty;
  837. u32 rx_pool;
  838. u32 oom_late;
  839. u32 phy_transmit_error;
  840. u32 tx_stuck;
  841. } __packed;
  842. struct acx_ps_statistics {
  843. u32 pspoll_timeouts;
  844. u32 upsd_timeouts;
  845. u32 upsd_max_sptime;
  846. u32 upsd_max_apturn;
  847. u32 pspoll_max_apturn;
  848. u32 pspoll_utilization;
  849. u32 upsd_utilization;
  850. } __packed;
  851. struct acx_rxpipe_statistics {
  852. u32 rx_prep_beacon_drop;
  853. u32 descr_host_int_trig_rx_data;
  854. u32 beacon_buffer_thres_host_int_trig_rx_data;
  855. u32 missed_beacon_host_int_trig_rx_data;
  856. u32 tx_xfr_host_int_trig_rx_data;
  857. } __packed;
  858. struct acx_statistics {
  859. struct acx_header header;
  860. struct acx_tx_statistics tx;
  861. struct acx_rx_statistics rx;
  862. struct acx_dma_statistics dma;
  863. struct acx_isr_statistics isr;
  864. struct acx_wep_statistics wep;
  865. struct acx_pwr_statistics pwr;
  866. struct acx_aes_statistics aes;
  867. struct acx_mic_statistics mic;
  868. struct acx_event_statistics event;
  869. struct acx_ps_statistics ps;
  870. struct acx_rxpipe_statistics rxpipe;
  871. } __packed;
  872. #define ACX_MAX_RATE_CLASSES 8
  873. #define ACX_RATE_MASK_UNSPECIFIED 0
  874. #define ACX_RATE_RETRY_LIMIT 10
  875. struct acx_rate_class {
  876. u32 enabled_rates;
  877. u8 short_retry_limit;
  878. u8 long_retry_limit;
  879. u8 aflags;
  880. u8 reserved;
  881. } __packed;
  882. struct acx_rate_policy {
  883. struct acx_header header;
  884. u32 rate_class_cnt;
  885. struct acx_rate_class rate_class[ACX_MAX_RATE_CLASSES];
  886. } __packed;
  887. struct wl1251_acx_memory {
  888. __le16 num_stations; /* number of STAs to be supported. */
  889. u16 reserved_1;
  890. /*
  891. * Nmber of memory buffers for the RX mem pool.
  892. * The actual number may be less if there are
  893. * not enough blocks left for the minimum num
  894. * of TX ones.
  895. */
  896. u8 rx_mem_block_num;
  897. u8 reserved_2;
  898. u8 num_tx_queues; /* From 1 to 16 */
  899. u8 host_if_options; /* HOST_IF* */
  900. u8 tx_min_mem_block_num;
  901. u8 num_ssid_profiles;
  902. __le16 debug_buffer_size;
  903. } __packed;
  904. #define ACX_RX_DESC_MIN 1
  905. #define ACX_RX_DESC_MAX 127
  906. #define ACX_RX_DESC_DEF 32
  907. struct wl1251_acx_rx_queue_config {
  908. u8 num_descs;
  909. u8 pad;
  910. u8 type;
  911. u8 priority;
  912. __le32 dma_address;
  913. } __packed;
  914. #define ACX_TX_DESC_MIN 1
  915. #define ACX_TX_DESC_MAX 127
  916. #define ACX_TX_DESC_DEF 16
  917. struct wl1251_acx_tx_queue_config {
  918. u8 num_descs;
  919. u8 pad[2];
  920. u8 attributes;
  921. } __packed;
  922. #define MAX_TX_QUEUE_CONFIGS 5
  923. #define MAX_TX_QUEUES 4
  924. struct wl1251_acx_config_memory {
  925. struct acx_header header;
  926. struct wl1251_acx_memory mem_config;
  927. struct wl1251_acx_rx_queue_config rx_queue_config;
  928. struct wl1251_acx_tx_queue_config tx_queue_config[MAX_TX_QUEUE_CONFIGS];
  929. } __packed;
  930. struct wl1251_acx_mem_map {
  931. struct acx_header header;
  932. void *code_start;
  933. void *code_end;
  934. void *wep_defkey_start;
  935. void *wep_defkey_end;
  936. void *sta_table_start;
  937. void *sta_table_end;
  938. void *packet_template_start;
  939. void *packet_template_end;
  940. void *queue_memory_start;
  941. void *queue_memory_end;
  942. void *packet_memory_pool_start;
  943. void *packet_memory_pool_end;
  944. void *debug_buffer1_start;
  945. void *debug_buffer1_end;
  946. void *debug_buffer2_start;
  947. void *debug_buffer2_end;
  948. /* Number of blocks FW allocated for TX packets */
  949. u32 num_tx_mem_blocks;
  950. /* Number of blocks FW allocated for RX packets */
  951. u32 num_rx_mem_blocks;
  952. } __packed;
  953. struct wl1251_acx_wr_tbtt_and_dtim {
  954. struct acx_header header;
  955. /* Time in TUs between two consecutive beacons */
  956. u16 tbtt;
  957. /*
  958. * DTIM period
  959. * For BSS: Number of TBTTs in a DTIM period (range: 1-10)
  960. * For IBSS: value shall be set to 1
  961. */
  962. u8 dtim;
  963. u8 padding;
  964. } __packed;
  965. enum wl1251_acx_bet_mode {
  966. WL1251_ACX_BET_DISABLE = 0,
  967. WL1251_ACX_BET_ENABLE = 1,
  968. };
  969. struct wl1251_acx_bet_enable {
  970. struct acx_header header;
  971. /*
  972. * Specifies if beacon early termination procedure is enabled or
  973. * disabled, see enum wl1251_acx_bet_mode.
  974. */
  975. u8 enable;
  976. /*
  977. * Specifies the maximum number of consecutive beacons that may be
  978. * early terminated. After this number is reached at least one full
  979. * beacon must be correctly received in FW before beacon ET
  980. * resumes. Range 0 - 255.
  981. */
  982. u8 max_consecutive;
  983. u8 padding[2];
  984. } __packed;
  985. #define ACX_IPV4_VERSION 4
  986. #define ACX_IPV6_VERSION 6
  987. #define ACX_IPV4_ADDR_SIZE 4
  988. struct wl1251_acx_arp_filter {
  989. struct acx_header header;
  990. u8 version; /* The IP version: 4 - IPv4, 6 - IPv6.*/
  991. u8 enable; /* 1 - ARP filtering is enabled, 0 - disabled */
  992. u8 padding[2];
  993. u8 address[16]; /* The IP address used to filter ARP packets.
  994. ARP packets that do not match this address are
  995. dropped. When the IP Version is 4, the last 12
  996. bytes of the the address are ignored. */
  997. } __attribute__((packed));
  998. struct wl1251_acx_ac_cfg {
  999. struct acx_header header;
  1000. /*
  1001. * Access Category - The TX queue's access category
  1002. * (refer to AccessCategory_enum)
  1003. */
  1004. u8 ac;
  1005. /*
  1006. * The contention window minimum size (in slots) for
  1007. * the access class.
  1008. */
  1009. u8 cw_min;
  1010. /*
  1011. * The contention window maximum size (in slots) for
  1012. * the access class.
  1013. */
  1014. u16 cw_max;
  1015. /* The AIF value (in slots) for the access class. */
  1016. u8 aifsn;
  1017. u8 reserved;
  1018. /* The TX Op Limit (in microseconds) for the access class. */
  1019. u16 txop_limit;
  1020. } __packed;
  1021. enum wl1251_acx_channel_type {
  1022. CHANNEL_TYPE_DCF = 0,
  1023. CHANNEL_TYPE_EDCF = 1,
  1024. CHANNEL_TYPE_HCCA = 2,
  1025. };
  1026. enum wl1251_acx_ps_scheme {
  1027. /* regular ps: simple sending of packets */
  1028. WL1251_ACX_PS_SCHEME_LEGACY = 0,
  1029. /* sending a packet triggers a unscheduled apsd downstream */
  1030. WL1251_ACX_PS_SCHEME_UPSD_TRIGGER = 1,
  1031. /* a pspoll packet will be sent before every data packet */
  1032. WL1251_ACX_PS_SCHEME_LEGACY_PSPOLL = 2,
  1033. /* scheduled apsd mode */
  1034. WL1251_ACX_PS_SCHEME_SAPSD = 3,
  1035. };
  1036. enum wl1251_acx_ack_policy {
  1037. WL1251_ACX_ACK_POLICY_LEGACY = 0,
  1038. WL1251_ACX_ACK_POLICY_NO_ACK = 1,
  1039. WL1251_ACX_ACK_POLICY_BLOCK = 2,
  1040. };
  1041. struct wl1251_acx_tid_cfg {
  1042. struct acx_header header;
  1043. /* tx queue id number (0-7) */
  1044. u8 queue;
  1045. /* channel access type for the queue, enum wl1251_acx_channel_type */
  1046. u8 type;
  1047. /* EDCA: ac index (0-3), HCCA: traffic stream id (8-15) */
  1048. u8 tsid;
  1049. /* ps scheme of the specified queue, enum wl1251_acx_ps_scheme */
  1050. u8 ps_scheme;
  1051. /* the tx queue ack policy, enum wl1251_acx_ack_policy */
  1052. u8 ack_policy;
  1053. u8 padding[3];
  1054. /* not supported */
  1055. u32 apsdconf[2];
  1056. } __packed;
  1057. /*************************************************************************
  1058. Host Interrupt Register (WiLink -> Host)
  1059. **************************************************************************/
  1060. /* RX packet is ready in Xfer buffer #0 */
  1061. #define WL1251_ACX_INTR_RX0_DATA BIT(0)
  1062. /* TX result(s) are in the TX complete buffer */
  1063. #define WL1251_ACX_INTR_TX_RESULT BIT(1)
  1064. /* OBSOLETE */
  1065. #define WL1251_ACX_INTR_TX_XFR BIT(2)
  1066. /* RX packet is ready in Xfer buffer #1 */
  1067. #define WL1251_ACX_INTR_RX1_DATA BIT(3)
  1068. /* Event was entered to Event MBOX #A */
  1069. #define WL1251_ACX_INTR_EVENT_A BIT(4)
  1070. /* Event was entered to Event MBOX #B */
  1071. #define WL1251_ACX_INTR_EVENT_B BIT(5)
  1072. /* OBSOLETE */
  1073. #define WL1251_ACX_INTR_WAKE_ON_HOST BIT(6)
  1074. /* Trace message on MBOX #A */
  1075. #define WL1251_ACX_INTR_TRACE_A BIT(7)
  1076. /* Trace message on MBOX #B */
  1077. #define WL1251_ACX_INTR_TRACE_B BIT(8)
  1078. /* Command processing completion */
  1079. #define WL1251_ACX_INTR_CMD_COMPLETE BIT(9)
  1080. /* Init sequence is done */
  1081. #define WL1251_ACX_INTR_INIT_COMPLETE BIT(14)
  1082. #define WL1251_ACX_INTR_ALL 0xFFFFFFFF
  1083. enum {
  1084. ACX_WAKE_UP_CONDITIONS = 0x0002,
  1085. ACX_MEM_CFG = 0x0003,
  1086. ACX_SLOT = 0x0004,
  1087. ACX_QUEUE_HEAD = 0x0005, /* for MASTER mode only */
  1088. ACX_AC_CFG = 0x0007,
  1089. ACX_MEM_MAP = 0x0008,
  1090. ACX_AID = 0x000A,
  1091. ACX_RADIO_PARAM = 0x000B, /* Not used */
  1092. ACX_CFG = 0x000C, /* Not used */
  1093. ACX_FW_REV = 0x000D,
  1094. ACX_MEDIUM_USAGE = 0x000F,
  1095. ACX_RX_CFG = 0x0010,
  1096. ACX_TX_QUEUE_CFG = 0x0011, /* FIXME: only used by wl1251 */
  1097. ACX_BSS_IN_PS = 0x0012, /* for AP only */
  1098. ACX_STATISTICS = 0x0013, /* Debug API */
  1099. ACX_FEATURE_CFG = 0x0015,
  1100. ACX_MISC_CFG = 0x0017, /* Not used */
  1101. ACX_TID_CFG = 0x001A,
  1102. ACX_BEACON_FILTER_OPT = 0x001F,
  1103. ACX_LOW_RSSI = 0x0020,
  1104. ACX_NOISE_HIST = 0x0021,
  1105. ACX_HDK_VERSION = 0x0022, /* ??? */
  1106. ACX_PD_THRESHOLD = 0x0023,
  1107. ACX_DATA_PATH_PARAMS = 0x0024, /* WO */
  1108. ACX_DATA_PATH_RESP_PARAMS = 0x0024, /* RO */
  1109. ACX_CCA_THRESHOLD = 0x0025,
  1110. ACX_EVENT_MBOX_MASK = 0x0026,
  1111. #ifdef FW_RUNNING_AS_AP
  1112. ACX_DTIM_PERIOD = 0x0027, /* for AP only */
  1113. #else
  1114. ACX_WR_TBTT_AND_DTIM = 0x0027, /* STA only */
  1115. #endif
  1116. ACX_ACI_OPTION_CFG = 0x0029, /* OBSOLETE (for 1251)*/
  1117. ACX_GPIO_CFG = 0x002A, /* Not used */
  1118. ACX_GPIO_SET = 0x002B, /* Not used */
  1119. ACX_PM_CFG = 0x002C, /* To Be Documented */
  1120. ACX_CONN_MONIT_PARAMS = 0x002D,
  1121. ACX_AVERAGE_RSSI = 0x002E, /* Not used */
  1122. ACX_CONS_TX_FAILURE = 0x002F,
  1123. ACX_BCN_DTIM_OPTIONS = 0x0031,
  1124. ACX_SG_ENABLE = 0x0032,
  1125. ACX_SG_CFG = 0x0033,
  1126. ACX_ANTENNA_DIVERSITY_CFG = 0x0035, /* To Be Documented */
  1127. ACX_LOW_SNR = 0x0037, /* To Be Documented */
  1128. ACX_BEACON_FILTER_TABLE = 0x0038,
  1129. ACX_ARP_IP_FILTER = 0x0039,
  1130. ACX_ROAMING_STATISTICS_TBL = 0x003B,
  1131. ACX_RATE_POLICY = 0x003D,
  1132. ACX_CTS_PROTECTION = 0x003E,
  1133. ACX_SLEEP_AUTH = 0x003F,
  1134. ACX_PREAMBLE_TYPE = 0x0040,
  1135. ACX_ERROR_CNT = 0x0041,
  1136. ACX_FW_GEN_FRAME_RATES = 0x0042,
  1137. ACX_IBSS_FILTER = 0x0044,
  1138. ACX_SERVICE_PERIOD_TIMEOUT = 0x0045,
  1139. ACX_TSF_INFO = 0x0046,
  1140. ACX_CONFIG_PS_WMM = 0x0049,
  1141. ACX_ENABLE_RX_DATA_FILTER = 0x004A,
  1142. ACX_SET_RX_DATA_FILTER = 0x004B,
  1143. ACX_GET_DATA_FILTER_STATISTICS = 0x004C,
  1144. ACX_POWER_LEVEL_TABLE = 0x004D,
  1145. ACX_BET_ENABLE = 0x0050,
  1146. DOT11_STATION_ID = 0x1001,
  1147. DOT11_RX_MSDU_LIFE_TIME = 0x1004,
  1148. DOT11_CUR_TX_PWR = 0x100D,
  1149. DOT11_DEFAULT_KEY = 0x1010,
  1150. DOT11_RX_DOT11_MODE = 0x1012,
  1151. DOT11_RTS_THRESHOLD = 0x1013,
  1152. DOT11_GROUP_ADDRESS_TBL = 0x1014,
  1153. MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL,
  1154. MAX_IE = 0xFFFF
  1155. };
  1156. int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod,
  1157. u8 mgt_rate, u8 mgt_mod);
  1158. int wl1251_acx_station_id(struct wl1251 *wl);
  1159. int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id);
  1160. int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event,
  1161. u8 listen_interval);
  1162. int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth);
  1163. int wl1251_acx_fw_version(struct wl1251 *wl, char *buf, size_t len);
  1164. int wl1251_acx_tx_power(struct wl1251 *wl, int power);
  1165. int wl1251_acx_feature_cfg(struct wl1251 *wl, u32 data_flow_options);
  1166. int wl1251_acx_mem_map(struct wl1251 *wl,
  1167. struct acx_header *mem_map, size_t len);
  1168. int wl1251_acx_data_path_params(struct wl1251 *wl,
  1169. struct acx_data_path_params_resp *data_path);
  1170. int wl1251_acx_rx_msdu_life_time(struct wl1251 *wl, u32 life_time);
  1171. int wl1251_acx_rx_config(struct wl1251 *wl, u32 config, u32 filter);
  1172. int wl1251_acx_pd_threshold(struct wl1251 *wl);
  1173. int wl1251_acx_slot(struct wl1251 *wl, enum acx_slot_type slot_time);
  1174. int wl1251_acx_group_address_tbl(struct wl1251 *wl, bool enable,
  1175. void *mc_list, u32 mc_list_len);
  1176. int wl1251_acx_service_period_timeout(struct wl1251 *wl);
  1177. int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold);
  1178. int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter);
  1179. int wl1251_acx_beacon_filter_table(struct wl1251 *wl);
  1180. int wl1251_acx_conn_monit_params(struct wl1251 *wl);
  1181. int wl1251_acx_sg_enable(struct wl1251 *wl);
  1182. int wl1251_acx_sg_cfg(struct wl1251 *wl);
  1183. int wl1251_acx_cca_threshold(struct wl1251 *wl);
  1184. int wl1251_acx_bcn_dtim_options(struct wl1251 *wl);
  1185. int wl1251_acx_aid(struct wl1251 *wl, u16 aid);
  1186. int wl1251_acx_event_mbox_mask(struct wl1251 *wl, u32 event_mask);
  1187. int wl1251_acx_low_rssi(struct wl1251 *wl, s8 threshold, u8 weight,
  1188. u8 depth, enum wl1251_acx_low_rssi_type type);
  1189. int wl1251_acx_set_preamble(struct wl1251 *wl, enum acx_preamble_type preamble);
  1190. int wl1251_acx_cts_protect(struct wl1251 *wl,
  1191. enum acx_ctsprotect_type ctsprotect);
  1192. int wl1251_acx_statistics(struct wl1251 *wl, struct acx_statistics *stats);
  1193. int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime);
  1194. int wl1251_acx_rate_policies(struct wl1251 *wl);
  1195. int wl1251_acx_mem_cfg(struct wl1251 *wl);
  1196. int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim);
  1197. int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode,
  1198. u8 max_consecutive);
  1199. int wl1251_acx_arp_ip_filter(struct wl1251 *wl, bool enable, __be32 address);
  1200. int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
  1201. u8 aifs, u16 txop);
  1202. int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue,
  1203. enum wl1251_acx_channel_type type,
  1204. u8 tsid, enum wl1251_acx_ps_scheme ps_scheme,
  1205. enum wl1251_acx_ack_policy ack_policy);
  1206. #endif /* __WL1251_ACX_H__ */