Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3201398yba; Mon, 6 May 2019 19:29:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGRfcVNpBfq4wTZs04G0sSkb3aP8BUunJcXLDB8rll6j9+ewTnIP/55VOPF3DgtM8s06ic X-Received: by 2002:a62:6842:: with SMTP id d63mr38815066pfc.9.1557196148353; Mon, 06 May 2019 19:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557196148; cv=none; d=google.com; s=arc-20160816; b=N3aGmt64hOvP5FiwL7Ztyr9UBJBpCINAymLsVSyrg9M1CjlnZurT+DkhzgNatMVf3e qH1KTyCDWnhARc66o14DnMMd2luU3qcVQLToFuCrJNRnlHdnnyI0O/OiFeX4hniuuA3J bqHjQ85j7pUZIOfku2Qa7TI5WVab24JcpyljjYcXqAOF0PkIFW3FlBiW390AAPHoZjho PhAW1N0Zlu1UeyriCo/jCz3Fqs2Z6j80fd86vO7Ou+I7sD9OOrFOdG5sg9XNxZ3b46wt m5GV0tu/FFaSUlysd5ujfc9vpiKeYUDCcbICkafw0dlXPpml/UyDMeCn+N1/nNoIbfck 1TKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:authenticated-by; bh=YXtD8ErYkjNq1bO+VjfAiyOYfRaE1I3A+Yvlghsi+l8=; b=HWgBdPN9r7PfrfKT2unS5svw9v2/sJKOV0EfESAwawz4Rsc3mFyj+AXhFACiHzfxRh dDu39iG8MX20CHahTOtjL95uQhwt/o7sbcz+lemYGA/L+hSZmwe79s521nLbj6lTsqpl gU6OpTia5HglH9uWKt8Grd2TR7tOIU5DEEsR3zaufHAqXcChMM1UfuEEOVCTtQJvnYWb b5xcfOSq/AjWCI8PcxHK1Xyk2W84TXsFi8Gg7V/vzqm3CY3idkr0qlE8hCcVGjm6EZ9P 8XDU1NTZxwmJgpimwF1HKNO9dC13ZydwVkBZ2U/ia8dgK9ebQMAoUDcqmbAmcxJY20JA TgbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si17711539plc.424.2019.05.06.19.28.41; Mon, 06 May 2019 19:29:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbfEGC22 (ORCPT + 99 others); Mon, 6 May 2019 22:28:28 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:50865 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEGC22 (ORCPT ); Mon, 6 May 2019 22:28:28 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x472SMXi004592, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtitcasv01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x472SMXi004592 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NOT); Tue, 7 May 2019 10:28:22 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.408.0; Tue, 7 May 2019 10:28:21 +0800 From: To: CC: Subject: [PATCH 5.2 v3] rtw88: fix unassigned rssi_level in rtw_sta_info Date: Tue, 7 May 2019 10:28:18 +0800 Message-ID: <1557196098-1479-1-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang The new rssi_level should be stored in si, otherwise the rssi_level will never be updated and get a wrong RA mask, which is calculated by the rssi level If a wrong RA mask is chosen, the firmware will pick some *bad rates*. The most hurtful scene will be in *noisy environment*, such as office or public area with many APs and users. The latency would be high and the overall throughput would be only half or less. Tested in 2.4G in office area, with this patch the throughput increased from such as "1x Mbps -> 4x Mbps". Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c index 4381b36..7f437e2 100644 --- a/drivers/net/wireless/realtek/rtw88/phy.c +++ b/drivers/net/wireless/realtek/rtw88/phy.c @@ -144,10 +144,10 @@ static void rtw_phy_stat_rssi_iter(void *data, struct ieee80211_sta *sta) struct rtw_phy_stat_iter_data *iter_data = data; struct rtw_dev *rtwdev = iter_data->rtwdev; struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; - u8 rssi, rssi_level; + u8 rssi; rssi = ewma_rssi_read(&si->avg_rssi); - rssi_level = rtw_phy_get_rssi_level(si->rssi_level, rssi); + si->rssi_level = rtw_phy_get_rssi_level(si->rssi_level, rssi); rtw_fw_send_rssi_info(rtwdev, si); -- 2.7.4