diff options
-rw-r--r-- | include/linux/nl80211.h | 15 | ||||
-rw-r--r-- | include/net/cfg80211.h | 20 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 15 |
3 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index c08709fe36fc..0edb2566c14c 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1413,6 +1413,16 @@ enum nl80211_reg_rule_flags { | |||
1413 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel | 1413 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel |
1414 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) | 1414 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) |
1415 | * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used | 1415 | * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used |
1416 | * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio | ||
1417 | * spent on this channel | ||
1418 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary | ||
1419 | * channel was sensed busy (either due to activity or energy detect) | ||
1420 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension | ||
1421 | * channel was sensed busy | ||
1422 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent | ||
1423 | * receiving data | ||
1424 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent | ||
1425 | * transmitting data | ||
1416 | * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number | 1426 | * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number |
1417 | * currently defined | 1427 | * currently defined |
1418 | * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use | 1428 | * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use |
@@ -1422,6 +1432,11 @@ enum nl80211_survey_info { | |||
1422 | NL80211_SURVEY_INFO_FREQUENCY, | 1432 | NL80211_SURVEY_INFO_FREQUENCY, |
1423 | NL80211_SURVEY_INFO_NOISE, | 1433 | NL80211_SURVEY_INFO_NOISE, |
1424 | NL80211_SURVEY_INFO_IN_USE, | 1434 | NL80211_SURVEY_INFO_IN_USE, |
1435 | NL80211_SURVEY_INFO_CHANNEL_TIME, | ||
1436 | NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, | ||
1437 | NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, | ||
1438 | NL80211_SURVEY_INFO_CHANNEL_TIME_RX, | ||
1439 | NL80211_SURVEY_INFO_CHANNEL_TIME_TX, | ||
1425 | 1440 | ||
1426 | /* keep last */ | 1441 | /* keep last */ |
1427 | __NL80211_SURVEY_INFO_AFTER_LAST, | 1442 | __NL80211_SURVEY_INFO_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f920a06f363e..24d5b5869272 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -294,6 +294,11 @@ struct key_params { | |||
294 | * | 294 | * |
295 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 295 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
296 | * @SURVEY_INFO_IN_USE: channel is currently being used | 296 | * @SURVEY_INFO_IN_USE: channel is currently being used |
297 | * @SURVEY_INFO_CHANNEL_TIME: channel active time (in ms) was filled in | ||
298 | * @SURVEY_INFO_CHANNEL_TIME_BUSY: channel busy time was filled in | ||
299 | * @SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: extension channel busy time was filled in | ||
300 | * @SURVEY_INFO_CHANNEL_TIME_RX: channel receive time was filled in | ||
301 | * @SURVEY_INFO_CHANNEL_TIME_TX: channel transmit time was filled in | ||
297 | * | 302 | * |
298 | * Used by the driver to indicate which info in &struct survey_info | 303 | * Used by the driver to indicate which info in &struct survey_info |
299 | * it has filled in during the get_survey(). | 304 | * it has filled in during the get_survey(). |
@@ -301,6 +306,11 @@ struct key_params { | |||
301 | enum survey_info_flags { | 306 | enum survey_info_flags { |
302 | SURVEY_INFO_NOISE_DBM = 1<<0, | 307 | SURVEY_INFO_NOISE_DBM = 1<<0, |
303 | SURVEY_INFO_IN_USE = 1<<1, | 308 | SURVEY_INFO_IN_USE = 1<<1, |
309 | SURVEY_INFO_CHANNEL_TIME = 1<<2, | ||
310 | SURVEY_INFO_CHANNEL_TIME_BUSY = 1<<3, | ||
311 | SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 1<<4, | ||
312 | SURVEY_INFO_CHANNEL_TIME_RX = 1<<5, | ||
313 | SURVEY_INFO_CHANNEL_TIME_TX = 1<<6, | ||
304 | }; | 314 | }; |
305 | 315 | ||
306 | /** | 316 | /** |
@@ -310,6 +320,11 @@ enum survey_info_flags { | |||
310 | * @filled: bitflag of flags from &enum survey_info_flags | 320 | * @filled: bitflag of flags from &enum survey_info_flags |
311 | * @noise: channel noise in dBm. This and all following fields are | 321 | * @noise: channel noise in dBm. This and all following fields are |
312 | * optional | 322 | * optional |
323 | * @channel_time: amount of time in ms the radio spent on the channel | ||
324 | * @channel_time_busy: amount of time the primary channel was sensed busy | ||
325 | * @channel_time_ext_busy: amount of time the extension channel was sensed busy | ||
326 | * @channel_time_rx: amount of time the radio spent receiving data | ||
327 | * @channel_time_tx: amount of time the radio spent transmitting data | ||
313 | * | 328 | * |
314 | * Used by dump_survey() to report back per-channel survey information. | 329 | * Used by dump_survey() to report back per-channel survey information. |
315 | * | 330 | * |
@@ -318,6 +333,11 @@ enum survey_info_flags { | |||
318 | */ | 333 | */ |
319 | struct survey_info { | 334 | struct survey_info { |
320 | struct ieee80211_channel *channel; | 335 | struct ieee80211_channel *channel; |
336 | u64 channel_time; | ||
337 | u64 channel_time_busy; | ||
338 | u64 channel_time_ext_busy; | ||
339 | u64 channel_time_rx; | ||
340 | u64 channel_time_tx; | ||
321 | u32 filled; | 341 | u32 filled; |
322 | s8 noise; | 342 | s8 noise; |
323 | }; | 343 | }; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 882dc921103b..c506241f8637 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3153,6 +3153,21 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 pid, u32 seq, | |||
3153 | survey->noise); | 3153 | survey->noise); |
3154 | if (survey->filled & SURVEY_INFO_IN_USE) | 3154 | if (survey->filled & SURVEY_INFO_IN_USE) |
3155 | NLA_PUT_FLAG(msg, NL80211_SURVEY_INFO_IN_USE); | 3155 | NLA_PUT_FLAG(msg, NL80211_SURVEY_INFO_IN_USE); |
3156 | if (survey->filled & SURVEY_INFO_CHANNEL_TIME) | ||
3157 | NLA_PUT_U64(msg, NL80211_SURVEY_INFO_CHANNEL_TIME, | ||
3158 | survey->channel_time); | ||
3159 | if (survey->filled & SURVEY_INFO_CHANNEL_TIME_BUSY) | ||
3160 | NLA_PUT_U64(msg, NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, | ||
3161 | survey->channel_time_busy); | ||
3162 | if (survey->filled & SURVEY_INFO_CHANNEL_TIME_EXT_BUSY) | ||
3163 | NLA_PUT_U64(msg, NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, | ||
3164 | survey->channel_time_ext_busy); | ||
3165 | if (survey->filled & SURVEY_INFO_CHANNEL_TIME_RX) | ||
3166 | NLA_PUT_U64(msg, NL80211_SURVEY_INFO_CHANNEL_TIME_RX, | ||
3167 | survey->channel_time_rx); | ||
3168 | if (survey->filled & SURVEY_INFO_CHANNEL_TIME_TX) | ||
3169 | NLA_PUT_U64(msg, NL80211_SURVEY_INFO_CHANNEL_TIME_TX, | ||
3170 | survey->channel_time_tx); | ||
3156 | 3171 | ||
3157 | nla_nest_end(msg, infoattr); | 3172 | nla_nest_end(msg, infoattr); |
3158 | 3173 | ||