Skip to content

Commit 9c06602

Browse files
Balaji Pothunoorijmberg-intel
authored andcommitted
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: Balaji Pothunoori <[email protected]> [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 <[email protected]>
1 parent 1ecef20 commit 9c06602

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

include/uapi/linux/nl80211.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,8 +3050,7 @@ enum nl80211_sta_bss_param {
30503050
* received from the station (u64, usec)
30513051
* @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
30523052
* @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
3053-
* @NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG: avg signal strength of (data)
3054-
* ACK frame (s8, dBm)
3053+
* @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
30553054
* @__NL80211_STA_INFO_AFTER_LAST: internal
30563055
* @NL80211_STA_INFO_MAX: highest possible station info attribute
30573056
*/
@@ -3091,13 +3090,17 @@ enum nl80211_sta_info {
30913090
NL80211_STA_INFO_RX_DURATION,
30923091
NL80211_STA_INFO_PAD,
30933092
NL80211_STA_INFO_ACK_SIGNAL,
3094-
NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,
3093+
NL80211_STA_INFO_ACK_SIGNAL_AVG,
30953094

30963095
/* keep last */
30973096
__NL80211_STA_INFO_AFTER_LAST,
30983097
NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
30993098
};
31003099

3100+
/* we renamed this - stay compatible */
3101+
#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG
3102+
3103+
31013104
/**
31023105
* enum nl80211_tid_stats - per TID statistics attributes
31033106
* @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
@@ -5213,9 +5216,8 @@ enum nl80211_feature_flags {
52135216
* "radar detected" event.
52145217
* @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and
52155218
* receiving control port frames over nl80211 instead of the netdevice.
5216-
* @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack
5217-
* rssi if firmware support, this flag is to intimate about ack rssi
5218-
* support to nl80211.
5219+
* @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
5220+
* (average) ACK signal strength reporting.
52195221
* @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
52205222
* TXQs.
52215223
* @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
@@ -5255,7 +5257,9 @@ enum nl80211_ext_feature_index {
52555257
NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
52565258
NL80211_EXT_FEATURE_DFS_OFFLOAD,
52575259
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
5258-
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,
5260+
NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
5261+
/* we renamed this - stay compatible */
5262+
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
52595263
NL80211_EXT_FEATURE_TXQS,
52605264
NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
52615265
NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,

net/mac80211/sta_info.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,13 +2323,13 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
23232323
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL);
23242324
}
23252325

2326-
if (ieee80211_hw_check(&sta->local->hw, REPORTS_TX_ACK_STATUS) &&
2327-
!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG))) {
2326+
if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG)) &&
2327+
sta->status_stats.ack_signal_filled) {
23282328
sinfo->avg_ack_signal =
23292329
-(s8)ewma_avg_signal_read(
23302330
&sta->status_stats.avg_ack_signal);
23312331
sinfo->filled |=
2332-
BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG);
2332+
BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG);
23332333
}
23342334
}
23352335

net/wireless/nl80211.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4724,10 +4724,11 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
47244724
PUT_SINFO_U64(RX_DROP_MISC, rx_dropped_misc);
47254725
PUT_SINFO_U64(BEACON_RX, rx_beacon);
47264726
PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
4727-
PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
47284727
if (wiphy_ext_feature_isset(&rdev->wiphy,
4729-
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT))
4730-
PUT_SINFO(DATA_ACK_SIGNAL_AVG, avg_ack_signal, s8);
4728+
NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT)) {
4729+
PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
4730+
PUT_SINFO(ACK_SIGNAL_AVG, avg_ack_signal, s8);
4731+
}
47314732

47324733
#undef PUT_SINFO
47334734
#undef PUT_SINFO_U64

0 commit comments

Comments
 (0)