wlcore/wl12xx/wl18xx: configure num_links per-hw
[pandora-kernel.git] / drivers / net / wireless / ti / wl12xx / wl12xx.h
1 /*
2  * This file is part of wl12xx
3  *
4  * Copyright (C) 2011 Texas Instruments Inc.
5  *
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.
9  *
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.
14  *
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
18  * 02110-1301 USA
19  *
20  */
21
22 #ifndef __WL12XX_PRIV_H__
23 #define __WL12XX_PRIV_H__
24
25 #include "conf.h"
26
27 /* WiLink 6/7 chip IDs */
28 #define CHIP_ID_127X_PG10              (0x04030101)
29 #define CHIP_ID_127X_PG20              (0x04030111)
30 #define CHIP_ID_128X_PG10              (0x05030101)
31 #define CHIP_ID_128X_PG20              (0x05030111)
32
33 /* FW chip version for wl127x */
34 #define WL127X_CHIP_VER         6
35 /* minimum single-role FW version for wl127x */
36 #define WL127X_IFTYPE_SR_VER    3
37 #define WL127X_MAJOR_SR_VER     10
38 #define WL127X_SUBTYPE_SR_VER   WLCORE_FW_VER_IGNORE
39 #define WL127X_MINOR_SR_VER     133
40 /* minimum multi-role FW version for wl127x */
41 #define WL127X_IFTYPE_MR_VER    5
42 #define WL127X_MAJOR_MR_VER     7
43 #define WL127X_SUBTYPE_MR_VER   WLCORE_FW_VER_IGNORE
44 #define WL127X_MINOR_MR_VER     42
45
46 /* FW chip version for wl128x */
47 #define WL128X_CHIP_VER         7
48 /* minimum single-role FW version for wl128x */
49 #define WL128X_IFTYPE_SR_VER    3
50 #define WL128X_MAJOR_SR_VER     10
51 #define WL128X_SUBTYPE_SR_VER   WLCORE_FW_VER_IGNORE
52 #define WL128X_MINOR_SR_VER     133
53 /* minimum multi-role FW version for wl128x */
54 #define WL128X_IFTYPE_MR_VER    5
55 #define WL128X_MAJOR_MR_VER     7
56 #define WL128X_SUBTYPE_MR_VER   WLCORE_FW_VER_IGNORE
57 #define WL128X_MINOR_MR_VER     42
58
59 #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
60
61 #define WL12XX_NUM_TX_DESCRIPTORS 16
62 #define WL12XX_NUM_RX_DESCRIPTORS 8
63
64 #define WL12XX_NUM_MAC_ADDRESSES 2
65
66 #define WL12XX_RX_BA_MAX_SESSIONS 3
67
68 #define WL12XX_MAX_LINKS 12
69
70 struct wl127x_rx_mem_pool_addr {
71         u32 addr;
72         u32 addr_extra;
73 };
74
75 struct wl12xx_priv {
76         struct wl12xx_priv_conf conf;
77
78         int ref_clock;
79         int tcxo_clock;
80
81         struct wl127x_rx_mem_pool_addr *rx_mem_addr;
82 };
83
84 struct wl12xx_fw_packet_counters {
85         /* Cumulative counter of released packets per AC */
86         u8 tx_released_pkts[NUM_TX_QUEUES];
87
88         /* Cumulative counter of freed packets per HLID */
89         u8 tx_lnk_free_pkts[WL12XX_MAX_LINKS];
90
91         /* Cumulative counter of released Voice memory blocks */
92         u8 tx_voice_released_blks;
93
94         /* Tx rate of the last transmitted packet */
95         u8 tx_last_rate;
96
97         u8 padding[2];
98 } __packed;
99
100 /* FW status registers */
101 struct wl12xx_fw_status {
102         __le32 intr;
103         u8  fw_rx_counter;
104         u8  drv_rx_counter;
105         u8  reserved;
106         u8  tx_results_counter;
107         __le32 rx_pkt_descs[WL12XX_NUM_RX_DESCRIPTORS];
108
109         __le32 fw_localtime;
110
111         /*
112          * A bitmap (where each bit represents a single HLID)
113          * to indicate if the station is in PS mode.
114          */
115         __le32 link_ps_bitmap;
116
117         /*
118          * A bitmap (where each bit represents a single HLID) to indicate
119          * if the station is in Fast mode
120          */
121         __le32 link_fast_bitmap;
122
123         /* Cumulative counter of total released mem blocks since FW-reset */
124         __le32 total_released_blks;
125
126         /* Size (in Memory Blocks) of TX pool */
127         __le32 tx_total;
128
129         struct wl12xx_fw_packet_counters counters;
130
131         __le32 log_start_addr;
132 } __packed;
133
134 #endif /* __WL12XX_PRIV_H__ */