mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-05 20:30:41 +00:00
wifi: ath12k: add primary link for data path operations
In case of Multi-link operation, data path peer setup and tid setup should be done only for primary link of multi-link station. Add changes to introduce primary link is peer. Currently, association link will be considered as primary link. 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: Sriram R <quic_srirrama@quicinc.com> Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20241121155806.1862733-4-kvalo@kernel.org
This commit is contained in:
parent
a27fa6148d
commit
ea41925538
@ -41,6 +41,11 @@ void ath12k_dp_peer_cleanup(struct ath12k *ar, int vdev_id, const u8 *addr)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!peer->primary_link) {
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
ath12k_dp_rx_peer_tid_cleanup(ar, peer);
|
||||
crypto_free_shash(peer->tfm_mmic);
|
||||
peer->dp_setup_done = false;
|
||||
|
@ -940,6 +940,11 @@ int ath12k_dp_rx_peer_tid_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (!peer->primary_link) {
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ab->hw_params->reoq_lut_support && !dp->reoq_lut.vaddr) {
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
ath12k_warn(ab, "reo qref table is not setup\n");
|
||||
@ -2781,6 +2786,11 @@ int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (!peer->primary_link) {
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i <= IEEE80211_NUM_TIDS; i++) {
|
||||
rx_tid = &peer->rx_tid[i];
|
||||
rx_tid->ab = ab;
|
||||
|
@ -313,7 +313,11 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
|
||||
struct ath12k_wmi_peer_create_arg *arg)
|
||||
{
|
||||
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(arvif->ahvif);
|
||||
struct ath12k_link_sta *arsta;
|
||||
u8 link_id = arvif->link_id;
|
||||
struct ath12k_peer *peer;
|
||||
struct ath12k_sta *ahsta;
|
||||
u16 ml_peer_id;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
|
||||
@ -379,6 +383,25 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
|
||||
arvif->ast_idx = peer->hw_peer_id;
|
||||
}
|
||||
|
||||
if (sta) {
|
||||
ahsta = ath12k_sta_to_ahsta(sta);
|
||||
arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
|
||||
ahsta->link[link_id]);
|
||||
|
||||
/* Fill ML info into created peer */
|
||||
if (sta->mlo) {
|
||||
ml_peer_id = ahsta->ml_peer_id;
|
||||
peer->ml_id = ml_peer_id | ATH12K_PEER_ML_ID_VALID;
|
||||
ether_addr_copy(peer->ml_addr, sta->addr);
|
||||
|
||||
/* the assoc link is considered primary for now */
|
||||
peer->primary_link = arsta->is_assoc_link;
|
||||
} else {
|
||||
peer->ml_id = ATH12K_MLO_PEER_ID_INVALID;
|
||||
peer->primary_link = true;
|
||||
}
|
||||
}
|
||||
|
||||
peer->sec_type = HAL_ENCRYPT_TYPE_OPEN;
|
||||
peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN;
|
||||
|
||||
|
@ -51,6 +51,14 @@ struct ath12k_peer {
|
||||
bool dp_setup_done;
|
||||
|
||||
u16 ml_id;
|
||||
|
||||
/* any other ML info common for all partners can be added
|
||||
* here and would be same for all partner peers.
|
||||
*/
|
||||
u8 ml_addr[ETH_ALEN];
|
||||
|
||||
/* To ensure only certain work related to dp is done once */
|
||||
bool primary_link;
|
||||
};
|
||||
|
||||
struct ath12k_ml_peer {
|
||||
|
Loading…
Reference in New Issue
Block a user