cfg80211: add nl80211 beacon-only statistics
authorJohannes Berg <johannes.berg@intel.com>
Mon, 17 Nov 2014 13:12:22 +0000 (14:12 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Jan 2015 14:28:13 +0000 (15:28 +0100)
Add these two values:
 * BEACON_RX: number of beacons received from this peer
 * BEACON_SIGNAL_AVG: signal strength average for beacons only

These can then be used for Android Lollipop's statistics request.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 91c133626c32626ffa1d442f16e2df0978c6e6bd..ef26ce16b0585b7d371e23148f317932e3754bea 100644 (file)
@@ -987,6 +987,9 @@ struct sta_bss_parameters {
  * @nonpeer_pm: non-peer mesh STA power save mode
  * @expected_throughput: expected throughput in kbps (including 802.11 headers)
  *     towards this station.
+ * @rx_beacon: number of beacons received from this peer
+ * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
+ *     from this peer
  */
 struct station_info {
        u32 filled;
@@ -1026,6 +1029,9 @@ struct station_info {
        enum nl80211_mesh_power_mode nonpeer_pm;
 
        u32 expected_throughput;
+
+       u64 rx_beacon;
+       u8 rx_beacon_signal_avg;
 };
 
 /**
index e48ca0bbd07b5f2190f89567d91b8753dbd2c95d..0c3d341c0aeb3e73f93b6392c4fb026a93bb0d70 100644 (file)
@@ -2375,6 +2375,9 @@ enum nl80211_sta_bss_param {
  *     802.11 header (u32, kbps)
  * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
  *     (u64)
+ * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
+ * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average
+ *     for beacons only (u8, dBm)
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -2408,6 +2411,8 @@ enum nl80211_sta_info {
        NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
        NL80211_STA_INFO_EXPECTED_THROUGHPUT,
        NL80211_STA_INFO_RX_DROP_MISC,
+       NL80211_STA_INFO_BEACON_RX,
+       NL80211_STA_INFO_BEACON_SIGNAL_AVG,
 
        /* keep last */
        __NL80211_STA_INFO_AFTER_LAST,
index 68faf8a2aa438e183672e8f071d0f62e7c6d6162..42b968a1f9941c4c7bbd2b1c2a59653384281beb 100644 (file)
@@ -3768,6 +3768,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
 
        PUT_SINFO(T_OFFSET, t_offset, u64);
        PUT_SINFO(RX_DROP_MISC, rx_dropped_misc, u64);
+       PUT_SINFO(BEACON_RX, rx_beacon, u64);
+       PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
 
 #undef PUT_SINFO
        nla_nest_end(msg, sinfoattr);