Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2306245rwl; Sat, 1 Apr 2023 05:46:18 -0700 (PDT) X-Google-Smtp-Source: AKy350ZKYBoNGB9BGm5MSRGVa/rI2/Pc7LUU19gsJYhw53v9sreZY21lrcvEqOvrLWOmgLvlt3t8 X-Received: by 2002:a05:6402:26d5:b0:4af:7bdc:188e with SMTP id x21-20020a05640226d500b004af7bdc188emr12891568edd.16.1680353178138; Sat, 01 Apr 2023 05:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680353178; cv=none; d=google.com; s=arc-20160816; b=qicY+gryK9yrOG9J47jUxk2i0rVGaTUDjnObG8ayYiHABasDkN8N6N4GDBVDmFdXxo 9joHI7UHldKXC0nU50A5KS8kQqRtGQtEJ5qbh9hL9v34pnqvNgESxC5xgmiZ58oEzgb0 aGNZ8cqC0zwPBLt7IkoLQJyeVlSQWIAOrQSG9bhAba0NyAW8LUTlxRsk0xTX6Fxjk+6p aII7DuhuDbEQsLAuaoumtfHa2svclhea2JlHZbAYZ9xFdglp8DROz19+NtnhQ9HXZCWo Jlg+I8fAG7vXmjYNeru9eGobw4SqCVsbhfcZM9gYX6nIhfz4oB2oRA5Z6YHdhpHH5VTJ ItZg== 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 :authenticated-by; bh=Tyx1TgJia2ix3AdHtfdItxJevRlXFwZ8NsnptjPmBjg=; b=y9iRtjpx4lW48oohYJjzmexV55gd4qPAYvrKy/SwMZ4OFS5IYGP94vKZfSGnwHFF1z sJJnIbsg2A8jTYbVnA+syuZE+r3ipnxwobJqIIqviH1NcfQaGPcSNa1Wcma6VwCWZBql bV5WyNG83pgyNnIqLy6KiUfeSO2mt+s+Bo0u08xpdTZSO55XVTUjbPyweQwe++UQGGUl jwxHAIWXNOBe/tRFBAZYV2kHvPN1ttDy3lI79b3D6xBXIUb8a01F3SVDnYcAMDpZbCLN D5HNUU/pM1qqrqrw79oSh7iCmlJ8KqnmTdObHWlW9cDr0JEENWoN5sPhYlL5AcQBk8oo R+UQ== 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 s14-20020a1709064d8e00b0092be6bcd27bsi4797260eju.556.2023.04.01.05.45.53; Sat, 01 Apr 2023 05:46:18 -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 S229450AbjDAMpu (ORCPT + 58 others); Sat, 1 Apr 2023 08:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjDAMps (ORCPT ); Sat, 1 Apr 2023 08:45:48 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD5261FD15 for ; Sat, 1 Apr 2023 05:45:44 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 331CjJ671021696, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 331CjJ671021696 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Sat, 1 Apr 2023 20:45:19 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Sat, 1 Apr 2023 20:45:37 +0800 Received: from localhost (172.16.16.15) 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; Sat, 1 Apr 2023 20:45:36 +0800 From: Ping-Ke Shih To: , CC: , Subject: [PATCH 7/7] wifi: rtw88: 8822c: add iface combination Date: Sat, 1 Apr 2023 20:44:10 +0800 Message-ID: <20230401124410.33221-8-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230401124410.33221-1-pkshih@realtek.com> References: <20230401124410.33221-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.15] 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-Spam-Status: No, score=0.0 required=5.0 tests=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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Po-Hao Huang Allow 8822c to operate two interface concurrently, only 1 AP mode plus 1 station mode under same frequency is supported. Combination of other types will not be added until requested. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/main.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 835abbdd87eff..d60a56508f389 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -102,6 +102,26 @@ static struct ieee80211_rate rtw_ratetable[] = { {.bitrate = 540, .hw_value = 0x0b,}, }; +static const struct ieee80211_iface_limit rtw_iface_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_STATION), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_AP), + } +}; + +static const struct ieee80211_iface_combination rtw_iface_combs[] = { + { + .limits = rtw_iface_limits, + .n_limits = ARRAY_SIZE(rtw_iface_limits), + .max_interfaces = 2, + .num_different_channels = 1, + } +}; + u16 rtw_desc_to_bitrate(u8 desc_rate) { struct ieee80211_rate rate; @@ -2195,6 +2215,11 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw) hw->wiphy->max_scan_ssids = RTW_SCAN_MAX_SSIDS; hw->wiphy->max_scan_ie_len = rtw_get_max_scan_ie_len(rtwdev); + if (rtwdev->chip->id == RTW_CHIP_TYPE_8822C) { + hw->wiphy->iface_combinations = rtw_iface_combs; + hw->wiphy->n_iface_combinations = ARRAY_SIZE(rtw_iface_combs); + } + wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SCAN_RANDOM_SN); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SET_SCAN_DWELL); -- 2.25.1