Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp229351pxb; Thu, 26 Aug 2021 01:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSiOyMXYr6H3muOpC6i1hzk100EasjC7ZHGyU/iCACEY+TmcxYgpfOH3uVBX6Z8yABxt5i X-Received: by 2002:a17:906:f992:: with SMTP id li18mr2983267ejb.381.1629966723316; Thu, 26 Aug 2021 01:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629966723; cv=none; d=google.com; s=arc-20160816; b=pAL7zCLRr9Gt5CJTZ7Xu0G6vACPDzxaLsccaztIF1MCp3JQx09psbckPE4rC/SQImm k+z081+W6lbItnn+/nMHYb/WXjOppQpWlHXX4T+TfdbdkeyDtBdACVj6ypqMCSpVtPfK CQRJa0Yr1RhUUIlrtECTr5tes473ckM1hARBfG6ViS04SgEfWmPdOZZYVpzWTkSBFH3z //42/JrH97lRX+E4BWT4TAgkOHsybkWYjfaGHPeeS2fM8j5DiwP6NNGIolulhSA6TCmK 8gmhQMEC60bjjuXGlQe4zD3zOVJrBu47trzue4CM22djzXWg5CcoHnjmX87L1In23Rca LEag== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=ChWPK7ox2IYbPXxDUF/DiOKMbfiJndJaeviCuolqwVE=; b=SauveE188Hjs0FSVM1ft4Gv7vfHC3zHCCOrsIUgofoUqyxjADgw7Y18yhfMoX1LkG0 JZFTFU2n5SpJptEf+ak2N4NtOScgpV2nFjVgZIevTboCPmAuyF/FOZr6/w86pmXGAKED +YDUX1q1U71pN72XsuvE3as7GUmQ7RJG+An/lveoNd9Fxc1ozuNrXMQmKla1vOGPV+ik jBv0JBhlcEMnaijrgNPDD3DBokk9wkWfp/ZYiY877xNc0NW0i+886ArpEe2p/k+XTnSZ tlEctvDntVcCW+s0YckpsooVHWzn12oKjSEn9ouz8BNke/P8tjGa8En3/K9eX7imxbnn scQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lcV3LLQE; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh6si2230974ejb.691.2021.08.26.01.31.39; Thu, 26 Aug 2021 01:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=lcV3LLQE; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240451AbhHZIaE (ORCPT + 99 others); Thu, 26 Aug 2021 04:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240315AbhHZIaD (ORCPT ); Thu, 26 Aug 2021 04:30:03 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05695C061757 for ; Thu, 26 Aug 2021 01:29:17 -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: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=ChWPK7ox2IYbPXxDUF/DiOKMbfiJndJaeviCuolqwVE=; t=1629966557; x=1631176157; b=lcV3LLQECc81ntahHXyr0dJ3gu2ZkDk1bN2qLKmKaEgRjbK LkaEBskW5WDK7mCANrF95Nyp6ukmkD8Pzi6JgATx4PJkr7NyNKY7jN1zQTU9vQftDZNLqS5v4ogoR cn7FJdBQNOS2VBpMq9IyP83aXWnJwBlJzb2p71+ygSddhGcsaXH+ko3B3YviP/LYxI5bI8FeElaRN 93FJs//DBdoVW3jWp8u9CVeT+h6ia+q9B/cD8TiR/BdU7ZsjrgK0rA0LmEEhPO+zz/30btyuhKSOp T+AjzYq1y6hYb/sLjEafY3qe8aaeJM6RWMoRCSqxTMf2+gTMWnVdigIbLajn3M3w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1mJAl6-00G4rR-ET; Thu, 26 Aug 2021 10:29:12 +0200 Message-ID: Subject: Re: [PATCH v2 8/8] mac80211: save transmit power envelope element and power constraint From: Johannes Berg To: Wen Gong , ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Date: Thu, 26 Aug 2021 10:29:11 +0200 In-Reply-To: <20210820122041.12157-9-wgong@codeaurora.org> References: <20210820122041.12157-1-wgong@codeaurora.org> <20210820122041.12157-9-wgong@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2021-08-20 at 08:20 -0400, Wen Gong wrote: > >   if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) { >   const struct cfg80211_bss_ies *ies; > + struct ieee80211_bss_conf *bss_conf; am I missing where you set this? > + if (is_6ghz) { > + struct ieee802_11_elems elems; This is pretty big, not sure we want it on the stack (causes warnings for me in build). Also, if we're doing this anyway, then we can change the code above (perhaps as a separate patch) to not do cfg80211_find_ext_ie() but rather take it out of the parsed. > + u8 i, j = 0; > + > + ieee802_11_parse_elems(ies->data, ies->len, false, &elems, (line too long) > + NULL, NULL); > + > + if (elems.pwr_constr_elem) > + bss_conf->pwr_reduction = *elems.pwr_constr_elem; before using it? > + > + BUILD_BUG_ON(ARRAY_SIZE(bss_conf->tx_pwr_env) != > + ARRAY_SIZE(elems.tx_pwr_env)); > + > + for (i = 0; i < elems.tx_pwr_env_num; i++) { > + if (elems.tx_pwr_env_len[i] > > + sizeof(bss_conf->tx_pwr_env[j])) > + continue; I did that in the parsing itself. > + > + bss_conf->tx_pwr_env_num++; > + memcpy(&bss_conf->tx_pwr_env[j], elems.tx_pwr_env[i], > + elems.tx_pwr_env_len[i]); You're never resetting any of this for the next connection (if it's not 6 GHz for example, or doesn't have any data) - should probably memset all the new members to 0 before the "if (is_6ghz)" or so? johannes