wifi: mac80211: fix channel switch link data
authorJohannes Berg <johannes.berg@intel.com>
Sun, 27 Aug 2023 11:05:32 +0000 (14:05 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 10:33:55 +0000 (12:33 +0200)
Use the correct link ID and per-link puncturing data instead
of hardcoding link ID 0 and using deflink puncturing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230827135854.0b6a211c8e75.I5724d32bb2dae440888efbc47334d8c115db9d50@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/mlme.c

index 490ee6f52d6e8d33f71ab5445f2eceec17772c28..de8f76a7637b1ae72fffa7936c5c315723dd563f 100644 (file)
@@ -3618,7 +3618,7 @@ static int __ieee80211_csa_finalize(struct ieee80211_link_data *link_data)
                return ieee80211_link_use_reserved_context(&sdata->deflink);
        }
 
-       if (!cfg80211_chandef_identical(&sdata->vif.bss_conf.chandef,
+       if (!cfg80211_chandef_identical(&link_data->conf->chandef,
                                        &link_data->csa_chandef))
                return -EINVAL;
 
@@ -3634,7 +3634,7 @@ static int __ieee80211_csa_finalize(struct ieee80211_link_data *link_data)
                changed |= BSS_CHANGED_EHT_PUNCTURING;
        }
 
-       ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed);
+       ieee80211_link_info_change_notify(sdata, link_data, changed);
 
        if (link_data->csa_block_tx) {
                ieee80211_wake_vif_queues(local, sdata,
@@ -3646,8 +3646,9 @@ static int __ieee80211_csa_finalize(struct ieee80211_link_data *link_data)
        if (err)
                return err;
 
-       cfg80211_ch_switch_notify(sdata->dev, &link_data->csa_chandef, 0,
-                                 sdata->vif.bss_conf.eht_puncturing);
+       cfg80211_ch_switch_notify(sdata->dev, &link_data->csa_chandef,
+                                 link_data->link_id,
+                                 link_data->conf->eht_puncturing);
 
        return 0;
 }
index f7dd25dc766c71efbe745cf90725c9994bf2635c..f1d88393689cd80cea618b2ea4d2f7212a126350 100644 (file)
@@ -1772,7 +1772,8 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_link_data *link)
                return;
        }
 
-       cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0, 0);
+       cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef,
+                                 link->link_id, 0);
 }
 
 void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success,