From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <kevin_yang@realtek.com>
Subject: [PATCH rtw-next 09/11] wifi: rtw89: get designated link to replace link instance 0
Date: Fri, 23 Jan 2026 09:39:55 +0800 [thread overview]
Message-ID: <20260123013957.16418-10-pkshih@realtek.com> (raw)
In-Reply-To: <20260123013957.16418-1-pkshih@realtek.com>
From: Zong-Zhe Yang <kevin_yang@realtek.com>
Clean up some places where still to get link instance 0 directly.
Since now MLSR switch is supported, it's not guaranteed to always
run on link instance 0. So, prefer to get designated link in most
cases.
For now, the only exception is MCC (multi-channel concurrency) case.
How to fill content of its H2C command depends on how to choose link
instance, so cannot simply change it as above. Will handle MCC case
separately afterwards.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/chan.c | 8 ++++----
drivers/net/wireless/realtek/rtw89/fw.c | 7 ++-----
drivers/net/wireless/realtek/rtw89/mac80211.c | 4 ++--
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/chan.c b/drivers/net/wireless/realtek/rtw89/chan.c
index c0af61992226..9b2f6f0a00fd 100644
--- a/drivers/net/wireless/realtek/rtw89/chan.c
+++ b/drivers/net/wireless/realtek/rtw89/chan.c
@@ -372,8 +372,8 @@ static void rtw89_normalize_link_chanctx(struct rtw89_dev *rtwdev,
if (unlikely(!rtwvif_link->chanctx_assigned))
return;
- cur = rtw89_vif_get_link_inst(rtwvif, 0);
- if (!cur || !cur->chanctx_assigned)
+ cur = rtw89_get_designated_link(rtwvif);
+ if (unlikely(!cur) || !cur->chanctx_assigned)
return;
if (cur == rtwvif_link)
@@ -522,8 +522,8 @@ static void rtw89_entity_recalc_mgnt_roles(struct rtw89_dev *rtwdev)
}
/* To be consistent with legacy behavior, expect the first active role
- * which uses RTW89_CHANCTX_0 to put at position 0, and make its first
- * link instance take RTW89_CHANCTX_0. (normalizing)
+ * which uses RTW89_CHANCTX_0 to put at position 0 and its designated
+ * link take RTW89_CHANCTX_0. (normalizing)
*/
list_for_each_entry(role, &mgnt->active_list, mgnt_entry) {
for (i = 0; i < role->links_inst_valid_num; i++) {
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 9e88fd6d735a..f84726f04669 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -9027,12 +9027,9 @@ static void rtw89_hw_scan_set_extra_op_info(struct rtw89_dev *rtwdev,
if (tmp == scan_rtwvif)
continue;
- tmp_link = rtw89_vif_get_link_inst(tmp, 0);
- if (unlikely(!tmp_link)) {
- rtw89_debug(rtwdev, RTW89_DBG_HW_SCAN,
- "hw scan: no HW-0 link for extra op\n");
+ tmp_link = rtw89_get_designated_link(tmp);
+ if (unlikely(!tmp_link))
continue;
- }
tmp_chan = rtw89_chan_get(rtwdev, tmp_link->chanctx_idx);
*ext = (struct rtw89_hw_scan_extra_op){
diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c
index ba71709a9bc9..315bb0d0759f 100644
--- a/drivers/net/wireless/realtek/rtw89/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
@@ -1438,9 +1438,9 @@ static void rtw89_ops_channel_switch_beacon(struct ieee80211_hw *hw,
BUILD_BUG_ON(RTW89_MLD_NON_STA_LINK_NUM != 1);
- rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
+ rtwvif_link = rtw89_get_designated_link(rtwvif);
if (unlikely(!rtwvif_link)) {
- rtw89_err(rtwdev, "chsw bcn: find no link on HW-0\n");
+ rtw89_err(rtwdev, "chsw bcn: find no designated link\n");
return;
}
--
2.25.1
next prev parent reply other threads:[~2026-01-23 1:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 1:39 [PATCH rtw-next 00/11] wifi: rtw89: update RFK command/report and REGD R73-R54 Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 01/11] wifi: rtw89: rfk: add firmware command to do TX IQK Ping-Ke Shih
2026-01-28 3:45 ` Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 02/11] wifi: rtw89: rfk: add to print debug log of " Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 03/11] wifi: rtw89: rfk: add firmware command to do CIM3K Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 04/11] wifi: rtw89: rfk: add to print debug log of CIM3K Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 05/11] wifi: rtw89: rfk: update RFK report format of IQK, DACK and TXGAPK Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 06/11] wifi: rtw89: fw: correct content of DACK H2C command Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 07/11] wifi: rtw89: phy: add PHY C2H event dummy handler for func 1-7 and 2-10 Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 08/11] wifi: rtw89: 8922a: configure FW version for SIM_SER_L0L1_BY_HALT_H2C Ping-Ke Shih
2026-01-23 1:39 ` Ping-Ke Shih [this message]
2026-01-23 1:39 ` [PATCH rtw-next 10/11] wifi: rtw89: pci: validate release report content before using for RTL8922DE Ping-Ke Shih
2026-01-23 1:39 ` [PATCH rtw-next 11/11] wifi: rtw89: regd: update regulatory map to R73-R54 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=20260123013957.16418-10-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-wireless@vger.kernel.org \
/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