From patchwork Thu Jun 4 07:09:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587031 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 635C1913 for ; Thu, 4 Jun 2020 07:10: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 41A45206DC for ; Thu, 4 Jun 2020 07:10: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="q/oL22hl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41A45206DC 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=VrkL7+nplfhDIA5fOKHMpiLebu0dyWuIznp+zzHzB5A=; b=q/oL22hl/UWmr6 lBc57gWfixBYDSbWQzW3Um4ra0SoG6jx1V7oncR6wQ7ehQW6/n5A/vdk1KHcHOuzAL8xrhrR7RG4e /ENaLUibzFm3aOtlHEM1rqWq4QFTnVWebaf6LP9ypDZ7s8lx3D1T9pRTbs2YWDjekpPv7iqVm1zE9 brTzRC1qysS6S9e2+li0Z8m1bjI38e6ClTNuH0IXZT3wh3WbpQGF2Vgexr6B1sdM55YwRNi+WMOje dpf1cr4RuSJal6m4Hs04EZuVUDb8mT6zGGMJThCKM0k/zFqJsDWPJ3+RJbls0lQbenIZTAQs6KAQk Et4hCU5NfigC1NuB8DfA==; 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 1jgk11-0001yy-4m; Thu, 04 Jun 2020 07:10: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 1jgk0p-0000GK-50 for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:06 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0k-0001P3-Ep; Thu, 04 Jun 2020 09:09:58 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 01/12] nl80211: add basic multiple bssid support Date: Thu, 4 Jun 2020 09:09:41 +0200 Message-Id: <20200604070952.15481-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_385693_35AD782E X-CRM114-Status: GOOD ( 15.98 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 support for passing the multiple bssid config to the kernel when adding an interface. A bss can be legacy, transmitting or non-transmitting. A non-transmitting BSSID will have a parent interface, which needs to be transmitting. Signed-off-by: John Crispin --- include/net/cfg80211.h | 8 ++++++++ include/uapi/linux/nl80211.h | 25 +++++++++++++++++++++++++ net/wireless/nl80211.c | 14 ++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index deaa3668d47a..f0fc65f900b4 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -601,6 +601,8 @@ struct vif_params { u8 macaddr[ETH_ALEN]; const u8 *vht_mumimo_groups; const u8 *vht_mumimo_follow_addr; + enum nl80211_multi_bssid_mode multi_bssid_mode; + u32 multi_bssid_parent; }; /** @@ -5060,6 +5062,9 @@ struct cfg80211_cqm_config; * @pmsr_list: (private) peer measurement requests * @pmsr_lock: (private) peer measurements requests/results lock * @pmsr_free_wk: (private) peer measurements cleanup work + * @multi_bssid_mode: Is this a legacy, transmitted or non-transmitted bssid + * @multi_bssid_parent: a non-transmitted bssid has a transmitted parent + * @multi_bssid_list: linked list for tracking parent - child relations. */ struct wireless_dev { struct wiphy *wiphy; @@ -5136,6 +5141,9 @@ struct wireless_dev { struct list_head pmsr_list; spinlock_t pmsr_lock; struct work_struct pmsr_free_wk; + enum nl80211_multi_bssid_mode multi_bssid_mode; + struct wireless_dev *multi_bssid_parent; + struct list_head multi_bssid_list; }; static inline u8 *wdev_address(struct wireless_dev *wdev) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 966887bd654c..a586567f18ea 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2470,6 +2470,12 @@ enum nl80211_commands { * no roaming occurs between the reauth threshold and PMK expiration, * disassociation is still forced. * + * @NL80211_ATTR_MULTI_BSSID_MODE: Set the (Non-)Transmitted flag for this + * BSSIDs beacon. + * + * @NL80211_ATTR_MULTI_BSSID_PARENT: If this is a Non-Transmitted BSSID, define + * the parent interface. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -2945,6 +2951,9 @@ enum nl80211_attrs { NL80211_ATTR_PMK_LIFETIME, NL80211_ATTR_PMK_REAUTH_THRESHOLD, + NL80211_ATTR_MULTI_BSSID_MODE, + NL80211_ATTR_MULTI_BSSID_PARENT, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -6700,6 +6709,22 @@ enum nl80211_peer_measurement_ftm_failure_reasons { NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS, }; +/** + * enum nl80211_multi_bssid_mode - Multiple BSSID beacon type + * + * Used by cfg80211_ap_settings + * + * @MULTIPLE_BSSID_LEGACY: This BSS is not part of a multiple BSSID group + * @MULTIPLE_BSSID_TRANSMITTED: This BSS is broadcasting a multiple BSSID + * beacon + * @MULTIPLE_BSSID_NON_TRANSMITTED: This BSS is not broadcasting a beacon + */ +enum nl80211_multi_bssid_mode { + NL80211_MULTIPLE_BSSID_LEGACY = 0, + NL80211_MULTIPLE_BSSID_TRANSMITTED, + NL80211_MULTIPLE_BSSID_NON_TRANSMITTED, +}; + /** * enum nl80211_peer_measurement_ftm_resp - FTM response attributes * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index ed545b2a958d..3b502514944c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -663,6 +663,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_CONTROL_PORT_NO_PREAUTH] = { .type = NLA_FLAG }, [NL80211_ATTR_PMK_LIFETIME] = NLA_POLICY_MIN(NLA_U32, 1), [NL80211_ATTR_PMK_REAUTH_THRESHOLD] = NLA_POLICY_RANGE(NLA_U8, 1, 100), + [NL80211_ATTR_MULTI_BSSID_MODE] = NLA_POLICY_RANGE(NLA_U8, + NL80211_MULTIPLE_BSSID_LEGACY, + NL80211_MULTIPLE_BSSID_NON_TRANSMITTED), + [NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 }, }; /* policy for the key attributes */ @@ -3756,6 +3760,16 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) if (err < 0) return err; + if (info->attrs[NL80211_ATTR_MULTI_BSSID_MODE]) + params.multi_bssid_mode = + nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_MODE]); + if (info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT]) + params.multi_bssid_parent = + nla_get_u8(info->attrs[NL80211_ATTR_MULTI_BSSID_PARENT]); + if (params.multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED && + !params.multi_bssid_parent) + return -EOPNOTSUPP; + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); if (!msg) return -ENOMEM; From patchwork Thu Jun 4 07:09:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587035 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 821EF1392 for ; Thu, 4 Jun 2020 07:10:21 +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 5F152206DC for ; Thu, 4 Jun 2020 07:10:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I+jz3QCP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F152206DC 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=0xyc/Os4tHTb82L5woy8/jc6NbL6ScoCNW/Qk48SH0A=; b=I+jz3QCPciDvvw 9da9IzrGBwsbg0uAv5mQh3bvHnbmE/AwLF5csxPJ30TbjHJBAt51LfDV4gAoNFIt7bvLR5b0knXJv lHyK0ZS4BN1+9esDfmDxa6hje5vyJgagH0lGAFUpEfJAFsH7VHGR4YtQY+sT1mcs4AsH5ZadDwTYo Vk7H4XiH9QPMtZ8QWLeYoQ47K23U5qgRWc5kG1gqmY9MOG7z4RDsg6MD+KOI50ctiFhduZFL2UBro 8zf5QNfXXzlQAZIj5dSpIGBFZmedfUSM0WW61fbZg/JZUfgN3bXxgC27LyitN0FQiZEfAj6ABOFxc el8zkj/Bayt/ujapOohA==; 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 1jgk15-0002oN-Kz; Thu, 04 Jun 2020 07:10:19 +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 1jgk0p-0000GM-5w for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:06 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0k-0001P3-PN; Thu, 04 Jun 2020 09:09:58 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 02/12] nl80211: add attributes for multiple bssid related settings Date: Thu, 4 Jun 2020 09:09:42 +0200 Message-Id: <20200604070952.15481-3-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_402791_EAA536DF X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 When we start a multiple bssid AP we need to pass the index and number of peers aswell to the kernel. This info needs to be propagated to the driver. Signed-off-by: John Crispin --- include/net/cfg80211.h | 12 ++++++++++++ include/uapi/linux/nl80211.h | 7 +++++++ net/wireless/nl80211.c | 15 +++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f0fc65f900b4..77cd2f780c6a 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -448,6 +448,17 @@ struct ieee80211_supported_band { const struct ieee80211_sband_iftype_data *iftype_data; }; +/** + * struct ieee80211_multi_bssid - AP settings for multi bssid + * + * @index: the index of this AP in the multi bssid group. + * @count: the total number of multi bssid peer APs. + */ +struct ieee80211_multi_bssid { + u32 index; + u32 count; +}; + /** * ieee80211_get_sband_iftype_data - return sband data for a given iftype * @sband: the sband to search for the STA on @@ -1113,6 +1124,7 @@ struct cfg80211_ap_settings { u32 flags; struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; + struct ieee80211_multi_bssid multi_bssid; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index a586567f18ea..f18f681796ed 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2476,6 +2476,11 @@ enum nl80211_commands { * @NL80211_ATTR_MULTI_BSSID_PARENT: If this is a Non-Transmitted BSSID, define * the parent interface. * + * @NL80211_ATTR_MULTI_BSSID_INDEX: The index of this BSS inside the multi bssid + * IE. + * + * @NL80211_ATTR_MULTI_BSSID_COUNT: The number of BSSs inside the multi bssid IE. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -2953,6 +2958,8 @@ enum nl80211_attrs { NL80211_ATTR_MULTI_BSSID_MODE, NL80211_ATTR_MULTI_BSSID_PARENT, + NL80211_ATTR_MULTI_BSSID_INDEX, + NL80211_ATTR_MULTI_BSSID_COUNT, /* add attributes here, update the policy in nl80211.c */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3b502514944c..58ce67bc31da 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -667,6 +667,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { NL80211_MULTIPLE_BSSID_LEGACY, NL80211_MULTIPLE_BSSID_NON_TRANSMITTED), [NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTI_BSSID_INDEX] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTI_BSSID_COUNT] = { .type = NLA_U32 }, }; /* policy for the key attributes */ @@ -4996,6 +4998,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) !info->attrs[NL80211_ATTR_BEACON_HEAD]) return -EINVAL; + if (wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED && + (!info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX] || + !info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT])) + return -EINVAL; + err = nl80211_parse_beacon(rdev, info->attrs, ¶ms.beacon); if (err) return err; @@ -5150,6 +5157,14 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) return err; } + if (info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX]) + params.multi_bssid.index = nla_get_u32( + info->attrs[NL80211_ATTR_MULTI_BSSID_INDEX]); + + if (info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]) + params.multi_bssid.count = nla_get_u32( + info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]); + nl80211_calculate_ap_params(¶ms); if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) From patchwork Thu Jun 4 07:09:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587029 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 37D89913 for ; Thu, 4 Jun 2020 07:10:16 +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 EF91F206DC for ; Thu, 4 Jun 2020 07:10: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="CMZPAH62" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF91F206DC 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=/FBJl04ghV19tGfv5/uMF6wAKS/yGv/cbSXrMy3KY5E=; b=CMZPAH62SkYizq EWrAzmsiZLEk0NIOhqInC1jO8D4qBNey5fkRjvau+mucrg4PI8O4AzxBIx2ApB5czLahKxekXm9RT EYac/TklMvrA3TpQRBvrQjPHEP03UgLxkJkDJ6uG6lUskpy6jU3A9qSGrblUyUSKjXQew4R4VX21d yFD1ocpM1Y2NRpKI/ISbU4QyApAE7DJfbvWy7mQFZ9wTQ0K1PEu5h7Rm0ncd9fJpF5LShebNh4/Es I2u6epzYkVMlS6DOjrH4FSd5bsYRYda3sq0MCHAdaaPCE1nhDHvwvSVd8wgQXImCFd7/tqKVk4Hzs mouzIpS2nfb/OUThaITA==; 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 1jgk0z-0001bG-4K; Thu, 04 Jun 2020 07:10: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 1jgk0p-0000GN-FI for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:05 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0k-0001P3-Vc; Thu, 04 Jun 2020 09:09:59 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 03/12] nl80211: add attributes to set beacon transmit mode Date: Thu, 4 Jun 2020 09:09:43 +0200 Message-Id: <20200604070952.15481-4-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_671206_506B7F0D X-CRM114-Status: GOOD ( 13.03 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 Beacons on a radio can be sent out in burst (back to back) or staggered (equally spread out over time) mode. This patch adds the required nl80211 attributes allowing us to configure this from userland. Signed-off-by: John Crispin --- include/net/cfg80211.h | 3 +++ include/uapi/linux/nl80211.h | 17 +++++++++++++++++ net/wireless/nl80211.c | 7 +++++++ 3 files changed, 27 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 77cd2f780c6a..157d37f74efb 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1094,6 +1094,8 @@ enum cfg80211_ap_settings_flags { * @he_obss_pd: OBSS Packet Detection settings * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) + * @beacon_tx_mode: can be set to tell the driver to sent the beacons in staggered + * or burst mode. */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; @@ -1125,6 +1127,7 @@ struct cfg80211_ap_settings { struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; struct ieee80211_multi_bssid multi_bssid; + enum nl80211_beacon_tx_mode beacon_tx_mode; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index f18f681796ed..2c4950aeb474 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2481,6 +2481,8 @@ enum nl80211_commands { * * @NL80211_ATTR_MULTI_BSSID_COUNT: The number of BSSs inside the multi bssid IE. * + * @NL80211_ATTR_BEACON_TX_MODE: Set the beacon tx mode to staggered or burst. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -2961,6 +2963,8 @@ enum nl80211_attrs { NL80211_ATTR_MULTI_BSSID_INDEX, NL80211_ATTR_MULTI_BSSID_COUNT, + NL80211_ATTR_BEACON_TX_MODE, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -6732,6 +6736,19 @@ enum nl80211_multi_bssid_mode { NL80211_MULTIPLE_BSSID_NON_TRANSMITTED, }; +/** + * enum nl80211_beacon_tx_mode - Beacon tx mode settings + * + * @BEACON_TX_MODE_DEFAULT: The beacons shall be sent out in its default mode + * @BEACON_TX_MODE_STAGGERED: The beacons shall be sent out in staggered mode + * @BEACON_TX_MODE_BURST: The beacons shall be sent out in burst mode + * beacon + */ +enum nl80211_beacon_tx_mode { + NL80211_BEACON_TX_MODE_STAGGERED = 0, + NL80211_BEACON_TX_MODE_BURST, +}; + /** * enum nl80211_peer_measurement_ftm_resp - FTM response attributes * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 58ce67bc31da..1f6f8ecbfb57 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -669,6 +669,9 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MULTI_BSSID_PARENT] = { .type = NLA_U32 }, [NL80211_ATTR_MULTI_BSSID_INDEX] = { .type = NLA_U32 }, [NL80211_ATTR_MULTI_BSSID_COUNT] = { .type = NLA_U32 }, + [NL80211_ATTR_BEACON_TX_MODE] = NLA_POLICY_RANGE(NLA_U8, + NL80211_BEACON_TX_MODE_STAGGERED, + NL80211_BEACON_TX_MODE_BURST), }; /* policy for the key attributes */ @@ -5165,6 +5168,10 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) params.multi_bssid.count = nla_get_u32( info->attrs[NL80211_ATTR_MULTI_BSSID_COUNT]); + if (info->attrs[NL80211_ATTR_BEACON_TX_MODE]) + params.beacon_tx_mode = + nla_get_u8(info->attrs[NL80211_ATTR_BEACON_TX_MODE]); + nl80211_calculate_ap_params(¶ms); if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) From patchwork Thu Jun 4 07:09:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587019 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 70A151392 for ; Thu, 4 Jun 2020 07:10:10 +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 4D3A6206DC for ; Thu, 4 Jun 2020 07:10:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E9lhNIuw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D3A6206DC 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=UQRA3nX/4Nc5E4m7dutUwfHdWsHuQRMAAESRZJVrhL4=; b=E9lhNIuwfsujOp 1R+X87M3ZN4BOgBuPDe/Av/HtO+iqth5nB9C0KIgFSj/a35BJ3fRFO8nSC59JEbtZDhrkyUt2QTPC MvMuT6eHJ+rsrfifEj1yW9/IXrmzd9E54utDqLp3Ry33mV6zN0uy3Fozp0ZY4vkt4+limA7dtyHNw MVuiuUzN5wZ2m/ZXip7t1W1hBufwnfwfJ/EQnGoWDysWzhuYQPJf7Hb2GWT95UA3p8vGGquMDeg9T OFvU2eXL6asVwdGL7fLXsvpajX+cZntdR5/2r+lcvW4ftVpXfD4IaKLpsRHeo2yMYvjnZAuImtv0W 1DvSm2O1JVVvobzxDkLw==; 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 1jgk0s-0000Ll-GW; Thu, 04 Jun 2020 07:10:06 +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 1jgk0o-0000GP-Ip for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:04 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0l-0001P3-5b; Thu, 04 Jun 2020 09:09:59 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 04/12] mac80211: add multiple bssid support Date: Thu, 4 Jun 2020 09:09:44 +0200 Message-Id: <20200604070952.15481-5-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001002_777624_2806A6FA X-CRM114-Status: GOOD ( 16.48 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 When bringing up multi bssid APs we need to track the parent-child relation of non-transmitting and transmitting VAPs. The patch makes sure that * a parent can not be deleted while it has children * a parent can only be opened when all children are open * a childs parent needs to exist when the child is added * a child can only be closed when its parent is already closed This patch ensures the above by using a linked list to track the relations. Signed-off-by: John Crispin --- include/net/mac80211.h | 20 ++++++++++++++ net/mac80211/cfg.c | 61 ++++++++++++++++++++++++++++++++++++++++++ net/mac80211/iface.c | 16 +++++++++++ net/mac80211/util.c | 27 +++++++++++++++++++ 4 files changed, 124 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b6b4de0e4b5e..bb2edace71a9 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -6529,4 +6529,24 @@ u32 ieee80211_calc_tx_airtime(struct ieee80211_hw *hw, */ bool ieee80211_set_hw_80211_encap(struct ieee80211_vif *vif, bool enable); +/** + * ieee80211_get_multi_bssid_mode - get a vifs multi bssid mode. + * + * This function is used to help look up the multi bssid mode which is tracked + * inside the wdev. + * + * @vif: &struct ieee80211_vif pointer from the add_interface callback. + */ +enum nl80211_multi_bssid_mode ieee80211_get_multi_bssid_mode(struct ieee80211_vif *vif); + +/** + * ieee80211_get_multi_bssid_parent - get a vifs multi bssid parent. + * + * This function is used to help look up the multi bssid parent which is tracked + * inside the wdev. + * + * @vif: &struct ieee80211_vif pointer from the add_interface callback. + */ +struct ieee80211_vif *ieee80211_get_multi_bssid_parent(struct ieee80211_vif *vif); + #endif /* MAC80211_H */ diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ea3791a930e8..e4f73567d873 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -111,6 +111,42 @@ static int ieee80211_set_mon_options(struct ieee80211_sub_if_data *sdata, return 0; } +static int ieee80211_set_multi_bssid_options(struct ieee80211_sub_if_data *sdata, + struct vif_params *params) +{ + struct ieee80211_local *local = sdata->local; + struct wiphy *wiphy = local->hw.wiphy; + struct net_device *parent; + + if (params->multi_bssid_mode && + !ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID)) + return -ENOTSUPP; + + switch (params->multi_bssid_mode) { + case NL80211_MULTIPLE_BSSID_NON_TRANSMITTED: + parent = __dev_get_by_index(wiphy_net(wiphy), + params->multi_bssid_parent); + if (!parent || !parent->ieee80211_ptr || + parent->ieee80211_ptr->multi_bssid_mode != + NL80211_MULTIPLE_BSSID_TRANSMITTED) + return -EINVAL; + sdata->wdev.multi_bssid_parent = parent->ieee80211_ptr; + list_add(&sdata->wdev.multi_bssid_list, + &parent->ieee80211_ptr->multi_bssid_list); + break; + + case NL80211_MULTIPLE_BSSID_TRANSMITTED: + INIT_LIST_HEAD(&sdata->wdev.multi_bssid_list); + break; + + default: + break; + } + sdata->wdev.multi_bssid_mode = params->multi_bssid_mode; + + return 0; +} + static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, const char *name, unsigned char name_assign_type, @@ -136,11 +172,36 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, } } + if (type == NL80211_IFTYPE_AP) { + err = ieee80211_set_multi_bssid_options(sdata, params); + if (err) { + ieee80211_if_remove(sdata); + return NULL; + } + } + return wdev; } static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) { + struct ieee80211_sub_if_data *sdata; + + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + switch (sdata->wdev.multi_bssid_mode) { + case NL80211_MULTIPLE_BSSID_TRANSMITTED: + if (!list_empty(&sdata->wdev.multi_bssid_list)) + return -EBUSY; + break; + + case NL80211_MULTIPLE_BSSID_NON_TRANSMITTED: + list_del(&sdata->wdev.multi_bssid_list); + break; + + default: + break; + } + ieee80211_if_remove(IEEE80211_WDEV_TO_SUB_IF(wdev)); return 0; diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index d069825705d6..4d3d8ee99960 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -535,6 +535,15 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) } case NL80211_IFTYPE_AP: sdata->bss = &sdata->u.ap; + if (wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_TRANSMITTED) { + struct wireless_dev *child; + + /* make sure all children are already up */ + list_for_each_entry(child, &wdev->multi_bssid_list, + multi_bssid_list) + if (!wdev_running(child)) + return -ENETDOWN; + } break; case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_STATION: @@ -795,6 +804,7 @@ static int ieee80211_open(struct net_device *dev) static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_down) { + struct wireless_dev *wdev = ieee80211_vif_to_wdev(&sdata->vif); struct ieee80211_local *local = sdata->local; unsigned long flags; struct sk_buff *skb, *tmp; @@ -805,6 +815,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool cancel_scan; struct cfg80211_nan_func *func; + if (sdata->vif.type == NL80211_IFTYPE_AP && + wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED) + /* make sure the parent is already down */ + if (wdev_running(wdev->multi_bssid_parent)) + return; + clear_bit(SDATA_STATE_RUNNING, &sdata->state); cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 20436c86b9bf..a7c4d6a44e21 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -847,6 +847,33 @@ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif) } EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev); +enum nl80211_multi_bssid_mode ieee80211_get_multi_bssid_mode(struct ieee80211_vif *vif) +{ + struct ieee80211_sub_if_data *sdata; + + if (!vif) + return 0; + + sdata = vif_to_sdata(vif); + + return sdata->wdev.multi_bssid_mode; +} +EXPORT_SYMBOL_GPL(ieee80211_get_multi_bssid_mode); + +struct ieee80211_vif *ieee80211_get_multi_bssid_parent(struct ieee80211_vif *vif) +{ + struct ieee80211_sub_if_data *sdata; + + if (!vif) + return NULL; + + sdata = vif_to_sdata(vif); + if (sdata->wdev.multi_bssid_parent) + return wdev_to_ieee80211_vif(sdata->wdev.multi_bssid_parent); + return NULL; +} +EXPORT_SYMBOL_GPL(ieee80211_get_multi_bssid_parent); + /* * Nothing should have been stuffed into the workqueue during * the suspend->resume cycle. Since we can't check each caller From patchwork Thu Jun 4 07:09:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587033 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 49EEB1392 for ; Thu, 4 Jun 2020 07:10:20 +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 281BA206DC for ; Thu, 4 Jun 2020 07:10:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tmAibGqF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 281BA206DC 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=dUSKR22JrBdkMjSwJyw/CmmTwv56mbXdEwpsyc0wJoU=; b=tmAibGqF7rX48S D5WXLNXEPd4p17tGGT8PfFVgGlHvGgYEgklBUz/ynFwZoKVoisTqFJjJBxriXDrJZC8Udf/yOlzTx DFNl7IvkwpDCWOXg10tbtVUKi8Gp7hVi7nzJwDUKG+L32pe+gxr2OpNWfKtBNmXMLvO5YS8z+I2ar FMNSIkyTdljazpeSeAqzDPyNrH2Y6eBPa1Gw5OzvMkYSFkUDdUnF0QjJX0QnaztLoLdTeObwOQPnP G0YzLvI4U5UQ+WpCvONaOUrQduBdGuahmdxYDsTdT4wBoyA1Psfx99hTSru+hoiFzUXeQSPWb/1Gc O90YwVp19usgNtOhsDHw==; 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 1jgk13-0002Ot-Q6; Thu, 04 Jun 2020 07:10: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 1jgk0p-0000GO-LK for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:06 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0l-0001P3-Fi; Thu, 04 Jun 2020 09:09:59 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 05/12] mac80211: add multiple bssid IE parsing Date: Thu, 4 Jun 2020 09:09:45 +0200 Message-Id: <20200604070952.15481-6-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_849782_8234A826 X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 Drivers might need to know the offset and length of the IE. Add parsing code and propagate the values to the driver using the mutable struct. Signed-off-by: John Crispin --- include/net/mac80211.h | 5 +++++ net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/tx.c | 10 ++++++++++ net/mac80211/util.c | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bb2edace71a9..1a98b3907aa7 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -4717,12 +4717,17 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets * to CSA counters. This array can contain zero values which * should be ignored. + * @mbssid_offset: position of mbssid_offset + * @mbssid_length: position of mbssid_offset */ struct ieee80211_mutable_offsets { u16 tim_offset; u16 tim_length; u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM]; + + u16 multiple_bssid_offset; + u16 multiple_bssid_length; }; /** diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 2502726d0a58..abe488424287 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1520,6 +1520,7 @@ struct ieee802_11_elems { u8 dtim_count; u8 dtim_period; const struct ieee80211_addba_ext_ie *addba_ext_ie; + u16 multiple_bssid_offset; /* length of them, respectively */ u8 ext_capab_len; @@ -1540,6 +1541,7 @@ struct ieee802_11_elems { u8 perr_len; u8 country_elem_len; u8 bssid_index_len; + u8 multiple_bssid_len; /* whether a parse error occurred while retrieving these elements */ bool parse_error; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 49d35936cc9d..5e2879cd24b0 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4747,11 +4747,21 @@ __ieee80211_beacon_get(struct ieee80211_hw *hw, is_template); if (offs) { + struct ieee802_11_elems elems; + offs->tim_offset = beacon->head_len; offs->tim_length = skb->len - beacon->head_len; /* for AP the csa offsets are from tail */ csa_off_base = skb->len; + + ieee802_11_parse_elems(skb->head, skb->len, true, &elems, + sdata->wdev.address, NULL); + if (!elems.parse_error) + goto out; + + offs->multiple_bssid_offset = elems.multiple_bssid_offset; + offs->multiple_bssid_length = elems.multiple_bssid_len; } if (beacon->tail) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a7c4d6a44e21..bbe2f1d9166c 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1311,6 +1311,10 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, &crc : NULL, elem, elems); break; + case WLAN_EID_MULTIPLE_BSSID: + elems->multiple_bssid_offset = pos - start; + elems->multiple_bssid_len = elen; + break; default: break; } From patchwork Thu Jun 4 07:09:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587027 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 DA7C5913 for ; Thu, 4 Jun 2020 07:10:14 +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 A808E206DC for ; Thu, 4 Jun 2020 07:10:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vD7PpWa9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A808E206DC 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=z6Xzwp6GdRKACVTPfSMhqmkhggMOOu59SJL0jnBucZ8=; b=vD7PpWa9B/qa+R 9znjAmoNaiqCsX833k+a6XoW6ts1+A0LpMxbrybYdD1tFRcLx9EGMb1rw8sK/mXNvUFrLe9JC9eof FP/2QkZEN4ddxxteOqNzvpsoPJ2mXAvONJ+XgNVI7g50CKB9JkZqZmSZEePgRItczWqag5SdmOfaq 5NmQVKdJm6cVj4aStWmILpJA8qAS09HPbUX/EOGeqo5VXMx/LkMdqp7mICECQB+6j3rbrLZyLT4zM o0R2RReoZJfkm8ZBucGMW22A7XDOzlUGaRrbgJKNF2wMZCYyyQftfGhvf5Uq0OL9VfkpXKi5d12XB y9WDPnggrmVsVOlopmkw==; 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 1jgk0x-00018H-2X; Thu, 04 Jun 2020 07:10:11 +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 1jgk0p-0000HP-Bl for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:05 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0l-0001P3-Ox; Thu, 04 Jun 2020 09:09:59 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 06/12] mac80211: propagate multi bssid settings when starting an AP Date: Thu, 4 Jun 2020 09:09:46 +0200 Message-Id: <20200604070952.15481-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_583128_D7AC3F72 X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 extends the bss_config allowing us to propagate the multiple bssid setting down the stack into the driver. Signed-off-by: John Crispin --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 1a98b3907aa7..3812adcef7d7 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -606,6 +606,7 @@ struct ieee80211_ftm_responder_params { * @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 + * @multi_bssid: the multi bssid settings of the AP. */ struct ieee80211_bss_conf { const u8 *bssid; @@ -669,6 +670,7 @@ struct ieee80211_bss_conf { struct ieee80211_he_operation he_operation; struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; + struct ieee80211_multi_bssid multi_bssid; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e4f73567d873..f6f7323c66ab 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1130,6 +1130,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, sizeof(struct ieee80211_he_obss_pd)); memcpy(&sdata->vif.bss_conf.he_bss_color, ¶ms->he_bss_color, sizeof(struct ieee80211_he_bss_color)); + memcpy(&sdata->vif.bss_conf.multi_bssid, ¶ms->multi_bssid, + sizeof(struct ieee80211_multi_bssid)); sdata->vif.bss_conf.ssid_len = params->ssid_len; if (params->ssid_len) From patchwork Thu Jun 4 07:09:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587037 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 6A21B913 for ; Thu, 4 Jun 2020 07:10:22 +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 48884206DC for ; Thu, 4 Jun 2020 07:10:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YFfkKsaZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48884206DC 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=bwYsgmKIzrEG0/vyGpKoOg5p+5+GvVdUX4NBy9fj8Mg=; b=YFfkKsaZ4pj0cq zTI/gL5u+gJZUjDE4leebHPbStcDuEdqHdzPdmbuT15i7GiZkv9Wbsa9Lz148RlHu1z0Xqo4dNUPh Ctcv2XkQamkZPO1LjphZxe6ENKX4excfUUkDjwbRFP3YCGq2ug2HN1DG+D4VNzm1IgSwxtjmGdtvU EzaMAsJ2V9D9J/jdlz/RlBfCJZurZQ8wNGtW1XKgj8C289waCHo/7dldRG0F50Q+xVwxUe+FrUnXl 1g8Ms0Q21Agk/fIwtTkq3Qx31uAUEL+fmwDm9vFBDQ3fuLabirxcG7Yp6fgCxdHMB0LQ3J+3hVrrS c/WyngRR1qYGbovsrsqA==; 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 1jgk16-0002uv-Ev; Thu, 04 Jun 2020 07:10:20 +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 1jgk0p-0000Hk-N5 for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:07 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0m-0001P3-0s; Thu, 04 Jun 2020 09:10:00 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 07/12] mac80211: propagate beacon tx mode to the driver Date: Thu, 4 Jun 2020 09:09:47 +0200 Message-Id: <20200604070952.15481-8-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001003_907829_19C35DCE X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 Now that we can set the beacon xmit mode via nl80211 we want to also propagate that info to the device driver. This patch sets the field inside bss_config. Signed-off-by: John Crispin --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 3812adcef7d7..f99abd5e8bc6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -607,6 +607,7 @@ struct ieee80211_ftm_responder_params { * @he_obss_pd: OBSS Packet Detection parameters. * @he_bss_color: BSS coloring settings, if BSS supports HE * @multi_bssid: the multi bssid settings of the AP. + * @beacon_tx_mode: the beacon tx mode. This can be staggered or burst. */ struct ieee80211_bss_conf { const u8 *bssid; @@ -671,6 +672,7 @@ struct ieee80211_bss_conf { struct ieee80211_he_obss_pd he_obss_pd; struct cfg80211_he_bss_color he_bss_color; struct ieee80211_multi_bssid multi_bssid; + enum nl80211_beacon_tx_mode beacon_tx_mode; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f6f7323c66ab..1f3c93b8f265 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1071,6 +1071,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, prev_beacon_int = sdata->vif.bss_conf.beacon_int; sdata->vif.bss_conf.beacon_int = params->beacon_interval; + sdata->vif.bss_conf.beacon_tx_mode = params->beacon_tx_mode; if (params->he_cap && params->he_oper) { sdata->vif.bss_conf.he_support = true; From patchwork Thu Jun 4 07:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587041 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 A7FCF14F6 for ; Thu, 4 Jun 2020 07:10:23 +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 8676C2074B for ; Thu, 4 Jun 2020 07:10:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fgc9Zk+C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8676C2074B 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=wHvv2hqqAy9G3WJaTtX11tjseSaSoQX9nQgqFbe39dc=; b=fgc9Zk+CMHtreI jL7sBTH1lYAT9//7T/qA0ul75eipmvN3Z+LGXEL4Vwt+wwn2kz3Axlwg6XhcVKucu7ZBNshTPIjSn Q0zn/wZIzx8MONju+cRqlr9/XTSoEWyIzSeVTrLvUydQZ+8U1H0sKp49fpUFjxR7xNZyj29Tq5fBB xvnrb8h8v8+LXnsGg2KY9n4eQFTMvU5QMTHpWQPScrN6wSIX7wTOCcDpn13VZAm40/fgw1CZLA1FI sITVSVZxsZKf+jyaaN2FAp6loHybHEEMhN4h4Hcuk0Do+HvrNmZ231jjAXYAL6utmUYI71wlww0aE Vd4BdWdeA92X93dwJdkA==; 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 1jgk18-0002x9-1U; Thu, 04 Jun 2020 07:10:22 +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 1jgk0p-0000I1-R6 for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:08 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0m-0001P3-Ad; Thu, 04 Jun 2020 09:10:00 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 08/12] ath11k: pass multiple bssid info to FW when a new vdev is created Date: Thu, 4 Jun 2020 09:09:48 +0200 Message-Id: <20200604070952.15481-9-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001004_027042_CF2ABC47 X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 When we use multiple bssid the FW needs to know if the bssid is non/transmitting and what the vdev_id of the parent is. This patch adds the required code to achieve this. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 28 +++++++++++++++++++++++++-- drivers/net/wireless/ath/ath11k/wmi.c | 2 ++ drivers/net/wireless/ath/ath11k/wmi.h | 10 ++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 2f11259de24a..b38b687d1100 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -4163,17 +4163,36 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw) atomic_set(&ar->num_pending_mgmt_tx, 0); } -static void +static int ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, struct vdev_create_params *params) { struct ath11k *ar = arvif->ar; struct ath11k_pdev *pdev = ar->pdev; + struct ieee80211_vif *parent; params->if_id = arvif->vdev_id; params->type = arvif->vdev_type; params->subtype = arvif->vdev_subtype; params->pdev_id = pdev->pdev_id; + params->vdevid_trans = 0; + switch (ieee80211_get_multi_bssid_mode(arvif->vif)) { + case NL80211_MULTIPLE_BSSID_TRANSMITTED: + params->flags = WMI_HOST_VDEV_FLAGS_TRANSMIT_AP; + break; + case NL80211_MULTIPLE_BSSID_NON_TRANSMITTED: + params->flags = WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP; + parent = ieee80211_get_multi_bssid_parent(arvif->vif); + if (!parent) + return -ENOENT; + if (ar->hw->wiphy != ieee80211_vif_to_wdev(parent)->wiphy) + return -EINVAL; + params->vdevid_trans = ath11k_vif_to_arvif(parent)->vdev_id; + break; + default: + params->flags = WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP; + break; + } if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP) { params->chains[NL80211_BAND_2GHZ].tx = ar->num_tx_chains; @@ -4183,6 +4202,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, params->chains[NL80211_BAND_5GHZ].tx = ar->num_tx_chains; params->chains[NL80211_BAND_5GHZ].rx = ar->num_rx_chains; } + return 0; } static u32 @@ -4334,7 +4354,11 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++) vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES - 1); - ath11k_mac_setup_vdev_create_params(arvif, &vdev_param); + ret = ath11k_mac_setup_vdev_create_params(arvif, &vdev_param); + if (ret) { + ath11k_warn(ab, "failed to prepare vdev %d\n", ret); + goto err; + } ret = ath11k_wmi_vdev_create(ar, vif->addr, &vdev_param); if (ret) { diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 5b35d06a0d81..a46aa831d8be 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -603,6 +603,8 @@ int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, cmd->vdev_subtype = param->subtype; cmd->num_cfg_txrx_streams = WMI_NUM_SUPPORTED_BAND_MAX; cmd->pdev_id = param->pdev_id; + cmd->flags = param->flags; + cmd->vdevid_trans = param->vdevid_trans; ether_addr_copy(cmd->vdev_macaddr.addr, macaddr); ptr = skb->data + sizeof(*cmd); diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 82929415e119..761e27a3a306 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -107,6 +107,12 @@ enum { WMI_HOST_WLAN_2G_5G_CAP = 0x3, }; +enum { + WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP = 1, + WMI_HOST_VDEV_FLAGS_TRANSMIT_AP = 2, + WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP = 4, +}; + /* * wmi command groups. */ @@ -2376,6 +2382,8 @@ struct vdev_create_params { u8 rx; } chains[NUM_NL80211_BANDS]; u32 pdev_id; + u32 flags; + u32 vdevid_trans; }; struct wmi_vdev_create_cmd { @@ -2386,6 +2394,8 @@ struct wmi_vdev_create_cmd { struct wmi_mac_addr vdev_macaddr; u32 num_cfg_txrx_streams; u32 pdev_id; + u32 flags; + u32 vdevid_trans; } __packed; struct wmi_vdev_txrx_streams { From patchwork Thu Jun 4 07:09:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587039 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 8D8BF1392 for ; Thu, 4 Jun 2020 07:10:23 +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 6BFE8206DC for ; Thu, 4 Jun 2020 07:10:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="f01ZEPAZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BFE8206DC 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=nfjKumsqTbII4xlnTcjvzRyFYiJRCiXETk7+JJpYEsw=; b=f01ZEPAZb/RRwH p9/te28C/xGbJyvecNs+2gh+omKhWY54KnxnSHllV2ilrDMm5TkiwVSNUufBfQEi6OU4Is+dQJ1LV XtRPOIE+2+epFprWRLCJE2x4QUx0Zq9+cvQfMD7oV4U9gAFpSML840VfvmDIt5lxeR0PTrYLVsvs4 fv/Ly4LtQQUD0EX1UUEH4frMDxQN28eVYRQg6/3778GvJdAzUOHkTQHfu+m+M0QerptS6ehcyi+ZV LU7fLz+O/MjnuYPZkmCYKvycdPtV1jij8yI7aDhpf9J0hF5HNO18PzD9Lt+h4HpyXX1KurqMhmvZ8 NHrkdIaPfTFt3oxVl8Vg==; 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 1jgk17-0002w3-ED; Thu, 04 Jun 2020 07:10:21 +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 1jgk0q-0000IO-4S for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:10:08 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0m-0001P3-LX; Thu, 04 Jun 2020 09:10:00 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 09/12] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up Date: Thu, 4 Jun 2020 09:09:49 +0200 Message-Id: <20200604070952.15481-10-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_001004_363022_89BD1724 X-CRM114-Status: GOOD ( 13.71 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 When setting up a multiple bssid we need to pass additional parameters to the FW. Doing this as individual parameters would make the call signature very long. Use an intermediate struct instead and adjust all callees to make use of it. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 38 ++++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 17 +++++++----- drivers/net/wireless/ath/ath11k/wmi.h | 12 +++++++-- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index b38b687d1100..63099607065b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -668,9 +668,13 @@ void ath11k_mac_peer_cleanup_all(struct ath11k *ar) static int ath11k_monitor_vdev_up(struct ath11k *ar, int vdev_id) { + struct vdev_up_params params = { + .vdev_id = vdev_id, + .bssid = ar->mac_addr, + }; int ret = 0; - ret = ath11k_wmi_vdev_up(ar, vdev_id, 0, ar->mac_addr); + ret = ath11k_wmi_vdev_up(ar, ¶ms); if (ret) { ath11k_warn(ar->ab, "failed to put up monitor vdev %i: %d\n", vdev_id, ret); @@ -735,6 +739,13 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, struct ieee80211_bss_conf *info) { struct ath11k *ar = arvif->ar; + struct ieee80211_vif *parent; + struct vdev_up_params params = { + .vdev_id = arvif->vdev_id, + .bssid = arvif->bssid, + .profile_num = info->multi_bssid.count, + .profile_idx = info->multi_bssid.index, + }; int ret = 0; lockdep_assert_held(&arvif->ar->conf_mutex); @@ -762,9 +773,15 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, arvif->aid = 0; ether_addr_copy(arvif->bssid, info->bssid); + parent = ieee80211_get_multi_bssid_parent(arvif->vif); + if (parent) { + struct ath11k_vif *pvif = (struct ath11k_vif *)parent->drv_priv; + + params.trans_bssid = pvif->bssid; + } + - ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, - arvif->bssid); + ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms); if (ret) { ath11k_warn(ar->ab, "failed to bring up vdev %d: %i\n", arvif->vdev_id, ret); @@ -1685,6 +1702,11 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = (void *)vif->drv_priv; struct peer_assoc_params peer_arg; + struct vdev_up_params params = { + .vdev_id = arvif->vdev_id, + .bssid = bss_conf->bssid, + .aid = bss_conf->aid, + }; struct ieee80211_sta *ap_sta; int ret; @@ -1733,7 +1755,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, arvif->aid = bss_conf->aid; ether_addr_copy(arvif->bssid, bss_conf->bssid); - ret = ath11k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid); + ret = ath11k_wmi_vdev_up(ar, ¶ms); if (ret) { ath11k_warn(ar->ab, "failed to set vdev %d up: %d\n", arvif->vdev_id, ret); @@ -4987,6 +5009,8 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, /* TODO: Update ar->rx_channel */ for (i = 0; i < n_vifs; i++) { + struct vdev_up_params params; + arvif = (void *)vifs[i].vif->drv_priv; if (WARN_ON(!arvif->is_started)) @@ -5007,8 +5031,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar, continue; } - ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid, - arvif->bssid); + params.vdev_id = arvif->vdev_id, + params.bssid = arvif->bssid, + params.aid = arvif->aid, + ret = ath11k_wmi_vdev_up(arvif->ar, ¶ms); if (ret) { ath11k_warn(ab, "failed to bring vdev up %d: %d\n", arvif->vdev_id, ret); diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index a46aa831d8be..3fca51c3f943 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -862,7 +862,7 @@ int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg, return ret; } -int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) +int ath11k_wmi_vdev_up(struct ath11k *ar, struct vdev_up_params *params) { struct ath11k_pdev_wmi *wmi = ar->wmi; struct wmi_vdev_up_cmd *cmd; @@ -877,10 +877,14 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_VDEV_UP_CMD) | FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE); - cmd->vdev_id = vdev_id; - cmd->vdev_assoc_id = aid; + cmd->vdev_id = params->vdev_id; + cmd->vdev_assoc_id = params->aid; + cmd->profile_idx = params->profile_idx; + cmd->profile_num = params->profile_num; - ether_addr_copy(cmd->vdev_bssid.addr, bssid); + if (params->trans_bssid) + ether_addr_copy(cmd->trans_bssid.addr, params->trans_bssid); + ether_addr_copy(cmd->vdev_bssid.addr, params->bssid); ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_UP_CMDID); if (ret) { @@ -889,8 +893,9 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) } ath11k_dbg(ar->ab, ATH11K_DBG_WMI, - "WMI mgmt vdev up id 0x%x assoc id %d bssid %pM\n", - vdev_id, aid, bssid); + "WMI mgmt vdev up id 0x%x assoc id %d idx %d num %d bssid %pM trans_bssid %pM\n", + params->vdev_id, params->aid, params->profile_idx, params->profile_num, + params->bssid, params->trans_bssid); return ret; } diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 761e27a3a306..548fa05cb1f6 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -2410,6 +2410,15 @@ struct wmi_vdev_delete_cmd { u32 vdev_id; } __packed; +struct vdev_up_params { + u32 vdev_id; + u16 aid; + u32 profile_idx; + u32 profile_num; + const u8 *bssid; + u8 *trans_bssid; +}; + struct wmi_vdev_up_cmd { u32 tlv_header; u32 vdev_id; @@ -4732,8 +4741,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, struct ieee80211_mutable_offsets *offs, struct sk_buff *bcn); int ath11k_wmi_vdev_down(struct ath11k *ar, u8 vdev_id); -int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, - const u8 *bssid); +int ath11k_wmi_vdev_up(struct ath11k *ar, struct vdev_up_params *params); int ath11k_wmi_vdev_stop(struct ath11k *ar, u8 vdev_id); int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg, bool restart); From patchwork Thu Jun 4 07:09:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587093 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 AEC7314E3 for ; Thu, 4 Jun 2020 07:26:55 +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 8CCB12072E for ; Thu, 4 Jun 2020 07:26:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ph1UMcuW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CCB12072E 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=ai23gWYt6Wgb9gHPwsP41XQ1LsmyTjlyFybGBvyOnYs=; b=Ph1UMcuW8VLg5u GuS1Z2hykwCMLM2hNnFvTixTw31aPHRYfZnDSc9JjYD5vKmC4lGCUpscAjUd8iOvTTc1n1SvTmGE6 59R2L1ZQK7NUgBFdHYu5V8a+56Jp/RkQCN6cCGKSNPI0SLZxY0zaNXkJFmqTtiHZ/T98ehX1VVE+o X5CSICL5r3PzDzBQiy+UGLEmjPnz/Y0hSP/JkuJCSrBN3dbG//L16T9XFUF7a10sVtgXmlPPlyBlh BoaovAZ4zeTC0cnsey48ubJw2WMGC8H8UWzsFWlGKYh2a/y9fnKLznYCfE2V1go6NgjgQcMzIbMQ/ vqLrgdUB2AfcFBjcfhsw==; 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 1jgkH8-0003z3-FO; Thu, 04 Jun 2020 07:26:54 +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 1jgkH5-0003xa-EC for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:26:52 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0n-0001P3-5V; Thu, 04 Jun 2020 09:10:01 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 10/12] ath11k: add the multiple bssid IE offset to the beacon template Date: Thu, 4 Jun 2020 09:09:50 +0200 Message-Id: <20200604070952.15481-11-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_002651_632186_0B35E047 X-CRM114-Status: UNSURE ( 9.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 The FW needs to know the offset of the multi bssid IE. Add this value to the WMI TLV. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/wmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 3fca51c3f943..2fe4b65850ef 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -1567,6 +1567,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, cmd->csa_switch_count_offset = offs->csa_counter_offs[0]; cmd->ext_csa_switch_count_offset = offs->csa_counter_offs[1]; cmd->buf_len = bcn->len; + cmd->mbssid_ie_offset = offs->multiple_bssid_offset; ptr = skb->data + sizeof(*cmd); From patchwork Thu Jun 4 07:09:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587091 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 E7FC814F6 for ; Thu, 4 Jun 2020 07:26:51 +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 C61302072E for ; Thu, 4 Jun 2020 07:26:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rCSBMrXq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C61302072E 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=4cdyzqcUf32JgqzefRU8PS/FTSuzArpuqO8ghYW324U=; b=rCSBMrXqz1wxJh PCXmdjtAl78ZunoC+kRJEUW/ZpmIBZkgq6PL8xGn9SzHfQVWdG1Z+xI/oNIR2vrZbIJSyEJZOVsYt N86dCHHxqjaMzKSTmbXzOmK4zkgY8WNRSibPq+xUW+H2Pl3ouDEcIP5dli1iUObhuj+i5v4FMhmvO jh6cUY+Db4aTohdMnZIvvgukAA5l2leqiVrHrC6g0YT8N0EM+y1PdPPUNfpfsYSHDsErbtvyPBuVM G96zuNtHuRgNhEgqntZ7dD+Nl2IlISIjSP7++vJ1LeS9ozrHS3cGxVGEJIn8RFG8o4IDk9obUlZ00 A11WuChl6SWCY9HTdSPA==; 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 1jgkH4-0003xB-5Z; Thu, 04 Jun 2020 07:26:50 +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 1jgkH1-0003wl-Kx for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:26:48 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0n-0001P3-Ht; Thu, 04 Jun 2020 09:10:01 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 11/12] ath11k: set beacon tx mode Date: Thu, 4 Jun 2020 09:09:51 +0200 Message-Id: <20200604070952.15481-12-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_002647_847460_5D01D751 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 The beacon can be sent out in staggered or burst mode. Set this mode according to what mac80211 tells us to use whenever the beacon changes. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 63099607065b..8ec11c654b3e 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1907,6 +1907,8 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BEACON) { param_id = WMI_PDEV_PARAM_BEACON_TX_MODE; param_value = WMI_BEACON_STAGGERED_MODE; + if (info->beacon_tx_mode == NL80211_BEACON_TX_MODE_BURST) + param_value = WMI_BEACON_BURST_MODE; ret = ath11k_wmi_pdev_set_param(ar, param_id, param_value, ar->pdev->pdev_id); if (ret) From patchwork Thu Jun 4 07:09:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11587097 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 D2A2A913 for ; Thu, 4 Jun 2020 07:27:06 +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 B04572075B for ; Thu, 4 Jun 2020 07:27:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XsjNpG8z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B04572075B 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=x2fssW23EomGEEpWR7CINAepWyhBvJEL1CyKnvaRbRQ=; b=XsjNpG8zYdAleh AegVxMAG7L8A7crPhKtcXA09238Zj5ir6q/y2npA/dklejUKBRzsF8Bga76yKnubBoi5EEr8CPyOx 7SmZNqgqM4NzwTPCQ6GZX4jVsoMdZX3GALEC7WwNpiQteMXPaIJyDhrad7xzJsc3pE0dnfcJ4IHR/ 2nTPwqn8Ygy/eJizf2yYht1vUCojeTS9CUKwJ4gYh9mEdQTjfpqaAfORuTDn28b14STyRVJxSaJrQ HgFUkmM12xp/e9rE99gHKvGF30o6v0cEh5RBWRC4reW3M/MrzKJStuzQxFsYkXQ20Y8H5F0W+r1Na g+pIAdx9YcAI4kDdhfiQ==; 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 1jgkHI-00041f-Oq; Thu, 04 Jun 2020 07:27:04 +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 1jgkHG-00041J-GT for ath11k@lists.infradead.org; Thu, 04 Jun 2020 07:27:03 +0000 Received: from [46.59.202.224] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jgk0n-0001P3-SY; Thu, 04 Jun 2020 09:10:01 +0200 From: John Crispin To: Johannes Berg Subject: [PATCH 12/12] ath11k: set the multiple bssid hw cap Date: Thu, 4 Jun 2020 09:09:52 +0200 Message-Id: <20200604070952.15481-13-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200604070952.15481-1-john@phrozen.org> References: <20200604070952.15481-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200604_002702_706083_21C31A96 X-CRM114-Status: GOOD ( 10.53 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 sets the SUPPORTS_MULTI_BSSID inside ath11k. Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/mac.c | 4 ++++ drivers/net/wireless/ath/ath11k/wmi.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 8ec11c654b3e..55876600b7c5 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -5980,17 +5980,20 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, static const u8 ath11k_if_types_ext_capa[] = { [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, + [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, }; static const u8 ath11k_if_types_ext_capa_sta[] = { [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, + [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, }; static const u8 ath11k_if_types_ext_capa_ap[] = { [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, + [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, [9] = WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT, }; @@ -6101,6 +6104,7 @@ static int __ath11k_mac_register(struct ath11k *ar) ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); + ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID); if (ht_cap & WMI_HT_CAP_ENABLED) { ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION); ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 548fa05cb1f6..14cffda43ed0 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -109,8 +109,8 @@ enum { enum { WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP = 1, - WMI_HOST_VDEV_FLAGS_TRANSMIT_AP = 2, - WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP = 4, + WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP = 2, + WMI_HOST_VDEV_FLAGS_TRANSMIT_AP = 4, }; /*