From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v2 7/8] wifi: ath12k: add helper to find multi-link station
Date: Fri, 1 Nov 2024 17:17:04 +0200 [thread overview]
Message-ID: <20241101151705.165987-8-kvalo@kernel.org> (raw)
In-Reply-To: <20241101151705.165987-1-kvalo@kernel.org>
From: Sriram R <quic_srirrama@quicinc.com>
Multi-link stations are identified in driver using the multi-link
peer id and they have ATH12K_PEER_ML_ID_VALID bit set in the id. Add a helper
to find multi-link station using the multi-link peer id.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/peer.c | 17 +++++++++++++++++
drivers/net/wireless/ath/ath12k/peer.h | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/peer.c b/drivers/net/wireless/ath/ath12k/peer.c
index 2ad19baf0664..0e86847edd6e 100644
--- a/drivers/net/wireless/ath/ath12k/peer.c
+++ b/drivers/net/wireless/ath/ath12k/peer.c
@@ -79,6 +79,20 @@ struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab,
return NULL;
}
+static struct ath12k_peer *ath12k_peer_find_by_ml_id(struct ath12k_base *ab,
+ int ml_peer_id)
+{
+ struct ath12k_peer *peer;
+
+ lockdep_assert_held(&ab->base_lock);
+
+ list_for_each_entry(peer, &ab->peers, list)
+ if (ml_peer_id == peer->ml_id)
+ return peer;
+
+ return NULL;
+}
+
struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
int peer_id)
{
@@ -86,6 +100,9 @@ struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
lockdep_assert_held(&ab->base_lock);
+ if (peer_id & ATH12K_PEER_ML_ID_VALID)
+ return ath12k_peer_find_by_ml_id(ab, peer_id);
+
list_for_each_entry(peer, &ab->peers, list)
if (peer_id == peer->peer_id)
return peer;
diff --git a/drivers/net/wireless/ath/ath12k/peer.h b/drivers/net/wireless/ath/ath12k/peer.h
index 085246ca938d..c28aca5d88a0 100644
--- a/drivers/net/wireless/ath/ath12k/peer.h
+++ b/drivers/net/wireless/ath/ath12k/peer.h
@@ -19,6 +19,8 @@ struct ppdu_user_delayba {
u32 resp_rate_flags;
};
+#define ATH12K_PEER_ML_ID_VALID BIT(13)
+
struct ath12k_peer {
struct list_head list;
struct ieee80211_sta *sta;
@@ -47,6 +49,8 @@ struct ath12k_peer {
/* protected by ab->data_lock */
bool dp_setup_done;
+
+ u16 ml_id;
};
struct ath12k_ml_peer {
--
2.39.5
next prev parent reply other threads:[~2024-11-01 15:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 15:16 [PATCH v2 0/8] wifi: ath12k: MLO support part 2 Kalle Valo
2024-11-01 15:16 ` [PATCH v2 1/8] wifi: ath12k: ath12k_mac_vdev_create(): use goto for error handling Kalle Valo
2024-11-01 16:21 ` Jeff Johnson
2024-11-01 15:16 ` [PATCH v2 2/8] wifi: ath12k: MLO vdev bringup changes Kalle Valo
2024-11-01 16:26 ` Jeff Johnson
2024-11-01 15:17 ` [PATCH v2 3/8] wifi: ath12k: Refactor sta state machine Kalle Valo
2024-11-01 16:36 ` Jeff Johnson
2024-11-01 15:17 ` [PATCH v2 4/8] wifi: ath12k: introduce ath12k_hw_warn() Kalle Valo
2024-11-01 16:37 ` Jeff Johnson
2024-11-01 15:17 ` [PATCH v2 5/8] wifi: ath12k: Add helpers for multi link peer creation and deletion Kalle Valo
2024-11-01 16:39 ` Jeff Johnson
2024-11-01 15:17 ` [PATCH v2 6/8] wifi: ath12k: add multi-link flag in peer create command Kalle Valo
2024-11-01 16:46 ` Jeff Johnson
2024-11-01 15:17 ` Kalle Valo [this message]
2024-11-01 16:47 ` [PATCH v2 7/8] wifi: ath12k: add helper to find multi-link station Jeff Johnson
2024-11-01 15:17 ` [PATCH v2 8/8] wifi: ath12k: Add MLO peer assoc command support Kalle Valo
2024-11-01 16:50 ` Jeff Johnson
2024-11-01 16:51 ` [PATCH v2 0/8] wifi: ath12k: MLO support part 2 Jeff Johnson
2024-11-04 11:13 ` Kalle Valo
2024-11-04 15:43 ` 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=20241101151705.165987-8-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