From patchwork Tue Oct 19 16:25:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1543505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HYfJt0m8sz9sR4 for ; Wed, 20 Oct 2021 03:26:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mcrwn-0006qe-5e; Tue, 19 Oct 2021 16:26:41 +0000 Received: from mail-pg1-f175.google.com ([209.85.215.175]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mcrwV-0006SL-6Y for kernel-team@lists.ubuntu.com; Tue, 19 Oct 2021 16:26:23 +0000 Received: by mail-pg1-f175.google.com with SMTP id m21so19815399pgu.13 for ; Tue, 19 Oct 2021 09:26:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=acOsTONWO/TEXbh45qGOVhKXKHvikJoMDvHrKNYhfts=; b=ZWfe428Kw8jYBrhR29OHFAy4o+AuJZgfbQ3JcuhIXkah2GCUzNrehKjAK4lo1if9yy BOSuyfBgbului5VgFnRWTsuF0iQ5g/f2F2Ac1LGDJOFswDDJnUTmDouEXPw86MQWRBFH e7U1T+eLjPVAf5soJV3+er9SWMBU2fFPMVjDMQ71GUPBK1rOjUAwZ78/PyrXnb+DwIgv H84ST4ujlZUgUe7xZ3vDF0pkNgZMu/uNmiS6YMDR+3q3DWYh0hL+27pNFtQiHtrieHt6 /XA8UvDtwbMOLcNDd7YoqdjaVdGXzccKtIuTwn7RQ39S70x2+xG0cZppcInqGDZT9HAw Wh0w== X-Gm-Message-State: AOAM530U6UIEYlhOpNFjj1oTQQ1TX3YyQq1mOkV0YPegN5IcKcWxDNpR bZKd34fBovWC8QwggmIvtXR+OFlO9a4= X-Google-Smtp-Source: ABdhPJx1n3wQ1dfyvMRplkKH4df0HZOP7h0w3a3+aDZlkgzy9eAze8H3CC8fm15abVbIuQ3tEmXY8Q== X-Received: by 2002:a05:6a00:1484:b0:44c:de7f:30 with SMTP id v4-20020a056a00148400b0044cde7f0030mr739471pfu.62.1634660768567; Tue, 19 Oct 2021 09:26:08 -0700 (PDT) Received: from localhost (220-142-196-159.dynamic-ip.hinet.net. [220.142.196.159]) by smtp.gmail.com with ESMTPSA id fh3sm3231172pjb.8.2021.10.19.09.26.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 09:26:08 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 11/33][SRU][OEM-5.13] mac80211: parse transmit power envelope element Date: Wed, 20 Oct 2021 00:25:26 +0800 Message-Id: <20211019162548.1408217-12-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211019162548.1408217-1-vicamo.yang@canonical.com> References: <20211019162548.1408217-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.175; envelope-from=vicamo@gmail.com; helo=mail-pg1-f175.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wen Gong BugLink: https://bugs.launchpad.net/bugs/1939528 Parse and store the transmit power envelope element. Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20210820122041.12157-8-wgong@codeaurora.org Signed-off-by: Johannes Berg (cherry picked from commit b0345850ad770c5164bf6d4a0aa0c40ef2419cb0) Signed-off-by: You-Sheng Yang --- net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/util.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 1e1d2e72de4a0..96832865423b7 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1494,6 +1494,7 @@ struct ieee802_11_elems { const struct ieee80211_he_spr *he_spr; const struct ieee80211_mu_edca_param_set *mu_edca_param_set; const struct ieee80211_he_6ghz_capa *he_6ghz_capa; + const struct ieee80211_tx_pwr_env *tx_pwr_env[IEEE80211_TPE_MAX_IE_COUNT]; const u8 *uora_element; const u8 *mesh_id; const u8 *peering; @@ -1544,6 +1545,8 @@ struct ieee802_11_elems { u8 perr_len; u8 country_elem_len; u8 bssid_index_len; + u8 tx_pwr_env_len[IEEE80211_TPE_MAX_IE_COUNT]; + u8 tx_pwr_env_num; /* whether a parse error occurred while retrieving these elements */ bool parse_error; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 060059ef96686..c7c6b73737449 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1336,6 +1336,18 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, elems->rsnx = pos; elems->rsnx_len = elen; break; + case WLAN_EID_TX_POWER_ENVELOPE: + if (elen < 1 || + elen > sizeof(struct ieee80211_tx_pwr_env)) + break; + + if (elems->tx_pwr_env_num >= ARRAY_SIZE(elems->tx_pwr_env)) + break; + + elems->tx_pwr_env[elems->tx_pwr_env_num] = (void *)pos; + elems->tx_pwr_env_len[elems->tx_pwr_env_num] = elen; + elems->tx_pwr_env_num++; + break; case WLAN_EID_EXTENSION: ieee80211_parse_extension_element(calc_crc ? &crc : NULL,