From patchwork Wed Jun 1 07:39:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 578479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FB2CC433EF for ; Wed, 1 Jun 2022 07:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345110AbiFAHkO (ORCPT ); Wed, 1 Jun 2022 03:40:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346505AbiFAHkH (ORCPT ); Wed, 1 Jun 2022 03:40:07 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAF4986EB for ; Wed, 1 Jun 2022 00:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=lojIq1zlQlZ7/qjd0G6TeOJ4z9KxMnwBQCbUjyie160=; t=1654069206; x=1655278806; b=iKGwARluRLpXnHkfHwibaebNUdZ47mwYOAGCfT2DvrhLh8g mg4YpTDoDayHs+ub6yDdEAydcZuAe/JSw7ecurcgi5hff4mKYNEAw/jEkwGrn3siapHZkZjyVRM9Q 3dJ1jbYcLQKxChRi/KieCLSXjzGZukRdmXUZosja+JJWBxusbqpgKGQT1czoah+AeBxF0kXM6jlqF Ug+uXukEChDIJFphO+tj2W7X3UJIxNmzZ2VNGIxB05nY6fDU5+Lf+0Cvu+ZK08oZU0tlFdjla76n2 /bixwFuBnilTGLUK0ioMQ3FkJIlAoIIcQUlJkpkkLH9LlnyWrBVhWeb3N0UYcejA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nwIxX-00AJPK-ET; Wed, 01 Jun 2022 09:40:03 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 08/15] mac80211: validate some driver features for MLO Date: Wed, 1 Jun 2022 09:39:51 +0200 Message-Id: <20220601093922.ae4718d24726.I81112aa6318e50bebba53117f8b39f255b41b28e@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220601073958.8345-1-johannes@sipsolutions.net> References: <20220601073958.8345-1-johannes@sipsolutions.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg 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 --- net/mac80211/main.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 6165b90bf0e2..c5553d68d779 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -951,6 +951,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;