[RFC PATCH 1/4] mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue

Johannes Berg johannes at sipsolutions.net
Tue May 25 05:59:46 PDT 2021


On Thu, 2021-05-20 at 03:56 +0800, Ryder Lee wrote:
> 
> +static ieee80211_tx_result
> +ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
> +			   struct sta_info *sta, u8 pn_offs,
> +			   struct ieee80211_key *key,
> +			   struct ieee80211_tx_data *tx)
>  {
> +	struct sk_buff *skb = tx->skb;
>  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
>  	struct ieee80211_hdr *hdr = (void *)skb->data;
>  	u8 tid = IEEE80211_NUM_TIDS;
>  
> 
> 
> 
> +	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
> +		if (ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE)
> +			return TX_DROP;

Probably nicer to roll that into one condition:

if (!...() &&
    ..._rate_ctrl(tx) != ...)
	return TX_DROP;


johannes




More information about the Linux-mediatek mailing list