Commit f86dd8ea authored by Martin Kaistra's avatar Martin Kaistra Committed by Kalle Valo

wifi: rtl8xxxu: don't parse CFO, if both interfaces are connected in STA mode

If both interfaces are in STATION mode and both are connected to an AP,
there might be conflicting CFO values for the two connections. Ignore
the CFO information in this case.
Signed-off-by: default avatarMartin Kaistra <martin.kaistra@linutronix.de>
Reviewed-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231222101442.626837-9-martin.kaistra@linutronix.de
parent 80fd8687
...@@ -5716,6 +5716,14 @@ static inline bool rtl8xxxu_is_packet_match_bssid(struct rtl8xxxu_priv *priv, ...@@ -5716,6 +5716,14 @@ static inline bool rtl8xxxu_is_packet_match_bssid(struct rtl8xxxu_priv *priv,
ether_addr_equal(priv->vifs[port_num]->bss_conf.bssid, hdr->addr2); ether_addr_equal(priv->vifs[port_num]->bss_conf.bssid, hdr->addr2);
} }
static inline bool rtl8xxxu_is_sta_sta(struct rtl8xxxu_priv *priv)
{
return (priv->vifs[0] && priv->vifs[0]->cfg.assoc &&
priv->vifs[0]->type == NL80211_IFTYPE_STATION) &&
(priv->vifs[1] && priv->vifs[1]->cfg.assoc &&
priv->vifs[1]->type == NL80211_IFTYPE_STATION);
}
void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv, void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
struct rtl8723au_phy_stats *phy_stats, struct rtl8723au_phy_stats *phy_stats,
...@@ -5734,6 +5742,7 @@ void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv, ...@@ -5734,6 +5742,7 @@ void rtl8723au_rx_parse_phystats(struct rtl8xxxu_priv *priv,
bool parse_cfo = priv->fops->set_crystal_cap && bool parse_cfo = priv->fops->set_crystal_cap &&
!crc_icv_err && !crc_icv_err &&
!ieee80211_is_ctl(hdr->frame_control) && !ieee80211_is_ctl(hdr->frame_control) &&
!rtl8xxxu_is_sta_sta(priv) &&
(rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) || (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) ||
rtl8xxxu_is_packet_match_bssid(priv, hdr, 1)); rtl8xxxu_is_packet_match_bssid(priv, hdr, 1));
...@@ -5772,6 +5781,7 @@ static void jaguar2_rx_parse_phystats_type1(struct rtl8xxxu_priv *priv, ...@@ -5772,6 +5781,7 @@ static void jaguar2_rx_parse_phystats_type1(struct rtl8xxxu_priv *priv,
bool parse_cfo = priv->fops->set_crystal_cap && bool parse_cfo = priv->fops->set_crystal_cap &&
!crc_icv_err && !crc_icv_err &&
!ieee80211_is_ctl(hdr->frame_control) && !ieee80211_is_ctl(hdr->frame_control) &&
!rtl8xxxu_is_sta_sta(priv) &&
(rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) || (rtl8xxxu_is_packet_match_bssid(priv, hdr, 0) ||
rtl8xxxu_is_packet_match_bssid(priv, hdr, 1)); rtl8xxxu_is_packet_match_bssid(priv, hdr, 1));
u8 pwdb_max = 0; u8 pwdb_max = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment