Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp128636lqz; Fri, 29 Mar 2024 10:40:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGkgKq20DwXxXXnI1bFgIoxGIgVa0zy0nM4rVcVkh90IcLF6sWuRmkq15FBw+O8MekCsJdbXTwbRqTlHsuQIXuZVXhwQ26Jc+U31yFnQ== X-Google-Smtp-Source: AGHT+IHpPAUDoO4gRp69Xk3Zl/qeTxbUw8hwJtfArf88/RYDlktdzByGxYwDRebGmQHcovLOGeqz X-Received: by 2002:a05:6a00:114d:b0:6e7:e6b:2ead with SMTP id b13-20020a056a00114d00b006e70e6b2eadmr2971072pfm.28.1711734029292; Fri, 29 Mar 2024 10:40:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711734029; cv=pass; d=google.com; s=arc-20160816; b=QdUXe7zXvPNS3s6HdTvCPrpuO8MtEM366j5mVKA6/gtX20McLJ2O7CJKeA3pQetJjp iEUvxSIF/gs8L8o/jOf0YJSpUYCL63VUB6FQ5OsVonkVjJ1+9qeg8tn8WogODr00f/j1 ls8/w+tGdZ8eorH04g0D5FaoQG4dfcPO+3P5BJiWUbSoyd8ILiMrS7+x/blmsXiqIeZZ yOznBdcer1lTIS/oaVaLwf8sfpAuKx3TtYH6yC9iAez0Ef/Rci5Odux4IHZhuc4Th1zX UUHvirZN0AxB+l492QOUzuJqoOoySvOW+nlqPjhLQyMgV1Cz5wWnh9wm+obLzAUY9kT2 K0OQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PkNnlqP6xVy5lBd+6YIIxx1dQRi7XPK3F0Kv5sxvoeU=; fh=sG9jhBHEsNc76hLve58zfxxmeh0GUKp4yFB8ltJHOnE=; b=XaYkaFHL21qT+qreLXHzEus548/DFn2Xe4dytQq+Kgs1IdtRgxc7jMZY01CIpt6MHA thr0aR0SiXad66RbWdF2GHLr1k0Fyqo+hfiNhwzEKoL1v2RyFELPy80yB0IZ/en9ogqo dTk7VRKQd+nXVTB/FrzJGLScvsswhYRXNZn2QFThK7Ds81cJkYbd99OcisfmvF4B6cPq 7KHkSQLav6WRfC/7AkFLLUC7z3qhb5sMDy2C526nj5W7+BHg6TeGg9qZsiNS/EHY1akk QnaiCuuusoP5V2RLRHVipGc2MtGhu7ltkUl+VpQ9Uq4LObbQI/UuKh7LVjAWn5kxwPUf mkTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=j57gqXFL; 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-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a7-20020a056a0011c700b006e558b4e179si3885789pfu.235.2024.03.29.10.40.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 10:40:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=j57gqXFL; 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-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5608-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E74072890BB for ; Fri, 29 Mar 2024 17:40:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 110AC136E07; Fri, 29 Mar 2024 17:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="j57gqXFL" 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 5EF88134735 for ; Fri, 29 Mar 2024 17:40:16 +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=1711734019; cv=none; b=uW0wODII8ZMDsfWx+lbfQpTpyStmrgs50xvq8rj0LYod/23cEPZpkVWHPU1Anz+q+X4T6kB7wLUlCvcIpP3SwqJXN4KQMlDpidELNWOClaWvHso1OiK7sLzmnFQWDwLOqEZsUO8GCrWj/oiF4TYnPMMAsfVChfCbA1izz5uoyfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711734019; c=relaxed/simple; bh=mHy2O/kKtOYZWJwTVN7QXwjW6GSqVbCBK7FgEd7ANG4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WfdhbI0DaF7Lyx2lSj5hQLWsXpVFZWJGApGvrjbvQwza67xMLMcZjVSa21l9BultJN34JdXROM4cUYmk4mMnDFrkYHOAzHpJ6r8p0VDeOPCi0Jco4rihEoYt4kcnRZ2PafEDZAwgP2CiNQ/SujUTsSLwUoOmH/XEBZ0dc52zq8U= 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=j57gqXFL; 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 42THeDnA025940; Fri, 29 Mar 2024 17:40:13 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-type; s=qcppdkim1; bh=PkNnlqP6xVy5lBd+6YII xx1dQRi7XPK3F0Kv5sxvoeU=; b=j57gqXFLe4b5sFdzzhGBCL0fL6nfzWFdHLFc IKyHPvdUxtqLu+RnGQmkjVPdpYXjDf9KFpc4b5QE/ZvbRpARwcydLowed78WTKNR PbnZ1rKyjpJ9vZfxBi0PhMKNhOZIZ1m6a6Nw6V/oyCFG50dUZD7kZJfJgKbIbKk1 oe6sB0OdXlxUY7uxtMx3rCI4N3WN1P3OdEXJ15odSPnx1OHi2difyAxTixjGa17u +Ts9PESN1z4/uOQYRpJfDOyA44GDaioGILaiReJXk1Km7yizIJHvf4C2/Ox01Cgd 2V0w6D0OBpEF/6iihWb7kfy9j9Q2zetueTtNSAJiBAI3kvtNbg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x5ybmrcm2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Mar 2024 17:40:12 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42THdbVT007409 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Mar 2024 17:39:37 GMT Received: from pradeepc2-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 29 Mar 2024 10:39:37 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu Subject: [PATCH v2 2/6] wifi: ath12k: Correct 6 GHz frequency value in rx status Date: Fri, 29 Mar 2024 10:39:22 -0700 Message-ID: <20240329173926.17741-3-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240329173926.17741-1-quic_pradeepc@quicinc.com> References: <20240329173926.17741-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: SevuFPkSgbPHawOEx8qAMAJ8H58b9BQ5 X-Proofpoint-GUID: SevuFPkSgbPHawOEx8qAMAJ8H58b9BQ5 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-29_13,2024-03-28_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 priorityscore=1501 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403290157 The frequency in the rx status is currently being filled incorrectly for the 6 GHz band. The channel number received is invalid in this case, resulting in packet drops. Fix this issue by correcting the frequency calculation. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Pradeep Kumar Chitrapu --- drivers/net/wireless/ath/ath12k/dp_rx.c | 9 ++++++--- drivers/net/wireless/ath/ath12k/wmi.c | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index a593beecdd12..2382274dd857 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2397,8 +2397,10 @@ void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc, channel_num = meta_data; center_freq = meta_data >> 16; - if (center_freq >= 5935 && center_freq <= 7105) { + if (center_freq >= ATH12K_MIN_6G_FREQ && + center_freq <= ATH12K_MAX_6G_FREQ) { rx_status->band = NL80211_BAND_6GHZ; + rx_status->freq = center_freq; } else if (channel_num >= 1 && channel_num <= 14) { rx_status->band = NL80211_BAND_2GHZ; } else if (channel_num >= 36 && channel_num <= 173) { @@ -2416,8 +2418,9 @@ void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc, rx_desc, sizeof(*rx_desc)); } - rx_status->freq = ieee80211_channel_to_frequency(channel_num, - rx_status->band); + if (rx_status->band != NL80211_BAND_6GHZ) + rx_status->freq = ieee80211_channel_to_frequency(channel_num, + rx_status->band); ath12k_dp_rx_h_rate(ar, rx_desc, rx_status); } diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 34de3d16efc0..2f0d82d88f20 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -5877,8 +5877,10 @@ static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb) if (rx_ev.status & WMI_RX_STATUS_ERR_MIC) status->flag |= RX_FLAG_MMIC_ERROR; - if (rx_ev.chan_freq >= ATH12K_MIN_6G_FREQ) { + if (rx_ev.chan_freq >= ATH12K_MIN_6G_FREQ && + rx_ev.chan_freq <= ATH12K_MAX_6G_FREQ) { status->band = NL80211_BAND_6GHZ; + status->freq = rx_ev.chan_freq; } else if (rx_ev.channel >= 1 && rx_ev.channel <= 14) { status->band = NL80211_BAND_2GHZ; } else if (rx_ev.channel >= 36 && rx_ev.channel <= ATH12K_MAX_5G_CHAN) { @@ -5899,8 +5901,10 @@ static void ath12k_mgmt_rx_event(struct ath12k_base *ab, struct sk_buff *skb) sband = &ar->mac.sbands[status->band]; - status->freq = ieee80211_channel_to_frequency(rx_ev.channel, - status->band); + if (status->band != NL80211_BAND_6GHZ) + status->freq = ieee80211_channel_to_frequency(rx_ev.channel, + status->band); + status->signal = rx_ev.snr + ATH12K_DEFAULT_NOISE_FLOOR; status->rate_idx = ath12k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); -- 2.17.1