Commit d7074be6 authored by Johannes Berg's avatar Johannes Berg
Browse files

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: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a6add8be
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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,
			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,
+2 −2
Original line number Diff line number Diff line
@@ -1206,7 +1206,7 @@ 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,
		wiphy_work_queue(sdata->local->hw.wiphy,
				 &link->csa_finalize_work);
		break;
	case NL80211_IFTYPE_STATION:
+2 −2
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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);

+2 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ 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,
	wiphy_work_init(&link->csa_finalize_work,
			ieee80211_csa_finalize_work);
	INIT_WORK(&link->color_change_finalize_work,
		  ieee80211_color_change_finalize_work);