diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-07-19 16:35:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-20 16:53:09 -0400 |
commit | 8b74964c73ca9eed7078388d871cc7fae973cb63 (patch) | |
tree | 0fe432bb9425d9418b7169a9763633d79d14b94f /drivers/net/wireless/rtl818x | |
parent | b603742f49c3ec922522602e18ac22e8f6835132 (diff) |
rtl8180: improve signal reporting for rtl8185 hardware
The existing code seemed to be somewhat based on the datasheet, but
varied substantially from the vendor-provided driver. This mirrors the
handling of the rtl8185 case from that driver, but still neglects the
specifics for the rtl8180 hardware. Those details are a bit muddled...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8180_dev.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c index 42705028751d..31808f96a3d6 100644 --- a/drivers/net/wireless/rtl818x/rtl8180_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c | |||
@@ -103,6 +103,7 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev) | |||
103 | { | 103 | { |
104 | struct rtl8180_priv *priv = dev->priv; | 104 | struct rtl8180_priv *priv = dev->priv; |
105 | unsigned int count = 32; | 105 | unsigned int count = 32; |
106 | u8 signal; | ||
106 | 107 | ||
107 | while (count--) { | 108 | while (count--) { |
108 | struct rtl8180_rx_desc *entry = &priv->rx_ring[priv->rx_idx]; | 109 | struct rtl8180_rx_desc *entry = &priv->rx_ring[priv->rx_idx]; |
@@ -130,10 +131,14 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev) | |||
130 | skb_put(skb, flags & 0xFFF); | 131 | skb_put(skb, flags & 0xFFF); |
131 | 132 | ||
132 | rx_status.antenna = (flags2 >> 15) & 1; | 133 | rx_status.antenna = (flags2 >> 15) & 1; |
133 | /* TODO: improve signal/rssi reporting */ | ||
134 | rx_status.signal = (flags2 >> 8) & 0x7F; | ||
135 | /* XXX: is this correct? */ | ||
136 | rx_status.rate_idx = (flags >> 20) & 0xF; | 134 | rx_status.rate_idx = (flags >> 20) & 0xF; |
135 | /* TODO: improve signal/rssi reporting for !rtl8185 */ | ||
136 | signal = (flags2 >> 17) & 0x7F; | ||
137 | if (rx_status.rate_idx > 3) | ||
138 | signal = 90 - clamp_t(u8, signal, 25, 90); | ||
139 | else | ||
140 | signal = 95 - clamp_t(u8, signal, 30, 95); | ||
141 | rx_status.signal = signal; | ||
137 | rx_status.freq = dev->conf.channel->center_freq; | 142 | rx_status.freq = dev->conf.channel->center_freq; |
138 | rx_status.band = dev->conf.channel->band; | 143 | rx_status.band = dev->conf.channel->band; |
139 | rx_status.mactime = le64_to_cpu(entry->tsft); | 144 | rx_status.mactime = le64_to_cpu(entry->tsft); |