Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171448
b: refs/heads/master
c: 70d9f40
h: refs/heads/master
v: v3
  • Loading branch information
Larry Finger authored and John W. Linville committed Nov 6, 2009
1 parent 1193c92 commit cfa694c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 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: 715caaeb896a51fe1583f306fb10b22cfab4f7fd
refs/heads/master: 70d9f405d09e334b609702d88ee03b6119c4b45e
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/rtl818x/rtl8187.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ struct rtl8187_priv {
} hw_rev;
struct sk_buff_head rx_queue;
u8 signal;
u8 quality;
u8 noise;
u8 slot_time;
u8 aifsn[4];
Expand Down
13 changes: 3 additions & 10 deletions trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ static void rtl8187_rx_cb(struct urb *urb)
struct ieee80211_rx_status rx_status = { 0 };
int rate, signal;
u32 flags;
u32 quality;
unsigned long f;

spin_lock_irqsave(&priv->rx_queue.lock, f);
Expand All @@ -338,10 +337,9 @@ static void rtl8187_rx_cb(struct urb *urb)
(typeof(hdr))(skb_tail_pointer(skb) - sizeof(*hdr));
flags = le32_to_cpu(hdr->flags);
/* As with the RTL8187B below, the AGC is used to calculate
* signal strength and quality. In this case, the scaling
* signal strength. In this case, the scaling
* constants are derived from the output of p54usb.
*/
quality = 130 - ((41 * hdr->agc) >> 6);
signal = -4 - ((27 * hdr->agc) >> 6);
rx_status.antenna = (hdr->signal >> 7) & 1;
rx_status.mactime = le64_to_cpu(hdr->mac_time);
Expand All @@ -354,23 +352,18 @@ static void rtl8187_rx_cb(struct urb *urb)
* In testing, none of these quantities show qualitative
* agreement with AP signal strength, except for the AGC,
* which is inversely proportional to the strength of the
* signal. In the following, the quality and signal strength
* are derived from the AGC. The arbitrary scaling constants
* signal. In the following, the signal strength
* is derived from the AGC. The arbitrary scaling constants
* are chosen to make the results close to the values obtained
* for a BCM4312 using b43 as the driver. The noise is ignored
* for now.
*/
flags = le32_to_cpu(hdr->flags);
quality = 170 - hdr->agc;
signal = 14 - hdr->agc / 2;
rx_status.antenna = (hdr->rssi >> 7) & 1;
rx_status.mactime = le64_to_cpu(hdr->mac_time);
}

if (quality > 100)
quality = 100;
rx_status.qual = quality;
priv->quality = quality;
rx_status.signal = signal;
priv->signal = signal;
rate = (flags >> 20) & 0xF;
Expand Down

0 comments on commit cfa694c

Please sign in to comment.