From patchwork Wed Oct 19 08:25:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp350538wrs; Wed, 19 Oct 2022 07:13:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jGNX1W720+NdwyC3bmnUaAgIhz44GAbXIY2+Y2QlRZf9Je5J9pKQdiNL+3e0SZSMqe7wp X-Received: by 2002:a17:902:d192:b0:182:b25c:e526 with SMTP id m18-20020a170902d19200b00182b25ce526mr8662180plb.13.1666188834499; Wed, 19 Oct 2022 07:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188834; cv=none; d=google.com; s=arc-20160816; b=AJA8iKcW94B7hr2ygK6aX1qocteCC8DgvASrpVpHlnvAa93pamSw9B8GXHQvdC+EnC 19vQngMryyrabXHZ4cYRsVHsCqKknM0OBf5tl0Jt9nRQnAVPjO7Pad1jjb4o6XXUkW5Q EUSfYt+UlrEDV/uK6BaA1pQBdmaRZbBk0tiVIP2BUMNn4HDwOrJczBRP68VLcUuZcdYT zBGjb3/g7kLTE1gH3Z2VqPIu94E4GeAlns1wRgj9i5EydNeCymsWy6nmvsObj4yX4Za6 +VQa980rBsTQy+vamiGHw/C0vWsQZFVzlsSFMjIRroofmFGjAa2T+3t6ORG+LOa2wuhs Ly/g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jaBs9qLtQgom5RL2DUHyml1oRMgCiWswtTn/Ut5ydGY=; b=ToIzk/sSF2+pCt8tQwsPt5J8Jq9wZrYT5/M9loa1JWNmSl2FVP3GeSBqCRcu04vwdI cB6oN7AYrno1DpMxYwtNX/+7ZmxhPFFlitlTU+RHKUxEo9962WIqQd6PBjuVZJiWQwOy ZSU8aM23QHbqCXG14n2Hod46Nlk2EJ6ugTu3HqjUz2NdONYdY2JIvA+XuHIF7ZbJWNPD mvd8EbJ6bKEK3HJHHj82pjui3O/aq0J/eMYxkUA8/b68s5DcRjCAquRrYC+Gs07N7/hD plZdQUYPq6eztAEYSJaHFOVvuMwfQ6MAqENsPUnvkapcbkNcaDPUJB+sawOFlrAo2PNS Ln1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hH+EehRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a636f06000000b0045efd23abd4si17327845pgc.874.2022.10.19.07.13.32; Wed, 19 Oct 2022 07:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=hH+EehRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233921AbiJSN7C (ORCPT + 99 others); Wed, 19 Oct 2022 09:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234275AbiJSNzc (ORCPT ); Wed, 19 Oct 2022 09:55:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EFFC170DF2; Wed, 19 Oct 2022 06:38:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0F083B822E8; Wed, 19 Oct 2022 08:49:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7802CC433D6; Wed, 19 Oct 2022 08:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169341; bh=Y4pMd06s9Gr1I5Zfl0sgVaB4qlD7jgp/s7Joa+5BCcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hH+EehRrRSY/OBD9e1i+Jjf6oshllD8tBynvU57Agn/hyd4CMkYf07Fxr8htodOfg tAXfYEfDexeDArnTkPjv59lChOtUPPMQhCnnBlR7fBAh29HS1Tvbgv8dlDapUR1p3j lSpAF20i9jIcQ9UVrF0IvFFx2sFrp9CIrZfewrMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mordechay Goodstein , Johannes Berg , Sasha Levin Subject: [PATCH 6.0 241/862] wifi: mac80211: mlme: dont add empty EML capabilities Date: Wed, 19 Oct 2022 10:25:28 +0200 Message-Id: <20221019083300.673827588@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125623437761209?= X-GMAIL-MSGID: =?utf-8?q?1747125623437761209?= From: Mordechay Goodstein [ Upstream commit 1cb3cf372abe4a0d16620d2b1201de0e291a6c58 ] Draft P802.11be_D2.1, section 35.3.17 states that the EML Capabilities Field shouldn't be included in case the device doesn't have support for EMLSR or EMLMR. Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link") Signed-off-by: Mordechay Goodstein Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mlme.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 1e9cb4be6ed3..76ae6f03d77e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1220,14 +1220,21 @@ static void ieee80211_assoc_add_ml_elem(struct ieee80211_sub_if_data *sdata, ml_elem = skb_put(skb, sizeof(*ml_elem)); ml_elem->control = cpu_to_le16(IEEE80211_ML_CONTROL_TYPE_BASIC | - IEEE80211_MLC_BASIC_PRES_EML_CAPA | IEEE80211_MLC_BASIC_PRES_MLD_CAPA_OP); common = skb_put(skb, sizeof(*common)); common->len = sizeof(*common) + - 2 + /* EML capabilities */ 2; /* MLD capa/ops */ memcpy(common->mld_mac_addr, sdata->vif.addr, ETH_ALEN); - skb_put_data(skb, &eml_capa, sizeof(eml_capa)); + + /* add EML_CAPA only if needed, see Draft P802.11be_D2.1, 35.3.17 */ + if (eml_capa & + cpu_to_le16((IEEE80211_EML_CAP_EMLSR_SUPP | + IEEE80211_EML_CAP_EMLMR_SUPPORT))) { + common->len += 2; /* EML capabilities */ + ml_elem->control |= + cpu_to_le16(IEEE80211_MLC_BASIC_PRES_EML_CAPA); + skb_put_data(skb, &eml_capa, sizeof(eml_capa)); + } /* need indication from userspace to support this */ mld_capa_ops &= ~cpu_to_le16(IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP); skb_put_data(skb, &mld_capa_ops, sizeof(mld_capa_ops));