Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171343
b: refs/heads/master
c: a776582
h: refs/heads/master
i:
  171341: 0933cfe
  171339: dfdc1ec
  171335: 951edaf
  171327: f0bd9d3
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 30, 2009
1 parent 80e1ace commit d6f226b
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 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: 896ff260351f736f0d9d32f4fd36257f3e75bd97
refs/heads/master: a77658286105c8be3741305c5dcf4c319746817f
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,9 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,

ah->ath9k_hw_spur_mitigate_freq(ah, chan);
ah->eep_ops->set_board_values(ah, chan);
ath9k_hw_decrease_chain_power(ah, chan);

if (AR_SREV_5416(ah))
ath9k_hw_decrease_chain_power(ah, chan);

REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr));
REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(common->macaddr + 4)
Expand Down
70 changes: 70 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@

#include "hw.h"

static void ath9k_phy_modify_rx_buffer(u32 *rfBuf, u32 reg32,
u32 numBits, u32 firstBit,
u32 column);

/**
* ath9k_hw_write_regs - ??
*
Expand Down Expand Up @@ -429,6 +433,67 @@ void ath9k_hw_9280_spur_mitigate(struct ath_hw *ah, struct ath9k_channel *chan)

/* All code below is for non single-chip solutions */

/*
* Fix on 2.4 GHz band for orientation sensitivity issue by increasing
* rf_pwd_icsyndiv.
*
* Theoretical Rules:
* if 2 GHz band
* if forceBiasAuto
* if synth_freq < 2412
* bias = 0
* else if 2412 <= synth_freq <= 2422
* bias = 1
* else // synth_freq > 2422
* bias = 2
* else if forceBias > 0
* bias = forceBias & 7
* else
* no change, use value from ini file
* else
* no change, invalid band
*
* 1st Mod:
* 2422 also uses value of 2
* <approved>
*
* 2nd Mod:
* Less than 2412 uses value of 0, 2412 and above uses value of 2
*/
static void ath9k_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
{
struct ath_common *common = ath9k_hw_common(ah);
u32 tmp_reg;
int reg_writes = 0;
u32 new_bias = 0;

if (!AR_SREV_5416(ah) || synth_freq >= 3000) {
return;
}

BUG_ON(AR_SREV_9280_10_OR_LATER(ah));

if (synth_freq < 2412)
new_bias = 0;
else if (synth_freq < 2422)
new_bias = 1;
else
new_bias = 2;

/* pre-reverse this field */
tmp_reg = ath9k_hw_reverse_bits(new_bias, 3);

ath_print(common, ATH_DBG_CONFIG,
"Force rf_pwd_icsyndiv to %1d on %4d\n",
new_bias, synth_freq);

/* swizzle rf_pwd_icsyndiv */
ath9k_phy_modify_rx_buffer(ah->analogBank6Data, tmp_reg, 3, 181, 3);

/* write Bank 6 with new params */
REG_WRITE_RF_ARRAY(&ah->iniBank6, ah->analogBank6Data, reg_writes);
}

/**
* ath9k_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios
* @ah: atheros hardware stucture
Expand Down Expand Up @@ -499,6 +564,9 @@ int ath9k_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
return -EINVAL;
}

ath9k_hw_force_bias(ah, freq);
ath9k_hw_decrease_chain_power(ah, chan);

reg32 =
(channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) |
(1 << 5) | 0x1;
Expand Down Expand Up @@ -946,6 +1014,8 @@ ath9k_hw_decrease_chain_power(struct ath_hw *ah, struct ath9k_channel *chan)
u32 bank6SelMask;
u32 *bank6Temp = ah->bank6Temp;

BUG_ON(AR_SREV_9280_10_OR_LATER(ah));

switch (ah->config.diversity_control) {
case ATH9K_ANT_FIXED_A:
bank6SelMask =
Expand Down

0 comments on commit d6f226b

Please sign in to comment.