diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-08-03 15:24:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-04 16:44:28 -0400 |
commit | 8df5d1b77395271dd9b75ed2b9aa9235f7589a0d (patch) | |
tree | 735c3ac7d49dbe49a611b3683d9a5ee8c59ea94e | |
parent | 4f3acf81f2a47244f7403353784f528c92e98a6c (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>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 3 |
3 files changed, 9 insertions, 11 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 | ||
440 | static void ath9k_hw_newstate(u16 devid, | 440 | static 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 | ||
613 | static int ath9k_hw_do_attach(struct ath_hw *ah, | 611 | static 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 | ||
1189 | int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc) | 1186 | int 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 | } |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 4a0d5f202a7e..c769dd6a8356 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -544,7 +544,7 @@ struct ath_hw { | |||
544 | /* Attach, Detach, Reset */ | 544 | /* Attach, Detach, Reset */ |
545 | const char *ath9k_hw_probe(u16 vendorid, u16 devid); | 545 | const char *ath9k_hw_probe(u16 vendorid, u16 devid); |
546 | void ath9k_hw_detach(struct ath_hw *ah); | 546 | void ath9k_hw_detach(struct ath_hw *ah); |
547 | int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc); | 547 | int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc); |
548 | void ath9k_hw_rfdetach(struct ath_hw *ah); | 548 | void ath9k_hw_rfdetach(struct ath_hw *ah); |
549 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | 549 | int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, |
550 | bool bChannelChange); | 550 | bool bChannelChange); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index c2b9974aa094..fa2c230c3c2f 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1331,8 +1331,9 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1331 | } | 1331 | } |
1332 | 1332 | ||
1333 | ah->ah_sc = sc; | 1333 | ah->ah_sc = sc; |
1334 | ah->hw_version.devid = devid; | ||
1334 | 1335 | ||
1335 | r = ath9k_hw_attach(ah, devid, sc); | 1336 | r = ath9k_hw_attach(ah, sc); |
1336 | if (r) { | 1337 | if (r) { |
1337 | DPRINTF(sc, ATH_DBG_FATAL, | 1338 | DPRINTF(sc, ATH_DBG_FATAL, |
1338 | "Unable to attach hardware; " | 1339 | "Unable to attach hardware; " |