2 * This file is part of wl1251
4 * Copyright (c) 1998-2007 Texas Instruments Incorporated
5 * Copyright (C) 2008 Nokia Corporation
7 * Contact: Kalle Valo <kalle.valo@nokia.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 #ifndef __WL1251_ACX_H__
26 #define __WL1251_ACX_H__
29 #include "wl1251_cmd.h"
31 /* Target's information element */
33 struct wl1251_cmd_header cmd
;
35 /* acx (or information element) header */
38 /* payload length (not including headers */
42 struct acx_error_counter
{
43 struct acx_header header
;
45 /* The number of PLCP errors since the last time this */
46 /* information element was interrogated. This field is */
47 /* automatically cleared when it is interrogated.*/
50 /* The number of FCS errors since the last time this */
51 /* information element was interrogated. This field is */
52 /* automatically cleared when it is interrogated.*/
55 /* The number of MPDUs without PLCP header errors received*/
56 /* since the last time this information element was interrogated. */
57 /* This field is automatically cleared when it is interrogated.*/
60 /* the number of missed sequence numbers in the squentially */
61 /* values of frames seq numbers */
63 } __attribute__ ((packed
));
66 struct acx_header header
;
69 * The WiLink firmware version, an ASCII string x.x.x.x,
70 * that uniquely identifies the current firmware.
71 * The left most digit is incremented each time a
72 * significant change is made to the firmware, such as
73 * code redesign or new platform support.
74 * The second digit is incremented when major enhancements
75 * are added or major fixes are made.
76 * The third digit is incremented for each GA release.
77 * The fourth digit is incremented for each build.
78 * The first two digits identify a firmware release version,
79 * in other words, a unique set of features.
80 * The first three digits identify a GA release.
85 * This 4 byte field specifies the WiLink hardware version.
86 * bits 0 - 15: Reserved.
87 * bits 16 - 23: Version ID - The WiLink version ID
88 * (1 = first spin, 2 = second spin, and so on).
89 * bits 24 - 31: Chip ID - The WiLink chip ID.
92 } __attribute__ ((packed
));
94 enum wl1251_psm_mode
{
101 /* Extreme low power */
105 struct acx_sleep_auth
{
106 struct acx_header header
;
108 /* The sleep level authorization of the device. */
109 /* 0 - Always active*/
110 /* 1 - Power down mode: light / fast sleep*/
111 /* 2 - ELP mode: Deep / Max sleep*/
114 } __attribute__ ((packed
));
117 HOSTIF_PCI_MASTER_HOST_INDIRECT
,
118 HOSTIF_PCI_MASTER_HOST_DIRECT
,
121 HOSTIF_DONTCARE
= 0xFF
124 #define DEFAULT_UCAST_PRIORITY 0
125 #define DEFAULT_RX_Q_PRIORITY 0
126 #define DEFAULT_NUM_STATIONS 1
127 #define DEFAULT_RXQ_PRIORITY 0 /* low 0 .. 15 high */
128 #define DEFAULT_RXQ_TYPE 0x07 /* All frames, Data/Ctrl/Mgmt */
129 #define TRACE_BUFFER_MAX_SIZE 256
131 #define DP_RX_PACKET_RING_CHUNK_SIZE 1600
132 #define DP_TX_PACKET_RING_CHUNK_SIZE 1600
133 #define DP_RX_PACKET_RING_CHUNK_NUM 2
134 #define DP_TX_PACKET_RING_CHUNK_NUM 2
135 #define DP_TX_COMPLETE_TIME_OUT 20
136 #define FW_TX_CMPLT_BLOCK_SIZE 16
138 struct acx_data_path_params
{
139 struct acx_header header
;
141 u16 rx_packet_ring_chunk_size
;
142 u16 tx_packet_ring_chunk_size
;
144 u8 rx_packet_ring_chunk_num
;
145 u8 tx_packet_ring_chunk_num
;
148 * Maximum number of packets that can be gathered
149 * in the TX complete ring before an interrupt
152 u8 tx_complete_threshold
;
154 /* Number of pending TX complete entries in cyclic ring.*/
155 u8 tx_complete_ring_depth
;
158 * Max num microseconds since a packet enters the TX
159 * complete ring until an interrupt is generated.
161 u32 tx_complete_timeout
;
162 } __attribute__ ((packed
));
165 struct acx_data_path_params_resp
{
166 struct acx_header header
;
168 u16 rx_packet_ring_chunk_size
;
169 u16 tx_packet_ring_chunk_size
;
171 u8 rx_packet_ring_chunk_num
;
172 u8 tx_packet_ring_chunk_num
;
176 u32 rx_packet_ring_addr
;
177 u32 tx_packet_ring_addr
;
182 u32 tx_complete_addr
;
183 } __attribute__ ((packed
));
185 #define TX_MSDU_LIFETIME_MIN 0
186 #define TX_MSDU_LIFETIME_MAX 3000
187 #define TX_MSDU_LIFETIME_DEF 512
188 #define RX_MSDU_LIFETIME_MIN 0
189 #define RX_MSDU_LIFETIME_MAX 0xFFFFFFFF
190 #define RX_MSDU_LIFETIME_DEF 512000
192 struct acx_rx_msdu_lifetime
{
193 struct acx_header header
;
196 * The maximum amount of time, in TU, before the
197 * firmware discards the MSDU.
200 } __attribute__ ((packed
));
203 * RX Config Options Table
207 * 13 Copy RX Status - when set, write three receive status words
208 * to top of rx'd MPDUs.
209 * When cleared, do not write three status words (added rev 1.5)
211 * 11 RX Complete upon FCS error - when set, give rx complete
212 * interrupt for FCS errors, after the rx filtering, e.g. unicast
213 * frames not to us with FCS error will not generate an interrupt.
214 * 10 SSID Filter Enable - When set, the WiLink discards all beacon,
215 * probe request, and probe response frames with an SSID that does
216 * not match the SSID specified by the host in the START/JOIN
218 * When clear, the WiLink receives frames with any SSID.
219 * 9 Broadcast Filter Enable - When set, the WiLink discards all
220 * broadcast frames. When clear, the WiLink receives all received
223 * 5 BSSID Filter Enable - When set, the WiLink discards any frames
224 * with a BSSID that does not match the BSSID specified by the
226 * When clear, the WiLink receives frames from any BSSID.
227 * 4 MAC Addr Filter - When set, the WiLink discards any frames
228 * with a destination address that does not match the MAC address
230 * When clear, the WiLink receives frames destined to any MAC
232 * 3 Promiscuous - When set, the WiLink receives all valid frames
233 * (i.e., all frames that pass the FCS check).
234 * When clear, only frames that pass the other filters specified
236 * 2 FCS - When set, the WiLink includes the FCS with the received
238 * When cleared, the FCS is discarded.
239 * 1 PLCP header - When set, write all data from baseband to frame
240 * buffer including PHY header.
241 * 0 Reserved - Always equal to 0.
243 * RX Filter Options Table
246 * 31:12 Reserved - Always equal to 0.
247 * 11 Association - When set, the WiLink receives all association
248 * related frames (association request/response, reassocation
249 * request/response, and disassociation). When clear, these frames
251 * 10 Auth/De auth - When set, the WiLink receives all authentication
252 * and de-authentication frames. When clear, these frames are
254 * 9 Beacon - When set, the WiLink receives all beacon frames.
255 * When clear, these frames are discarded.
256 * 8 Contention Free - When set, the WiLink receives all contention
258 * When clear, these frames are discarded.
259 * 7 Control - When set, the WiLink receives all control frames.
260 * When clear, these frames are discarded.
261 * 6 Data - When set, the WiLink receives all data frames.
262 * When clear, these frames are discarded.
263 * 5 FCS Error - When set, the WiLink receives frames that have FCS
265 * When clear, these frames are discarded.
266 * 4 Management - When set, the WiLink receives all management
268 * When clear, these frames are discarded.
269 * 3 Probe Request - When set, the WiLink receives all probe request
271 * When clear, these frames are discarded.
272 * 2 Probe Response - When set, the WiLink receives all probe
274 * When clear, these frames are discarded.
275 * 1 RTS/CTS/ACK - When set, the WiLink receives all RTS, CTS and ACK
277 * When clear, these frames are discarded.
278 * 0 Rsvd Type/Sub Type - When set, the WiLink receives all frames
279 * that have reserved frame types and sub types as defined by the
280 * 802.11 specification.
281 * When clear, these frames are discarded.
283 struct acx_rx_config
{
284 struct acx_header header
;
288 } __attribute__ ((packed
));
295 QOS_HIGHEST_AC_INDEX
= QOS_AC_VO
,
298 #define MAX_NUM_OF_AC (QOS_HIGHEST_AC_INDEX+1)
299 #define FIRST_AC_INDEX QOS_AC_BE
300 #define MAX_NUM_OF_802_1d_TAGS 8
301 #define AC_PARAMS_MAX_TSID 15
302 #define MAX_APSD_CONF 0xffff
304 #define QOS_TX_HIGH_MIN (0)
305 #define QOS_TX_HIGH_MAX (100)
307 #define QOS_TX_HIGH_BK_DEF (25)
308 #define QOS_TX_HIGH_BE_DEF (35)
309 #define QOS_TX_HIGH_VI_DEF (35)
310 #define QOS_TX_HIGH_VO_DEF (35)
312 #define QOS_TX_LOW_BK_DEF (15)
313 #define QOS_TX_LOW_BE_DEF (25)
314 #define QOS_TX_LOW_VI_DEF (25)
315 #define QOS_TX_LOW_VO_DEF (25)
317 struct acx_tx_queue_qos_config
{
318 struct acx_header header
;
323 /* Max number of blocks allowd in the queue */
326 /* Lowest memory blocks guaranteed for this queue */
328 } __attribute__ ((packed
));
330 struct acx_packet_detection
{
331 struct acx_header header
;
334 } __attribute__ ((packed
));
340 DEFAULT_SLOT_TIME
= SLOT_TIME_SHORT
,
341 MAX_SLOT_TIMES
= 0xFF
344 #define STATION_WONE_INDEX 0
347 struct acx_header header
;
349 u8 wone_index
; /* Reserved */
352 } __attribute__ ((packed
));
355 #define ADDRESS_GROUP_MAX (8)
356 #define ADDRESS_GROUP_MAX_LEN (ETH_ALEN * ADDRESS_GROUP_MAX)
358 struct acx_dot11_grp_addr_tbl
{
359 struct acx_header header
;
364 u8 mac_table
[ADDRESS_GROUP_MAX_LEN
];
365 } __attribute__ ((packed
));
368 #define RX_TIMEOUT_PS_POLL_MIN 0
369 #define RX_TIMEOUT_PS_POLL_MAX (200000)
370 #define RX_TIMEOUT_PS_POLL_DEF (15)
371 #define RX_TIMEOUT_UPSD_MIN 0
372 #define RX_TIMEOUT_UPSD_MAX (200000)
373 #define RX_TIMEOUT_UPSD_DEF (15)
375 struct acx_rx_timeout
{
376 struct acx_header header
;
379 * The longest time the STA will wait to receive
380 * traffic from the AP after a PS-poll has been
386 * The longest time the STA will wait to receive
387 * traffic from the AP after a frame has been sent
388 * from an UPSD enabled queue.
391 } __attribute__ ((packed
));
393 #define RTS_THRESHOLD_MIN 0
394 #define RTS_THRESHOLD_MAX 4096
395 #define RTS_THRESHOLD_DEF 2347
397 struct acx_rts_threshold
{
398 struct acx_header header
;
402 } __attribute__ ((packed
));
404 struct acx_beacon_filter_option
{
405 struct acx_header header
;
410 * The number of beacons without the unicast TIM
411 * bit set that the firmware buffers before
412 * signaling the host about ready frames.
413 * When set to 0 and the filter is enabled, beacons
414 * without the unicast TIM bit set are dropped.
418 } __attribute__ ((packed
));
421 * ACXBeaconFilterEntry (not 221)
422 * Byte Offset Size (Bytes) Definition
423 * =========== ============ ==========
425 * 1 1 Treatment bit mask
427 * ACXBeaconFilterEntry (221)
428 * Byte Offset Size (Bytes) Definition
429 * =========== ============ ==========
431 * 1 1 Treatment bit mask
437 * Treatment bit mask - The information element handling:
438 * bit 0 - The information element is compared and transferred
440 * bit 1 - The information element is transferred to the host
441 * with each appearance or disappearance.
442 * Note that both bits can be set at the same time.
444 #define BEACON_FILTER_TABLE_MAX_IE_NUM (32)
445 #define BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM (6)
446 #define BEACON_FILTER_TABLE_IE_ENTRY_SIZE (2)
447 #define BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE (6)
448 #define BEACON_FILTER_TABLE_MAX_SIZE ((BEACON_FILTER_TABLE_MAX_IE_NUM * \
449 BEACON_FILTER_TABLE_IE_ENTRY_SIZE) + \
450 (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
451 BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))
453 struct acx_beacon_filter_ie_table
{
454 struct acx_header header
;
457 u8 table
[BEACON_FILTER_TABLE_MAX_SIZE
];
459 } __attribute__ ((packed
));
464 SG_SENSE_NO_ACTIVITY
,
468 struct acx_bt_wlan_coex
{
469 struct acx_header header
;
474 * 2 -> sense no active mode, i.e.
475 * an interrupt is sent upon
477 * 3 -> PTA is switched on in response
478 * to the interrupt sending.
482 } __attribute__ ((packed
));
484 #define PTA_ANTENNA_TYPE_DEF (0)
485 #define PTA_BT_HP_MAXTIME_DEF (2000)
486 #define PTA_WLAN_HP_MAX_TIME_DEF (5000)
487 #define PTA_SENSE_DISABLE_TIMER_DEF (1350)
488 #define PTA_PROTECTIVE_RX_TIME_DEF (1500)
489 #define PTA_PROTECTIVE_TX_TIME_DEF (1500)
490 #define PTA_TIMEOUT_NEXT_BT_LP_PACKET_DEF (3000)
491 #define PTA_SIGNALING_TYPE_DEF (1)
492 #define PTA_AFH_LEVERAGE_ON_DEF (0)
493 #define PTA_NUMBER_QUIET_CYCLE_DEF (0)
494 #define PTA_MAX_NUM_CTS_DEF (3)
495 #define PTA_NUMBER_OF_WLAN_PACKETS_DEF (2)
496 #define PTA_NUMBER_OF_BT_PACKETS_DEF (2)
497 #define PTA_PROTECTIVE_RX_TIME_FAST_DEF (1500)
498 #define PTA_PROTECTIVE_TX_TIME_FAST_DEF (3000)
499 #define PTA_CYCLE_TIME_FAST_DEF (8700)
500 #define PTA_RX_FOR_AVALANCHE_DEF (5)
501 #define PTA_ELP_HP_DEF (0)
502 #define PTA_ANTI_STARVE_PERIOD_DEF (500)
503 #define PTA_ANTI_STARVE_NUM_CYCLE_DEF (4)
504 #define PTA_ALLOW_PA_SD_DEF (1)
505 #define PTA_TIME_BEFORE_BEACON_DEF (6300)
506 #define PTA_HPDM_MAX_TIME_DEF (1600)
507 #define PTA_TIME_OUT_NEXT_WLAN_DEF (2550)
508 #define PTA_AUTO_MODE_NO_CTS_DEF (0)
509 #define PTA_BT_HP_RESPECTED_DEF (3)
510 #define PTA_WLAN_RX_MIN_RATE_DEF (24)
511 #define PTA_ACK_MODE_DEF (1)
513 struct acx_bt_wlan_coex_param
{
514 struct acx_header header
;
517 * The minimum rate of a received WLAN packet in the STA,
518 * during protective mode, of which a new BT-HP request
519 * during this Rx will always be respected and gain the antenna.
523 /* Max time the BT HP will be respected. */
526 /* Max time the WLAN HP will be respected. */
527 u16 wlan_hp_max_time
;
530 * The time between the last BT activity
531 * and the moment when the sense mode returns
534 u16 sense_disable_timer
;
536 /* Time before the next BT HP instance */
540 /* range: 10-20000 default: 1500 */
541 u16 rx_time_bt_hp_fast
;
542 u16 tx_time_bt_hp_fast
;
544 /* range: 2000-65535 default: 8700 */
547 /* range: 0 - 15000 (Msec) default: 1000 */
548 u16 bt_anti_starvation_period
;
550 /* range 400-10000(Usec) default: 3000 */
551 u16 next_bt_lp_packet
;
553 /* Deafult: worst case for BT DH5 traffic */
556 /* range: 0-50000(Usec) default: 1050 */
557 u16 hp_dm_max_guard_time
;
560 * This is to prevent both BT & WLAN antenna
562 * Range: 100-50000(Usec) default:2550
564 u16 next_wlan_packet
;
566 /* 0 -> shared antenna */
578 * 1 -> from dedicated GPIO
579 * 2 -> AFH on (from host)
584 * The number of cycles during which no
585 * TX will be sent after 1 cycle of RX
586 * transaction in protective mode
591 * The maximum number of CTSs that will
592 * be sent for receiving RX packet in
598 * The number of WLAN packets
599 * transferred in common mode before
605 * The number of BT packets
606 * transferred in common mode before
611 /* range: 1-255 default: 5 */
612 u8 missed_rx_avalanche
;
614 /* range: 0-1 default: 1 */
617 /* range: 0 - 15 default: 4 */
618 u8 bt_anti_starvation_cycles
;
620 u8 ack_mode_dual_ant
;
623 * Allow PA_SD assertion/de-assertion
624 * during enabled BT activity.
629 * Enable/Disable PTA in auto mode:
630 * Support Both Active & P.S modes
632 u8 pta_auto_mode_enable
;
634 /* range: 0 - 20 default: 1 */
635 u8 bt_hp_respected_num
;
636 } __attribute__ ((packed
));
638 #define CCA_THRSH_ENABLE_ENERGY_D 0x140A
639 #define CCA_THRSH_DISABLE_ENERGY_D 0xFFEF
641 struct acx_energy_detection
{
642 struct acx_header header
;
644 /* The RX Clear Channel Assessment threshold in the PHY */
645 u16 rx_cca_threshold
;
646 u8 tx_energy_detection
;
648 } __attribute__ ((packed
));
650 #define BCN_RX_TIMEOUT_DEF_VALUE 10000
651 #define BROADCAST_RX_TIMEOUT_DEF_VALUE 20000
652 #define RX_BROADCAST_IN_PS_DEF_VALUE 1
653 #define CONSECUTIVE_PS_POLL_FAILURE_DEF 4
655 struct acx_beacon_broadcast
{
656 struct acx_header header
;
658 u16 beacon_rx_timeout
;
659 u16 broadcast_timeout
;
661 /* Enables receiving of broadcast packets in PS mode */
662 u8 rx_broadcast_in_ps
;
664 /* Consecutive PS Poll failures before updating the host */
665 u8 ps_poll_threshold
;
667 } __attribute__ ((packed
));
669 struct acx_event_mask
{
670 struct acx_header header
;
673 u32 high_event_mask
; /* Unused */
674 } __attribute__ ((packed
));
676 #define CFG_RX_FCS BIT(2)
677 #define CFG_RX_ALL_GOOD BIT(3)
678 #define CFG_UNI_FILTER_EN BIT(4)
679 #define CFG_BSSID_FILTER_EN BIT(5)
680 #define CFG_MC_FILTER_EN BIT(6)
681 #define CFG_MC_ADDR0_EN BIT(7)
682 #define CFG_MC_ADDR1_EN BIT(8)
683 #define CFG_BC_REJECT_EN BIT(9)
684 #define CFG_SSID_FILTER_EN BIT(10)
685 #define CFG_RX_INT_FCS_ERROR BIT(11)
686 #define CFG_RX_INT_ENCRYPTED BIT(12)
687 #define CFG_RX_WR_RX_STATUS BIT(13)
688 #define CFG_RX_FILTER_NULTI BIT(14)
689 #define CFG_RX_RESERVE BIT(15)
690 #define CFG_RX_TIMESTAMP_TSF BIT(16)
692 #define CFG_RX_RSV_EN BIT(0)
693 #define CFG_RX_RCTS_ACK BIT(1)
694 #define CFG_RX_PRSP_EN BIT(2)
695 #define CFG_RX_PREQ_EN BIT(3)
696 #define CFG_RX_MGMT_EN BIT(4)
697 #define CFG_RX_FCS_ERROR BIT(5)
698 #define CFG_RX_DATA_EN BIT(6)
699 #define CFG_RX_CTL_EN BIT(7)
700 #define CFG_RX_CF_EN BIT(8)
701 #define CFG_RX_BCN_EN BIT(9)
702 #define CFG_RX_AUTH_EN BIT(10)
703 #define CFG_RX_ASSOC_EN BIT(11)
705 #define SCAN_PASSIVE BIT(0)
706 #define SCAN_5GHZ_BAND BIT(1)
707 #define SCAN_TRIGGERED BIT(2)
708 #define SCAN_PRIORITY_HIGH BIT(3)
710 struct acx_fw_gen_frame_rates
{
711 struct acx_header header
;
713 u8 tx_ctrl_frame_rate
; /* RATE_* */
714 u8 tx_ctrl_frame_mod
; /* CCK_* or PBCC_* */
715 u8 tx_mgt_frame_rate
;
717 } __attribute__ ((packed
));
720 struct acx_dot11_station_id
{
721 struct acx_header header
;
725 } __attribute__ ((packed
));
727 struct acx_feature_config
{
728 struct acx_header header
;
731 u32 data_flow_options
;
732 } __attribute__ ((packed
));
734 struct acx_current_tx_power
{
735 struct acx_header header
;
739 } __attribute__ ((packed
));
741 struct acx_dot11_default_key
{
742 struct acx_header header
;
746 } __attribute__ ((packed
));
748 struct acx_tsf_info
{
749 struct acx_header header
;
757 } __attribute__ ((packed
));
759 enum acx_wake_up_event
{
760 WAKE_UP_EVENT_BEACON_BITMAP
= 0x01, /* Wake on every Beacon*/
761 WAKE_UP_EVENT_DTIM_BITMAP
= 0x02, /* Wake on every DTIM*/
762 WAKE_UP_EVENT_N_DTIM_BITMAP
= 0x04, /* Wake on every Nth DTIM */
763 WAKE_UP_EVENT_N_BEACONS_BITMAP
= 0x08, /* Wake on every Nth Beacon */
764 WAKE_UP_EVENT_BITS_MASK
= 0x0F
767 struct acx_wake_up_condition
{
768 struct acx_header header
;
770 u8 wake_up_event
; /* Only one bit can be set */
773 } __attribute__ ((packed
));
776 struct acx_header header
;
779 * To be set when associated with an AP.
783 } __attribute__ ((packed
));
785 enum acx_preamble_type
{
786 ACX_PREAMBLE_LONG
= 0,
787 ACX_PREAMBLE_SHORT
= 1
790 struct acx_preamble
{
791 struct acx_header header
;
794 * When set, the WiLink transmits the frames with a short preamble and
795 * when cleared, the WiLink transmits the frames with a long preamble.
799 } __attribute__ ((packed
));
801 enum acx_ctsprotect_type
{
802 CTSPROTECT_DISABLE
= 0,
803 CTSPROTECT_ENABLE
= 1
806 struct acx_ctsprotect
{
807 struct acx_header header
;
810 } __attribute__ ((packed
));
812 struct acx_tx_statistics
{
813 u32 internal_desc_overflow
;
814 } __attribute__ ((packed
));
816 struct acx_rx_statistics
{
825 } __attribute__ ((packed
));
827 struct acx_dma_statistics
{
832 } __attribute__ ((packed
));
834 struct acx_isr_statistics
{
835 /* host command complete */
841 /* (INT_STS_ND & INT_TRIG_RX_HEADER) */
844 /* (INT_STS_ND & INT_TRIG_RX_CMPLT) */
847 /* (INT_STS_ND & INT_TRIG_NO_RX_BUF) */
850 /* (INT_STS_ND & INT_TRIG_S_RX_RDY) */
856 /* (INT_STS_ND & INT_TRIG_TX_PROC) */
859 /* (INT_STS_ND & INT_TRIG_DECRYPT_DONE) */
862 /* (INT_STS_ND & INT_TRIG_DMA0) */
865 /* (INT_STS_ND & INT_TRIG_DMA1) */
868 /* (INT_STS_ND & INT_TRIG_TX_EXC_CMPLT) */
869 u32 tx_exch_complete
;
871 /* (INT_STS_ND & INT_TRIG_COMMAND) */
874 /* (INT_STS_ND & INT_TRIG_RX_PROC) */
877 /* (INT_STS_ND & INT_TRIG_PM_802) */
878 u32 hw_pm_mode_changes
;
880 /* (INT_STS_ND & INT_TRIG_ACKNOWLEDGE) */
881 u32 host_acknowledges
;
883 /* (INT_STS_ND & INT_TRIG_PM_PCI) */
886 /* (INT_STS_ND & INT_TRIG_ACM_WAKEUP) */
889 /* (INT_STS_ND & INT_TRIG_LOW_RSSI) */
891 } __attribute__ ((packed
));
893 struct acx_wep_statistics
{
894 /* WEP address keys configured */
897 /* default keys configured */
898 u32 default_key_count
;
902 /* number of times that WEP key not found on lookup */
905 /* number of times that WEP key decryption failed */
908 /* WEP packets decrypted */
911 /* WEP decrypt interrupts */
913 } __attribute__ ((packed
));
915 #define ACX_MISSED_BEACONS_SPREAD 10
917 struct acx_pwr_statistics
{
918 /* the amount of enters into power save mode (both PD & ELP) */
921 /* the amount of enters into ELP mode */
924 /* the amount of missing beacon interrupts to the host */
927 /* the amount of wake on host-access times */
930 /* the amount of wake on timer-expire */
931 u32 wake_on_timer_exp
;
933 /* the number of packets that were transmitted with PS bit set */
936 /* the number of packets that were transmitted with PS bit clear */
939 /* the number of received beacons */
942 /* the number of entering into PowerOn (power save off) */
945 /* the number of entries into power save mode */
949 * the number of exits from power save, not including failed PS
955 * the number of times the TSF counter was adjusted because
960 /* Gives statistics about the spread continuous missed beacons.
961 * The 16 LSB are dedicated for the PS mode.
962 * The 16 MSB are dedicated for the PS mode.
963 * cont_miss_bcns_spread[0] - single missed beacon.
964 * cont_miss_bcns_spread[1] - two continuous missed beacons.
965 * cont_miss_bcns_spread[2] - three continuous missed beacons.
967 * cont_miss_bcns_spread[9] - ten and more continuous missed beacons.
969 u32 cont_miss_bcns_spread
[ACX_MISSED_BEACONS_SPREAD
];
971 /* the number of beacons in awake mode */
972 u32 rcvd_awake_beacons
;
973 } __attribute__ ((packed
));
975 struct acx_mic_statistics
{
978 } __attribute__ ((packed
));
980 struct acx_aes_statistics
{
985 u32 encrypt_interrupt
;
986 u32 decrypt_interrupt
;
987 } __attribute__ ((packed
));
989 struct acx_event_statistics
{
996 u32 phy_transmit_error
;
998 } __attribute__ ((packed
));
1000 struct acx_ps_statistics
{
1001 u32 pspoll_timeouts
;
1003 u32 upsd_max_sptime
;
1004 u32 upsd_max_apturn
;
1005 u32 pspoll_max_apturn
;
1006 u32 pspoll_utilization
;
1007 u32 upsd_utilization
;
1008 } __attribute__ ((packed
));
1010 struct acx_rxpipe_statistics
{
1011 u32 rx_prep_beacon_drop
;
1012 u32 descr_host_int_trig_rx_data
;
1013 u32 beacon_buffer_thres_host_int_trig_rx_data
;
1014 u32 missed_beacon_host_int_trig_rx_data
;
1015 u32 tx_xfr_host_int_trig_rx_data
;
1016 } __attribute__ ((packed
));
1018 struct acx_statistics
{
1019 struct acx_header header
;
1021 struct acx_tx_statistics tx
;
1022 struct acx_rx_statistics rx
;
1023 struct acx_dma_statistics dma
;
1024 struct acx_isr_statistics isr
;
1025 struct acx_wep_statistics wep
;
1026 struct acx_pwr_statistics pwr
;
1027 struct acx_aes_statistics aes
;
1028 struct acx_mic_statistics mic
;
1029 struct acx_event_statistics event
;
1030 struct acx_ps_statistics ps
;
1031 struct acx_rxpipe_statistics rxpipe
;
1032 } __attribute__ ((packed
));
1034 #define ACX_MAX_RATE_CLASSES 8
1035 #define ACX_RATE_MASK_UNSPECIFIED 0
1036 #define ACX_RATE_RETRY_LIMIT 10
1038 struct acx_rate_class
{
1040 u8 short_retry_limit
;
1041 u8 long_retry_limit
;
1046 struct acx_rate_policy
{
1047 struct acx_header header
;
1050 struct acx_rate_class rate_class
[ACX_MAX_RATE_CLASSES
];
1051 } __attribute__ ((packed
));
1053 struct wl1251_acx_memory
{
1054 __le16 num_stations
; /* number of STAs to be supported. */
1058 * Nmber of memory buffers for the RX mem pool.
1059 * The actual number may be less if there are
1060 * not enough blocks left for the minimum num
1063 u8 rx_mem_block_num
;
1065 u8 num_tx_queues
; /* From 1 to 16 */
1066 u8 host_if_options
; /* HOST_IF* */
1067 u8 tx_min_mem_block_num
;
1068 u8 num_ssid_profiles
;
1069 __le16 debug_buffer_size
;
1070 } __attribute__ ((packed
));
1073 #define ACX_RX_DESC_MIN 1
1074 #define ACX_RX_DESC_MAX 127
1075 #define ACX_RX_DESC_DEF 32
1076 struct wl1251_acx_rx_queue_config
{
1082 } __attribute__ ((packed
));
1084 #define ACX_TX_DESC_MIN 1
1085 #define ACX_TX_DESC_MAX 127
1086 #define ACX_TX_DESC_DEF 16
1087 struct wl1251_acx_tx_queue_config
{
1091 } __attribute__ ((packed
));
1093 #define MAX_TX_QUEUE_CONFIGS 5
1094 #define MAX_TX_QUEUES 4
1095 struct wl1251_acx_config_memory
{
1096 struct acx_header header
;
1098 struct wl1251_acx_memory mem_config
;
1099 struct wl1251_acx_rx_queue_config rx_queue_config
;
1100 struct wl1251_acx_tx_queue_config tx_queue_config
[MAX_TX_QUEUE_CONFIGS
];
1101 } __attribute__ ((packed
));
1103 struct wl1251_acx_mem_map
{
1104 struct acx_header header
;
1109 void *wep_defkey_start
;
1110 void *wep_defkey_end
;
1112 void *sta_table_start
;
1113 void *sta_table_end
;
1115 void *packet_template_start
;
1116 void *packet_template_end
;
1118 void *queue_memory_start
;
1119 void *queue_memory_end
;
1121 void *packet_memory_pool_start
;
1122 void *packet_memory_pool_end
;
1124 void *debug_buffer1_start
;
1125 void *debug_buffer1_end
;
1127 void *debug_buffer2_start
;
1128 void *debug_buffer2_end
;
1130 /* Number of blocks FW allocated for TX packets */
1131 u32 num_tx_mem_blocks
;
1133 /* Number of blocks FW allocated for RX packets */
1134 u32 num_rx_mem_blocks
;
1135 } __attribute__ ((packed
));
1137 /*************************************************************************
1139 Host Interrupt Register (WiLink -> Host)
1141 **************************************************************************/
1143 /* RX packet is ready in Xfer buffer #0 */
1144 #define WL1251_ACX_INTR_RX0_DATA BIT(0)
1146 /* TX result(s) are in the TX complete buffer */
1147 #define WL1251_ACX_INTR_TX_RESULT BIT(1)
1150 #define WL1251_ACX_INTR_TX_XFR BIT(2)
1152 /* RX packet is ready in Xfer buffer #1 */
1153 #define WL1251_ACX_INTR_RX1_DATA BIT(3)
1155 /* Event was entered to Event MBOX #A */
1156 #define WL1251_ACX_INTR_EVENT_A BIT(4)
1158 /* Event was entered to Event MBOX #B */
1159 #define WL1251_ACX_INTR_EVENT_B BIT(5)
1162 #define WL1251_ACX_INTR_WAKE_ON_HOST BIT(6)
1164 /* Trace meassge on MBOX #A */
1165 #define WL1251_ACX_INTR_TRACE_A BIT(7)
1167 /* Trace meassge on MBOX #B */
1168 #define WL1251_ACX_INTR_TRACE_B BIT(8)
1170 /* Command processing completion */
1171 #define WL1251_ACX_INTR_CMD_COMPLETE BIT(9)
1173 /* Init sequence is done */
1174 #define WL1251_ACX_INTR_INIT_COMPLETE BIT(14)
1176 #define WL1251_ACX_INTR_ALL 0xFFFFFFFF
1179 ACX_WAKE_UP_CONDITIONS
= 0x0002,
1180 ACX_MEM_CFG
= 0x0003,
1182 ACX_QUEUE_HEAD
= 0x0005, /* for MASTER mode only */
1183 ACX_AC_CFG
= 0x0007,
1184 ACX_MEM_MAP
= 0x0008,
1186 ACX_RADIO_PARAM
= 0x000B, /* Not used */
1187 ACX_CFG
= 0x000C, /* Not used */
1188 ACX_FW_REV
= 0x000D,
1189 ACX_MEDIUM_USAGE
= 0x000F,
1190 ACX_RX_CFG
= 0x0010,
1191 ACX_TX_QUEUE_CFG
= 0x0011, /* FIXME: only used by wl1251 */
1192 ACX_BSS_IN_PS
= 0x0012, /* for AP only */
1193 ACX_STATISTICS
= 0x0013, /* Debug API */
1194 ACX_FEATURE_CFG
= 0x0015,
1195 ACX_MISC_CFG
= 0x0017, /* Not used */
1196 ACX_TID_CFG
= 0x001A,
1197 ACX_BEACON_FILTER_OPT
= 0x001F,
1198 ACX_LOW_RSSI
= 0x0020,
1199 ACX_NOISE_HIST
= 0x0021,
1200 ACX_HDK_VERSION
= 0x0022, /* ??? */
1201 ACX_PD_THRESHOLD
= 0x0023,
1202 ACX_DATA_PATH_PARAMS
= 0x0024, /* WO */
1203 ACX_DATA_PATH_RESP_PARAMS
= 0x0024, /* RO */
1204 ACX_CCA_THRESHOLD
= 0x0025,
1205 ACX_EVENT_MBOX_MASK
= 0x0026,
1206 #ifdef FW_RUNNING_AS_AP
1207 ACX_DTIM_PERIOD
= 0x0027, /* for AP only */
1209 ACX_WR_TBTT_AND_DTIM
= 0x0027, /* STA only */
1211 ACX_ACI_OPTION_CFG
= 0x0029, /* OBSOLETE (for 1251)*/
1212 ACX_GPIO_CFG
= 0x002A, /* Not used */
1213 ACX_GPIO_SET
= 0x002B, /* Not used */
1214 ACX_PM_CFG
= 0x002C, /* To Be Documented */
1215 ACX_CONN_MONIT_PARAMS
= 0x002D,
1216 ACX_AVERAGE_RSSI
= 0x002E, /* Not used */
1217 ACX_CONS_TX_FAILURE
= 0x002F,
1218 ACX_BCN_DTIM_OPTIONS
= 0x0031,
1219 ACX_SG_ENABLE
= 0x0032,
1220 ACX_SG_CFG
= 0x0033,
1221 ACX_ANTENNA_DIVERSITY_CFG
= 0x0035, /* To Be Documented */
1222 ACX_LOW_SNR
= 0x0037, /* To Be Documented */
1223 ACX_BEACON_FILTER_TABLE
= 0x0038,
1224 ACX_ARP_IP_FILTER
= 0x0039,
1225 ACX_ROAMING_STATISTICS_TBL
= 0x003B,
1226 ACX_RATE_POLICY
= 0x003D,
1227 ACX_CTS_PROTECTION
= 0x003E,
1228 ACX_SLEEP_AUTH
= 0x003F,
1229 ACX_PREAMBLE_TYPE
= 0x0040,
1230 ACX_ERROR_CNT
= 0x0041,
1231 ACX_FW_GEN_FRAME_RATES
= 0x0042,
1232 ACX_IBSS_FILTER
= 0x0044,
1233 ACX_SERVICE_PERIOD_TIMEOUT
= 0x0045,
1234 ACX_TSF_INFO
= 0x0046,
1235 ACX_CONFIG_PS_WMM
= 0x0049,
1236 ACX_ENABLE_RX_DATA_FILTER
= 0x004A,
1237 ACX_SET_RX_DATA_FILTER
= 0x004B,
1238 ACX_GET_DATA_FILTER_STATISTICS
= 0x004C,
1239 ACX_POWER_LEVEL_TABLE
= 0x004D,
1240 ACX_BET_ENABLE
= 0x0050,
1241 DOT11_STATION_ID
= 0x1001,
1242 DOT11_RX_MSDU_LIFE_TIME
= 0x1004,
1243 DOT11_CUR_TX_PWR
= 0x100D,
1244 DOT11_DEFAULT_KEY
= 0x1010,
1245 DOT11_RX_DOT11_MODE
= 0x1012,
1246 DOT11_RTS_THRESHOLD
= 0x1013,
1247 DOT11_GROUP_ADDRESS_TBL
= 0x1014,
1249 MAX_DOT11_IE
= DOT11_GROUP_ADDRESS_TBL
,
1255 int wl1251_acx_frame_rates(struct wl1251
*wl
, u8 ctrl_rate
, u8 ctrl_mod
,
1256 u8 mgt_rate
, u8 mgt_mod
);
1257 int wl1251_acx_station_id(struct wl1251
*wl
);
1258 int wl1251_acx_default_key(struct wl1251
*wl
, u8 key_id
);
1259 int wl1251_acx_wake_up_conditions(struct wl1251
*wl
, u8 wake_up_event
,
1260 u8 listen_interval
);
1261 int wl1251_acx_sleep_auth(struct wl1251
*wl
, u8 sleep_auth
);
1262 int wl1251_acx_fw_version(struct wl1251
*wl
, char *buf
, size_t len
);
1263 int wl1251_acx_tx_power(struct wl1251
*wl
, int power
);
1264 int wl1251_acx_feature_cfg(struct wl1251
*wl
);
1265 int wl1251_acx_mem_map(struct wl1251
*wl
,
1266 struct acx_header
*mem_map
, size_t len
);
1267 int wl1251_acx_data_path_params(struct wl1251
*wl
,
1268 struct acx_data_path_params_resp
*data_path
);
1269 int wl1251_acx_rx_msdu_life_time(struct wl1251
*wl
, u32 life_time
);
1270 int wl1251_acx_rx_config(struct wl1251
*wl
, u32 config
, u32 filter
);
1271 int wl1251_acx_pd_threshold(struct wl1251
*wl
);
1272 int wl1251_acx_slot(struct wl1251
*wl
, enum acx_slot_type slot_time
);
1273 int wl1251_acx_group_address_tbl(struct wl1251
*wl
);
1274 int wl1251_acx_service_period_timeout(struct wl1251
*wl
);
1275 int wl1251_acx_rts_threshold(struct wl1251
*wl
, u16 rts_threshold
);
1276 int wl1251_acx_beacon_filter_opt(struct wl1251
*wl
);
1277 int wl1251_acx_beacon_filter_table(struct wl1251
*wl
);
1278 int wl1251_acx_sg_enable(struct wl1251
*wl
);
1279 int wl1251_acx_sg_cfg(struct wl1251
*wl
);
1280 int wl1251_acx_cca_threshold(struct wl1251
*wl
);
1281 int wl1251_acx_bcn_dtim_options(struct wl1251
*wl
);
1282 int wl1251_acx_aid(struct wl1251
*wl
, u16 aid
);
1283 int wl1251_acx_event_mbox_mask(struct wl1251
*wl
, u32 event_mask
);
1284 int wl1251_acx_set_preamble(struct wl1251
*wl
, enum acx_preamble_type preamble
);
1285 int wl1251_acx_cts_protect(struct wl1251
*wl
,
1286 enum acx_ctsprotect_type ctsprotect
);
1287 int wl1251_acx_statistics(struct wl1251
*wl
, struct acx_statistics
*stats
);
1288 int wl1251_acx_tsf_info(struct wl1251
*wl
, u64
*mactime
);
1289 int wl1251_acx_rate_policies(struct wl1251
*wl
);
1290 int wl1251_acx_mem_cfg(struct wl1251
*wl
);
1292 #endif /* __WL1251_ACX_H__ */