Commit 9c06602b authored by Balaji Pothunoori's avatar Balaji Pothunoori Committed by Johannes Berg

cfg80211: clarify frames covered by average ACK signal report

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: default avatarBalaji 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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1ecef20c
...@@ -3050,8 +3050,7 @@ enum nl80211_sta_bss_param { ...@@ -3050,8 +3050,7 @@ enum nl80211_sta_bss_param {
* received from the station (u64, usec) * received from the station (u64, usec)
* @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment * @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_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
* @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data) * @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
* ACK frame (s8, dBm)
* @__NL80211_STA_INFO_AFTER_LAST: internal * @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute * @NL80211_STA_INFO_MAX: highest possible station info attribute
*/ */
...@@ -3091,13 +3090,17 @@ enum nl80211_sta_info { ...@@ -3091,13 +3090,17 @@ enum nl80211_sta_info {
NL80211_STA_INFO_RX_DURATION, NL80211_STA_INFO_RX_DURATION,
NL80211_STA_INFO_PAD, NL80211_STA_INFO_PAD,
NL80211_STA_INFO_ACK_SIGNAL, NL80211_STA_INFO_ACK_SIGNAL,
NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG, NL80211_STA_INFO_ACK_SIGNAL_AVG,
/* keep last */ /* keep last */
__NL80211_STA_INFO_AFTER_LAST, __NL80211_STA_INFO_AFTER_LAST,
NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1 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 * enum nl80211_tid_stats - per TID statistics attributes
* @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
...@@ -5213,9 +5216,8 @@ enum nl80211_feature_flags { ...@@ -5213,9 +5216,8 @@ enum nl80211_feature_flags {
* "radar detected" event. * "radar detected" event.
* @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and
* receiving control port frames over nl80211 instead of the netdevice. * receiving control port frames over nl80211 instead of the netdevice.
* @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
* rssi if firmware support, this flag is to intimate about ack rssi * (average) ACK signal strength reporting.
* support to nl80211.
* @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
* TXQs. * TXQs.
* @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
...@@ -5255,7 +5257,9 @@ enum nl80211_ext_feature_index { ...@@ -5255,7 +5257,9 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN, NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
NL80211_EXT_FEATURE_DFS_OFFLOAD, NL80211_EXT_FEATURE_DFS_OFFLOAD,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211, 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_TXQS,
NL80211_EXT_FEATURE_SCAN_RANDOM_SN, NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT, NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
......
...@@ -2323,13 +2323,13 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, ...@@ -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); sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL);
} }
if (ieee80211_hw_check(&sta->local->hw, REPORTS_TX_ACK_STATUS) && if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG)) &&
!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG))) { sta->status_stats.ack_signal_filled) {
sinfo->avg_ack_signal = sinfo->avg_ack_signal =
-(s8)ewma_avg_signal_read( -(s8)ewma_avg_signal_read(
&sta->status_stats.avg_ack_signal); &sta->status_stats.avg_ack_signal);
sinfo->filled |= sinfo->filled |=
BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG); BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG);
} }
} }
......
...@@ -4724,10 +4724,11 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, ...@@ -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(RX_DROP_MISC, rx_dropped_misc);
PUT_SINFO_U64(BEACON_RX, rx_beacon); PUT_SINFO_U64(BEACON_RX, rx_beacon);
PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8); PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
if (wiphy_ext_feature_isset(&rdev->wiphy, if (wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT)) NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT)) {
PUT_SINFO(DATA_ACK_SIGNAL_AVG, avg_ack_signal, s8); PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
PUT_SINFO(ACK_SIGNAL_AVG, avg_ack_signal, s8);
}
#undef PUT_SINFO #undef PUT_SINFO
#undef PUT_SINFO_U64 #undef PUT_SINFO_U64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment