From patchwork Thu Apr 25 11:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 13643154 X-Patchwork-Delegate: pkshih@realtek.com Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8349583CCD for ; Thu, 25 Apr 2024 11:28:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714044528; cv=none; b=TOiMau5nnURp0+qi3MoZkq8c2s4E6DcB5sC4nmv+h5ef/MlG0lDDaqMy2IyCM8u6XnPfCF+R2FnJ2FAQqkh5bTio+d66Hov0iPGXoh5rn/Nho07KzC7Q/aIwsN12HsUX52ZMbqLLD7XXMsKByjuSNQIgmPpFRLJ/RwMiRpdSrDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714044528; c=relaxed/simple; bh=Epnh8Zz6nAbgQp9ljunITpwsy7xtbtb7BSkqfljswAc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VXmf2LTQ80sCsmCR1bA1T6eSaoOkWtgSQI7eoGw8uWoyhyQqsCBJSUTQMwJZLjOx+fy44BpQWJPLASc8qhFNwGna4v7sysiZEQJ5qQvSPXxmJ9P/T4ZKEO9Q6eSzbKecWgY/49iy1+QLkSve5hjLvBH5aD8BcjObLpTm0TZysGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 43PBShlQ63482236, 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.95/5.92) with ESMTPS id 43PBShlQ63482236 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 25 Apr 2024 19:28:43 +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_256_GCM_SHA384) id 15.1.2507.35; Thu, 25 Apr 2024 19:28:43 +0800 Received: from [127.0.1.1] (172.16.16.129) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 25 Apr 2024 19:28:42 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 01/12] wifi: rtw89: wow: send RFK pre-nofity H2C command in WoWLAN mode Date: Thu, 25 Apr 2024 19:28:05 +0800 Message-ID: <20240425112816.26431-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240425112816.26431-1-pkshih@realtek.com> References: <20240425112816.26431-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) From: Chin-Yen Lee 802.11be WiFi chips need a RFK (RF calibration) notify H2C command after downloading WoWLAN firmware to make sure RF TX/RX work fine when leaving power save mode, so add it to correct RF TX/RX in WoWLAN mode. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/wow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c index ccad026defb5..f7e96fcbbaba 100644 --- a/drivers/net/wireless/realtek/rtw89/wow.c +++ b/drivers/net/wireless/realtek/rtw89/wow.c @@ -454,6 +454,7 @@ static int rtw89_wow_check_fw_status(struct rtw89_dev *rtwdev, bool wow_enable) static int rtw89_wow_swap_fw(struct rtw89_dev *rtwdev, bool wow) { enum rtw89_fw_type fw_type = wow ? RTW89_FW_WOWLAN : RTW89_FW_NORMAL; + enum rtw89_chip_gen chip_gen = rtwdev->chip->chip_gen; struct rtw89_wow_param *rtw_wow = &rtwdev->wow; struct ieee80211_vif *wow_vif = rtw_wow->wow_vif; struct rtw89_vif *rtwvif = (struct rtw89_vif *)wow_vif->drv_priv; @@ -519,6 +520,9 @@ static int rtw89_wow_swap_fw(struct rtw89_dev *rtwdev, bool wow) rtw89_chip_cfg_txpwr_ul_tb_offset(rtwdev, wow_vif); } + if (chip_gen == RTW89_CHIP_BE) + rtw89_phy_rfk_pre_ntfy_and_wait(rtwdev, RTW89_PHY_0, 5); + rtw89_mac_hw_mgnt_sec(rtwdev, wow); rtw89_hci_enable_intr(rtwdev);