Re: [PATCH rtw-next v10 2/3] wifi: rtw88: support channel switch in AP mode
From: Luka Gejak
Date: Thu Nov 12 2026 - 07:10:50 EST
Hi Mehmet,
Thanks for the v10, the rtw_core_stop() change looks good to me. I just
have one comment below.
On November 11, 2026 1:15:24 PM GMT+01:00, Mehmet Fide
<mehmet.fide@xxxxxxxxx> wrote:
> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 5e40cf06a9e3..e6c9866fd599 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
[ ... ]
> @@ -438,6 +443,11 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
> rtw_set_dtim_period(rtwdev, conf->dtim_period);
> rtw_fw_download_rsvd_page(rtwdev);
> rtw_send_rsvd_page_h2c(rtwdev);
> + /* restart replay resumes it, a beacon without CSA ends it */
> + if (conf->csa_active)
> + rtw_fw_csa_start(rtwdev, vif);
> + else
> + rtw_fw_csa_stop(rtwdev, vif);
> }
[ ... ]
> +static void rtw_ops_channel_switch_beacon(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif,
> + struct cfg80211_chan_def *chandef)
> +{
> + struct rtw_dev *rtwdev = hw->priv;
> +
> + mutex_lock(&rtwdev->mutex);
> + rtw_fw_csa_start(rtwdev, vif);
> + mutex_unlock(&rtwdev->mutex);
> +}
As far as I can see this op normally has nothing left to do.
__ieee80211_channel_switch() sets csa_active and sends the beacon change
before it calls the op:
link_conf->csa_active = true;
...
if (changed) {
ieee80211_link_info_change_notify(sdata, link_data, changed);
drv_channel_switch_beacon(sdata, &link_data->csa.chanreq.oper);
}
For rtw88 changed is only set there when there is a CSA beacon, so it
always carries BSS_CHANGED_BEACON. The path above then starts every
countdown, not only the one after a restart, and in the normal flow
rtw_fw_csa_start() in the op returns early because csa_vif already
matches.
Maybe drop the op and say in the comment above that this path starts
the countdown? Or is it kept on purpose?
Best regards,
Luka Gejak