wifi: mac80211: move CSA finalize to wiphy work

This work should be made per link as well, and then
will have cancellation issues. Moving it to a wiphy
work already fixes those beforehand.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2023-08-28 13:59:50 +02:00
parent a6add8bee6
commit d7074be64a
5 changed files with 11 additions and 11 deletions

View File

@ -3584,11 +3584,11 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif)
if (iter == sdata || iter->vif.mbssid_tx_vif != vif)
continue;
ieee80211_queue_work(&iter->local->hw,
&iter->deflink.csa_finalize_work);
wiphy_work_queue(iter->local->hw.wiphy,
&iter->deflink.csa_finalize_work);
}
}
ieee80211_queue_work(&local->hw, &sdata->deflink.csa_finalize_work);
wiphy_work_queue(local->hw.wiphy, &sdata->deflink.csa_finalize_work);
rcu_read_unlock();
}
@ -3716,7 +3716,7 @@ static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
}
}
void ieee80211_csa_finalize_work(struct work_struct *work)
void ieee80211_csa_finalize_work(struct wiphy *wiphy, struct wiphy_work *work)
{
struct ieee80211_sub_if_data *sdata =
container_of(work, struct ieee80211_sub_if_data,

View File

@ -1206,8 +1206,8 @@ ieee80211_link_chanctx_reservation_complete(struct ieee80211_link_data *link)
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_OCB:
ieee80211_queue_work(&sdata->local->hw,
&link->csa_finalize_work);
wiphy_work_queue(sdata->local->hw.wiphy,
&link->csa_finalize_work);
break;
case NL80211_IFTYPE_STATION:
wiphy_delayed_work_queue(sdata->local->hw.wiphy,

View File

@ -990,7 +990,7 @@ struct ieee80211_link_data {
struct ieee80211_key __rcu *default_mgmt_key;
struct ieee80211_key __rcu *default_beacon_key;
struct work_struct csa_finalize_work;
struct wiphy_work csa_finalize_work;
bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
bool operating_11g_mode;
@ -1989,7 +1989,7 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
struct wireless_dev *wdev, u64 cookie);
/* channel switch handling */
void ieee80211_csa_finalize_work(struct work_struct *work);
void ieee80211_csa_finalize_work(struct wiphy *wiphy, struct wiphy_work *work);
int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_csa_settings *params);

View File

@ -535,9 +535,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
mutex_unlock(&local->mtx);
sdata_unlock(sdata);
cancel_work_sync(&sdata->deflink.csa_finalize_work);
cancel_work_sync(&sdata->deflink.color_change_finalize_work);
wiphy_work_cancel(local->hw.wiphy, &sdata->deflink.csa_finalize_work);
wiphy_delayed_work_cancel(local->hw.wiphy,
&sdata->deflink.dfs_cac_timer_work);

View File

@ -37,8 +37,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
link_conf->link_id = link_id;
link_conf->vif = &sdata->vif;
INIT_WORK(&link->csa_finalize_work,
ieee80211_csa_finalize_work);
wiphy_work_init(&link->csa_finalize_work,
ieee80211_csa_finalize_work);
INIT_WORK(&link->color_change_finalize_work,
ieee80211_color_change_finalize_work);
INIT_DELAYED_WORK(&link->color_collision_detect_work,