From patchwork Mon May 20 11:02:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 10950905 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 2EBD4912 for ; Mon, 20 May 2019 11:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B9F6287DE for ; Mon, 20 May 2019 11:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 100FE287E5; Mon, 20 May 2019 11:02:21 +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 9E194287E3 for ; Mon, 20 May 2019 11:02:20 +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=Sz2qY5fkgEFxKGbQdVnGvCxZ5V0eUlJcWAGViT1M0k8=; b=fA25lAolFars+k Ms1EsJ+Brn/Dsb56+qNFTd7ZApK7gRJlK7eqhkPtRulH3ZStdIKnyNYHfNj4iNHo45dWhZTUkM8Nx e09fgSt9dCPanT753JWzHEYJFhZZmw3xwDZ+mhnuFX8TLAuZBrgdXl2NZ+o4HVxWPykOLnfIIZeEW zgTKti46VPjygHjn4pgLu9T0GwSDeIGTmwQr4N3RB2PuuMT51WhiWu582PIgDMZWPVmzBV69dyksw Az8txAJXRVT0IlVs+A3lXPZtks/dCdlfKTXV+CV/ZGFXMZZemyR0PcSHhab55fdZPP8Sen1wHw+oR O3E7LtSxQI+xk0Zf1Kbg==; 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 1hSg3e-0007Rm-NA; Mon, 20 May 2019 11:02:18 +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 1hSg3b-0007Mt-1M for ath11k@lists.infradead.org; Mon, 20 May 2019 11:02:16 +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 1hSg3Y-0003rt-7R; Mon, 20 May 2019 13:02:12 +0200 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 6/7] mac80211: propagate spatial reuse info into ieee80211_sta Date: Mon, 20 May 2019 13:02:03 +0200 Message-Id: <20190520110204.27588-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520110204.27588-1-john@phrozen.org> References: <20190520110204.27588-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_040215_291217_0F1F66DB X-CRM114-Status: GOOD ( 10.36 ) 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 SPR 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 | 1 + net/mac80211/he.c | 24 ++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 4 ++++ net/mac80211/mlme.c | 1 + 4 files changed, 30 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d81eea9140e5..f73a210b122b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1952,6 +1952,7 @@ struct ieee80211_sta { struct ieee80211_sta_vht_cap vht_cap; struct ieee80211_sta_he_cap he_cap; struct ieee80211_he_operation he_operation; + struct ieee80211_he_obss_pd he_obss_pd; u16 max_rx_aggregation_subframes; bool wme; u8 uapsd_queues; diff --git a/net/mac80211/he.c b/net/mac80211/he.c index 62ef029e5c48..e41ee4a29257 100644 --- a/net/mac80211/he.c +++ b/net/mac80211/he.c @@ -67,3 +67,27 @@ ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata, } memcpy(he_operation, he_op_ie_elem, sizeof(*he_operation)); } + +void +ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata, + const struct ieee80211_he_spr *he_spr_ie_elem, + struct sta_info *sta) +{ + struct ieee80211_he_obss_pd *he_obss_pd = &sta->sta.he_obss_pd; + const u8 *data = he_spr_ie_elem->optional; + + memset(he_obss_pd, 0, sizeof(*he_obss_pd)); + + if (!he_spr_ie_elem) + return; + + if (he_spr_ie_elem->he_sr_control & + IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) + data++; + if (he_spr_ie_elem->he_sr_control & + IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) { + he_obss_pd->max_offset = *data++; + he_obss_pd->min_offset = *data++; + he_obss_pd->enable = true; + } +} diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e931e114fba4..d82469754d34 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1870,6 +1870,10 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband, const u8 *he_cap_ie, u8 he_cap_len, struct sta_info *sta); +void +ieee80211_he_spr_ie_to_sta_he_obss_pd(struct ieee80211_sub_if_data *sdata, + const struct ieee80211_he_spr *he_spr_ie_elem, + struct sta_info *sta); void ieee80211_he_op_ie_to_sta_he_op(struct ieee80211_sub_if_data *sdata, diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 996439a288c0..098335f34aa3 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3377,6 +3377,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, bss_conf->uora_ocw_range = elems.uora_element[0]; ieee80211_he_op_ie_to_sta_he_op(sdata, elems.he_operation, sta); + ieee80211_he_spr_ie_to_sta_he_obss_pd(sdata, elems.he_spr, sta); /* TODO: OPEN: what happens if BSS color disable is set? */ }