Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86478
b: refs/heads/master
c: 05253c9
h: refs/heads/master
v: v3
  • Loading branch information
Ivo van Doorn authored and John W. Linville committed Feb 28, 2008
1 parent 24e8ca0 commit 28f57d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 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: 61667d8d5bf3c3ee09474069eaf4b93a4755ff8b
refs/heads/master: 05253c93feb40901d80a0d6f239a0bc78860c679
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00config.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
libconf.ant.rx = rx;
libconf.ant.tx = tx;

if (rx == rt2x00dev->link.ant.active.rx &&
tx == rt2x00dev->link.ant.active.tx)
return;

/*
* Antenna setup changes require the RX to be disabled,
* else the changes will be ignored by the device.
Expand Down
18 changes: 5 additions & 13 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,11 @@ static void rt2x00lib_evaluate_antenna_sample(struct rt2x00_dev *rt2x00dev)
if (sample_a == sample_b)
return;

if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) {
if (sample_a > sample_b && rx == ANTENNA_B)
rx = ANTENNA_A;
else if (rx == ANTENNA_A)
rx = ANTENNA_B;
}
if (rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY)
rx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY) {
if (sample_a > sample_b && tx == ANTENNA_B)
tx = ANTENNA_A;
else if (tx == ANTENNA_A)
tx = ANTENNA_B;
}
if (rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)
tx = (sample_a > sample_b) ? ANTENNA_A : ANTENNA_B;

rt2x00lib_config_antenna(rt2x00dev, rx, tx);
}
Expand Down Expand Up @@ -327,7 +319,7 @@ static void rt2x00lib_evaluate_antenna(struct rt2x00_dev *rt2x00dev)

if (!(rt2x00dev->link.ant.flags & ANTENNA_RX_DIVERSITY) &&
!(rt2x00dev->link.ant.flags & ANTENNA_TX_DIVERSITY)) {
rt2x00dev->link.ant.flags &= ~ANTENNA_MODE_SAMPLE;
rt2x00dev->link.ant.flags = 0;
return;
}

Expand Down

0 comments on commit 28f57d0

Please sign in to comment.