Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8103141rwi; Tue, 25 Oct 2022 02:29:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LH8k0xIJ+1AvWAQosPgGBCbhnKY6FBOv79jXVuDy+jyM7MCMEgKQcinn+ToN6LRTzIaD7 X-Received: by 2002:a05:6402:35d1:b0:45d:3661:567e with SMTP id z17-20020a05640235d100b0045d3661567emr35508430edc.343.1666690180003; Tue, 25 Oct 2022 02:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666690179; cv=none; d=google.com; s=arc-20160816; b=ZRfQJqPVqEjL0XUvlkSb7G0icVBJvr6kQyeU+1hhwMq6oCUksRdA2Ff3twHJv69OZV g7qj03GGYLyLYWF9BtDDLTgjyBwmK4iSa6sX7AYDNtKOpADvkvSCtgWCM7GTtTQx4B99 43OavdB+VEpUEJPJskJtwlw6VQGAxZJBuPYd7tTn2m70EaT94ASFwA13+1WZ9t8IKUHx lddzjf8elSekxijhRGtu7f1lKmcAuYy1ZyUp+heqI4AKq77o0JoL71k9lTNfPKHlIJP5 SinNXCSS1z2zUxzxF3PuFZVDF4rJZn4moLnDvB22LeqvIBxV8Jnpx8la4EBNOG+xd5p6 WARA== 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=/M8dfPnW+BfBURMMM6tAT2WhxmKIzdVwhUZKwHJePBE=; b=KLbaFkjkM3WoVlMu+Pf64RxMqZYhT110cR1nO9s0sN2Jp0v3j57k0siV2M05dcxJSq SNnrm2ZbeKZmYEyslRKqru0WHiJ77YjNX+rgPnhb5HuYJTQobqRM+jKzd7CPzlhGT2Lo l3BpkCWAXDvi4Oeym6B5u2fSTRa832K43HQPBL8Ph44O2ehF/7+M+TCfHZsAQVDjAMWT pTJ4JoEjamfJcuP7NIDfZS/0ocu/0HfotRAK3ZXHM+mRTdvvMeZG+TFV4UcEtN9r11CJ /qmXXpMbaRCA8ugEuBjjvwRxFemtMTjL3N800ZX9unLgGn2b3rySNBn/016kt+/EnHid uYeg== 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 y6-20020a50eb86000000b004602a1b7da9si1990082edr.133.2022.10.25.02.29.23; Tue, 25 Oct 2022 02:29:39 -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 S231361AbiJYJ0G (ORCPT + 65 others); Tue, 25 Oct 2022 05:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbiJYJZb (ORCPT ); Tue, 25 Oct 2022 05:25:31 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 17E8865266 for ; Tue, 25 Oct 2022 02:20:45 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 29P9K3sjC006495, 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 29P9K3sjC006495 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Tue, 25 Oct 2022 17:20:03 +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; Tue, 25 Oct 2022 17:20:36 +0800 Received: from localhost (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; Tue, 25 Oct 2022 17:20:35 +0800 From: Ping-Ke Shih To: CC: , , Subject: [PATCH 0/7] wifi: rtw89: support WoWLAN Date: Tue, 25 Oct 2022 17:19:47 +0800 Message-ID: <20221025091954.23957-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.21.69.188] 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: trusted connection X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 10/25/2022 08:58:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: =?big5?B?Q2xlYW4sIGJhc2VzOiAyMDIyLzEwLzI1IKRXpMggMDY6MzM6MDA=?= X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled 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 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 WoWLAN (Wake on WLAN) is a feature which allows devices to be woken up from suspend state by WLAN events. When specific events are received, WiFi chip raises a physical pin or sends an in-band message to wake up system. For a PCIE WiFi device, it sends a PCIE PME event to host. Before entering suspend, driver needs to stop TX/RX DMA, swap to WoWLAN firmware due to firmware size is limited, and then restart HCI properly for WoWLAN mode. To avoid track work to ask entering LPS while process of going to suspend, we forbid the work during suspend/resume period. In additional to main flow mentioned above, patch 1/7 is to prepare RF parameters to help WoWLAN firmware configure RF. Patch 2/7 is to refine download_firmware(), because swapping WoWLAN firmware can reuse the flow. Patch 4/7 is to drop TX packets to ensure TX queue empty before entering suspend. The main patch is 6/7, it adds main flow of WoWLAN, and the last patch is to add WoWLAN pattern match. Since WoWLAN of 8852B is still under development, we don't enable it at this patchset, and will support it soon. Chih-Kang Chang (4): wifi: rtw89: collect and send RF parameters to firmware for WoWLAN wifi: rtw89: move enable_cpu/disable_cpu into fw_download wifi: rtw89: add function to adjust and restore PLE quota wifi: rtw89: add drop tx packet function Chin-Yen Lee (3): wifi: rtw89: add related H2C for WoWLAN mode wifi: rtw89: add WoWLAN function support wifi: rtw89: add WoWLAN pattern match support drivers/net/wireless/realtek/rtw89/Makefile | 2 + drivers/net/wireless/realtek/rtw89/core.c | 10 +- drivers/net/wireless/realtek/rtw89/core.h | 129 ++- drivers/net/wireless/realtek/rtw89/debug.h | 1 + drivers/net/wireless/realtek/rtw89/fw.c | 294 ++++++ drivers/net/wireless/realtek/rtw89/fw.h | 249 ++++- drivers/net/wireless/realtek/rtw89/mac.c | 135 ++- drivers/net/wireless/realtek/rtw89/mac.h | 31 + drivers/net/wireless/realtek/rtw89/mac80211.c | 55 ++ drivers/net/wireless/realtek/rtw89/pci.c | 23 +- drivers/net/wireless/realtek/rtw89/phy.c | 31 +- drivers/net/wireless/realtek/rtw89/phy.h | 2 +- drivers/net/wireless/realtek/rtw89/ps.c | 2 +- drivers/net/wireless/realtek/rtw89/ps.h | 1 + drivers/net/wireless/realtek/rtw89/reg.h | 21 + drivers/net/wireless/realtek/rtw89/rtw8852a.c | 18 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 14 + drivers/net/wireless/realtek/rtw89/util.h | 11 + drivers/net/wireless/realtek/rtw89/wow.c | 858 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/wow.h | 21 + 20 files changed, 1888 insertions(+), 20 deletions(-) create mode 100644 drivers/net/wireless/realtek/rtw89/wow.c create mode 100644 drivers/net/wireless/realtek/rtw89/wow.h -- 2.25.1