mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH rtw-next v3 0/2] wifi: rtw88: channel switch in AP mode
@ 2026-10-05 14:33 Mehmet Fide
  2026-10-05 14:33 ` [PATCH rtw-next v3 1/2] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Mehmet Fide @ 2026-10-05 14:33 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: Luka Gejak, Bitterblue Smith, linux-wireless, linux-kernel, mehmet.fide

From: Mehmet Fide <mehmet.fide@screeningeagle.com>

An rtw88 AP cannot change its channel: the driver does not announce
channel switch support, so hostapd's CHAN_SWITCH is refused and the
only way is to tear the AP down. The series fixes the beacon download
the reserved page build makes twice, then implements
channel_switch_beacon on top of the firmware's beacon page.

v3:
- 1/2: the beacon out-pointer is initialised in the caller (Luka)
- 2/2: the countdown work lives in the interface, remove_interface
  cancels it unconditionally, the queue wrapper and the comments are
  gone (Ping-Ke)
- 2/2: the TIM update and the PG backup on set_key skip the page
  download while a switch is announced; every beacon fetch advances
  the countdown (Luka)
- 2/2: the commit message names the refused hardware scan (Ping-Ke)
- the hardware scan path ran on an RTL8822CU, whose firmware has scan
  offload: a scan with the AP up keeps the beacon and the station, a
  scan during a countdown is refused

v2:
- 2/2: a hardware scan is refused while a switch is announced
- the rtw89 mention is gone from the cover

Mehmet Fide (2):
  wifi: rtw88: download the beacon the reserved page was built with
  wifi: rtw88: support channel switch in AP mode

 drivers/net/wireless/realtek/rtw88/fw.c       | 93 ++++++++++++++++---
 drivers/net/wireless/realtek/rtw88/fw.h       |  2 +
 drivers/net/wireless/realtek/rtw88/mac80211.c | 53 ++++++++++-
 drivers/net/wireless/realtek/rtw88/main.c     |  3 +-
 drivers/net/wireless/realtek/rtw88/main.h     |  2 +
 5 files changed, 138 insertions(+), 15 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH rtw-next v3 0/2] wifi: rtw88: channel switch in AP mode
@ 2026-10-05 14:35 Mehmet Fide
  2026-10-05 14:35 ` [PATCH rtw-next v3 2/2] wifi: rtw88: support " Mehmet Fide
  0 siblings, 1 reply; 13+ messages in thread
From: Mehmet Fide @ 2026-10-05 14:35 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: Luka Gejak, Bitterblue Smith, linux-wireless, linux-kernel, mehmet.fide

From: Mehmet Fide <mehmet.fide@screeningeagle.com>

An rtw88 AP cannot change its channel: the driver does not announce
channel switch support, so hostapd's CHAN_SWITCH is refused and the
only way is to tear the AP down. The series fixes the beacon download
the reserved page build makes twice, then implements
channel_switch_beacon on top of the firmware's beacon page.

v3:
- 1/2: the beacon out-pointer is initialised in the caller (Luka)
- 2/2: the countdown work lives in the interface, remove_interface
  cancels it unconditionally, the queue wrapper and the comments are
  gone (Ping-Ke)
- 2/2: the TIM update and the PG backup on set_key skip the page
  download while a switch is announced; every beacon fetch advances
  the countdown (Luka)
- 2/2: the commit message names the refused hardware scan (Ping-Ke)
- the hardware scan path ran on an RTL8822CU, whose firmware has scan
  offload: a scan with the AP up keeps the beacon and the station, a
  scan during a countdown is refused

v2:
- 2/2: a hardware scan is refused while a switch is announced
- the rtw89 mention is gone from the cover

Mehmet Fide (2):
  wifi: rtw88: download the beacon the reserved page was built with
  wifi: rtw88: support channel switch in AP mode

 drivers/net/wireless/realtek/rtw88/fw.c       | 93 ++++++++++++++++---
 drivers/net/wireless/realtek/rtw88/fw.h       |  2 +
 drivers/net/wireless/realtek/rtw88/mac80211.c | 53 ++++++++++-
 drivers/net/wireless/realtek/rtw88/main.c     |  3 +-
 drivers/net/wireless/realtek/rtw88/main.h     |  2 +
 5 files changed, 138 insertions(+), 15 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] wifi: rtw88: support channel switch in AP mode
  2026-10-05 14:35 ` [PATCH rtw-next v3 2/2] wifi: rtw88: support " Mehmet Fide
@ 2026-10-05 17:33 Luka Gejak
  2026-10-06  7:46 ` [PATCH rtw-next " Mehmet Fide
  0 siblings, 1 reply; 13+ messages in thread
From: Luka Gejak @ 2026-10-05 17:33 UTC (permalink / raw)
  To: Mehmet Fide
  Cc: Ping-Ke Shih, Bitterblue Smith, mehmet.fide, linux-wireless,
	linux-kernel, Luka Gejak

On Mon, 05 Oct 2026, Mehmet Fide wrote:

> @@ -626,7 +652,8 @@ static int rtw_ops_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> [...]
> -	if (rtw_get_lps_deep_mode(rtwdev) == LPS_DEEP_MODE_PG)
> +	if (rtw_get_lps_deep_mode(rtwdev) == LPS_DEEP_MODE_PG &&
> +	    !rtw_fw_csa_active(rtwdev))
>  		rtw_fw_download_rsvd_page(rtwdev);

The assoc change downloads the same page, and it is not guarded:

	if (changed & BSS_CHANGED_ASSOC) {
		rtw_vif_assoc_changed(rtwvif, conf);
		if (vif->cfg.assoc) {
			rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_FINISH);

			rtw_fw_download_rsvd_page(rtwdev);

The page holds the beacon of the AP vif, and building it fetches that
beacon:

	case RSVD_BEACON:
		skb_new = ieee80211_beacon_get_tim(hw, vif, &tim_offset, NULL, 0);

mac80211 steps the countdown on that fetch, not once per transmitted
beacon:

	if (beacon->cntdwn_counter_offsets[0]) {
		if (!is_template)
			ieee80211_beacon_update_cntdwn(vif, link->link_id);

so an association during the countdown moves the count a second time in
the same interval. Can this download skip the page while a switch is
announced, the way set_key does?

> @@ -900,6 +945,13 @@ static int rtw_ops_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>  	mutex_lock(&rtwdev->mutex);
> +
> +	rtw_iterate_vifs(rtwdev, rtw_csa_active_iter, &csa_active);
> +	if (csa_active) {
> +		mutex_unlock(&rtwdev->mutex);
> +		return -EBUSY;
> +	}

The hw scan check sits below the offload test, so with firmware without
scan offload the op returns before it:

	if (!rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_SCAN_OFFLOAD))
		return 1;

A return of one tells mac80211 to run the scan in software:

	if (hw_scan && rc == 1) {
		/*
		 * we can't fall back to software for P2P-GO
		 * as it must update NoA etc.
		 */
		if (ieee80211_vif_type_p2p(&sdata->vif) ==
				NL80211_IFTYPE_P2P_GO)
			return -EOPNOTSUPP;
		hw_scan = false;
		goto again;
	}

so the AP leaves the channel during the countdown anyway. Can the check
move above the feature test?

Best regards,
Luka Gejak

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-10-06  8:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 14:33 [PATCH rtw-next v3 0/2] wifi: rtw88: channel switch in AP mode Mehmet Fide
2026-10-05 14:33 ` [PATCH rtw-next v3 1/2] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-10-05 14:33 ` [PATCH rtw-next v3 2/2] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-10-05 14:42 ` [PATCH rtw-next v3 0/2] wifi: rtw88: " Mehmet Fide
2026-10-06  0:47 ` Ping-Ke Shih
2026-10-06  7:46   ` Mehmet Fide
2026-10-06  7:48     ` Ping-Ke Shih
2026-10-05 14:35 Mehmet Fide
2026-10-05 14:35 ` [PATCH rtw-next v3 2/2] wifi: rtw88: support " Mehmet Fide
2026-10-06  1:26   ` Ping-Ke Shih
2026-10-06  7:46     ` Mehmet Fide
2026-10-06  7:54       ` Ping-Ke Shih
2026-10-06  8:16         ` Mehmet Fide
2026-10-05 17:33 [PATCH " Luka Gejak
2026-10-06  7:46 ` [PATCH rtw-next " Mehmet Fide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®