Commit b345f063 authored by Aloka Dixit's avatar Aloka Dixit Committed by Johannes Berg
Browse files

wifi: cfg80211: include puncturing bitmap in channel switch events



Add puncturing bitmap in channel switch notifications
and corresponding trace functions.

Signed-off-by: default avatarAloka Dixit <quic_alokad@quicinc.com>
Link: https://lore.kernel.org/r/20230131001227.25014-4-quic_alokad@quicinc.com


[fix qtnfmac]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d7c1a9a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
					NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);

	mutex_lock(&vif->wdev.mtx);
	cfg80211_ch_switch_notify(vif->ndev, &chandef, 0);
	cfg80211_ch_switch_notify(vif->ndev, &chandef, 0, 0);
	mutex_unlock(&vif->wdev.mtx);
}

+1 −1
Original line number Diff line number Diff line
@@ -292,6 +292,6 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
	mwifiex_dbg(priv->adapter, MSG,
		    "indicating channel switch completion to kernel\n");
	mutex_lock(&priv->wdev.mtx);
	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0);
	cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0, 0);
	mutex_unlock(&priv->wdev.mtx);
}
+1 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
			continue;

		mutex_lock(&vif->wdev.mtx);
		cfg80211_ch_switch_notify(vif->netdev, &chandef, 0);
		cfg80211_ch_switch_notify(vif->netdev, &chandef, 0, 0);
		mutex_unlock(&vif->wdev.mtx);
	}

+4 −2
Original line number Diff line number Diff line
@@ -8326,13 +8326,14 @@ bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy,
 * @dev: the device which switched channels
 * @chandef: the new channel definition
 * @link_id: the link ID for MLO, must be 0 for non-MLO
 * @punct_bitmap: the new puncturing bitmap
 *
 * Caller must acquire wdev_lock, therefore must only be called from sleepable
 * driver context!
 */
void cfg80211_ch_switch_notify(struct net_device *dev,
			       struct cfg80211_chan_def *chandef,
			       unsigned int link_id);
			       unsigned int link_id, u16 punct_bitmap);

/*
 * cfg80211_ch_switch_started_notify - notify channel switch start
@@ -8341,6 +8342,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
 * @link_id: the link ID for MLO, must be 0 for non-MLO
 * @count: the number of TBTTs until the channel switch happens
 * @quiet: whether or not immediate quiet was requested by the AP
 * @punct_bitmap: the future puncturing bitmap
 *
 * Inform the userspace about the channel switch that has just
 * started, so that it can take appropriate actions (eg. starting
@@ -8349,7 +8351,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
void cfg80211_ch_switch_started_notify(struct net_device *dev,
				       struct cfg80211_chan_def *chandef,
				       unsigned int link_id, u8 count,
				       bool quiet);
				       bool quiet, u16 punct_bitmap);

/**
 * ieee80211_operating_class_to_band - convert operating class to band
+3 −2
Original line number Diff line number Diff line
@@ -3587,7 +3587,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
	if (err)
		return err;

	cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0);
	cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0,
				  0);

	return 0;
}
@@ -3859,7 +3860,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,

	cfg80211_ch_switch_started_notify(sdata->dev,
					  &sdata->deflink.csa_chandef, 0,
					  params->count, params->block_tx);
					  params->count, params->block_tx, 0);

	if (changed) {
		ieee80211_link_info_change_notify(sdata, &sdata->deflink,
Loading