RE: [PATCH v4 2/7] wifi: rtw88: rx: mark zero length packets on RTL8723BS

Ping-Ke Shih <[email protected]>
Newsgroups org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
[email protected] <[email protected]> wrote:
> From: Luka Gejak <[email protected]>
> 
> Like the RTL8703B, the RTL8723BS reports receive descriptors with a zero
> packet length, which the vendor driver drops outright. rtw88 already
> flags these as having no PSDU for the RTL8703B, so extend the same
> handling rather than passing an empty frame up.
> 
> This is gated on the SDIO interface rather than the chip id, because it
> has only been observed there; the USB variant is not known to do it.
> 
> Co-developed-by: Michael Straube <[email protected]>
> Signed-off-by: Michael Straube <[email protected]>
> Signed-off-by: Luka Gejak <[email protected]>
> ---
>  drivers/net/wireless/realtek/rtw88/rx.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
> index 01fd299abb7f..a9361ef4b93c 100644
> --- a/drivers/net/wireless/realtek/rtw88/rx.c
> +++ b/drivers/net/wireless/realtek/rtw88/rx.c
> @@ -253,10 +253,12 @@ static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev,
> 
>         rtw_rx_addr_match(rtwdev, pkt_stat, hdr);
> 
> -       /* Rtl8723cs driver checks for size < 14 or size > 8192 and
> -        * simply drops the packet.
> +       /*
> +        * Rtl8723cs and rtl8723bs drivers check for size < 14 or size > 8192
> +        * and simply drop the packet.
>          */
> -       if (rtwdev->chip->id == RTW_CHIP_TYPE_8703B && pkt_stat->pkt_len == 0) {
> +       if ((rtwdev->chip->id == RTW_CHIP_TYPE_8703B || rtw_is_8723bs(rtwdev)) &&
> +           pkt_stat->pkt_len == 0) {

I think we can evaluate ` pkt_stat->pkt_len == 0` first, because it is an
unlikely case and we can save a little time.

>                 rx_status->flag |= RX_FLAG_NO_PSDU;
>                 rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet");
>         }
> --
> 2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.