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])