diff options
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r-- | net/mac80211/wext.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index a8bb8e31b1ec..4806d96b9877 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -169,14 +169,26 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev, | |||
169 | range->num_encoding_sizes = 2; | 169 | range->num_encoding_sizes = 2; |
170 | range->max_encoding_tokens = NUM_DEFAULT_KEYS; | 170 | range->max_encoding_tokens = NUM_DEFAULT_KEYS; |
171 | 171 | ||
172 | range->max_qual.qual = local->hw.max_signal; | 172 | if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC || |
173 | range->max_qual.level = local->hw.max_rssi; | 173 | local->hw.flags & IEEE80211_HW_SIGNAL_DB) |
174 | range->max_qual.noise = local->hw.max_noise; | 174 | range->max_qual.level = local->hw.max_signal; |
175 | else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) | ||
176 | range->max_qual.level = -110; | ||
177 | else | ||
178 | range->max_qual.level = 0; | ||
179 | |||
180 | if (local->hw.flags & IEEE80211_HW_NOISE_DBM) | ||
181 | range->max_qual.noise = -110; | ||
182 | else | ||
183 | range->max_qual.noise = 0; | ||
184 | |||
185 | range->max_qual.qual = 100; | ||
175 | range->max_qual.updated = local->wstats_flags; | 186 | range->max_qual.updated = local->wstats_flags; |
176 | 187 | ||
177 | range->avg_qual.qual = local->hw.max_signal/2; | 188 | range->avg_qual.qual = 50; |
178 | range->avg_qual.level = 0; | 189 | /* not always true but better than nothing */ |
179 | range->avg_qual.noise = 0; | 190 | range->avg_qual.level = range->max_qual.level / 2; |
191 | range->avg_qual.noise = range->max_qual.noise / 2; | ||
180 | range->avg_qual.updated = local->wstats_flags; | 192 | range->avg_qual.updated = local->wstats_flags; |
181 | 193 | ||
182 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | 194 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | |
@@ -1007,8 +1019,8 @@ static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev | |||
1007 | wstats->qual.noise = 0; | 1019 | wstats->qual.noise = 0; |
1008 | wstats->qual.updated = IW_QUAL_ALL_INVALID; | 1020 | wstats->qual.updated = IW_QUAL_ALL_INVALID; |
1009 | } else { | 1021 | } else { |
1010 | wstats->qual.level = sta->last_rssi; | 1022 | wstats->qual.level = sta->last_signal; |
1011 | wstats->qual.qual = sta->last_signal; | 1023 | wstats->qual.qual = sta->last_qual; |
1012 | wstats->qual.noise = sta->last_noise; | 1024 | wstats->qual.noise = sta->last_noise; |
1013 | wstats->qual.updated = local->wstats_flags; | 1025 | wstats->qual.updated = local->wstats_flags; |
1014 | } | 1026 | } |