summaryrefslogtreecommitdiff
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-05-30 23:52:14 +0300
committerJohannes Berg <johannes.berg@intel.com>2022-06-20 13:55:22 +0300
commit762623a6a422198c6b39ea099cc8f80bae1767e9 (patch)
tree40010ebe54885cac7329dfdee9890a7ce3afddce /net/mac80211/main.c
parentec7a04073d3b31c03a9ad00e0709ffd78b5cfd1b (diff)
downloadlinux-762623a6a422198c6b39ea099cc8f80bae1767e9.tar.xz
wifi: mac80211: validate some driver features for MLO
If MLO is enabled by the driver then validate a set of capabilities that mac80211 will initially not support in MLO. This might change if features are implemented. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5c71b522013f..0eaa1f48efa7 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -955,6 +955,48 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
(!local->ops->start_nan || !local->ops->stop_nan)))
return -EINVAL;
+ if (hw->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO) {
+ /*
+ * For drivers capable of doing MLO, assume modern driver
+ * or firmware facilities, so software doesn't have to do
+ * as much, e.g. monitoring beacons would be hard if we
+ * might not even know which link is active at which time.
+ */
+ if (WARN_ON(!local->use_chanctx))
+ return -EINVAL;
+
+ if (WARN_ON(!local->ops->link_info_changed))
+ return -EINVAL;
+
+ if (WARN_ON(!ieee80211_hw_check(hw, HAS_RATE_CONTROL)))
+ return -EINVAL;
+
+ if (WARN_ON(!ieee80211_hw_check(hw, AMPDU_AGGREGATION)))
+ return -EINVAL;
+
+ if (WARN_ON(ieee80211_hw_check(hw, HOST_BROADCAST_PS_BUFFERING)))
+ return -EINVAL;
+
+ if (WARN_ON(ieee80211_hw_check(hw, SUPPORTS_PS) &&
+ !ieee80211_hw_check(hw, SUPPORTS_DYNAMIC_PS)))
+ return -EINVAL;
+
+ if (WARN_ON(!ieee80211_hw_check(hw, MFP_CAPABLE)))
+ return -EINVAL;
+
+ if (WARN_ON(!ieee80211_hw_check(hw, CONNECTION_MONITOR)))
+ return -EINVAL;
+
+ if (WARN_ON(ieee80211_hw_check(hw, NEED_DTIM_BEFORE_ASSOC)))
+ return -EINVAL;
+
+ if (WARN_ON(ieee80211_hw_check(hw, TIMING_BEACON_ONLY)))
+ return -EINVAL;
+
+ if (WARN_ON(!ieee80211_hw_check(hw, AP_LINK_PS)))
+ return -EINVAL;
+ }
+
#ifdef CONFIG_PM
if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume))
return -EINVAL;