Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1657777rwr; Thu, 20 Apr 2023 19:49:43 -0700 (PDT) X-Google-Smtp-Source: AKy350Y23URpzdI7lkDA3EShlqE/suDJ/vNENlYAM7lcT50Dh1SFB4SWp/rYEPmFWwHMBybqsFPk X-Received: by 2002:a05:6a00:22c1:b0:63b:86a0:6a37 with SMTP id f1-20020a056a0022c100b0063b86a06a37mr4608779pfj.34.1682045383690; Thu, 20 Apr 2023 19:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682045383; cv=none; d=google.com; s=arc-20160816; b=sxFfB2/yQxvnRA+O+6BXbWgp5pWgNU71vBhb6BZZGjpkjpSHf1wBitjovr5lhg9zz/ YMjrWrYo3cDDBNclAckS+lOaxne/aE40y1DDTBthZ0nnFjQeHGVqTI9IwvGsiNUalrLh 4YfuvDbjEpa60dmlGiOtoblAf+Pz/KEBlkhURRvVUPuYn1UoDTSjGIQrdwMm22KcjadV kOTzXDDzaGbUQpJ/Oktg2BqlLOnMH88vdaG5o1yKmMJNcUNNnT0dPqF+/au+HrE1uJpZ 58aLVtVY2J2HcOO0dav7co9SCaMGDLiaknxrj0RE1fWujMoocEzOzbR4hXx6yFgz/28t 6NzA== 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=YZykARxv2CDhfwPyR7KjNrAsVV8CaUiw4TqnXtYw6mI=; b=tcqGkO7Y2HkBK4fRDBBPRvtef+w+5IJ5Lf/lcxFpWmHf8QKoNPYe7XwNlebdnp7YfQ /380e333vq4aL8ooLaoCwp+EslQiS++ekyS3k0JwyrFHF9yJ6jMwU7YXXseNYCBIntCT /yvdccFbSiZtTwVorxyhrEa88Snl1NzXkeWxB/CBV7MScCr+y2vz6nDfXqRApmC9dI6X P+eM+T3JhI55+65xCSojfRYNRDPc9rI/P8Ppq0lnD1mgwFfdiqzG4l+H97UAkPVvEMr8 bG5eZnGKfns06ffD7HjdCCrEQmzf3ZMEYUFLfOWF/oge3RmL3E/2AcsktlHyDMI4Iy/D N+QA== 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 64-20020a630743000000b005138c1f1fcdsi3094147pgh.663.2023.04.20.19.49.35; Thu, 20 Apr 2023 19:49:43 -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 S232030AbjDUCqf (ORCPT + 62 others); Thu, 20 Apr 2023 22:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232378AbjDUCqe (ORCPT ); Thu, 20 Apr 2023 22:46:34 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CF865B3 for ; Thu, 20 Apr 2023 19:46:29 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33L2kNVf9016490, 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 33L2kNVf9016490 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Fri, 21 Apr 2023 10:46:24 +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; Fri, 21 Apr 2023 10:46:03 +0800 Received: from localhost.localdomain (172.21.69.188) 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; Fri, 21 Apr 2023 10:46:02 +0800 From: Ping-Ke Shih To: CC: , , Subject: [PATCH 7/8] wifi: rtw89: 8851b: add support WoWLAN to 8851B Date: Fri, 21 Apr 2023 10:45:50 +0800 Message-ID: <20230421024551.29994-8-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230421024551.29994-1-pkshih@realtek.com> References: <20230421024551.29994-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.188] X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) 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=-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: Chih-Kang Chang Add WoWLAN stub to 8851B, and decalre this chip can support magic packet and disconnect wakeup. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 12 ++++++++++++ drivers/net/wireless/realtek/rtw89/wow.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c index 5ed699ab75a40..ce5c7a8644c39 100644 --- a/drivers/net/wireless/realtek/rtw89/rtw8851b.c +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c @@ -31,6 +31,15 @@ static const struct rtw89_chip_ops rtw8851b_chip_ops = { .h2c_dctl_sec_cam = NULL, }; +#ifdef CONFIG_PM +static const struct wiphy_wowlan_support rtw_wowlan_stub_8851b = { + .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT, + .n_patterns = RTW89_MAX_PATTERN_NUM, + .pattern_max_len = RTW89_MAX_PATTERN_SIZE, + .pattern_min_len = 1, +}; +#endif + const struct rtw89_chip_info rtw8851b_chip_info = { .chip_id = RTL8851B, .ops = &rtw8851b_chip_ops, @@ -101,6 +110,9 @@ const struct rtw89_chip_info rtw8851b_chip_info = { BIT(RTW89_DMA_ACH6) | BIT(RTW89_DMA_ACH7) | BIT(RTW89_DMA_B1MG) | BIT(RTW89_DMA_B1HI), .edcca_lvl_reg = R_SEG0R_EDCCA_LVL_V1, +#ifdef CONFIG_PM + .wowlan_stub = &rtw_wowlan_stub_8851b, +#endif .xtal_info = &rtw8851b_xtal_info, }; EXPORT_SYMBOL(rtw8851b_chip_info); diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c index 2ca8abb70f110..364e546221500 100644 --- a/drivers/net/wireless/realtek/rtw89/wow.c +++ b/drivers/net/wireless/realtek/rtw89/wow.c @@ -91,7 +91,7 @@ static void rtw89_wow_show_wakeup_reason(struct rtw89_dev *rtwdev) u32 wow_reason_reg; u8 reason; - if (chip_id == RTL8852A || chip_id == RTL8852B) + if (chip_id == RTL8852A || chip_id == RTL8852B || chip_id == RTL8851B) wow_reason_reg = R_AX_C2HREG_DATA3 + 3; else wow_reason_reg = R_AX_C2HREG_DATA3_V1 + 3; -- 2.25.1