Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp32067lql; Fri, 12 Apr 2024 02:46:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCivi9EVQeRzveh9paQT0+uejJc69K+dQWDFzM5z2mkphxumQHRqARK+vCtY9qS3MlZW7zYQPs1e7x5mlqUvGrBgg7UkLNOKUC/j03KQ== X-Google-Smtp-Source: AGHT+IHbSHZiiMaBLGkPd/5rDIFW5YO9HQYC76RIq8YhPjyKp0ExhPgeLs/VTcnucs/CuMNLTuSO X-Received: by 2002:ac8:5f95:0:b0:434:ffff:698c with SMTP id j21-20020ac85f95000000b00434ffff698cmr2108491qta.35.1712915168044; Fri, 12 Apr 2024 02:46:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712915168; cv=pass; d=google.com; s=arc-20160816; b=NP5SDadoe45lbpRb1INpgh1LtvkuDqtsrS4K7j3WhwjAKGbB0MHGOaL/ftkkzGOhxX Ujfp14pONfz9f3hG+zynmtaDYHgYipUSdADzahD7zpUDKZfZ2Gl+PUb0vcFsgyOT7mH1 VLLTunSg4GIKjauG8Q1wYwjVZQnNqU5zPFewdV7OSrfTUPtxz/6sy4VfOppBy0kRMKm9 rjYQ+tyjVnewcW7ixD9h00//S0/e6Rt6SDy2vWOvv/TlJdcjOqx04cskMCD5S5mlLHnQ Q9d3Gte63jd2+aWMArHE6gRdFjk9ZRifRACUvwsWljYS7zfLm8JNvMZeSaX2RewW4khF NE0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=fhhbsHGNsmfM4st8q4g55VM7ihGk1JTBYjuKEFL1YQU=; fh=T27QnONB81A+Cjn+MTd5LSsVmiM+pe1FYthz2KpViJo=; b=RjcTTGGn5o/cN9aGM3N3Zx05iOSwdONIyYR6BfPBx1ruws3E7GlCGnbpjZGFrnTMUp y9ggDWFGRHXxjKKRK4OBCb+BG/kd8TzIJC/vB7VWVOqfsCS7yCeTt9F189GVIDjcCaur GE9pqBQMlPJlrcGDzfiG9n2DjjwmJrJ72bTCADcQFnRzd4Lu9xtmZxCJ+0wIJ5y7qqES 2SuN77qKxl9xIH4BL57107bCf+eenTUnxRfpn1glkSpSF9qlWjkuDAuts+6oipvXGxk1 40MGr01H39VxLbRODR+2boBBnBP2H2QSkuNN14reqd/RJujXdTlFjDqPoRcAlKWq7VgM PJTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jNOpIGXe; 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-6237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6237-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 e15-20020a05622a110f00b0043697289955si567656qty.354.2024.04.12.02.46.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:46:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6237-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=jNOpIGXe; 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-6237-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6237-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 838671C20C04 for ; Fri, 12 Apr 2024 09:46:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1A4850A87; Fri, 12 Apr 2024 09:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jNOpIGXe" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 2DD295029E for ; Fri, 12 Apr 2024 09:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712915164; cv=none; b=lvrmAoKLvQ+C7WYaQodpH/VYRynxUtuooVdvONlLvf/Ou93fE0N+YNwmblItVPs9jVk7a7b1HJFxL0jUCylaiU0AZ7xiBe5OnUK0muENeRTqJVI8TaBVk0zV/yCM2E+wRgxmUiBnKW9w+pPDwDjLLbMeWPus8xDoj/tTua9JtQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712915164; c=relaxed/simple; bh=sOSQ3APr5Qm0ga9eT63W0WkVBIH+BDYCHLb1hVM9tyY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=U0inGhsFEK/VoO5tUpZMji0a79vXmBTWsVLGB4FRgPRd3p+7BEeMCqTQXD/2WMKhb0CwzmRQiJ7VvVMXH7CxMSh0/d2VblOOJkTcCi2NPN0dIPMa0eTI/Le0xYFWF52o74cwR/NrxYdFcP7v0J9JZshboNvYQEIJtAxrtneYDTQ= 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=jNOpIGXe; arc=none smtp.client-ip=205.220.168.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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43C6GR37011713; Fri, 12 Apr 2024 09:45:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=fhhbsHGNsmfM4st8q4g55VM7ihGk1JTBYjuKEFL1YQU=; b=jN OpIGXex3xLxlvh+sz8OYRm9SOH028ESMUE8ufqSrd67W1QXQWzyfVbaVPv6UJVx0 RvpPxFtSDBSided0vvj7ZLohHnlX5QM94u284vul5BfWc+Hfjg7OAm2V3g+CLlKd 7mQPC2i8MNKBspsCgG61pHcHz9x5fnX2LFE5ndqjftdBo73eIbau4VIw3ZCeCrEK s3EvC1NntrNVY7Uq6sfiF2I1EpLUBch0Yx/eAo24h5e7aSDUd7uFn/xhUJwlSFFs Hm7dUV0TCE3TMq5dlSCRVhYae5E9rDv5MP0CJgj5OTN9Ztt5yrpQUd7hPnRY35wM kpZSYdifmbqRsL9Vgp6w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xesjbs36f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 09:45:59 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43C9jwFN029723 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 09:45:58 GMT Received: from [10.110.42.101] (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.1544.9; Fri, 12 Apr 2024 02:45:57 -0700 Message-ID: <70f73d7c-4ed1-4678-9eb4-7d4594af1df9@quicinc.com> Date: Fri, 12 Apr 2024 17:45:54 +0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] wifi: ath12k: report station mode signal strength To: Jeff Johnson , CC: References: <20240411025322.33888-1-quic_lingbok@quicinc.com> <20240411025322.33888-4-quic_lingbok@quicinc.com> Content-Language: en-US From: Lingbo Kong In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: ECaCi7fqBC0yGQMJU4iNtmP9YPjsANAz X-Proofpoint-GUID: ECaCi7fqBC0yGQMJU4iNtmP9YPjsANAz 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-04-12_06,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 mlxscore=0 impostorscore=0 bulkscore=0 adultscore=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404120070 On 2024/4/12 5:51, Jeff Johnson wrote: > On 4/10/2024 7:53 PM, Lingbo Kong wrote: >> Currently, the signal strength of "iw dev xxx station dump" always show an >> invalid value. >> >> This is because signal strength is only set in ath12k_mgmt_rx_event() >> function, and not set for received data packet. So, change to get signal >> from firmware and report to mac80211. >> >> After that, "iw dev xxx station dump" show the correct signal strength. >> Such as: >> >> Station 00:03:7f:12:03:03 (on wlo1) >> inactive time: 36 ms >> rx bytes: 61571 >> rx packets: 336 >> tx bytes: 28204 >> tx packets: 205 >> tx retries: 49 >> tx failed: 0 >> beacon loss: 0 >> beacon rx: 83 >> rx drop misc: 66 >> signal: -24 dBm >> beacon signal avg: -22 dBm >> >> For WCN7850, the firmware supports db2dbm, so not need to add noise floor. >> For QCN9274, the firmware not support db2dbm, so need to add noise floor. >> >> This patch affects the station mode of WCN7850 and QCN9274. >> >> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 >> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.2.1-00201-QCAHKSWPL_SILICONZ-1 >> >> Signed-off-by: Lingbo Kong >> --- >> drivers/net/wireless/ath/ath12k/core.h | 2 + >> drivers/net/wireless/ath/ath12k/mac.c | 56 ++++++++++- >> drivers/net/wireless/ath/ath12k/wmi.c | 130 +++++++++++++++++++++++++ >> drivers/net/wireless/ath/ath12k/wmi.h | 48 +++++++++ >> 4 files changed, 234 insertions(+), 2 deletions(-) > [...] >> diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h >> index 78afc94a815d..9016eda03d57 100644 >> --- a/drivers/net/wireless/ath/ath12k/wmi.h >> +++ b/drivers/net/wireless/ath/ath12k/wmi.h >> @@ -4811,6 +4811,52 @@ struct wmi_twt_disable_event { >> __le32 status; >> } __packed; >> >> +struct wmi_stats_event { >> + __le32 stats_id; >> + __le32 num_pdev_stats; >> + __le32 num_vdev_stats; >> + __le32 num_peer_stats; >> + __le32 num_bcnflt_stats; >> + __le32 num_chan_stats; >> + __le32 num_mib_stats; >> + __le32 pdev_id; >> + __le32 num_bcn_stats; >> + __le32 num_peer_extd_stats; >> + __le32 num_peer_extd2_stats; >> +} __packed; >> + >> +enum wmi_stats_id { >> + WMI_REQUEST_VDEV_STAT = BIT(3), >> +}; >> + >> +struct wmi_request_stats_cmd { >> + __le32 tlv_header; >> + __le32 stats_id; >> + __le32 vdev_id; >> + struct ath12k_wmi_mac_addr_params peer_macaddr; >> + __le32 pdev_id; >> +} __packed; >> + >> +#define WLAN_MAX_AC 4 >> +#define MAX_TX_RATE_VALUES 10 >> + >> +struct ath12k_wmi_vdev_stats { > > this name does not conform to the "Naming conventions for structures" outlined > at the beginning of the file: > * _params is a structure which is embedded either into _cmd or _event (or > * both), it is not sent individually. > Oh, thanks for pointing out. I get what you mean, but the ath12k_wmi_vdev_stats belongs to event, so, i can changes it to wmi_vdev_stats_event, i will apply it in next version. Best regards Lingbo Kong >> + __le32 vdev_id; >> + __le32 beacon_snr; >> + __le32 data_snr; >> + __le32 num_tx_frames[WLAN_MAX_AC]; >> + __le32 num_rx_frames; >> + __le32 num_tx_frames_retries[WLAN_MAX_AC]; >> + __le32 num_tx_frames_failures[WLAN_MAX_AC]; >> + __le32 num_rts_fail; >> + __le32 num_rts_success; >> + __le32 num_rx_err; >> + __le32 num_rx_discard; >> + __le32 num_tx_not_acked; >> + __le32 tx_rate_history[MAX_TX_RATE_VALUES]; >> + __le32 beacon_rssi_history[MAX_TX_RATE_VALUES]; >> +} __packed; >