aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-25 17:15:08 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-28 09:13:09 -0500
commit05253c93feb40901d80a0d6f239a0bc78860c679 (patch)
treeb83242d123469de89bdc3f22f2f2232f4e482586 /drivers/net/wireless/rt2x00
parent61667d8d5bf3c3ee09474069eaf4b93a4755ff8b (diff)
rt2x00: Don't switch to antenna with low rssi
When rssi_a > rssi_b is true and the current antenna was already antenna A, then rt2x00 incorrectly jumped to antenna B. Also don't configure the antenna when there has been no change in the antenna setup. 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')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c18
2 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 0d57d7f67837..07adc576db49 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -97,6 +97,10 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
97 libconf.ant.rx = rx; 97 libconf.ant.rx = rx;
98 libconf.ant.tx = tx; 98 libconf.ant.tx = tx;
99 99
100 if (rx == rt2x00dev->link.ant.active.rx &&
101 tx == rt2x00dev->link.ant.active.tx)
102 return;
103
100 /* 104 /*
101 * Antenna setup changes require the RX to be disabled, 105 * Antenna setup changes require the RX to be disabled,
102 * else the changes will be ignored by the device. 106 * else the changes will be ignored by the device.
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 00f5f0d49e1d..7294c75272d0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -260,19 +260,11 @@ static void rt2x00lib_evaluate_antenna_sample(struct rt2x00_dev *rt2x00dev)
260 if (sample_a == sample_b) 260 if (sample_a == sample_b)
261 return; 261 return;
262 262
263 if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) { 263 if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY)
264 if (sample_a > sample_b && rx == ANTENNA_B) 264 rx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;
265 rx = ANTENNA_A;
266 else if (rx == ANTENNA_A)
267 rx = ANTENNA_B;
268 }
269 265
270 if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY) { 266 if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)
271 if (sample_a > sample_b && tx == ANTENNA_B) 267 tx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;
272 tx = ANTENNA_A;
273 else if (tx == ANTENNA_A)
274 tx = ANTENNA_B;
275 }
276 268
277 rt2x00lib_config_antenna(rt2x00dev, rx, tx); 269 rt2x00lib_config_antenna(rt2x00dev, rx, tx);
278} 270}
@@ -327,7 +319,7 @@ static void rt2x00lib_evaluate_antenna(struct rt2x00_dev *rt2x00dev)
327 319
328 if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) && 320 if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&
329 !(rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)) { 321 !(rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)) {
330 rt2x00dev->link.ant.flags &= ~ANTENNA_MODE_SAMPLE; 322 rt2x00dev->link.ant.flags = 0;
331 return; 323 return;
332 } 324 }
333 325