提交 cc60dbbf 编写于 作者: B Balaji Pothunoori 提交者: Johannes Berg

mac80211: average ack rssi support for data frames

The driver will process the RSSI if available and send it to mac80211.
mac80211 will compute the weighted average of ack RSSI for stations.
Signed-off-by: NBalaji Pothunoori <bpothuno@codeaurora.org>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 81d5439d
...@@ -358,6 +358,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -358,6 +358,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->last_connected = ktime_get_seconds(); sta->last_connected = ktime_get_seconds();
ewma_signal_init(&sta->rx_stats_avg.signal); ewma_signal_init(&sta->rx_stats_avg.signal);
ewma_avg_signal_init(&sta->status_stats.avg_ack_signal);
for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++) for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++)
ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]); ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]);
...@@ -2294,6 +2295,15 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) ...@@ -2294,6 +2295,15 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->ack_signal = sta->status_stats.last_ack_signal; sinfo->ack_signal = sta->status_stats.last_ack_signal;
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) &&
!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG))) {
sinfo->avg_ack_signal =
-(s8)ewma_avg_signal_read(
&sta->status_stats.avg_ack_signal);
sinfo->filled |=
BIT_ULL(NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG);
}
} }
u32 sta_get_expected_throughput(struct sta_info *sta) u32 sta_get_expected_throughput(struct sta_info *sta)
......
...@@ -119,6 +119,7 @@ enum ieee80211_sta_info_flags { ...@@ -119,6 +119,7 @@ enum ieee80211_sta_info_flags {
#define HT_AGG_STATE_START_CB 6 #define HT_AGG_STATE_START_CB 6
#define HT_AGG_STATE_STOP_CB 7 #define HT_AGG_STATE_STOP_CB 7
DECLARE_EWMA(avg_signal, 10, 8)
enum ieee80211_agg_stop_reason { enum ieee80211_agg_stop_reason {
AGG_STOP_DECLINED, AGG_STOP_DECLINED,
AGG_STOP_LOCAL_REQUEST, AGG_STOP_LOCAL_REQUEST,
...@@ -550,6 +551,7 @@ struct sta_info { ...@@ -550,6 +551,7 @@ struct sta_info {
unsigned long last_ack; unsigned long last_ack;
s8 last_ack_signal; s8 last_ack_signal;
bool ack_signal_filled; bool ack_signal_filled;
struct ewma_avg_signal avg_ack_signal;
} status_stats; } status_stats;
/* Updated from TX path only, no locking requirements */ /* Updated from TX path only, no locking requirements */
......
...@@ -195,6 +195,8 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb) ...@@ -195,6 +195,8 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb)
sta->status_stats.last_ack_signal = sta->status_stats.last_ack_signal =
(s8)txinfo->status.ack_signal; (s8)txinfo->status.ack_signal;
sta->status_stats.ack_signal_filled = true; sta->status_stats.ack_signal_filled = true;
ewma_avg_signal_add(&sta->status_stats.avg_ack_signal,
-txinfo->status.ack_signal);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册