Remove ieee80211_rx_beacon_freq_valid() and replace it with the same freq offset aware comparison used elsewhere, since we now expect the 1MHz primary to be reported at all times. Signed-off-by: Lachlan Hodges --- net/mac80211/mlme.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6ec45a9f7221..f9ede2d80523 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8095,38 +8095,6 @@ static bool ieee80211_mgd_ssid_mismatch(struct ieee80211_sub_if_data *sdata, return memcmp(elems->ssid, cfg->ssid, cfg->ssid_len); } -static bool -ieee80211_rx_beacon_freq_valid(struct ieee80211_local *local, - struct ieee80211_mgmt *mgmt, - struct ieee80211_rx_status *rx_status, - struct ieee80211_chanctx_conf *chanctx) -{ - u32 pri_2mhz_khz; - struct ieee80211_channel *s1g_sibling_1mhz; - u32 pri_khz = ieee80211_channel_to_khz(chanctx->def.chan); - u32 rx_khz = ieee80211_rx_status_to_khz(rx_status); - - if (rx_khz == pri_khz) - return true; - - if (!chanctx->def.s1g_primary_2mhz) - return false; - - /* - * If we have an S1G interface with a 2MHz primary, beacons are - * sent on the center frequency of the 2MHz primary. Find the sibling - * 1MHz channel and calculate the 2MHz primary center frequency. - */ - s1g_sibling_1mhz = cfg80211_s1g_get_primary_sibling(local->hw.wiphy, - &chanctx->def); - if (!s1g_sibling_1mhz) - return false; - - pri_2mhz_khz = - (pri_khz + ieee80211_channel_to_khz(s1g_sibling_1mhz)) / 2; - return rx_khz == pri_2mhz_khz; -} - static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, struct ieee80211_hdr *hdr, size_t len, struct ieee80211_rx_status *rx_status) @@ -8180,8 +8148,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, return; } - if (!ieee80211_rx_beacon_freq_valid(local, mgmt, rx_status, - chanctx_conf)) { + if (ieee80211_rx_status_to_khz(rx_status) != + ieee80211_channel_to_khz(chanctx_conf->def.chan)) { rcu_read_unlock(); return; } -- 2.43.0