* [PATCH 3/9] ath5k: Fix diversity
@ 2007-12-16 0:55 Nick Kossifidis
0 siblings, 0 replies; only message in thread
From: Nick Kossifidis @ 2007-12-16 0:55 UTC (permalink / raw)
To: ath5k-devel, linux-wireless; +Cc: linville, bruno, jirislaby, mcgrof
* Fix diversity support
We have to write all antenna information on AR5K_PHY_ANT_SWITCH_TABLE if antenna mode is not fixed.
Changes-licensed-under: ISC
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
---
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index aea9589..8357cac 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -578,7 +578,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
ATH5K_TRACE(ah->ah_sc);
s_seq = 0;
- s_ant = 1;
+ s_ant = 0;
ee_mode = 0;
freq = 0;
mode = 0;
@@ -753,14 +753,20 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode,
AR5K_TXCFG_B_MODE);
}
- /* Set antenna mode */
- AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x44),
- ah->ah_antenna[ee_mode][0], 0xfffffc06);
-
- if (freq == AR5K_INI_RFGAIN_2GHZ)
- ant[0] = ant[1] = AR5K_ANT_FIXED_B;
- else
- ant[0] = ant[1] = AR5K_ANT_FIXED_A;
+ /*
+ * In case a fixed antenna was set as default
+ * write the same settings on both AR5K_PHY_ANT_SWITCH_TABLE
+ * registers.
+ */
+ if (s_ant != 0){
+ if (s_ant == AR5K_ANT_FIXED_A) /* 1 - Main */
+ ant[0] = ant[1] = AR5K_ANT_FIXED_A;
+ else /* 2 - Aux */
+ ant[0] = ant[1] = AR5K_ANT_FIXED_B;
+ } else {
+ ant[0] = AR5K_ANT_FIXED_A;
+ ant[1] = AR5K_ANT_FIXED_B;
+ }
ath5k_hw_reg_write(ah, ah->ah_antenna[ee_mode][ant[0]],
AR5K_PHY_ANT_SWITCH_TABLE_0);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-16 0:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-16 0:55 [PATCH 3/9] ath5k: Fix diversity Nick Kossifidis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.