aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-04-15 17:39:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:43:41 -0400
commitebd5a14a450e31611696dfe96781a3b8915d835c (patch)
treeb44246ca07fcea61e3032325344c74f0685dcf92 /drivers/net/wireless/ath/ath9k/hw.c
parent57b98384e5450996300d77ece61739b58325a84f (diff)
ath9k_hw: move the RF claim stuff to AR9002 hardware family
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c51
1 files changed, 5 insertions, 46 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 888a768ee0b..70162db1323 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -264,21 +264,6 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah)
264 } 264 }
265} 265}
266 266
267static int ath9k_hw_get_radiorev(struct ath_hw *ah)
268{
269 u32 val;
270 int i;
271
272 REG_WRITE(ah, AR_PHY(0x36), 0x00007058);
273
274 for (i = 0; i < 8; i++)
275 REG_WRITE(ah, AR_PHY(0x20), 0x00010000);
276 val = (REG_READ(ah, AR_PHY(256)) >> 24) & 0xff;
277 val = ((val & 0xf0) >> 4) | ((val & 0x0f) << 4);
278
279 return ath9k_hw_reverse_bits(val, 8);
280}
281
282/************************************/ 267/************************************/
283/* HW Attach, Detach, Init Routines */ 268/* HW Attach, Detach, Init Routines */
284/************************************/ 269/************************************/
@@ -438,34 +423,6 @@ static void ath9k_hw_init_defaults(struct ath_hw *ah)
438 ah->power_mode = ATH9K_PM_UNDEFINED; 423 ah->power_mode = ATH9K_PM_UNDEFINED;
439} 424}
440 425
441static int ath9k_hw_rf_claim(struct ath_hw *ah)
442{
443 u32 val;
444
445 REG_WRITE(ah, AR_PHY(0), 0x00000007);
446
447 val = ath9k_hw_get_radiorev(ah);
448 switch (val & AR_RADIO_SREV_MAJOR) {
449 case 0:
450 val = AR_RAD5133_SREV_MAJOR;
451 break;
452 case AR_RAD5133_SREV_MAJOR:
453 case AR_RAD5122_SREV_MAJOR:
454 case AR_RAD2133_SREV_MAJOR:
455 case AR_RAD2122_SREV_MAJOR:
456 break;
457 default:
458 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
459 "Radio Chip Rev 0x%02X not supported\n",
460 val & AR_RADIO_SREV_MAJOR);
461 return -EOPNOTSUPP;
462 }
463
464 ah->hw_version.analog5GhzRev = val;
465
466 return 0;
467}
468
469static int ath9k_hw_init_macaddr(struct ath_hw *ah) 426static int ath9k_hw_init_macaddr(struct ath_hw *ah)
470{ 427{
471 struct ath_common *common = ath9k_hw_common(ah); 428 struct ath_common *common = ath9k_hw_common(ah);
@@ -496,9 +453,11 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
496 return -ENODEV; 453 return -ENODEV;
497 } 454 }
498 455
499 ecode = ath9k_hw_rf_claim(ah); 456 if (!AR_SREV_9300_20_OR_LATER(ah)) {
500 if (ecode != 0) 457 ecode = ar9002_hw_rf_claim(ah);
501 return ecode; 458 if (ecode != 0)
459 return ecode;
460 }
502 461
503 ecode = ath9k_hw_eeprom_init(ah); 462 ecode = ath9k_hw_eeprom_init(ah);
504 if (ecode != 0) 463 if (ecode != 0)