Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3205640iob; Mon, 16 May 2022 16:01:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuy6U26PNaPQQWCXFgSf4txIuZEGCWIJS0+cAe+XDZpv9Z0MnBppAmp7xrJp9jVQCl5EcC X-Received: by 2002:a63:d90c:0:b0:3c6:4ab4:fbfe with SMTP id r12-20020a63d90c000000b003c64ab4fbfemr17191722pgg.499.1652742080303; Mon, 16 May 2022 16:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652742080; cv=none; d=google.com; s=arc-20160816; b=cxFQyWpmztfK028r6C9LCe4EA28hLkKYON04xruHceoUGbWu/iU5BKN70l/Qm/hHfu IhbmHQPdtIkyaI2Z32aSSr099A2HIVvKUvxRodKm+OFqmP6kS7HQOuh/XZ8fD9a/nCgb oDfHZj5PTrcLTSziBE72w5CBT04JVaxDGmfHTG/Tt2xKIajNM0FuDnuHuvok3qGOJDEJ ykdCezDShp0kvT7aJuDKrucaRRwUCq6jJbzRL1Rg/fLu3sFqbDbCzf50Y3fBqHzPyqtq RZ7VJeMmjqfrUko8rL4iP2ELd1dOIMu9fDmHFvKk7TsTttPpqJh2E5HTFS2ZuzqmaykR zHMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=NnmRvzGtSGsyKNBcTXKfWISWjiUoKXMH88ebcwW8HVk=; b=Cat5Ia3kekhyZ0HnQwFOlUMaWKYEZOp/sw0j9Y/WNGooXB9jfm0ZdPIhtn3sS69N0w zbxZ/CAJFYYL9R7IBlugI0S+WuXCnkOXGVic1bTnhuZovD8es7l3P7bFjId1SZbvz9+B bWyDCpT3Vdaq775cLd0Pxotkl7HqSTIBA3Gd2ZzqOKti9pT+TF0WfZ2hQLIxLjv58AIb YR8WfVPiHNs9XncoVNr7KLEmRpRcXla8tqp1QOWuKyS6yVSihIqP7RPZTeOXUPZ3/RF1 MwcNc3T/SQhbnSIirjQJhzo2t2nJyv0K3q/1cy82P5yErizwXESMYiNEmQKPh/WGOUId ewig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vf3HL5Ia; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a170902e81200b001619aaf38b2si2300234plg.65.2022.05.16.16.01.11; Mon, 16 May 2022 16:01:20 -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=@quicinc.com header.s=qcdkim header.b=vf3HL5Ia; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234125AbiEPWfr (ORCPT + 70 others); Mon, 16 May 2022 18:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349686AbiEPWfm (ORCPT ); Mon, 16 May 2022 18:35:42 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4F1111B for ; Mon, 16 May 2022 15:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652740541; x=1684276541; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=NnmRvzGtSGsyKNBcTXKfWISWjiUoKXMH88ebcwW8HVk=; b=vf3HL5IaQoGMZDT/id2+FQC3fWYlXPzNLspCMhq/HGIJvWQVXIyFc2LG ZUlXYzcLT51WQPI3R28BgigkQiV/Ecp24fyCR7eEkrx7fLfIkaiajXDRm Kq1pxM4MICpcSeTBGfQZtxaQOx0qF52vw5D5y5qpiV8qpby1bK1WuveN0 c=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 16 May 2022 15:35:40 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 15:35:40 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 16 May 2022 15:35:40 -0700 Received: from [10.110.66.23] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 16 May 2022 15:35:39 -0700 Message-ID: <25c05c43-fae5-8d25-8f8a-73e6cb0c36a7@quicinc.com> Date: Mon, 16 May 2022 15:35:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [RFC][PATCH] mac80211: fix VHT 160Mhz bandwidth when using extended NSS on PHY with NSS ratio Content-Language: en-US To: , Johannes Berg CC: linux-wireless References: <19cbe5dd1d7f0e194ed40c8db2cf2beffa3ae167.camel@freebox.fr> From: Jeff Johnson In-Reply-To: <19cbe5dd1d7f0e194ed40c8db2cf2beffa3ae167.camel@freebox.fr> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 On 5/16/2022 1:39 AM, Maxime Bizon wrote: > > A PHY supporting 160Mhz with a reduced number of NSS may not have any note correct abbreviation is: MHz and it is suggested to use a space to separate the value from the units > of the IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK bits set. > > For exemple, the QCA9984 is 4x4, but can only do 2x2 VHT160 or s/exemple/example/ > 80+80. The corresponding VHT capabilities should be: > - IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK == 0 > - Extended NSS BW == 2 > > If we use that hardware in AP mode, and a 160Mhz 2x2 STA without NSS > restriction connects to it, then that STA will set > IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to 1. > > The usual logic of using bitwise-and with our own capabilities does > not work here, the current code clears the SUPP_CHAN_WIDTH bits and > resolve STA bandwidth to 80Mhz instead of 160Mhz, fix this. > > Signed-off-by: Maxime Bizon > --- > net/mac80211/vht.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c > index e856f9092137..7ef93adc4f24 100644 > --- a/net/mac80211/vht.c > +++ b/net/mac80211/vht.c > @@ -230,9 +230,11 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata, > sizeof(struct ieee80211_vht_mcs_info)); > > /* copy EXT_NSS_BW Support value or remove the capability */ > - if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_VHT_EXT_NSS_BW)) > + if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_VHT_EXT_NSS_BW)) { > + vht_cap->cap |= cap_info & > + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK; > vht_cap->cap |= (cap_info & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK); > - else > + } else per the coding style when you use braces on any leg of if/else, use them on all legs > vht_cap->vht_mcs.tx_highest &= > ~cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE); >