acx.h 38 KB

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