cfg80211: clarify frames covered by average ACK signal report
authorBalaji Pothunoori <bpothuno@codeaurora.org>
Thu, 19 Jul 2018 13:26:27 +0000 (18:56 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 29 Aug 2018 09:01:51 +0000 (11:01 +0200)
Modify the API to include all ACK frames in average ACK
signal strength reporting, not just ACKs for data frames.
Make exposing the data conditional on implementing the
extended feature flag.

This is how it was really implemented in mac80211, update
the code there to use the new defines and clean up some of
the setting code.

Keep nl80211.h source compatibility by keeping the old names.

Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org>
[rewrite commit log, change compatibility to be old=new
 instead of the other way around, update kernel-doc,
 roll in mac80211 changes, make mac80211 depend on valid
 bit instead of HW flag]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/uapi/linux/nl80211.h
net/mac80211/sta_info.c
net/wireless/nl80211.c

index 023989604fc6af9346b866c84ff72f3710d20a5e..1766a12b231c7e1641ede3a84a0416e6ab7be420 100644 (file)
@@ -3050,8 +3050,7 @@ enum nl80211_sta_bss_param {
  *     received from the station (u64, usec)
  * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
  * @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
- * @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data)
- *     ACK frame (s8, dBm)
+ * @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -3091,13 +3090,17 @@ enum nl80211_sta_info {
        NL80211_STA_INFO_RX_DURATION,
        NL80211_STA_INFO_PAD,
        NL80211_STA_INFO_ACK_SIGNAL,
-       NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,
+       NL80211_STA_INFO_ACK_SIGNAL_AVG,
 
        /* keep last */
        __NL80211_STA_INFO_AFTER_LAST,
        NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
 };
 
+/* we renamed this - stay compatible */
+#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG
+
+
 /**
  * enum nl80211_tid_stats - per TID statistics attributes
  * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
@@ -5213,9 +5216,8 @@ enum nl80211_feature_flags {
  *     "radar detected" event.
  * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and
  *     receiving control port frames over nl80211 instead of the netdevice.
- * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack
- *     rssi if firmware support, this flag is to intimate about ack rssi
- *     support to nl80211.
+ * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
+ *     (average) ACK signal strength reporting.
  * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
  *      TXQs.
  * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
@@ -5255,7 +5257,9 @@ enum nl80211_ext_feature_index {
        NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
        NL80211_EXT_FEATURE_DFS_OFFLOAD,
        NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
-       NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,
+       NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
+       /* we renamed this - stay compatible */
+       NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
        NL80211_EXT_FEATURE_TXQS,
        NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
        NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
index f34202242d24d074f5cca49c7b4b7a101114f73b..a231d623b2d2536cee76e31b436231ff21feb96f 100644 (file)
@@ -2323,13 +2323,13 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
                sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL);
        }
 
-       if (ieee80211_hw_check(&sta->local->hw, REPORTS_TX_ACK_STATUS) &&
-           !(sinfo->filled & BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG))) {
+       if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG)) &&
+           sta->status_stats.ack_signal_filled) {
                sinfo->avg_ack_signal =
                        -(s8)ewma_avg_signal_read(
                                &sta->status_stats.avg_ack_signal);
                sinfo->filled |=
-                       BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG);
+                       BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG);
        }
 }
 
index 5fb9b7dd98318b6e9d4842474361104855b42983..62e6679de481def100b417488286b230275f6ff5 100644 (file)
@@ -4724,10 +4724,11 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
        PUT_SINFO_U64(RX_DROP_MISC, rx_dropped_misc);
        PUT_SINFO_U64(BEACON_RX, rx_beacon);
        PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
-       PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
        if (wiphy_ext_feature_isset(&rdev->wiphy,
-                                   NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT))
-               PUT_SINFO(DATA_ACK_SIGNAL_AVG, avg_ack_signal, s8);
+                                   NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT)) {
+               PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
+               PUT_SINFO(ACK_SIGNAL_AVG, avg_ack_signal, s8);
+       }
 
 #undef PUT_SINFO
 #undef PUT_SINFO_U64