aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-10-01 04:55:41 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-01 04:55:41 -0400
commit788df7322a7543a337c1ea400d38b621346ea78e (patch)
tree30e9ba775a44839726e07f79f2437ec431d1d8e6
parent6e50e8a2136f1a90de251c653226ded447c5c915 (diff)
parent0d5f0316593df606515b17b037a1fd36c4b8bfdf (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
-rw-r--r--drivers/net/wireless/ath5k/ath5k.h59
-rw-r--r--drivers/net/wireless/ath5k/attach.c184
-rw-r--r--drivers/net/wireless/ath5k/base.c61
-rw-r--r--drivers/net/wireless/ath5k/dma.c49
-rw-r--r--drivers/net/wireless/ath5k/pcu.c14
-rw-r--r--drivers/net/wireless/ath5k/qcu.c8
-rw-r--r--drivers/net/wireless/ath5k/reg.h577
-rw-r--r--drivers/net/wireless/ath5k/reset.c8
-rw-r--r--drivers/net/wireless/b43/main.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-csr.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c30
-rw-r--r--drivers/net/wireless/libertas/cmd.c2
-rw-r--r--drivers/net/wireless/libertas/cmd.h6
-rw-r--r--drivers/net/wireless/libertas/defs.h1
-rw-r--r--drivers/net/wireless/libertas/wext.c12
-rw-r--r--drivers/net/wireless/p54/p54common.c33
-rw-r--r--drivers/net/wireless/p54/p54common.h3
-rw-r--r--drivers/net/wireless/p54/p54usb.c8
-rw-r--r--drivers/net/wireless/rt2x00/Kconfig69
-rw-r--r--include/net/ieee80211.h4
-rw-r--r--net/mac80211/iface.c9
-rw-r--r--net/mac80211/rx.c2
-rw-r--r--net/mac80211/sta_info.h12
-rw-r--r--net/mac80211/wme.c8
26 files changed, 782 insertions, 409 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index 20018869051d..7134c40d6a69 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -281,7 +281,9 @@ enum ath5k_radio {
281 AR5K_RF5112 = 2, 281 AR5K_RF5112 = 2,
282 AR5K_RF2413 = 3, 282 AR5K_RF2413 = 3,
283 AR5K_RF5413 = 4, 283 AR5K_RF5413 = 4,
284 AR5K_RF2425 = 5, 284 AR5K_RF2316 = 5,
285 AR5K_RF2317 = 6,
286 AR5K_RF2425 = 7,
285}; 287};
286 288
287/* 289/*
@@ -289,7 +291,7 @@ enum ath5k_radio {
289 */ 291 */
290 292
291enum ath5k_srev_type { 293enum ath5k_srev_type {
292 AR5K_VERSION_VER, 294 AR5K_VERSION_MAC,
293 AR5K_VERSION_RAD, 295 AR5K_VERSION_RAD,
294}; 296};
295 297
@@ -301,23 +303,24 @@ struct ath5k_srev_name {
301 303
302#define AR5K_SREV_UNKNOWN 0xffff 304#define AR5K_SREV_UNKNOWN 0xffff
303 305
304#define AR5K_SREV_VER_AR5210 0x00 306#define AR5K_SREV_AR5210 0x00 /* Crete */
305#define AR5K_SREV_VER_AR5311 0x10 307#define AR5K_SREV_AR5311 0x10 /* Maui 1 */
306#define AR5K_SREV_VER_AR5311A 0x20 308#define AR5K_SREV_AR5311A 0x20 /* Maui 2 */
307#define AR5K_SREV_VER_AR5311B 0x30 309#define AR5K_SREV_AR5311B 0x30 /* Spirit */
308#define AR5K_SREV_VER_AR5211 0x40 310#define AR5K_SREV_AR5211 0x40 /* Oahu */
309#define AR5K_SREV_VER_AR5212 0x50 311#define AR5K_SREV_AR5212 0x50 /* Venice */
310#define AR5K_SREV_VER_AR5213 0x55 312#define AR5K_SREV_AR5213 0x55 /* ??? */
311#define AR5K_SREV_VER_AR5213A 0x59 313#define AR5K_SREV_AR5213A 0x59 /* Hainan */
312#define AR5K_SREV_VER_AR2413 0x78 314#define AR5K_SREV_AR2413 0x78 /* Griffin lite */
313#define AR5K_SREV_VER_AR2414 0x79 315#define AR5K_SREV_AR2414 0x70 /* Griffin */
314#define AR5K_SREV_VER_AR2424 0xa0 /* PCI-E */ 316#define AR5K_SREV_AR5424 0x90 /* Condor */
315#define AR5K_SREV_VER_AR5424 0xa3 /* PCI-E */ 317#define AR5K_SREV_AR5413 0xa4 /* Eagle lite */
316#define AR5K_SREV_VER_AR5413 0xa4 318#define AR5K_SREV_AR5414 0xa0 /* Eagle */
317#define AR5K_SREV_VER_AR5414 0xa5 319#define AR5K_SREV_AR2415 0xb0 /* Cobra */
318#define AR5K_SREV_VER_AR5416 0xc0 /* PCI-E */ 320#define AR5K_SREV_AR5416 0xc0 /* PCI-E */
319#define AR5K_SREV_VER_AR5418 0xca /* PCI-E */ 321#define AR5K_SREV_AR5418 0xca /* PCI-E */
320#define AR5K_SREV_VER_AR2425 0xe2 /* PCI-E */ 322#define AR5K_SREV_AR2425 0xe0 /* Swan */
323#define AR5K_SREV_AR2417 0xf0 /* Nala */
321 324
322#define AR5K_SREV_RAD_5110 0x00 325#define AR5K_SREV_RAD_5110 0x00
323#define AR5K_SREV_RAD_5111 0x10 326#define AR5K_SREV_RAD_5111 0x10
@@ -329,10 +332,20 @@ struct ath5k_srev_name {
329#define AR5K_SREV_RAD_2112 0x40 332#define AR5K_SREV_RAD_2112 0x40
330#define AR5K_SREV_RAD_2112A 0x45 333#define AR5K_SREV_RAD_2112A 0x45
331#define AR5K_SREV_RAD_2112B 0x46 334#define AR5K_SREV_RAD_2112B 0x46
332#define AR5K_SREV_RAD_SC0 0x50 /* Found on 2413/2414 */ 335#define AR5K_SREV_RAD_2413 0x50
333#define AR5K_SREV_RAD_SC1 0x60 /* Found on 5413/5414 */ 336#define AR5K_SREV_RAD_5413 0x60
334#define AR5K_SREV_RAD_SC2 0xa0 /* Found on 2424-5/5424 */ 337#define AR5K_SREV_RAD_2316 0x70
335#define AR5K_SREV_RAD_5133 0xc0 /* MIMO found on 5418 */ 338#define AR5K_SREV_RAD_2317 0x80
339#define AR5K_SREV_RAD_5424 0xa0 /* Mostly same as 5413 */
340#define AR5K_SREV_RAD_2425 0xa2
341#define AR5K_SREV_RAD_5133 0xc0
342
343#define AR5K_SREV_PHY_5211 0x30
344#define AR5K_SREV_PHY_5212 0x41
345#define AR5K_SREV_PHY_2112B 0x43
346#define AR5K_SREV_PHY_2413 0x45
347#define AR5K_SREV_PHY_5413 0x61
348#define AR5K_SREV_PHY_2425 0x70
336 349
337/* IEEE defs */ 350/* IEEE defs */
338#define IEEE80211_MAX_LEN 2500 351#define IEEE80211_MAX_LEN 2500
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c
index 153c4111fabe..51d569883cdd 100644
--- a/drivers/net/wireless/ath5k/attach.c
+++ b/drivers/net/wireless/ath5k/attach.c
@@ -137,7 +137,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
137 ah->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY; 137 ah->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY;
138 138
139 /* 139 /*
140 * Set the mac revision based on the pci id 140 * Set the mac version based on the pci id
141 */ 141 */
142 ah->ah_version = mac_version; 142 ah->ah_version = mac_version;
143 143
@@ -160,87 +160,132 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
160 0xffffffff; 160 0xffffffff;
161 ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah, 161 ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah,
162 CHANNEL_5GHZ); 162 CHANNEL_5GHZ);
163 ah->ah_phy = AR5K_PHY(0);
163 164
164 if (ah->ah_version == AR5K_AR5210) 165 /* Try to identify radio chip based on it's srev */
165 ah->ah_radio_2ghz_revision = 0; 166 switch (ah->ah_radio_5ghz_revision & 0xf0) {
166 else 167 case AR5K_SREV_RAD_5111:
167 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
168 CHANNEL_2GHZ);
169
170 /* Return on unsuported chips (unsupported eeprom etc) */
171 if ((srev >= AR5K_SREV_VER_AR5416) &&
172 (srev < AR5K_SREV_VER_AR2425)) {
173 ATH5K_ERR(sc, "Device not yet supported.\n");
174 ret = -ENODEV;
175 goto err_free;
176 } else if (srev == AR5K_SREV_VER_AR2425) {
177 ATH5K_WARN(sc, "Support for RF2425 is under development.\n");
178 }
179
180 /* Identify single chip solutions */
181 if (((srev <= AR5K_SREV_VER_AR5414) &&
182 (srev >= AR5K_SREV_VER_AR2413)) ||
183 (srev == AR5K_SREV_VER_AR2425)) {
184 ah->ah_single_chip = true;
185 } else {
186 ah->ah_single_chip = false;
187 }
188
189 /* Single chip radio */
190 if (ah->ah_radio_2ghz_revision == ah->ah_radio_5ghz_revision)
191 ah->ah_radio_2ghz_revision = 0;
192
193 /* Identify the radio chip*/
194 if (ah->ah_version == AR5K_AR5210) {
195 ah->ah_radio = AR5K_RF5110;
196 /*
197 * Register returns 0x0/0x04 for radio revision
198 * so ath5k_hw_radio_revision doesn't parse the value
199 * correctly. For now we are based on mac's srev to
200 * identify RF2425 radio.
201 */
202 } else if (srev == AR5K_SREV_VER_AR2425) {
203 ah->ah_radio = AR5K_RF2425;
204 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2425;
205 } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112) {
206 ah->ah_radio = AR5K_RF5111; 168 ah->ah_radio = AR5K_RF5111;
169 ah->ah_single_chip = false;
170 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
171 CHANNEL_2GHZ);
207 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5111; 172 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5111;
208 } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC0) { 173 break;
174 case AR5K_SREV_RAD_5112:
175 case AR5K_SREV_RAD_2112:
209 ah->ah_radio = AR5K_RF5112; 176 ah->ah_radio = AR5K_RF5112;
177 ah->ah_single_chip = false;
178 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
179 CHANNEL_2GHZ);
210 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; 180 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112;
211 } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC1) { 181 break;
182 case AR5K_SREV_RAD_2413:
212 ah->ah_radio = AR5K_RF2413; 183 ah->ah_radio = AR5K_RF2413;
184 ah->ah_single_chip = true;
213 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413; 185 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413;
214 } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC2) { 186 break;
187 case AR5K_SREV_RAD_5413:
215 ah->ah_radio = AR5K_RF5413; 188 ah->ah_radio = AR5K_RF5413;
189 ah->ah_single_chip = true;
216 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413; 190 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413;
217 } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5133) { 191 break;
218 /* AR5424 */ 192 case AR5K_SREV_RAD_2316:
219 if (srev >= AR5K_SREV_VER_AR5424) { 193 ah->ah_radio = AR5K_RF2316;
194 ah->ah_single_chip = true;
195 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2316;
196 break;
197 case AR5K_SREV_RAD_2317:
198 ah->ah_radio = AR5K_RF2317;
199 ah->ah_single_chip = true;
200 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2317;
201 break;
202 case AR5K_SREV_RAD_5424:
203 if (ah->ah_mac_version == AR5K_SREV_AR2425 ||
204 ah->ah_mac_version == AR5K_SREV_AR2417){
205 ah->ah_radio = AR5K_RF2425;
206 ah->ah_single_chip = true;
207 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2425;
208 } else {
220 ah->ah_radio = AR5K_RF5413; 209 ah->ah_radio = AR5K_RF5413;
210 ah->ah_single_chip = true;
221 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413; 211 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413;
222 /* AR2424 */ 212 }
223 } else { 213 break;
224 ah->ah_radio = AR5K_RF2413; /* For testing */ 214 default:
215 /* Identify radio based on mac/phy srev */
216 if (ah->ah_version == AR5K_AR5210) {
217 ah->ah_radio = AR5K_RF5110;
218 ah->ah_single_chip = false;
219 } else if (ah->ah_version == AR5K_AR5211) {
220 ah->ah_radio = AR5K_RF5111;
221 ah->ah_single_chip = false;
222 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
223 CHANNEL_2GHZ);
224 } else if (ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4) ||
225 ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4) ||
226 ah->ah_phy_revision == AR5K_SREV_PHY_2425) {
227 ah->ah_radio = AR5K_RF2425;
228 ah->ah_single_chip = true;
229 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2425;
230 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2425;
231 } else if (srev == AR5K_SREV_AR5213A &&
232 ah->ah_phy_revision == AR5K_SREV_PHY_2112B) {
233 ah->ah_radio = AR5K_RF5112;
234 ah->ah_single_chip = false;
235 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2112B;
236 } else if (ah->ah_mac_version == (AR5K_SREV_AR2415 >> 4)) {
237 ah->ah_radio = AR5K_RF2316;
238 ah->ah_single_chip = true;
239 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2316;
240 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2316;
241 } else if (ah->ah_mac_version == (AR5K_SREV_AR5414 >> 4) ||
242 ah->ah_phy_revision == AR5K_SREV_PHY_5413) {
243 ah->ah_radio = AR5K_RF5413;
244 ah->ah_single_chip = true;
245 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_5413;
246 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413;
247 } else if (ah->ah_mac_version == (AR5K_SREV_AR2414 >> 4) ||
248 ah->ah_phy_revision == AR5K_SREV_PHY_2413) {
249 ah->ah_radio = AR5K_RF2413;
250 ah->ah_single_chip = true;
251 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2413;
225 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413; 252 ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413;
253 } else {
254 ATH5K_ERR(sc, "Couldn't identify radio revision.\n");
255 ret = -ENODEV;
256 goto err_free;
226 } 257 }
227 } 258 }
228 ah->ah_phy = AR5K_PHY(0); 259
260
261 /* Return on unsuported chips (unsupported eeprom etc) */
262 if ((srev >= AR5K_SREV_AR5416) &&
263 (srev < AR5K_SREV_AR2425)) {
264 ATH5K_ERR(sc, "Device not yet supported.\n");
265 ret = -ENODEV;
266 goto err_free;
267 }
229 268
230 /* 269 /*
231 * Write PCI-E power save settings 270 * Write PCI-E power save settings
232 */ 271 */
233 if ((ah->ah_version == AR5K_AR5212) && (pdev->is_pcie)) { 272 if ((ah->ah_version == AR5K_AR5212) && (pdev->is_pcie)) {
234 ath5k_hw_reg_write(ah, 0x9248fc00, 0x4080); 273 ath5k_hw_reg_write(ah, 0x9248fc00, AR5K_PCIE_SERDES);
235 ath5k_hw_reg_write(ah, 0x24924924, 0x4080); 274 ath5k_hw_reg_write(ah, 0x24924924, AR5K_PCIE_SERDES);
236 ath5k_hw_reg_write(ah, 0x28000039, 0x4080); 275 /* Shut off RX when elecidle is asserted */
237 ath5k_hw_reg_write(ah, 0x53160824, 0x4080); 276 ath5k_hw_reg_write(ah, 0x28000039, AR5K_PCIE_SERDES);
238 ath5k_hw_reg_write(ah, 0xe5980579, 0x4080); 277 ath5k_hw_reg_write(ah, 0x53160824, AR5K_PCIE_SERDES);
239 ath5k_hw_reg_write(ah, 0x001defff, 0x4080); 278 /* TODO: EEPROM work */
240 ath5k_hw_reg_write(ah, 0x1aaabe40, 0x4080); 279 ath5k_hw_reg_write(ah, 0xe5980579, AR5K_PCIE_SERDES);
241 ath5k_hw_reg_write(ah, 0xbe105554, 0x4080); 280 /* Shut off PLL and CLKREQ active in L1 */
242 ath5k_hw_reg_write(ah, 0x000e3007, 0x4080); 281 ath5k_hw_reg_write(ah, 0x001defff, AR5K_PCIE_SERDES);
243 ath5k_hw_reg_write(ah, 0x00000000, 0x4084); 282 /* Preserce other settings */
283 ath5k_hw_reg_write(ah, 0x1aaabe40, AR5K_PCIE_SERDES);
284 ath5k_hw_reg_write(ah, 0xbe105554, AR5K_PCIE_SERDES);
285 ath5k_hw_reg_write(ah, 0x000e3007, AR5K_PCIE_SERDES);
286 /* Reset SERDES to load new settings */
287 ath5k_hw_reg_write(ah, 0x00000000, AR5K_PCIE_SERDES_RESET);
288 mdelay(1);
244 } 289 }
245 290
246 /* 291 /*
@@ -250,14 +295,13 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
250 if (ret) 295 if (ret)
251 goto err_free; 296 goto err_free;
252 297
253 /* Write AR5K_PCICFG_UNK on 2112B and later chips */ 298 /* Enable pci core retry fix on Hainan (5213A) and later chips */
254 if (ah->ah_radio_5ghz_revision > AR5K_SREV_RAD_2112B || 299 if (srev >= AR5K_SREV_AR5213A)
255 srev > AR5K_SREV_VER_AR2413) { 300 ath5k_hw_reg_write(ah, AR5K_PCICFG_RETRY_FIX, AR5K_PCICFG);
256 ath5k_hw_reg_write(ah, AR5K_PCICFG_UNK, AR5K_PCICFG);
257 }
258 301
259 /* 302 /*
260 * Get card capabilities, values, ... 303 * Get card capabilities, calibration values etc
304 * TODO: EEPROM work
261 */ 305 */
262 ret = ath5k_eeprom_init(ah); 306 ret = ath5k_eeprom_init(ah);
263 if (ret) { 307 if (ret) {
@@ -273,7 +317,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
273 goto err_free; 317 goto err_free;
274 } 318 }
275 319
276 /* Get MAC address */ 320 /* Set MAC address */
277 ret = ath5k_eeprom_read_mac(ah, mac); 321 ret = ath5k_eeprom_read_mac(ah, mac);
278 if (ret) { 322 if (ret) {
279 ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n", 323 ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n",
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index e09ed2ce6753..c151588aa484 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -72,7 +72,7 @@ MODULE_AUTHOR("Nick Kossifidis");
72MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards."); 72MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards.");
73MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards"); 73MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards");
74MODULE_LICENSE("Dual BSD/GPL"); 74MODULE_LICENSE("Dual BSD/GPL");
75MODULE_VERSION("0.5.0 (EXPERIMENTAL)"); 75MODULE_VERSION("0.6.0 (EXPERIMENTAL)");
76 76
77 77
78/* Known PCI ids */ 78/* Known PCI ids */
@@ -93,41 +93,48 @@ static struct pci_device_id ath5k_pci_id_table[] __devinitdata = {
93 { PCI_VDEVICE(ATHEROS, 0x0019), .driver_data = AR5K_AR5212 }, /* 5212 combatible */ 93 { PCI_VDEVICE(ATHEROS, 0x0019), .driver_data = AR5K_AR5212 }, /* 5212 combatible */
94 { PCI_VDEVICE(ATHEROS, 0x001a), .driver_data = AR5K_AR5212 }, /* 2413 Griffin-lite */ 94 { PCI_VDEVICE(ATHEROS, 0x001a), .driver_data = AR5K_AR5212 }, /* 2413 Griffin-lite */
95 { PCI_VDEVICE(ATHEROS, 0x001b), .driver_data = AR5K_AR5212 }, /* 5413 Eagle */ 95 { PCI_VDEVICE(ATHEROS, 0x001b), .driver_data = AR5K_AR5212 }, /* 5413 Eagle */
96 { PCI_VDEVICE(ATHEROS, 0x001c), .driver_data = AR5K_AR5212 }, /* 5424 Condor (PCI-E)*/ 96 { PCI_VDEVICE(ATHEROS, 0x001c), .driver_data = AR5K_AR5212 }, /* PCI-E cards */
97 { PCI_VDEVICE(ATHEROS, 0x001d), .driver_data = AR5K_AR5212 }, /* 2417 Nala */
97 { 0 } 98 { 0 }
98}; 99};
99MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table); 100MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
100 101
101/* Known SREVs */ 102/* Known SREVs */
102static struct ath5k_srev_name srev_names[] = { 103static struct ath5k_srev_name srev_names[] = {
103 { "5210", AR5K_VERSION_VER, AR5K_SREV_VER_AR5210 }, 104 { "5210", AR5K_VERSION_MAC, AR5K_SREV_AR5210 },
104 { "5311", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311 }, 105 { "5311", AR5K_VERSION_MAC, AR5K_SREV_AR5311 },
105 { "5311A", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311A }, 106 { "5311A", AR5K_VERSION_MAC, AR5K_SREV_AR5311A },
106 { "5311B", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311B }, 107 { "5311B", AR5K_VERSION_MAC, AR5K_SREV_AR5311B },
107 { "5211", AR5K_VERSION_VER, AR5K_SREV_VER_AR5211 }, 108 { "5211", AR5K_VERSION_MAC, AR5K_SREV_AR5211 },
108 { "5212", AR5K_VERSION_VER, AR5K_SREV_VER_AR5212 }, 109 { "5212", AR5K_VERSION_MAC, AR5K_SREV_AR5212 },
109 { "5213", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213 }, 110 { "5213", AR5K_VERSION_MAC, AR5K_SREV_AR5213 },
110 { "5213A", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213A }, 111 { "5213A", AR5K_VERSION_MAC, AR5K_SREV_AR5213A },
111 { "2413", AR5K_VERSION_VER, AR5K_SREV_VER_AR2413 }, 112 { "2413", AR5K_VERSION_MAC, AR5K_SREV_AR2413 },
112 { "2414", AR5K_VERSION_VER, AR5K_SREV_VER_AR2414 }, 113 { "2414", AR5K_VERSION_MAC, AR5K_SREV_AR2414 },
113 { "2424", AR5K_VERSION_VER, AR5K_SREV_VER_AR2424 }, 114 { "5424", AR5K_VERSION_MAC, AR5K_SREV_AR5424 },
114 { "5424", AR5K_VERSION_VER, AR5K_SREV_VER_AR5424 }, 115 { "5413", AR5K_VERSION_MAC, AR5K_SREV_AR5413 },
115 { "5413", AR5K_VERSION_VER, AR5K_SREV_VER_AR5413 }, 116 { "5414", AR5K_VERSION_MAC, AR5K_SREV_AR5414 },
116 { "5414", AR5K_VERSION_VER, AR5K_SREV_VER_AR5414 }, 117 { "2415", AR5K_VERSION_MAC, AR5K_SREV_AR2415 },
117 { "5416", AR5K_VERSION_VER, AR5K_SREV_VER_AR5416 }, 118 { "5416", AR5K_VERSION_MAC, AR5K_SREV_AR5416 },
118 { "5418", AR5K_VERSION_VER, AR5K_SREV_VER_AR5418 }, 119 { "5418", AR5K_VERSION_MAC, AR5K_SREV_AR5418 },
119 { "2425", AR5K_VERSION_VER, AR5K_SREV_VER_AR2425 }, 120 { "2425", AR5K_VERSION_MAC, AR5K_SREV_AR2425 },
120 { "xxxxx", AR5K_VERSION_VER, AR5K_SREV_UNKNOWN }, 121 { "2417", AR5K_VERSION_MAC, AR5K_SREV_AR2417 },
122 { "xxxxx", AR5K_VERSION_MAC, AR5K_SREV_UNKNOWN },
121 { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 }, 123 { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 },
122 { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 }, 124 { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 },
125 { "5111A", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111A },
123 { "2111", AR5K_VERSION_RAD, AR5K_SREV_RAD_2111 }, 126 { "2111", AR5K_VERSION_RAD, AR5K_SREV_RAD_2111 },
124 { "5112", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112 }, 127 { "5112", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112 },
125 { "5112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A }, 128 { "5112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A },
129 { "5112B", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112B },
126 { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, 130 { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 },
127 { "2112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A }, 131 { "2112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A },
128 { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC0 }, 132 { "2112B", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112B },
129 { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC1 }, 133 { "2413", AR5K_VERSION_RAD, AR5K_SREV_RAD_2413 },
130 { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC2 }, 134 { "5413", AR5K_VERSION_RAD, AR5K_SREV_RAD_5413 },
135 { "2316", AR5K_VERSION_RAD, AR5K_SREV_RAD_2316 },
136 { "2317", AR5K_VERSION_RAD, AR5K_SREV_RAD_2317 },
137 { "5424", AR5K_VERSION_RAD, AR5K_SREV_RAD_5424 },
131 { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 }, 138 { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 },
132 { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, 139 { "xxxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN },
133}; 140};
@@ -390,7 +397,11 @@ ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val)
390 for (i = 0; i < ARRAY_SIZE(srev_names); i++) { 397 for (i = 0; i < ARRAY_SIZE(srev_names); i++) {
391 if (srev_names[i].sr_type != type) 398 if (srev_names[i].sr_type != type)
392 continue; 399 continue;
393 if ((val & 0xff) < srev_names[i + 1].sr_val) { 400
401 if ((val & 0xf0) == srev_names[i].sr_val)
402 name = srev_names[i].sr_name;
403
404 if ((val & 0xff) == srev_names[i].sr_val) {
394 name = srev_names[i].sr_name; 405 name = srev_names[i].sr_name;
395 break; 406 break;
396 } 407 }
@@ -536,7 +547,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
536 goto err_ah; 547 goto err_ah;
537 548
538 ATH5K_INFO(sc, "Atheros AR%s chip found (MAC: 0x%x, PHY: 0x%x)\n", 549 ATH5K_INFO(sc, "Atheros AR%s chip found (MAC: 0x%x, PHY: 0x%x)\n",
539 ath5k_chip_name(AR5K_VERSION_VER,sc->ah->ah_mac_srev), 550 ath5k_chip_name(AR5K_VERSION_MAC, sc->ah->ah_mac_srev),
540 sc->ah->ah_mac_srev, 551 sc->ah->ah_mac_srev,
541 sc->ah->ah_phy_revision); 552 sc->ah->ah_phy_revision);
542 553
diff --git a/drivers/net/wireless/ath5k/dma.c b/drivers/net/wireless/ath5k/dma.c
index a28090be9603..7adceb2c7fab 100644
--- a/drivers/net/wireless/ath5k/dma.c
+++ b/drivers/net/wireless/ath5k/dma.c
@@ -68,7 +68,7 @@ int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah)
68 /* 68 /*
69 * It may take some time to disable the DMA receive unit 69 * It may take some time to disable the DMA receive unit
70 */ 70 */
71 for (i = 2000; i > 0 && 71 for (i = 1000; i > 0 &&
72 (ath5k_hw_reg_read(ah, AR5K_CR) & AR5K_CR_RXE) != 0; 72 (ath5k_hw_reg_read(ah, AR5K_CR) & AR5K_CR_RXE) != 0;
73 i--) 73 i--)
74 udelay(10); 74 udelay(10);
@@ -182,11 +182,10 @@ int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue)
182 * have any pending frames. Returns -EBUSY if we still have pending frames, 182 * have any pending frames. Returns -EBUSY if we still have pending frames,
183 * -EINVAL if queue number is out of range. 183 * -EINVAL if queue number is out of range.
184 * 184 *
185 * TODO: Test queue drain code
186 */ 185 */
187int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue) 186int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
188{ 187{
189 unsigned int i = 100; 188 unsigned int i = 40;
190 u32 tx_queue, pending; 189 u32 tx_queue, pending;
191 190
192 ATH5K_TRACE(ah->ah_sc); 191 ATH5K_TRACE(ah->ah_sc);
@@ -233,13 +232,53 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
233 udelay(100); 232 udelay(100);
234 } while (--i && pending); 233 } while (--i && pending);
235 234
235 /* For 2413+ order PCU to drop packets using
236 * QUIET mechanism */
237 if (ah->ah_mac_version >= (AR5K_SREV_AR2414 >> 4) &&
238 pending){
239 /* Set periodicity and duration */
240 ath5k_hw_reg_write(ah,
241 AR5K_REG_SM(100, AR5K_QUIET_CTL2_QT_PER)|
242 AR5K_REG_SM(10, AR5K_QUIET_CTL2_QT_DUR),
243 AR5K_QUIET_CTL2);
244
245 /* Enable quiet period for current TSF */
246 ath5k_hw_reg_write(ah,
247 AR5K_QUIET_CTL1_QT_EN |
248 AR5K_REG_SM(ath5k_hw_reg_read(ah,
249 AR5K_TSF_L32_5211) >> 10,
250 AR5K_QUIET_CTL1_NEXT_QT_TSF),
251 AR5K_QUIET_CTL1);
252
253 /* Force channel idle high */
254 AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211,
255 AR5K_DIAG_SW_CHANEL_IDLE_HIGH);
256
257 /* Wait a while and disable mechanism */
258 udelay(200);
259 AR5K_REG_DISABLE_BITS(ah, AR5K_QUIET_CTL1,
260 AR5K_QUIET_CTL1_QT_EN);
261
262 /* Re-check for pending frames */
263 i = 40;
264 do {
265 pending = ath5k_hw_reg_read(ah,
266 AR5K_QUEUE_STATUS(queue)) &
267 AR5K_QCU_STS_FRMPENDCNT;
268 udelay(100);
269 } while (--i && pending);
270
271 AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW_5211,
272 AR5K_DIAG_SW_CHANEL_IDLE_HIGH);
273 }
274
236 /* Clear register */ 275 /* Clear register */
237 ath5k_hw_reg_write(ah, 0, AR5K_QCU_TXD); 276 ath5k_hw_reg_write(ah, 0, AR5K_QCU_TXD);
238 if (pending) 277 if (pending)
239 return -EBUSY; 278 return -EBUSY;
240 } 279 }
241 280
242 /* TODO: Check for success else return error */ 281 /* TODO: Check for success on 5210 else return error */
243 return 0; 282 return 0;
244} 283}
245 284
@@ -415,7 +454,7 @@ done:
415bool ath5k_hw_is_intr_pending(struct ath5k_hw *ah) 454bool ath5k_hw_is_intr_pending(struct ath5k_hw *ah)
416{ 455{
417 ATH5K_TRACE(ah->ah_sc); 456 ATH5K_TRACE(ah->ah_sc);
418 return ath5k_hw_reg_read(ah, AR5K_INTPEND); 457 return ath5k_hw_reg_read(ah, AR5K_INTPEND) == 1 ? 1 : 0;
419} 458}
420 459
421/** 460/**
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c
index c77cee2a5582..a47df9a24aa1 100644
--- a/drivers/net/wireless/ath5k/pcu.c
+++ b/drivers/net/wireless/ath5k/pcu.c
@@ -633,8 +633,20 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
633 */ 633 */
634void ath5k_hw_reset_tsf(struct ath5k_hw *ah) 634void ath5k_hw_reset_tsf(struct ath5k_hw *ah)
635{ 635{
636 u32 val;
637
636 ATH5K_TRACE(ah->ah_sc); 638 ATH5K_TRACE(ah->ah_sc);
637 AR5K_REG_ENABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_RESET_TSF); 639
640 val = ath5k_hw_reg_read(ah, AR5K_BEACON) | AR5K_BEACON_RESET_TSF;
641
642 /*
643 * Each write to the RESET_TSF bit toggles a hardware internal
644 * signal to reset TSF, but if left high it will cause a TSF reset
645 * on the next chip reset as well. Thus we always write the value
646 * twice to clear the signal.
647 */
648 ath5k_hw_reg_write(ah, val, AR5K_BEACON);
649 ath5k_hw_reg_write(ah, val, AR5K_BEACON);
638} 650}
639 651
640/* 652/*
diff --git a/drivers/net/wireless/ath5k/qcu.c b/drivers/net/wireless/ath5k/qcu.c
index 2e20f7816ca7..01bf09176d23 100644
--- a/drivers/net/wireless/ath5k/qcu.c
+++ b/drivers/net/wireless/ath5k/qcu.c
@@ -375,7 +375,7 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
375 case AR5K_TX_QUEUE_BEACON: 375 case AR5K_TX_QUEUE_BEACON:
376 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue), 376 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
377 AR5K_QCU_MISC_FRSHED_DBA_GT | 377 AR5K_QCU_MISC_FRSHED_DBA_GT |
378 AR5K_QCU_MISC_CBREXP_BCN | 378 AR5K_QCU_MISC_CBREXP_BCN_DIS |
379 AR5K_QCU_MISC_BCN_ENABLE); 379 AR5K_QCU_MISC_BCN_ENABLE);
380 380
381 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue), 381 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue),
@@ -395,8 +395,8 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
395 case AR5K_TX_QUEUE_CAB: 395 case AR5K_TX_QUEUE_CAB:
396 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue), 396 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
397 AR5K_QCU_MISC_FRSHED_DBA_GT | 397 AR5K_QCU_MISC_FRSHED_DBA_GT |
398 AR5K_QCU_MISC_CBREXP | 398 AR5K_QCU_MISC_CBREXP_DIS |
399 AR5K_QCU_MISC_CBREXP_BCN); 399 AR5K_QCU_MISC_CBREXP_BCN_DIS);
400 400
401 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue), 401 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue),
402 (AR5K_DCU_MISC_ARBLOCK_CTL_GLOBAL << 402 (AR5K_DCU_MISC_ARBLOCK_CTL_GLOBAL <<
@@ -405,7 +405,7 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
405 405
406 case AR5K_TX_QUEUE_UAPSD: 406 case AR5K_TX_QUEUE_UAPSD:
407 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue), 407 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
408 AR5K_QCU_MISC_CBREXP); 408 AR5K_QCU_MISC_CBREXP_DIS);
409 break; 409 break;
410 410
411 case AR5K_TX_QUEUE_DATA: 411 case AR5K_TX_QUEUE_DATA:
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h
index 410f99a6d616..e557fe178bbf 100644
--- a/drivers/net/wireless/ath5k/reg.h
+++ b/drivers/net/wireless/ath5k/reg.h
@@ -29,6 +29,10 @@
29 * http://www.it.iitb.ac.in/~janak/wifire/01222734.pdf 29 * http://www.it.iitb.ac.in/~janak/wifire/01222734.pdf
30 * 30 *
31 * 5211 - http://www.hotchips.org/archives/hc14/3_Tue/16_mcfarland.pdf 31 * 5211 - http://www.hotchips.org/archives/hc14/3_Tue/16_mcfarland.pdf
32 *
33 * This file also contains register values found on a memory dump of
34 * Atheros's ART program (Atheros Radio Test), on ath9k, on legacy-hal
35 * released by Atheros and on various debug messages found on the net.
32 */ 36 */
33 37
34 38
@@ -295,7 +299,7 @@
295#define AR5K_ISR_RXPHY 0x00004000 /* PHY error */ 299#define AR5K_ISR_RXPHY 0x00004000 /* PHY error */
296#define AR5K_ISR_RXKCM 0x00008000 /* RX Key cache miss */ 300#define AR5K_ISR_RXKCM 0x00008000 /* RX Key cache miss */
297#define AR5K_ISR_SWBA 0x00010000 /* Software beacon alert */ 301#define AR5K_ISR_SWBA 0x00010000 /* Software beacon alert */
298#define AR5K_ISR_BRSSI 0x00020000 302#define AR5K_ISR_BRSSI 0x00020000 /* Beacon rssi below threshold (?) */
299#define AR5K_ISR_BMISS 0x00040000 /* Beacon missed */ 303#define AR5K_ISR_BMISS 0x00040000 /* Beacon missed */
300#define AR5K_ISR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */ 304#define AR5K_ISR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */
301#define AR5K_ISR_BNR 0x00100000 /* Beacon not ready [5211+] */ 305#define AR5K_ISR_BNR 0x00100000 /* Beacon not ready [5211+] */
@@ -303,46 +307,56 @@
303#define AR5K_ISR_RXCHIRP 0x00200000 /* CHIRP Received [5212+] */ 307#define AR5K_ISR_RXCHIRP 0x00200000 /* CHIRP Received [5212+] */
304#define AR5K_ISR_SSERR 0x00200000 /* Signaled System Error [5210] */ 308#define AR5K_ISR_SSERR 0x00200000 /* Signaled System Error [5210] */
305#define AR5K_ISR_DPERR 0x00400000 /* Det par Error (?) [5210] */ 309#define AR5K_ISR_DPERR 0x00400000 /* Det par Error (?) [5210] */
306#define AR5K_ISR_TIM 0x00800000 /* [5210] */ 310#define AR5K_ISR_RXDOPPLER 0x00400000 /* Doppler chirp received [5212+] */
307#define AR5K_ISR_BCNMISC 0x00800000 /* [5212+] */ 311#define AR5K_ISR_TIM 0x00800000 /* [5211+] */
308#define AR5K_ISR_GPIO 0x01000000 /* GPIO (rf kill)*/ 312#define AR5K_ISR_BCNMISC 0x00800000 /* 'or' of TIM, CAB_END, DTIM_SYNC, BCN_TIMEOUT,
309#define AR5K_ISR_QCBRORN 0x02000000 /* CBR overrun (?) [5211+] */ 313 CAB_TIMEOUT and DTIM bits from SISR2 [5212+] */
310#define AR5K_ISR_QCBRURN 0x04000000 /* CBR underrun (?) [5211+] */ 314#define AR5K_ISR_GPIO 0x01000000 /* GPIO (rf kill) */
311#define AR5K_ISR_QTRIG 0x08000000 /* [5211+] */ 315#define AR5K_ISR_QCBRORN 0x02000000 /* QCU CBR overrun [5211+] */
316#define AR5K_ISR_QCBRURN 0x04000000 /* QCU CBR underrun [5211+] */
317#define AR5K_ISR_QTRIG 0x08000000 /* QCU scheduling trigger [5211+] */
312 318
313/* 319/*
314 * Secondary status registers [5211+] (0 - 4) 320 * Secondary status registers [5211+] (0 - 4)
315 * 321 *
316 * I guess from the names that these give the status for each 322 * These give the status for each QCU, only QCUs 0-9 are
317 * queue, that's why only masks are defined here, haven't got 323 * represented.
318 * any info about them (couldn't find them anywhere in ar5k code).
319 */ 324 */
320#define AR5K_SISR0 0x0084 /* Register Address [5211+] */ 325#define AR5K_SISR0 0x0084 /* Register Address [5211+] */
321#define AR5K_SISR0_QCU_TXOK 0x000003ff /* Mask for QCU_TXOK */ 326#define AR5K_SISR0_QCU_TXOK 0x000003ff /* Mask for QCU_TXOK */
327#define AR5K_SISR0_QCU_TXOK_S 0
322#define AR5K_SISR0_QCU_TXDESC 0x03ff0000 /* Mask for QCU_TXDESC */ 328#define AR5K_SISR0_QCU_TXDESC 0x03ff0000 /* Mask for QCU_TXDESC */
329#define AR5K_SISR0_QCU_TXDESC_S 16
323 330
324#define AR5K_SISR1 0x0088 /* Register Address [5211+] */ 331#define AR5K_SISR1 0x0088 /* Register Address [5211+] */
325#define AR5K_SISR1_QCU_TXERR 0x000003ff /* Mask for QCU_TXERR */ 332#define AR5K_SISR1_QCU_TXERR 0x000003ff /* Mask for QCU_TXERR */
333#define AR5K_SISR1_QCU_TXERR_S 0
326#define AR5K_SISR1_QCU_TXEOL 0x03ff0000 /* Mask for QCU_TXEOL */ 334#define AR5K_SISR1_QCU_TXEOL 0x03ff0000 /* Mask for QCU_TXEOL */
335#define AR5K_SISR1_QCU_TXEOL_S 16
327 336
328#define AR5K_SISR2 0x008c /* Register Address [5211+] */ 337#define AR5K_SISR2 0x008c /* Register Address [5211+] */
329#define AR5K_SISR2_QCU_TXURN 0x000003ff /* Mask for QCU_TXURN */ 338#define AR5K_SISR2_QCU_TXURN 0x000003ff /* Mask for QCU_TXURN */
339#define AR5K_SISR2_QCU_TXURN_S 0
330#define AR5K_SISR2_MCABT 0x00100000 /* Master Cycle Abort */ 340#define AR5K_SISR2_MCABT 0x00100000 /* Master Cycle Abort */
331#define AR5K_SISR2_SSERR 0x00200000 /* Signaled System Error */ 341#define AR5K_SISR2_SSERR 0x00200000 /* Signaled System Error */
332#define AR5K_SISR2_DPERR 0x00400000 /* Det par Error (?) */ 342#define AR5K_SISR2_DPERR 0x00400000 /* Bus parity error */
333#define AR5K_SISR2_TIM 0x01000000 /* [5212+] */ 343#define AR5K_SISR2_TIM 0x01000000 /* [5212+] */
334#define AR5K_SISR2_CAB_END 0x02000000 /* [5212+] */ 344#define AR5K_SISR2_CAB_END 0x02000000 /* [5212+] */
335#define AR5K_SISR2_DTIM_SYNC 0x04000000 /* DTIM sync lost [5212+] */ 345#define AR5K_SISR2_DTIM_SYNC 0x04000000 /* DTIM sync lost [5212+] */
336#define AR5K_SISR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */ 346#define AR5K_SISR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */
337#define AR5K_SISR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */ 347#define AR5K_SISR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */
338#define AR5K_SISR2_DTIM 0x20000000 /* [5212+] */ 348#define AR5K_SISR2_DTIM 0x20000000 /* [5212+] */
349#define AR5K_SISR2_TSFOOR 0x80000000 /* TSF OOR (?) */
339 350
340#define AR5K_SISR3 0x0090 /* Register Address [5211+] */ 351#define AR5K_SISR3 0x0090 /* Register Address [5211+] */
341#define AR5K_SISR3_QCBRORN 0x000003ff /* Mask for QCBRORN */ 352#define AR5K_SISR3_QCBRORN 0x000003ff /* Mask for QCBRORN */
353#define AR5K_SISR3_QCBORN_S 0
342#define AR5K_SISR3_QCBRURN 0x03ff0000 /* Mask for QCBRURN */ 354#define AR5K_SISR3_QCBRURN 0x03ff0000 /* Mask for QCBRURN */
355#define AR5K_SISR3_QCBRURN_S 16
343 356
344#define AR5K_SISR4 0x0094 /* Register Address [5211+] */ 357#define AR5K_SISR4 0x0094 /* Register Address [5211+] */
345#define AR5K_SISR4_QTRIG 0x000003ff /* Mask for QTRIG */ 358#define AR5K_SISR4_QTRIG 0x000003ff /* Mask for QTRIG */
359#define AR5K_SISR4_QTRIG_S 0
346 360
347/* 361/*
348 * Shadow read-and-clear interrupt status registers [5211+] 362 * Shadow read-and-clear interrupt status registers [5211+]
@@ -379,7 +393,7 @@
379#define AR5K_IMR_RXPHY 0x00004000 /* PHY error*/ 393#define AR5K_IMR_RXPHY 0x00004000 /* PHY error*/
380#define AR5K_IMR_RXKCM 0x00008000 /* RX Key cache miss */ 394#define AR5K_IMR_RXKCM 0x00008000 /* RX Key cache miss */
381#define AR5K_IMR_SWBA 0x00010000 /* Software beacon alert*/ 395#define AR5K_IMR_SWBA 0x00010000 /* Software beacon alert*/
382#define AR5K_IMR_BRSSI 0x00020000 396#define AR5K_IMR_BRSSI 0x00020000 /* Beacon rssi below threshold (?) */
383#define AR5K_IMR_BMISS 0x00040000 /* Beacon missed*/ 397#define AR5K_IMR_BMISS 0x00040000 /* Beacon missed*/
384#define AR5K_IMR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */ 398#define AR5K_IMR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */
385#define AR5K_IMR_BNR 0x00100000 /* Beacon not ready [5211+] */ 399#define AR5K_IMR_BNR 0x00100000 /* Beacon not ready [5211+] */
@@ -387,12 +401,14 @@
387#define AR5K_IMR_RXCHIRP 0x00200000 /* CHIRP Received [5212+]*/ 401#define AR5K_IMR_RXCHIRP 0x00200000 /* CHIRP Received [5212+]*/
388#define AR5K_IMR_SSERR 0x00200000 /* Signaled System Error [5210] */ 402#define AR5K_IMR_SSERR 0x00200000 /* Signaled System Error [5210] */
389#define AR5K_IMR_DPERR 0x00400000 /* Det par Error (?) [5210] */ 403#define AR5K_IMR_DPERR 0x00400000 /* Det par Error (?) [5210] */
404#define AR5K_IMR_RXDOPPLER 0x00400000 /* Doppler chirp received [5212+] */
390#define AR5K_IMR_TIM 0x00800000 /* [5211+] */ 405#define AR5K_IMR_TIM 0x00800000 /* [5211+] */
391#define AR5K_IMR_BCNMISC 0x00800000 /* [5212+] */ 406#define AR5K_IMR_BCNMISC 0x00800000 /* 'or' of TIM, CAB_END, DTIM_SYNC, BCN_TIMEOUT,
407 CAB_TIMEOUT and DTIM bits from SISR2 [5212+] */
392#define AR5K_IMR_GPIO 0x01000000 /* GPIO (rf kill)*/ 408#define AR5K_IMR_GPIO 0x01000000 /* GPIO (rf kill)*/
393#define AR5K_IMR_QCBRORN 0x02000000 /* CBR overrun (?) [5211+] */ 409#define AR5K_IMR_QCBRORN 0x02000000 /* QCU CBR overrun (?) [5211+] */
394#define AR5K_IMR_QCBRURN 0x04000000 /* CBR underrun (?) [5211+] */ 410#define AR5K_IMR_QCBRURN 0x04000000 /* QCU CBR underrun (?) [5211+] */
395#define AR5K_IMR_QTRIG 0x08000000 /* [5211+] */ 411#define AR5K_IMR_QTRIG 0x08000000 /* QCU scheduling trigger [5211+] */
396 412
397/* 413/*
398 * Secondary interrupt mask registers [5211+] (0 - 4) 414 * Secondary interrupt mask registers [5211+] (0 - 4)
@@ -414,13 +430,14 @@
414#define AR5K_SIMR2_QCU_TXURN_S 0 430#define AR5K_SIMR2_QCU_TXURN_S 0
415#define AR5K_SIMR2_MCABT 0x00100000 /* Master Cycle Abort */ 431#define AR5K_SIMR2_MCABT 0x00100000 /* Master Cycle Abort */
416#define AR5K_SIMR2_SSERR 0x00200000 /* Signaled System Error */ 432#define AR5K_SIMR2_SSERR 0x00200000 /* Signaled System Error */
417#define AR5K_SIMR2_DPERR 0x00400000 /* Det par Error (?) */ 433#define AR5K_SIMR2_DPERR 0x00400000 /* Bus parity error */
418#define AR5K_SIMR2_TIM 0x01000000 /* [5212+] */ 434#define AR5K_SIMR2_TIM 0x01000000 /* [5212+] */
419#define AR5K_SIMR2_CAB_END 0x02000000 /* [5212+] */ 435#define AR5K_SIMR2_CAB_END 0x02000000 /* [5212+] */
420#define AR5K_SIMR2_DTIM_SYNC 0x04000000 /* DTIM Sync lost [5212+] */ 436#define AR5K_SIMR2_DTIM_SYNC 0x04000000 /* DTIM Sync lost [5212+] */
421#define AR5K_SIMR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */ 437#define AR5K_SIMR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */
422#define AR5K_SIMR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */ 438#define AR5K_SIMR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */
423#define AR5K_SIMR2_DTIM 0x20000000 /* [5212+] */ 439#define AR5K_SIMR2_DTIM 0x20000000 /* [5212+] */
440#define AR5K_SIMR2_TSFOOR 0x80000000 /* TSF OOR (?) */
424 441
425#define AR5K_SIMR3 0x00b0 /* Register Address [5211+] */ 442#define AR5K_SIMR3 0x00b0 /* Register Address [5211+] */
426#define AR5K_SIMR3_QCBRORN 0x000003ff /* Mask for QCBRORN */ 443#define AR5K_SIMR3_QCBRORN 0x000003ff /* Mask for QCBRORN */
@@ -586,15 +603,15 @@
586#define AR5K_QCU_MISC_FRSHED_M 0x0000000f /* Frame sheduling mask */ 603#define AR5K_QCU_MISC_FRSHED_M 0x0000000f /* Frame sheduling mask */
587#define AR5K_QCU_MISC_FRSHED_ASAP 0 /* ASAP */ 604#define AR5K_QCU_MISC_FRSHED_ASAP 0 /* ASAP */
588#define AR5K_QCU_MISC_FRSHED_CBR 1 /* Constant Bit Rate */ 605#define AR5K_QCU_MISC_FRSHED_CBR 1 /* Constant Bit Rate */
589#define AR5K_QCU_MISC_FRSHED_DBA_GT 2 /* DMA Beacon alert gated (?) */ 606#define AR5K_QCU_MISC_FRSHED_DBA_GT 2 /* DMA Beacon alert gated */
590#define AR5K_QCU_MISC_FRSHED_TIM_GT 3 /* Time gated (?) */ 607#define AR5K_QCU_MISC_FRSHED_TIM_GT 3 /* TIMT gated */
591#define AR5K_QCU_MISC_FRSHED_BCN_SENT_GT 4 /* Beacon sent gated (?) */ 608#define AR5K_QCU_MISC_FRSHED_BCN_SENT_GT 4 /* Beacon sent gated */
592#define AR5K_QCU_MISC_ONESHOT_ENABLE 0x00000010 /* Oneshot enable */ 609#define AR5K_QCU_MISC_ONESHOT_ENABLE 0x00000010 /* Oneshot enable */
593#define AR5K_QCU_MISC_CBREXP 0x00000020 /* CBR expired (normal queue) */ 610#define AR5K_QCU_MISC_CBREXP_DIS 0x00000020 /* Disable CBR expired counter (normal queue) */
594#define AR5K_QCU_MISC_CBREXP_BCN 0x00000040 /* CBR expired (beacon queue) */ 611#define AR5K_QCU_MISC_CBREXP_BCN_DIS 0x00000040 /* Disable CBR expired counter (beacon queue) */
595#define AR5K_QCU_MISC_BCN_ENABLE 0x00000080 /* Enable Beacon use */ 612#define AR5K_QCU_MISC_BCN_ENABLE 0x00000080 /* Enable Beacon use */
596#define AR5K_QCU_MISC_CBR_THRES_ENABLE 0x00000100 /* CBR threshold enabled */ 613#define AR5K_QCU_MISC_CBR_THRES_ENABLE 0x00000100 /* CBR expired threshold enabled */
597#define AR5K_QCU_MISC_RDY_VEOL_POLICY 0x00000200 /* TXE reset when RDYTIME enalbed */ 614#define AR5K_QCU_MISC_RDY_VEOL_POLICY 0x00000200 /* TXE reset when RDYTIME expired or VEOL */
598#define AR5K_QCU_MISC_CBR_RESET_CNT 0x00000400 /* CBR threshold (counter) reset */ 615#define AR5K_QCU_MISC_CBR_RESET_CNT 0x00000400 /* CBR threshold (counter) reset */
599#define AR5K_QCU_MISC_DCU_EARLY 0x00000800 /* DCU early termination */ 616#define AR5K_QCU_MISC_DCU_EARLY 0x00000800 /* DCU early termination */
600#define AR5K_QCU_MISC_DCU_CMP_EN 0x00001000 /* Enable frame compression */ 617#define AR5K_QCU_MISC_DCU_CMP_EN 0x00001000 /* Enable frame compression */
@@ -663,6 +680,7 @@
663#define AR5K_DCU_LCL_IFS_CW_MAX_S 10 680#define AR5K_DCU_LCL_IFS_CW_MAX_S 10
664#define AR5K_DCU_LCL_IFS_AIFS 0x0ff00000 /* Arbitrated Interframe Space */ 681#define AR5K_DCU_LCL_IFS_AIFS 0x0ff00000 /* Arbitrated Interframe Space */
665#define AR5K_DCU_LCL_IFS_AIFS_S 20 682#define AR5K_DCU_LCL_IFS_AIFS_S 20
683#define AR5K_DCU_LCL_IFS_AIFS_MAX 0xfc /* Anything above that can cause DCU to hang */
666#define AR5K_QUEUE_DFS_LOCAL_IFS(_q) AR5K_QUEUE_REG(AR5K_DCU_LCL_IFS_BASE, _q) 684#define AR5K_QUEUE_DFS_LOCAL_IFS(_q) AR5K_QUEUE_REG(AR5K_DCU_LCL_IFS_BASE, _q)
667 685
668/* 686/*
@@ -691,11 +709,7 @@
691/* 709/*
692 * DCU misc registers [5211+] 710 * DCU misc registers [5211+]
693 * 711 *
694 * For some of the registers i couldn't find in the code 712 * Note: Arbiter lockout control controls the
695 * (only backoff stuff is there realy) i tried to match the
696 * names with 802.11e parameters etc, so i guess VIRTCOL here
697 * means Virtual Collision and HCFPOLL means Hybrid Coordination
698 * factor Poll (CF- Poll). Arbiter lockout control controls the
699 * behaviour on low priority queues when we have multiple queues 713 * behaviour on low priority queues when we have multiple queues
700 * with pending frames. Intra-frame lockout means we wait until 714 * with pending frames. Intra-frame lockout means we wait until
701 * the queue's current frame transmits (with post frame backoff and bursting) 715 * the queue's current frame transmits (with post frame backoff and bursting)
@@ -705,15 +719,20 @@
705 * No lockout means there is no special handling. 719 * No lockout means there is no special handling.
706 */ 720 */
707#define AR5K_DCU_MISC_BASE 0x1100 /* Register Address -Queue0 DCU_MISC */ 721#define AR5K_DCU_MISC_BASE 0x1100 /* Register Address -Queue0 DCU_MISC */
708#define AR5K_DCU_MISC_BACKOFF 0x000007ff /* Mask for backoff threshold */ 722#define AR5K_DCU_MISC_BACKOFF 0x0000003f /* Mask for backoff threshold */
723#define AR5K_DCU_MISC_ETS_RTS_POL 0x00000040 /* End of transmission series
724 station RTS/data failure count
725 reset policy (?) */
726#define AR5K_DCU_MISC_ETS_CW_POL 0x00000080 /* End of transmission series
727 CW reset policy */
728#define AR5K_DCU_MISC_FRAG_WAIT 0x00000100 /* Wait for next fragment */
709#define AR5K_DCU_MISC_BACKOFF_FRAG 0x00000200 /* Enable backoff while bursting */ 729#define AR5K_DCU_MISC_BACKOFF_FRAG 0x00000200 /* Enable backoff while bursting */
710#define AR5K_DCU_MISC_HCFPOLL_ENABLE 0x00000800 /* CF - Poll enable */ 730#define AR5K_DCU_MISC_HCFPOLL_ENABLE 0x00000800 /* CF - Poll enable */
711#define AR5K_DCU_MISC_BACKOFF_PERSIST 0x00001000 /* Persistent backoff */ 731#define AR5K_DCU_MISC_BACKOFF_PERSIST 0x00001000 /* Persistent backoff */
712#define AR5K_DCU_MISC_FRMPRFTCH_ENABLE 0x00002000 /* Enable frame pre-fetch */ 732#define AR5K_DCU_MISC_FRMPRFTCH_ENABLE 0x00002000 /* Enable frame pre-fetch */
713#define AR5K_DCU_MISC_VIRTCOL 0x0000c000 /* Mask for Virtual Collision (?) */ 733#define AR5K_DCU_MISC_VIRTCOL 0x0000c000 /* Mask for Virtual Collision (?) */
714#define AR5K_DCU_MISC_VIRTCOL_NORMAL 0 734#define AR5K_DCU_MISC_VIRTCOL_NORMAL 0
715#define AR5K_DCU_MISC_VIRTCOL_MODIFIED 1 735#define AR5K_DCU_MISC_VIRTCOL_IGNORE 1
716#define AR5K_DCU_MISC_VIRTCOL_IGNORE 2
717#define AR5K_DCU_MISC_BCN_ENABLE 0x00010000 /* Enable Beacon use */ 736#define AR5K_DCU_MISC_BCN_ENABLE 0x00010000 /* Enable Beacon use */
718#define AR5K_DCU_MISC_ARBLOCK_CTL 0x00060000 /* Arbiter lockout control mask */ 737#define AR5K_DCU_MISC_ARBLOCK_CTL 0x00060000 /* Arbiter lockout control mask */
719#define AR5K_DCU_MISC_ARBLOCK_CTL_S 17 738#define AR5K_DCU_MISC_ARBLOCK_CTL_S 17
@@ -768,8 +787,9 @@
768#define AR5K_DCU_GBL_IFS_MISC_TURBO_MODE 0x00000008 /* Turbo mode */ 787#define AR5K_DCU_GBL_IFS_MISC_TURBO_MODE 0x00000008 /* Turbo mode */
769#define AR5K_DCU_GBL_IFS_MISC_SIFS_DUR_USEC 0x000003f0 /* SIFS Duration mask */ 788#define AR5K_DCU_GBL_IFS_MISC_SIFS_DUR_USEC 0x000003f0 /* SIFS Duration mask */
770#define AR5K_DCU_GBL_IFS_MISC_USEC_DUR 0x000ffc00 /* USEC Duration mask */ 789#define AR5K_DCU_GBL_IFS_MISC_USEC_DUR 0x000ffc00 /* USEC Duration mask */
790#define AR5K_DCU_GBL_IFS_MISC_USEC_DUR_S 10
771#define AR5K_DCU_GBL_IFS_MISC_DCU_ARB_DELAY 0x00300000 /* DCU Arbiter delay mask */ 791#define AR5K_DCU_GBL_IFS_MISC_DCU_ARB_DELAY 0x00300000 /* DCU Arbiter delay mask */
772#define AR5K_DCU_GBL_IFS_MISC_SIFS_CNT_RST 0x00400000 /* SIFC cnt reset policy (?) */ 792#define AR5K_DCU_GBL_IFS_MISC_SIFS_CNT_RST 0x00400000 /* SIFS cnt reset policy (?) */
773#define AR5K_DCU_GBL_IFS_MISC_AIFS_CNT_RST 0x00800000 /* AIFS cnt reset policy (?) */ 793#define AR5K_DCU_GBL_IFS_MISC_AIFS_CNT_RST 0x00800000 /* AIFS cnt reset policy (?) */
774#define AR5K_DCU_GBL_IFS_MISC_RND_LFSR_SL_DIS 0x01000000 /* Disable random LFSR slice */ 794#define AR5K_DCU_GBL_IFS_MISC_RND_LFSR_SL_DIS 0x01000000 /* Disable random LFSR slice */
775 795
@@ -831,9 +851,11 @@
831#define AR5K_SLEEP_CTL_SLE_S 16 851#define AR5K_SLEEP_CTL_SLE_S 16
832#define AR5K_SLEEP_CTL_SLE_WAKE 0x00000000 /* Force chip awake */ 852#define AR5K_SLEEP_CTL_SLE_WAKE 0x00000000 /* Force chip awake */
833#define AR5K_SLEEP_CTL_SLE_SLP 0x00010000 /* Force chip sleep */ 853#define AR5K_SLEEP_CTL_SLE_SLP 0x00010000 /* Force chip sleep */
834#define AR5K_SLEEP_CTL_SLE_ALLOW 0x00020000 854#define AR5K_SLEEP_CTL_SLE_ALLOW 0x00020000 /* Normal sleep policy */
835#define AR5K_SLEEP_CTL_SLE_UNITS 0x00000008 /* [5211+] */ 855#define AR5K_SLEEP_CTL_SLE_UNITS 0x00000008 /* [5211+] */
836/* more bits */ 856#define AR5K_SLEEP_CTL_DUR_TIM_POL 0x00040000 /* Sleep duration timing policy */
857#define AR5K_SLEEP_CTL_DUR_WRITE_POL 0x00080000 /* Sleep duration write policy */
858#define AR5K_SLEEP_CTL_SLE_POL 0x00100000 /* Sleep policy mode */
837 859
838/* 860/*
839 * Interrupt pending register 861 * Interrupt pending register
@@ -849,27 +871,28 @@
849 871
850/* 872/*
851 * PCI configuration register 873 * PCI configuration register
874 * TODO: Fix LED stuff
852 */ 875 */
853#define AR5K_PCICFG 0x4010 /* Register Address */ 876#define AR5K_PCICFG 0x4010 /* Register Address */
854#define AR5K_PCICFG_EEAE 0x00000001 /* Eeprom access enable [5210] */ 877#define AR5K_PCICFG_EEAE 0x00000001 /* Eeprom access enable [5210] */
855#define AR5K_PCICFG_SLEEP_CLOCK_EN 0x00000002 /* Enable sleep clock (?) */ 878#define AR5K_PCICFG_SLEEP_CLOCK_EN 0x00000002 /* Enable sleep clock */
856#define AR5K_PCICFG_CLKRUNEN 0x00000004 /* CLKRUN enable [5211+] */ 879#define AR5K_PCICFG_CLKRUNEN 0x00000004 /* CLKRUN enable [5211+] */
857#define AR5K_PCICFG_EESIZE 0x00000018 /* Mask for EEPROM size [5211+] */ 880#define AR5K_PCICFG_EESIZE 0x00000018 /* Mask for EEPROM size [5211+] */
858#define AR5K_PCICFG_EESIZE_S 3 881#define AR5K_PCICFG_EESIZE_S 3
859#define AR5K_PCICFG_EESIZE_4K 0 /* 4K */ 882#define AR5K_PCICFG_EESIZE_4K 0 /* 4K */
860#define AR5K_PCICFG_EESIZE_8K 1 /* 8K */ 883#define AR5K_PCICFG_EESIZE_8K 1 /* 8K */
861#define AR5K_PCICFG_EESIZE_16K 2 /* 16K */ 884#define AR5K_PCICFG_EESIZE_16K 2 /* 16K */
862#define AR5K_PCICFG_EESIZE_FAIL 3 /* Failed to get size (?) [5211+] */ 885#define AR5K_PCICFG_EESIZE_FAIL 3 /* Failed to get size [5211+] */
863#define AR5K_PCICFG_LED 0x00000060 /* Led status [5211+] */ 886#define AR5K_PCICFG_LED 0x00000060 /* Led status [5211+] */
864#define AR5K_PCICFG_LED_NONE 0x00000000 /* Default [5211+] */ 887#define AR5K_PCICFG_LED_NONE 0x00000000 /* Default [5211+] */
865#define AR5K_PCICFG_LED_PEND 0x00000020 /* Scan / Auth pending */ 888#define AR5K_PCICFG_LED_PEND 0x00000020 /* Scan / Auth pending */
866#define AR5K_PCICFG_LED_ASSOC 0x00000040 /* Associated */ 889#define AR5K_PCICFG_LED_ASSOC 0x00000040 /* Associated */
867#define AR5K_PCICFG_BUS_SEL 0x00000380 /* Mask for "bus select" [5211+] (?) */ 890#define AR5K_PCICFG_BUS_SEL 0x00000380 /* Mask for "bus select" [5211+] (?) */
868#define AR5K_PCICFG_CBEFIX_DIS 0x00000400 /* Disable CBE fix (?) */ 891#define AR5K_PCICFG_CBEFIX_DIS 0x00000400 /* Disable CBE fix */
869#define AR5K_PCICFG_SL_INTEN 0x00000800 /* Enable interrupts when asleep (?) */ 892#define AR5K_PCICFG_SL_INTEN 0x00000800 /* Enable interrupts when asleep */
870#define AR5K_PCICFG_LED_BCTL 0x00001000 /* Led blink (?) [5210] */ 893#define AR5K_PCICFG_LED_BCTL 0x00001000 /* Led blink (?) [5210] */
871#define AR5K_PCICFG_UNK 0x00001000 /* Passed on some parts durring attach (?) */ 894#define AR5K_PCICFG_RETRY_FIX 0x00001000 /* Enable pci core retry fix */
872#define AR5K_PCICFG_SL_INPEN 0x00002000 /* Sleep even whith pending interrupts (?) */ 895#define AR5K_PCICFG_SL_INPEN 0x00002000 /* Sleep even whith pending interrupts*/
873#define AR5K_PCICFG_SPWR_DN 0x00010000 /* Mask for power status */ 896#define AR5K_PCICFG_SPWR_DN 0x00010000 /* Mask for power status */
874#define AR5K_PCICFG_LEDMODE 0x000e0000 /* Ledmode [5211+] */ 897#define AR5K_PCICFG_LEDMODE 0x000e0000 /* Ledmode [5211+] */
875#define AR5K_PCICFG_LEDMODE_PROP 0x00000000 /* Blink on standard traffic [5211+] */ 898#define AR5K_PCICFG_LEDMODE_PROP 0x00000000 /* Blink on standard traffic [5211+] */
@@ -882,7 +905,8 @@
882#define AR5K_PCICFG_LEDSTATE \ 905#define AR5K_PCICFG_LEDSTATE \
883 (AR5K_PCICFG_LED | AR5K_PCICFG_LEDMODE | \ 906 (AR5K_PCICFG_LED | AR5K_PCICFG_LEDMODE | \
884 AR5K_PCICFG_LEDBLINK | AR5K_PCICFG_LEDSLOW) 907 AR5K_PCICFG_LEDBLINK | AR5K_PCICFG_LEDSLOW)
885#define AR5K_PCICFG_SLEEP_CLOCK_RATE 0x03000000 /* Sleep clock rate (field) */ 908#define AR5K_PCICFG_SLEEP_CLOCK_RATE 0x03000000 /* Sleep clock rate */
909#define AR5K_PCICFG_SLEEP_CLOCK_RATE_S 24
886 910
887/* 911/*
888 * "General Purpose Input/Output" (GPIO) control register 912 * "General Purpose Input/Output" (GPIO) control register
@@ -904,8 +928,8 @@
904 928
905#define AR5K_GPIOCR 0x4014 /* Register Address */ 929#define AR5K_GPIOCR 0x4014 /* Register Address */
906#define AR5K_GPIOCR_INT_ENA 0x00008000 /* Enable GPIO interrupt */ 930#define AR5K_GPIOCR_INT_ENA 0x00008000 /* Enable GPIO interrupt */
907#define AR5K_GPIOCR_INT_SELL 0x00000000 /* Generate interrupt when pin is off (?) */ 931#define AR5K_GPIOCR_INT_SELL 0x00000000 /* Generate interrupt when pin is low */
908#define AR5K_GPIOCR_INT_SELH 0x00010000 /* Generate interrupt when pin is on */ 932#define AR5K_GPIOCR_INT_SELH 0x00010000 /* Generate interrupt when pin is high */
909#define AR5K_GPIOCR_IN(n) (0 << ((n) * 2)) /* Mode 0 for pin n */ 933#define AR5K_GPIOCR_IN(n) (0 << ((n) * 2)) /* Mode 0 for pin n */
910#define AR5K_GPIOCR_OUT0(n) (1 << ((n) * 2)) /* Mode 1 for pin n */ 934#define AR5K_GPIOCR_OUT0(n) (1 << ((n) * 2)) /* Mode 1 for pin n */
911#define AR5K_GPIOCR_OUT1(n) (2 << ((n) * 2)) /* Mode 2 for pin n */ 935#define AR5K_GPIOCR_OUT1(n) (2 << ((n) * 2)) /* Mode 2 for pin n */
@@ -923,7 +947,6 @@
923#define AR5K_GPIODI 0x401c 947#define AR5K_GPIODI 0x401c
924#define AR5K_GPIODI_M 0x0000002f 948#define AR5K_GPIODI_M 0x0000002f
925 949
926
927/* 950/*
928 * Silicon revision register 951 * Silicon revision register
929 */ 952 */
@@ -933,7 +956,59 @@
933#define AR5K_SREV_VER 0x000000ff /* Mask for version */ 956#define AR5K_SREV_VER 0x000000ff /* Mask for version */
934#define AR5K_SREV_VER_S 4 957#define AR5K_SREV_VER_S 4
935 958
959/*
960 * TXE write posting register
961 */
962#define AR5K_TXEPOST 0x4028
963
964/*
965 * QCU sleep mask
966 */
967#define AR5K_QCU_SLEEP_MASK 0x402c
968
969/* 0x4068 is compression buffer configuration
970 * register on 5414 and pm configuration register
971 * on 5424 and newer pci-e chips. */
972
973/*
974 * Compression buffer configuration
975 * register (enable/disable) [5414]
976 */
977#define AR5K_5414_CBCFG 0x4068
978#define AR5K_5414_CBCFG_BUF_DIS 0x10 /* Disable buffer */
979
980/*
981 * PCI-E Power managment configuration
982 * and status register [5424+]
983 */
984#define AR5K_PCIE_PM_CTL 0x4068 /* Register address */
985/* Only 5424 */
986#define AR5K_PCIE_PM_CTL_L1_WHEN_D2 0x00000001 /* enable PCIe core enter L1
987 when d2_sleep_en is asserted */
988#define AR5K_PCIE_PM_CTL_L0_L0S_CLEAR 0x00000002 /* Clear L0 and L0S counters */
989#define AR5K_PCIE_PM_CTL_L0_L0S_EN 0x00000004 /* Start L0 nd L0S counters */
990#define AR5K_PCIE_PM_CTL_LDRESET_EN 0x00000008 /* Enable reset when link goes
991 down */
992/* Wake On Wireless */
993#define AR5K_PCIE_PM_CTL_PME_EN 0x00000010 /* PME Enable */
994#define AR5K_PCIE_PM_CTL_AUX_PWR_DET 0x00000020 /* Aux power detect */
995#define AR5K_PCIE_PM_CTL_PME_CLEAR 0x00000040 /* Clear PME */
996#define AR5K_PCIE_PM_CTL_PSM_D0 0x00000080
997#define AR5K_PCIE_PM_CTL_PSM_D1 0x00000100
998#define AR5K_PCIE_PM_CTL_PSM_D2 0x00000200
999#define AR5K_PCIE_PM_CTL_PSM_D3 0x00000400
1000
1001/*
1002 * PCI-E Workaround enable register
1003 */
1004#define AR5K_PCIE_WAEN 0x407c
936 1005
1006/*
1007 * PCI-E Serializer/Desirializer
1008 * registers
1009 */
1010#define AR5K_PCIE_SERDES 0x4080
1011#define AR5K_PCIE_SERDES_RESET 0x4084
937 1012
938/*====EEPROM REGISTERS====*/ 1013/*====EEPROM REGISTERS====*/
939 1014
@@ -1006,14 +1081,28 @@
1006 * EEPROM config register 1081 * EEPROM config register
1007 */ 1082 */
1008#define AR5K_EEPROM_CFG 0x6010 /* Register Addres */ 1083#define AR5K_EEPROM_CFG 0x6010 /* Register Addres */
1009#define AR5K_EEPROM_CFG_SIZE_OVR 0x00000001 1084#define AR5K_EEPROM_CFG_SIZE 0x00000003 /* Size determination override */
1085#define AR5K_EEPROM_CFG_SIZE_AUTO 0
1086#define AR5K_EEPROM_CFG_SIZE_4KBIT 1
1087#define AR5K_EEPROM_CFG_SIZE_8KBIT 2
1088#define AR5K_EEPROM_CFG_SIZE_16KBIT 3
1010#define AR5K_EEPROM_CFG_WR_WAIT_DIS 0x00000004 /* Disable write wait */ 1089#define AR5K_EEPROM_CFG_WR_WAIT_DIS 0x00000004 /* Disable write wait */
1011#define AR5K_EEPROM_CFG_CLK_RATE 0x00000018 /* Clock rate */ 1090#define AR5K_EEPROM_CFG_CLK_RATE 0x00000018 /* Clock rate */
1012#define AR5K_EEPROM_CFG_PROT_KEY 0x00ffff00 /* Protectio key */ 1091#define AR5K_EEPROM_CFG_CLK_RATE_S 3
1092#define AR5K_EEPROM_CFG_CLK_RATE_156KHZ 0
1093#define AR5K_EEPROM_CFG_CLK_RATE_312KHZ 1
1094#define AR5K_EEPROM_CFG_CLK_RATE_625KHZ 2
1095#define AR5K_EEPROM_CFG_PROT_KEY 0x00ffff00 /* Protection key */
1096#define AR5K_EEPROM_CFG_PROT_KEY_S 8
1013#define AR5K_EEPROM_CFG_LIND_EN 0x01000000 /* Enable length indicator (?) */ 1097#define AR5K_EEPROM_CFG_LIND_EN 0x01000000 /* Enable length indicator (?) */
1014 1098
1015 1099
1016/* 1100/*
1101 * TODO: Wake On Wireless registers
1102 * Range 0x7000 - 0x7ce0
1103 */
1104
1105/*
1017 * Protocol Control Unit (PCU) registers 1106 * Protocol Control Unit (PCU) registers
1018 */ 1107 */
1019/* 1108/*
@@ -1045,11 +1134,13 @@
1045#define AR5K_STA_ID1_DESC_ANTENNA 0x00400000 /* Update antenna from descriptor */ 1134#define AR5K_STA_ID1_DESC_ANTENNA 0x00400000 /* Update antenna from descriptor */
1046#define AR5K_STA_ID1_RTS_DEF_ANTENNA 0x00800000 /* Use default antenna for RTS */ 1135#define AR5K_STA_ID1_RTS_DEF_ANTENNA 0x00800000 /* Use default antenna for RTS */
1047#define AR5K_STA_ID1_ACKCTS_6MB 0x01000000 /* Use 6Mbit/s for ACK/CTS */ 1136#define AR5K_STA_ID1_ACKCTS_6MB 0x01000000 /* Use 6Mbit/s for ACK/CTS */
1048#define AR5K_STA_ID1_BASE_RATE_11B 0x02000000 /* Use 11b base rate (for ACK/CTS ?) [5211+] */ 1137#define AR5K_STA_ID1_BASE_RATE_11B 0x02000000 /* Use 11b base rate for ACK/CTS [5211+] */
1049#define AR5K_STA_ID1_SELF_GEN_SECTORE 0x04000000 /* Self generate sectore (?) */ 1138#define AR5K_STA_ID1_SELFGEN_DEF_ANT 0x04000000 /* Use def. antenna for self generated frames */
1050#define AR5K_STA_ID1_CRYPT_MIC_EN 0x08000000 /* Enable MIC */ 1139#define AR5K_STA_ID1_CRYPT_MIC_EN 0x08000000 /* Enable MIC */
1051#define AR5K_STA_ID1_KEYSRCH_MODE 0x10000000 /* Keysearch mode (?) */ 1140#define AR5K_STA_ID1_KEYSRCH_MODE 0x10000000 /* Look up key when key id != 0 */
1052#define AR5K_STA_ID1_PRESERVE_SEQ_NUM 0x20000000 /* Preserve sequence number */ 1141#define AR5K_STA_ID1_PRESERVE_SEQ_NUM 0x20000000 /* Preserve sequence number */
1142#define AR5K_STA_ID1_CBCIV_ENDIAN 0x40000000 /* ??? */
1143#define AR5K_STA_ID1_KEYSRCH_MCAST 0x80000000 /* Do key cache search for mcast frames */
1053 1144
1054/* 1145/*
1055 * First BSSID register (MAC address, lower 32bits) 1146 * First BSSID register (MAC address, lower 32bits)
@@ -1308,16 +1399,16 @@
1308#define AR5K_DIAG_SW_LOOP_BACK_5211 0x00000040 1399#define AR5K_DIAG_SW_LOOP_BACK_5211 0x00000040
1309#define AR5K_DIAG_SW_LOOP_BACK (ah->ah_version == AR5K_AR5210 ? \ 1400#define AR5K_DIAG_SW_LOOP_BACK (ah->ah_version == AR5K_AR5210 ? \
1310 AR5K_DIAG_SW_LOOP_BACK_5210 : AR5K_DIAG_SW_LOOP_BACK_5211) 1401 AR5K_DIAG_SW_LOOP_BACK_5210 : AR5K_DIAG_SW_LOOP_BACK_5211)
1311#define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 1402#define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 /* Corrupted FCS */
1312#define AR5K_DIAG_SW_CORR_FCS_5211 0x00000080 1403#define AR5K_DIAG_SW_CORR_FCS_5211 0x00000080
1313#define AR5K_DIAG_SW_CORR_FCS (ah->ah_version == AR5K_AR5210 ? \ 1404#define AR5K_DIAG_SW_CORR_FCS (ah->ah_version == AR5K_AR5210 ? \
1314 AR5K_DIAG_SW_CORR_FCS_5210 : AR5K_DIAG_SW_CORR_FCS_5211) 1405 AR5K_DIAG_SW_CORR_FCS_5210 : AR5K_DIAG_SW_CORR_FCS_5211)
1315#define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 1406#define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 /* Dump channel info */
1316#define AR5K_DIAG_SW_CHAN_INFO_5211 0x00000100 1407#define AR5K_DIAG_SW_CHAN_INFO_5211 0x00000100
1317#define AR5K_DIAG_SW_CHAN_INFO (ah->ah_version == AR5K_AR5210 ? \ 1408#define AR5K_DIAG_SW_CHAN_INFO (ah->ah_version == AR5K_AR5210 ? \
1318 AR5K_DIAG_SW_CHAN_INFO_5210 : AR5K_DIAG_SW_CHAN_INFO_5211) 1409 AR5K_DIAG_SW_CHAN_INFO_5210 : AR5K_DIAG_SW_CHAN_INFO_5211)
1319#define AR5K_DIAG_SW_EN_SCRAM_SEED_5211 0x00000200 /* Enable scrambler seed */ 1410#define AR5K_DIAG_SW_EN_SCRAM_SEED_5210 0x00000400 /* Enable fixed scrambler seed */
1320#define AR5K_DIAG_SW_EN_SCRAM_SEED_5210 0x00000400 1411#define AR5K_DIAG_SW_EN_SCRAM_SEED_5211 0x00000200
1321#define AR5K_DIAG_SW_EN_SCRAM_SEED (ah->ah_version == AR5K_AR5210 ? \ 1412#define AR5K_DIAG_SW_EN_SCRAM_SEED (ah->ah_version == AR5K_AR5210 ? \
1322 AR5K_DIAG_SW_EN_SCRAM_SEED_5210 : AR5K_DIAG_SW_EN_SCRAM_SEED_5211) 1413 AR5K_DIAG_SW_EN_SCRAM_SEED_5210 : AR5K_DIAG_SW_EN_SCRAM_SEED_5211)
1323#define AR5K_DIAG_SW_ECO_ENABLE 0x00000400 /* [5211+] */ 1414#define AR5K_DIAG_SW_ECO_ENABLE 0x00000400 /* [5211+] */
@@ -1326,12 +1417,15 @@
1326#define AR5K_DIAG_SW_SCRAM_SEED_S 10 1417#define AR5K_DIAG_SW_SCRAM_SEED_S 10
1327#define AR5K_DIAG_SW_DIS_SEQ_INC 0x00040000 /* Disable seqnum increment (?)[5210] */ 1418#define AR5K_DIAG_SW_DIS_SEQ_INC 0x00040000 /* Disable seqnum increment (?)[5210] */
1328#define AR5K_DIAG_SW_FRAME_NV0_5210 0x00080000 1419#define AR5K_DIAG_SW_FRAME_NV0_5210 0x00080000
1329#define AR5K_DIAG_SW_FRAME_NV0_5211 0x00020000 1420#define AR5K_DIAG_SW_FRAME_NV0_5211 0x00020000 /* Accept frames of non-zero protocol number */
1330#define AR5K_DIAG_SW_FRAME_NV0 (ah->ah_version == AR5K_AR5210 ? \ 1421#define AR5K_DIAG_SW_FRAME_NV0 (ah->ah_version == AR5K_AR5210 ? \
1331 AR5K_DIAG_SW_FRAME_NV0_5210 : AR5K_DIAG_SW_FRAME_NV0_5211) 1422 AR5K_DIAG_SW_FRAME_NV0_5210 : AR5K_DIAG_SW_FRAME_NV0_5211)
1332#define AR5K_DIAG_SW_OBSPT_M 0x000c0000 1423#define AR5K_DIAG_SW_OBSPT_M 0x000c0000 /* Observation point select (?) */
1333#define AR5K_DIAG_SW_OBSPT_S 18 1424#define AR5K_DIAG_SW_OBSPT_S 18
1334/* more bits */ 1425#define AR5K_DIAG_SW_RX_CLEAR_HIGH 0x0010000 /* Force RX Clear high */
1426#define AR5K_DIAG_SW_IGNORE_CARR_SENSE 0x0020000 /* Ignore virtual carrier sense */
1427#define AR5K_DIAG_SW_CHANEL_IDLE_HIGH 0x0040000 /* Force channel idle high */
1428#define AR5K_DIAG_SW_PHEAR_ME 0x0080000 /* ??? */
1335 1429
1336/* 1430/*
1337 * TSF (clock) register (lower 32 bits) 1431 * TSF (clock) register (lower 32 bits)
@@ -1542,16 +1636,16 @@
1542 * 1636 *
1543 * XXX: PCDAC steps (0.5dbm) or DBM ? 1637 * XXX: PCDAC steps (0.5dbm) or DBM ?
1544 * 1638 *
1545 * XXX: Mask changes for newer chips to 7f
1546 * like tx power table ?
1547 */ 1639 */
1548#define AR5K_TXPC 0x80e8 /* Register Address */ 1640#define AR5K_TXPC 0x80e8 /* Register Address */
1549#define AR5K_TXPC_ACK_M 0x0000003f /* Mask for ACK tx power */ 1641#define AR5K_TXPC_ACK_M 0x0000003f /* ACK tx power */
1550#define AR5K_TXPC_ACK_S 0 1642#define AR5K_TXPC_ACK_S 0
1551#define AR5K_TXPC_CTS_M 0x00003f00 /* Mask for CTS tx power */ 1643#define AR5K_TXPC_CTS_M 0x00003f00 /* CTS tx power */
1552#define AR5K_TXPC_CTS_S 8 1644#define AR5K_TXPC_CTS_S 8
1553#define AR5K_TXPC_CHIRP_M 0x003f0000 /* Mask for CHIRP tx power */ 1645#define AR5K_TXPC_CHIRP_M 0x003f0000 /* CHIRP tx power */
1554#define AR5K_TXPC_CHIRP_S 22 1646#define AR5K_TXPC_CHIRP_S 16
1647#define AR5K_TXPC_DOPPLER 0x0f000000 /* Doppler chirp span (?) */
1648#define AR5K_TXPC_DOPPLER_S 24
1555 1649
1556/* 1650/*
1557 * Profile count registers 1651 * Profile count registers
@@ -1562,14 +1656,19 @@
1562#define AR5K_PROFCNT_CYCLE 0x80f8 /* Cycle count (?) */ 1656#define AR5K_PROFCNT_CYCLE 0x80f8 /* Cycle count (?) */
1563 1657
1564/* 1658/*
1565 * Quiet (period) control registers (?) 1659 * Quiet period control registers
1566 */ 1660 */
1567#define AR5K_QUIET_CTL1 0x80fc /* Register Address */ 1661#define AR5K_QUIET_CTL1 0x80fc /* Register Address */
1568#define AR5K_QUIET_CTL1_NEXT_QT 0x0000ffff /* Mask for next quiet (period?) (?) */ 1662#define AR5K_QUIET_CTL1_NEXT_QT_TSF 0x0000ffff /* Next quiet period TSF (TU) */
1569#define AR5K_QUIET_CTL1_QT_EN 0x00010000 /* Enable quiet (period?) */ 1663#define AR5K_QUIET_CTL1_NEXT_QT_TSF_S 0
1664#define AR5K_QUIET_CTL1_QT_EN 0x00010000 /* Enable quiet period */
1665#define AR5K_QUIET_CTL1_ACK_CTS_EN 0x00020000 /* Send ACK/CTS during quiet period */
1666
1570#define AR5K_QUIET_CTL2 0x8100 /* Register Address */ 1667#define AR5K_QUIET_CTL2 0x8100 /* Register Address */
1571#define AR5K_QUIET_CTL2_QT_PER 0x0000ffff /* Mask for quiet period (?) */ 1668#define AR5K_QUIET_CTL2_QT_PER 0x0000ffff /* Mask for quiet period periodicity */
1572#define AR5K_QUIET_CTL2_QT_DUR 0xffff0000 /* Mask for quiet duration (?) */ 1669#define AR5K_QUIET_CTL2_QT_PER_S 0
1670#define AR5K_QUIET_CTL2_QT_DUR 0xffff0000 /* Mask for quiet period duration */
1671#define AR5K_QUIET_CTL2_QT_DUR_S 16
1573 1672
1574/* 1673/*
1575 * TSF parameter register 1674 * TSF parameter register
@@ -1579,12 +1678,15 @@
1579#define AR5K_TSF_PARM_INC_S 0 1678#define AR5K_TSF_PARM_INC_S 0
1580 1679
1581/* 1680/*
1582 * QoS register (?) 1681 * QoS NOACK policy
1583 */ 1682 */
1584#define AR5K_QOS 0x8108 /* Register Address */ 1683#define AR5K_QOS_NOACK 0x8108 /* Register Address */
1585#define AR5K_QOS_NOACK_2BIT_VALUES 0x00000000 /* (field) */ 1684#define AR5K_QOS_NOACK_2BIT_VALUES 0x0000000f /* ??? */
1586#define AR5K_QOS_NOACK_BIT_OFFSET 0x00000020 /* (field) */ 1685#define AR5K_QOS_NOACK_2BIT_VALUES_S 0
1587#define AR5K_QOS_NOACK_BYTE_OFFSET 0x00000080 /* (field) */ 1686#define AR5K_QOS_NOACK_BIT_OFFSET 0x00000070 /* ??? */
1687#define AR5K_QOS_NOACK_BIT_OFFSET_S 4
1688#define AR5K_QOS_NOACK_BYTE_OFFSET 0x00000180 /* ??? */
1689#define AR5K_QOS_NOACK_BYTE_OFFSET_S 8
1588 1690
1589/* 1691/*
1590 * PHY error filter register 1692 * PHY error filter register
@@ -1608,29 +1710,15 @@
1608/* 1710/*
1609 * MIC QoS control register (?) 1711 * MIC QoS control register (?)
1610 */ 1712 */
1611#define AR5K_MIC_QOS_CTL 0x8118 /* Register Address */ 1713#define AR5K_MIC_QOS_CTL 0x8118 /* Register Address */
1612#define AR5K_MIC_QOS_CTL_0 0x00000001 /* MIC QoS control 0 (?) */ 1714#define AR5K_MIC_QOS_CTL_OFF(_n) (1 << (_n * 2))
1613#define AR5K_MIC_QOS_CTL_1 0x00000004 /* MIC QoS control 1 (?) */ 1715#define AR5K_MIC_QOS_CTL_MQ_EN 0x00010000 /* Enable MIC QoS */
1614#define AR5K_MIC_QOS_CTL_2 0x00000010 /* MIC QoS control 2 (?) */
1615#define AR5K_MIC_QOS_CTL_3 0x00000040 /* MIC QoS control 3 (?) */
1616#define AR5K_MIC_QOS_CTL_4 0x00000100 /* MIC QoS control 4 (?) */
1617#define AR5K_MIC_QOS_CTL_5 0x00000400 /* MIC QoS control 5 (?) */
1618#define AR5K_MIC_QOS_CTL_6 0x00001000 /* MIC QoS control 6 (?) */
1619#define AR5K_MIC_QOS_CTL_7 0x00004000 /* MIC QoS control 7 (?) */
1620#define AR5K_MIC_QOS_CTL_MQ_EN 0x00010000 /* Enable MIC QoS */
1621 1716
1622/* 1717/*
1623 * MIC QoS select register (?) 1718 * MIC QoS select register (?)
1624 */ 1719 */
1625#define AR5K_MIC_QOS_SEL 0x811c 1720#define AR5K_MIC_QOS_SEL 0x811c
1626#define AR5K_MIC_QOS_SEL_0 0x00000001 1721#define AR5K_MIC_QOS_SEL_OFF(_n) (1 << (_n * 4))
1627#define AR5K_MIC_QOS_SEL_1 0x00000010
1628#define AR5K_MIC_QOS_SEL_2 0x00000100
1629#define AR5K_MIC_QOS_SEL_3 0x00001000
1630#define AR5K_MIC_QOS_SEL_4 0x00010000
1631#define AR5K_MIC_QOS_SEL_5 0x00100000
1632#define AR5K_MIC_QOS_SEL_6 0x01000000
1633#define AR5K_MIC_QOS_SEL_7 0x10000000
1634 1722
1635/* 1723/*
1636 * Misc mode control register (?) 1724 * Misc mode control register (?)
@@ -1665,6 +1753,11 @@
1665#define AR5K_TSF_THRES 0x813c 1753#define AR5K_TSF_THRES 0x813c
1666 1754
1667/* 1755/*
1756 * TODO: Wake On Wireless registers
1757 * Range: 0x8147 - 0x818c
1758 */
1759
1760/*
1668 * Rate -> ACK SIFS mapping table (32 entries) 1761 * Rate -> ACK SIFS mapping table (32 entries)
1669 */ 1762 */
1670#define AR5K_RATE_ACKSIFS_BASE 0x8680 /* Register Address */ 1763#define AR5K_RATE_ACKSIFS_BASE 0x8680 /* Register Address */
@@ -1779,7 +1872,8 @@
1779 */ 1872 */
1780#define AR5K_PHY_TURBO 0x9804 /* Register Address */ 1873#define AR5K_PHY_TURBO 0x9804 /* Register Address */
1781#define AR5K_PHY_TURBO_MODE 0x00000001 /* Enable turbo mode */ 1874#define AR5K_PHY_TURBO_MODE 0x00000001 /* Enable turbo mode */
1782#define AR5K_PHY_TURBO_SHORT 0x00000002 /* Short mode (20Mhz channels) (?) */ 1875#define AR5K_PHY_TURBO_SHORT 0x00000002 /* Set short symbols to turbo mode */
1876#define AR5K_PHY_TURBO_MIMO 0x00000004 /* Set turbo for mimo mimo */
1783 1877
1784/* 1878/*
1785 * PHY agility command register 1879 * PHY agility command register
@@ -1789,6 +1883,11 @@
1789#define AR5K_PHY_TST1 0x9808 1883#define AR5K_PHY_TST1 0x9808
1790#define AR5K_PHY_AGC_DISABLE 0x08000000 /* Disable AGC to A2 (?)*/ 1884#define AR5K_PHY_AGC_DISABLE 0x08000000 /* Disable AGC to A2 (?)*/
1791#define AR5K_PHY_TST1_TXHOLD 0x00003800 /* Set tx hold (?) */ 1885#define AR5K_PHY_TST1_TXHOLD 0x00003800 /* Set tx hold (?) */
1886#define AR5K_PHY_TST1_TXSRC_SRC 0x00000002 /* Used with bit 7 (?) */
1887#define AR5K_PHY_TST1_TXSRC_SRC_S 1
1888#define AR5K_PHY_TST1_TXSRC_ALT 0x00000080 /* Set input to tsdac (?) */
1889#define AR5K_PHY_TST1_TXSRC_ALT_S 7
1890
1792 1891
1793/* 1892/*
1794 * PHY timing register 3 [5112+] 1893 * PHY timing register 3 [5112+]
@@ -1813,15 +1912,23 @@
1813 1912
1814/* 1913/*
1815 * PHY RF control registers 1914 * PHY RF control registers
1816 * (i think these are delay times,
1817 * these calibration values exist
1818 * in EEPROM)
1819 */ 1915 */
1820#define AR5K_PHY_RF_CTL2 0x9824 /* Register Address */ 1916#define AR5K_PHY_RF_CTL2 0x9824 /* Register Address */
1821#define AR5K_PHY_RF_CTL2_TXF2TXD_START 0x0000000f /* Mask for TX frame to TX d(esc?) start */ 1917#define AR5K_PHY_RF_CTL2_TXF2TXD_START 0x0000000f /* TX frame to TX data start */
1918#define AR5K_PHY_RF_CTL2_TXF2TXD_START_S 0
1822 1919
1823#define AR5K_PHY_RF_CTL3 0x9828 /* Register Address */ 1920#define AR5K_PHY_RF_CTL3 0x9828 /* Register Address */
1824#define AR5K_PHY_RF_CTL3_TXE2XLNA_ON 0x0000000f /* Mask for TX end to XLNA on */ 1921#define AR5K_PHY_RF_CTL3_TXE2XLNA_ON 0x0000000f /* TX end to XLNA on */
1922#define AR5K_PHY_RF_CTL3_TXE2XLNA_ON_S 0
1923
1924#define AR5K_PHY_ADC_CTL 0x982c
1925#define AR5K_PHY_ADC_CTL_INBUFGAIN_OFF 0x00000003
1926#define AR5K_PHY_ADC_CTL_INBUFGAIN_OFF_S 0
1927#define AR5K_PHY_ADC_CTL_PWD_DAC_OFF 0x00002000
1928#define AR5K_PHY_ADC_CTL_PWD_BAND_GAP_OFF 0x00004000
1929#define AR5K_PHY_ADC_CTL_PWD_ADC_OFF 0x00008000
1930#define AR5K_PHY_ADC_CTL_INBUFGAIN_ON 0x00030000
1931#define AR5K_PHY_ADC_CTL_INBUFGAIN_ON_S 16
1825 1932
1826#define AR5K_PHY_RF_CTL4 0x9834 /* Register Address */ 1933#define AR5K_PHY_RF_CTL4 0x9834 /* Register Address */
1827#define AR5K_PHY_RF_CTL4_TXF2XPA_A_ON 0x00000001 /* TX frame to XPA A on (field) */ 1934#define AR5K_PHY_RF_CTL4_TXF2XPA_A_ON 0x00000001 /* TX frame to XPA A on (field) */
@@ -1843,14 +1950,19 @@
1843 * PHY settling register 1950 * PHY settling register
1844 */ 1951 */
1845#define AR5K_PHY_SETTLING 0x9844 /* Register Address */ 1952#define AR5K_PHY_SETTLING 0x9844 /* Register Address */
1846#define AR5K_PHY_SETTLING_AGC 0x0000007f /* Mask for AGC settling time */ 1953#define AR5K_PHY_SETTLING_AGC 0x0000007f /* AGC settling time */
1847#define AR5K_PHY_SETTLING_SWITCH 0x00003f80 /* Mask for Switch settlig time */ 1954#define AR5K_PHY_SETTLING_AGC_S 0
1955#define AR5K_PHY_SETTLING_SWITCH 0x00003f80 /* Switch settlig time */
1956#define AR5K_PHY_SETTLINK_SWITCH_S 7
1848 1957
1849/* 1958/*
1850 * PHY Gain registers 1959 * PHY Gain registers
1851 */ 1960 */
1852#define AR5K_PHY_GAIN 0x9848 /* Register Address */ 1961#define AR5K_PHY_GAIN 0x9848 /* Register Address */
1853#define AR5K_PHY_GAIN_TXRX_ATTEN 0x0003f000 /* Mask for TX-RX Attenuation */ 1962#define AR5K_PHY_GAIN_TXRX_ATTEN 0x0003f000 /* TX-RX Attenuation */
1963#define AR5K_PHY_GAIN_TXRX_ATTEN_S 12
1964#define AR5K_PHY_GAIN_TXRX_RF_MAX 0x007c0000
1965#define AR5K_PHY_GAIN_TXRX_RF_MAX_S 18
1854 1966
1855#define AR5K_PHY_GAIN_OFFSET 0x984c /* Register Address */ 1967#define AR5K_PHY_GAIN_OFFSET 0x984c /* Register Address */
1856#define AR5K_PHY_GAIN_OFFSET_RXTX_FLAG 0x00020000 /* RX-TX flag (?) */ 1968#define AR5K_PHY_GAIN_OFFSET_RXTX_FLAG 0x00020000 /* RX-TX flag (?) */
@@ -1860,18 +1972,21 @@
1860 * (for more infos read ANI patent) 1972 * (for more infos read ANI patent)
1861 */ 1973 */
1862#define AR5K_PHY_DESIRED_SIZE 0x9850 /* Register Address */ 1974#define AR5K_PHY_DESIRED_SIZE 0x9850 /* Register Address */
1863#define AR5K_PHY_DESIRED_SIZE_ADC 0x000000ff /* Mask for ADC desired size */ 1975#define AR5K_PHY_DESIRED_SIZE_ADC 0x000000ff /* ADC desired size */
1864#define AR5K_PHY_DESIRED_SIZE_PGA 0x0000ff00 /* Mask for PGA desired size */ 1976#define AR5K_PHY_DESIRED_SIZE_ADC_S 0
1865#define AR5K_PHY_DESIRED_SIZE_TOT 0x0ff00000 /* Mask for Total desired size */ 1977#define AR5K_PHY_DESIRED_SIZE_PGA 0x0000ff00 /* PGA desired size */
1978#define AR5K_PHY_DESIRED_SIZE_PGA_S 8
1979#define AR5K_PHY_DESIRED_SIZE_TOT 0x0ff00000 /* Total desired size */
1980#define AR5K_PHY_DESIRED_SIZE_TOT_S 20
1866 1981
1867/* 1982/*
1868 * PHY signal register 1983 * PHY signal register
1869 * (for more infos read ANI patent) 1984 * (for more infos read ANI patent)
1870 */ 1985 */
1871#define AR5K_PHY_SIG 0x9858 /* Register Address */ 1986#define AR5K_PHY_SIG 0x9858 /* Register Address */
1872#define AR5K_PHY_SIG_FIRSTEP 0x0003f000 /* Mask for FIRSTEP */ 1987#define AR5K_PHY_SIG_FIRSTEP 0x0003f000 /* FIRSTEP */
1873#define AR5K_PHY_SIG_FIRSTEP_S 12 1988#define AR5K_PHY_SIG_FIRSTEP_S 12
1874#define AR5K_PHY_SIG_FIRPWR 0x03fc0000 /* Mask for FIPWR */ 1989#define AR5K_PHY_SIG_FIRPWR 0x03fc0000 /* FIPWR */
1875#define AR5K_PHY_SIG_FIRPWR_S 18 1990#define AR5K_PHY_SIG_FIRPWR_S 18
1876 1991
1877/* 1992/*
@@ -1879,9 +1994,9 @@
1879 * (for more infos read ANI patent) 1994 * (for more infos read ANI patent)
1880 */ 1995 */
1881#define AR5K_PHY_AGCCOARSE 0x985c /* Register Address */ 1996#define AR5K_PHY_AGCCOARSE 0x985c /* Register Address */
1882#define AR5K_PHY_AGCCOARSE_LO 0x00007f80 /* Mask for AGC Coarse low */ 1997#define AR5K_PHY_AGCCOARSE_LO 0x00007f80 /* AGC Coarse low */
1883#define AR5K_PHY_AGCCOARSE_LO_S 7 1998#define AR5K_PHY_AGCCOARSE_LO_S 7
1884#define AR5K_PHY_AGCCOARSE_HI 0x003f8000 /* Mask for AGC Coarse high */ 1999#define AR5K_PHY_AGCCOARSE_HI 0x003f8000 /* AGC Coarse high */
1885#define AR5K_PHY_AGCCOARSE_HI_S 15 2000#define AR5K_PHY_AGCCOARSE_HI_S 15
1886 2001
1887/* 2002/*
@@ -1890,6 +2005,8 @@
1890#define AR5K_PHY_AGCCTL 0x9860 /* Register address */ 2005#define AR5K_PHY_AGCCTL 0x9860 /* Register address */
1891#define AR5K_PHY_AGCCTL_CAL 0x00000001 /* Enable PHY calibration */ 2006#define AR5K_PHY_AGCCTL_CAL 0x00000001 /* Enable PHY calibration */
1892#define AR5K_PHY_AGCCTL_NF 0x00000002 /* Enable Noise Floor calibration */ 2007#define AR5K_PHY_AGCCTL_NF 0x00000002 /* Enable Noise Floor calibration */
2008#define AR5K_PHY_AGCCTL_NF_EN 0x00008000 /* Enable nf calibration to happen (?) */
2009#define AR5K_PHY_AGCCTL_NF_NOUPDATE 0x00020000 /* Don't update nf automaticaly */
1893 2010
1894/* 2011/*
1895 * PHY noise floor status register 2012 * PHY noise floor status register
@@ -1900,7 +2017,10 @@
1900#define AR5K_PHY_NF_RVAL(_n) (((_n) >> 19) & AR5K_PHY_NF_M) 2017#define AR5K_PHY_NF_RVAL(_n) (((_n) >> 19) & AR5K_PHY_NF_M)
1901#define AR5K_PHY_NF_AVAL(_n) (-((_n) ^ AR5K_PHY_NF_M) + 1) 2018#define AR5K_PHY_NF_AVAL(_n) (-((_n) ^ AR5K_PHY_NF_M) + 1)
1902#define AR5K_PHY_NF_SVAL(_n) (((_n) & AR5K_PHY_NF_M) | (1 << 9)) 2019#define AR5K_PHY_NF_SVAL(_n) (((_n) & AR5K_PHY_NF_M) | (1 << 9))
1903#define AR5K_PHY_NF_THRESH62 0x00001000 /* Thresh62 -check ANI patent- (field) */ 2020#define AR5K_PHY_NF_THRESH62 0x0007f000 /* Thresh62 -check ANI patent- (field) */
2021#define AR5K_PHY_NF_THRESH62_S 12
2022#define AR5K_PHY_NF_MINCCA_PWR 0x0ff80000 /* ??? */
2023#define AR5K_PHY_NF_MINCCA_PWR_S 19
1904 2024
1905/* 2025/*
1906 * PHY ADC saturation register [5110] 2026 * PHY ADC saturation register [5110]
@@ -1940,24 +2060,31 @@
1940 */ 2060 */
1941#define AR5K_PHY_SCR 0x9870 2061#define AR5K_PHY_SCR 0x9870
1942#define AR5K_PHY_SCR_32MHZ 0x0000001f 2062#define AR5K_PHY_SCR_32MHZ 0x0000001f
2063
1943#define AR5K_PHY_SLMT 0x9874 2064#define AR5K_PHY_SLMT 0x9874
1944#define AR5K_PHY_SLMT_32MHZ 0x0000007f 2065#define AR5K_PHY_SLMT_32MHZ 0x0000007f
2066
1945#define AR5K_PHY_SCAL 0x9878 2067#define AR5K_PHY_SCAL 0x9878
1946#define AR5K_PHY_SCAL_32MHZ 0x0000000e 2068#define AR5K_PHY_SCAL_32MHZ 0x0000000e
1947 2069
2070
1948/* 2071/*
1949 * PHY PLL (Phase Locked Loop) control register 2072 * PHY PLL (Phase Locked Loop) control register
1950 */ 2073 */
1951#define AR5K_PHY_PLL 0x987c 2074#define AR5K_PHY_PLL 0x987c
1952#define AR5K_PHY_PLL_20MHZ 0x13 /* For half rate (?) [5111+] */ 2075#define AR5K_PHY_PLL_20MHZ 0x00000013 /* For half rate (?) */
1953#define AR5K_PHY_PLL_40MHZ_5211 0x18 /* For 802.11a */ 2076/* 40MHz -> 5GHz band */
2077#define AR5K_PHY_PLL_40MHZ_5211 0x00000018
1954#define AR5K_PHY_PLL_40MHZ_5212 0x000000aa 2078#define AR5K_PHY_PLL_40MHZ_5212 0x000000aa
2079#define AR5K_PHY_PLL_40MHZ_5413 0x00000004
1955#define AR5K_PHY_PLL_40MHZ (ah->ah_version == AR5K_AR5211 ? \ 2080#define AR5K_PHY_PLL_40MHZ (ah->ah_version == AR5K_AR5211 ? \
1956 AR5K_PHY_PLL_40MHZ_5211 : AR5K_PHY_PLL_40MHZ_5212) 2081 AR5K_PHY_PLL_40MHZ_5211 : AR5K_PHY_PLL_40MHZ_5212)
1957#define AR5K_PHY_PLL_44MHZ_5211 0x19 /* For 802.11b/g */ 2082/* 44MHz -> 2.4GHz band */
2083#define AR5K_PHY_PLL_44MHZ_5211 0x00000019
1958#define AR5K_PHY_PLL_44MHZ_5212 0x000000ab 2084#define AR5K_PHY_PLL_44MHZ_5212 0x000000ab
1959#define AR5K_PHY_PLL_44MHZ (ah->ah_version == AR5K_AR5211 ? \ 2085#define AR5K_PHY_PLL_44MHZ (ah->ah_version == AR5K_AR5211 ? \
1960 AR5K_PHY_PLL_44MHZ_5211 : AR5K_PHY_PLL_44MHZ_5212) 2086 AR5K_PHY_PLL_44MHZ_5211 : AR5K_PHY_PLL_44MHZ_5212)
2087
1961#define AR5K_PHY_PLL_RF5111 0x00000000 2088#define AR5K_PHY_PLL_RF5111 0x00000000
1962#define AR5K_PHY_PLL_RF5112 0x00000040 2089#define AR5K_PHY_PLL_RF5112 0x00000040
1963#define AR5K_PHY_PLL_HALF_RATE 0x00000100 2090#define AR5K_PHY_PLL_HALF_RATE 0x00000100
@@ -2024,6 +2151,19 @@
2024#define AR5K_PHY_RFSTG_DISABLE 0x00000021 2151#define AR5K_PHY_RFSTG_DISABLE 0x00000021
2025 2152
2026/* 2153/*
2154 * BIN masks (?)
2155 */
2156#define AR5K_PHY_BIN_MASK_1 0x9900
2157#define AR5K_PHY_BIN_MASK_2 0x9904
2158#define AR5K_PHY_BIN_MASK_3 0x9908
2159
2160#define AR5K_PHY_BIN_MASK_CTL 0x990c
2161#define AR5K_PHY_BIN_MASK_CTL_MASK_4 0x00003fff
2162#define AR5K_PHY_BIN_MASK_CTL_MASK_4_S 0
2163#define AR5K_PHY_BIN_MASK_CTL_RATE 0xff000000
2164#define AR5K_PHY_BIN_MASK_CTL_RATE_S 24
2165
2166/*
2027 * PHY Antenna control register 2167 * PHY Antenna control register
2028 */ 2168 */
2029#define AR5K_PHY_ANT_CTL 0x9910 /* Register Address */ 2169#define AR5K_PHY_ANT_CTL 0x9910 /* Register Address */
@@ -2070,6 +2210,7 @@
2070#define AR5K_PHY_OFDM_SELFCORR 0x9924 /* Register Address */ 2210#define AR5K_PHY_OFDM_SELFCORR 0x9924 /* Register Address */
2071#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1_EN 0x00000001 /* Enable cyclic RSSI thr 1 */ 2211#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1_EN 0x00000001 /* Enable cyclic RSSI thr 1 */
2072#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1 0x000000fe /* Mask for Cyclic RSSI threshold 1 */ 2212#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1 0x000000fe /* Mask for Cyclic RSSI threshold 1 */
2213#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1_S 0
2073#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR3 0x00000100 /* Cyclic RSSI threshold 3 (field) (?) */ 2214#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR3 0x00000100 /* Cyclic RSSI threshold 3 (field) (?) */
2074#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR_EN 0x00008000 /* Enable 1A RSSI threshold (?) */ 2215#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR_EN 0x00008000 /* Enable 1A RSSI threshold (?) */
2075#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR 0x00010000 /* 1A RSSI threshold (field) (?) */ 2216#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR 0x00010000 /* 1A RSSI threshold (field) (?) */
@@ -2116,7 +2257,6 @@
2116#define AR5K_PHY_PAPD_PROBE_INI_5111 0x00004883 /* [5212+] */ 2257#define AR5K_PHY_PAPD_PROBE_INI_5111 0x00004883 /* [5212+] */
2117#define AR5K_PHY_PAPD_PROBE_INI_5112 0x00004882 /* [5212+] */ 2258#define AR5K_PHY_PAPD_PROBE_INI_5112 0x00004882 /* [5212+] */
2118 2259
2119
2120/* 2260/*
2121 * PHY TX rate power registers [5112+] 2261 * PHY TX rate power registers [5112+]
2122 */ 2262 */
@@ -2138,6 +2278,8 @@
2138#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 /* Mask for tx clip (?) */ 2278#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 /* Mask for tx clip (?) */
2139#define AR5K_PHY_FRAME_CTL_TX_CLIP_S 3 2279#define AR5K_PHY_FRAME_CTL_TX_CLIP_S 3
2140#define AR5K_PHY_FRAME_CTL_PREP_CHINFO 0x00010000 /* Prepend chan info */ 2280#define AR5K_PHY_FRAME_CTL_PREP_CHINFO 0x00010000 /* Prepend chan info */
2281#define AR5K_PHY_FRAME_CTL_EMU 0x80000000
2282#define AR5K_PHY_FRAME_CTL_EMU_S 31
2141/*---[5110/5111]---*/ 2283/*---[5110/5111]---*/
2142#define AR5K_PHY_FRAME_CTL_TIMING_ERR 0x01000000 /* PHY timing error */ 2284#define AR5K_PHY_FRAME_CTL_TIMING_ERR 0x01000000 /* PHY timing error */
2143#define AR5K_PHY_FRAME_CTL_PARITY_ERR 0x02000000 /* Parity error */ 2285#define AR5K_PHY_FRAME_CTL_PARITY_ERR 0x02000000 /* Parity error */
@@ -2156,48 +2298,36 @@
2156 * PHY radar detection register [5111+] 2298 * PHY radar detection register [5111+]
2157 */ 2299 */
2158#define AR5K_PHY_RADAR 0x9954 2300#define AR5K_PHY_RADAR 0x9954
2159
2160/* Radar enable ........ ........ ........ .......1 */
2161#define AR5K_PHY_RADAR_ENABLE 0x00000001 2301#define AR5K_PHY_RADAR_ENABLE 0x00000001
2162#define AR5K_PHY_RADAR_DISABLE 0x00000000 2302#define AR5K_PHY_RADAR_DISABLE 0x00000000
2163#define AR5K_PHY_RADAR_ENABLE_S 0 2303#define AR5K_PHY_RADAR_INBANDTHR 0x0000003e /* Inband threshold
2164 2304 5-bits, units unknown {0..31}
2165/* This is the value found on the card .1.111.1 .1.1.... 111....1 1...1... 2305 (? MHz ?) */
2166at power on. */
2167#define AR5K_PHY_RADAR_PWONDEF_AR5213 0x5d50e188
2168
2169/* This is the value found on the card .1.1.111 ..11...1 .1...1.1 1...11.1
2170after DFS is enabled */
2171#define AR5K_PHY_RADAR_ENABLED_AR5213 0x5731458d
2172
2173/* Finite Impulse Response (FIR) filter .1111111 ........ ........ ........
2174 * power out threshold.
2175 * 7-bits, standard power range {0..127} in 1/2 dBm units. */
2176#define AR5K_PHY_RADAR_FIRPWROUTTHR 0x7f000000
2177#define AR5K_PHY_RADAR_FIRPWROUTTHR_S 24
2178
2179/* Radar RSSI/SNR threshold. ........ 111111.. ........ ........
2180 * 6-bits, dBm range {0..63} in dBm units. */
2181#define AR5K_PHY_RADAR_RADARRSSITHR 0x00fc0000
2182#define AR5K_PHY_RADAR_RADARRSSITHR_S 18
2183
2184/* Pulse height threshold ........ ......11 1111.... ........
2185 * 6-bits, dBm range {0..63} in dBm units. */
2186#define AR5K_PHY_RADAR_PULSEHEIGHTTHR 0x0003f000
2187#define AR5K_PHY_RADAR_PULSEHEIGHTTHR_S 12
2188
2189/* Pulse RSSI/SNR threshold ........ ........ ....1111 11......
2190 * 6-bits, dBm range {0..63} in dBm units. */
2191#define AR5K_PHY_RADAR_PULSERSSITHR 0x00000fc0
2192#define AR5K_PHY_RADAR_PULSERSSITHR_S 6
2193
2194/* Inband threshold ........ ........ ........ ..11111.
2195 * 5-bits, units unknown {0..31} (? MHz ?) */
2196#define AR5K_PHY_RADAR_INBANDTHR 0x0000003e
2197#define AR5K_PHY_RADAR_INBANDTHR_S 1 2306#define AR5K_PHY_RADAR_INBANDTHR_S 1
2198 2307
2308#define AR5K_PHY_RADAR_PRSSI_THR 0x00000fc0 /* Pulse RSSI/SNR threshold
2309 6-bits, dBm range {0..63}
2310 in dBm units. */
2311#define AR5K_PHY_RADAR_PRSSI_THR_S 6
2312
2313#define AR5K_PHY_RADAR_PHEIGHT_THR 0x0003f000 /* Pulse height threshold
2314 6-bits, dBm range {0..63}
2315 in dBm units. */
2316#define AR5K_PHY_RADAR_PHEIGHT_THR_S 12
2317
2318#define AR5K_PHY_RADAR_RSSI_THR 0x00fc0000 /* Radar RSSI/SNR threshold.
2319 6-bits, dBm range {0..63}
2320 in dBm units. */
2321#define AR5K_PHY_RADAR_RSSI_THR_S 18
2322
2323#define AR5K_PHY_RADAR_FIRPWR_THR 0x7f000000 /* Finite Impulse Response
2324 filter power out threshold.
2325 7-bits, standard power range
2326 {0..127} in 1/2 dBm units. */
2327#define AR5K_PHY_RADAR_FIRPWR_THRS 24
2328
2199/* 2329/*
2200 * PHY antenna switch table registers [5110] 2330 * PHY antenna switch table registers
2201 */ 2331 */
2202#define AR5K_PHY_ANT_SWITCH_TABLE_0 0x9960 2332#define AR5K_PHY_ANT_SWITCH_TABLE_0 0x9960
2203#define AR5K_PHY_ANT_SWITCH_TABLE_1 0x9964 2333#define AR5K_PHY_ANT_SWITCH_TABLE_1 0x9964
@@ -2208,25 +2338,65 @@ after DFS is enabled */
2208#define AR5K_PHY_NFTHRES 0x9968 2338#define AR5K_PHY_NFTHRES 0x9968
2209 2339
2210/* 2340/*
2211 * PHY clock sleep registers [5112+] 2341 * Sigma Delta register (?) [5213]
2212 */ 2342 */
2213#define AR5K_PHY_SCLOCK 0x99f0 2343#define AR5K_PHY_SIGMA_DELTA 0x996C
2214#define AR5K_PHY_SCLOCK_32MHZ 0x0000000c 2344#define AR5K_PHY_SIGMA_DELTA_ADC_SEL 0x00000003
2215#define AR5K_PHY_SDELAY 0x99f4 2345#define AR5K_PHY_SIGMA_DELTA_ADC_SEL_S 0
2216#define AR5K_PHY_SDELAY_32MHZ 0x000000ff 2346#define AR5K_PHY_SIGMA_DELTA_FILT2 0x000000f8
2217#define AR5K_PHY_SPENDING 0x99f8 2347#define AR5K_PHY_SIGMA_DELTA_FILT2_S 3
2218#define AR5K_PHY_SPENDING_14 0x00000014 2348#define AR5K_PHY_SIGMA_DELTA_FILT1 0x00001f00
2219#define AR5K_PHY_SPENDING_18 0x00000018 2349#define AR5K_PHY_SIGMA_DELTA_FILT1_S 8
2220#define AR5K_PHY_SPENDING_RF5111 0x00000018 2350#define AR5K_PHY_SIGMA_DELTA_ADC_CLIP 0x01ff3000
2221#define AR5K_PHY_SPENDING_RF5112 0x00000014 2351#define AR5K_PHY_SIGMA_DELTA_ADC_CLIP_S 13
2222/* #define AR5K_PHY_SPENDING_RF5112A 0x0000000e */ 2352
2223/* #define AR5K_PHY_SPENDING_RF5424 0x00000012 */ 2353/*
2224#define AR5K_PHY_SPENDING_RF5413 0x00000014 2354 * RF restart register [5112+] (?)
2225#define AR5K_PHY_SPENDING_RF2413 0x00000014 2355 */
2226#define AR5K_PHY_SPENDING_RF2425 0x00000018 2356#define AR5K_PHY_RESTART 0x9970 /* restart */
2357#define AR5K_PHY_RESTART_DIV_GC 0x001c0000 /* Fast diversity gc_limit (?) */
2358#define AR5K_PHY_RESTART_DIV_GC_S 18
2359
2360/*
2361 * RF Bus access request register (for synth-oly channel switching)
2362 */
2363#define AR5K_PHY_RFBUS_REQ 0x997C
2364#define AR5K_PHY_RFBUS_REQ_REQUEST 0x00000001
2227 2365
2228/* 2366/*
2229 * Misc PHY/radio registers [5110 - 5111] 2367 * Spur mitigation masks (?)
2368 */
2369#define AR5K_PHY_TIMING_7 0x9980
2370#define AR5K_PHY_TIMING_8 0x9984
2371#define AR5K_PHY_TIMING_8_PILOT_MASK_2 0x000fffff
2372#define AR5K_PHY_TIMING_8_PILOT_MASK_2_S 0
2373
2374#define AR5K_PHY_BIN_MASK2_1 0x9988
2375#define AR5K_PHY_BIN_MASK2_2 0x998c
2376#define AR5K_PHY_BIN_MASK2_3 0x9990
2377
2378#define AR5K_PHY_BIN_MASK2_4 0x9994
2379#define AR5K_PHY_BIN_MASK2_4_MASK_4 0x00003fff
2380#define AR5K_PHY_BIN_MASK2_4_MASK_4_S 0
2381
2382#define AR_PHY_TIMING_9 0x9998
2383#define AR_PHY_TIMING_10 0x999c
2384#define AR_PHY_TIMING_10_PILOT_MASK_2 0x000fffff
2385#define AR_PHY_TIMING_10_PILOT_MASK_2_S 0
2386
2387/*
2388 * Spur mitigation control
2389 */
2390#define AR_PHY_TIMING_11 0x99a0 /* Register address */
2391#define AR_PHY_TIMING_11_SPUR_DELTA_PHASE 0x000fffff /* Spur delta phase */
2392#define AR_PHY_TIMING_11_SPUR_DELTA_PHASE_S 0
2393#define AR_PHY_TIMING_11_SPUR_FREQ_SD 0x3ff00000 /* Freq sigma delta */
2394#define AR_PHY_TIMING_11_SPUR_FREQ_SD_S 20
2395#define AR_PHY_TIMING_11_USE_SPUR_IN_AGC 0x40000000 /* Spur filter in AGC detector */
2396#define AR_PHY_TIMING_11_USE_SPUR_IN_SELFCOR 0x80000000 /* Spur filter in OFDM self correlator */
2397
2398/*
2399 * Gain tables
2230 */ 2400 */
2231#define AR5K_BB_GAIN_BASE 0x9b00 /* BaseBand Amplifier Gain table base address */ 2401#define AR5K_BB_GAIN_BASE 0x9b00 /* BaseBand Amplifier Gain table base address */
2232#define AR5K_BB_GAIN(_n) (AR5K_BB_GAIN_BASE + ((_n) << 2)) 2402#define AR5K_BB_GAIN(_n) (AR5K_BB_GAIN_BASE + ((_n) << 2))
@@ -2246,9 +2416,10 @@ after DFS is enabled */
2246#define AR5K_PHY_CURRENT_RSSI 0x9c1c 2416#define AR5K_PHY_CURRENT_RSSI 0x9c1c
2247 2417
2248/* 2418/*
2249 * PHY RF Bus grant register (?) 2419 * PHY RF Bus grant register
2250 */ 2420 */
2251#define AR5K_PHY_RFBUS_GRANT 0x9c20 2421#define AR5K_PHY_RFBUS_GRANT 0x9c20
2422#define AR5K_PHY_RFBUS_GRANT_OK 0x00000001
2252 2423
2253/* 2424/*
2254 * PHY ADC test register 2425 * PHY ADC test register
@@ -2292,6 +2463,31 @@ after DFS is enabled */
2292#define AR5K_PHY_CHAN_STATUS_RX_CLR_PAP 0x00000008 2463#define AR5K_PHY_CHAN_STATUS_RX_CLR_PAP 0x00000008
2293 2464
2294/* 2465/*
2466 * Heavy clip enable register
2467 */
2468#define AR5K_PHY_HEAVY_CLIP_ENABLE 0x99e0
2469
2470/*
2471 * PHY clock sleep registers [5112+]
2472 */
2473#define AR5K_PHY_SCLOCK 0x99f0
2474#define AR5K_PHY_SCLOCK_32MHZ 0x0000000c
2475#define AR5K_PHY_SDELAY 0x99f4
2476#define AR5K_PHY_SDELAY_32MHZ 0x000000ff
2477#define AR5K_PHY_SPENDING 0x99f8
2478#define AR5K_PHY_SPENDING_14 0x00000014
2479#define AR5K_PHY_SPENDING_18 0x00000018
2480#define AR5K_PHY_SPENDING_RF5111 0x00000018
2481#define AR5K_PHY_SPENDING_RF5112 0x00000014
2482/* #define AR5K_PHY_SPENDING_RF5112A 0x0000000e */
2483/* #define AR5K_PHY_SPENDING_RF5424 0x00000012 */
2484#define AR5K_PHY_SPENDING_RF5413 0x00000018
2485#define AR5K_PHY_SPENDING_RF2413 0x00000018
2486#define AR5K_PHY_SPENDING_RF2316 0x00000018
2487#define AR5K_PHY_SPENDING_RF2317 0x00000018
2488#define AR5K_PHY_SPENDING_RF2425 0x00000014
2489
2490/*
2295 * PHY PAPD I (power?) table (?) 2491 * PHY PAPD I (power?) table (?)
2296 * (92! entries) 2492 * (92! entries)
2297 */ 2493 */
@@ -2342,10 +2538,47 @@ after DFS is enabled */
2342#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR 0x0000000f 2538#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR 0x0000000f
2343#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR_S 0 2539#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR_S 0
2344 2540
2541/* Same address is used for antenna diversity activation */
2542#define AR5K_PHY_FAST_ANT_DIV 0xa208
2543#define AR5K_PHY_FAST_ANT_DIV_EN 0x00002000
2544
2345/* 2545/*
2346 * PHY 2GHz gain register [5111+] 2546 * PHY 2GHz gain register [5111+]
2347 */ 2547 */
2348#define AR5K_PHY_GAIN_2GHZ 0xa20c 2548#define AR5K_PHY_GAIN_2GHZ 0xa20c
2349#define AR5K_PHY_GAIN_2GHZ_MARGIN_TXRX 0x00fc0000 2549#define AR5K_PHY_GAIN_2GHZ_MARGIN_TXRX 0x00fc0000
2350#define AR5K_PHY_GAIN_2GHZ_MARGIN_TXRX_S 18 2550#define AR5K_PHY_GAIN_2GHZ_MARGIN_TXRX_S 18
2351#define AR5K_PHY_GAIN_2GHZ_INI_5111 0x6480416c 2551#define AR5K_PHY_GAIN_2GHZ_INI_5111 0x6480416c
2552
2553#define AR5K_PHY_CCK_RX_CTL_4 0xa21c
2554#define AR5K_PHY_CCK_RX_CTL_4_FREQ_EST_SHORT 0x01f80000
2555#define AR5K_PHY_CCK_RX_CTL_4_FREQ_EST_SHORT_S 19
2556
2557#define AR5K_PHY_DAG_CCK_CTL 0xa228
2558#define AR5K_PHY_DAG_CCK_CTL_EN_RSSI_THR 0x00000200
2559#define AR5K_PHY_DAG_CCK_CTL_RSSI_THR 0x0001fc00
2560#define AR5K_PHY_DAG_CCK_CTL_RSSI_THR_S 10
2561
2562#define AR5K_PHY_FAST_ADC 0xa24c
2563
2564#define AR5K_PHY_BLUETOOTH 0xa254
2565
2566/*
2567 * Transmit Power Control register
2568 * [2413+]
2569 */
2570#define AR5K_PHY_TPC_RG1 0xa258
2571#define AR5K_PHY_TPC_RG1_NUM_PD_GAIN 0x0000c000
2572#define AR5K_PHY_TPC_RG1_NUM_PD_GAIN_S 14
2573
2574#define AR5K_PHY_TPC_RG5 0xa26C
2575#define AR5K_PHY_TPC_RG5_PD_GAIN_OVERLAP 0x0000000F
2576#define AR5K_PHY_TPC_RG5_PD_GAIN_OVERLAP_S 0
2577#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_1 0x000003F0
2578#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_1_S 4
2579#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_2 0x0000FC00
2580#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_2_S 10
2581#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_3 0x003F0000
2582#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_3_S 16
2583#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_4 0x0FC00000
2584#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_4_S 22
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index 953ba3b19ff7..8f1886834e61 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -543,13 +543,13 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
543 ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); 543 ath5k_hw_reg_write(ah, 0x0002a002, 0x982c);
544 544
545 if (channel->hw_value == CHANNEL_G) 545 if (channel->hw_value == CHANNEL_G)
546 if (ah->ah_mac_srev < AR5K_SREV_VER_AR2413) 546 if (ah->ah_mac_srev < AR5K_SREV_AR2413)
547 ath5k_hw_reg_write(ah, 0x00f80d80, 547 ath5k_hw_reg_write(ah, 0x00f80d80,
548 0x994c); 548 0x994c);
549 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2424) 549 else if (ah->ah_mac_srev < AR5K_SREV_AR5424)
550 ath5k_hw_reg_write(ah, 0x00380140, 550 ath5k_hw_reg_write(ah, 0x00380140,
551 0x994c); 551 0x994c);
552 else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2425) 552 else if (ah->ah_mac_srev < AR5K_SREV_AR2425)
553 ath5k_hw_reg_write(ah, 0x00fc0ec0, 553 ath5k_hw_reg_write(ah, 0x00fc0ec0,
554 0x994c); 554 0x994c);
555 else /* 2425 */ 555 else /* 2425 */
@@ -915,7 +915,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
915 ath5k_hw_reg_write(ah, 0x000100aa, 0x8118); 915 ath5k_hw_reg_write(ah, 0x000100aa, 0x8118);
916 ath5k_hw_reg_write(ah, 0x00003210, 0x811c); 916 ath5k_hw_reg_write(ah, 0x00003210, 0x811c);
917 ath5k_hw_reg_write(ah, 0x00000052, 0x8108); 917 ath5k_hw_reg_write(ah, 0x00000052, 0x8108);
918 if (ah->ah_mac_srev >= AR5K_SREV_VER_AR2413) 918 if (ah->ah_mac_srev >= AR5K_SREV_AR2413)
919 ath5k_hw_reg_write(ah, 0x00000004, 0x8120); 919 ath5k_hw_reg_write(ah, 0x00000004, 0x8120);
920 } 920 }
921 921
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 0f628a29d833..3bf74e236abc 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -815,7 +815,7 @@ void b43_dummy_transmission(struct b43_wldev *dev)
815 break; 815 break;
816 udelay(10); 816 udelay(10);
817 } 817 }
818 for (i = 0x00; i < 0x0A; i++) { 818 for (i = 0x00; i < 0x19; i++) {
819 value = b43_read16(dev, 0x0690); 819 value = b43_read16(dev, 0x0690);
820 if (!(value & 0x0100)) 820 if (!(value & 0x0100))
821 break; 821 break;
@@ -4543,9 +4543,11 @@ static void b43_sprom_fixup(struct ssb_bus *bus)
4543 pdev = bus->host_pci; 4543 pdev = bus->host_pci;
4544 if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || 4544 if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) ||
4545 IS_PDEV(pdev, BROADCOM, 0x4320, DELL, 0x0003) || 4545 IS_PDEV(pdev, BROADCOM, 0x4320, DELL, 0x0003) ||
4546 IS_PDEV(pdev, BROADCOM, 0x4320, HP, 0x12f8) ||
4546 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || 4547 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) ||
4547 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0014) || 4548 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0014) ||
4548 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) 4549 IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013) ||
4550 IS_PDEV(pdev, BROADCOM, 0x4320, MOTOROLA, 0x7010))
4549 bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST; 4551 bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST;
4550 } 4552 }
4551} 4553}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 7330890fd05e..204abab76449 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2875,6 +2875,13 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
2875 goto out; 2875 goto out;
2876 } 2876 }
2877 2877
2878 if (conf->flags & IEEE80211_CONF_PS)
2879 ret = iwl_power_set_user_mode(priv, IWL_POWER_INDEX_3);
2880 else
2881 ret = iwl_power_set_user_mode(priv, IWL_POWER_MODE_CAM);
2882 if (ret)
2883 IWL_DEBUG_MAC80211("Error setting power level\n");
2884
2878 IWL_DEBUG_MAC80211("TX Power old=%d new=%d\n", 2885 IWL_DEBUG_MAC80211("TX Power old=%d new=%d\n",
2879 priv->tx_power_user_lmt, conf->power_level); 2886 priv->tx_power_user_lmt, conf->power_level);
2880 2887
@@ -4236,13 +4243,13 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4236 4243
4237 pci_set_master(pdev); 4244 pci_set_master(pdev);
4238 4245
4239 err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); 4246 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
4240 if (!err) 4247 if (!err)
4241 err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); 4248 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(36));
4242 if (err) { 4249 if (err) {
4243 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 4250 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
4244 if (!err) 4251 if (!err)
4245 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 4252 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
4246 /* both attempts failed: */ 4253 /* both attempts failed: */
4247 if (err) { 4254 if (err) {
4248 printk(KERN_WARNING "%s: No suitable DMA available.\n", 4255 printk(KERN_WARNING "%s: No suitable DMA available.\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h
index 52629fbd835a..662edf4f8d22 100644
--- a/drivers/net/wireless/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/iwlwifi/iwl-csr.h
@@ -64,7 +64,7 @@
64#define CSR_BASE (0x000) 64#define CSR_BASE (0x000)
65 65
66#define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */ 66#define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */
67#define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */ 67#define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */
68#define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */ 68#define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */
69#define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */ 69#define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */
70#define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/ 70#define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index cd11c0ca2991..a72efdf6d1dd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -247,8 +247,8 @@
247#define FH_RCSR_CHNL0_RX_CONFIG_RBDBC_SIZE_MSK (0x00F00000) /* bits 20-23 */ 247#define FH_RCSR_CHNL0_RX_CONFIG_RBDBC_SIZE_MSK (0x00F00000) /* bits 20-23 */
248#define FH_RCSR_CHNL0_RX_CONFIG_DMA_CHNL_EN_MSK (0xC0000000) /* bits 30-31*/ 248#define FH_RCSR_CHNL0_RX_CONFIG_DMA_CHNL_EN_MSK (0xC0000000) /* bits 30-31*/
249 249
250#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT (20) 250#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS (20)
251#define FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_BITSHIFT (4) 251#define FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS (4)
252#define RX_RB_TIMEOUT (0x10) 252#define RX_RB_TIMEOUT (0x10)
253 253
254#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_VAL (0x00000000) 254#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_VAL (0x00000000)
@@ -260,8 +260,9 @@
260#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_12K (0x00020000) 260#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_12K (0x00020000)
261#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_16K (0x00030000) 261#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_16K (0x00030000)
262 262
263#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_NO_INT_VAL (0x00000000) 263#define FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY (0x00000004)
264#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL (0x00001000) 264#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_NO_INT_VAL (0x00000000)
265#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL (0x00001000)
265 266
266 267
267/** 268/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 38b2946b1d81..7cde9d76ff5d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -376,7 +376,9 @@ int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
376{ 376{
377 int ret; 377 int ret;
378 unsigned long flags; 378 unsigned long flags;
379 unsigned int rb_size; 379 u32 rb_size;
380 const u32 rfdnlog = RX_QUEUE_SIZE_LOG; /* 256 RBDs */
381 const u32 rb_timeout = 0; /* FIXME: RX_RB_TIMEOUT why this stalls RX */
380 382
381 spin_lock_irqsave(&priv->lock, flags); 383 spin_lock_irqsave(&priv->lock, flags);
382 ret = iwl_grab_nic_access(priv); 384 ret = iwl_grab_nic_access(priv);
@@ -398,26 +400,32 @@ int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
398 400
399 /* Tell device where to find RBD circular buffer in DRAM */ 401 /* Tell device where to find RBD circular buffer in DRAM */
400 iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG, 402 iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
401 rxq->dma_addr >> 8); 403 (u32)(rxq->dma_addr >> 8));
402 404
403 /* Tell device where in DRAM to update its Rx status */ 405 /* Tell device where in DRAM to update its Rx status */
404 iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG, 406 iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
405 (priv->shared_phys + priv->rb_closed_offset) >> 4); 407 (priv->shared_phys + priv->rb_closed_offset) >> 4);
406 408
407 /* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */ 409 /* Enable Rx DMA
410 * FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set becuase of HW bug in
411 * the credit mechanism in 5000 HW RX FIFO
412 * Direct rx interrupts to hosts
413 * Rx buffer size 4 or 8k
414 * RB timeout 0x10
415 * 256 RBDs
416 */
408 iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 417 iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
409 FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | 418 FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
419 FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY |
410 FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | 420 FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
411 rb_size | 421 rb_size|
412 /* 0x10 << 4 | */ 422 (rb_timeout << FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS)|
413 (RX_QUEUE_SIZE_LOG << 423 (rfdnlog << FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS));
414 FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT));
415
416 /*
417 * iwl_write32(priv,CSR_INT_COAL_REG,0);
418 */
419 424
420 iwl_release_nic_access(priv); 425 iwl_release_nic_access(priv);
426
427 iwl_write32(priv, CSR_INT_COALESCING, 0x40);
428
421 spin_unlock_irqrestore(&priv->lock, flags); 429 spin_unlock_irqrestore(&priv->lock, flags);
422 430
423 return 0; 431 return 0;
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index aee19fa844e4..a912fb68c099 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1949,7 +1949,7 @@ int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
1949 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 1949 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
1950 cmd.action = cpu_to_le16(CMD_ACT_SET); 1950 cmd.action = cpu_to_le16(CMD_ACT_SET);
1951 cmd.enable = !!enable; 1951 cmd.enable = !!enable;
1952 cmd.usesnr = !!enable; 1952 cmd.usesnr = !!usesnr;
1953 cmd.P0 = p0; 1953 cmd.P0 = p0;
1954 cmd.P1 = p1; 1954 cmd.P1 = p1;
1955 cmd.P2 = p2; 1955 cmd.P2 = p2;
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h
index d002160f597d..36be4c9703e0 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -32,6 +32,12 @@ int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
32int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, 32int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
33 int8_t p2, int usesnr); 33 int8_t p2, int usesnr);
34 34
35int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
36 int8_t p1, int8_t p2);
37
38int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
39 int8_t p2, int usesnr);
40
35int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra, 41int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
36 struct cmd_header *resp); 42 struct cmd_header *resp);
37 43
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
index 58d11a35e61b..076a636e8f62 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -189,7 +189,6 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
189#define MRVDRV_CMD_UPLD_RDY 0x0008 189#define MRVDRV_CMD_UPLD_RDY 0x0008
190#define MRVDRV_CARDEVENT 0x0010 190#define MRVDRV_CARDEVENT 0x0010
191 191
192
193/* Automatic TX control default levels */ 192/* Automatic TX control default levels */
194#define POW_ADAPT_DEFAULT_P0 13 193#define POW_ADAPT_DEFAULT_P0 13
195#define POW_ADAPT_DEFAULT_P1 15 194#define POW_ADAPT_DEFAULT_P1 15
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 6ebdd7f161f1..82c3e5a50ea6 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1025,6 +1025,18 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
1025 new_rate); 1025 new_rate);
1026 goto out; 1026 goto out;
1027 } 1027 }
1028 if (priv->fwrelease < 0x09000000) {
1029 ret = lbs_set_power_adapt_cfg(priv, 0,
1030 POW_ADAPT_DEFAULT_P0,
1031 POW_ADAPT_DEFAULT_P1,
1032 POW_ADAPT_DEFAULT_P2);
1033 if (ret)
1034 goto out;
1035 }
1036 ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1,
1037 TPC_DEFAULT_P2, 1);
1038 if (ret)
1039 goto out;
1028 } 1040 }
1029 1041
1030 /* Try the newer command first (Firmware Spec 5.1 and above) */ 1042 /* Try the newer command first (Firmware Spec 5.1 and above) */
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index bac58ed03e5c..de5e8f44b202 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -149,7 +149,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
149 u32 code = le32_to_cpu(bootrec->code); 149 u32 code = le32_to_cpu(bootrec->code);
150 switch (code) { 150 switch (code) {
151 case BR_CODE_COMPONENT_ID: 151 case BR_CODE_COMPONENT_ID:
152 priv->fw_interface = be32_to_cpup(bootrec->data); 152 priv->fw_interface = be32_to_cpup((__be32 *)
153 bootrec->data);
153 switch (priv->fw_interface) { 154 switch (priv->fw_interface) {
154 case FW_FMAC: 155 case FW_FMAC:
155 printk(KERN_INFO "p54: FreeMAC firmware\n"); 156 printk(KERN_INFO "p54: FreeMAC firmware\n");
@@ -181,9 +182,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
181 priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500; 182 priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500;
182 priv->headroom = desc->headroom; 183 priv->headroom = desc->headroom;
183 priv->tailroom = desc->tailroom; 184 priv->tailroom = desc->tailroom;
184 if (bootrec->len == 11) 185 if (le32_to_cpu(bootrec->len) == 11)
185 priv->rx_mtu = (size_t) le16_to_cpu( 186 priv->rx_mtu = le16_to_cpu(bootrec->rx_mtu);
186 (__le16)bootrec->data[10]);
187 else 187 else
188 priv->rx_mtu = (size_t) 188 priv->rx_mtu = (size_t)
189 0x620 - priv->tx_hdr_len; 189 0x620 - priv->tx_hdr_len;
@@ -306,11 +306,11 @@ static int p54_convert_rev1(struct ieee80211_hw *dev,
306 return 0; 306 return 0;
307} 307}
308 308
309const char* p54_rf_chips[] = { "NULL", "Indigo?", "Duette", 309static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette",
310 "Frisbee", "Xbow", "Longbow" }; 310 "Frisbee", "Xbow", "Longbow" };
311static int p54_init_xbow_synth(struct ieee80211_hw *dev); 311static int p54_init_xbow_synth(struct ieee80211_hw *dev);
312 312
313int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) 313static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
314{ 314{
315 struct p54_common *priv = dev->priv; 315 struct p54_common *priv = dev->priv;
316 struct eeprom_pda_wrap *wrap = NULL; 316 struct eeprom_pda_wrap *wrap = NULL;
@@ -617,7 +617,7 @@ static void p54_rx_eeprom_readback(struct ieee80211_hw *dev,
617 if (!priv->eeprom) 617 if (!priv->eeprom)
618 return ; 618 return ;
619 619
620 memcpy(priv->eeprom, eeprom->data, eeprom->len); 620 memcpy(priv->eeprom, eeprom->data, le16_to_cpu(eeprom->len));
621 621
622 complete(&priv->eeprom_comp); 622 complete(&priv->eeprom_comp);
623} 623}
@@ -777,8 +777,9 @@ int p54_read_eeprom(struct ieee80211_hw *dev)
777 hdr->len = cpu_to_le16(blocksize + sizeof(*eeprom_hdr)); 777 hdr->len = cpu_to_le16(blocksize + sizeof(*eeprom_hdr));
778 eeprom_hdr->offset = cpu_to_le16(offset); 778 eeprom_hdr->offset = cpu_to_le16(offset);
779 eeprom_hdr->len = cpu_to_le16(blocksize); 779 eeprom_hdr->len = cpu_to_le16(blocksize);
780 p54_assign_address(dev, NULL, hdr, hdr->len + sizeof(*hdr)); 780 p54_assign_address(dev, NULL, hdr, le16_to_cpu(hdr->len) +
781 priv->tx(dev, hdr, hdr->len + sizeof(*hdr), 0); 781 sizeof(*hdr));
782 priv->tx(dev, hdr, le16_to_cpu(hdr->len) + sizeof(*hdr), 0);
782 783
783 if (!wait_for_completion_interruptible_timeout(&priv->eeprom_comp, HZ)) { 784 if (!wait_for_completion_interruptible_timeout(&priv->eeprom_comp, HZ)) {
784 printk(KERN_ERR "%s: device does not respond!\n", 785 printk(KERN_ERR "%s: device does not respond!\n",
@@ -1247,18 +1248,20 @@ static void p54_configure_filter(struct ieee80211_hw *dev,
1247 1248
1248 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { 1249 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
1249 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) 1250 if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
1250 p54_set_filter(dev, priv->filter_type, NULL); 1251 p54_set_filter(dev, le16_to_cpu(priv->filter_type),
1252 NULL);
1251 else 1253 else
1252 p54_set_filter(dev, priv->filter_type, priv->bssid); 1254 p54_set_filter(dev, le16_to_cpu(priv->filter_type),
1255 priv->bssid);
1253 } 1256 }
1254 1257
1255 if (changed_flags & FIF_PROMISC_IN_BSS) { 1258 if (changed_flags & FIF_PROMISC_IN_BSS) {
1256 if (*total_flags & FIF_PROMISC_IN_BSS) 1259 if (*total_flags & FIF_PROMISC_IN_BSS)
1257 p54_set_filter(dev, priv->filter_type | 1260 p54_set_filter(dev, le16_to_cpu(priv->filter_type) |
1258 cpu_to_le16(0x8), NULL); 1261 0x8, NULL);
1259 else 1262 else
1260 p54_set_filter(dev, priv->filter_type & 1263 p54_set_filter(dev, le16_to_cpu(priv->filter_type) &
1261 ~cpu_to_le16(0x8), priv->bssid); 1264 ~0x8, priv->bssid);
1262 } 1265 }
1263} 1266}
1264 1267
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h
index 4da736c789ac..2fa994cfcfed 100644
--- a/drivers/net/wireless/p54/p54common.h
+++ b/drivers/net/wireless/p54/p54common.h
@@ -18,7 +18,8 @@
18struct bootrec { 18struct bootrec {
19 __le32 code; 19 __le32 code;
20 __le32 len; 20 __le32 len;
21 u32 data[0]; 21 u32 data[10];
22 __le16 rx_mtu;
22} __attribute__((packed)); 23} __attribute__((packed));
23 24
24struct bootrec_exp_if { 25struct bootrec_exp_if {
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 7444f3729779..1912f5e9a0a9 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -218,17 +218,17 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct p54_control_hdr *data,
218 usb_submit_urb(data_urb, GFP_ATOMIC); 218 usb_submit_urb(data_urb, GFP_ATOMIC);
219} 219}
220 220
221__le32 p54u_lm87_chksum(const u32 *data, size_t length) 221static __le32 p54u_lm87_chksum(const u32 *data, size_t length)
222{ 222{
223 __le32 chk = 0; 223 u32 chk = 0;
224 224
225 length >>= 2; 225 length >>= 2;
226 while (length--) { 226 while (length--) {
227 chk ^= cpu_to_le32(*data++); 227 chk ^= *data++;
228 chk = (chk >> 5) ^ (chk << 3); 228 chk = (chk >> 5) ^ (chk << 3);
229 } 229 }
230 230
231 return chk; 231 return cpu_to_le32(chk);
232} 232}
233 233
234static void p54u_tx_lm87(struct ieee80211_hw *dev, 234static void p54u_tx_lm87(struct ieee80211_hw *dev,
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index b686dc45483e..f839ce044afd 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -1,5 +1,5 @@
1config RT2X00 1menuconfig RT2X00
2 tristate "Ralink driver support" 2 bool "Ralink driver support"
3 depends on MAC80211 && WLAN_80211 && EXPERIMENTAL 3 depends on MAC80211 && WLAN_80211 && EXPERIMENTAL
4 ---help--- 4 ---help---
5 This will enable the experimental support for the Ralink drivers, 5 This will enable the experimental support for the Ralink drivers,
@@ -17,39 +17,6 @@ config RT2X00
17 17
18if RT2X00 18if RT2X00
19 19
20config RT2X00_LIB
21 tristate
22
23config RT2X00_LIB_PCI
24 tristate
25 select RT2X00_LIB
26
27config RT2X00_LIB_USB
28 tristate
29 select RT2X00_LIB
30
31config RT2X00_LIB_FIRMWARE
32 boolean
33 depends on RT2X00_LIB
34 select FW_LOADER
35
36config RT2X00_LIB_CRYPTO
37 boolean
38 depends on RT2X00_LIB
39
40config RT2X00_LIB_RFKILL
41 boolean
42 depends on RT2X00_LIB
43 depends on RFKILL
44 default y
45
46config RT2X00_LIB_LEDS
47 boolean
48 depends on RT2X00_LIB
49 depends on NEW_LEDS
50 depends on LEDS_CLASS
51 default y
52
53config RT2400PCI 20config RT2400PCI
54 tristate "Ralink rt2400 (PCI/PCMCIA) support" 21 tristate "Ralink rt2400 (PCI/PCMCIA) support"
55 depends on PCI 22 depends on PCI
@@ -109,6 +76,38 @@ config RT73USB
109 76
110 When compiled as a module, this driver will be called "rt73usb.ko". 77 When compiled as a module, this driver will be called "rt73usb.ko".
111 78
79config RT2X00_LIB_PCI
80 tristate
81 select RT2X00_LIB
82
83config RT2X00_LIB_USB
84 tristate
85 select RT2X00_LIB
86
87config RT2X00_LIB
88 tristate
89
90config RT2X00_LIB_FIRMWARE
91 boolean
92 select FW_LOADER
93
94config RT2X00_LIB_CRYPTO
95 boolean
96
97config RT2X00_LIB_RFKILL
98 boolean
99 default y if (RT2X00_LIB=y && RFKILL=y) || (RT2X00_LIB=m && RFKILL!=n)
100
101comment "rt2x00 rfkill support disabled due to modularized RFKILL and built-in rt2x00"
102 depends on RT2X00_LIB=y && RFKILL=m
103
104config RT2X00_LIB_LEDS
105 boolean
106 default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n)
107
108comment "rt2x00 leds support disabled due to modularized LEDS_CLASS and built-in rt2x00"
109 depends on RT2X00_LIB=y && LEDS_CLASS=m
110
112config RT2X00_LIB_DEBUGFS 111config RT2X00_LIB_DEBUGFS
113 bool "Ralink debugfs support" 112 bool "Ralink debugfs support"
114 depends on RT2X00_LIB && MAC80211_DEBUGFS 113 depends on RT2X00_LIB && MAC80211_DEBUGFS
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index b31399e1fd83..6048579d0b24 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -190,10 +190,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
190#endif 190#endif
191#include <net/iw_handler.h> /* new driver API */ 191#include <net/iw_handler.h> /* new driver API */
192 192
193#ifndef ETH_P_PAE
194#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
195#endif /* ETH_P_PAE */
196
197#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ 193#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
198 194
199#ifndef ETH_P_80211_RAW 195#ifndef ETH_P_80211_RAW
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b5cd91e89712..8336fee68d3e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -58,8 +58,9 @@ static inline int identical_mac_addr_allowed(int type1, int type2)
58 58
59static int ieee80211_open(struct net_device *dev) 59static int ieee80211_open(struct net_device *dev)
60{ 60{
61 struct ieee80211_sub_if_data *sdata, *nsdata; 61 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
62 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 62 struct ieee80211_sub_if_data *nsdata;
63 struct ieee80211_local *local = sdata->local;
63 struct sta_info *sta; 64 struct sta_info *sta;
64 struct ieee80211_if_init_conf conf; 65 struct ieee80211_if_init_conf conf;
65 u32 changed = 0; 66 u32 changed = 0;
@@ -67,8 +68,6 @@ static int ieee80211_open(struct net_device *dev)
67 bool need_hw_reconfig = 0; 68 bool need_hw_reconfig = 0;
68 u8 null_addr[ETH_ALEN] = {0}; 69 u8 null_addr[ETH_ALEN] = {0};
69 70
70 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
71
72 /* fail early if user set an invalid address */ 71 /* fail early if user set an invalid address */
73 if (compare_ether_addr(dev->dev_addr, null_addr) && 72 if (compare_ether_addr(dev->dev_addr, null_addr) &&
74 !is_valid_ether_addr(dev->dev_addr)) 73 !is_valid_ether_addr(dev->dev_addr))
@@ -512,8 +511,8 @@ static int ieee80211_stop(struct net_device *dev)
512 511
513static void ieee80211_set_multicast_list(struct net_device *dev) 512static void ieee80211_set_multicast_list(struct net_device *dev)
514{ 513{
515 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
516 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 514 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
515 struct ieee80211_local *local = sdata->local;
517 int allmulti, promisc, sdata_allmulti, sdata_promisc; 516 int allmulti, promisc, sdata_allmulti, sdata_promisc;
518 517
519 allmulti = !!(dev->flags & IFF_ALLMULTI); 518 allmulti = !!(dev->flags & IFF_ALLMULTI);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c489865761bc..77e7b014872b 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1379,7 +1379,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1379 return RX_QUEUED; 1379 return RX_QUEUED;
1380} 1380}
1381 1381
1382static ieee80211_rx_result debug_noinline 1382static ieee80211_rx_result
1383ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) 1383ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1384{ 1384{
1385 struct ieee80211_hdr *hdr; 1385 struct ieee80211_hdr *hdr;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index c3f436964621..a6b51862a89d 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -189,7 +189,6 @@ struct sta_ampdu_mlme {
189 * @last_qual: qual of last received frame from this STA 189 * @last_qual: qual of last received frame from this STA
190 * @last_noise: noise of last received frame from this STA 190 * @last_noise: noise of last received frame from this STA
191 * @last_seq_ctrl: last received seq/frag number from this STA (per RX queue) 191 * @last_seq_ctrl: last received seq/frag number from this STA (per RX queue)
192 * @wme_rx_queue: TBD
193 * @tx_filtered_count: TBD 192 * @tx_filtered_count: TBD
194 * @tx_retry_failed: TBD 193 * @tx_retry_failed: TBD
195 * @tx_retry_count: TBD 194 * @tx_retry_count: TBD
@@ -199,7 +198,6 @@ struct sta_ampdu_mlme {
199 * @tx_fragments: number of transmitted MPDUs 198 * @tx_fragments: number of transmitted MPDUs
200 * @last_txrate_idx: Index of the last used transmit rate 199 * @last_txrate_idx: Index of the last used transmit rate
201 * @tid_seq: TBD 200 * @tid_seq: TBD
202 * @wme_tx_queue: TBD
203 * @ampdu_mlme: TBD 201 * @ampdu_mlme: TBD
204 * @timer_to_tid: identity mapping to ID timers 202 * @timer_to_tid: identity mapping to ID timers
205 * @tid_to_tx_q: map tid to tx queue 203 * @tid_to_tx_q: map tid to tx queue
@@ -258,9 +256,6 @@ struct sta_info {
258 int last_qual; 256 int last_qual;
259 int last_noise; 257 int last_noise;
260 __le16 last_seq_ctrl[NUM_RX_DATA_QUEUES]; 258 __le16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
261#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
262 unsigned int wme_rx_queue[NUM_RX_DATA_QUEUES];
263#endif
264 259
265 /* Updated from TX status path only, no locking requirements */ 260 /* Updated from TX status path only, no locking requirements */
266 unsigned long tx_filtered_count; 261 unsigned long tx_filtered_count;
@@ -274,9 +269,6 @@ struct sta_info {
274 unsigned long tx_fragments; 269 unsigned long tx_fragments;
275 unsigned int last_txrate_idx; 270 unsigned int last_txrate_idx;
276 u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1]; 271 u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
277#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
278 unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES];
279#endif
280 272
281 /* 273 /*
282 * Aggregation information, locked with lock. 274 * Aggregation information, locked with lock.
@@ -307,10 +299,6 @@ struct sta_info {
307 struct dentry *num_ps_buf_frames; 299 struct dentry *num_ps_buf_frames;
308 struct dentry *inactive_ms; 300 struct dentry *inactive_ms;
309 struct dentry *last_seq_ctrl; 301 struct dentry *last_seq_ctrl;
310#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
311 struct dentry *wme_rx_queue;
312 struct dentry *wme_tx_queue;
313#endif
314 struct dentry *agg_status; 302 struct dentry *agg_status;
315 } debugfs; 303 } debugfs;
316#endif 304#endif
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index c703f8b44e92..139b5f267b34 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -73,9 +73,8 @@ static int wme_downgrade_ac(struct sk_buff *skb)
73 73
74 74
75/* Indicate which queue to use. */ 75/* Indicate which queue to use. */
76static u16 classify80211(struct sk_buff *skb, struct net_device *dev) 76static u16 classify80211(struct ieee80211_local *local, struct sk_buff *skb)
77{ 77{
78 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
79 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 78 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
80 79
81 if (!ieee80211_is_data(hdr->frame_control)) { 80 if (!ieee80211_is_data(hdr->frame_control)) {
@@ -113,14 +112,15 @@ static u16 classify80211(struct sk_buff *skb, struct net_device *dev)
113 112
114u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb) 113u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb)
115{ 114{
115 struct ieee80211_master_priv *mpriv = netdev_priv(dev);
116 struct ieee80211_local *local = mpriv->local;
116 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 117 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
117 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
118 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 118 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
119 struct sta_info *sta; 119 struct sta_info *sta;
120 u16 queue; 120 u16 queue;
121 u8 tid; 121 u8 tid;
122 122
123 queue = classify80211(skb, dev); 123 queue = classify80211(local, skb);
124 if (unlikely(queue >= local->hw.queues)) 124 if (unlikely(queue >= local->hw.queues))
125 queue = local->hw.queues - 1; 125 queue = local->hw.queues - 1;
126 126