public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 8/8] wifi: mt76: scan: fix setting tx_info fields
Date: Tue, 11 Mar 2025 11:36:45 +0100	[thread overview]
Message-ID: <20250311103646.43346-8-nbd@nbd.name> (raw)
In-Reply-To: <20250311103646.43346-1-nbd@nbd.name>

ieee80211_tx_prepare_skb initializes the skb cb, so fields need to be set
afterwards.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/scan.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/scan.c b/drivers/net/wireless/mediatek/mt76/scan.c
index 1c4f9deaaada..9b20ccbeb8cf 100644
--- a/drivers/net/wireless/mediatek/mt76/scan.c
+++ b/drivers/net/wireless/mediatek/mt76/scan.c
@@ -52,11 +52,6 @@ mt76_scan_send_probe(struct mt76_dev *dev, struct cfg80211_ssid *ssid)
 		ether_addr_copy(hdr->addr3, req->bssid);
 	}
 
-	info = IEEE80211_SKB_CB(skb);
-	if (req->no_cck)
-		info->flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
-	info->control.flags |= IEEE80211_TX_CTRL_DONT_USE_RATE_MASK;
-
 	if (req->ie_len)
 		skb_put_data(skb, req->ie, req->ie_len);
 
@@ -64,10 +59,20 @@ mt76_scan_send_probe(struct mt76_dev *dev, struct cfg80211_ssid *ssid)
 	skb_set_queue_mapping(skb, IEEE80211_AC_VO);
 
 	rcu_read_lock();
-	if (ieee80211_tx_prepare_skb(phy->hw, vif, skb, band, NULL))
-		mt76_tx(phy, NULL, mvif->wcid, skb);
-	else
+
+	if (!ieee80211_tx_prepare_skb(phy->hw, vif, skb, band, NULL)) {
 		ieee80211_free_txskb(phy->hw, skb);
+		goto out;
+	}
+
+	info = IEEE80211_SKB_CB(skb);
+	if (req->no_cck)
+		info->flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
+	info->control.flags |= IEEE80211_TX_CTRL_DONT_USE_RATE_MASK;
+
+	mt76_tx(phy, NULL, mvif->wcid, skb);
+
+out:
 	rcu_read_unlock();
 }
 
-- 
2.47.1


      parent reply	other threads:[~2025-03-11 10:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 10:36 [PATCH 1/8] wifi: mt76: mt7996: revise TXS size Felix Fietkau
2025-03-11 10:36 ` [PATCH 2/8] wifi: mt76: mt7996: fix SER reset trigger on WED reset Felix Fietkau
2025-03-11 10:36 ` [PATCH 3/8] wifi: mt76: mt7996: remove unnecessary key->cipher check for BIP frames Felix Fietkau
2025-03-11 10:36 ` [PATCH 4/8] wifi: mt76: scan: set vif offchannel link for scanning/roc Felix Fietkau
2025-03-11 10:36 ` [PATCH 5/8] wifi: mt76: mt7996: use the correct vif " Felix Fietkau
2025-03-12  2:08   ` Ping-Ke Shih
2025-03-12  9:06     ` Felix Fietkau
2025-03-11 10:36 ` [PATCH 6/8] mt76: only mark tx-status-failed frames as ACKed on mt76x0/2 Felix Fietkau
2025-03-11 10:47   ` Felix Fietkau
2025-03-11 10:36 ` [PATCH 7/8] wifi: mt76: mt7996: implement driver specific get_txpower function Felix Fietkau
2025-03-11 13:55   ` Lorenzo Bianconi
2025-03-11 14:01     ` Felix Fietkau
2025-03-11 10:36 ` Felix Fietkau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250311103646.43346-8-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox