2023-11-21 17:18:44

by Jay Sweat

[permalink] [raw]
Subject: Realtek 8822ce p2p support

Hello,
I am trying to enable miracast via gnome network displays, which requires p2p, on my arch linux device with a soldered realtek 8822ce adapter. As far as I can tell, then hardware supports p2p ( linux says so and miracast works in windows) but it is not enabled and/or implemented in the driver. I was just wondering if this was a feature that would be added or if I am just wasting my time.
Thanks!


2023-11-22 01:29:36

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Realtek 8822ce p2p support



> -----Original Message-----
> From: Jay Sweat <[email protected]>
> Sent: Wednesday, November 22, 2023 1:18 AM
> To: [email protected]
> Subject: Realtek 8822ce p2p support
>
> Hello,
> I am trying to enable miracast via gnome network displays, which requires p2p, on my arch linux device with
> a soldered realtek 8822ce adapter. As far as I can tell, then hardware supports p2p ( linux says so and
> miracast works in windows) but it is not enabled and/or implemented in the driver. I was just wondering
> if this was a feature that would be added or if I am just wasting my time.

8822ce can play as STA or AP role, so it is possible to support P2P basically.
Are you interested in this work?

Ping-Ke

2023-11-22 17:32:40

by Jay Sweat

[permalink] [raw]
Subject: Re: Realtek 8822ce p2p support

I am interesting, but Im not sure how much help I can be. I only have a basic knowledge of linux and next to no development skills.

2023-11-23 00:32:09

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Realtek 8822ce p2p support



> -----Original Message-----
> From: Jay Sweat <[email protected]>
> Sent: Thursday, November 23, 2023 1:32 AM
> To: Ping-Ke Shih <[email protected]>
> Cc: [email protected]
> Subject: Re: Realtek 8822ce p2p support
>
> I am interesting, but Im not sure how much help I can be. I only have a basic knowledge of linux and next
> to no development skills.

First step is to download Linux kernel source and build rtw88 driver or whole kernel.
Also, you need a user-space application called wpa_supplicant [1] to make P2P connection.

Declare P2P capability by below patch, and then see how it works and debug...

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 4a33d2e47f33..ad988d6b204b 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -110,7 +110,9 @@ static const struct ieee80211_iface_limit rtw_iface_limits[] = {
},
{
.max = 1,
- .types = BIT(NL80211_IFTYPE_AP),
+ .types = BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_P2P_CLIENT) |
+ BIT(NL80211_IFTYPE_P2P_GO);
}
};

@@ -2232,7 +2234,9 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_ADHOC) |
- BIT(NL80211_IFTYPE_MESH_POINT);
+ BIT(NL80211_IFTYPE_MESH_POINT) |
+ BIT(NL80211_IFTYPE_P2P_CLIENT) |
+ BIT(NL80211_IFTYPE_P2P_GO);
hw->wiphy->available_antennas_tx = hal->antenna_tx;
hw->wiphy->available_antennas_rx = hal->antenna_rx;


[1] https://w1.fi/cvs.html


2023-11-28 19:49:42

by Jay Sweat

[permalink] [raw]
Subject: Re: Realtek 8822ce p2p support

That seems to have worked. P2P is now listed under supported interface modes and gnome-network-displays works without issue. Havent noticed any other changes or any issues with P2P, but I only have the one app to test with.

2023-11-29 00:34:06

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Realtek 8822ce p2p support



> -----Original Message-----
> From: Jay Sweat <[email protected]>
> Sent: Wednesday, November 29, 2023 3:50 AM
> To: Ping-Ke Shih <[email protected]>
> Cc: [email protected]
> Subject: Re: Realtek 8822ce p2p support
>
> That seems to have worked. P2P is now listed under supported interface modes and gnome-network-displays
> works without issue. Havent noticed any other changes or any issues with P2P, but I only have the one app
> to test with.

Good to hear the news. More tests you can do are to make connection with
various devices, and try to play as GO and GC respectively. This can set
p2p_go_intent (0~15) in wpa_supplicant.conf to decide how a device
intents to be a GO. Then, use 'iw info' to check the role.

An advance test is to configure peer as concurrency that connects to an
AP, and the make another interface as P2P. A simple way is to take an
Android phone, and enter P2P connection setting page to make P2P connection
first, and then connect to an AP. The order of connection is important,
because different connected channels of P2P and AP make thing complicated,
and I suppose current code can't handle this case properly. Also, try
to be GO and GC in this scenario.

Ping-Ke


2024-05-17 14:33:41

by Giovanni Santini

[permalink] [raw]
Subject: RE: Realtek 8822ce p2p support

Hi everyone,

I would love to get P2P working on my laptop WiFi card.

How can I help this to progress?
I suppose the steps would be:

1. Make the mentioned diff as a patch file

2. Perform tests (need some inputs on them)

3. ??? Profit?

Let me know :)

Bests,

--
Giovanni Santini