Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159407
b: refs/heads/master
c: ee2bb46
h: refs/heads/master
i:
  159405: da5b919
  159403: c8a7e4c
  159399: 4c26c09
  159391: 800e3ac
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent 980b227 commit 244e8db
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1e2f93ffacab692823209e00a124e802039aa9a
refs/heads/master: ee2bb460e28b757f097efb9e5947a6e47e2477e1
48 changes: 26 additions & 22 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 */
/*******/
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 244e8db

Please sign in to comment.