Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp439409rwe; Fri, 14 Apr 2023 05:20:19 -0700 (PDT) X-Google-Smtp-Source: AKy350aU5Mc9iG3tPOHqiz+uvGcMnL9krXZNCcaBsYzbKleXrub2Skzr0asV9aA9r2nImPdsCzET X-Received: by 2002:a05:6a00:2343:b0:626:17b8:8586 with SMTP id j3-20020a056a00234300b0062617b88586mr7694926pfj.30.1681474818961; Fri, 14 Apr 2023 05:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681474818; cv=none; d=google.com; s=arc-20160816; b=jivdtE2J8yypXZ2ZSTpWwtbIJB2AntCatK/knAjAB/NFiG4sepiX5DJNtACLoz5Y/6 hRoQov9VjKlKha5gpTevK+80xrMp53Hb7WlwuGn8zNygRreHfxQfjIy9eNv3EqtagFgi gWrVo2MSv4ul1jRY37ZR4rr4cUYJ/AQcSd+2CigS9wOU3o+PYXDYCkFVaZV4otLEY5ik xO9L6VAH8UOlLTFh9FbvuRvwyNJL2U7nzmPfgVsY/t76gyJ6XCsmTPBTaX4icsFzSnSG 2uG3EM14p6c9QvH42VDz2zL+rj7MA98JlI/mFfcxqQ+j/ZksX8M7Fh5KH48V8lQXm5AY xV6A== 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:authenticated-by; bh=tnfTbLvKjkS34tYVHK+ROvM0X+iDBg/c3BJk0ow5I+Y=; b=K3Z6UFG180PHxam2OLK9i5aZNnqB9RwOIx4A7PSMkouD5HcognDe26EkiJLLuXYaIZ cZs5ZHbo0fttDEEAlZBZ5FXgYbNEsImD3FaPj/Qf9oiZY4rsjlG1DeVlqftM2HXHaxK3 u8bMU3NwYebg+un2Q3cCoYLlvdBiaB/pv8JwcOV5c0TFduuLQ+n6y4uoeh9Ky1yZ6N6o BecqXfOjSLH9mAkcpfK2POu5FKrNWp2O5XTYhE/CwliN9Ph0pL8zhzGiQ9c0mXG5H1Pq J2QDkMVTtDkYfgUY6SD3Z7bbBNOViAqXLCzPL2cw/dVRNDcvzpe5JDTgqWAeth4VXcyT LjsQ== 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 f23-20020a631017000000b005139e0d2b5csi4411891pgl.487.2023.04.14.05.20.11; Fri, 14 Apr 2023 05:20: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 S230316AbjDNMNq (ORCPT + 62 others); Fri, 14 Apr 2023 08:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbjDNMNp (ORCPT ); Fri, 14 Apr 2023 08:13:45 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB9E3E69 for ; Fri, 14 Apr 2023 05:13:44 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33ECDFbV4008079, 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 33ECDFbV4008079 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Fri, 14 Apr 2023 20:13:15 +0800 Received: from RTEXDAG02.realtek.com.tw (172.21.6.101) 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; Fri, 14 Apr 2023 20:13:37 +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 20:13:37 +0800 From: Ping-Ke Shih To: , CC: , Subject: [PATCH v2 8/8] wifi: rtw88: 8822c: add iface combination Date: Fri, 14 Apr 2023 20:13:31 +0800 Message-ID: <20230414121331.18062-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-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 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 --- v2: no change --- 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 c3a91bef13e4e..0ba81b87aad55 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -103,6 +103,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; @@ -2205,6 +2225,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