RE: [PATCH rtw-next v5 1/2] wifi: rtw88: 8822c: filter hardware-handled control frames on SDIO
From: Ping-Ke Shih
Date: Tue Dec 01 2026 - 21:04:32 EST
Leonard Lausen <leonard@xxxxxxxxx> wrote:
> RTL8822C forwards every control-frame subtype to the host by default.
> ACK, Block Ack, RTS and CTS frames are handled by hardware, but forwarding
> them also adds small SDIO transfers to the data path.
>
> Clear these four subtypes from the normal SDIO RX filter, retaining BAR,
> PS-Poll and the remaining subtypes. Cache the current FIF_CONTROL request
> separately from that default, using the full requested flags even when
> changed_flags does not contain FIF_CONTROL.
>
> Use a shared writer in filter configuration, every chip initializer and
> both beamforming paths. This keeps the monitor override across IPS wake,
> MAC reinitialization and beamforming, while removing the request restores
> the current normal filter.
>
> Limit the reduced default to SDIO, where profiling identified this
> overhead. PCIe and USB receive paths have not been tested with it.
> FriendlyElec's RTL8822CS driver also filters control frames at startup;
> this change retains additional subtypes for mac80211.
>
> Link:
> https://github.com/friendlyarm/rtl8822cs/blob/c8b944a34bba2116fcdb060362bde40242bb87e5/hal/rtl8822
> c/rtl8822c_halinit.c
I don't think this should be a formal Link.
Just [1] + "the http link" followed by a blank line.
[...]
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> index 09315d23e2c40..8c4046cf65652 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> @@ -2096,7 +2096,17 @@ static int rtw8822c_mac_init(struct rtw_dev *rtwdev)
> rtw_write8(rtwdev, REG_WMAC_TRXPTCL_CTL_H + 2, WLAN_BAR_ACK_TYPE);
> rtw_write16(rtwdev, REG_RXFLTMAP0, WLAN_RX_FILTER0);
> rtwdev->hal.rxfltmap1 = WLAN_RX_FILTER1;
> - rtw_write16(rtwdev, REG_RXFLTMAP1, rtwdev->hal.rxfltmap1);
> + if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO) {
Recently, I saw many people are interested in monitor mode (plus injection).
Will it be a problem to miss receive somethings?
> + /*
> + * Do not forward these control frames to mac80211; retain BAR
> + * and PS-Poll. The common writer preserves FIF_CONTROL requests.
> + */
> + rtwdev->hal.rxfltmap1 &= ~(BIT_RXFLTMAP1_ACK |
> + BIT_RXFLTMAP1_CTS |
> + BIT_RXFLTMAP1_RTS |
> + BIT_RXFLTMAP1_BACK);
> + }
> + rtw_update_rx_filter(rtwdev);
> rtw_write16(rtwdev, REG_RXFLTMAP2, WLAN_RX_FILTER2);
> rtw_write32(rtwdev, REG_RCR, WLAN_RCR_CFG);
> rtw_write8(rtwdev, REG_RX_PKT_LIMIT, WLAN_RXPKT_MAX_SZ_512);