From patchwork Fri Dec 6 14:33:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276541 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A64817EF for ; Fri, 6 Dec 2019 14:34:15 +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 5558E24659 for ; Fri, 6 Dec 2019 14:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mpHaplTs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5558E24659 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=3xXPIUth3FZUnqI7MBJ/cgOiG0A9jT+LgYlzgOWA3Z8=; b=mpHaplTsDd3FzX w8EEfM055EUINwwGvhf6nD7EN1mrCUipQrV5HXJANZiI0tKgMBPc9RUmyfxtsh1tgdSPV26rfmgzq FdhTufgah9HbKllpWllFON96yGeKw4Jmk8+w+ScweU5A5Tb1LNnNPcDrnvY5F2GGc964XAs+mEkNo kh5u/eVWmhE/oZaV/N70d2awpec0aBtgHFDrOmRGyVwg2mjmlcaAL9/kj7dD2F3g+raOFjdw6ZbUn JHs3XZTgPSKQN/v06eXCPhTPclVniLQAMFS9xd1loaZUWhw3ur+0amGhxL9SC0RzVNj3+X5wkOc+Y RVfX7ghZfpqacNpzvMMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgP-0006wb-5G; Fri, 06 Dec 2019 14:34:13 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006ol-98 for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:12 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgF-0004Lm-17; Fri, 06 Dec 2019 15:34:03 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 1/7] mac80211: add a struct for holding BSS color settings Date: Fri, 6 Dec 2019 15:33:55 +0100 Message-Id: <20191206143401.4080-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_478057_364A849B X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Right now we only track the actual color but not the other bits contained within the he_oper field. Fix this by creating a new struct to hold all of the info. Signed-off-by: John Crispin --- include/net/cfg80211.h | 15 +++++++++++++++ include/net/mac80211.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 8140c4837122..e395ef48af83 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -259,6 +259,19 @@ struct ieee80211_he_obss_pd { u8 max_offset; }; +/** + * struct ieee80211_he_bss_color - AP settings for BSS coloring + * + * @color: the current color. + * @disabled: is the feature disabled. + * @partial: define the AID equation. + */ +struct ieee80211_he_bss_color { + u8 color; + bool disabled; + bool partial; +}; + /** * struct ieee80211_sta_ht_cap - STA's HT capabilities * @@ -910,6 +923,7 @@ enum cfg80211_ap_settings_flags { * @twt_responder: Enable Target Wait Time * @flags: flags, as defined in enum cfg80211_ap_settings_flags * @he_obss_pd: OBSS Packet Detection settings + * @he_bss_color: BSS Color settings */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; @@ -938,6 +952,7 @@ struct cfg80211_ap_settings { bool twt_responder; u32 flags; struct ieee80211_he_obss_pd he_obss_pd; + struct ieee80211_he_bss_color he_bss_color; }; /** diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 6781d4637557..16a5525ddab1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -604,6 +604,7 @@ struct ieee80211_ftm_responder_params { * in order to discover all the nontransmitted BSSIDs in the set. * @he_operation: HE operation information of the AP we are connected to * @he_obss_pd: OBSS Packet Detection parameters. + * @he_bss_color: BSS coloring settings, if BSS supports HE */ struct ieee80211_bss_conf { const u8 *bssid; @@ -667,6 +668,7 @@ struct ieee80211_bss_conf { u8 profile_periodicity; struct ieee80211_he_operation he_operation; struct ieee80211_he_obss_pd he_obss_pd; + struct ieee80211_he_bss_color he_bss_color; }; /** From patchwork Fri Dec 6 14:33:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276545 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97AA1139A for ; Fri, 6 Dec 2019 14:34:17 +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 75A6C2464E for ; Fri, 6 Dec 2019 14:34:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WJf+mNyN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75A6C2464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=Bj2+LLLWT7/ANkINRAT7/BGwARVljQeW1UIbX8457+Y=; b=WJf+mNyN/1tVAu 16xNuHWWul8Dt7qWP50gV8rJsGnm1EvrmOoBZEM21Iz0o3NsAPmCCEZ5GDASNu6LfDzv1WZ0ZjGpN N0/5RQdDhZjzDh/P/XlIL4AskJz9sW2oCbJ98kw+whavYWMjrWsjZlJMYD2eL2lbicExFsq4MuIa+ wECxu/UCh2WHG7GhBjpAmt0kxHdphJhhVoTjIe0mft2m5Kaato8sukh71s4wZbJ3TYhxJ9X1B9XWB 1r4k6htuGCKPu4amkr9+WONgvbKcMRHm4S3jhmIFjRRnfDSMaFWo8viqByEXP9udyy+/tG5SWUxZf aN5+0hro5UfuisAsI66A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgR-0006yF-De; Fri, 06 Dec 2019 14:34:15 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006nF-8r for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:13 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgF-0004Lm-JD; Fri, 06 Dec 2019 15:34:03 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 2/7] nl80211: add handling for BSS color Date: Fri, 6 Dec 2019 15:33:56 +0100 Message-Id: <20191206143401.4080-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_478065_4B2F6E38 X-CRM114-Status: GOOD ( 13.23 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 s patch adds the attributes, policy and parsing code to allow userland to send the info about the BSS coloring settings to the kernel. Signed-off-by: John Crispin --- include/uapi/linux/nl80211.h | 27 ++++++++++++++++++++++++ net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 822851d369ab..6a1b6da5cd36 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2361,6 +2361,8 @@ enum nl80211_commands { * @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection * functionality. * + * @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -2820,6 +2822,8 @@ enum nl80211_attrs { NL80211_ATTR_HE_OBSS_PD, + NL80211_ATTR_HE_BSS_COLOR, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -6516,5 +6520,28 @@ enum nl80211_obss_pd_attributes { NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1, }; +/** + * enum nl80211_bss_color_attributes - BSS Color attributes + * @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid + * + * @NL80211_HE_BSS_COLOR: the OBSS PD minimum tx power offset. + * @NL80211_HE_BSS_COLOR_DISABLED: is BSS coloring disabled. + * @NL80211_HE_BSS_COLOR_PARTIAL: the AID equation to be used.. + * + * @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal + * @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute. + */ +enum nl80211_bss_color_attributes { + __NL80211_HE_BSS_COLOR_ATTR_INVALID, + + NL80211_HE_BSS_COLOR, + NL80211_HE_BSS_COLOR_DISABLED, + NL80211_HE_BSS_COLOR_PARTIAL, + + /* keep last */ + __NL80211_HE_BSS_COLOR_ATTR_LAST, + NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1, +}; + #endif /* __LINUX_NL80211_H */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 92e06482563c..46040083abe8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -289,6 +289,13 @@ he_obss_pd_policy[NL80211_HE_OBSS_PD_ATTR_MAX + 1] = { NLA_POLICY_RANGE(NLA_U8, 1, 20), }; +static const struct nla_policy +he_bss_color_policy[NL80211_HE_BSS_COLOR_ATTR_MAX + 1] = { + [NL80211_HE_BSS_COLOR] = NLA_POLICY_RANGE(NLA_U8, 1, 63), + [NL80211_HE_BSS_COLOR_DISABLED] = { .type = NLA_FLAG }, + [NL80211_HE_BSS_COLOR_PARTIAL] = { .type = NLA_FLAG }, +}; + const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD }, [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, @@ -584,6 +591,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { .len = SAE_PASSWORD_MAX_LEN }, [NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG }, [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy), + [NL80211_ATTR_HE_BSS_COLOR] = NLA_POLICY_NESTED(he_bss_color_policy), }; /* policy for the key attributes */ @@ -4441,6 +4449,30 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs, return 0; } +static int nl80211_parse_he_bss_color(struct nlattr *attrs, + struct ieee80211_he_bss_color *he_bss_color) +{ + struct nlattr *tb[NL80211_HE_BSS_COLOR_ATTR_MAX + 1]; + int err; + + err = nla_parse_nested(tb, NL80211_HE_BSS_COLOR_ATTR_MAX, attrs, + he_bss_color_policy, NULL); + if (err) + return err; + + if (!tb[NL80211_HE_BSS_COLOR]) + return -EINVAL; + + he_bss_color->color = + nla_get_u8(tb[NL80211_HE_BSS_COLOR]); + he_bss_color->disabled = + nla_get_flag(tb[NL80211_HE_BSS_COLOR_DISABLED]); + he_bss_color->partial = + nla_get_flag(tb[NL80211_HE_BSS_COLOR_PARTIAL]); + + return 0; +} + static void nl80211_check_ap_rate_selectors(struct cfg80211_ap_settings *params, const u8 *rates) { @@ -4733,6 +4765,14 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) return err; } + if (info->attrs[NL80211_ATTR_HE_BSS_COLOR]) { + err = nl80211_parse_he_bss_color( + info->attrs[NL80211_ATTR_HE_BSS_COLOR], + ¶ms.he_bss_color); + if (err) + return err; + } + nl80211_calculate_ap_params(¶ms); if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) From patchwork Fri Dec 6 14:33:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276551 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DAE014BD for ; Fri, 6 Dec 2019 14:34:18 +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 7C4FF2464E for ; Fri, 6 Dec 2019 14:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H8hnSLnf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C4FF2464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=FOWwPX2B3WfACJBBZ/dj+DjEkp5DUBMYXvxyZve8QbY=; b=H8hnSLnfZCi0nD f1YP5+Wf0+KKanqyyVe4xb9unVKldwU4oIRzJ4KVRVJpJRGMbVXjcWUbQYBS0XhH9zszLpsHb/7De lZmCU7Ipl19w56pDW0fkJYtOBnX+ZkkRfVTj2QPBgUM+c0+JXZ0qaLnBJw7+03l0uuQz9dv39UhPY WbHJCeMT3ZswxXq0KPhNBIxGXsgmRhkbSpcNAt47Ze8qDU2WOx7K6i6E5lqXi6KrdDyNk14T+8Pbx meqGdcoKpoELrVMq+eZ6ulmtohrXYChJClWnVP3CQHUUoA3LusfHda3nMO4O9OrZuaVSuxh1JyY7r 1xZvkH8NxITGKKjHQ31Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgS-000702-KF; Fri, 06 Dec 2019 14:34:16 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006sA-Rw for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:13 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgG-0004Lm-4R; Fri, 06 Dec 2019 15:34:04 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 3/7] mac80211: add handling for BSS color Date: Fri, 6 Dec 2019 15:33:57 +0100 Message-Id: <20191206143401.4080-3-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063411_057532_3D9D8CAE X-CRM114-Status: GOOD ( 12.31 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 It is now possible to propagate BSS color settings into the subsystem. Lets make mac80211 also handle them so that we can send them further down the stack into the drivers. We continue to populate the old bss_color field until all users have been updated to use the new he_bss_color struct. Signed-off-by: John Crispin --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 5 ++++- net/mac80211/mlme.c | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 16a5525ddab1..994686443553 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -316,6 +316,7 @@ struct ieee80211_vif_chanctx_switch { * functionality changed for this BSS (AP mode). * @BSS_CHANGED_TWT: TWT status changed * @BSS_CHANGED_HE_OBSS_PD: OBSS Packet Detection status changed. + * @BSS_CHANGED_HE_BSS_COLOR: BSS Color has changed * */ enum ieee80211_bss_change { @@ -348,6 +349,7 @@ enum ieee80211_bss_change { BSS_CHANGED_FTM_RESPONDER = 1<<26, BSS_CHANGED_TWT = 1<<27, BSS_CHANGED_HE_OBSS_PD = 1<<28, + BSS_CHANGED_HE_BSS_COLOR = 1<<29, /* when adding here, make sure to change ieee80211_reconfig */ }; diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ed56b0c6fe19..e109b47c4219 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -981,7 +981,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, BSS_CHANGED_P2P_PS | BSS_CHANGED_TXPOWER | BSS_CHANGED_TWT | - BSS_CHANGED_HE_OBSS_PD; + BSS_CHANGED_HE_OBSS_PD | + BSS_CHANGED_HE_BSS_COLOR; int err; int prev_beacon_int; @@ -1054,6 +1055,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, sdata->vif.bss_conf.twt_responder = params->twt_responder; memcpy(&sdata->vif.bss_conf.he_obss_pd, ¶ms->he_obss_pd, sizeof(struct ieee80211_he_obss_pd)); + memcpy(&sdata->vif.bss_conf.he_bss_color, ¶ms->he_bss_color, + sizeof(struct ieee80211_he_bss_color)); sdata->vif.bss_conf.ssid_len = params->ssid_len; if (params->ssid_len) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 641876982ab9..319d43f4082b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3372,8 +3372,16 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, if (bss_conf->he_support) { bss_conf->bss_color = + bss_conf->he_bss_color.color = le32_get_bits(elems.he_operation->he_oper_params, IEEE80211_HE_OPERATION_BSS_COLOR_MASK); + bss_conf->he_bss_color.partial = + le32_get_bits(elems.he_operation->he_oper_params, + IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR); + bss_conf->he_bss_color.disabled = + le32_get_bits(elems.he_operation->he_oper_params, + IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED); + changed |= BSS_CHANGED_HE_BSS_COLOR; bss_conf->htc_trig_based_pkt_ext = le32_get_bits(elems.he_operation->he_oper_params, From patchwork Fri Dec 6 14:33:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276543 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 856DB14BD for ; Fri, 6 Dec 2019 14:34:15 +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 48D502464E for ; Fri, 6 Dec 2019 14:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tQWooGSQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48D502464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=wGIaoGVizhjiwQo/OaTSbq80yuP+m9fkQEO4pvfzZQY=; b=tQWooGSQIneetn V6RTlnnYcW9HhVC6WoOMqFFfCYoBsBR/ZmjtzO9kLqSIHnfg1v+OTNPoJcsagVMWhnZNDREoa3f68 kAzdJKWOG9cFy9g9RWYRxBGQiQFJDX6zP/B2Y/ZkGB65O8ezyeXk79F4LRBkHRtpEkdhsxbJIMC+S BxhPlQZDABR3nuHSZd7U2SEHDYWClLtNzphdB+F/ZTOc2BoPFwjxmc3ocxezxLAalrJ84T9a1D/ai Kt97fOlJ+1MbUJexJye88oev7ihJF+uwHjFcTNrXL1FsVbAY0rvsNvCuaEyOOHEf+iY9AFUc9Y6cN 0UxEh07jWrv+hBhjJayg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgO-0006wL-U4; Fri, 06 Dec 2019 14:34:12 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006px-8s for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:11 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgG-0004Lm-Qt; Fri, 06 Dec 2019 15:34:05 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 4/7] iwlwifi: use new bss_color struct Date: Fri, 6 Dec 2019 15:33:58 +0100 Message-Id: <20191206143401.4080-4-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_475078_D78C25A8 X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 We will be removing the bss_color element. Lets use the he_bss_color struct instead. Signed-off-by: John Crispin --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index b74bd58f3f45..f0bf42f91af1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -2225,7 +2225,7 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, struct iwl_he_sta_context_cmd sta_ctxt_cmd = { .sta_id = sta_id, .tid_limit = IWL_MAX_TID_COUNT, - .bss_color = vif->bss_conf.bss_color, + .bss_color = vif->bss_conf.he_bss_color.color, .htc_trig_based_pkt_ext = vif->bss_conf.htc_trig_based_pkt_ext, .frame_time_rts_th = cpu_to_le16(vif->bss_conf.frame_time_rts_th), From patchwork Fri Dec 6 14:33:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276547 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4C9217EF for ; Fri, 6 Dec 2019 14:34:17 +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 B04842464E for ; Fri, 6 Dec 2019 14:34:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tqz9vXQj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B04842464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=cfeu1OegPKmQZ8f1yzsGXksaPwWwPQ7LBOpSyEqpN1M=; b=tqz9vXQj/a2GUD 4oRHO3YDGMKKsrCEHg8bbupPv0/qyTBpKm6s9my0fLvZ3bQDCxxPvbrwVWeIGrMk3bpaWiv2m+dPd EE/KUnwZmnnoQLkYJajDOi9EvDksfvtBOfFpbsNAhlCPGl7msVF2gBkVp9Ob6dLFRaIroSnF6timX 5FtPw7DGI+3pbvM/L1UaFlyC3p7tV8FrEaS8Uyx4FYhMehKtI4kQtIRNacvtJTE5KAZXUSjwLucXc Ep20mW6+vpCBBSP7t9521HabelrE4qsQ/5ENHDZUQbEkyvnKzAIObul51CkWoATFLsUEGyfDstLvQ pmUFVdfjm9NqrYmYReuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgR-0006yi-Qh; Fri, 06 Dec 2019 14:34:15 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006uV-CS for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:13 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgH-0004Lm-L3; Fri, 06 Dec 2019 15:34:05 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 5/7] mac80211: drop now unused bss_color element Date: Fri, 6 Dec 2019 15:33:59 +0100 Message-Id: <20191206143401.4080-5-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_591839_C0952A5D X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 With all users of bss_color converted we can drop the old element. Driver code should now use the new he_bss_color struct. Signed-off-by: John Crispin --- include/net/mac80211.h | 2 -- net/mac80211/mlme.c | 1 - 2 files changed, 3 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 994686443553..9a67fd2cfe4b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -496,7 +496,6 @@ struct ieee80211_ftm_responder_params { * This structure keeps information about a BSS (and an association * to that BSS) that can change during the lifetime of the BSS. * - * @bss_color: 6-bit value to mark inter-BSS frame, if BSS supports HE * @htc_trig_based_pkt_ext: default PE in 4us units, if BSS supports HE * @multi_sta_back_32bit: supports BA bitmap of 32-bits in Multi-STA BACK * @uora_exists: is the UORA element advertised by AP @@ -610,7 +609,6 @@ struct ieee80211_ftm_responder_params { */ struct ieee80211_bss_conf { const u8 *bssid; - u8 bss_color; u8 htc_trig_based_pkt_ext; bool multi_sta_back_32bit; bool uora_exists; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 319d43f4082b..bc602d460b73 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3371,7 +3371,6 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, } if (bss_conf->he_support) { - bss_conf->bss_color = bss_conf->he_bss_color.color = le32_get_bits(elems.he_operation->he_oper_params, IEEE80211_HE_OPERATION_BSS_COLOR_MASK); From patchwork Fri Dec 6 14:34:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11276553 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE30517EF for ; Fri, 6 Dec 2019 14:34:18 +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 CCE422464E for ; Fri, 6 Dec 2019 14:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M9vk+q3n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCE422464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=prf+KHdTX/D22g46eHqvwWCm+IJdM8SCJ/ZwAzlPAbs=; b=M9vk+q3nleGNVq GjJVFZYLDAVd+Yypq3BgSaofjiQJVsYGuQDmVIqkOi6hxSgTvKcjSfMhDp4RlXt4hYhplZOYSHdJy 9S8xYmztGlKt0BOa+ie2HIQQYY9DORiRBjc4XH/DykZfM4N6R6pdpKo0EnaDX2EZy1InTRLOw0RWk HOut6atyKnefRI7dt0EPolI1jUgS9/6ZmQe2Ckgp0Gz3y1UHzPvT9tQWVwCybIkc7VRAAVfLG6y/X JQ/9f35BzAK3ZAvRkGrFEyYfDzTnupb6IRl2VPmf7ULCDYkUlZh012l9/si6hCYqYC3ib/hlGdpyh T3UQJkobx67BiPVGCzYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgT-00070i-5C; Fri, 06 Dec 2019 14:34:17 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006uW-NV for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:13 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgI-0004Lm-AJ; Fri, 06 Dec 2019 15:34:06 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 6/7] ath11k: add WMI calls required for handling BSS color Date: Fri, 6 Dec 2019 15:34:00 +0100 Message-Id: <20191206143401.4080-6-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_919224_84C4F97A X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 If the he_operation field of the beacon sets a BSS color, we need to inform the FW of the settings. This patch adds the WMI command handlers required to do so. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/wmi.c | 67 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/wmi.h | 31 +++++++++++++ 2 files changed, 98 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 8cf7220a95f9..5d9276db9a85 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -2789,6 +2789,73 @@ ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id, return ret; } +int +ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id, + u8 bss_color, u32 period, + bool enable) +{ + struct ath11k_pdev_wmi *wmi = ar->wmi; + struct ath11k_base *ab = wmi->wmi_ab->ab; + struct wmi_obss_color_collision_cfg_params_cmd *cmd; + struct sk_buff *skb; + int ret, len; + + len = sizeof(*cmd); + + skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); + if (!skb) + return -ENOMEM; + + cmd = (struct wmi_obss_color_collision_cfg_params_cmd *)skb->data; + cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_OBSS_COLOR_COLLISION_DET_CONFIG) | + FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); + cmd->vdev_id = vdev_id; + cmd->evt_type = enable ? ATH11K_OBSS_COLOR_COLLISION_DETECTION : + ATH11K_OBSS_COLOR_COLLISION_DETECTION_DISABLE; + cmd->current_bss_color = bss_color; + cmd->detection_period_ms = period; + cmd->scan_period_ms = ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS; + cmd->free_slot_expiry_time_ms = 0; + cmd->flags = 0; + + ret = ath11k_wmi_cmd_send(wmi, skb, + WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID); + if (ret) { + ath11k_warn(ab, "Failed to send WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID"); + dev_kfree_skb(skb); + } + return ret; +} + +int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id, bool enable) +{ + struct ath11k_pdev_wmi *wmi = ar->wmi; + struct ath11k_base *ab = wmi->wmi_ab->ab; + struct wmi_bss_color_change_enable_params_cmd *cmd; + struct sk_buff *skb; + int ret, len; + + len = sizeof(*cmd); + + skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, len); + if (!skb) + return -ENOMEM; + + cmd = (struct wmi_bss_color_change_enable_params_cmd *)skb->data; + cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_BSS_COLOR_CHANGE_ENABLE) | + FIELD_PREP(WMI_TLV_LEN, len - TLV_HDR_SIZE); + cmd->vdev_id = vdev_id; + cmd->enable = enable ? 1 : 0; + + ret = ath11k_wmi_cmd_send(wmi, skb, + WMI_BSS_COLOR_CHANGE_ENABLE_CMDID); + if (ret) { + ath11k_warn(ab, "Failed to send WMI_TWT_DIeABLE_CMDID"); + dev_kfree_skb(skb); + } + return ret; +} + static void ath11k_fill_band_to_mac_param(struct ath11k_base *soc, struct wmi_host_pdev_band_to_mac *band_to_mac) diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 4dbcb9dc0f8d..f62f796305aa 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -483,6 +483,7 @@ enum wmi_tlv_cmd_id { WMI_SAR_LIMITS_CMDID, WMI_OBSS_SCAN_ENABLE_CMDID = WMI_TLV_CMD(WMI_GRP_OBSS_OFL), WMI_OBSS_SCAN_DISABLE_CMDID, + WMI_OBSS_COLOR_COLLISION_DET_CONFIG_CMDID, WMI_LPI_MGMT_SNOOPING_CONFIG_CMDID = WMI_TLV_CMD(WMI_GRP_LPI), WMI_LPI_START_SCAN_CMDID, WMI_LPI_STOP_SCAN_CMDID, @@ -4694,6 +4695,30 @@ struct wmi_peer_oper_mode_change_event { u32 new_disablemu; } __packed; +#define ATH11K_BSS_COLOR_COLLISION_SCAN_PERIOD_MS 200 +#define ATH11K_OBSS_COLOR_COLLISION_DETECTION_DISABLE 0 +#define ATH11K_OBSS_COLOR_COLLISION_DETECTION 1 + +#define ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS 10000 +#define ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS 5000 + +struct wmi_obss_color_collision_cfg_params_cmd { + u32 tlv_header; + u32 vdev_id; + u32 flags; + u32 evt_type; + u32 current_bss_color; + u32 detection_period_ms; + u32 scan_period_ms; + u32 free_slot_expiry_time_ms; +} __packed; + +struct wmi_bss_color_change_enable_params_cmd { + u32 tlv_header; + u32 vdev_id; + u32 enable; +} __packed; + struct target_resource_config { u32 num_vdevs; u32 num_peers; @@ -4892,4 +4917,10 @@ int ath11k_wmi_send_twt_resume_dialog_cmd(struct ath11k *ar, struct wmi_twt_resume_dialog_params *params); int ath11k_wmi_send_obss_spr_cmd(struct ath11k *ar, u32 vdev_id, struct ieee80211_he_obss_pd *he_obss_pd); +int ath11k_wmi_send_obss_color_collision_cfg_cmd(struct ath11k *ar, u32 vdev_id, + u8 bss_color, u32 period, + bool enable); +int ath11k_wmi_send_bss_color_change_enable_cmd(struct ath11k *ar, u32 vdev_id, + bool enable); + #endif From patchwork Fri Dec 6 14:34: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: 11276549 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44510139A for ; Fri, 6 Dec 2019 14:34:18 +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 229322464E for ; Fri, 6 Dec 2019 14:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VNxdRBB+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 229322464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org 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=0Lm652oxuVZu83TPcbT3lG+UquR4wdMvF5BeHN+Th58=; b=VNxdRBB+7qjWd3 mqnJhvJHciiwhLJ0U/4Z6tt6Bnd0V4bB1Pad/nB3pUtSzOcN1fjCguk0UHR/q2ldUrmlsHsUvZPs/ gIq6s4C8w2NzSuk0IRNeG9rjyKlEEWQbiNPD6tdRw0mr1R5+8IZFYwXiCP3Rx4qGrWteJF6lEPddb BetgRz7Qlzpx9cZ0Frqfi0mb8eHIZAryAAb9w1gMqgqTCxi1Kp+0Jxy15DvdIZqEBUG2rgtZUb5I2 ms1TObqJBwk6VfePmNKpNqSoF3Mv7/XPZw/3WH98M90hpJ6xFc4zaELV+gkKf6wevvZyO7C7lqtgZ RYm0aPHS+qT9DBdugwsA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgS-0006zI-8Q; Fri, 06 Dec 2019 14:34:16 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1idEgM-0006uX-Pn for ath11k@lists.infradead.org; Fri, 06 Dec 2019 14:34:13 +0000 Received: from tmo-101-57.customers.d1-online.com ([80.187.101.57] helo=bertha.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1idEgJ-0004Lm-28; Fri, 06 Dec 2019 15:34:07 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 7/7] ath11k: add handling for BSS color Date: Fri, 6 Dec 2019 15:34:01 +0100 Message-Id: <20191206143401.4080-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206143401.4080-1-john@phrozen.org> References: <20191206143401.4080-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191206_063410_988626_16C4FD3C X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 This patch adds code to handle the BSS_CHANGED_BSS_COLOR flag. IT will trigger the propagation of BSS color settings into the FW. Handling is slightly different between AP and STA interfaces. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 6a8c1c3b8da2..c692922513b2 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1928,6 +1928,19 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, ath11k_wmi_send_obss_spr_cmd(ar, arvif->vdev_id, &info->he_obss_pd); + if (changed & BSS_CHANGED_HE_BSS_COLOR) { + if (vif->type == NL80211_IFTYPE_AP) { + ath11k_wmi_send_obss_color_collision_cfg_cmd( + ar, arvif->vdev_id, info->he_bss_color.color, + ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS, + !info->he_bss_color.disabled); + } else if (vif->type == NL80211_IFTYPE_STATION) { + ath11k_wmi_send_bss_color_change_enable_cmd(ar, arvif->vdev_id, 1); + ath11k_wmi_send_obss_color_collision_cfg_cmd(ar, arvif->vdev_id, 0, + ATH11K_BSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS, 1); + } + } + mutex_unlock(&ar->conf_mutex); }