aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ieee80211/ieee80211_wx.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index f87c6b89f845..9496918e6106 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -149,9 +149,7 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee,
149 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID | 149 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID |
150 IW_QUAL_LEVEL_INVALID; 150 IW_QUAL_LEVEL_INVALID;
151 iwe.u.qual.qual = 0; 151 iwe.u.qual.qual = 0;
152 iwe.u.qual.level = 0;
153 } else { 152 } else {
154 iwe.u.qual.level = network->stats.rssi;
155 if (ieee->perfect_rssi == ieee->worst_rssi) 153 if (ieee->perfect_rssi == ieee->worst_rssi)
156 iwe.u.qual.qual = 100; 154 iwe.u.qual.qual = 100;
157 else 155 else
@@ -179,6 +177,13 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee,
179 iwe.u.qual.noise = network->stats.noise; 177 iwe.u.qual.noise = network->stats.noise;
180 } 178 }
181 179
180 if (!(network->stats.mask & IEEE80211_STATMASK_SIGNAL)) {
181 iwe.u.qual.updated |= IW_QUAL_LEVEL_INVALID;
182 iwe.u.qual.level = 0;
183 } else {
184 iwe.u.qual.level = network->stats.signal;
185 }
186
182 start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN); 187 start = iwe_stream_add_event(start, stop, &iwe, IW_EV_QUAL_LEN);
183 188
184 iwe.cmd = IWEVCUSTOM; 189 iwe.cmd = IWEVCUSTOM;
@@ -229,6 +234,28 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee,
229 if (iwe.u.data.length) 234 if (iwe.u.data.length)
230 start = iwe_stream_add_point(start, stop, &iwe, custom); 235 start = iwe_stream_add_point(start, stop, &iwe, custom);
231 236
237 /* Add spectrum management information */
238 iwe.cmd = -1;
239 p = custom;
240 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Channel flags: ");
241
242 if (ieee80211_get_channel_flags(ieee, network->channel) &
243 IEEE80211_CH_INVALID) {
244 iwe.cmd = IWEVCUSTOM;
245 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "INVALID ");
246 }
247
248 if (ieee80211_get_channel_flags(ieee, network->channel) &
249 IEEE80211_CH_RADAR_DETECT) {
250 iwe.cmd = IWEVCUSTOM;
251 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "DFS ");
252 }
253
254 if (iwe.cmd == IWEVCUSTOM) {
255 iwe.u.data.length = p - custom;
256 start = iwe_stream_add_point(start, stop, &iwe, custom);
257 }
258
232 return start; 259 return start;
233} 260}
234 261