mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Mehmet Fide <mehmet.fide@gmail.com>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	mehmet.fide@screeningeagle.com, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, Luka Gejak <luka.gejak@linux.dev>
Subject: Re: [PATCH v3 2/2] wifi: rtw88: support channel switch in AP mode
Date: Mon,  5 Oct 2026 17:33:26 +0000	[thread overview]
Message-ID: <20261005173326.2306-1-luka.gejak@linux.dev> (raw)
In-Reply-To: <20261005143523.130287-3-mehmet.fide@gmail.com>

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

  reply	other threads:[~2026-10-05 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 14:35 [PATCH rtw-next v3 0/2] wifi: rtw88: " Mehmet Fide
2026-10-05 14:35 ` [PATCH rtw-next v3 1/2] wifi: rtw88: download the beacon the reserved page was built with Mehmet Fide
2026-10-05 17:36   ` Luka Gejak
2026-10-05 14:35 ` [PATCH rtw-next v3 2/2] wifi: rtw88: support channel switch in AP mode Mehmet Fide
2026-10-05 17:33   ` Luka Gejak [this message]
2026-10-06  1:26   ` Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261005173326.2306-1-luka.gejak@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mehmet.fide@gmail.com \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®