Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp139822lqk; Sat, 9 Mar 2024 04:12:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUwDBTAlTXnkH9CafUQuHPpgfTsjaqiQJ0dKSAZTzdFgP63jCBfTPWh8yozH5nMRwkqTxtyQSRUQZWI4DdHqIABHu/ogGTYbFEfBk5o2A== X-Google-Smtp-Source: AGHT+IFvSSj+MTjfjtbqhl0CWghvw5oJPt33bsdUqFS2qrNCaRggu6MTam1cc5vjQLido8bQcvqv X-Received: by 2002:ac8:5849:0:b0:42e:7a59:8041 with SMTP id h9-20020ac85849000000b0042e7a598041mr3720282qth.4.1709986332760; Sat, 09 Mar 2024 04:12:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709986332; cv=pass; d=google.com; s=arc-20160816; b=guQjqzyBNh/+j1fm44GuFLVRKjAnOA9X11fWgAwh4Rt18EPaQHjsXxOyHUJLH2iENg 8g4PFn3fJwegWpSCxsY6kqMSfwh7tNzdth/XEl30oh2cFSnDHtUIb+uxpCUgVfmhGSqu lhvUaFvP8VbHrTS7zn5rJ1SeqNbSFADaACrT69NAzxeikrYdN3015KbzvphFnbptRedE kK2VzOzscH1ld6Jflw/ih1kvbnkC2a0kNfIebWxQSegR9PISb+DkduuGixUClD6TMUgm tdHah8PV71V+6aU0dz/uIjrhfZ0ye22nzgK46ch6scDKe2xXQqGIyrZ3kMXp7TZ37Zgl HTqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=8spNzfVDYXqnoGqZxoqtSV6/KIyrNwZMnMKRiN9BDlE=; fh=/ph0EOuGOvl5ILQGsTcDMjeQfOLIlZZP+EsTHgPG26A=; b=Kg4yBsOeZtnyaZmj4G6an2/RkqTpRdgAtFxM8cNWxZHdA8PtBlvmJllXVB9rcNx8WF 5R3mJG54q25dqOrX+jxpRoBMiv4fhQNOLCJzepMgT2KqB/iM8HhyR99F5ezTrtGAJx22 70fVgnJzgJV9mgXY6jqe27d1HnK1MP8rgPkeyr60W4gzotfeVsFjuUVshxXVph2CugEF QXA1XMgS6F0zv/2z/AYOJOqkzF5PNb8SOrKmpjhAZ9lt4KbUiTc9fqM/eErjzsuRD9uK LMpLOlO7N8Pk/2DRabUfie7JDKw8dnw9F1JYh/hyUkb9gN7ViH7lzMirAC2WZ9iAspql 5/pQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RMieqmfo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-4518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jr6-20020a0562142a8600b00690493ddf90si1451287qvb.429.2024.03.09.04.12.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 04:12:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RMieqmfo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-4518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 616281C20985 for ; Sat, 9 Mar 2024 12:12:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7A062BD12; Sat, 9 Mar 2024 12:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="RMieqmfo" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0301B1D69E for ; Sat, 9 Mar 2024 12:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709986329; cv=none; b=g1CBoVemN60XxUrIOpzFTdnCzaU+Rz7tufI3wWIE4EYQbsTY6W94t8xqrFulq5YX4hi5UKsP7MBcf2rc9FpzGL7upQNWCnPQHFFGyRn2sjdXJZoZB6G/LiWz/jI0NHjn5nVm4WxDKUFPmIrR9YHTaHWE2w3bqmg2vxN1xnXjVbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709986329; c=relaxed/simple; bh=lGzWTqHJWrbe/AGrJv9PLurC/cJDG5AsL0NXRejmcZk=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=W5MySAMt2W5lZ7VRqE8xzFBNm0ptP4y9pfwrpPpOGyPprQsCzcZJCCcGYGEyrSwWZHKgmxgqujvBwYzLwDct0dL1H/kb7sf9M9d1qDR6+Tu9LYQuBZcOGGsDYhV4NombyUvI8SsC+u4Cihh4rFOkVti9ZeyxB0DRaL4n7PbRZE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=RMieqmfo; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 429C9QvG023037; Sat, 9 Mar 2024 12:11:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=8spNzfV DYXqnoGqZxoqtSV6/KIyrNwZMnMKRiN9BDlE=; b=RMieqmfoHBnG+9Ku4NsIX8s TSwi5zvJ362NfTQ/xAKoFt5F+z65/AVyMODKO52Fa9kRL4ox8Y/aF/x8eXuWD/db OvNNb9HQhUvo7cYxtZnPct3UzwMvi8e9QiukgC3OKECtDZGYy2OHhe8ef4tAUA6T fjPLh23qvM7/jYpw1oqhnpfmpoL6JknuQ5pWRrV3LgDP+dGs7QJuzFbrisvVlgHP oMt9Incv1C0bVBD8ArbieQQQu4CFSLAfuUmbb6UwxrERoRCO5GQcxZIm2bP3LUdS U2tKToSYU2fKR942imJwuiMbDJ0ArGwT50BXSd6IFykeCEip+rPNaGu7IcC5G0w= = Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wrfc40gdc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 09 Mar 2024 12:11:47 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 429CBku9025436 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 9 Mar 2024 12:11:46 GMT Received: from lingbok-Birman-PHX.qca.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 9 Mar 2024 04:11:45 -0800 From: Lingbo Kong To: CC: , Subject: [PATCH] wifi: ath11k: modify the calculation of the average signal strength in station mode Date: Sat, 9 Mar 2024 20:11:29 +0800 Message-ID: <20240309121129.5379-1-quic_lingbok@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: RjZfXhawuQL65f5jBpmYmYePYhydz9he X-Proofpoint-GUID: RjZfXhawuQL65f5jBpmYmYePYhydz9he X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1011 spamscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403090098 Currently, the calculation of the average signal strength in station mode is incorrect. This is because before calculating the average signal strength, ath11k need to determine whether the hardware and firmware support db2dbm, if the hardware and firmware support db2dbm, do not need to add noise floor, otherwise, need to add noise floor. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Lingbo Kong --- drivers/net/wireless/ath/ath11k/mac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index a6a37d67a50a..1f9cf7a42ba8 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -8976,8 +8976,11 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw, sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); } - sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi) + - ATH11K_DEFAULT_NOISE_FLOOR; + sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi); + + if (!db2dbm) + sinfo->signal_avg += ATH11K_DEFAULT_NOISE_FLOOR; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG); } base-commit: 7a5ed5a3801e9b6cf7bafbb0a05c70cef620b22a -- 2.34.1