X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=package%2Fmac80211%2Fpatches%2F522-ath9k_per_chain_signal_strength.patch;h=0648e0dd754269e9416533f612a2483dbdc0b492;hp=3b9cfe8752d04e5ff0e011a67240fdce478fe36c;hb=f0ce8c9691f4d0b0b79f6be2132883e4328ec50f;hpb=ba1de008dbc3e0bf50c816af76a2b97e76166dd6 diff --git a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch index 3b9cfe8752..0648e0dd75 100644 --- a/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch +++ b/package/mac80211/patches/522-ath9k_per_chain_signal_strength.patch @@ -1,26 +1,25 @@ --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -697,6 +697,9 @@ enum mac80211_rx_flags { - * @mactime: value in microseconds of the 64-bit Time Synchronization Function - * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. - * @band: the active band when this frame was received +@@ -706,6 +706,9 @@ enum mac80211_rx_flags { + * @signal: signal strength when receiving this frame, either in dBm, in dB or + * unspecified depending on the hardware capabilities flags + * @IEEE80211_HW_SIGNAL_* + * @chains: bitmask of receive chains for which separate signal strength + * values were filled. + * @chain_signal: per-chain signal strength, same format as @signal - * @freq: frequency the radio was tuned to when receiving this frame, in MHz - * @signal: signal strength when receiving this frame, either in dBm, in dB or - * unspecified depending on the hardware capabilities flags -@@ -710,6 +713,10 @@ enum mac80211_rx_flags { - struct ieee80211_rx_status { - u64 mactime; - enum ieee80211_band band; + * @antenna: antenna used + * @rate_idx: index of data rate into band's supported rates or MCS index if + * HT rates are use (RX_FLAG_HT) +@@ -722,6 +725,9 @@ struct ieee80211_rx_status { + u8 band; + u8 antenna; + s8 signal; + + u8 chains; + s8 chain_signal[4]; -+ - int freq; - int signal; - int antenna; + }; + + /** --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -325,6 +325,11 @@ struct sta_info { @@ -37,7 +36,7 @@ --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c -@@ -1263,6 +1263,7 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1231,6 +1231,7 @@ ieee80211_rx_h_sta_process(struct ieee80 struct sk_buff *skb = rx->skb; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -45,7 +44,7 @@ if (!sta) return RX_CONTINUE; -@@ -1307,6 +1308,19 @@ ieee80211_rx_h_sta_process(struct ieee80 +@@ -1275,6 +1276,19 @@ ieee80211_rx_h_sta_process(struct ieee80 ewma_add(&sta->avg_signal, -status->signal); } @@ -67,7 +66,7 @@ * exchange sequence. --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -256,6 +256,8 @@ struct sta_info *sta_info_alloc(struct i +@@ -254,6 +254,8 @@ struct sta_info *sta_info_alloc(struct i do_posix_clock_monotonic_gettime(&uptime); sta->last_connected = uptime.tv_sec; ewma_init(&sta->avg_signal, 1024, 8); @@ -78,7 +77,7 @@ kfree(sta); --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -527,6 +527,8 @@ struct station_parameters { +@@ -546,6 +546,8 @@ struct station_parameters { * @STATION_INFO_STA_FLAGS: @sta_flags filled * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled * @STATION_INFO_T_OFFSET: @t_offset filled @@ -87,7 +86,7 @@ */ enum station_info_flags { STATION_INFO_INACTIVE_TIME = 1<<0, -@@ -550,6 +552,8 @@ enum station_info_flags { +@@ -569,6 +571,8 @@ enum station_info_flags { STATION_INFO_STA_FLAGS = 1<<18, STATION_INFO_BEACON_LOSS_COUNT = 1<<19, STATION_INFO_T_OFFSET = 1<<20, @@ -96,17 +95,17 @@ }; /** -@@ -631,6 +635,9 @@ struct sta_bss_parameters { - NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. - * @signal_avg: avg signal strength, type depends on the wiphy's signal_type - NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. +@@ -652,6 +656,9 @@ struct sta_bss_parameters { + * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. + * @signal_avg: Average signal strength, type depends on the wiphy's signal_type. + * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. + * @chains: bitmask for filled values in @chain_signal, @chain_signal_avg + * @chain_signal: per-chain signal strength of last received packet in dBm + * @chain_signal_avg: per-chain signal strength average in dBm * @txrate: current unicast bitrate from this station * @rxrate: current unicast bitrate to this station * @rx_packets: packets received from this station -@@ -663,6 +670,11 @@ struct station_info { +@@ -684,6 +691,11 @@ struct station_info { u8 plink_state; s8 signal; s8 signal_avg; @@ -137,7 +136,7 @@ u8 rs_num_delims; --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c -@@ -951,6 +951,7 @@ static int ath9k_rx_skb_preprocess(struc +@@ -955,6 +955,7 @@ static int ath9k_rx_skb_preprocess(struc bool *decrypt_error) { struct ath_hw *ah = common->ah; @@ -145,7 +144,7 @@ /* * everything but the rate is checked here, the rate check is done -@@ -976,6 +977,20 @@ static int ath9k_rx_skb_preprocess(struc +@@ -980,6 +981,20 @@ static int ath9k_rx_skb_preprocess(struc if (rx_stats->rs_moreaggr) rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; @@ -229,7 +228,7 @@ if (ads.ds_rxstatus8 & AR_RxKeyIdxValid) --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -998,12 +998,12 @@ void ath_debug_stat_rx(struct ath_softc +@@ -997,12 +997,12 @@ void ath_debug_stat_rx(struct ath_softc #ifdef CONFIG_ATH9K_MAC_DEBUG spin_lock(&sc->debug.samp_lock); RX_SAMP_DBG(jiffies) = jiffies; @@ -250,7 +249,7 @@ RX_SAMP_DBG(rate) = rs->rs_rate; --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h -@@ -1699,6 +1699,8 @@ enum nl80211_sta_bss_param { +@@ -1734,6 +1734,8 @@ enum nl80211_sta_bss_param { * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) @@ -259,7 +258,7 @@ * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ -@@ -1723,6 +1725,8 @@ enum nl80211_sta_info { +@@ -1758,6 +1760,8 @@ enum nl80211_sta_info { NL80211_STA_INFO_STA_FLAGS, NL80211_STA_INFO_BEACON_LOSS, NL80211_STA_INFO_T_OFFSET, @@ -270,7 +269,7 @@ __NL80211_STA_INFO_AFTER_LAST, --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -2553,6 +2553,33 @@ nla_put_failure: +@@ -2745,6 +2745,32 @@ nla_put_failure: return false; } @@ -285,26 +284,25 @@ + + attr = nla_nest_start(msg, id); + if (!attr) -+ goto nla_put_failure; ++ return false; + + for (i = 0; i < 4; i++) { + if (!(mask & BIT(i))) + continue; + -+ NLA_PUT_U8(msg, i, signal[i]); ++ if (nla_put_u8(msg, i, signal[i])) ++ return false; + } + + nla_nest_end(msg, attr); + + return true; -+nla_put_failure: -+ return false; +} + static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, int flags, struct cfg80211_registered_device *rdev, -@@ -2614,6 +2641,18 @@ static int nl80211_send_station(struct s +@@ -2806,6 +2832,18 @@ static int nl80211_send_station(struct s default: break; } @@ -325,16 +323,16 @@ NL80211_STA_INFO_TX_BITRATE)) --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -354,6 +354,7 @@ static void sta_set_sinfo(struct sta_inf - { +@@ -355,6 +355,7 @@ static void sta_set_sinfo(struct sta_inf struct ieee80211_sub_if_data *sdata = sta->sdata; + struct ieee80211_local *local = sdata->local; struct timespec uptime; + int i; sinfo->generation = sdata->local->sta_generation; -@@ -391,6 +392,17 @@ static void sta_set_sinfo(struct sta_inf - sinfo->signal = (s8)sta->last_signal; +@@ -394,6 +395,17 @@ static void sta_set_sinfo(struct sta_inf + sinfo->signal = (s8)sta->last_signal; sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal); } + if (sta->chains) {