diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index ee7a70a13250..1ce7af9bec35 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c | |||
@@ -152,15 +152,18 @@ static inline char *ipw2100_translate_scan(struct ieee80211_device *ieee, | |||
152 | iwe.u.qual.level = 0; | 152 | iwe.u.qual.level = 0; |
153 | } else { | 153 | } else { |
154 | iwe.u.qual.level = network->stats.rssi; | 154 | iwe.u.qual.level = network->stats.rssi; |
155 | iwe.u.qual.qual = | 155 | if (ieee->perfect_rssi == ieee->worst_rssi) |
156 | (100 * | 156 | iwe.u.qual.qual = 100; |
157 | (ieee->perfect_rssi - ieee->worst_rssi) * | 157 | else |
158 | (ieee->perfect_rssi - ieee->worst_rssi) - | 158 | iwe.u.qual.qual = |
159 | (ieee->perfect_rssi - network->stats.rssi) * | 159 | (100 * |
160 | (15 * (ieee->perfect_rssi - ieee->worst_rssi) + | 160 | (ieee->perfect_rssi - ieee->worst_rssi) * |
161 | 62 * (ieee->perfect_rssi - network->stats.rssi))) / | 161 | (ieee->perfect_rssi - ieee->worst_rssi) - |
162 | ((ieee->perfect_rssi - ieee->worst_rssi) * | 162 | (ieee->perfect_rssi - network->stats.rssi) * |
163 | (ieee->perfect_rssi - ieee->worst_rssi)); | 163 | (15 * (ieee->perfect_rssi - ieee->worst_rssi) + |
164 | 62 * (ieee->perfect_rssi - network->stats.rssi))) / | ||
165 | ((ieee->perfect_rssi - ieee->worst_rssi) * | ||
166 | (ieee->perfect_rssi - ieee->worst_rssi)); | ||
164 | if (iwe.u.qual.qual > 100) | 167 | if (iwe.u.qual.qual > 100) |
165 | iwe.u.qual.qual = 100; | 168 | iwe.u.qual.qual = 100; |
166 | else if (iwe.u.qual.qual < 1) | 169 | else if (iwe.u.qual.qual < 1) |