001-08-v6.9-wifi-rtl8xxxu-don-t-parse-CFO-if-both-interfaces-are.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From f86dd8eaf8da84ee5b803d90b8c311d7e2725d0b Mon Sep 17 00:00:00 2001
  2. From: Martin Kaistra <[email protected]>
  3. Date: Fri, 22 Dec 2023 11:14:29 +0100
  4. Subject: [PATCH 08/21] wifi: rtl8xxxu: don't parse CFO, if both interfaces are
  5. connected in STA mode
  6. If both interfaces are in STATION mode and both are connected to an AP,
  7. there might be conflicting CFO values for the two connections. Ignore
  8. the CFO information in this case.
  9. Signed-off-by: Martin Kaistra <[email protected]>
  10. Reviewed-by: Ping-Ke Shih <[email protected]>
  11. Signed-off-by: Kalle Valo <[email protected]>
  12. Link: https://msgid.link/[email protected]
  13. ---
  14. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 ++++++++++
  15. 1 file changed, 10 insertions(+)
  16. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  17. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  18. @@ -5716,6 +5716,14 @@ static inline bool rtl8xxxu_is_packet_ma
  19. ether_addr_equal(priv->vifs[port_num]->bss_conf.bssid, hdr->addr2);
  20. }
  21. +static inline bool rtl8xxxu_is_sta_sta(struct rtl8xxxu_priv *priv)
  22. +{
  23. + return (priv->vifs[0] && priv->vifs[0]->cfg.assoc &&
  24. + priv->vifs[0]->type == NL80211_IFTYPE_STATION) &&
  25. + (priv->vifs[1] && priv->vifs[1]->cfg.assoc &&
  26. + priv->vifs[1]->type == NL80211_IFTYPE_STATION);
  27. +}
  28. +
  29. void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv,
  30. struct ieee80211_rx_status *rx_status,
  31. struct rtl8723au_phy_stats *phy_stats,
  32. @@ -5734,6 +5742,7 @@ void rtl8723au_rx_parse_phystats(struct
  33. bool parse_cfo = priv->fops->set_crystal_cap &&
  34. !crc_icv_err &&
  35. !ieee80211_is_ctl(hdr->frame_control) &&
  36. + !rtl8xxxu_is_sta_sta(priv) &&
  37. (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) ||
  38. rtl8xxxu_is_packet_match_bssid(priv, hdr, 1));
  39. @@ -5772,6 +5781,7 @@ static void jaguar2_rx_parse_phystats_ty
  40. bool parse_cfo = priv->fops->set_crystal_cap &&
  41. !crc_icv_err &&
  42. !ieee80211_is_ctl(hdr->frame_control) &&
  43. + !rtl8xxxu_is_sta_sta(priv) &&
  44. (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) ||
  45. rtl8xxxu_is_packet_match_bssid(priv, hdr, 1));
  46. u8 pwdb_max = 0;