Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp440595rwe; Fri, 14 Apr 2023 05:21:19 -0700 (PDT) X-Google-Smtp-Source: AKy350bAB7Ljhg7AUxx1t9/l2qTt0zr5TovsoJnYrgtBKfA1Dgmd9hxyJkYZdM4WHYws2DvFST5k X-Received: by 2002:a17:902:c70c:b0:1a6:95c3:74a with SMTP id p12-20020a170902c70c00b001a695c3074amr2086599plp.17.1681474879333; Fri, 14 Apr 2023 05:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681474879; cv=none; d=google.com; s=arc-20160816; b=oOZiu397yh0PzoBL4zTWWbyGvYxTx3cOHetXrMuGsly0mpbpqLC5Lo2XOV/CX2CaZi lw4aamHGLbZgnabL3DcLjy8N2BjUQI6v/RZPl0XefFhgpSEKfATIrfwPMF3opJFHIu7J jrQN2h7s8XML12s68RN96RE1O5wdbqumsEY4fHC15CfNn0eQaFXEycgQCDFXeXPp4cTH v6JnRVPdEiTX2Nv7+va+JCJc3c/grVo7K0vGMQeWYG08IRinbF+PPM5mNhD+XMTrGAgy c1MLo6MxVB7slY+DPk4Pb07vY54FqPB7WtvZAT75/eyCOQR+05TCzMX7rEwheoaXyYIM fc4g== 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=XUpDdvJn4pzaBH3PATzCpOudt/wKoUl+/9JxzmNtVdU=; b=n3WmmkgyEt4VZ9BQqd5Ik5MG6WaixqIWDnT0ZbnBM6Q9H3nltOmnjMcjExE7jlcYXW csssL87QNozt+/pXqHKb4HBZkeFYew/Gtwm/CnkwKywYm8Ruruw20DhOJyBkHz7CuBQK LXUQFG9V3CMDKxGd4lxCmGr6mJoSTF5OZinOHsjnb+DkTVTFYbkKfhjiAx84d+0TRi7c rJyHpbp2XGAvwV8Wyzg4EFYDW4RFxjqgjRZOpc2bFCSw/r5SFIeiEDI8SjlpGusFgVYK Tetu7UiyDo8SuS8CCJEKkkg02vVlnFycsf7Ule28iN+eUFAqmwAy8qQD8xWuU4LVp79s MgGw== 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 z5-20020a170903018500b001a2911b43c7si4886273plg.273.2023.04.14.05.21.11; Fri, 14 Apr 2023 05:21:19 -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 S230322AbjDNMNR (ORCPT + 62 others); Fri, 14 Apr 2023 08:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbjDNMNQ (ORCPT ); Fri, 14 Apr 2023 08:13:16 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0909D1722 for ; Fri, 14 Apr 2023 05:13:15 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 33ECCkHI2007583, 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 33ECCkHI2007583 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Fri, 14 Apr 2023 20:12:46 +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:08 +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:08 +0800 From: Ping-Ke Shih To: , CC: , Subject: [PATCH v2 5/8] wifi: rtw88: refine reserved page flow for AP mode Date: Fri, 14 Apr 2023 20:13:00 +0800 Message-ID: <20230414121300.17900-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 Only gather reserved pages from AP interface after it has started. Or else ieee80211_beacon_get_*() returns NULL and causes other VIFs' reserved pages fail to download. Update location of current reserved page after beacon renews so offsets changed by beacon can be recognized. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih --- v2: no change --- drivers/net/wireless/realtek/rtw88/fw.c | 5 +++++ drivers/net/wireless/realtek/rtw88/mac80211.c | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index 82295ac6402ee..049473accdb97 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -1393,6 +1393,10 @@ static void rtw_build_rsvd_page_iter(void *data, u8 *mac, struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; struct rtw_rsvd_page *rsvd_pkt; + /* AP not yet started, don't gather its rsvd pages */ + if (vif->type == NL80211_IFTYPE_AP && !rtwdev->ap_active) + return; + list_for_each_entry(rsvd_pkt, &rtwvif->rsvd_page_list, vif_list) { if (rsvd_pkt->type == RSVD_BEACON) list_add(&rsvd_pkt->build_list, @@ -1614,6 +1618,7 @@ void rtw_fw_update_beacon_work(struct work_struct *work) mutex_lock(&rtwdev->mutex); rtw_fw_download_rsvd_page(rtwdev); + rtw_send_rsvd_page_h2c(rtwdev); mutex_unlock(&rtwdev->mutex); } diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c index 1ced57b090832..dbd40a26908ac 100644 --- a/drivers/net/wireless/realtek/rtw88/mac80211.c +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c @@ -417,6 +417,7 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BEACON) { rtw_set_dtim_period(rtwdev, conf->dtim_period); rtw_fw_download_rsvd_page(rtwdev); + rtw_send_rsvd_page_h2c(rtwdev); } if (changed & BSS_CHANGED_BEACON_ENABLED) { -- 2.25.1