From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A1D3C433F5 for ; Fri, 3 Sep 2021 11:49:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3ED061051 for ; Fri, 3 Sep 2021 11:49:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C3ED061051 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XCp+/fF0Wfd5jwKO0JfbiY3h28mtHMBF5O0LCnavft4=; b=1svFyl4I+39XX5 ZuM7uBKgFK2mAY35PNbwJ7z/od94zxSZGAsuTJmQY/bHLOUKdxwzupY3WuwV4CVMQ/n9oiCS1OkVh DOUzFtONQ9j9Bnyr6XkGUyR7rO8BVCsknc2sg5y0mF69DOx0TGyznh+qCl6/BaHpKQIA2+S1zlFo/ LCGSRQ+b7DRU2Lr6FuGbvpNGKPn29NwcCl/B+eWl9QcJWGhG6rPZ7HZNp1RhC59tSdgCMQsx/os/S wE8WMV1z9umcUEp/c0b/2pbxF2YBnqU9ctym2OcWaSBAOX9SCgh6kpMfsPD0u1dqh9oCZQWfWFRF4 xLOIrfOC7rzHJKOxSdAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mM7gs-00Bphl-MB; Fri, 03 Sep 2021 11:49:02 +0000 Received: from so254-9.mailgun.net ([198.61.254.9]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mM7gp-00BpNx-JY for ath11k@lists.infradead.org; Fri, 03 Sep 2021 11:49:01 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630669739; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=m6I4lQrgQMUlQhV7i0cGQqRPyKnzr9KCU3CfgE5qOBo=; b=F9FU+uhWZ7cZZB+PRSLTuKnMhiBnXAzbOhNS7MjGOxM8BoWnSSm0Rse5KcgQoU/kVSmIvcqJ s31+8qLXu87+W7bWX7PC4mKpkoIOv7MeCMQR9pwHePJnz7YnRrn8N7yhpG0++082nmsEDnj8 ObG7tYGWq48j9Csd+qBI6h/OiAo= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyJmOGQ2ZiIsICJhdGgxMWtAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 61320b976fc2cf7ad9a24a8d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 03 Sep 2021 11:48:39 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 19288C4338F; Fri, 3 Sep 2021 11:48:39 +0000 (UTC) Received: from wgong-HP3-Z230-SFF-Workstation.qca.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong) by smtp.codeaurora.org (Postfix) with ESMTPSA id B5941C43460; Fri, 3 Sep 2021 11:48:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org B5941C43460 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Wen Gong To: johannes@sipsolutions.net, ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, wgong@codeaurora.org Subject: [PATCH v3 7/9] mac80211: add parse transmit power envelope element Date: Fri, 3 Sep 2021 07:48:19 -0400 Message-Id: <20210903114821.23346-8-wgong@codeaurora.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210903114821.23346-1-wgong@codeaurora.org> References: <20210903114821.23346-1-wgong@codeaurora.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210903_044859_993419_0103CC0E X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath11k" Errors-To: ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org The transmit power envelope elements in beacon is used to calculate the power limit by lower driver, and sometimes it has more than one elements in a beacon frame. This is to add parse the transmit power envelope elements, then it will be saved and transfer to lower driver to calculate the power limit. Signed-off-by: Wen Gong --- net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/util.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 648696b49f89..bb62de5e3758 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 04f2ba530d4f..c94ba3221086 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1336,6 +1336,16 @@ _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 (elems->tx_pwr_env_num >= ARRAY_SIZE(elems->tx_pwr_env) || + elen < 1 || + elen > sizeof(elems->tx_pwr_env[0])) + 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, -- 2.31.1 -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k