From 244e8db4d8adc65b56e1a6d8dcd1e5f4f0441579 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Mon, 3 Aug 2009 12:24:39 -0700 Subject: [PATCH] --- yaml --- r: 159407 b: refs/heads/master c: ee2bb460e28b757f097efb9e5947a6e47e2477e1 h: refs/heads/master i: 159405: da5b919e728e27d72d2f9e23d56d46c3fbf86d98 159403: c8a7e4c29bbfa89ca07cd4efb81e73969b004108 159399: 4c26c098a173532972ec982566f102030ae5c3fe 159391: 800e3acafffd3eb5ce2f548d93ea4f6eef9e67b8 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/ath/ath9k/hw.c | 48 ++++++++++++----------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index 6e5063a31e59..439f0654f879 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e1e2f93ffacab692823209e00a124e802039aa9a +refs/heads/master: ee2bb460e28b757f097efb9e5947a6e47e2477e1 diff --git a/trunk/drivers/net/wireless/ath/ath9k/hw.c b/trunk/drivers/net/wireless/ath/ath9k/hw.c index ff2875b233da..d8ae289a09b4 100644 --- a/trunk/drivers/net/wireless/ath/ath9k/hw.c +++ b/trunk/drivers/net/wireless/ath/ath9k/hw.c @@ -608,12 +608,35 @@ static int ath9k_hw_post_attach(struct ath_hw *ah) return 0; } -static int ath9k_hw_do_attach(struct ath_hw *ah, - struct ath_softc *sc) +static bool ath9k_hw_devid_supported(u16 devid) +{ + switch (devid) { + case AR5416_DEVID_PCI: + case AR5416_DEVID_PCIE: + case AR5416_AR9100_DEVID: + case AR9160_DEVID_PCI: + case AR9280_DEVID_PCI: + case AR9280_DEVID_PCIE: + case AR9285_DEVID_PCIE: + case AR5416_DEVID_AR9287_PCI: + case AR5416_DEVID_AR9287_PCIE: + return true; + default: + break; + } + return false; +} + +int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc) { int r; u32 i, j; + if (!ath9k_hw_devid_supported(ah->hw_version.devid)) { + r = -EOPNOTSUPP; + goto bad; + } + ath9k_hw_newstate(ah); ath9k_hw_set_defaults(ah); @@ -1183,25 +1206,6 @@ void ath9k_hw_detach(struct ath_hw *ah) kfree(ah); } -int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc) -{ - switch (ah->hw_version.devid) { - case AR5416_DEVID_PCI: - case AR5416_DEVID_PCIE: - case AR5416_AR9100_DEVID: - case AR9160_DEVID_PCI: - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: - case AR9285_DEVID_PCIE: - case AR5416_DEVID_AR9287_PCI: - case AR5416_DEVID_AR9287_PCIE: - return ath9k_hw_do_attach(ah, sc); - default: - break; - } - return -EOPNOTSUPP; -} - /*******/ /* INI */ /*******/ @@ -2898,7 +2902,7 @@ void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore) /* * AR9280 2.0 or later chips use SerDes values from the * initvals.h initialized depending on chipset during - * ath9k_hw_do_attach() + * ath9k_hw_attach() */ for (i = 0; i < ah->iniPcieSerdes.ia_rows; i++) { REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0),