acx.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  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 ADDRESS_GROUP_MAX (8)
  296. #define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * 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[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. struct wl1251_acx_ac_cfg {
  1000. struct acx_header header;
  1001. /*
  1002. * Access Category - The TX queue's access category
  1003. * (refer to AccessCategory_enum)
  1004. */
  1005. u8 ac;
  1006. /*
  1007. * The contention window minimum size (in slots) for
  1008. * the access class.
  1009. */
  1010. u8 cw_min;
  1011. /*
  1012. * The contention window maximum size (in slots) for
  1013. * the access class.
  1014. */
  1015. u16 cw_max;
  1016. /* The AIF value (in slots) for the access class. */
  1017. u8 aifsn;
  1018. u8 reserved;
  1019. /* The TX Op Limit (in microseconds) for the access class. */
  1020. u16 txop_limit;
  1021. } __packed;
  1022. enum wl1251_acx_channel_type {
  1023. CHANNEL_TYPE_DCF = 0,
  1024. CHANNEL_TYPE_EDCF = 1,
  1025. CHANNEL_TYPE_HCCA = 2,
  1026. };
  1027. enum wl1251_acx_ps_scheme {
  1028. /* regular ps: simple sending of packets */
  1029. WL1251_ACX_PS_SCHEME_LEGACY = 0,
  1030. /* sending a packet triggers a unscheduled apsd downstream */
  1031. WL1251_ACX_PS_SCHEME_UPSD_TRIGGER = 1,
  1032. /* a pspoll packet will be sent before every data packet */
  1033. WL1251_ACX_PS_SCHEME_LEGACY_PSPOLL = 2,
  1034. /* scheduled apsd mode */
  1035. WL1251_ACX_PS_SCHEME_SAPSD = 3,
  1036. };
  1037. enum wl1251_acx_ack_policy {
  1038. WL1251_ACX_ACK_POLICY_LEGACY = 0,
  1039. WL1251_ACX_ACK_POLICY_NO_ACK = 1,
  1040. WL1251_ACX_ACK_POLICY_BLOCK = 2,
  1041. };
  1042. struct wl1251_acx_tid_cfg {
  1043. struct acx_header header;
  1044. /* tx queue id number (0-7) */
  1045. u8 queue;
  1046. /* channel access type for the queue, enum wl1251_acx_channel_type */
  1047. u8 type;
  1048. /* EDCA: ac index (0-3), HCCA: traffic stream id (8-15) */
  1049. u8 tsid;
  1050. /* ps scheme of the specified queue, enum wl1251_acx_ps_scheme */
  1051. u8 ps_scheme;
  1052. /* the tx queue ack policy, enum wl1251_acx_ack_policy */
  1053. u8 ack_policy;
  1054. u8 padding[3];
  1055. /* not supported */
  1056. u32 apsdconf[2];
  1057. } __packed;
  1058. /*************************************************************************
  1059. Host Interrupt Register (WiLink -> Host)
  1060. **************************************************************************/
  1061. /* RX packet is ready in Xfer buffer #0 */
  1062. #define WL1251_ACX_INTR_RX0_DATA BIT(0)
  1063. /* TX result(s) are in the TX complete buffer */
  1064. #define WL1251_ACX_INTR_TX_RESULT BIT(1)
  1065. /* OBSOLETE */
  1066. #define WL1251_ACX_INTR_TX_XFR BIT(2)
  1067. /* RX packet is ready in Xfer buffer #1 */
  1068. #define WL1251_ACX_INTR_RX1_DATA BIT(3)
  1069. /* Event was entered to Event MBOX #A */
  1070. #define WL1251_ACX_INTR_EVENT_A BIT(4)
  1071. /* Event was entered to Event MBOX #B */
  1072. #define WL1251_ACX_INTR_EVENT_B BIT(5)
  1073. /* OBSOLETE */
  1074. #define WL1251_ACX_INTR_WAKE_ON_HOST BIT(6)
  1075. /* Trace message on MBOX #A */
  1076. #define WL1251_ACX_INTR_TRACE_A BIT(7)
  1077. /* Trace message on MBOX #B */
  1078. #define WL1251_ACX_INTR_TRACE_B BIT(8)
  1079. /* Command processing completion */
  1080. #define WL1251_ACX_INTR_CMD_COMPLETE BIT(9)
  1081. /* Init sequence is done */
  1082. #define WL1251_ACX_INTR_INIT_COMPLETE BIT(14)
  1083. #define WL1251_ACX_INTR_ALL 0xFFFFFFFF
  1084. enum {
  1085. ACX_WAKE_UP_CONDITIONS = 0x0002,
  1086. ACX_MEM_CFG = 0x0003,
  1087. ACX_SLOT = 0x0004,
  1088. ACX_QUEUE_HEAD = 0x0005, /* for MASTER mode only */
  1089. ACX_AC_CFG = 0x0007,
  1090. ACX_MEM_MAP = 0x0008,
  1091. ACX_AID = 0x000A,
  1092. ACX_RADIO_PARAM = 0x000B, /* Not used */
  1093. ACX_CFG = 0x000C, /* Not used */
  1094. ACX_FW_REV = 0x000D,
  1095. ACX_MEDIUM_USAGE = 0x000F,
  1096. ACX_RX_CFG = 0x0010,
  1097. ACX_TX_QUEUE_CFG = 0x0011, /* FIXME: only used by wl1251 */
  1098. ACX_BSS_IN_PS = 0x0012, /* for AP only */
  1099. ACX_STATISTICS = 0x0013, /* Debug API */
  1100. ACX_FEATURE_CFG = 0x0015,
  1101. ACX_MISC_CFG = 0x0017, /* Not used */
  1102. ACX_TID_CFG = 0x001A,
  1103. ACX_BEACON_FILTER_OPT = 0x001F,
  1104. ACX_LOW_RSSI = 0x0020,
  1105. ACX_NOISE_HIST = 0x0021,
  1106. ACX_HDK_VERSION = 0x0022, /* ??? */
  1107. ACX_PD_THRESHOLD = 0x0023,
  1108. ACX_DATA_PATH_PARAMS = 0x0024, /* WO */
  1109. ACX_DATA_PATH_RESP_PARAMS = 0x0024, /* RO */
  1110. ACX_CCA_THRESHOLD = 0x0025,
  1111. ACX_EVENT_MBOX_MASK = 0x0026,
  1112. #ifdef FW_RUNNING_AS_AP
  1113. ACX_DTIM_PERIOD = 0x0027, /* for AP only */
  1114. #else
  1115. ACX_WR_TBTT_AND_DTIM = 0x0027, /* STA only */
  1116. #endif
  1117. ACX_ACI_OPTION_CFG = 0x0029, /* OBSOLETE (for 1251)*/
  1118. ACX_GPIO_CFG = 0x002A, /* Not used */
  1119. ACX_GPIO_SET = 0x002B, /* Not used */
  1120. ACX_PM_CFG = 0x002C, /* To Be Documented */
  1121. ACX_CONN_MONIT_PARAMS = 0x002D,
  1122. ACX_AVERAGE_RSSI = 0x002E, /* Not used */
  1123. ACX_CONS_TX_FAILURE = 0x002F,
  1124. ACX_BCN_DTIM_OPTIONS = 0x0031,
  1125. ACX_SG_ENABLE = 0x0032,
  1126. ACX_SG_CFG = 0x0033,
  1127. ACX_ANTENNA_DIVERSITY_CFG = 0x0035, /* To Be Documented */
  1128. ACX_LOW_SNR = 0x0037, /* To Be Documented */
  1129. ACX_BEACON_FILTER_TABLE = 0x0038,
  1130. ACX_ARP_IP_FILTER = 0x0039,
  1131. ACX_ROAMING_STATISTICS_TBL = 0x003B,
  1132. ACX_RATE_POLICY = 0x003D,
  1133. ACX_CTS_PROTECTION = 0x003E,
  1134. ACX_SLEEP_AUTH = 0x003F,
  1135. ACX_PREAMBLE_TYPE = 0x0040,
  1136. ACX_ERROR_CNT = 0x0041,
  1137. ACX_FW_GEN_FRAME_RATES = 0x0042,
  1138. ACX_IBSS_FILTER = 0x0044,
  1139. ACX_SERVICE_PERIOD_TIMEOUT = 0x0045,
  1140. ACX_TSF_INFO = 0x0046,
  1141. ACX_CONFIG_PS_WMM = 0x0049,
  1142. ACX_ENABLE_RX_DATA_FILTER = 0x004A,
  1143. ACX_SET_RX_DATA_FILTER = 0x004B,
  1144. ACX_GET_DATA_FILTER_STATISTICS = 0x004C,
  1145. ACX_POWER_LEVEL_TABLE = 0x004D,
  1146. ACX_BET_ENABLE = 0x0050,
  1147. DOT11_STATION_ID = 0x1001,
  1148. DOT11_RX_MSDU_LIFE_TIME = 0x1004,
  1149. DOT11_CUR_TX_PWR = 0x100D,
  1150. DOT11_DEFAULT_KEY = 0x1010,
  1151. DOT11_RX_DOT11_MODE = 0x1012,
  1152. DOT11_RTS_THRESHOLD = 0x1013,
  1153. DOT11_GROUP_ADDRESS_TBL = 0x1014,
  1154. MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL,
  1155. MAX_IE = 0xFFFF
  1156. };
  1157. int wl1251_acx_frame_rates(struct wl1251 *wl, u8 ctrl_rate, u8 ctrl_mod,
  1158. u8 mgt_rate, u8 mgt_mod);
  1159. int wl1251_acx_station_id(struct wl1251 *wl);
  1160. int wl1251_acx_default_key(struct wl1251 *wl, u8 key_id);
  1161. int wl1251_acx_wake_up_conditions(struct wl1251 *wl, u8 wake_up_event,
  1162. u8 listen_interval);
  1163. int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth);
  1164. int wl1251_acx_fw_version(struct wl1251 *wl, char *buf, size_t len);
  1165. int wl1251_acx_tx_power(struct wl1251 *wl, int power);
  1166. int wl1251_acx_feature_cfg(struct wl1251 *wl);
  1167. int wl1251_acx_mem_map(struct wl1251 *wl,
  1168. struct acx_header *mem_map, size_t len);
  1169. int wl1251_acx_data_path_params(struct wl1251 *wl,
  1170. struct acx_data_path_params_resp *data_path);
  1171. int wl1251_acx_rx_msdu_life_time(struct wl1251 *wl, u32 life_time);
  1172. int wl1251_acx_rx_config(struct wl1251 *wl, u32 config, u32 filter);
  1173. int wl1251_acx_pd_threshold(struct wl1251 *wl);
  1174. int wl1251_acx_slot(struct wl1251 *wl, enum acx_slot_type slot_time);
  1175. int wl1251_acx_group_address_tbl(struct wl1251 *wl);
  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_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
  1200. u8 aifs, u16 txop);
  1201. int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue,
  1202. enum wl1251_acx_channel_type type,
  1203. u8 tsid, enum wl1251_acx_ps_scheme ps_scheme,
  1204. enum wl1251_acx_ack_policy ack_policy);
  1205. #endif /* __WL1251_ACX_H__ */