From: Mehmet Fide <mehmet.fide@gmail.com>
To: "Georg Müller" <georgmueller@gmx.net>
Cc: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
Jes Sorensen <Jes.Sorensen@gmail.com>,
Ping-Ke Shih <pkshih@realtek.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
mehmet.fide@screeningeagle.com
Subject: Re: [RFC PATCH v3 0/4] wifi: rtl8xxxu: implement AP mode for 8188EU
Date: Wed, 25 Nov 2026 17:06:16 +0100 [thread overview]
Message-ID: <20261125160616.1201001-1-mehmet.fide@gmail.com> (raw)
In-Reply-To: <4161102f-dcdc-4780-9bf5-26961a1360c8@gmx.net>
Hi Georg, Bitterblue,
I tested v3 on rtw-next (18d0bedbb5f0, context fixes in patches 2 and 4
only) with an Edimax EW-7811Un V2 (RTL8188EUS rev D) as AP and a
separate sniffer. I found three problems in the AP part, plus an older
one that explains the duplicate pings.
1. Beacons. After hostapd starts, the 8188e sends one beacon and then
none. Probe responses go out, so clients still find the AP by active
scanning, but association takes about 6 s and a passive scan sees
nothing. BCN_VALID is set and the beacon function is enabled; the
hardware clears the beacon queue after the first beacon. In AP mode the
vendor driver (hw_var_set_opmode()) sets BIT(3) | BIT(4) in
REG_MBID_NUM, commented "If set 0, hw will clr bcnq when tx becon
ok/fail". With that there is a beacon at every TBTT and association
takes 0.5 s.
2. TBTT hold time. rtl8xxxu_start_tx_beacon() writes 0x80 to
REG_TBTT_PROHIBIT + 1 and clears bit 0 of + 2; the vendor
ResumeTxBeacon() writes 0xff and sets bit 0. On channel 6 with several
neighbour APs, 7 runs of about 120 TBTTs each: 2-5 % of the beacons
missing (one run 42 %) with the rtl8xxxu value; with the vendor value
0 % in 5 runs and 1-3 % in 2.
3. macid in the TX descriptor, which Bitterblue pointed out:
rtl8xxxu_fill_txdesc_v3() still does not set it; the vendor driver puts
mac_id & 0x3f into txdw1. The same function also indexes
priv->ra_info[macid] now, but for group addressed frames with a key,
rtl8xxxu_tx() replaces macid with the security CAM index, which can go
past the 16 entries of ra_info.
This is what I use on top of v3 for 1-3:
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
index 49c167fd6ee4..9a297b077443 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
@@ -1154,6 +1154,14 @@ static void rtl8xxxu_start_tx_beacon(struct rtl8xxxu_priv *priv)
val8 |= EN_BCNQ_DL >> 16;
rtl8xxxu_write8(priv, REG_FWHW_TXQ_CTRL + 2, val8);
+ if (priv->rtl_chip == RTL8188E) {
+ rtl8xxxu_write8(priv, REG_TBTT_PROHIBIT + 1, 0xff);
+ val8 = rtl8xxxu_read8(priv, REG_TBTT_PROHIBIT + 2);
+ val8 |= BIT(0);
+ rtl8xxxu_write8(priv, REG_TBTT_PROHIBIT + 2, val8);
+ return;
+ }
+
rtl8xxxu_write8(priv, REG_TBTT_PROHIBIT + 1, 0x80);
val8 = rtl8xxxu_read8(priv, REG_TBTT_PROHIBIT + 2);
val8 &= 0xF0;
@@ -5572,7 +5580,7 @@ rtl8xxxu_fill_txdesc_v3(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
{
struct rtl8xxxu_priv *priv = hw->priv;
struct device *dev = &priv->udev->dev;
- struct rtl8xxxu_ra_info *ra = &priv->ra_info[macid];
+ struct rtl8xxxu_ra_info *ra;
u8 *qc = ieee80211_get_qos_ctl(hdr);
u8 tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
u32 rate = 0;
@@ -5580,6 +5588,10 @@ rtl8xxxu_fill_txdesc_v3(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+ /* macid is the security CAM index for group addressed frames */
+ ra = &priv->ra_info[macid < RTL8188E_MAX_MAC_ID_NUM ? macid : 0];
+ tx_desc->txdw1 |= cpu_to_le32(macid & 0x3f);
+
if (ieee80211_is_data(hdr->frame_control)) {
rate = ra->decision_rate;
tx_desc->txdw5 = cpu_to_le32(rate);
@@ -7002,6 +7014,13 @@ static int rtl8xxxu_add_interface(struct ieee80211_hw *hw,
rtl8xxxu_write16(priv, REG_TSFTR_SYN_OFFSET, 0x7fff); /* ~32ms */
rtl8xxxu_write8(priv, REG_DUAL_TSF_RST, DUAL_TSF_RESET_TSF0);
+ /* The 8188e clears the beacon queue after each beacon unless told not to */
+ if (priv->rtl_chip == RTL8188E) {
+ val8 = rtl8xxxu_read8(priv, REG_MBID_NUM);
+ val8 |= BIT(3) | BIT(4);
+ rtl8xxxu_write8(priv, REG_MBID_NUM, val8);
+ }
+
/* enable BCN0 function */
rtl8xxxu_write8(priv, REG_BEACON_CTRL,
BEACON_DISABLE_TSF_UPDATE |
With these, beacon loss is 0.5-3.4 % at the sniffer and association
takes 0.5 s.
4. Duplicate pings. I can reproduce them with two clients, on one of
the two and in both directions, and not with one client. The captures
show the client sending the same MSDU again with a new sequence number
after its retry limit, because many of its frames are not acked: 62-73 %
of the frames sent to the 8188e carry the retry bit.
This is not AP specific. With the 8188e as a station of an rtw88 AP,
same dongle, place and traffic, 63 % of the frames to the 8188e are
retries with rtl8xxxu and 0 % with Realtek's v5.3.9 driver
(aircrack-ng/rtl8188eus with kernel API fixes only, on a non-RT kernel;
it crashes on PREEMPT_RT). I dumped the registers of both
drivers while associated and wrote the vendor values into rtl8xxxu one
group at a time. The difference is REG_OFDM0_XA_AGC_CORE1:
rtl8xxxu_start() sets the IGI to 0x1e (see c8bc37602779 ("wifi:
rtl8xxxu: Simplify setting the initial gain")) and nothing changes it
later, while the vendor driver had 0x40 in that test. With IGI 0x40 alone the
retries drop to 1 %.
A fixed value does not solve it, though. In AP mode with the two
clients at -44 and -52 dBm, IGI 0x40 removes the duplicates but loses
35-65 % of the pings. The 8188e seems to need the vendor's dynamic
initial gain (IGI from the lowest station RSSI and the false alarm
count). Bitterblue, is there a reason rtl8xxxu has no DIG, or would a
simple one for the 8188e be acceptable?
Georg, do you plan a v4? I can send 1-3 as patches on top of your
series, or include them in a v4 with your patches if you prefer.
Best regards,
Mehmet
next prev parent reply other threads:[~2026-11-25 16:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 13:53 Georg Müller
2026-03-13 13:53 ` [RFC PATCH v3 1/4] wifi: rtl8xxxu: move dynamic_tx_rpt_timing_counter from ra_info to priv Georg Müller
2026-03-16 6:17 ` Ping-Ke Shih
2026-03-16 9:30 ` Georg Müller
2026-03-17 2:52 ` Ping-Ke Shih
2026-03-13 13:53 ` [RFC PATCH v3 2/4] wifi: rtl8xxxu: handle rate control for 8188e a per mac_id Georg Müller
2026-03-16 6:35 ` Ping-Ke Shih
2026-03-16 9:41 ` Georg Müller
2026-03-13 13:53 ` [RFC PATCH v3 3/4] wifi: rtl8xxxu: update max report mac id on station add / remove for 8188e chips Georg Müller
2026-03-16 7:07 ` Ping-Ke Shih
2026-03-13 13:53 ` [RFC PATCH v3 4/4] wifi: rtl8xxxu: Enable AP mode for RTL8188EU Georg Müller
2026-03-13 23:14 ` [RFC PATCH v3 0/4] wifi: rtl8xxxu: implement AP mode for 8188EU Bitterblue Smith
2026-03-27 13:58 ` Georg Müller
2026-11-25 16:06 ` Mehmet Fide [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-03-13 13:18 [RFC PATCH v2 " Georg Müller
2026-07-17 8:02 ` [RFC PATCH v3 " Mehmet Fide
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=20261125160616.1201001-1-mehmet.fide@gmail.com \
--to=mehmet.fide@gmail.com \
--cc=Jes.Sorensen@gmail.com \
--cc=georgmueller@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mehmet.fide@screeningeagle.com \
--cc=pkshih@realtek.com \
--cc=rtl8821cerfe2@gmail.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®