Re: Driver for rtw8723ds

Martin Blumenstingl
2023-05-15T21:11:27Z

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

Hi Jernej,

On Mon, May 15, 2023 at 10:37 PM Jernej Škrabec
<jernej.skrabec@gmail.com> wrote:
[...]
> > With aggregation disabled, we still get "Invalid RX packet size!" messages. I am
> > changing the statement to log (curr_pkt_len + pkt_desc_sz) > rx_len. I will let
> > you know when the OP responds.
>
> Yeah, I saw. I just find another possible reason, which fits nicely in current
> situation. Vendor driver parses drv_info_sz and shift fields only if packet
> is normal, e.g. not c2h type. However, rtw88 always parses those fields. It's
> possible that they have some value which should be ignored on 8723ds. I
> appended another patch to test.
I tried that patch and it didn't work for me (I can't get the card to
assoc to my AP with that patch).
Additionally I tried a simplified version (attached) and it didn't work.

I'm out of time for today though so I cannot continue testing.

Best regards,
Martin

[-- Attachment #2: sdio-check-is-c2h.diff --]
[-- Type: text/x-patch, Size: 709 bytes --]

diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
index 06fce7c3adda..f96e98818184 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -961,8 +961,10 @@ static void rtw_sdio_rxfifo_recv(struct rtw_dev *rtwdev, u32 rx_len)
rx_desc = skb->data;
chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat,
&rx_status);
- pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz +
- pkt_stat.shift;
+
+ pkt_offset = pkt_desc_sz;
+ if (!pkt_stat.is_c2h)
+ pkt_offset += pkt_stat.drv_info_sz + pkt_stat.shift;

curr_pkt_len = ALIGN(pkt_offset + pkt_stat.pkt_len,
RTW_SDIO_DATA_PTR_ALIGN);