aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-08-03 15:24:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:29 -0400
commitf9d4a668035b0bf65d1c8d5eba680201112f7c3d (patch)
treeb07c2720a4b248135dad44686587e8489bb4a33b /drivers
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>
Diffstat (limited to 'drivers')
-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 301ef04e0529..4f3d7bf73c52 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)
627 return false; 627 return false;
628} 628}
629 629
630static bool ath9k_hw_macversion_supported(u32 macversion)
631{
632 switch (macversion) {
633 case AR_SREV_VERSION_5416_PCI:
634 case AR_SREV_VERSION_5416_PCIE:
635 case AR_SREV_VERSION_9160:
636 case AR_SREV_VERSION_9100:
637 case AR_SREV_VERSION_9280:
638 case AR_SREV_VERSION_9285:
639 case AR_SREV_VERSION_9287:
640 return true;
641 default:
642 break;
643 }
644 return false;
645}
646
630int ath9k_hw_attach(struct ath_hw *ah) 647int ath9k_hw_attach(struct ath_hw *ah)
631{ 648{
632 int r; 649 int r;
@@ -666,16 +683,7 @@ int ath9k_hw_attach(struct ath_hw *ah)
666 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n", 683 DPRINTF(ah->ah_sc, ATH_DBG_RESET, "serialize_regmode is %d\n",
667 ah->config.serialize_regmode); 684 ah->config.serialize_regmode);
668 685
669 switch (ah->hw_version.macVersion) { 686 if (!ath9k_hw_macversion_supported(ah->hw_version.macVersion)) {
670 case AR_SREV_VERSION_5416_PCI:
671 case AR_SREV_VERSION_5416_PCIE:
672 case AR_SREV_VERSION_9160:
673 case AR_SREV_VERSION_9100:
674 case AR_SREV_VERSION_9280:
675 case AR_SREV_VERSION_9285:
676 case AR_SREV_VERSION_9287:
677 break;
678 default:
679 DPRINTF(ah->ah_sc, ATH_DBG_FATAL, 687 DPRINTF(ah->ah_sc, ATH_DBG_FATAL,
680 "Mac Chip Rev 0x%02x.%x is not supported by " 688 "Mac Chip Rev 0x%02x.%x is not supported by "
681 "this driver\n", ah->hw_version.macVersion, 689 "this driver\n", ah->hw_version.macVersion,