Commit 4670d8dc authored by Johannes Berg's avatar Johannes Berg

wifi: iwlwifi: mvm: track u-APSD misbehaving AP by AP address

If the AP is an AP MLD, then we shouldn't track just the BSSID
but the MLD address. Just generally use ap_addr since it has
the BSSID in the non-MLD case.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230614123447.b6a4f7edd10c.Ie5a8029ed686b9441620ba06596d430432f65559@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c4c95454
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* /*
* Copyright (C) 2012-2014, 2018-2021 Intel Corporation * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH
*/ */
...@@ -554,7 +554,7 @@ static ssize_t iwl_dbgfs_uapsd_misbehaving_read(struct file *file, ...@@ -554,7 +554,7 @@ static ssize_t iwl_dbgfs_uapsd_misbehaving_read(struct file *file,
char buf[20]; char buf[20];
int len; int len;
len = sprintf(buf, "%pM\n", mvmvif->uapsd_misbehaving_bssid); len = sprintf(buf, "%pM\n", mvmvif->uapsd_misbehaving_ap_addr);
return simple_read_from_buffer(user_buf, count, ppos, buf, len); return simple_read_from_buffer(user_buf, count, ppos, buf, len);
} }
...@@ -567,7 +567,7 @@ static ssize_t iwl_dbgfs_uapsd_misbehaving_write(struct ieee80211_vif *vif, ...@@ -567,7 +567,7 @@ static ssize_t iwl_dbgfs_uapsd_misbehaving_write(struct ieee80211_vif *vif,
bool ret; bool ret;
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
ret = mac_pton(buf, mvmvif->uapsd_misbehaving_bssid); ret = mac_pton(buf, mvmvif->uapsd_misbehaving_ap_addr);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
return ret ? count : -EINVAL; return ret ? count : -EINVAL;
......
...@@ -418,7 +418,7 @@ struct iwl_mvm_vif { ...@@ -418,7 +418,7 @@ struct iwl_mvm_vif {
#endif #endif
/* FW identified misbehaving AP */ /* FW identified misbehaving AP */
u8 uapsd_misbehaving_bssid[ETH_ALEN]; u8 uapsd_misbehaving_ap_addr[ETH_ALEN] __aligned(2);
struct delayed_work uapsd_nonagg_detected_wk; struct delayed_work uapsd_nonagg_detected_wk;
bool csa_countdown; bool csa_countdown;
......
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* /*
* Copyright (C) 2012-2014, 2018-2019, 2021 Intel Corporation * Copyright (C) 2012-2014, 2018-2019, 2021-2023 Intel Corporation
* Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2015-2017 Intel Deutschland GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH
*/ */
...@@ -237,8 +237,8 @@ static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm, ...@@ -237,8 +237,8 @@ static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm,
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
if (!memcmp(mvmvif->uapsd_misbehaving_bssid, vif->bss_conf.bssid, if (ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr,
ETH_ALEN)) vif->cfg.ap_addr))
return false; return false;
/* /*
...@@ -502,9 +502,9 @@ void iwl_mvm_power_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -502,9 +502,9 @@ void iwl_mvm_power_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{ {
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
if (memcmp(vif->bss_conf.bssid, mvmvif->uapsd_misbehaving_bssid, if (!ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr,
ETH_ALEN)) vif->cfg.ap_addr))
eth_zero_addr(mvmvif->uapsd_misbehaving_bssid); eth_zero_addr(mvmvif->uapsd_misbehaving_ap_addr);
} }
static void iwl_mvm_power_uapsd_misbehav_ap_iterator(void *_data, u8 *mac, static void iwl_mvm_power_uapsd_misbehav_ap_iterator(void *_data, u8 *mac,
...@@ -512,14 +512,23 @@ static void iwl_mvm_power_uapsd_misbehav_ap_iterator(void *_data, u8 *mac, ...@@ -512,14 +512,23 @@ static void iwl_mvm_power_uapsd_misbehav_ap_iterator(void *_data, u8 *mac,
{ {
u8 *ap_sta_id = _data; u8 *ap_sta_id = _data;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct ieee80211_bss_conf *link_conf;
unsigned int link_id;
rcu_read_lock();
for_each_vif_active_link(vif, link_conf, link_id) {
struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id];
/* The ap_sta_id is not expected to change during current association /* The ap_sta_id is not expected to change during current
* so no explicit protection is needed * association so no explicit protection is needed
*/ */
if (mvmvif->deflink.ap_sta_id == *ap_sta_id) if (link_info->ap_sta_id == *ap_sta_id) {
memcpy(mvmvif->uapsd_misbehaving_bssid, ether_addr_copy(mvmvif->uapsd_misbehaving_ap_addr,
vif->bss_conf.bssid, vif->cfg.ap_addr);
ETH_ALEN); break;
}
}
rcu_read_unlock();
} }
void iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm, void iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
......
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