Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp740843rwd; Thu, 8 Jun 2023 07:11:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZCOtyLf8N+FIf6ARByA9/rG5hccsP8142mSoiqRt07aTHt3+35OhYZynAf9q1xq3QqJ9U X-Received: by 2002:a05:6a00:14cf:b0:651:ce88:27f5 with SMTP id w15-20020a056a0014cf00b00651ce8827f5mr10907094pfu.13.1686233474445; Thu, 08 Jun 2023 07:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686233474; cv=none; d=google.com; s=arc-20160816; b=MmwptsddzTxNcdnspMFj1FomenonRifwzkSRnOKhPNG1YoI5UcEaS6QIX7IhZhpYTU tZslyxb383nNDErCLMhpM/B2AFMFlofrpXLy7ggrrj2Gbftym7AJHLlYbIVtRGNbqSYv WifzUJPt65Vfs0pQTyV6pwUp5Uy1Whxv71f6wfE6SJitDEBv0K6ZGAk48BEkBJMZJ1q7 f3UOqRiv4vP0cvwgJGzc+m7/Gjhau3+scKkcXY7XRcxz5Y6BC6+Wp0mgrDAXzddalC6j DfiZy9YHYwnJcqggptEauJa+sBa2q5BDpvuzS1bTIG/L5YtM0781hi9mhGF61prT99s7 XKYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mZd5LNSY3F8oUMDFmASrko1OpA9OqHJo0ufC3Lvy8xg=; b=a7r+i3dOTZ2+ovjV/hzUvaO/X3NMgaiHq7BR2mLvhWGYd/BuRgXt1a1tyGA8qH3O8E HOBXunZM5wNbkH7ScF1Ig1N5GA3QEYERdd74lODb/V0BQk5HPztL0ZurFSg+NrhtPLR+ 5R4wO6sUEx6h7kUF9LJBbGLZAq6Liub3emiz9ynpDLi78j1AnEBdgHQPs4xPZYivw4O3 15/9fbd7qUTEJE/zen+tRLmgqhJY0m8pD3+utw53EA7/Lx2dauxdTPEIUVrLp8YNFPDj aePIS9zDD9o5ZVrfb0AF6sSIWHRNPlPwXgm8dy7X5dZFTdl3sxwvR+WHHMZVMzRvEFK9 nvdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NIXFWJrY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h63-20020a638342000000b00544c073691dsi1040719pge.217.2023.06.08.07.11.06; Thu, 08 Jun 2023 07:11:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NIXFWJrY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236888AbjFHOHe (ORCPT + 61 others); Thu, 8 Jun 2023 10:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236835AbjFHOHZ (ORCPT ); Thu, 8 Jun 2023 10:07:25 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E3CD273F for ; Thu, 8 Jun 2023 07:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686233241; x=1717769241; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0XNOx440eTca30Q0Zm0z9eumP0EX8P+4WPyJHJqbAeU=; b=NIXFWJrYtYx13OPlc7uf8cP3z7djXNt9TXeZhr5rwlVQY+zSdCHY6dyI 9I0uINP5aQQeE1tX2NFuxdel3KJRAeDvz+KibQhzN5XRz1n/3yyAkgPXd gNtC1qb70HYYdZf79zw0WdhjwYxzyZ+YRkniybDZvhXWptJtXkVHaGb56 9HpAV2XsqGB4BprT+sUdQ3c+ulYcz5lbFilcmUIKqzLViIRYdj2+/9Gii 5pQH/WYGgbPclsaqTwqv05kKk6BB+TPD3k4Ra1aSQwZ+EOrGy1RFRMyPU DEvfGNmEL08IAqkb0hde8922Xp9YLpUB8WszmZQk7Zkr79SmBk93ETAVs Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="423176293" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="423176293" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="956706388" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="956706388" Received: from unknown (HELO ggreenma-mobl2.intel.com) ([10.249.94.100]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:52 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer , Gregory Greenman Subject: [PATCH 14/15] wifi: cfg80211: Support association to AP MLD with disabled links Date: Thu, 8 Jun 2023 16:36:10 +0300 Message-Id: <20230608163202.c4c61ee4c4a5.I784ef4a0d619fc9120514b5615458fbef3b3684a@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230608133611.1303724-1-gregory.greenman@intel.com> References: <20230608133611.1303724-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ilan Peer An AP part of an AP MLD might be temporarily disabled, and might be enabled later. Such a link should be included in the association exchange, but should not be used until enabled. Extend the NL80211_CMD_ASSOCIATE to also indicate disabled links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman --- include/net/cfg80211.h | 5 ++++- include/uapi/linux/nl80211.h | 7 ++++++- net/wireless/nl80211.c | 13 ++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1b8619685bf6..6d5b104212b3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -7,7 +7,7 @@ * Copyright 2006-2010 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2021, 2023 Intel Corporation */ #include @@ -2870,11 +2870,14 @@ struct cfg80211_auth_request { * if this is %NULL for a link, that link is not requested * @elems: extra elements for the per-STA profile for this link * @elems_len: length of the elements + * @disabled: If set this link should be included during association etc. but it + * should not be used until enabled by the AP MLD. */ struct cfg80211_assoc_link { struct cfg80211_bss *bss; const u8 *elems; size_t elems_len; + bool disabled; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index c59fec406da5..c3b674cee312 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -11,7 +11,7 @@ * Copyright 2008 Jouni Malinen * Copyright 2008 Colin McCabe * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -2805,6 +2805,9 @@ enum nl80211_commands { * index. If the userspace includes more RNR elements than number of * MBSSID elements then these will be added in every EMA beacon. * + * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is + * disabled. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -3341,6 +3344,8 @@ enum nl80211_attrs { NL80211_ATTR_EMA_RNR_ELEMS, + NL80211_ATTR_MLO_LINK_DISABLED, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 772671b9bc42..2941187a7a3d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5,7 +5,7 @@ * Copyright 2006-2010 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation */ #include @@ -816,6 +816,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS] = { .type = NLA_U16 }, [NL80211_ATTR_HW_TIMESTAMP_ENABLED] = { .type = NLA_FLAG }, [NL80211_ATTR_EMA_RNR_ELEMS] = { .type = NLA_NESTED }, + [NL80211_ATTR_MLO_LINK_DISABLED] = { .type = NLA_FLAG }, }; /* policy for the key attributes */ @@ -11115,6 +11116,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) goto free; } } + + req.links[link_id].disabled = + nla_get_flag(attrs[NL80211_ATTR_MLO_LINK_DISABLED]); } if (!req.links[req.link_id].bss) { @@ -11129,6 +11133,13 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) goto free; } + if (req.links[req.link_id].disabled) { + GENL_SET_ERR_MSG(info, + "cannot have assoc link disabled"); + err = -EINVAL; + goto free; + } + kfree(attrs); attrs = NULL; } else { -- 2.38.1