aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-14 10:44:11 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-08 09:27:58 -0500
commit052536abfa9144566599a7fbe8cc89e1086fa9a7 (patch)
tree8a80459200cfd34ddfd8c33ec7b4ba6a3c06fc2e
parent11f78ac32b06648c1dde9371b70323168b51a83e (diff)
cfg80211: add scan time to survey data
Add the time spent scanning to the survey data so it can be reported by drivers that collect such information. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--include/uapi/linux/nl80211.h3
-rw-r--r--net/wireless/nl80211.c4
-rw-r--r--net/wireless/trace.h7
4 files changed, 16 insertions, 2 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 5a861440c122..f94f0d486d13 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -525,6 +525,7 @@ ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
525 * @SURVEY_INFO_TIME_EXT_BUSY: extension channel busy time was filled in 525 * @SURVEY_INFO_TIME_EXT_BUSY: extension channel busy time was filled in
526 * @SURVEY_INFO_TIME_RX: receive time was filled in 526 * @SURVEY_INFO_TIME_RX: receive time was filled in
527 * @SURVEY_INFO_TIME_TX: transmit time was filled in 527 * @SURVEY_INFO_TIME_TX: transmit time was filled in
528 * @SURVEY_INFO_TIME_SCAN: scan time was filled in
528 * 529 *
529 * Used by the driver to indicate which info in &struct survey_info 530 * Used by the driver to indicate which info in &struct survey_info
530 * it has filled in during the get_survey(). 531 * it has filled in during the get_survey().
@@ -537,6 +538,7 @@ enum survey_info_flags {
537 SURVEY_INFO_TIME_EXT_BUSY = BIT(4), 538 SURVEY_INFO_TIME_EXT_BUSY = BIT(4),
538 SURVEY_INFO_TIME_RX = BIT(5), 539 SURVEY_INFO_TIME_RX = BIT(5),
539 SURVEY_INFO_TIME_TX = BIT(6), 540 SURVEY_INFO_TIME_TX = BIT(6),
541 SURVEY_INFO_TIME_SCAN = BIT(7),
540}; 542};
541 543
542/** 544/**
@@ -552,6 +554,7 @@ enum survey_info_flags {
552 * @time_ext_busy: amount of time the extension channel was sensed busy 554 * @time_ext_busy: amount of time the extension channel was sensed busy
553 * @time_rx: amount of time the radio spent receiving data 555 * @time_rx: amount of time the radio spent receiving data
554 * @time_tx: amount of time the radio spent transmitting data 556 * @time_tx: amount of time the radio spent transmitting data
557 * @time_scan: amount of time the radio spent for scanning
555 * 558 *
556 * Used by dump_survey() to report back per-channel survey information. 559 * Used by dump_survey() to report back per-channel survey information.
557 * 560 *
@@ -565,6 +568,7 @@ struct survey_info {
565 u64 time_ext_busy; 568 u64 time_ext_busy;
566 u64 time_rx; 569 u64 time_rx;
567 u64 time_tx; 570 u64 time_tx;
571 u64 time_scan;
568 u32 filled; 572 u32 filled;
569 s8 noise; 573 s8 noise;
570}; 574};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5e8b65f239a5..2f549a253138 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2835,6 +2835,8 @@ enum nl80211_user_reg_hint_type {
2835 * receiving data (on channel or globally) 2835 * receiving data (on channel or globally)
2836 * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent 2836 * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent
2837 * transmitting data (on channel or globally) 2837 * transmitting data (on channel or globally)
2838 * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
2839 * (on this channel or globally)
2838 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number 2840 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
2839 * currently defined 2841 * currently defined
2840 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use 2842 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
@@ -2849,6 +2851,7 @@ enum nl80211_survey_info {
2849 NL80211_SURVEY_INFO_TIME_EXT_BUSY, 2851 NL80211_SURVEY_INFO_TIME_EXT_BUSY,
2850 NL80211_SURVEY_INFO_TIME_RX, 2852 NL80211_SURVEY_INFO_TIME_RX,
2851 NL80211_SURVEY_INFO_TIME_TX, 2853 NL80211_SURVEY_INFO_TIME_TX,
2854 NL80211_SURVEY_INFO_TIME_SCAN,
2852 2855
2853 /* keep last */ 2856 /* keep last */
2854 __NL80211_SURVEY_INFO_AFTER_LAST, 2857 __NL80211_SURVEY_INFO_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 9555ef9fd99e..f56309bd21bd 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6667,6 +6667,10 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq,
6667 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_TX, 6667 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_TX,
6668 survey->time_tx)) 6668 survey->time_tx))
6669 goto nla_put_failure; 6669 goto nla_put_failure;
6670 if ((survey->filled & SURVEY_INFO_TIME_SCAN) &&
6671 nla_put_u64(msg, NL80211_SURVEY_INFO_TIME_SCAN,
6672 survey->time_scan))
6673 goto nla_put_failure;
6670 6674
6671 nla_nest_end(msg, infoattr); 6675 nla_nest_end(msg, infoattr);
6672 6676
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index bbb7afc264af..b17b3692f8c2 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1609,6 +1609,7 @@ TRACE_EVENT(rdev_return_int_survey_info,
1609 __field(u64, time_ext_busy) 1609 __field(u64, time_ext_busy)
1610 __field(u64, time_rx) 1610 __field(u64, time_rx)
1611 __field(u64, time_tx) 1611 __field(u64, time_tx)
1612 __field(u64, time_scan)
1612 __field(u32, filled) 1613 __field(u32, filled)
1613 __field(s8, noise) 1614 __field(s8, noise)
1614 ), 1615 ),
@@ -1621,17 +1622,19 @@ TRACE_EVENT(rdev_return_int_survey_info,
1621 __entry->time_ext_busy = info->time_ext_busy; 1622 __entry->time_ext_busy = info->time_ext_busy;
1622 __entry->time_rx = info->time_rx; 1623 __entry->time_rx = info->time_rx;
1623 __entry->time_tx = info->time_tx; 1624 __entry->time_tx = info->time_tx;
1625 __entry->time_scan = info->time_scan;
1624 __entry->filled = info->filled; 1626 __entry->filled = info->filled;
1625 __entry->noise = info->noise; 1627 __entry->noise = info->noise;
1626 ), 1628 ),
1627 TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT 1629 TP_printk(WIPHY_PR_FMT ", returned: %d, " CHAN_PR_FMT
1628 ", channel time: %llu, channel time busy: %llu, " 1630 ", channel time: %llu, channel time busy: %llu, "
1629 "channel time extension busy: %llu, channel time rx: %llu, " 1631 "channel time extension busy: %llu, channel time rx: %llu, "
1630 "channel time tx: %llu, filled: %u, noise: %d", 1632 "channel time tx: %llu, scan time: %llu, filled: %u, noise: %d",
1631 WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG, 1633 WIPHY_PR_ARG, __entry->ret, CHAN_PR_ARG,
1632 __entry->time, __entry->time_busy, 1634 __entry->time, __entry->time_busy,
1633 __entry->time_ext_busy, __entry->time_rx, 1635 __entry->time_ext_busy, __entry->time_rx,
1634 __entry->time_tx, __entry->filled, __entry->noise) 1636 __entry->time_tx, __entry->time_scan,
1637 __entry->filled, __entry->noise)
1635); 1638);
1636 1639
1637TRACE_EVENT(rdev_tdls_oper, 1640TRACE_EVENT(rdev_tdls_oper,