Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp164826ybl; Wed, 11 Dec 2019 15:55:17 -0800 (PST) X-Google-Smtp-Source: APXvYqwUMn7l+WxjJozJxWyUwAkbPC6zWcfenOgEUzwEClvBaq1D1ovur5M6ePAfPXTCtt5qd5/b X-Received: by 2002:a9d:1e88:: with SMTP id n8mr4817359otn.369.1576108517497; Wed, 11 Dec 2019 15:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576108517; cv=none; d=google.com; s=arc-20160816; b=v4ZXmSTrn1vdJlgP92aThQGRUv870cWgl6Ub84vWbq+23NHXI4SOoY5PhVse9zHFpj ghr5z3UfECvDr0TAl2djplNAeYPbGCtl9GChVFyD8HKXM8r2ZVMbUTRg2iRvnrwEr7o8 gQnL+kz3+mtIEIfukGQUZc77TWl7GD8UoaG+w2vHvnp0Ko6tWM19JiX3IdxCji7SQQwA rYTd9yJRjo7mD5jlU95gAMHN8DEp6I7JELi7iv4wcsila02Blh20iRAqpwE6gVfmUZGg D2gHT39zlNmqCIa4koRRdDj/NpqExrfF4qsfJwJknANidwmiD3KlZoAiaenrl9pFcJfT 2M8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5ECDhu+vJMUhva1Zekn3gaqIUKzm49AwOHQQn75G0xU=; b=QVWsubV0ite87ubuX7NB97DgBAxE6TpZA7fCSNgc7bK2hVtvMM3UKUMwFxH0Fmac1Z ShxMMHoJo749fh0VPlioTfeWuFLzLjBEfLgymk/+6XkFeaDvdIzLW5L77CNap8iFb4dr p++TV8I1aWXu2YB9c0i/90FHzQ4WnE5jlKW31CZJnuq6lNJ24bwm4CLvqNDGg4i9EI+e 7lrKZKd7Vt+UqzKAan+cZfK19fYHtNqWzOA9dI3KUSwXHbJR0eP2dVDpyxTyBJw8B92V cMi+xu17VgzmL510IDDvvFb+g+JLpqjY0p7C0BlobjWQNuunfQbGRoOH1F61lL7Cf6Wg uorQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=LrNnwQUq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21si2297905ote.320.2019.12.11.15.55.05; Wed, 11 Dec 2019 15:55:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=LrNnwQUq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727433AbfLKXyM (ORCPT + 99 others); Wed, 11 Dec 2019 18:54:12 -0500 Received: from mout.web.de ([217.72.192.78]:51263 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727198AbfLKXx2 (ORCPT ); Wed, 11 Dec 2019 18:53:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1576108395; bh=bqrfzn03Wk5A81+Bxtr6JafRDf0LDppSY0FopstiOWU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LrNnwQUqQrR0y8v6QbdwFWGQreRkC4UnLS5vcVMOJWqrggruA85WPRuDtsut44XCJ yEqnecDjdVWTJLbeEBdKSRro6bhl4HlystbX32DXbG0J+16xNcdgo0pzXbUjQ/Rumx VmqU5cVabbZFYa0qgNLQtUwVMzEIAshhpw5rpgtU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from localhost.localdomain ([89.204.139.166]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M6E6g-1hmhaz0h0k-00yBkG; Thu, 12 Dec 2019 00:53:15 +0100 From: Soeren Moch To: Kalle Valo , Heiko Stuebner Cc: Wright Feng , Soeren Moch , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-Hsien Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/9] brcmfmac: add RSDB condition when setting interface combinations Date: Thu, 12 Dec 2019 00:52:50 +0100 Message-Id: <20191211235253.2539-7-smoch@web.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211235253.2539-1-smoch@web.de> References: <20191211235253.2539-1-smoch@web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sObgus2FDRoa5HGMYXoHjJ8dLBCTgL7OufE2JZLV/N7PtqNDME2 YuQXbzzDjKtPnQsO7f8f9MzJSbdmoMqCb/6c4H24QSLEbLJ8AUwZUsdhGOh3NKpytNJMIhG hXxgebyZByKXqYQJn7hWvI2FVd66BOnDCk39Fi8sBq+VoW4dZHw85R6jVOnpy5jpfvCvUlo Tx1C7zBeV/t96cuCIyhhA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:l+RZ/qB1OXc=:NPKGOTlEvEQpnntq6ydHAz fHl0SEXZuE6K9NBqv4Lht5uPB32IkQoru8VRv4/YD+JhRqRzu+tcMxC2gZ5IB67lWwyUdySCm uBnJwQR+zq8SQmwMwXiVtWbbYaPtxcQ0OPwiJgkN35EtVWAdo18b1j2o3Y6eiXAgb+yTDfEO4 QPc4Xh7ZV7/Ozn0gxYjPVXPBRJV+m5jNdO0gT+LKNm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PGbo/eu0kB/3JzBN69//WDdupLb2MjoLAududA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wright Feng With firmware RSDB feature 1. The maximum support interface is four. 2. The maximum difference channel is two. 3. The maximum interfaces of {station/p2p client/AP} are two. 4. The maximum interface of p2p device is one. Signed-off-by: Wright Feng Signed-off-by: Soeren Moch Reviewed-by: Chi-Hsien Lin =2D-- changes in v2: - add missing s-o-b - add review tag received for v1 Cc: Kalle Valo Cc: Heiko Stuebner Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Chi-Hsien Lin Cc: Wright Feng Cc: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list.pdl@broadcom.com Cc: brcm80211-dev-list@cypress.com Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org =2D-- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 54 ++++++++++++++++--- 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b= /drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 0cf13cea1dbe..9d9dc9195e9e 100644 =2D-- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6520,6 +6520,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] =3D { * #STA <=3D 1, #AP <=3D 1, channels =3D 1, 2 total * #AP <=3D 4, matching BI, channels =3D 1, 4 total * + * no p2p and rsdb: + * #STA <=3D 2, #AP <=3D 2, channels =3D 2, 4 total + * * p2p, no mchan, and mbss: * * #STA <=3D 1, #P2P-DEV <=3D 1, #{P2P-CL, P2P-GO} <=3D 1, channels =3D 1= , 3 total @@ -6531,6 +6534,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] =3D { * #STA <=3D 1, #P2P-DEV <=3D 1, #{P2P-CL, P2P-GO} <=3D 1, channels =3D 2= , 3 total * #STA <=3D 1, #P2P-DEV <=3D 1, #AP <=3D 1, #P2P-CL <=3D 1, channels =3D= 1, 4 total * #AP <=3D 4, matching BI, channels =3D 1, 4 total + * + * p2p, rsdb, and no mbss: + * #STA <=3D 2, #P2P-DEV <=3D 1, #{P2P-CL, P2P-GO} <=3D 2, AP <=3D 2, + * channels =3D 2, 4 total */ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) { @@ -6538,13 +6545,14 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy= , struct brcmf_if *ifp) struct ieee80211_iface_limit *c0_limits =3D NULL; struct ieee80211_iface_limit *p2p_limits =3D NULL; struct ieee80211_iface_limit *mbss_limits =3D NULL; - bool mbss, p2p; + bool mbss, p2p, rsdb; int i, c, n_combos; mbss =3D brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS); p2p =3D brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P); + rsdb =3D brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB); - n_combos =3D 1 + !!p2p + !!mbss; + n_combos =3D 1 + !!(p2p && !rsdb) + !!mbss; combo =3D kcalloc(n_combos, sizeof(*combo), GFP_KERNEL); if (!combo) goto err; @@ -6555,16 +6563,36 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy= , struct brcmf_if *ifp) c =3D 0; i =3D 0; - c0_limits =3D kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); + if (p2p && rsdb) + c0_limits =3D kcalloc(4, sizeof(*c0_limits), GFP_KERNEL); + else if (p2p) + c0_limits =3D kcalloc(3, sizeof(*c0_limits), GFP_KERNEL); + else + c0_limits =3D kcalloc(2, sizeof(*c0_limits), GFP_KERNEL); if (!c0_limits) goto err; - c0_limits[i].max =3D 1; - c0_limits[i++].types =3D BIT(NL80211_IFTYPE_STATION); - if (p2p) { + if (p2p && rsdb) { + combo[c].num_different_channels =3D 2; + wiphy->interface_modes |=3D BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_P2P_DEVICE); + c0_limits[i].max =3D 2; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_STATION); + c0_limits[i].max =3D 1; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_P2P_DEVICE); + c0_limits[i].max =3D 2; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO); + c0_limits[i].max =3D 2; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_AP); + combo[c].max_interfaces =3D 5; + } else if (p2p) { if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN)) combo[c].num_different_channels =3D 2; else combo[c].num_different_channels =3D 1; + c0_limits[i].max =3D 1; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_STATION); wiphy->interface_modes |=3D BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_DEVICE); @@ -6573,16 +6601,26 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy= , struct brcmf_if *ifp) c0_limits[i].max =3D 1; c0_limits[i++].types =3D BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO); + combo[c].max_interfaces =3D i; + } else if (rsdb) { + combo[c].num_different_channels =3D 2; + c0_limits[i].max =3D 2; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_STATION); + c0_limits[i].max =3D 2; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_AP); + combo[c].max_interfaces =3D 3; } else { combo[c].num_different_channels =3D 1; c0_limits[i].max =3D 1; + c0_limits[i++].types =3D BIT(NL80211_IFTYPE_STATION); + c0_limits[i].max =3D 1; c0_limits[i++].types =3D BIT(NL80211_IFTYPE_AP); + combo[c].max_interfaces =3D i; } - combo[c].max_interfaces =3D i; combo[c].n_limits =3D i; combo[c].limits =3D c0_limits; - if (p2p) { + if (p2p && !rsdb) { c++; i =3D 0; p2p_limits =3D kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); =2D- 2.17.1