2 * This file is part of wl18xx
4 * Copyright (C) 2011 Texas Instruments Inc.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 #ifndef __WL18XX_PRIV_H__
23 #define __WL18XX_PRIV_H__
27 /* minimum FW required for driver */
28 #define WL18XX_CHIP_VER 8
29 #define WL18XX_IFTYPE_VER 9
30 #define WL18XX_MAJOR_VER WLCORE_FW_VER_IGNORE
31 #define WL18XX_SUBTYPE_VER WLCORE_FW_VER_IGNORE
32 #define WL18XX_MINOR_VER 11
34 #define WL18XX_CMD_MAX_SIZE 740
36 #define WL18XX_AGGR_BUFFER_SIZE (13 * PAGE_SIZE)
38 #define WL18XX_NUM_TX_DESCRIPTORS 32
39 #define WL18XX_NUM_RX_DESCRIPTORS 32
41 #define WL18XX_NUM_MAC_ADDRESSES 2
43 #define WL18XX_RX_BA_MAX_SESSIONS 13
45 #define WL18XX_MAX_AP_STATIONS 10
46 #define WL18XX_MAX_LINKS 16
49 /* buffer for sending commands to FW */
50 u8 cmd_buf
[WL18XX_CMD_MAX_SIZE
];
52 struct wl18xx_priv_conf conf
;
54 /* Index of last released Tx desc in FW */
57 /* number of keys requiring extra spare mem-blocks */
58 int extra_spare_key_count
;
61 #define WL18XX_FW_MAX_TX_STATUS_DESC 33
63 struct wl18xx_fw_status_priv
{
65 * Index in released_tx_desc for first byte that holds
66 * released tx host desc
71 * Array of host Tx descriptors, where fw_release_idx
72 * indicated the first released idx.
74 u8 released_tx_desc
[WL18XX_FW_MAX_TX_STATUS_DESC
];
76 /* A bitmap representing the currently suspended links. The suspend
77 * is short lived, for multi-channel Tx requirements.
79 __le32 link_suspend_bitmap
;
81 /* packet threshold for an "almost empty" AC,
82 * for Tx schedulng purposes
86 /* number of packets to queue up for a link in PS */
89 /* number of packet to queue up for a suspended link */
90 u8 tx_suspend_threshold
;
92 /* Should have less than this number of packets in queue of a slow
93 * link to qualify as high priority link
95 u8 tx_slow_link_prio_threshold
;
97 /* Should have less than this number of packets in queue of a fast
98 * link to qualify as high priority link
100 u8 tx_fast_link_prio_threshold
;
102 /* Should have less than this number of packets in queue of a slow
103 * link before we stop queuing up packets for it.
105 u8 tx_slow_stop_threshold
;
107 /* Should have less than this number of packets in queue of a fast
108 * link before we stop queuing up packets for it.
110 u8 tx_fast_stop_threshold
;
115 struct wl18xx_fw_packet_counters
{
116 /* Cumulative counter of released packets per AC */
117 u8 tx_released_pkts
[NUM_TX_QUEUES
];
119 /* Cumulative counter of freed packets per HLID */
120 u8 tx_lnk_free_pkts
[WL18XX_MAX_LINKS
];
122 /* Cumulative counter of released Voice memory blocks */
123 u8 tx_voice_released_blks
;
125 /* Tx rate of the last transmitted packet */
131 /* FW status registers */
132 struct wl18xx_fw_status
{
137 u8 tx_results_counter
;
138 __le32 rx_pkt_descs
[WL18XX_NUM_RX_DESCRIPTORS
];
143 * A bitmap (where each bit represents a single HLID)
144 * to indicate if the station is in PS mode.
146 __le32 link_ps_bitmap
;
149 * A bitmap (where each bit represents a single HLID) to indicate
150 * if the station is in Fast mode
152 __le32 link_fast_bitmap
;
154 /* Cumulative counter of total released mem blocks since FW-reset */
155 __le32 total_released_blks
;
157 /* Size (in Memory Blocks) of TX pool */
160 struct wl18xx_fw_packet_counters counters
;
162 __le32 log_start_addr
;
164 /* Private status to be used by the lower drivers */
165 struct wl18xx_fw_status_priv priv
;
168 #define WL18XX_PHY_VERSION_MAX_LEN 20
170 struct wl18xx_static_data_priv
{
171 char phy_version
[WL18XX_PHY_VERSION_MAX_LEN
];
174 struct wl18xx_clk_cfg
{
183 CLOCK_CONFIG_16_2_M
= 1,
184 CLOCK_CONFIG_16_368_M
,
188 CLOCK_CONFIG_32_736_M
,
190 CLOCK_CONFIG_38_468_M
,
196 #endif /* __WL18XX_PRIV_H__ */