Commit 81f67d60 authored by Aditya Kumar Singh's avatar Aditya Kumar Singh Committed by Johannes Berg
Browse files

wifi: cfg80211: handle DFS per link



Currently, during starting a radar detection, no link id information is
parsed and passed down. In order to support starting radar detection
during Multi Link Operation, it is required to pass link id as well.

Add changes to first parse and then pass link id in the start radar
detection path.

Additionally, update notification APIs to allow drivers/mac80211 to
pass the link ID.

However, everything is handled at link 0 only until all API's are ready to
handle it per link.

Signed-off-by: default avatarAditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-6-quic_adisi@quicinc.com


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 62c16f21
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ void mwifiex_dfs_cac_work_queue(struct work_struct *work)
			    "CAC timer finished; No radar detected\n");
		cfg80211_cac_event(priv->netdev, &chandef,
				   NL80211_RADAR_CAC_FINISHED,
				   GFP_KERNEL);
				   GFP_KERNEL, 0);
	}
}

@@ -182,7 +182,8 @@ void mwifiex_abort_cac(struct mwifiex_private *priv)
			    "Aborting delayed work for CAC.\n");
		cancel_delayed_work_sync(&priv->dfs_cac_work);
		cfg80211_cac_event(priv->netdev, &priv->dfs_chandef,
				   NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
				   NL80211_RADAR_CAC_ABORTED, GFP_KERNEL,
				   0);
	}
}

@@ -221,7 +222,7 @@ int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv,
				cfg80211_cac_event(priv->netdev,
						   &priv->dfs_chandef,
						   NL80211_RADAR_DETECTED,
						   GFP_KERNEL);
						   GFP_KERNEL, 0);
			}
			break;
		default:
+1 −1
Original line number Diff line number Diff line
@@ -4205,7 +4205,7 @@ static int
mwifiex_cfg80211_start_radar_detection(struct wiphy *wiphy,
				       struct net_device *dev,
				       struct cfg80211_chan_def *chandef,
				       u32 cac_time_ms)
				       u32 cac_time_ms, int link_id)
{
	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
	struct mwifiex_radar_params radar_params;
+1 −1
Original line number Diff line number Diff line
@@ -837,7 +837,7 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev,
static int qtnf_start_radar_detection(struct wiphy *wiphy,
				      struct net_device *ndev,
				      struct cfg80211_chan_def *chandef,
				      u32 cac_time_ms)
				      u32 cac_time_ms, int link_id)
{
	struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
	int ret;
+3 −3
Original line number Diff line number Diff line
@@ -524,14 +524,14 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
			break;

		cfg80211_cac_event(vif->netdev, &chandef,
				   NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
				   NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0);
		break;
	case QLINK_RADAR_CAC_ABORTED:
		if (!vif->wdev.links[0].cac_started)
			break;

		cfg80211_cac_event(vif->netdev, &chandef,
				   NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
				   NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
		break;
	case QLINK_RADAR_CAC_STARTED:
		if (vif->wdev.links[0].cac_started)
@@ -542,7 +542,7 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
			break;

		cfg80211_cac_event(vif->netdev, &chandef,
				   NL80211_RADAR_CAC_STARTED, GFP_KERNEL);
				   NL80211_RADAR_CAC_STARTED, GFP_KERNEL, 0);
		break;
	default:
		pr_warn("%s: unhandled radar event %u\n",
+5 −3
Original line number Diff line number Diff line
@@ -4837,9 +4837,9 @@ struct cfg80211_ops {
	int	(*start_radar_detection)(struct wiphy *wiphy,
					 struct net_device *dev,
					 struct cfg80211_chan_def *chandef,
					 u32 cac_time_ms);
					 u32 cac_time_ms, int link_id);
	void	(*end_cac)(struct wiphy *wiphy,
				struct net_device *dev);
			   struct net_device *dev, unsigned int link_id);
	int	(*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
				 struct cfg80211_update_ft_ies_params *ftie);
	int	(*crit_proto_start)(struct wiphy *wiphy,
@@ -8741,6 +8741,7 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
 * @chandef: chandef for the current channel
 * @event: type of event
 * @gfp: context flags
 * @link_id: valid link_id for MLO operation or 0 otherwise.
 *
 * This function is called when a Channel availability check (CAC) is finished
 * or aborted. This must be called to notify the completion of a CAC process,
@@ -8748,7 +8749,8 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
 */
void cfg80211_cac_event(struct net_device *netdev,
			const struct cfg80211_chan_def *chandef,
			enum nl80211_radar_event event, gfp_t gfp);
			enum nl80211_radar_event event, gfp_t gfp,
			unsigned int link_id);

/**
 * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
Loading