diff --git a/mlinux/moal_cfg80211.c b/mlinux/moal_cfg80211.c index aee41d0..074fd59 100644 --- a/mlinux/moal_cfg80211.c +++ b/mlinux/moal_cfg80211.c @@ -1105,7 +1105,10 @@ void woal_cancel_cac(moal_private *priv) if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) PRINTM(MERROR, "%s: cancel chan report failed \n", __func__); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); #else @@ -1200,7 +1203,12 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, PRINTM(MERROR, "%s: cancel chan report failed \n", __func__); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, + &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, + GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, diff --git a/mlinux/moal_cfg80211.h b/mlinux/moal_cfg80211.h index 06268e6..3323055 100644 --- a/mlinux/moal_cfg80211.h +++ b/mlinux/moal_cfg80211.h @@ -472,7 +472,12 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, #endif #if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE -#if KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE +#if KERNEL_VERSION(6, 12, 0) <= CFG80211_VERSION_CODE +int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_chan_def *chandef, + u32 cac_time_msi, int link_id); +#elif KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_chan_def *chandef, diff --git a/mlinux/moal_main.c b/mlinux/moal_main.c index 7dfc595..f91901c 100644 --- a/mlinux/moal_main.c +++ b/mlinux/moal_main.c @@ -1224,7 +1224,7 @@ void woal_clean_up(moal_handle *handle) handle->cac_period = MFALSE; priv = handle->priv[handle->cac_bss_index]; if (priv) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) cfg80211_cac_event(priv->netdev, &handle->dfs_channel, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); diff --git a/mlinux/moal_shim.c b/mlinux/moal_shim.c index be555ef..a651593 100644 --- a/mlinux/moal_shim.c +++ b/mlinux/moal_shim.c @@ -3705,7 +3705,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) &priv->phandle->cac_timer); priv->phandle->is_cac_timer_set = MFALSE; if (radar_detected) { -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, + &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, + GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, @@ -3727,11 +3732,19 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) // WARN_ON(!time_after_eq(jiffies, // timeout)); mdelay(100); Using // optimized delay +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + timeout = + (priv->wdev->links[0].cac_start_time + + msecs_to_jiffies( + priv->wdev + ->links[0].cac_time_ms)); +#else timeout = (priv->wdev->cac_start_time + msecs_to_jiffies( priv->wdev ->cac_time_ms)); +#endif if (!time_after_eq(jiffies, timeout)) { /* Exact time to make host and * device timer in sync */ @@ -3748,7 +3761,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) } #endif -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, + &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_FINISHED, + GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_FINISHED, @@ -3826,7 +3844,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) woal_11h_cancel_chan_report_ioctl(priv, MOAL_NO_WAIT); /* upstream: inform cfg80211 */ -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, + &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, + GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, diff --git a/mlinux/moal_uap_cfg80211.c b/mlinux/moal_uap_cfg80211.c index bc2940e..6c40a10 100644 --- a/mlinux/moal_uap_cfg80211.c +++ b/mlinux/moal_uap_cfg80211.c @@ -3168,7 +3168,10 @@ int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) PRINTM(MERROR, "%s: cancel chan report failed \n", __func__); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); #else @@ -3848,7 +3851,10 @@ void woal_cac_timer_func(void *context) moal_private *priv = handle->priv[handle->cac_bss_index]; PRINTM(MEVENT, "cac_timer fired.\n"); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, &handle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &handle->dfs_channel, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); #else @@ -4007,7 +4013,10 @@ void woal_process_cancel_chanrpt_event(moal_private *priv) if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT)) PRINTM(MERROR, "%s: cancel chan report failed \n", __func__); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) + cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, + NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel, NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); #else @@ -4021,7 +4030,22 @@ void woal_process_cancel_chanrpt_event(moal_private *priv) } #endif -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) +/** + * @brief start radar detection + * + * @param wiphy A pointer to wiphy structure + * @param dev A pointer to net_device structure + * @param chandef A pointer to cfg80211_chan_def structure + * @param cac_time_ms A cac dwell time + * @param link_id valid link_id for MLO operation or 0 otherwise. + * @return 0 -- success, otherwise fail + */ +int woal_cfg80211_start_radar_detection(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_chan_def *chandef, + u32 cac_time_ms, int link_id) +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) /** * @brief start radar detection *