aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-09 14:17:24 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-09 14:17:24 -0500
commitf6d773cd4f3c18c40ab25a5cb92453756237840e (patch)
tree5631a6ea4495ae2eb5058fb63b25dea3b197d61b /drivers/net/wireless/rtl818x
parentd0e1e88d6e7dbd8e1661cb6a058ca30f54ee39e4 (diff)
parentbcb628d579a61d0ab0cac4c6cc8a403de5254920 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187.h1
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c13
2 files changed, 3 insertions, 11 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h
index bf9175a8c1f4..abb4907cf296 100644
--- a/drivers/net/wireless/rtl818x/rtl8187.h
+++ b/drivers/net/wireless/rtl818x/rtl8187.h
@@ -119,7 +119,6 @@ struct rtl8187_priv {
119 } hw_rev; 119 } hw_rev;
120 struct sk_buff_head rx_queue; 120 struct sk_buff_head rx_queue;
121 u8 signal; 121 u8 signal;
122 u8 quality;
123 u8 noise; 122 u8 noise;
124 u8 slot_time; 123 u8 slot_time;
125 u8 aifsn[4]; 124 u8 aifsn[4];
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 2017ccc00145..76973b8c7099 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -320,7 +320,6 @@ static void rtl8187_rx_cb(struct urb *urb)
320 struct ieee80211_rx_status rx_status = { 0 }; 320 struct ieee80211_rx_status rx_status = { 0 };
321 int rate, signal; 321 int rate, signal;
322 u32 flags; 322 u32 flags;
323 u32 quality;
324 unsigned long f; 323 unsigned long f;
325 324
326 spin_lock_irqsave(&priv->rx_queue.lock, f); 325 spin_lock_irqsave(&priv->rx_queue.lock, f);
@@ -338,10 +337,9 @@ static void rtl8187_rx_cb(struct urb *urb)
338 (typeof(hdr))(skb_tail_pointer(skb) - sizeof(*hdr)); 337 (typeof(hdr))(skb_tail_pointer(skb) - sizeof(*hdr));
339 flags = le32_to_cpu(hdr->flags); 338 flags = le32_to_cpu(hdr->flags);
340 /* As with the RTL8187B below, the AGC is used to calculate 339 /* As with the RTL8187B below, the AGC is used to calculate
341 * signal strength and quality. In this case, the scaling 340 * signal strength. In this case, the scaling
342 * constants are derived from the output of p54usb. 341 * constants are derived from the output of p54usb.
343 */ 342 */
344 quality = 130 - ((41 * hdr->agc) >> 6);
345 signal = -4 - ((27 * hdr->agc) >> 6); 343 signal = -4 - ((27 * hdr->agc) >> 6);
346 rx_status.antenna = (hdr->signal >> 7) & 1; 344 rx_status.antenna = (hdr->signal >> 7) & 1;
347 rx_status.mactime = le64_to_cpu(hdr->mac_time); 345 rx_status.mactime = le64_to_cpu(hdr->mac_time);
@@ -354,23 +352,18 @@ static void rtl8187_rx_cb(struct urb *urb)
354 * In testing, none of these quantities show qualitative 352 * In testing, none of these quantities show qualitative
355 * agreement with AP signal strength, except for the AGC, 353 * agreement with AP signal strength, except for the AGC,
356 * which is inversely proportional to the strength of the 354 * which is inversely proportional to the strength of the
357 * signal. In the following, the quality and signal strength 355 * signal. In the following, the signal strength
358 * are derived from the AGC. The arbitrary scaling constants 356 * is derived from the AGC. The arbitrary scaling constants
359 * are chosen to make the results close to the values obtained 357 * are chosen to make the results close to the values obtained
360 * for a BCM4312 using b43 as the driver. The noise is ignored 358 * for a BCM4312 using b43 as the driver. The noise is ignored
361 * for now. 359 * for now.
362 */ 360 */
363 flags = le32_to_cpu(hdr->flags); 361 flags = le32_to_cpu(hdr->flags);
364 quality = 170 - hdr->agc;
365 signal = 14 - hdr->agc / 2; 362 signal = 14 - hdr->agc / 2;
366 rx_status.antenna = (hdr->rssi >> 7) & 1; 363 rx_status.antenna = (hdr->rssi >> 7) & 1;
367 rx_status.mactime = le64_to_cpu(hdr->mac_time); 364 rx_status.mactime = le64_to_cpu(hdr->mac_time);
368 } 365 }
369 366
370 if (quality > 100)
371 quality = 100;
372 rx_status.qual = quality;
373 priv->quality = quality;
374 rx_status.signal = signal; 367 rx_status.signal = signal;
375 priv->signal = signal; 368 priv->signal = signal;
376 rate = (flags >> 20) & 0xF; 369 rate = (flags >> 20) & 0xF;