From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <owen.hsiao@realtek.com>, <echuang@realtek.com>,
<henchy.chen@realtek.com>, <phhuang@realtek.com>,
<kevin_yang@realtek.com>
Subject: [PATCH rtw-next 14/14] wifi: rtw89: add p2p device declaration
Date: Wed, 26 Aug 2026 14:41:01 +0800 [thread overview]
Message-ID: <20260826064101.58892-15-pkshih@realtek.com> (raw)
In-Reply-To: <20260826064101.58892-1-pkshih@realtek.com>
From: Po-Hao Huang <phhuang@realtek.com>
Use separate interface for P2P operations. This is required for
concurrent operations under MLO, so that address conversion can be
applied to correct frames. The wpa_cli commands for P2P operations
should be changed to under p2p-dev-<interface> after this commit.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/core.c | 16 +++++++++++++++-
drivers/net/wireless/realtek/rtw89/core.h | 2 +-
drivers/net/wireless/realtek/rtw89/ps.c | 2 ++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 80c4877e2dab..572d9c65a2dd 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -176,6 +176,10 @@ static const struct ieee80211_iface_limit rtw89_iface_limits[] = {
BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_AP),
},
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
+ },
};
static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = {
@@ -188,6 +192,10 @@ static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = {
.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
BIT(NL80211_IFTYPE_P2P_GO),
},
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
+ },
};
static const struct ieee80211_iface_combination rtw89_iface_combs[] = {
@@ -5697,6 +5705,7 @@ void rtw89_vif_type_mapping(struct rtw89_vif_link *rtwvif_link, bool assoc)
else
rtwvif_link->wifi_role = RTW89_WIFI_ROLE_AP;
break;
+ RTW89_TYPE_MAPPING(P2P_DEVICE);
RTW89_TYPE_MAPPING(ADHOC);
RTW89_TYPE_MAPPING(MONITOR);
RTW89_TYPE_MAPPING(MESH_POINT);
@@ -5730,6 +5739,10 @@ void rtw89_vif_type_mapping(struct rtw89_vif_link *rtwvif_link, bool assoc)
rtwvif_link->self_role = RTW89_SELF_ROLE_CLIENT;
rtwvif_link->addr_cam.sec_ent_mode = RTW89_ADDR_CAM_SEC_NORMAL;
break;
+ case NL80211_IFTYPE_P2P_DEVICE:
+ rtwvif_link->net_type = RTW89_NET_TYPE_NO_LINK;
+ rtwvif_link->self_role = RTW89_SELF_ROLE_CLIENT;
+ break;
case NL80211_IFTYPE_MONITOR:
break;
default:
@@ -7523,7 +7536,8 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_P2P_CLIENT) |
- BIT(NL80211_IFTYPE_P2P_GO);
+ BIT(NL80211_IFTYPE_P2P_GO) |
+ BIT(NL80211_IFTYPE_P2P_DEVICE);
if (hal->ant_diversity) {
hw->wiphy->available_antennas_tx = 0x3;
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index a2f6e68987a9..83554a2c8732 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -6340,7 +6340,7 @@ enum rtw89_entity_mode {
RTW89_ENTITY_MODE_UNHANDLED = -ESRCH,
};
-#define RTW89_MAX_INTERFACE_NUM 2
+#define RTW89_MAX_INTERFACE_NUM 3
/* only valid when running with chanctx_ops */
struct rtw89_entity_mgnt {
diff --git a/drivers/net/wireless/realtek/rtw89/ps.c b/drivers/net/wireless/realtek/rtw89/ps.c
index 34105d030537..23a9c7a0704a 100644
--- a/drivers/net/wireless/realtek/rtw89/ps.c
+++ b/drivers/net/wireless/realtek/rtw89/ps.c
@@ -367,6 +367,8 @@ void rtw89_recalc_lps(struct rtw89_dev *rtwdev)
rtw89_for_each_rtwvif(rtwdev, rtwvif) {
vif = rtwvif_to_vif(rtwvif);
+ if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
+ continue;
if (vif->type != NL80211_IFTYPE_STATION) {
count = 0;
--
2.25.1
prev parent reply other threads:[~2026-08-26 6:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 6:40 [PATCH rtw-next 00/14] wifi: rtw89: update RTL8922D capabilities and settings, and enable P2P device Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 01/14] wifi: rtw89: 8922de: add low latency quirk for Valve device Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 02/14] wifi: rtw89: 8922d: disable VCORE for thermal protection by default Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 03/14] wifi: rtw89: allow two station interfaces in SCC Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 04/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v4 Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 05/14] wifi: rtw89: 8922d: set BB wrapper settings according to operating channel Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 06/14] wifi: rtw89: 8922d: move conditionally disabled TX shape to common flow Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 07/14] wifi: rtw89: 8922d: update BB wrapper RFSI ctrl to v5 Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 08/14] wifi: rtw89: 8922d: send RFE type to firmware Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 09/14] wifi: rtw89: 8922d: bypass RX IQK when scan Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 10/14] wifi: rtw89: 8922d: correct selection of CCK rate circuit Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 11/14] wifi: rtw89: chan: introduce helper and refine active list iteration Ping-Ke Shih
2026-08-26 6:40 ` [PATCH rtw-next 12/14] wifi: rtw89: regd: check only active vifs when recalculating 6 GHz power type Ping-Ke Shih
2026-08-26 6:41 ` [PATCH rtw-next 13/14] wifi: rtw89: skip tracking things when entity is paused Ping-Ke Shih
2026-08-26 6:41 ` Ping-Ke Shih [this message]
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=20260826064101.58892-15-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=echuang@realtek.com \
--cc=henchy.chen@realtek.com \
--cc=kevin_yang@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=owen.hsiao@realtek.com \
--cc=phhuang@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