diff options
author | Alwin Beukers <alwin@broadcom.com> | 2011-10-18 08:02:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-08 15:54:00 -0500 |
commit | 73ffc2fcd53a041fdee1bade5ae471ce704be26d (patch) | |
tree | f9eb9e0436f187b296dae69bc09da471c7e40bd3 /drivers/net/wireless/brcm80211/brcmsmac/main.c | |
parent | ef5af74707e1921f9462e2cfeb336a21af6ae902 (diff) |
brcm80211: cleanup defines in main.c
Signed-off-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/main.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.c | 348 |
1 files changed, 148 insertions, 200 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 510e9bb52287..77261ea0bd6a 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -35,39 +35,25 @@ | |||
35 | * Indication for txflowcontrol that all priority bits in | 35 | * Indication for txflowcontrol that all priority bits in |
36 | * TXQ_STOP_FOR_PRIOFC_MASK are to be considered. | 36 | * TXQ_STOP_FOR_PRIOFC_MASK are to be considered. |
37 | */ | 37 | */ |
38 | #define ALLPRIO -1 | 38 | #define ALLPRIO -1 |
39 | |||
40 | /* | ||
41 | * 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL. | ||
42 | */ | ||
43 | #define SSID_FMT_BUF_LEN ((4 * IEEE80211_MAX_SSID_LEN) + 1) | ||
44 | 39 | ||
45 | /* watchdog timer, in unit of ms */ | 40 | /* watchdog timer, in unit of ms */ |
46 | #define TIMER_INTERVAL_WATCHDOG 1000 | 41 | #define TIMER_INTERVAL_WATCHDOG 1000 |
47 | /* radio monitor timer, in unit of ms */ | 42 | /* radio monitor timer, in unit of ms */ |
48 | #define TIMER_INTERVAL_RADIOCHK 800 | 43 | #define TIMER_INTERVAL_RADIOCHK 800 |
49 | 44 | ||
50 | /* Max MPC timeout, in unit of watchdog */ | 45 | /* Max MPC timeout, in unit of watchdog */ |
51 | #ifndef BRCMS_MPC_MAX_DELAYCNT | 46 | #ifndef BRCMS_MPC_MAX_DELAYCNT |
52 | #define BRCMS_MPC_MAX_DELAYCNT 10 | 47 | #define BRCMS_MPC_MAX_DELAYCNT 10 |
53 | #endif | 48 | #endif |
54 | 49 | ||
55 | /* Min MPC timeout, in unit of watchdog */ | 50 | /* Min MPC timeout, in unit of watchdog */ |
56 | #define BRCMS_MPC_MIN_DELAYCNT 1 | 51 | #define BRCMS_MPC_MIN_DELAYCNT 1 |
57 | #define BRCMS_MPC_THRESHOLD 3 /* MPC count threshold level */ | 52 | /* MPC count threshold level */ |
53 | #define BRCMS_MPC_THRESHOLD 3 | ||
58 | 54 | ||
59 | /* beacon interval, in unit of 1024TU */ | 55 | /* beacon interval, in unit of 1024TU */ |
60 | #define BEACON_INTERVAL_DEFAULT 100 | 56 | #define BEACON_INTERVAL_DEFAULT 100 |
61 | /* DTIM interval, in unit of beacon interval */ | ||
62 | #define DTIM_INTERVAL_DEFAULT 3 | ||
63 | |||
64 | /* Scale down delays to accommodate QT slow speed */ | ||
65 | /* beacon interval, in unit of 1024TU */ | ||
66 | #define BEACON_INTERVAL_DEF_QT 20 | ||
67 | /* DTIM interval, in unit of beacon interval */ | ||
68 | #define DTIM_INTERVAL_DEF_QT 1 | ||
69 | |||
70 | #define TBTT_ALIGN_LEEWAY_US 100 /* min leeway before first TBTT in us */ | ||
71 | 57 | ||
72 | /* n-mode support capability */ | 58 | /* n-mode support capability */ |
73 | /* 2x2 includes both 1x1 & 2x2 devices | 59 | /* 2x2 includes both 1x1 & 2x2 devices |
@@ -78,113 +64,76 @@ | |||
78 | #define WL_11N_3x3 3 | 64 | #define WL_11N_3x3 3 |
79 | #define WL_11N_4x4 4 | 65 | #define WL_11N_4x4 4 |
80 | 66 | ||
81 | /* define 11n feature disable flags */ | 67 | #define EDCF_ACI_MASK 0x60 |
82 | #define WLFEATURE_DISABLE_11N 0x00000001 | 68 | #define EDCF_ACI_SHIFT 5 |
83 | #define WLFEATURE_DISABLE_11N_STBC_TX 0x00000002 | 69 | #define EDCF_ECWMIN_MASK 0x0f |
84 | #define WLFEATURE_DISABLE_11N_STBC_RX 0x00000004 | 70 | #define EDCF_ECWMAX_SHIFT 4 |
85 | #define WLFEATURE_DISABLE_11N_SGI_TX 0x00000008 | 71 | #define EDCF_AIFSN_MASK 0x0f |
86 | #define WLFEATURE_DISABLE_11N_SGI_RX 0x00000010 | 72 | #define EDCF_AIFSN_MAX 15 |
87 | #define WLFEATURE_DISABLE_11N_AMPDU_TX 0x00000020 | 73 | #define EDCF_ECWMAX_MASK 0xf0 |
88 | #define WLFEATURE_DISABLE_11N_AMPDU_RX 0x00000040 | 74 | |
89 | #define WLFEATURE_DISABLE_11N_GF 0x00000080 | 75 | #define EDCF_AC_BE_TXOP_STA 0x0000 |
90 | 76 | #define EDCF_AC_BK_TXOP_STA 0x0000 | |
91 | #define EDCF_ACI_MASK 0x60 | 77 | #define EDCF_AC_VO_ACI_STA 0x62 |
92 | #define EDCF_ACI_SHIFT 5 | 78 | #define EDCF_AC_VO_ECW_STA 0x32 |
93 | #define EDCF_ECWMIN_MASK 0x0f | 79 | #define EDCF_AC_VI_ACI_STA 0x42 |
94 | #define EDCF_ECWMAX_SHIFT 4 | 80 | #define EDCF_AC_VI_ECW_STA 0x43 |
95 | #define EDCF_AIFSN_MASK 0x0f | 81 | #define EDCF_AC_BK_ECW_STA 0xA4 |
96 | #define EDCF_AIFSN_MAX 15 | 82 | #define EDCF_AC_VI_TXOP_STA 0x005e |
97 | #define EDCF_ECWMAX_MASK 0xf0 | 83 | #define EDCF_AC_VO_TXOP_STA 0x002f |
98 | 84 | #define EDCF_AC_BE_ACI_STA 0x03 | |
99 | #define EDCF_AC_BE_TXOP_STA 0x0000 | 85 | #define EDCF_AC_BE_ECW_STA 0xA4 |
100 | #define EDCF_AC_BK_TXOP_STA 0x0000 | 86 | #define EDCF_AC_BK_ACI_STA 0x27 |
101 | #define EDCF_AC_VO_ACI_STA 0x62 | 87 | #define EDCF_AC_VO_TXOP_AP 0x002f |
102 | #define EDCF_AC_VO_ECW_STA 0x32 | 88 | |
103 | #define EDCF_AC_VI_ACI_STA 0x42 | 89 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) |
104 | #define EDCF_AC_VI_ECW_STA 0x43 | 90 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) |
105 | #define EDCF_AC_BK_ECW_STA 0xA4 | 91 | |
106 | #define EDCF_AC_VI_TXOP_STA 0x005e | 92 | #define APHY_SYMBOL_TIME 4 |
107 | #define EDCF_AC_VO_TXOP_STA 0x002f | 93 | #define APHY_PREAMBLE_TIME 16 |
108 | #define EDCF_AC_BE_ACI_STA 0x03 | 94 | #define APHY_SIGNAL_TIME 4 |
109 | #define EDCF_AC_BE_ECW_STA 0xA4 | 95 | #define APHY_SIFS_TIME 16 |
110 | #define EDCF_AC_BK_ACI_STA 0x27 | 96 | #define APHY_SERVICE_NBITS 16 |
111 | #define EDCF_AC_VO_TXOP_AP 0x002f | 97 | #define APHY_TAIL_NBITS 6 |
112 | 98 | #define BPHY_SIFS_TIME 10 | |
113 | #define EDCF_TXOP2USEC(txop) ((txop) << 5) | 99 | #define BPHY_PLCP_SHORT_TIME 96 |
114 | #define EDCF_ECW2CW(exp) ((1 << (exp)) - 1) | 100 | |
115 | 101 | #define PREN_PREAMBLE 24 | |
116 | #define APHY_SYMBOL_TIME 4 | 102 | #define PREN_MM_EXT 12 |
117 | #define APHY_PREAMBLE_TIME 16 | 103 | #define PREN_PREAMBLE_EXT 4 |
118 | #define APHY_SIGNAL_TIME 4 | ||
119 | #define APHY_SIFS_TIME 16 | ||
120 | #define APHY_SERVICE_NBITS 16 | ||
121 | #define APHY_TAIL_NBITS 6 | ||
122 | #define BPHY_SIFS_TIME 10 | ||
123 | #define BPHY_PLCP_SHORT_TIME 96 | ||
124 | |||
125 | #define PREN_PREAMBLE 24 | ||
126 | #define PREN_MM_EXT 12 | ||
127 | #define PREN_PREAMBLE_EXT 4 | ||
128 | 104 | ||
129 | #define DOT11_MAC_HDR_LEN 24 | 105 | #define DOT11_MAC_HDR_LEN 24 |
130 | #define DOT11_ACK_LEN 10 | 106 | #define DOT11_ACK_LEN 10 |
131 | #define DOT11_BA_LEN 4 | 107 | #define DOT11_BA_LEN 4 |
132 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 | 108 | #define DOT11_OFDM_SIGNAL_EXTENSION 6 |
133 | #define DOT11_MIN_FRAG_LEN 256 | 109 | #define DOT11_MIN_FRAG_LEN 256 |
134 | #define DOT11_RTS_LEN 16 | 110 | #define DOT11_RTS_LEN 16 |
135 | #define DOT11_CTS_LEN 10 | 111 | #define DOT11_CTS_LEN 10 |
136 | #define DOT11_BA_BITMAP_LEN 128 | 112 | #define DOT11_BA_BITMAP_LEN 128 |
137 | #define DOT11_MIN_BEACON_PERIOD 1 | 113 | #define DOT11_MIN_BEACON_PERIOD 1 |
138 | #define DOT11_MAX_BEACON_PERIOD 0xFFFF | 114 | #define DOT11_MAX_BEACON_PERIOD 0xFFFF |
139 | #define DOT11_MAXNUMFRAGS 16 | 115 | #define DOT11_MAXNUMFRAGS 16 |
140 | #define DOT11_MAX_FRAG_LEN 2346 | 116 | #define DOT11_MAX_FRAG_LEN 2346 |
141 | 117 | ||
142 | #define BPHY_PLCP_TIME 192 | 118 | #define BPHY_PLCP_TIME 192 |
143 | #define RIFS_11N_TIME 2 | 119 | #define RIFS_11N_TIME 2 |
144 | |||
145 | #define WME_VER 1 | ||
146 | #define WME_SUBTYPE_PARAM_IE 1 | ||
147 | #define WME_TYPE 2 | ||
148 | #define WME_OUI "\x00\x50\xf2" | ||
149 | 120 | ||
150 | #define AC_BE 0 | 121 | #define AC_BE 0 |
151 | #define AC_BK 1 | 122 | #define AC_BK 1 |
152 | #define AC_VI 2 | 123 | #define AC_VI 2 |
153 | #define AC_VO 3 | 124 | #define AC_VO 3 |
154 | 125 | ||
155 | #define BCN_TMPL_LEN 512 /* length of the BCN template area */ | 126 | /* length of the BCN template area */ |
127 | #define BCN_TMPL_LEN 512 | ||
156 | 128 | ||
157 | /* brcms_bss_info flag bit values */ | 129 | /* brcms_bss_info flag bit values */ |
158 | #define BRCMS_BSS_HT 0x0020 /* BSS is HT (MIMO) capable */ | 130 | #define BRCMS_BSS_HT 0x0020 /* BSS is HT (MIMO) capable */ |
159 | 131 | ||
160 | /* Flags used in brcms_c_txq_info.stopped */ | 132 | /* chip rx buffer offset */ |
161 | /* per prio flow control bits */ | 133 | #define BRCMS_HWRXOFF 38 |
162 | #define TXQ_STOP_FOR_PRIOFC_MASK 0x000000FF | ||
163 | /* stop txq enqueue for packet drain */ | ||
164 | #define TXQ_STOP_FOR_PKT_DRAIN 0x00000100 | ||
165 | /* stop txq enqueue for ampdu flow control */ | ||
166 | #define TXQ_STOP_FOR_AMPDU_FLOW_CNTRL 0x00000200 | ||
167 | |||
168 | #define BRCMS_HWRXOFF 38 /* chip rx buffer offset */ | ||
169 | |||
170 | /* Find basic rate for a given rate */ | ||
171 | static u8 brcms_basic_rate(struct brcms_c_info *wlc, u32 rspec) | ||
172 | { | ||
173 | if (is_mcs_rate(rspec)) | ||
174 | return wlc->band->basic_rate[mcs_table[rspec & RSPEC_RATE_MASK] | ||
175 | .leg_ofdm]; | ||
176 | return wlc->band->basic_rate[rspec & RSPEC_RATE_MASK]; | ||
177 | } | ||
178 | |||
179 | static u16 frametype(u32 rspec, u8 mimoframe) | ||
180 | { | ||
181 | if (is_mcs_rate(rspec)) | ||
182 | return mimoframe; | ||
183 | return is_cck_rate(rspec) ? FT_CCK : FT_OFDM; | ||
184 | } | ||
185 | 134 | ||
186 | /* rfdisable delay timer 500 ms, runs of ALP clock */ | 135 | /* rfdisable delay timer 500 ms, runs of ALP clock */ |
187 | #define RFDISABLE_DEFAULT 10000000 | 136 | #define RFDISABLE_DEFAULT 10000000 |
188 | 137 | ||
189 | #define BRCMS_TEMPSENSE_PERIOD 10 /* 10 second timeout */ | 138 | #define BRCMS_TEMPSENSE_PERIOD 10 /* 10 second timeout */ |
190 | 139 | ||
@@ -194,87 +143,83 @@ static u16 frametype(u32 rspec, u8 mimoframe) | |||
194 | * These constants are used ONLY by wlc_prio2prec_map. Do not use them | 143 | * These constants are used ONLY by wlc_prio2prec_map. Do not use them |
195 | * elsewhere. | 144 | * elsewhere. |
196 | */ | 145 | */ |
197 | #define _BRCMS_PREC_NONE 0 /* None = - */ | 146 | #define _BRCMS_PREC_NONE 0 /* None = - */ |
198 | #define _BRCMS_PREC_BK 2 /* BK - Background */ | 147 | #define _BRCMS_PREC_BK 2 /* BK - Background */ |
199 | #define _BRCMS_PREC_BE 4 /* BE - Best-effort */ | 148 | #define _BRCMS_PREC_BE 4 /* BE - Best-effort */ |
200 | #define _BRCMS_PREC_EE 6 /* EE - Excellent-effort */ | 149 | #define _BRCMS_PREC_EE 6 /* EE - Excellent-effort */ |
201 | #define _BRCMS_PREC_CL 8 /* CL - Controlled Load */ | 150 | #define _BRCMS_PREC_CL 8 /* CL - Controlled Load */ |
202 | #define _BRCMS_PREC_VI 10 /* Vi - Video */ | 151 | #define _BRCMS_PREC_VI 10 /* Vi - Video */ |
203 | #define _BRCMS_PREC_VO 12 /* Vo - Voice */ | 152 | #define _BRCMS_PREC_VO 12 /* Vo - Voice */ |
204 | #define _BRCMS_PREC_NC 14 /* NC - Network Control */ | 153 | #define _BRCMS_PREC_NC 14 /* NC - Network Control */ |
205 | 154 | ||
206 | /* The BSS is generating beacons in HW */ | 155 | /* synthpu_dly times in us */ |
207 | #define BRCMS_BSSCFG_HW_BCN 0x20 | 156 | #define SYNTHPU_DLY_APHY_US 3700 |
208 | 157 | #define SYNTHPU_DLY_BPHY_US 1050 | |
209 | #define SYNTHPU_DLY_APHY_US 3700 /* a phy synthpu_dly time in us */ | 158 | #define SYNTHPU_DLY_NPHY_US 2048 |
210 | #define SYNTHPU_DLY_BPHY_US 1050 /* b/g phy synthpu_dly time in us */ | 159 | #define SYNTHPU_DLY_LPPHY_US 300 |
211 | #define SYNTHPU_DLY_NPHY_US 2048 /* n phy REV3 synthpu_dly time in us */ | 160 | |
212 | #define SYNTHPU_DLY_LPPHY_US 300 /* lpphy synthpu_dly time in us */ | 161 | #define ANTCNT 10 /* vanilla M_MAX_ANTCNT val */ |
213 | |||
214 | #define SYNTHPU_DLY_PHY_US_QT 100 /* QT synthpu_dly time in us */ | ||
215 | |||
216 | #define ANTCNT 10 /* vanilla M_MAX_ANTCNT value */ | ||
217 | 162 | ||
218 | /* Per-AC retry limit register definitions; uses defs.h bitfield macros */ | 163 | /* Per-AC retry limit register definitions; uses defs.h bitfield macros */ |
219 | #define EDCF_SHORT_S 0 | 164 | #define EDCF_SHORT_S 0 |
220 | #define EDCF_SFB_S 4 | 165 | #define EDCF_SFB_S 4 |
221 | #define EDCF_LONG_S 8 | 166 | #define EDCF_LONG_S 8 |
222 | #define EDCF_LFB_S 12 | 167 | #define EDCF_LFB_S 12 |
223 | #define EDCF_SHORT_M BITFIELD_MASK(4) | 168 | #define EDCF_SHORT_M BITFIELD_MASK(4) |
224 | #define EDCF_SFB_M BITFIELD_MASK(4) | 169 | #define EDCF_SFB_M BITFIELD_MASK(4) |
225 | #define EDCF_LONG_M BITFIELD_MASK(4) | 170 | #define EDCF_LONG_M BITFIELD_MASK(4) |
226 | #define EDCF_LFB_M BITFIELD_MASK(4) | 171 | #define EDCF_LFB_M BITFIELD_MASK(4) |
227 | 172 | ||
228 | #define RETRY_SHORT_DEF 7 /* Default Short retry Limit */ | 173 | #define RETRY_SHORT_DEF 7 /* Default Short retry Limit */ |
229 | #define RETRY_SHORT_MAX 255 /* Maximum Short retry Limit */ | 174 | #define RETRY_SHORT_MAX 255 /* Maximum Short retry Limit */ |
230 | #define RETRY_LONG_DEF 4 /* Default Long retry count */ | 175 | #define RETRY_LONG_DEF 4 /* Default Long retry count */ |
231 | #define RETRY_SHORT_FB 3 /* Short count for fallback rate */ | 176 | #define RETRY_SHORT_FB 3 /* Short count for fb rate */ |
232 | #define RETRY_LONG_FB 2 /* Long count for fallback rate */ | 177 | #define RETRY_LONG_FB 2 /* Long count for fb rate */ |
233 | 178 | ||
234 | #define APHY_CWMIN 15 | 179 | #define APHY_CWMIN 15 |
235 | #define PHY_CWMAX 1023 | 180 | #define PHY_CWMAX 1023 |
236 | 181 | ||
237 | #define EDCF_AIFSN_MIN 1 | 182 | #define EDCF_AIFSN_MIN 1 |
238 | 183 | ||
239 | #define FRAGNUM_MASK 0xF | 184 | #define FRAGNUM_MASK 0xF |
240 | 185 | ||
241 | #define APHY_SLOT_TIME 9 | 186 | #define APHY_SLOT_TIME 9 |
242 | #define BPHY_SLOT_TIME 20 | 187 | #define BPHY_SLOT_TIME 20 |
243 | 188 | ||
244 | #define WL_SPURAVOID_OFF 0 | 189 | #define WL_SPURAVOID_OFF 0 |
245 | #define WL_SPURAVOID_ON1 1 | 190 | #define WL_SPURAVOID_ON1 1 |
246 | #define WL_SPURAVOID_ON2 2 | 191 | #define WL_SPURAVOID_ON2 2 |
247 | 192 | ||
248 | /* invalid core flags, use the saved coreflags */ | 193 | /* invalid core flags, use the saved coreflags */ |
249 | #define BRCMS_USE_COREFLAGS 0xffffffff | 194 | #define BRCMS_USE_COREFLAGS 0xffffffff |
250 | 195 | ||
251 | /* values for PLCPHdr_override */ | 196 | /* values for PLCPHdr_override */ |
252 | #define BRCMS_PLCP_AUTO -1 | 197 | #define BRCMS_PLCP_AUTO -1 |
253 | #define BRCMS_PLCP_SHORT 0 | 198 | #define BRCMS_PLCP_SHORT 0 |
254 | #define BRCMS_PLCP_LONG 1 | 199 | #define BRCMS_PLCP_LONG 1 |
255 | 200 | ||
256 | /* values for g_protection_override and n_protection_override */ | 201 | /* values for g_protection_override and n_protection_override */ |
257 | #define BRCMS_PROTECTION_AUTO -1 | 202 | #define BRCMS_PROTECTION_AUTO -1 |
258 | #define BRCMS_PROTECTION_OFF 0 | 203 | #define BRCMS_PROTECTION_OFF 0 |
259 | #define BRCMS_PROTECTION_ON 1 | 204 | #define BRCMS_PROTECTION_ON 1 |
260 | #define BRCMS_PROTECTION_MMHDR_ONLY 2 | 205 | #define BRCMS_PROTECTION_MMHDR_ONLY 2 |
261 | #define BRCMS_PROTECTION_CTS_ONLY 3 | 206 | #define BRCMS_PROTECTION_CTS_ONLY 3 |
262 | 207 | ||
263 | /* values for g_protection_control and n_protection_control */ | 208 | /* values for g_protection_control and n_protection_control */ |
264 | #define BRCMS_PROTECTION_CTL_OFF 0 | 209 | #define BRCMS_PROTECTION_CTL_OFF 0 |
265 | #define BRCMS_PROTECTION_CTL_LOCAL 1 | 210 | #define BRCMS_PROTECTION_CTL_LOCAL 1 |
266 | #define BRCMS_PROTECTION_CTL_OVERLAP 2 | 211 | #define BRCMS_PROTECTION_CTL_OVERLAP 2 |
267 | 212 | ||
268 | /* values for n_protection */ | 213 | /* values for n_protection */ |
269 | #define BRCMS_N_PROTECTION_OFF 0 | 214 | #define BRCMS_N_PROTECTION_OFF 0 |
270 | #define BRCMS_N_PROTECTION_OPTIONAL 1 | 215 | #define BRCMS_N_PROTECTION_OPTIONAL 1 |
271 | #define BRCMS_N_PROTECTION_20IN40 2 | 216 | #define BRCMS_N_PROTECTION_20IN40 2 |
272 | #define BRCMS_N_PROTECTION_MIXEDMODE 3 | 217 | #define BRCMS_N_PROTECTION_MIXEDMODE 3 |
273 | 218 | ||
274 | /* values for band specific 40MHz capabilities */ | 219 | /* values for band specific 40MHz capabilities */ |
275 | #define BRCMS_N_BW_20ALL 0 | 220 | #define BRCMS_N_BW_20ALL 0 |
276 | #define BRCMS_N_BW_40ALL 1 | 221 | #define BRCMS_N_BW_40ALL 1 |
277 | #define BRCMS_N_BW_20IN2G_40IN5G 2 | 222 | #define BRCMS_N_BW_20IN2G_40IN5G 2 |
278 | 223 | ||
279 | /* bitflags for SGI support (sgi_rx iovar) */ | 224 | /* bitflags for SGI support (sgi_rx iovar) */ |
280 | #define BRCMS_N_SGI_20 0x01 | 225 | #define BRCMS_N_SGI_20 0x01 |
@@ -282,48 +227,42 @@ static u16 frametype(u32 rspec, u8 mimoframe) | |||
282 | 227 | ||
283 | /* defines used by the nrate iovar */ | 228 | /* defines used by the nrate iovar */ |
284 | /* MSC in use,indicates b0-6 holds an mcs */ | 229 | /* MSC in use,indicates b0-6 holds an mcs */ |
285 | #define NRATE_MCS_INUSE 0x00000080 | 230 | #define NRATE_MCS_INUSE 0x00000080 |
286 | /* rate/mcs value */ | 231 | /* rate/mcs value */ |
287 | #define NRATE_RATE_MASK 0x0000007f | 232 | #define NRATE_RATE_MASK 0x0000007f |
288 | /* stf mode mask: siso, cdd, stbc, sdm */ | 233 | /* stf mode mask: siso, cdd, stbc, sdm */ |
289 | #define NRATE_STF_MASK 0x0000ff00 | 234 | #define NRATE_STF_MASK 0x0000ff00 |
290 | /* stf mode shift */ | 235 | /* stf mode shift */ |
291 | #define NRATE_STF_SHIFT 8 | 236 | #define NRATE_STF_SHIFT 8 |
292 | /* bit indicates override both rate & mode */ | ||
293 | #define NRATE_OVERRIDE 0x80000000 | ||
294 | /* bit indicate to override mcs only */ | 237 | /* bit indicate to override mcs only */ |
295 | #define NRATE_OVERRIDE_MCS_ONLY 0x40000000 | 238 | #define NRATE_OVERRIDE_MCS_ONLY 0x40000000 |
296 | #define NRATE_SGI_MASK 0x00800000 /* sgi mode */ | 239 | #define NRATE_SGI_MASK 0x00800000 /* sgi mode */ |
297 | #define NRATE_SGI_SHIFT 23 /* sgi mode */ | 240 | #define NRATE_SGI_SHIFT 23 /* sgi mode */ |
298 | #define NRATE_LDPC_CODING 0x00400000 /* bit indicates adv coding in use */ | 241 | #define NRATE_LDPC_CODING 0x00400000 /* adv coding in use */ |
299 | #define NRATE_LDPC_SHIFT 22 /* ldpc shift */ | 242 | #define NRATE_LDPC_SHIFT 22 /* ldpc shift */ |
300 | 243 | ||
301 | #define NRATE_STF_SISO 0 /* stf mode SISO */ | 244 | #define NRATE_STF_SISO 0 /* stf mode SISO */ |
302 | #define NRATE_STF_CDD 1 /* stf mode CDD */ | 245 | #define NRATE_STF_CDD 1 /* stf mode CDD */ |
303 | #define NRATE_STF_STBC 2 /* stf mode STBC */ | 246 | #define NRATE_STF_STBC 2 /* stf mode STBC */ |
304 | #define NRATE_STF_SDM 3 /* stf mode SDM */ | 247 | #define NRATE_STF_SDM 3 /* stf mode SDM */ |
305 | 248 | ||
306 | #define MAX_DMA_SEGS 4 | 249 | #define MAX_DMA_SEGS 4 |
307 | 250 | ||
308 | /* Max # of entries in Tx FIFO based on 4kb page size */ | 251 | /* Max # of entries in Tx FIFO based on 4kb page size */ |
309 | #define NTXD 256 | 252 | #define NTXD 256 |
310 | /* Max # of entries in Rx FIFO based on 4kb page size */ | 253 | /* Max # of entries in Rx FIFO based on 4kb page size */ |
311 | #define NRXD 256 | 254 | #define NRXD 256 |
312 | 255 | ||
313 | /* try to keep this # rbufs posted to the chip */ | 256 | /* try to keep this # rbufs posted to the chip */ |
314 | #define NRXBUFPOST 32 | 257 | #define NRXBUFPOST 32 |
315 | 258 | ||
316 | /* data msg txq hiwat mark */ | 259 | /* data msg txq hiwat mark */ |
317 | #define BRCMS_DATAHIWAT 50 | 260 | #define BRCMS_DATAHIWAT 50 |
318 | 261 | ||
319 | /* bounded rx loops */ | 262 | /* max # frames to process in brcms_c_recv() */ |
320 | #define RXBND 8 /* max # frames to process in brcms_c_recv() */ | 263 | #define RXBND 8 |
321 | #define TXSBND 8 /* max # tx status to process in wlc_txstatus() */ | 264 | /* max # tx status to process in wlc_txstatus() */ |
322 | 265 | #define TXSBND 8 | |
323 | /* | ||
324 | * 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL. | ||
325 | */ | ||
326 | #define SSID_FMT_BUF_LEN ((4 * IEEE80211_MAX_SSID_LEN) + 1) | ||
327 | 266 | ||
328 | /* brcmu_format_flags() bit description structure */ | 267 | /* brcmu_format_flags() bit description structure */ |
329 | struct brcms_c_bit_desc { | 268 | struct brcms_c_bit_desc { |
@@ -405,13 +344,6 @@ static const u16 xmtfifo_sz[][NFIFO] = { | |||
405 | {9, 58, 22, 14, 14, 5}, | 344 | {9, 58, 22, 14, 14, 5}, |
406 | }; | 345 | }; |
407 | 346 | ||
408 | static const u8 acbitmap2maxprio[] = { | ||
409 | PRIO_8021D_BE, PRIO_8021D_BE, PRIO_8021D_BK, PRIO_8021D_BK, | ||
410 | PRIO_8021D_VI, PRIO_8021D_VI, PRIO_8021D_VI, PRIO_8021D_VI, | ||
411 | PRIO_8021D_VO, PRIO_8021D_VO, PRIO_8021D_VO, PRIO_8021D_VO, | ||
412 | PRIO_8021D_VO, PRIO_8021D_VO, PRIO_8021D_VO, PRIO_8021D_VO | ||
413 | }; | ||
414 | |||
415 | #ifdef BCMDBG | 347 | #ifdef BCMDBG |
416 | static const char * const fifo_names[] = { | 348 | static const char * const fifo_names[] = { |
417 | "AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" }; | 349 | "AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" }; |
@@ -424,6 +356,22 @@ static const char fifo_names[6][0]; | |||
424 | static struct brcms_c_info *wlc_info_dbg = (struct brcms_c_info *) (NULL); | 356 | static struct brcms_c_info *wlc_info_dbg = (struct brcms_c_info *) (NULL); |
425 | #endif | 357 | #endif |
426 | 358 | ||
359 | /* Find basic rate for a given rate */ | ||
360 | static u8 brcms_basic_rate(struct brcms_c_info *wlc, u32 rspec) | ||
361 | { | ||
362 | if (is_mcs_rate(rspec)) | ||
363 | return wlc->band->basic_rate[mcs_table[rspec & RSPEC_RATE_MASK] | ||
364 | .leg_ofdm]; | ||
365 | return wlc->band->basic_rate[rspec & RSPEC_RATE_MASK]; | ||
366 | } | ||
367 | |||
368 | static u16 frametype(u32 rspec, u8 mimoframe) | ||
369 | { | ||
370 | if (is_mcs_rate(rspec)) | ||
371 | return mimoframe; | ||
372 | return is_cck_rate(rspec) ? FT_CCK : FT_OFDM; | ||
373 | } | ||
374 | |||
427 | /* currently the best mechanism for determining SIFS is the band in use */ | 375 | /* currently the best mechanism for determining SIFS is the band in use */ |
428 | static u16 get_sifs(struct brcms_band *band) | 376 | static u16 get_sifs(struct brcms_band *band) |
429 | { | 377 | { |