Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1696786rdb; Wed, 20 Sep 2023 17:39:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDEvqKQLxeS30C9TdHL9nvZnigHZELb2ZLMOCOXzUe/5IL/VqswyQZcaIZugj03ChvwB4K X-Received: by 2002:a0d:e24f:0:b0:59b:c4a5:f2ba with SMTP id l76-20020a0de24f000000b0059bc4a5f2bamr4240386ywe.9.1695256765438; Wed, 20 Sep 2023 17:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695256765; cv=none; d=google.com; s=arc-20160816; b=VyMlkjBE41WFb1LbZMsrn6SVEYqzMSHugsXLyZSBIO668u8z7dq2/dJdhjJ2cdKu6o kr6VYvG2gAsmdBMBZZ1+JTeNw5X5vbxexs8XOOYTAw38VkfZsE+KewRa3MiwlfBW7Xns h6wO7zBnqHb22FSc8nm0PVzaLces1sPk1fkuL0IY9FMuTQeyOExekgMLmE9xkKQ3ASMI rvBsdFid752jUnb9H1yTCwxSpGhgx86Q3nvk9SqTI3zEBzOo74jypEw6LNC/OMsnxpup gnLEwdsYq7GPtV2YgeAq59yoS0p7CSQ90fhmW0mmwaNhxfPpseX2VJ2Nsf8IrlPBEBoO N0jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Vhy5Gh36VpGi7M0hsYWtlYUw41Fj1sUmxzhSwKpCnHM=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=x/JBnFOpTEjML/UOTJrsNrHcd0NQiNVYWk9grHro5hSQ5Ph2PVqsI57JF2Yf25pnmw tAS5VTdgOT4G/zzIL8Z9MQ7nIesXgUegXYUp7Z+vkc6C72w76vf2J2GegbR9XtwnThj8 c2r+88CjezQ2ezEp3/3uH0tA36VkV2e1lSoiBcpWbVEl/SOx3WS81daG+aBADEwxxeuS tWPsHEsVAsu7j4vf4uUacMVjSHn+rpoEAKh3bDySTvPQsbtErMNmSGCRa5M95COWrH63 MbsenjXF0Nea0eiCfM5ICr4SwrZLvyVvAcXHJcq1i7L0jAs7DL3Bm2noUM5AsaroVksy O6Sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x24-20020a056a000bd800b00690d42e3347si269502pfu.157.2023.09.20.17.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 17:39:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D0499832B7B0; Wed, 20 Sep 2023 17:37:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjIUAga (ORCPT + 56 others); Wed, 20 Sep 2023 20:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjIUAg2 (ORCPT ); Wed, 20 Sep 2023 20:36:28 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B8F7B7 for ; Wed, 20 Sep 2023 17:36:21 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 38L0aDpxD1967005, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.92/5.92) with ESMTPS id 38L0aDpxD1967005 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Sep 2023 08:36:13 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Thu, 21 Sep 2023 08:36:14 +0800 Received: from [127.0.1.1] (172.16.16.112) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 21 Sep 2023 08:36:13 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 4/4] wifi: rtw89: declare MCC in interface combination Date: Thu, 21 Sep 2023 08:35:59 +0800 Message-ID: <20230921003559.11588-5-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921003559.11588-1-pkshih@realtek.com> References: <20230921003559.11588-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.16.112] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 17:37:43 -0700 (PDT) From: Zong-Zhe Yang MCC (multi-channel concurrency) supports two combinations as below. * P2P-GO + STA * P2P-GC + STA We add the corresponding ieee80211_iface_limit for it into ieee80211_iface_combination. Besides, for multiple channels, it must run with mac80211 chanctx. So, only with it, ieee80211_iface_combination can allow MCC case. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index ac5a4b0d8282..27770064f1b0 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -172,13 +172,31 @@ static const struct ieee80211_iface_limit rtw89_iface_limits[] = { }, }; +static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_STATION), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), + }, +}; + static const struct ieee80211_iface_combination rtw89_iface_combs[] = { { .limits = rtw89_iface_limits, .n_limits = ARRAY_SIZE(rtw89_iface_limits), .max_interfaces = 2, .num_different_channels = 1, - } + }, + { + .limits = rtw89_iface_limits_mcc, + .n_limits = ARRAY_SIZE(rtw89_iface_limits_mcc), + .max_interfaces = 2, + .num_different_channels = 2, + }, }; bool rtw89_ra_report_to_bitrate(struct rtw89_dev *rtwdev, u8 rpt_rate, u16 *bitrate) @@ -4279,7 +4297,11 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device, goto err; hw->wiphy->iface_combinations = rtw89_iface_combs; - hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw89_iface_combs); + + if (no_chanctx || chip->support_chanctx_num == 1) + hw->wiphy->n_iface_combinations = 1; + else + hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw89_iface_combs); rtwdev = hw->priv; rtwdev->hw = hw; -- 2.25.1