提交 ee2bb460 编写于 作者: L Luis R. Rodriguez 提交者: John W. Linville

ath9k: call hw initializer directly

ath9k_hw_attach() was going first through some device id verifier,
and then calling some other helper which was doing the real hardware
initialization. Lets just do the devid checks within the real worker
by calling a helper ath9k_hw_devid_supported().
Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e1e2f93f
...@@ -608,12 +608,35 @@ static int ath9k_hw_post_attach(struct ath_hw *ah) ...@@ -608,12 +608,35 @@ static int ath9k_hw_post_attach(struct ath_hw *ah)
return 0; return 0;
} }
static int ath9k_hw_do_attach(struct ath_hw *ah, static bool ath9k_hw_devid_supported(u16 devid)
struct ath_softc *sc) {
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; int r;
u32 i, j; u32 i, j;
if (!ath9k_hw_devid_supported(ah->hw_version.devid)) {
r = -EOPNOTSUPP;
goto bad;
}
ath9k_hw_newstate(ah); ath9k_hw_newstate(ah);
ath9k_hw_set_defaults(ah); ath9k_hw_set_defaults(ah);
...@@ -1183,25 +1206,6 @@ void ath9k_hw_detach(struct ath_hw *ah) ...@@ -1183,25 +1206,6 @@ void ath9k_hw_detach(struct ath_hw *ah)
kfree(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 */ /* INI */
/*******/ /*******/
...@@ -2898,7 +2902,7 @@ void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore) ...@@ -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 * AR9280 2.0 or later chips use SerDes values from the
* initvals.h initialized depending on chipset during * initvals.h initialized depending on chipset during
* ath9k_hw_do_attach() * ath9k_hw_attach()
*/ */
for (i = 0; i < ah->iniPcieSerdes.ia_rows; i++) { for (i = 0; i < ah->iniPcieSerdes.ia_rows; i++) {
REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0), REG_WRITE(ah, INI_RA(&ah->iniPcieSerdes, i, 0),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册