aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-08-03 15:24:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:28 -0400
commit8df5d1b77395271dd9b75ed2b9aa9235f7589a0d (patch)
tree735c3ac7d49dbe49a611b3683d9a5ee8c59ea94e /drivers/net/wireless/ath/ath9k/hw.c
parent4f3acf81f2a47244f7403353784f528c92e98a6c (diff)
ath9k: move devid cache setting to ath_init()
This lets us trim one argument off of hw initializer routines. 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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index fcefea8461f6..ff2875b233da 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -437,16 +437,14 @@ static void ath9k_hw_set_defaults(struct ath_hw *ah)
437 ah->config.serialize_regmode = SER_REG_MODE_AUTO; 437 ah->config.serialize_regmode = SER_REG_MODE_AUTO;
438} 438}
439 439
440static void ath9k_hw_newstate(u16 devid, 440static void ath9k_hw_newstate(struct ath_hw *ah)
441 struct ath_hw *ah)
442{ 441{
443 ah->hw_version.magic = AR5416_MAGIC; 442 ah->hw_version.magic = AR5416_MAGIC;
444 ah->regulatory.country_code = CTRY_DEFAULT; 443 ah->regulatory.country_code = CTRY_DEFAULT;
445 ah->hw_version.devid = devid;
446 ah->hw_version.subvendorid = 0; 444 ah->hw_version.subvendorid = 0;
447 445
448 ah->ah_flags = 0; 446 ah->ah_flags = 0;
449 if ((devid == AR5416_AR9100_DEVID)) 447 if (ah->hw_version.devid == AR5416_AR9100_DEVID)
450 ah->hw_version.macVersion = AR_SREV_VERSION_9100; 448 ah->hw_version.macVersion = AR_SREV_VERSION_9100;
451 if (!AR_SREV_9100(ah)) 449 if (!AR_SREV_9100(ah))
452 ah->ah_flags = AH_USE_EEPROM; 450 ah->ah_flags = AH_USE_EEPROM;
@@ -611,13 +609,12 @@ static int ath9k_hw_post_attach(struct ath_hw *ah)
611} 609}
612 610
613static int ath9k_hw_do_attach(struct ath_hw *ah, 611static int ath9k_hw_do_attach(struct ath_hw *ah,
614 u16 devid,
615 struct ath_softc *sc) 612 struct ath_softc *sc)
616{ 613{
617 int r; 614 int r;
618 u32 i, j; 615 u32 i, j;
619 616
620 ath9k_hw_newstate(devid, ah); 617 ath9k_hw_newstate(ah);
621 ath9k_hw_set_defaults(ah); 618 ath9k_hw_set_defaults(ah);
622 619
623 if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { 620 if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
@@ -1186,9 +1183,9 @@ void ath9k_hw_detach(struct ath_hw *ah)
1186 kfree(ah); 1183 kfree(ah);
1187} 1184}
1188 1185
1189int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc) 1186int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
1190{ 1187{
1191 switch (devid) { 1188 switch (ah->hw_version.devid) {
1192 case AR5416_DEVID_PCI: 1189 case AR5416_DEVID_PCI:
1193 case AR5416_DEVID_PCIE: 1190 case AR5416_DEVID_PCIE:
1194 case AR5416_AR9100_DEVID: 1191 case AR5416_AR9100_DEVID:
@@ -1198,7 +1195,7 @@ int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc)
1198 case AR9285_DEVID_PCIE: 1195 case AR9285_DEVID_PCIE:
1199 case AR5416_DEVID_AR9287_PCI: 1196 case AR5416_DEVID_AR9287_PCI:
1200 case AR5416_DEVID_AR9287_PCIE: 1197 case AR5416_DEVID_AR9287_PCIE:
1201 return ath9k_hw_do_attach(ah, devid, sc); 1198 return ath9k_hw_do_attach(ah, sc);
1202 default: 1199 default:
1203 break; 1200 break;
1204 } 1201 }