diff options
Diffstat (limited to 'net/mac80211/sta_info.c')
| -rw-r--r-- | net/mac80211/sta_info.c | 34 | 
1 files changed, 32 insertions, 2 deletions
| diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7cdf7a835bb0..69615016d5bf 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -20,6 +20,7 @@  #include <linux/timer.h>  #include <linux/rtnetlink.h> +#include <net/codel.h>  #include <net/mac80211.h>  #include "ieee80211_i.h"  #include "driver-ops.h" @@ -425,6 +426,11 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,  	sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; +	sta->cparams.ce_threshold = CODEL_DISABLED_THRESHOLD; +	sta->cparams.target = MS2TIME(20); +	sta->cparams.interval = MS2TIME(100); +	sta->cparams.ecn = true; +  	sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr);  	return sta; @@ -1306,7 +1312,7 @@ static void ieee80211_send_null_response(struct sta_info *sta, int tid,  	skb_reserve(skb, local->hw.extra_tx_headroom); -	nullfunc = (void *) skb_put(skb, size); +	nullfunc = skb_put(skb, size);  	nullfunc->frame_control = fc;  	nullfunc->duration_id = 0;  	memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); @@ -2155,7 +2161,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)  			struct ieee80211_sta_rx_stats *cpurxs;  			cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); -			sinfo->rx_packets += cpurxs->dropped; +			sinfo->rx_dropped_misc += cpurxs->dropped;  		}  	} @@ -2310,3 +2316,27 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta)  		return stats->last_rx;  	return sta->status_stats.last_ack;  } + +static void sta_update_codel_params(struct sta_info *sta, u32 thr) +{ +	if (!sta->sdata->local->ops->wake_tx_queue) +		return; + +	if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { +		sta->cparams.target = MS2TIME(50); +		sta->cparams.interval = MS2TIME(300); +		sta->cparams.ecn = false; +	} else { +		sta->cparams.target = MS2TIME(20); +		sta->cparams.interval = MS2TIME(100); +		sta->cparams.ecn = true; +	} +} + +void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubsta, +					   u32 thr) +{ +	struct sta_info *sta = container_of(pubsta, struct sta_info, sta); + +	sta_update_codel_params(sta, thr); +} |