diff mbox

[v2,1/2] mac80211: check requested flags in ieee80211_tx_prepare_skb()

Message ID 1451990134-15183-1-git-send-email-janusz.dziedzic@tieto.com (mailing list archive)
State Rejected
Delegated to: Johannes Berg
Headers show

Commit Message

Janusz.Dziedzic@tieto.com Jan. 5, 2016, 10:35 a.m. UTC
In case driver already set info->flags (eg. IEEE80211_TX_CTL_NO_CCK_RATE
in ath9k driver), before this patch we skip this requested flags.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 net/mac80211/tx.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Berg Jan. 6, 2016, 10:44 a.m. UTC | #1
On Tue, 2016-01-05 at 11:35 +0100, Janusz Dziedzic wrote:
> In case driver already set info->flags (eg.
> IEEE80211_TX_CTL_NO_CCK_RATE
> in ath9k driver), before this patch we skip this requested flags.

I don't see how we "skip" them?

> +	unsigned int flags = info->flags;
>  
>  	if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP)
>  		return false;

>  	info->band = band;
>  	info->control.vif = vif;
>  	info->hw_queue = vif->hw_queue[skb_get_queue_mapping(skb)];
> +	info->flags |= flags;

tx_prepare() doesn't [seem to] do anything to the flags but twiddle a
few, so ?

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Janusz.Dziedzic@tieto.com Jan. 7, 2016, 6:17 a.m. UTC | #2
On 6 January 2016 at 11:44, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2016-01-05 at 11:35 +0100, Janusz Dziedzic wrote:
>> In case driver already set info->flags (eg.
>> IEEE80211_TX_CTL_NO_CCK_RATE
>> in ath9k driver), before this patch we skip this requested flags.
>
> I don't see how we "skip" them?
>
>> +     unsigned int flags = info->flags;
>>
>>       if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP)
>>               return false;
>>
>>       info->band = band;
>>       info->control.vif = vif;
>>       info->hw_queue = vif->hw_queue[skb_get_queue_mapping(skb)];
>> +     info->flags |= flags;
>
> tx_prepare() doesn't [seem to] do anything to the flags but twiddle a
> few, so ?
>
Yes, you right - this patch is not needed.
Thanks.

BR
Janusz
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index a512c4b..6ea1c65 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1532,6 +1532,7 @@  bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_tx_data tx;
 	struct sk_buff *skb2;
+	unsigned int flags = info->flags;
 
 	if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP)
 		return false;
@@ -1539,6 +1540,7 @@  bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
 	info->band = band;
 	info->control.vif = vif;
 	info->hw_queue = vif->hw_queue[skb_get_queue_mapping(skb)];
+	info->flags |= flags;
 
 	if (invoke_tx_handlers(&tx))
 		return false;