diff options
author | Lars Ericsson <lars_ericsson@telia.com> | 2010-09-08 22:55:36 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-15 00:03:43 +0400 |
commit | 85f4d6488cba35d3bb58833edbcb28faaffdd37c (patch) | |
tree | 8bd04ff80a54cfcf86c7f017de892f694af63ed8 /drivers/net/wireless/rt2x00/rt2x00link.c | |
parent | 58d7e0f37cfc5b4f473d437024a03d874e5969a3 (diff) | |
download | linux-85f4d6488cba35d3bb58833edbcb28faaffdd37c.tar.xz |
rt2x00: Antenna diversity does not work in 2.6.35
The test if antenna diversity is at all enabled uses a local variable
'flags' to prepare the test condition, but uses 'ant->flags' when the test
is evaluated. The effect is that the diversity evaluation will never start.
I can see two solutions, use the 'flag' in the test condition or revert the
local flag change. My attached patch took alternative two.
Then the evaluation start but it will still not switch antenna. The problem
is a code section in rt2x00lib_config_antenna (). The effect of that code
section is that any change the diversity function perform will be
effectively shorten and no antenna selection command issued. The attached
patch will filter out any ANTENNA_SW_DIVERSITY setting but forward all
other
Signed-off-by: Lars Ericsson <lars_ericsson@telia.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00link.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00link.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c index 666cef3f8472..4d534e9dc628 100644 --- a/drivers/net/wireless/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/rt2x00/rt2x00link.c @@ -188,7 +188,6 @@ static void rt2x00lib_antenna_diversity_eval(struct rt2x00_dev *rt2x00dev) static bool rt2x00lib_antenna_diversity(struct rt2x00_dev *rt2x00dev) { struct link_ant *ant = &rt2x00dev->link.ant; - unsigned int flags = ant->flags; /* * Determine if software diversity is enabled for @@ -196,13 +195,13 @@ static bool rt2x00lib_antenna_diversity(struct rt2x00_dev *rt2x00dev) * Always perform this check since within the link * tuner interval the configuration might have changed. */ - flags &= ~ANTENNA_RX_DIVERSITY; - flags &= ~ANTENNA_TX_DIVERSITY; + ant->flags &= ~ANTENNA_RX_DIVERSITY; + ant->flags &= ~ANTENNA_TX_DIVERSITY; if (rt2x00dev->default_ant.rx == ANTENNA_SW_DIVERSITY) - flags |= ANTENNA_RX_DIVERSITY; + ant->flags |= ANTENNA_RX_DIVERSITY; if (rt2x00dev->default_ant.tx == ANTENNA_SW_DIVERSITY) - flags |= ANTENNA_TX_DIVERSITY; + ant->flags |= ANTENNA_TX_DIVERSITY; if (!(ant->flags & ANTENNA_RX_DIVERSITY) && !(ant->flags & ANTENNA_TX_DIVERSITY)) { @@ -210,9 +209,6 @@ static bool rt2x00lib_antenna_diversity(struct rt2x00_dev *rt2x00dev) return true; } - /* Update flags */ - ant->flags = flags; - /* * If we have only sampled the data over the last period * we should now harvest the data. Otherwise just evaluate |