aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorHenning Rogge <hrogge@googlemail.com>2008-12-11 16:04:19 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:04:54 -0500
commit420e7fabd9c6d907280ed6b3e40eef425c5d8d8d (patch)
tree6effc9f9386746d1aeb953e32fe82b0a5a5fdf18 /net/mac80211/cfg.c
parent221b3d60cbb2740ec7d46a4f1ea6d3318a112e51 (diff)
nl80211: Add signal strength and bandwith to nl80211station info
This patch adds signal strength and transmission bitrate to the station_info of nl80211. Signed-off-by: Henning Rogge <rogge@fgan.de> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7912eb14eca0..23b5eeaf7bc5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -310,12 +310,35 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
310 310
311 sinfo->filled = STATION_INFO_INACTIVE_TIME | 311 sinfo->filled = STATION_INFO_INACTIVE_TIME |
312 STATION_INFO_RX_BYTES | 312 STATION_INFO_RX_BYTES |
313 STATION_INFO_TX_BYTES; 313 STATION_INFO_TX_BYTES |
314 STATION_INFO_TX_BITRATE;
314 315
315 sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); 316 sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
316 sinfo->rx_bytes = sta->rx_bytes; 317 sinfo->rx_bytes = sta->rx_bytes;
317 sinfo->tx_bytes = sta->tx_bytes; 318 sinfo->tx_bytes = sta->tx_bytes;
318 319
320 if (sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
321 sinfo->filled |= STATION_INFO_SIGNAL;
322 sinfo->signal = (s8)sta->last_signal;
323 }
324
325 sinfo->txrate.flags = 0;
326 if (sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS)
327 sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
328 if (sta->last_tx_rate.flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
329 sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
330 if (sta->last_tx_rate.flags & IEEE80211_TX_RC_SHORT_GI)
331 sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
332
333 if (!(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS)) {
334 struct ieee80211_supported_band *sband;
335 sband = sta->local->hw.wiphy->bands[
336 sta->local->hw.conf.channel->band];
337 sinfo->txrate.legacy =
338 sband->bitrates[sta->last_tx_rate.idx].bitrate;
339 } else
340 sinfo->txrate.mcs = sta->last_tx_rate.idx;
341
319 if (ieee80211_vif_is_mesh(&sdata->vif)) { 342 if (ieee80211_vif_is_mesh(&sdata->vif)) {
320#ifdef CONFIG_MAC80211_MESH 343#ifdef CONFIG_MAC80211_MESH
321 sinfo->filled |= STATION_INFO_LLID | 344 sinfo->filled |= STATION_INFO_LLID |