mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zong-Zhe Yang <kevin_yang@realtek.com>
To: Enver Ikromov <owner@ph4ntom-rev.uz>, Ping-Ke Shih <pkshih@realtek.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH rtw-next v7 3/5] wifi: rtw89: restore channel when leaving idle on non-chanctx devices
Date: Thu, 19 Nov 2026 05:13:48 +0000	[thread overview]
Message-ID: <61ca0408d2ba4b0f8232881a5729990f@realtek.com> (raw)
In-Reply-To: <20261118180435.904-4-owner@ph4ntom-rev.uz>

Enver Ikromov <owner@ph4ntom-rev.uz> wrote:
> 
> Fix the operating channel not being restored after bringing a monitor
> interface down and back up on devices that do not use native chanctx
> callbacks (such as RTL8852AE when firmware lacks beacon filtering).
> 
> Stopping the interface powers down the PHY while mac80211 retains the
> previous chandef and omits IEEE80211_CONF_CHANGE_CHANNEL on restart.
> Record support_chanctx in rtwdev and set
> IEEE80211_CONF_CHANGE_CHANNEL
> when re-entering monitor mode from idle on non-chanctx devices so the
> channel is applied again.
> 
> Signed-off-by: Enver Ikromov <owner@ph4ntom-rev.uz>
> ---
>  drivers/net/wireless/realtek/rtw89/core.c     | 1 +
>  drivers/net/wireless/realtek/rtw89/core.h     | 1 +
>  drivers/net/wireless/realtek/rtw89/mac80211.c | 7 +++++++
>  3 files changed, 9 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c
> b/drivers/net/wireless/realtek/rtw89/core.c
> index 37ff745..8333b26 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -7761,6 +7761,7 @@ struct rtw89_dev
> *rtw89_alloc_ieee80211_hw(struct device *device,
>         rtwdev->board = info->board;
>         rtwdev->fw.req.firmware = firmware;
>         rtwdev->fw.fw_format = fw_format;
> +       rtwdev->support_chanctx = !no_chanctx;
>         rtwdev->support_mlo = support_mlo;
> 
>         bitmap_copy(rtwdev->quirks, &chip->default_quirks,
> NUM_OF_RTW89_QUIRKS);
> diff --git a/drivers/net/wireless/realtek/rtw89/core.h
> b/drivers/net/wireless/realtek/rtw89/core.h
> index 8e93cf1..780ec47 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.h
> +++ b/drivers/net/wireless/realtek/rtw89/core.h
> @@ -7703,6 +7703,7 @@ struct rtw89_dev {
>         const struct rtw89_io_ops *io;
> 
>         bool dbcc_en;
> +       bool support_chanctx;
>         bool support_mlo;
>         enum rtw89_mlo_dbcc_mode mlo_dbcc_mode;
>         struct rtw89_hw_scan_info scan_info;
> diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c
> b/drivers/net/wireless/realtek/rtw89/mac80211.c
> index 7a55fed..98f4b5c 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
> @@ -97,6 +97,13 @@ static int rtw89_ops_config(struct ieee80211_hw *hw,
> int radio_idx, u32 changed)
> 
>         rtw89_leave_ps_mode(rtwdev);
> 
> +       if (!rtwdev->support_chanctx &&
> +           changed & IEEE80211_CONF_CHANGE_IDLE &&
> +           changed & IEEE80211_CONF_CHANGE_MONITOR &&
> +           !(hw->conf.flags & IEEE80211_CONF_IDLE) &&
> +           hw->conf.flags & IEEE80211_CONF_MONITOR)
> +               changed |= IEEE80211_CONF_CHANGE_CHANNEL;
> +
>         if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
>             !(hw->conf.flags & IEEE80211_CONF_IDLE))
>                 rtw89_leave_ips(rtwdev);
> --
> 2.56.0.windows.4
> 

Looks good to me

  reply	other threads:[~2026-11-19  5:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 18:04 [PATCH rtw-next v7 0/5] wifi: rtw89: monitor mode and raw frame injection fixes Enver Ikromov
2026-11-18 18:04 ` [PATCH rtw-next v7 1/5] wifi: rtw89: avoid NULL vif dereference in rtw89_ops_tx() Enver Ikromov
2026-11-18 18:04 ` [PATCH rtw-next v7 2/5] wifi: rtw89: handle negative rate index for injected frames Enver Ikromov
2026-11-18 18:04 ` [PATCH rtw-next v7 3/5] wifi: rtw89: restore channel when leaving idle on non-chanctx devices Enver Ikromov
2026-11-19  5:13   ` Zong-Zhe Yang [this message]
2026-11-18 18:04 ` [PATCH rtw-next v7 4/5] wifi: rtw89: avoid reading seq_ctrl on control frames Enver Ikromov
2026-11-18 18:04 ` [PATCH rtw-next v7 5/5] wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK for injected frames Enver Ikromov

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=61ca0408d2ba4b0f8232881a5729990f@realtek.com \
    --to=kevin_yang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=owner@ph4ntom-rev.uz \
    --cc=pkshih@realtek.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®