Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp612638rwe; Fri, 14 Apr 2023 07:32:49 -0700 (PDT) X-Google-Smtp-Source: AKy350Y/4dzGK5Ae3lg6Owsgrsk0XtCdFfIPWGOSqpFF8UAHiOwdAcgw8Ue0tyKX3+lIpYm/9Lgp X-Received: by 2002:a05:6a20:6993:b0:eb:6f70:6d08 with SMTP id t19-20020a056a20699300b000eb6f706d08mr9867955pzk.16.1681482769167; Fri, 14 Apr 2023 07:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681482769; cv=none; d=google.com; s=arc-20160816; b=QKFcO+0m0622vjTPHufx2x0F0VGYEMiQNHlRI++HT5kVyxnvZMqXyHH+ro5DYHS0wh j7gGBfg7hy9w5qBEmIHKwKzwOLVUDiclR6AwF60OAqVWlD3ZAArYXtXOaR1vzhvhzee0 suWfl7HFDcSLm2iZCBx4T416OGJei344ROBGg2Pg7/CYaJH366123yuV83FnAUZkwie8 N/wtv3XzM+fH6Fo4XTzKgLVwzWhJYTkuj6B7A4E2+eYqErlL8o6Ob3di4yCzwmWko+3W b+BHOLtk0R//nQ41/r9vS9k7j7mBTXsdnkyq5Zbuy4mWbs6oGKgVt80jMjEznUaffOrt eM3A== 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 :message-id:date:subject:cc:to:from; bh=Rga1qai55o8FPQ7q6iaaVGpUj9w8TuwawkCEP3W3jBA=; b=RGIQFIHydD6pquIkmfnK6pj9dBuEseiQHhSylpF6QafAP4eQcakOw6n+U4J7DRTAQM ADDNsl1y+O7y3f15znm6ARTfVWWIF980elZBOekawMiTp2e2lqs1QwpOYLU4o+t65X8R cqNbW25N5QrNiL3VyvJUPjsa9LK/LXSAa8MkcTIQO/hMHpUjJk5LGwM9pmzR/n2iMEgB TfFNn3GLZUSS6PN6jT5HuwXYBYjrMXtAWUOE5t+6g14a6dxkVk6Zx0sfWMVey6Ly+rlF 4c96Sab1GRstrUzTEP9+RYwQApYtr72zwW9mKgptOeTP4A7LBJZvLO1tW4uZ16KTAnbq NPDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b0051a24ba4d9fsi4178585pgk.413.2023.04.14.07.32.41; Fri, 14 Apr 2023 07:32:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbjDNOcK (ORCPT + 62 others); Fri, 14 Apr 2023 10:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230249AbjDNOcJ (ORCPT ); Fri, 14 Apr 2023 10:32:09 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91512B471 for ; Fri, 14 Apr 2023 07:32:05 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33EE4O8L0022023, 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.81/5.90) with ESMTPS id 33EE4O8L0022023 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Fri, 14 Apr 2023 22:04:24 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) 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; Fri, 14 Apr 2023 22:04:47 +0800 Received: from localhost (172.16.20.53) by RTEXDAG02.realtek.com.tw (172.21.6.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 14 Apr 2023 22:04:46 +0800 From: Ping-Ke Shih To: CC: , , Subject: [PATCH 5/5] wifi: rtw89: add support of concurrent mode Date: Fri, 14 Apr 2023 22:04:39 +0800 Message-ID: <20230414140439.27827-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.20.53] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXDAG02.realtek.com.tw (172.21.6.101) X-KSE-ServerInfo: RTEXDAG02.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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Po-Hao Huang Add iface_combination declaration to enable concurrent mode. Only two interfaces under same frequency is supported currently. We limit the role combination to be STA + P2P or STA + AP only for now until new feature is requested. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/core.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c index 8cdab81ba5f07..60eeb6cea66e4 100644 --- a/drivers/net/wireless/realtek/rtw89/core.c +++ b/drivers/net/wireless/realtek/rtw89/core.c @@ -156,6 +156,28 @@ static struct ieee80211_rate rtw89_bitrates[] = { { .bitrate = 540, .hw_value = 0x0b, }, }; +static const struct ieee80211_iface_limit rtw89_iface_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_STATION), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_AP), + }, +}; + +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, + } +}; + bool rtw89_ra_report_to_bitrate(struct rtw89_dev *rtwdev, u8 rpt_rate, u16 *bitrate) { struct ieee80211_rate rate; @@ -3834,6 +3856,9 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device, if (!hw) goto err; + hw->wiphy->iface_combinations = rtw89_iface_combs; + hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw89_iface_combs); + rtwdev = hw->priv; rtwdev->hw = hw; rtwdev->dev = device; -- 2.25.1