aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-05-04 16:45:07 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-06-06 14:14:03 +0200
commit2d22be01b844c47771421ff8e0e68cecf967b7e3 (patch)
tree16f6d4516c727e14da4f3c2996ffcbc054d21139
parentwifi: mac80211: remove element scratch_len (diff)
downloadwireguard-linux-2d22be01b844c47771421ff8e0e68cecf967b7e3.tar.xz
wireguard-linux-2d22be01b844c47771421ff8e0e68cecf967b7e3.zip
wifi: mac80211_hwsim: avoid warning with MLO PS stations
If the station disables all links it's in powersave and we shouldn't transmit anything to it, but we don't handle that correctly yet. For now, just avoid the warning, once we really add support for this case we can revert to the old warning. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230504134511.828474-8-gregory.greenman@intel.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/virtual/mac80211_hwsim.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index 9a8faaf4c6b6..5ff193bcd4b9 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -1940,7 +1940,14 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
hdr, &link_sta);
}
- if (WARN_ON(!bss_conf)) {
+ if (unlikely(!bss_conf)) {
+ /* if it's an MLO STA, it might have deactivated all
+ * links temporarily - but we don't handle real PS in
+ * this code yet, so just drop the frame in that case
+ */
+ WARN(link != IEEE80211_LINK_UNSPECIFIED || !sta || !sta->mlo,
+ "link:%d, sta:%pM, sta->mlo:%d\n",
+ link, sta ? sta->addr : NULL, sta ? sta->mlo : -1);
ieee80211_free_txskb(hw, skb);
return;
}