From patchwork Mon May 20 08:55:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 10950559 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E35D36C5 for ; Mon, 20 May 2019 08:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D183C2879E for ; Mon, 20 May 2019 08:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5E9B28756; Mon, 20 May 2019 08:55:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61A2028785 for ; Mon, 20 May 2019 08:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SuV7VZZdv1wFljW2c74jeXPAffZhdkxbLjxfk5L+/9g=; b=SxN9kwVhYVHaRs 1VNjgTh1ZZ8LpUnL2ac3Q2VEcxtO+bBi9KP4r2/8naqW12Zsx5WO1Hean3RegThtY+vGhVM6V/Ztl /Y5YINHBI3fjaXh+0DQ3JqR/mnuII77lTKD0CU43wRNDDgRXWiTHvBYcQGoL4nk9qB4xfSTsMjxM7 zCTY0eb2htV8rjxvC8Ps0Vqp2MBi8pyJErTjlv1hN01IvQfYYZxGycF72N6KgIoY/NLvDhhWQvrDy rlyZB4ViY40Uejr1vXRv83m4sI4zDR0auUqrFe9VLk5v9077IvPX0zMKB9Ux1hPTBNEIdL0/iSfgz CLTNb5YVDhQCUhK1RPTw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSe4r-0004jE-SE; Mon, 20 May 2019 08:55:25 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSe4k-0004dT-Uy for ath11k@lists.infradead.org; Mon, 20 May 2019 08:55:22 +0000 Received: from p548c87ba.dip0.t-ipconnect.de ([84.140.135.186] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hSe4i-0002Y7-Sw; Mon, 20 May 2019 10:55:16 +0200 From: John Crispin To: Kalle Valo Subject: [PATCH V5 1/8] mac80211: propagate HE operation info into ieee80211_sta Date: Mon, 20 May 2019 10:55:01 +0200 Message-Id: <20190520085508.5888-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520085508.5888-1-john@phrozen.org> References: <20190520085508.5888-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_015519_171363_B561BE73 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shashidhar Lakkavalli , linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Upon a successful assoc a station shall store the content of the HE operation element inside ieee80211_sta so that the driver can setup the hardware accordingly. Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin --- include/net/mac80211.h | 2 ++ net/mac80211/he.c | 14 ++++++++++++++ net/mac80211/ieee80211_i.h | 5 +++++ net/mac80211/mlme.c | 1 + 4 files changed, 22 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 112dc18c658f..ba4a16f87364 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1903,6 +1903,7 @@ struct ieee80211_sta_rates { * @ht_cap: HT capabilities of this STA; restricted to our own capabilities * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities * @he_cap: HE capabilities of this STA + * @he_operation: HE operation information of the AP we are connected to * @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU * that this station is allowed to transmit to us. * Can be modified by driver. @@ -1941,6 +1942,7 @@ struct ieee80211_sta { struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_vht_cap vht_cap; struct ieee80211_sta_he_cap he_cap; + struct ieee80211_he_operation he_operation; u16 max_rx_aggregation_subframes; bool wme; u8 uapsd_queues; diff --git a/net/mac80211/he.c b/net/mac80211/he.c index 769078ed5a12..62ef029e5c48 100644 --- a/net/mac80211/he.c +++ b/net/mac80211/he.c @@ -53,3 +53,17 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, he_cap->has_he = true; } + +void +ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata, + const struct ieee80211_he_operation *he_op_ie_elem, + struct sta_info *sta) +{ + struct ieee80211_he_operation *he_operation = &sta->sta.he_operation; + + if (!he_op_ie_elem) { + memset(he_operation, 0, sizeof(*he_operation)); + return; + } + memcpy(he_operation, he_op_ie_elem, sizeof(*he_operation)); +} diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e170f986d226..11bc1778bfd5 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1870,6 +1870,11 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, const u8 *he_cap_ie, u8 he_cap_len, struct sta_info *sta); +void +ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata, + const struct ieee80211_he_operation *he_op_ie_elem, + struct sta_info *sta); + /* Spectrum management */ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2dbcf5d5512e..5d8a8a0feaf9 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3364,6 +3364,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, if (elems.uora_element) bss_conf->uora_ocw_range = elems.uora_element[0]; + ieee80211_he_op_ie_to_sta_he_op(sdata, elems.he_operation, sta); /* TODO: OPEN: what happens if BSS color disable is set? */ }