From: Mehmet Fide Without RCR_APPEND_FCS the 8188e reports some MPDUs of an A-MPDU 4 bytes short, while their retries have the right length. With CCMP such a frame loses the last 4 bytes of its payload when mac80211 strips the MIC. An RTL8188EU station of an MT7921AU AP with WPA2 got the ARP reply of the AP 38 bytes long after 5 of 45 connections, and could not reach the AP. As an AP, with the AP mode patches for it applied, the RTL8188EU got the ARP requests of two MT7921AU stations short after 21 of 45 connections. Let the 8188e append the FCS, as the vendor driver does, and remove it from the length of each received frame. No ARP frame arrived short then, in 45 connections as a station and 45 as an AP. Fixes: 3dfb8e844fa3 ("wifi: rtl8xxxu: Support new chip RTL8188EU") Signed-off-by: Mehmet Fide --- drivers/net/wireless/realtek/rtl8xxxu/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c index e578b0aba0ac..afdcb80adfa0 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c @@ -4180,6 +4180,8 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw) val32 = RCR_ACCEPT_PHYS_MATCH | RCR_ACCEPT_MCAST | RCR_ACCEPT_BCAST | RCR_ACCEPT_MGMT_FRAME | RCR_HTC_LOC_CTRL | RCR_APPEND_PHYSTAT | RCR_APPEND_ICV | RCR_APPEND_MIC; + if (priv->rtl_chip == RTL8188E) + val32 |= RCR_APPEND_FCS; rtl8xxxu_write32(priv, REG_RCR, val32); priv->regrcr = val32; @@ -6577,6 +6579,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb) skb_pull(skb, drvinfo_sz + desc_shift); + if (priv->regrcr & RCR_APPEND_FCS) + pkt_len -= FCS_LEN; skb_trim(skb, pkt_len); hdr = (struct ieee80211_hdr *)skb->data; -- 2.56.0