Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194228
b: refs/heads/master
c: 2eb46d9
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Roskin authored and John W. Linville committed Apr 8, 2010
1 parent 8d6606b commit f6cff3d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 65 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: f984d94c500c79048b33ab14923dfcec336d9968
refs/heads/master: 2eb46d9bda44b3f85727fee6865d9b25725e6bf9
76 changes: 12 additions & 64 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

static bool ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type);
static void ath9k_hw_set_regs(struct ath_hw *ah, struct ath9k_channel *chan);
static u32 ath9k_hw_ini_fixup(struct ath_hw *ah,
struct ar5416_eeprom_def *pEepData,
u32 reg, u32 value);

MODULE_AUTHOR("Atheros Communications");
MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");
Expand Down Expand Up @@ -844,24 +841,17 @@ static void ath9k_hw_init_mode_gain_regs(struct ath_hw *ah)

static void ath9k_hw_init_eeprom_fix(struct ath_hw *ah)
{
u32 i, j;

if (ah->hw_version.devid == AR9280_DEVID_PCI) {

/* EEPROM Fixup */
for (i = 0; i < ah->iniModes.ia_rows; i++) {
u32 reg = INI_RA(&ah->iniModes, i, 0);
struct base_eep_header *pBase = &(ah->eeprom.def.baseEepHeader);
struct ath_common *common = ath9k_hw_common(ah);

for (j = 1; j < ah->iniModes.ia_columns; j++) {
u32 val = INI_RA(&ah->iniModes, i, j);
ah->need_an_top2_fixup = (ah->hw_version.devid == AR9280_DEVID_PCI) &&
(ah->eep_map != EEP_MAP_4KBITS) &&
((pBase->version & 0xff) > 0x0a) &&
(pBase->pwdclkind == 0);

INI_RA(&ah->iniModes, i, j) =
ath9k_hw_ini_fixup(ah,
&ah->eeprom.def,
reg, val);
}
}
}
if (ah->need_an_top2_fixup)
ath_print(common, ATH_DBG_EEPROM,
"needs fixup for AR_AN_TOP2 register\n");
}

int ath9k_hw_init(struct ath_hw *ah)
Expand Down Expand Up @@ -1305,51 +1295,6 @@ static void ath9k_hw_override_ini(struct ath_hw *ah,
}
}

static u32 ath9k_hw_def_ini_fixup(struct ath_hw *ah,
struct ar5416_eeprom_def *pEepData,
u32 reg, u32 value)
{
struct base_eep_header *pBase = &(pEepData->baseEepHeader);
struct ath_common *common = ath9k_hw_common(ah);

switch (ah->hw_version.devid) {
case AR9280_DEVID_PCI:
if (reg == 0x7894) {
ath_print(common, ATH_DBG_EEPROM,
"ini VAL: %x EEPROM: %x\n", value,
(pBase->version & 0xff));

if ((pBase->version & 0xff) > 0x0a) {
ath_print(common, ATH_DBG_EEPROM,
"PWDCLKIND: %d\n",
pBase->pwdclkind);
value &= ~AR_AN_TOP2_PWDCLKIND;
value |= AR_AN_TOP2_PWDCLKIND &
(pBase->pwdclkind << AR_AN_TOP2_PWDCLKIND_S);
} else {
ath_print(common, ATH_DBG_EEPROM,
"PWDCLKIND Earlier Rev\n");
}

ath_print(common, ATH_DBG_EEPROM,
"final ini VAL: %x\n", value);
}
break;
}

return value;
}

static u32 ath9k_hw_ini_fixup(struct ath_hw *ah,
struct ar5416_eeprom_def *pEepData,
u32 reg, u32 value)
{
if (ah->eep_map == EEP_MAP_4KBITS)
return value;
else
return ath9k_hw_def_ini_fixup(ah, pEepData, reg, value);
}

static void ath9k_olc_init(struct ath_hw *ah)
{
u32 i;
Expand Down Expand Up @@ -1455,6 +1400,9 @@ static int ath9k_hw_process_ini(struct ath_hw *ah,
u32 reg = INI_RA(&ah->iniModes, i, 0);
u32 val = INI_RA(&ah->iniModes, i, modesIndex);

if (reg == AR_AN_TOP2 && ah->need_an_top2_fixup)
val &= ~AR_AN_TOP2_PWDCLKIND;

REG_WRITE(ah, reg, val);

if (reg >= 0x7800 && reg < 0x78a0
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ struct ath_hw {

bool sw_mgmt_crypto;
bool is_pciexpress;
bool need_an_top2_fixup;
u16 tx_trig_level;
u16 rfsilent;
u32 rfkill_gpio;
Expand Down

0 comments on commit f6cff3d

Please sign in to comment.