diff options
author | Zhu Yi <yi.zhu@intel.com> | 2006-01-19 03:21:54 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-01-27 17:08:06 -0500 |
commit | 7bd64366044565d6861783613db191c8aaec691e (patch) | |
tree | 2a75f5bda5df503c532e7c12f53b9be9bd47401e /net/ieee80211/ieee80211_wx.c | |
parent | d128f6c176bff9c4929476e13132804321a6d5c5 (diff) |
[PATCH] ieee80211: Add spectrum management information
Add spectrum management information and use stat.signal to provide
signal level information.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/ieee80211_wx.c')
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 31 |
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 | ||