aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
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/rt2x00dev.c
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/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c18
1 files changed, 5 insertions, 13 deletions
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