Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
@ 2026-03-12 14:21 Georg Müller
  2026-03-12 14:29 ` Georg Müller
  2026-03-12 15:58 ` Bitterblue Smith
  0 siblings, 2 replies; 10+ messages in thread
From: Georg Müller @ 2026-03-12 14:21 UTC (permalink / raw)
  To: Jes.Sorensen; +Cc: linux-wireless, linux-kernel, Georg Müller

Allow devices with this driver to be used as a wireless access point.

I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.

Experiments two years ago failed, but some other improvements to the
driver seemed to have resolved theses issues.

The max_macid_num is conservative. The old driver used 32 [1], some
other sources said 64. I have not enough adapters to test any of the
higher values. Given the usage of this chipset in nano dongles, I think
the 16 might be high enough.

Signed-off-by: Georg Müller <georgmueller@gmx.net>
---
 drivers/net/wireless/realtek/rtl8xxxu/8188e.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
index 766a7a7c7d28..c6aecb28d28b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
@@ -1867,6 +1867,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops = {
 	.init_reg_pkt_life_time = 1,
 	.gen2_thermal_meter = 1,
 	.max_sec_cam_num = 32,
+	.supports_ap = 1,
+	.max_macid_num = 16,
 	.adda_1t_init = 0x0b1b25a0,
 	.adda_1t_path_on = 0x0bdb25a0,
 	/*
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 14:21 Georg Müller
@ 2026-03-12 14:29 ` Georg Müller
  2026-03-12 15:58 ` Bitterblue Smith
  1 sibling, 0 replies; 10+ messages in thread
From: Georg Müller @ 2026-03-12 14:29 UTC (permalink / raw)
  To: Jes.Sorensen; +Cc: linux-wireless, linux-kernel

Sorry, I missed the link:

Am 12.03.26 um 15:21 schrieb Georg Müller:
> The max_macid_num is conservative. The old driver used 32 [1], some
> other sources said 64. I have not enough adapters to test any of the
> higher values. Given the usage of this chipset in nano dongles, I think
> the 16 might be high enough.
> 

[1] https://github.com/lwfinger/rtl8188eu/blob/f5d1c8df2e2d8b217ea0113bf2cf3e37df8cb716/include/sta_info.h#L28

Link for max_macid_num = 64:
https://lore.kernel.org/linux-wireless/27e83382-4c84-1841-c428-d1e5143ea20c@gmail.com/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 14:21 Georg Müller
  2026-03-12 14:29 ` Georg Müller
@ 2026-03-12 15:58 ` Bitterblue Smith
  2026-03-12 16:08   ` Georg Müller
  1 sibling, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2026-03-12 15:58 UTC (permalink / raw)
  To: Georg Müller, Jes.Sorensen; +Cc: linux-wireless, linux-kernel

On 12/03/2026 16:21, Georg Müller wrote:
> Allow devices with this driver to be used as a wireless access point.
> 
> I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.
> 
> Experiments two years ago failed, but some other improvements to the
> driver seemed to have resolved theses issues.
> 

The rate control code still doesn't handle more than one station.
It's not going to work right.

It shouldn't be too complicated. The ra_info member of rtl8xxxu_priv
needs to become an array.

> The max_macid_num is conservative. The old driver used 32 [1], some
> other sources said 64. I have not enough adapters to test any of the
> higher values. Given the usage of this chipset in nano dongles, I think
> the 16 might be high enough.
> 
> Signed-off-by: Georg Müller <georgmueller@gmx.net>
> ---
>  drivers/net/wireless/realtek/rtl8xxxu/8188e.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
> index 766a7a7c7d28..c6aecb28d28b 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
> @@ -1867,6 +1867,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops = {
>  	.init_reg_pkt_life_time = 1,
>  	.gen2_thermal_meter = 1,
>  	.max_sec_cam_num = 32,
> +	.supports_ap = 1,
> +	.max_macid_num = 16,
>  	.adda_1t_init = 0x0b1b25a0,
>  	.adda_1t_path_on = 0x0bdb25a0,
>  	/*


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 15:58 ` Bitterblue Smith
@ 2026-03-12 16:08   ` Georg Müller
  2026-03-12 17:06     ` Bitterblue Smith
  0 siblings, 1 reply; 10+ messages in thread
From: Georg Müller @ 2026-03-12 16:08 UTC (permalink / raw)
  To: Bitterblue Smith, Jes.Sorensen; +Cc: linux-wireless, linux-kernel


Am 12.03.26 um 16:58 schrieb Bitterblue Smith:
> On 12/03/2026 16:21, Georg Müller wrote:
>> Allow devices with this driver to be used as a wireless access point.
>>
>> I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.
>>
>> Experiments two years ago failed, but some other improvements to the
>> driver seemed to have resolved theses issues.
>>
> 
> The rate control code still doesn't handle more than one station.
> It's not going to work right.
> 
> It shouldn't be too complicated. The ra_info member of rtl8xxxu_priv
> needs to become an array.

Ok, I have only tested it with one client in my setup.

So the ra_info array needs to of size max_macid_num?
Dynamically allocated or hard-coded in struct rtl8xxxu_priv (8188e seems
to be the only user of struct rtl8xxxu_ra_info)?

Best regards,
Georg


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 16:08   ` Georg Müller
@ 2026-03-12 17:06     ` Bitterblue Smith
  2026-03-12 22:20       ` Bitterblue Smith
  0 siblings, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2026-03-12 17:06 UTC (permalink / raw)
  To: Georg Müller, Jes.Sorensen; +Cc: linux-wireless, linux-kernel

On 12/03/2026 18:08, Georg Müller wrote:
> 
> Am 12.03.26 um 16:58 schrieb Bitterblue Smith:
>> On 12/03/2026 16:21, Georg Müller wrote:
>>> Allow devices with this driver to be used as a wireless access point.
>>>
>>> I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.
>>>
>>> Experiments two years ago failed, but some other improvements to the
>>> driver seemed to have resolved theses issues.
>>>
>>
>> The rate control code still doesn't handle more than one station.
>> It's not going to work right.
>>
>> It shouldn't be too complicated. The ra_info member of rtl8xxxu_priv
>> needs to become an array.
> 
> Ok, I have only tested it with one client in my setup.
> 
> So the ra_info array needs to of size max_macid_num?
> Dynamically allocated or hard-coded in struct rtl8xxxu_priv (8188e seems
> to be the only user of struct rtl8xxxu_ra_info)?
> 

Yes. :)

Also, if I remember correctly, there was a member of rtl8xxxu_ra_info
that needs to be moved to rtl8xxxu_priv, because it's a global thing,
not per macid.

> Best regards,
> Georg
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 17:06     ` Bitterblue Smith
@ 2026-03-12 22:20       ` Bitterblue Smith
  2026-03-12 23:52         ` Georg Müller
  0 siblings, 1 reply; 10+ messages in thread
From: Bitterblue Smith @ 2026-03-12 22:20 UTC (permalink / raw)
  To: Georg Müller, Jes.Sorensen; +Cc: linux-wireless, linux-kernel

On 12/03/2026 19:06, Bitterblue Smith wrote:
> On 12/03/2026 18:08, Georg Müller wrote:
>>
>> Am 12.03.26 um 16:58 schrieb Bitterblue Smith:
>>> On 12/03/2026 16:21, Georg Müller wrote:
>>>> Allow devices with this driver to be used as a wireless access point.
>>>>
>>>> I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.
>>>>
>>>> Experiments two years ago failed, but some other improvements to the
>>>> driver seemed to have resolved theses issues.
>>>>
>>>
>>> The rate control code still doesn't handle more than one station.
>>> It's not going to work right.
>>>
>>> It shouldn't be too complicated. The ra_info member of rtl8xxxu_priv
>>> needs to become an array.
>>
>> Ok, I have only tested it with one client in my setup.
>>
>> So the ra_info array needs to of size max_macid_num?
>> Dynamically allocated or hard-coded in struct rtl8xxxu_priv (8188e seems
>> to be the only user of struct rtl8xxxu_ra_info)?
>>
> 
> Yes. :)
> 
> Also, if I remember correctly, there was a member of rtl8xxxu_ra_info
> that needs to be moved to rtl8xxxu_priv, because it's a global thing,
> not per macid.
> 

Ah, we talked about it before:
https://lore.kernel.org/linux-wireless/938ae608-a865-4056-06de-c230d74e1847@gmail.com/

>> Best regards,
>> Georg
>>
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-03-12 22:20       ` Bitterblue Smith
@ 2026-03-12 23:52         ` Georg Müller
  0 siblings, 0 replies; 10+ messages in thread
From: Georg Müller @ 2026-03-12 23:52 UTC (permalink / raw)
  To: Bitterblue Smith, Jes.Sorensen; +Cc: linux-wireless, linux-kernel


Am 12.03.26 um 23:20 schrieb Bitterblue Smith:
> On 12/03/2026 19:06, Bitterblue Smith wrote:
>> On 12/03/2026 18:08, Georg Müller wrote:
>>>
>>> Am 12.03.26 um 16:58 schrieb Bitterblue Smith:
>>>> On 12/03/2026 16:21, Georg Müller wrote:
>>>>> Allow devices with this driver to be used as a wireless access point.
>>>>>
>>>>> I successfully tested this with a TP-Link TP-Link TL-WN725N adapter.
>>>>>
>>>>> Experiments two years ago failed, but some other improvements to the
>>>>> driver seemed to have resolved theses issues.
>>>>>
>>>>
>>>> The rate control code still doesn't handle more than one station.
>>>> It's not going to work right.
>>>>
>>>> It shouldn't be too complicated. The ra_info member of rtl8xxxu_priv
>>>> needs to become an array.
>>>
>>> Ok, I have only tested it with one client in my setup.
>>>
>>> So the ra_info array needs to of size max_macid_num?
>>> Dynamically allocated or hard-coded in struct rtl8xxxu_priv (8188e seems
>>> to be the only user of struct rtl8xxxu_ra_info)?
>>>
>>
>> Yes. :)
>>
>> Also, if I remember correctly, there was a member of rtl8xxxu_ra_info
>> that needs to be moved to rtl8xxxu_priv, because it's a global thing,
>> not per macid.
>>
> 
> Ah, we talked about it before:
> https://lore.kernel.org/linux-wireless/938ae608-a865-4056-06de-c230d74e1847@gmail.com/

Oh, yes, I didn't remember all the details from then and only checked an earlier response.

I will try to integrate the suggestions into the RFC patch and will send a v2.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
@ 2026-10-30  7:35 hi
  2026-11-01  4:10 ` Ping-Ke Shih
  0 siblings, 1 reply; 10+ messages in thread
From: hi @ 2026-10-30  7:35 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-wireless, Ping-Ke Shih

From 0a3cdd4c6cc416804e49c935516a22e854a87483 Mon Sep 17 00:00:00 2001
From: Shreyansh Khajanchi <hi@shreyan.sh>
Date: Fri, 30 Oct 2026 12:34:44 +0530
Subject: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU

The RTL8188EU shares the AP mode implementation in core.c with the
other chips supported by this driver, so advertising
NL80211_IFTYPE_AP is enough to make it usable as an access point.

Set max_macid_num to 32 as well, so that max_ap_assoc_sta is
initialised. The vendor driver defines NUM_STA as 32, and starts
station MAC IDs at 2 because 0 and 1 are reserved for
broadcast/multicast. This matches RTL8192CU, which also sets
max_macid_num to 32.

Tested with an RTL8188EUS (0bda:8179) on a Raspberry Pi Zero running
6.12 (armv6): hostapd serves a 2.4 GHz WPA2 network, clients associate
and pass traffic.

Signed-off-by: Shreyansh Khajanchi <hi@shreyan.sh>
---
 drivers/net/wireless/realtek/rtl8xxxu/8188e.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
index fea5aec..0c3ab32 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/8188e.c
@@ -1867,6 +1867,8 @@ struct rtl8xxxu_fileops rtl8188eu_fops = {
 	.init_reg_pkt_life_time = 1,
 	.gen2_thermal_meter = 1,
 	.hw_feature_report = 0,
+	.supports_ap = 1,
+	.max_macid_num = 32,
 	.max_sec_cam_num = 32,
 	.adda_1t_init = 0x0b1b25a0,
 	.adda_1t_path_on = 0x0bdb25a0,
-- 
2.56.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-10-30  7:35 [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU hi
@ 2026-11-01  4:10 ` Ping-Ke Shih
  2026-11-26  5:21   ` Mehmet Fide
  0 siblings, 1 reply; 10+ messages in thread
From: Ping-Ke Shih @ 2026-11-01  4:10 UTC (permalink / raw)
  To: hi@shreyan.sh, Jes Sorensen; +Cc: linux-wireless@vger.kernel.org

hi@shreyan.sh <hi@shreyan.sh> wrote:
> From 0a3cdd4c6cc416804e49c935516a22e854a87483 Mon Sep 17 00:00:00 2001
> From: Shreyansh Khajanchi <hi@shreyan.sh>
> Date: Fri, 30 Oct 2026 12:34:44 +0530
> Subject: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
> 
> The RTL8188EU shares the AP mode implementation in core.c with the
> other chips supported by this driver, so advertising
> NL80211_IFTYPE_AP is enough to make it usable as an access point.
> 
> Set max_macid_num to 32 as well, so that max_ap_assoc_sta is
> initialised. The vendor driver defines NUM_STA as 32, and starts
> station MAC IDs at 2 because 0 and 1 are reserved for
> broadcast/multicast. This matches RTL8192CU, which also sets
> max_macid_num to 32.

Do you have a sniffer to have air capture to check beacon?

If so, please check TIM for unicast packets if station goes
sleepy, and TIM for broadcast/multicast packets (for example,
send a broadcast ARP by ping a non-existing IP).

> 
> Tested with an RTL8188EUS (0bda:8179) on a Raspberry Pi Zero running
> 6.12 (armv6): hostapd serves a 2.4 GHz WPA2 network, clients associate
> and pass traffic.
> 
> Signed-off-by: Shreyansh Khajanchi <hi@shreyan.sh>

I give my reviewed-by, but still want test results of TIM.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU
  2026-11-01  4:10 ` Ping-Ke Shih
@ 2026-11-26  5:21   ` Mehmet Fide
  0 siblings, 0 replies; 10+ messages in thread
From: Mehmet Fide @ 2026-11-26  5:21 UTC (permalink / raw)
  To: Shreyansh Khajanchi
  Cc: Ping-Ke Shih, Jes Sorensen, Georg Müller, Bitterblue Smith,
	linux-wireless, mehmet.fide

Hi Shreyansh, Ping-Ke,

Here are the air captures and TIM results Ping-Ke asked for. Georg's
RFC [1] enables AP mode on the same chip; the beacon problem below is
the same with both.

Setup: rtw-next 18d0bedbb5f0 plus this patch, Edimax EW-7811Un V2
(RTL8188EUS) as AP, hostapd on channel 6, beacon_int 100,
dtim_period 2, open and WPA2. The client is an RTL8822CE (rtw88) with
power save on; it dozes (PM=1, and mac80211 on the AP marks it PS_STA
and buffers frames for it). Two MT7921AU sniffers capture the air and
agree on the beacon contents. Received packets are counted with
tcpdump on the client. In each run the AP pings the client 20 times,
then sends 20 UDP broadcasts, one per second. Reference AP with the
same client: ath9k_htc.

Beacons, this patch alone (4 runs): 4 to 8 beacons in 20 s instead of
about 195. The client never dozes, so TIM cannot be checked. Georg's
RFC sends one beacon after hostapd starts and then none. With two
changes from [1] (REG_MBID_NUM |= BIT(3) | BIT(4) in AP mode, as the
vendor driver does, and the vendor TBTT hold time) there is a beacon
at every TBTT. The TIM results below are with these two changes,
16 runs.

What works:
- Association and traffic, open and WPA2.
- Unicast TIM: the client's AID is set while mac80211 has frames
  buffered for it.

What does not work:
- The DTIM count does not count down. mac80211 counts it down once per
  ieee80211_beacon_get(), and the hardware repeats the uploaded
  beacon, so the count stays at one value until the next upload.
  ath9k_htc sends 1, 0, 1, 0.
- The multicast bit is never set, and broadcast frames go out when
  they are queued, not after a DTIM beacon. rtl8xxxu does not set
  HOST_BROADCAST_PS_BUFFERING, so mac80211 does not buffer them.
  ath9k_htc sets the bit in the DTIM beacons and sends the broadcasts
  after them.

What works with problems:
- Unicast delivery to the dozing client depends on how many beacons
  happen to carry DTIM count 0. In 3 runs only 2 of 200, 2 of 217 and
  3 of 213 did, and none of the 20 pings reached the client although
  its AID was set in almost every beacon. In runs with 40 % or more
  such beacons, 12 to 20 pings arrived. With ath9k_htc every run
  delivered 20 of 20.
- "rtl8xxxu_send_beacon_frame: Failed to read beacon valid bit"
  appeared in 11 of these 16 runs.
- Frames sent to the 8188e are often not acked (62-73 % carry the
  retry bit), in station mode as well. Details are in [1].

[1] https://lore.kernel.org/linux-wireless/20261125160616.1201001-1-mehmet.fide@gmail.com/

Best regards,
Mehmet

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-26  5:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  7:35 [PATCH] wifi: rtl8xxxu: Enable AP mode for RTL8188EU hi
2026-11-01  4:10 ` Ping-Ke Shih
2026-11-26  5:21   ` Mehmet Fide
  -- strict thread matches above, loose matches on Subject: below --
2026-03-12 14:21 Georg Müller
2026-03-12 14:29 ` Georg Müller
2026-03-12 15:58 ` Bitterblue Smith
2026-03-12 16:08   ` Georg Müller
2026-03-12 17:06     ` Bitterblue Smith
2026-03-12 22:20       ` Bitterblue Smith
2026-03-12 23:52         ` Georg Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox