From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 9/9] wifi: ath12k: pass link ID during MLO while delivering skb
Date: Mon, 9 Dec 2024 20:54:21 +0200 [thread overview]
Message-ID: <20241209185421.376381-10-kvalo@kernel.org> (raw)
In-Reply-To: <20241209185421.376381-1-kvalo@kernel.org>
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
mac80211 expects link_id in some scenarios or else the packet might
get dropped. Hence, add link_id information before delivering the skb.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp_mon.c | 8 +++++++-
drivers/net/wireless/ath/ath12k/dp_rx.c | 5 +++++
drivers/net/wireless/ath/ath12k/peer.c | 2 ++
drivers/net/wireless/ath/ath12k/peer.h | 3 +++
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 494984133a91..2d53404095d6 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -1093,8 +1093,14 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
decap = ath12k_dp_rx_h_decap_type(ar->ab, rxcb->rx_desc);
spin_lock_bh(&ar->ab->base_lock);
peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
- if (peer && peer->sta)
+ if (peer && peer->sta) {
pubsta = peer->sta;
+ if (pubsta->valid_links) {
+ status->link_valid = 1;
+ status->link_id = peer->link_id;
+ }
+ }
+
spin_unlock_bh(&ar->ab->base_lock);
ath12k_dbg(ar->ab, ATH12K_DBG_DATA,
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index adbd7bbcef6f..1cc7f6ce55b9 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -2474,6 +2474,11 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap
pubsta = peer ? peer->sta : NULL;
+ if (pubsta && pubsta->valid_links) {
+ status->link_valid = 1;
+ status->link_id = peer->link_id;
+ }
+
spin_unlock_bh(&ab->base_lock);
ath12k_dbg(ab, ATH12K_DBG_DATA,
diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c
index 5763c5a40cfc..792cca8a3fb1 100644
--- a/drivers/net/wireless/ath/ath12k/peer.c
+++ b/drivers/net/wireless/ath/ath12k/peer.c
@@ -388,6 +388,8 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
ahsta->link[link_id]);
+ peer->link_id = arsta->link_id;
+
/* Fill ML info into created peer */
if (sta->mlo) {
ml_peer_id = ahsta->ml_peer_id;
diff --git a/drivers/net/wireless/ath/ath12k/peer.h b/drivers/net/wireless/ath/ath12k/peer.h
index 7e6231cb2b52..5870ee11a8c7 100644
--- a/drivers/net/wireless/ath/ath12k/peer.h
+++ b/drivers/net/wireless/ath/ath12k/peer.h
@@ -59,6 +59,9 @@ struct ath12k_peer {
/* To ensure only certain work related to dp is done once */
bool primary_link;
+
+ /* for reference to ath12k_link_sta */
+ u8 link_id;
};
struct ath12k_ml_peer {
--
2.39.5
next prev parent reply other threads:[~2024-12-09 18:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 18:54 [PATCH 0/9] wifi: ath12k: MLO support part 8 Kalle Valo
2024-12-09 18:54 ` [PATCH 1/9] wifi: ath12k: move to HW link id based reveive handling Kalle Valo
2024-12-09 19:44 ` Jeff Johnson
2024-12-09 20:01 ` Kalle Valo
2024-12-09 18:54 ` [PATCH 2/9] wifi: ath12k: add partner device buffer support in receive data path Kalle Valo
2024-12-09 18:54 ` [PATCH 3/9] wifi: ath12k: add helper function to init partner cmem configuration Kalle Valo
2024-12-09 18:54 ` [PATCH 4/9] wifi: ath12k: introduce interface combination cleanup helper Kalle Valo
2024-12-09 18:54 ` [PATCH 5/9] wifi: ath12k: Refactor radio frequency information Kalle Valo
2024-12-09 18:54 ` [PATCH 6/9] wifi: ath12k: advertise multi device interface combination Kalle Valo
2024-12-09 18:54 ` [PATCH 7/9] wifi: ath12k: fix ath12k_qmi_alloc_chunk() to handle too large allocations Kalle Valo
2024-12-09 18:54 ` [PATCH 8/9] wifi: ath12k: fix ar->supports_6ghz usage during hw register Kalle Valo
2024-12-09 18:54 ` Kalle Valo [this message]
2024-12-10 8:25 ` [PATCH 0/9] wifi: ath12k: MLO support part 8 Kalle Valo
2024-12-16 16:50 ` Jeff Johnson
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=20241209185421.376381-10-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).