Skip to content

Commit 1833a2c

Browse files
Aditya Kumar Singhkvalo
authored andcommitted
wifi: ath12k: ath12k_bss_assoc(): MLO support
Currently, the ath12k_bss_assoc() function handles only deflink station connections. To support multi-link station connections, make the necessary changes to retrieve the required information from the link-level members. 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 <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 90570ba commit 1833a2c

File tree

1 file changed

+20
-8
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+20
-8
lines changed

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,7 +3133,9 @@ static void ath12k_bss_assoc(struct ath12k *ar,
31333133
struct ath12k_vif *ahvif = arvif->ahvif;
31343134
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif);
31353135
struct ath12k_wmi_vdev_up_params params = {};
3136-
struct ath12k_wmi_peer_assoc_arg peer_arg;
3136+
struct ath12k_wmi_peer_assoc_arg peer_arg = {};
3137+
struct ieee80211_link_sta *link_sta;
3138+
u8 link_id = bss_conf->link_id;
31373139
struct ath12k_link_sta *arsta;
31383140
struct ieee80211_sta *ap_sta;
31393141
struct ath12k_sta *ahsta;
@@ -3143,27 +3145,38 @@ static void ath12k_bss_assoc(struct ath12k *ar,
31433145

31443146
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
31453147

3146-
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %i assoc bssid %pM aid %d\n",
3147-
arvif->vdev_id, arvif->bssid, ahvif->aid);
3148+
ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
3149+
"mac vdev %i link id %u assoc bssid %pM aid %d\n",
3150+
arvif->vdev_id, link_id, arvif->bssid, ahvif->aid);
31483151

31493152
rcu_read_lock();
31503153

3151-
ap_sta = ieee80211_find_sta(vif, bss_conf->bssid);
3154+
/* During ML connection, cfg.ap_addr has the MLD address. For
3155+
* non-ML connection, it has the BSSID.
3156+
*/
3157+
ap_sta = ieee80211_find_sta(vif, vif->cfg.ap_addr);
31523158
if (!ap_sta) {
31533159
ath12k_warn(ar->ab, "failed to find station entry for bss %pM vdev %i\n",
3154-
bss_conf->bssid, arvif->vdev_id);
3160+
vif->cfg.ap_addr, arvif->vdev_id);
31553161
rcu_read_unlock();
31563162
return;
31573163
}
31583164

31593165
ahsta = ath12k_sta_to_ahsta(ap_sta);
3160-
arsta = &ahsta->deflink;
31613166

3167+
arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
3168+
ahsta->link[link_id]);
31623169
if (WARN_ON(!arsta)) {
31633170
rcu_read_unlock();
31643171
return;
31653172
}
31663173

3174+
link_sta = ath12k_mac_get_link_sta(arsta);
3175+
if (WARN_ON(!link_sta)) {
3176+
rcu_read_unlock();
3177+
return;
3178+
}
3179+
31673180
ath12k_peer_assoc_prepare(ar, arvif, arsta, &peer_arg, false);
31683181

31693182
rcu_read_unlock();
@@ -3182,8 +3195,7 @@ static void ath12k_bss_assoc(struct ath12k *ar,
31823195
}
31833196

31843197
ret = ath12k_setup_peer_smps(ar, arvif, bss_conf->bssid,
3185-
&ap_sta->deflink.ht_cap,
3186-
&ap_sta->deflink.he_6ghz_capa);
3198+
&link_sta->ht_cap, &link_sta->he_6ghz_capa);
31873199
if (ret) {
31883200
ath12k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n",
31893201
arvif->vdev_id, ret);

0 commit comments

Comments
 (0)