summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-08-03 12:24:41 -0700
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:29 -0400
commitf9d4a668035b0bf65d1c8d5eba680201112f7c3d (patch)
treeb07c2720a4b248135dad44686587e8489bb4a33b
parent07c10c6177bdd199fead127c2a4c43acb415a5be (diff)
ath9k: move hw macrevision checker to helper
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.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 301ef04e052..4f3d7bf73c5 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -627,6 +627,23 @@ static bool ath9k_hw_devid_supported(u16 devid)
return false;
}
+static bool ath9k_hw_macversion_supported(u32 macversion)
+{
+ switch (macversion) {
+ case AR_SREV_VERSION_5416_PCI:
+ case AR_SREV_VERSION_5416_PCIE:
+ case AR_SREV_VERSION_9160:
+ case AR_SREV_VERSION_9100:
+ case AR_SREV_VERSION_9280:
+ case AR_SREV_VERSION_9285:
+ case AR_SREV_VERSION_9287:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
int ath9k_hw_attach(struct ath_hw *ah)
{
int r;
@@ -666,16 +683,7 @@ int ath9k_hw_attach(struct ath_hw *ah)
DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
ah->config.serialize_regmode);
- switch (ah->hw_version.macVersion) {
- case AR_SREV_VERSION_5416_PCI:
- case AR_SREV_VERSION_5416_PCIE:
- case AR_SREV_VERSION_9160:
- case AR_SREV_VERSION_9100:
- case AR_SREV_VERSION_9280:
- case AR_SREV_VERSION_9285:
- case AR_SREV_VERSION_9287:
- break;
- default:
+ if (!ath9k_hw_macversion_supported(ah->hw_version.macVersion)) {
DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
"Mac Chip Rev 0x%02x.%x is not supported by "
"this driver\n", ah->hw_version.macVersion,