Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159405
b: refs/heads/master
c: 8df5d1b
h: refs/heads/master
i:
  159403: c8a7e4c
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent 4756981 commit da5b919
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 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: 4f3acf81f2a47244f7403353784f528c92e98a6c
refs/heads/master: 8df5d1b77395271dd9b75ed2b9aa9235f7589a0d
15 changes: 6 additions & 9 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,14 @@ static void ath9k_hw_set_defaults(struct ath_hw *ah)
ah->config.serialize_regmode = SER_REG_MODE_AUTO;
}

static void ath9k_hw_newstate(u16 devid,
struct ath_hw *ah)
static void ath9k_hw_newstate(struct ath_hw *ah)
{
ah->hw_version.magic = AR5416_MAGIC;
ah->regulatory.country_code = CTRY_DEFAULT;
ah->hw_version.devid = devid;
ah->hw_version.subvendorid = 0;

ah->ah_flags = 0;
if ((devid == AR5416_AR9100_DEVID))
if (ah->hw_version.devid == AR5416_AR9100_DEVID)
ah->hw_version.macVersion = AR_SREV_VERSION_9100;
if (!AR_SREV_9100(ah))
ah->ah_flags = AH_USE_EEPROM;
Expand Down Expand Up @@ -611,13 +609,12 @@ static int ath9k_hw_post_attach(struct ath_hw *ah)
}

static int ath9k_hw_do_attach(struct ath_hw *ah,
u16 devid,
struct ath_softc *sc)
{
int r;
u32 i, j;

ath9k_hw_newstate(devid, ah);
ath9k_hw_newstate(ah);
ath9k_hw_set_defaults(ah);

if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
Expand Down Expand Up @@ -1186,9 +1183,9 @@ void ath9k_hw_detach(struct ath_hw *ah)
kfree(ah);
}

int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc)
int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc)
{
switch (devid) {
switch (ah->hw_version.devid) {
case AR5416_DEVID_PCI:
case AR5416_DEVID_PCIE:
case AR5416_AR9100_DEVID:
Expand All @@ -1198,7 +1195,7 @@ int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc)
case AR9285_DEVID_PCIE:
case AR5416_DEVID_AR9287_PCI:
case AR5416_DEVID_AR9287_PCIE:
return ath9k_hw_do_attach(ah, devid, sc);
return ath9k_hw_do_attach(ah, sc);
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ struct ath_hw {
/* Attach, Detach, Reset */
const char *ath9k_hw_probe(u16 vendorid, u16 devid);
void ath9k_hw_detach(struct ath_hw *ah);
int ath9k_hw_attach(struct ath_hw *ah, u16 devid, struct ath_softc *sc);
int ath9k_hw_attach(struct ath_hw *ah, struct ath_softc *sc);
void ath9k_hw_rfdetach(struct ath_hw *ah);
int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
bool bChannelChange);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,9 @@ static int ath_init(u16 devid, struct ath_softc *sc)
}

ah->ah_sc = sc;
ah->hw_version.devid = devid;

r = ath9k_hw_attach(ah, devid, sc);
r = ath9k_hw_attach(ah, sc);
if (r) {
DPRINTF(sc, ATH_DBG_FATAL,
"Unable to attach hardware; "
Expand Down

0 comments on commit da5b919

Please sign in to comment.