BACKPORT: nl80211: Add per peer statistics to compute FCS error rate
Add support for drivers to report the total number of MPDUs received and the number of MPDUs received with an FCS error from a specific peer. These counters will be incremented only when the TA of the frame matches the MAC address of the peer irrespective of FCS error. It should be noted that the TA field in the frame might be corrupted when there is an FCS error and TA matching logic would fail in such cases. Hence, FCS error counter might not be fully accurate, but it can provide help in detecting bad RX links in significant number of cases. This FCS error counter without full accuracy can be used, e.g., to trigger a kick-out of a connected client with a bad link in AP mode to force such a client to roam to another AP. Test: build Bug: 153912588 Signed-off-by: Ankita Bajaj <bankita@codeaurora.org> Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> (cherry picked from commit 0d4e14a32dcab9c4bd559d02874120fbb86b1322) [hridya: resolved minor conflicts] Signed-off-by: Hridya Valsaraju <hridya@google.com> Change-Id: I5306d36e6df255efcb130b0de5151bebda67c549
This commit is contained in:
parent
6da0c634f8
commit
8766a7247a
3 changed files with 17 additions and 0 deletions
|
@ -1381,6 +1381,10 @@ struct cfg80211_tid_stats {
|
|||
* @ack_signal: signal strength (in dBm) of the last ACK frame.
|
||||
* @avg_ack_signal: average rssi value of ack packet for the no of msdu's has
|
||||
* been sent.
|
||||
* @rx_mpdu_count: number of MPDUs received from this station
|
||||
* @fcs_err_count: number of packets (MPDUs) received from this station with
|
||||
* an FCS error. This counter should be incremented only when TA of the
|
||||
* received packet with an FCS error matches the peer MAC address.
|
||||
*/
|
||||
struct station_info {
|
||||
u64 filled;
|
||||
|
@ -1427,6 +1431,9 @@ struct station_info {
|
|||
struct cfg80211_tid_stats *pertid;
|
||||
s8 ack_signal;
|
||||
s8 avg_ack_signal;
|
||||
|
||||
u32 rx_mpdu_count;
|
||||
u32 fcs_err_count;
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_CFG80211)
|
||||
|
|
|
@ -3124,6 +3124,12 @@ enum nl80211_sta_bss_param {
|
|||
* @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_RX_MPDUS: total number of received packets (MPDUs)
|
||||
* (u32, from this station)
|
||||
* @NL80211_STA_INFO_FCS_ERROR_COUNT: total number of packets (MPDUs) received
|
||||
* with an FCS error (u32, from this station). This count may not include
|
||||
* some packets with an FCS error due to TA corruption. Hence this counter
|
||||
* might not be fully accurate.
|
||||
* @__NL80211_STA_INFO_AFTER_LAST: internal
|
||||
* @NL80211_STA_INFO_MAX: highest possible station info attribute
|
||||
*/
|
||||
|
@ -3164,6 +3170,8 @@ enum nl80211_sta_info {
|
|||
NL80211_STA_INFO_PAD,
|
||||
NL80211_STA_INFO_ACK_SIGNAL,
|
||||
NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG,
|
||||
NL80211_STA_INFO_RX_MPDUS,
|
||||
NL80211_STA_INFO_FCS_ERROR_COUNT,
|
||||
|
||||
/* keep last */
|
||||
__NL80211_STA_INFO_AFTER_LAST,
|
||||
|
|
|
@ -4803,6 +4803,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
|
|||
PUT_SINFO_U64(BEACON_RX, rx_beacon);
|
||||
PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
|
||||
PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
|
||||
PUT_SINFO(RX_MPDUS, rx_mpdu_count, u32);
|
||||
PUT_SINFO(FCS_ERROR_COUNT, fcs_err_count, u32);
|
||||
if (wiphy_ext_feature_isset(&rdev->wiphy,
|
||||
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT))
|
||||
PUT_SINFO(DATA_ACK_SIGNAL_AVG, avg_ack_signal, s8);
|
||||
|
|
Loading…
Reference in a new issue