Root/package/mac80211/patches/580-mac80211_ignore_bad_signal_values.patch

1--- a/include/net/mac80211.h
2+++ b/include/net/mac80211.h
3@@ -659,6 +659,8 @@ ieee80211_tx_info_clear_status(struct ie
4  * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
5  * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
6  * @RX_FLAG_SHORT_GI: Short guard interval was used
7+ * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
8+ * Valid only for data frames (mainly A-MPDU)
9  */
10 enum mac80211_rx_flags {
11     RX_FLAG_MMIC_ERROR = 1<<0,
12@@ -672,6 +674,7 @@ enum mac80211_rx_flags {
13     RX_FLAG_HT = 1<<9,
14     RX_FLAG_40MHZ = 1<<10,
15     RX_FLAG_SHORT_GI = 1<<11,
16+ RX_FLAG_NO_SIGNAL_VAL = 1<<12,
17 };
18 
19 /**
20--- a/net/mac80211/rx.c
21+++ b/net/mac80211/rx.c
22@@ -177,7 +177,8 @@ ieee80211_add_rx_radiotap_header(struct
23     pos += 2;
24 
25     /* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
26- if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
27+ if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM &&
28+ !(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
29         *pos = status->signal;
30         rthdr->it_present |=
31             cpu_to_le32(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
32@@ -1310,8 +1311,10 @@ ieee80211_rx_h_sta_process(struct ieee80
33 
34     sta->rx_fragments++;
35     sta->rx_bytes += rx->skb->len;
36- sta->last_signal = status->signal;
37- ewma_add(&sta->avg_signal, -status->signal);
38+ if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
39+ sta->last_signal = status->signal;
40+ ewma_add(&sta->avg_signal, -status->signal);
41+ }
42 
43     if (status->chains) {
44         sta->chains = status->chains;
45

Archive Download this file



interactive