Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp45453lql; Fri, 12 Apr 2024 03:17:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZB4o5DkaBJM+1spRoCcQjLoyxxrLTYFRK0TwsohxOVJw7fSpgONBr3Sf5xL2t+RKmqN9cKB6l/8l8J3tNWhz05o6ZuFNx3ryEoFXFBg== X-Google-Smtp-Source: AGHT+IHTJ2Qg+QQPoUJHiSwBoDhtFE+0FRxuQG/Aqm12yB6AbklkI3dcnlZsxId1xAc6nhrqPT2M X-Received: by 2002:a17:906:716:b0:a52:2a68:b45 with SMTP id y22-20020a170906071600b00a522a680b45mr1644729ejb.62.1712917038038; Fri, 12 Apr 2024 03:17:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712917038; cv=pass; d=google.com; s=arc-20160816; b=zCr8swzziCPQAPnky+PAqoK4/pKqxGRVsQAiSf39MxKRAnZJMbDr/kHEtD/03DKtqR FhsOl1c2wm3Vh/qlUnqrGpvn11y15z683KhZXVMez4xCUo7tlqr/1v9Mjcxx5DJJ0J6M erkhvjDGeV6ZnjZ5lcvtRncDvH1/wSJfxni3R20z986Z0KL2oPqcN/2gVpjcMlNZs/m9 3NL+a6+YJzm2vpabk9Utyanyrc/Poc7w0vnGNObTk5jFWdKv/RPyrF3u1H6el+o9sMEx HnvPZS1OsjFDiA/e3tr3rD8vNjcYP3jWyngz6+N3kIT4xcqWXXVIEjA85NnAcnI9um6h +jpw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=oMXwQRwX9srFmgPct+1gavNzi4EoX3rYSsOV17E5RhU=; fh=FeRHs2WX8VAc5wtea+afpOiGBDI/QNqygA2b1gY4TiI=; b=bilE+J7i+21AFtPXq4Z1OlnajJ3wj6omWy9wEiMA1Vet6KHdybuT1eGOuV2s7q0d8a yfMpIGgVAbDHsThEaw02jOBHFZNQVXQjUzEYZOiWUIVdMs/w8YChxSx2Q+a+lXVpEHLz b1H5hULNjTVBxICNC5gaS2tFo/oTvdB5w9+XS881XkMVOmHmxxSb+uwKBxgRyLLj7qUz 7JozcRRaRBJrtdXESSKOfLHx8VqlgJfzGtOX0qpU++fY22DmZMaNumjBkK/53cqMIGHb /wlYcu5rdQFmZwHXvnSMTX7HF+z2svKBDan606X447PcoSvTOFIZxmQU/QgvoQcz7orT 7Bgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=B36Gf1rf; 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-6242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cw21-20020a170906479500b00a4e8ac27ab1si1642632ejc.443.2024.04.12.03.17.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 03:17:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=B36Gf1rf; 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-6242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6242-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 999331F21415 for ; Fri, 12 Apr 2024 10:17:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F80353E1A; Fri, 12 Apr 2024 10:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="B36Gf1rf" 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 8895953384 for ; Fri, 12 Apr 2024 10:17:08 +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=1712917030; cv=none; b=jfnKO5ZnstN1yW/2md0dnpLZcMJJ/n6pUj4lUIR66LsLjZViK1gR7n+zTEJG9VuhnS05wmX//9cYqdBtb+KWEIOW9nnHyh46ESVwgvwwfqxHKzogIoqirwTUe1JVipsApVXWUMR2TOma6iacPfTTTpDslSdDvSgz4ofJ4eon528= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712917030; c=relaxed/simple; bh=RjAj7OvueSW+hFODPlJUTXU2znBQ/d4BzEpHpi55tzM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J4H1bHhNlFjHy9A5tKJSg/SxW52ff0B8VaNJAAPwlN3RgvopgHWXp9Jl0NdgIcZqE2uFDEJ+HgvdsaMlx5UXbSTwO0fAvzwzvYCyzf3xEGZ7NmG3HIb4WVKrSQWS2V35wNwaY5PwzzhECnPAen0rXbw2STaEBAaSfOVEJsLHWas= 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=B36Gf1rf; 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 (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43C2oQWx032694; Fri, 12 Apr 2024 10:17:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=oMXwQRwX9srFmgPct+1gavNzi4EoX3rYSsOV17E5RhU=; b=B3 6Gf1rfVhSwJAIjO7wSv+3F9rn655WlczKOD4GeO9b+7eptQgwQqewyS8TfExjg1n fnvXCJpBRF3BS3vrdvpLpnhvyOmY1PgYFdsPV1GuTykNz6c5B/5lXLpVafarE98g Q+Cmvbha49Hw3RL1H7ysxko6i4nNzsmdSpfhJmg7nQL1rpDSpMQ86pgSRAl+eh7a Z1n9DDYmaoXveg0ol3eFFlOaPH2WxVjFOt1o1XHVrBUgSoqJ4XDAFclj2iFhLvr8 90sI7P7sJuaVCnX1SNWpXfr7x82xykADzL3TGCttWL+VXP2lRLhbmw9/sTGNwxhO 7/qydgQJbNjgYCUso5yg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xev74rv55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 10:17:04 +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 43CAH3Ht008228 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 10:17:03 GMT Received: from lingbok-Birman-PHX.lan (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 03:17:01 -0700 From: Lingbo Kong To: CC: , Subject: [PATCH v2 2/3] wifi: ath12k: report station mode receive rate for IEEE 802.11be Date: Fri, 12 Apr 2024 18:15:59 +0800 Message-ID: <20240412101600.55344-3-quic_lingbok@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412101600.55344-1-quic_lingbok@quicinc.com> References: <20240412101600.55344-1-quic_lingbok@quicinc.com> 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: nasanex01b.na.qualcomm.com (10.46.141.250) 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-GUID: UAWqWghDrOL7TXBdw7UE8a7va2w3ZZRO X-Proofpoint-ORIG-GUID: UAWqWghDrOL7TXBdw7UE8a7va2w3ZZRO 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 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404120074 Currently, the receive rate of EHT of "iw dev xxx station dump" command always show an invalid value. This is because ath12k does not pass information about the rx_status of EHT to mac80211. So, mac80211 not calculate the receive rate. To address this issue, add logic for handling rx_status of EHT to the ath12k_dp_rx_h_rate() function. After that, "iw dev xxx station dump" show the correct receive rate. Such as: Station 00:03:7f:12:03:03 (on wlo1) inactive time: 48 ms rx bytes: 59226 rx packets: 320 tx bytes: 26556 tx packets: 191 tx retries: 99 tx failed: 0 beacon loss: 0 beacon rx: 79 rx drop misc: 68 signal: -95 dBm beacon signal avg: -20 dBm tx bitrate: 688.2 MBit/s 40MHz EHT-MCS 13 EHT-NSS 2 EHT-GI 0 tx duration: 0 us rx bitrate: 619.5 MBit/s 40MHz EHT-MCS 8 EHT-NSS 3 EHT-GI 0 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/dp_rx.c | 20 +++++++++++++++++++- drivers/net/wireless/ath/ath12k/rx_desc.h | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index a593beecdd12..2061c9827dc6 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2373,6 +2373,23 @@ static void ath12k_dp_rx_h_rate(struct ath12k *ar, struct hal_rx_desc *rx_desc, rx_status->he_gi = ath12k_he_gi_to_nl80211_he_gi(sgi); rx_status->bw = ath12k_mac_bw_to_mac80211_bw(bw); break; + case RX_MSDU_START_PKT_TYPE_11BE: + rx_status->rate_idx = rate_mcs; + + if (rate_mcs > ATH12K_EHT_MCS_MAX) { + ath12k_warn(ar->ab, + "Received with invalid mcs in EHT mode %d\n", + rate_mcs); + break; + } + + rx_status->encoding = RX_ENC_EHT; + rx_status->nss = nss; + rx_status->eht.gi = ath12k_mac_eht_gi_to_nl80211_eht_gi(sgi); + rx_status->bw = ath12k_mac_bw_to_mac80211_bw(bw); + break; + default: + break; } } @@ -2459,7 +2476,7 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap spin_unlock_bh(&ab->base_lock); ath12k_dbg(ab, ATH12K_DBG_DATA, - "rx skb %pK len %u peer %pM %d %s sn %u %s%s%s%s%s%s%s%s%s rate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", + "rx skb %pK len %u peer %pM %d %s sn %u %s%s%s%s%s%s%s%s%s%s rate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n", msdu, msdu->len, peer ? peer->addr : NULL, @@ -2470,6 +2487,7 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap (status->encoding == RX_ENC_HT) ? "ht" : "", (status->encoding == RX_ENC_VHT) ? "vht" : "", (status->encoding == RX_ENC_HE) ? "he" : "", + (status->encoding == RX_ENC_EHT) ? "eht" : "", (status->bw == RATE_INFO_BW_40) ? "40" : "", (status->bw == RATE_INFO_BW_80) ? "80" : "", (status->bw == RATE_INFO_BW_160) ? "160" : "", diff --git a/drivers/net/wireless/ath/ath12k/rx_desc.h b/drivers/net/wireless/ath/ath12k/rx_desc.h index a0db6702a189..e620f4794286 100644 --- a/drivers/net/wireless/ath/ath12k/rx_desc.h +++ b/drivers/net/wireless/ath/ath12k/rx_desc.h @@ -637,6 +637,8 @@ enum rx_msdu_start_pkt_type { RX_MSDU_START_PKT_TYPE_11N, RX_MSDU_START_PKT_TYPE_11AC, RX_MSDU_START_PKT_TYPE_11AX, + RX_MSDU_START_PKT_TYPE_11BA, + RX_MSDU_START_PKT_TYPE_11BE, }; enum rx_msdu_start_sgi { -- 2.34.1