Skip to content

Commit afbab6e

Browse files
Sriram RJeff Johnson
authored andcommitted
wifi: ath12k: modify ath12k_mac_op_bss_info_changed() for MLO
Currently bss_info_changed callback (which is registered with ath12k_mac_op_bss_info_changed()) is used to inform vif (struct ieee80211_vif) and bss (struct ieee80211_bss_conf) level configuration changes to driver. With MLO, vif level config as well each link config changes inside vif needs to be updated and mac80211 uses vif_cfg_changed() and link_info_changed() callback ops for the same, this is also backward compatible where mac80211 will update default link conf changes in case VIF is non-MLO. Rename ath12k_mac_op_bss_info_changed() to ath12k_mac_op_link_info_changed() and register the same to link_info_changed callback. Register ath12k_mac_op_vif_cfg_changed() to vif_cfg_changed() callback and handle all vif level configuration changes there. Also, currently ath12k_mac_op_bss_info_changed() uses deflink to apply the config or to cache the config based on the availability of corresponding vdev. With MLO multiple links can be affiliated to a vif/BSS, so use the link id provided by mac80211 to fetch the corresponding link to which the bss change was intended. For non-MLO link id 0 will be provided by mac80211 and deflink (which is mapped to ahvif->links[0]) will be used. 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 <[email protected]> Co-developed-by: Rameshkumar Sundaram <[email protected]> Signed-off-by: Rameshkumar Sundaram <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]>
1 parent 94a2712 commit afbab6e

File tree

1 file changed

+46
-15
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+46
-15
lines changed

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

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,6 +3150,40 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,
31503150
return ret;
31513151
}
31523152

3153+
static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
3154+
struct ieee80211_vif *vif,
3155+
u64 changed)
3156+
{
3157+
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
3158+
unsigned long links = ahvif->links_map;
3159+
struct ath12k_link_vif *arvif;
3160+
struct ath12k *ar;
3161+
u8 link_id;
3162+
3163+
lockdep_assert_wiphy(hw->wiphy);
3164+
3165+
if (changed & BSS_CHANGED_SSID && vif->type == NL80211_IFTYPE_AP) {
3166+
ahvif->u.ap.ssid_len = vif->cfg.ssid_len;
3167+
if (vif->cfg.ssid_len)
3168+
memcpy(ahvif->u.ap.ssid, vif->cfg.ssid, vif->cfg.ssid_len);
3169+
}
3170+
3171+
if (changed & BSS_CHANGED_ASSOC) {
3172+
for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
3173+
arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
3174+
if (!arvif || !arvif->ar)
3175+
continue;
3176+
3177+
ar = arvif->ar;
3178+
3179+
if (vif->cfg.assoc)
3180+
ath12k_bss_assoc(ar, arvif, &vif->bss_conf);
3181+
else
3182+
ath12k_bss_disassoc(ar, arvif);
3183+
}
3184+
}
3185+
}
3186+
31533187
static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
31543188
{
31553189
struct ath12k *ar = arvif->ar;
@@ -3497,33 +3531,27 @@ static void ath12k_ahvif_put_link_cache(struct ath12k_vif *ahvif, u8 link_id)
34973531
ahvif->cache[link_id] = NULL;
34983532
}
34993533

3500-
static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
3501-
struct ieee80211_vif *vif,
3502-
struct ieee80211_bss_conf *info,
3503-
u64 changed)
3534+
static void ath12k_mac_op_link_info_changed(struct ieee80211_hw *hw,
3535+
struct ieee80211_vif *vif,
3536+
struct ieee80211_bss_conf *info,
3537+
u64 changed)
35043538
{
35053539
struct ath12k *ar;
35063540
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
35073541
struct ath12k_vif_cache *cache;
35083542
struct ath12k_link_vif *arvif;
3543+
u8 link_id = info->link_id;
35093544

35103545
lockdep_assert_wiphy(hw->wiphy);
35113546

3512-
/* TODO use info->link_id and fetch corresponding ahvif->link[]
3513-
* with MLO support.
3514-
*/
3515-
arvif = &ahvif->deflink;
3516-
ar = ath12k_get_ar_by_vif(hw, vif);
3547+
arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
35173548

35183549
/* if the vdev is not created on a certain radio,
35193550
* cache the info to be updated later on vdev creation
35203551
*/
35213552

3522-
if (!ar) {
3523-
/* TODO Once link vif is fetched based on link id from
3524-
* info, avoid using ATH12K_DEFAULT_LINK_ID.
3525-
*/
3526-
cache = ath12k_ahvif_get_link_cache(ahvif, ATH12K_DEFAULT_LINK_ID);
3553+
if (!arvif || !arvif->is_created) {
3554+
cache = ath12k_ahvif_get_link_cache(ahvif, link_id);
35273555
if (!cache)
35283556
return;
35293557

@@ -3532,6 +3560,8 @@ static void ath12k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
35323560
return;
35333561
}
35343562

3563+
ar = arvif->ar;
3564+
35353565
ath12k_mac_bss_info_changed(ar, arvif, info, changed);
35363566
}
35373567

@@ -8888,7 +8918,8 @@ static const struct ieee80211_ops ath12k_ops = {
88888918
.remove_interface = ath12k_mac_op_remove_interface,
88898919
.update_vif_offload = ath12k_mac_op_update_vif_offload,
88908920
.config = ath12k_mac_op_config,
8891-
.bss_info_changed = ath12k_mac_op_bss_info_changed,
8921+
.link_info_changed = ath12k_mac_op_link_info_changed,
8922+
.vif_cfg_changed = ath12k_mac_op_vif_cfg_changed,
88928923
.configure_filter = ath12k_mac_op_configure_filter,
88938924
.hw_scan = ath12k_mac_op_hw_scan,
88948925
.cancel_hw_scan = ath12k_mac_op_cancel_hw_scan,

0 commit comments

Comments
 (0)