Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp330837rwd; Tue, 16 May 2023 01:27:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IsyD9yGM4+kCBN5ak/KXrpxrJINLS+xBmbhrZM1umcSPkY8awwuGyorJvD3EHmpAIMyU/ X-Received: by 2002:a17:90a:ee88:b0:246:f8a8:af02 with SMTP id i8-20020a17090aee8800b00246f8a8af02mr35155246pjz.5.1684225639697; Tue, 16 May 2023 01:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684225639; cv=none; d=google.com; s=arc-20160816; b=KtCel0QFfUIazppoybEv/1rRZWHxDyaxeEm9mhA+g+7e717c32dQVz/D1Ki5Xc5MxB aApwxtoX3tA5FAP3QgzuYHa4pzZM9ofyPdFDRFOaH/bbbFUcUHiYrbyUyrmHAPK0OZZX cLhGCCpC3D1VUWmeu2RCHHxqjGJTu7EQjUO+Vo5/63BoyUeQFacTIqdlIO2/7bD8xmiV wJc34Uz9uFyfJgBaLd9XWHEXv2h4HwSwhKvQybSXCtFC4tNuGSQvRZhJTNN4JaxZo6Rc z0EFWFlsG2Afj6u8w43rllAw6kOJSA8OgCGozmO15+iJFnijiQo8jlmhZljKI/gE85Ik JoHw== 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=2N91OTkKEuUJ/1eVHpW+ao4Kv1hVuA6GbZNnF5w6+qg=; b=xb8mx2n/x5eQOmkUZzZUUtZW0ZY2CMTwe3X6cg6Pz5LU1j/A1eC1gFGCqbi8RAQd7P caXrhOxjnoT8m2NgdFSzD1IwE7fbnG9cmefzdB4y+BAF+m/YWqjg+Jz1fHDy1/3A0dZ5 KqqW5e6zufF82Buylmb80Qv3ReOso6fLlcpbgXFquVHnwzrTZlPKCoahLGLblaumMkx1 12HOmS1aKiL5z63yrVAM/R17SWH5PBVZUHZDxhEfgmqtZX86Yrl8Lfqo9g08HvjbxLYG nHLiajWlWOp5BlDyydJGMptNW4omPe0RzirI/Lu5aZ+i7hNFohTWZstl+SERUs7evoiR Auew== 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 ha11-20020a17090af3cb00b0024de687d6e3si1283633pjb.111.2023.05.16.01.27.07; Tue, 16 May 2023 01:27: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 S230469AbjEPIZV (ORCPT + 63 others); Tue, 16 May 2023 04:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjEPIZT (ORCPT ); Tue, 16 May 2023 04:25:19 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71B1B30EA for ; Tue, 16 May 2023 01:25:17 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 34G8OurT6024306, 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 34G8OurT6024306 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Tue, 16 May 2023 16:24:56 +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, 16 May 2023 16:25:05 +0800 Received: from [127.0.1.1] (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, 16 May 2023 16:25:04 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/3] wifi: rtw89: ser: reset total_sta_assoc and tdls_peer when L2 Date: Tue, 16 May 2023 16:24:39 +0800 Message-ID: <20230516082441.11154-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230516082441.11154-1-pkshih@realtek.com> References: <20230516082441.11154-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: 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: 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: Zong-Zhe Yang The total_sta_assoc and the tdls_peer are used for statistics accodring to stations' information. L2 (Level 2) SER (system error recovery) will call ieee80211_restart_hw() which re-invokes sta_state ops. And then, the total_sta_assoc and tdls_peer will be re-increased. In case wrong statistics results, we reset them in SER L2 handling. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/ser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c index 9ba99f3764e7e..54b314b8b3292 100644 --- a/drivers/net/wireless/realtek/rtw89/ser.c +++ b/drivers/net/wireless/realtek/rtw89/ser.c @@ -303,6 +303,7 @@ static void ser_reset_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif) rtw89_core_release_bit_map(rtwdev->hw_port, rtwvif->port); rtwvif->net_type = RTW89_NET_TYPE_NO_LINK; rtwvif->trigger = false; + rtwvif->tdls_peer = 0; } static void ser_sta_deinit_cam_iter(void *data, struct ieee80211_sta *sta) @@ -341,6 +342,8 @@ static void ser_reset_mac_binding(struct rtw89_dev *rtwdev) rtw89_core_release_all_bits_map(rtwdev->mac_id_map, RTW89_MAX_MAC_ID_NUM); rtw89_for_each_rtwvif(rtwdev, rtwvif) ser_reset_vif(rtwdev, rtwvif); + + rtwdev->total_sta_assoc = 0; } /* hal function */ -- 2.25.1