Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1419386lqd; Thu, 25 Apr 2024 15:21:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWcWBmnVBj4+pR2EDOrdJKT8dPMWyb3VhGHxKhzFJsXfwe7WpIG1HUv9RjNOomc3WwO00ixIqxkKORu2IW0J00Z+fGP0ydK7lEow9Mxg== X-Google-Smtp-Source: AGHT+IEYIDJoTzCxR6oIXgut5ArtqBBudLm4XOl5mjMv6G7c9bbNiqPklauas7zwt7qlEZB2w3Ij X-Received: by 2002:a05:6870:d621:b0:221:416:1df9 with SMTP id a33-20020a056870d62100b0022104161df9mr857900oaq.23.1714083680186; Thu, 25 Apr 2024 15:21:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714083680; cv=pass; d=google.com; s=arc-20160816; b=SvmMn17//lJuuHjLKCoJFMpRmtaBpf7IxKE4Bn1FtIcM5rNYLMLQAEjA88tc4v6XMY LtyrnYzFIJwww0drt6hV9bpYdkbhWHFLzi68G9HovNs0cu4ljCKm69BrKuS9hizVyR4/ s0IuFl6Xs1KkhjQNm2QCrSmIz9K7++rj1iRCx7c6LwTwzAVD7jI8vEU05EXYIabvmPQS DrZTGpOVX+zwHPZPPSSFiPrGUAtajkpdbmKV0pn5kVw5ZYTBEPAAwZzl+jzDpo0QQxBW KE9Q88GsPZPODTDKvU38g88NDpP60+9BrDcl4fIfjR5a5lf8mvRHgFN8B2/x63BkFaUE ddIA== 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=dDvrBGe+5H3xFMGW44JbONxV3ZglbQwhoAsoJ58IyCw=; fh=sG9jhBHEsNc76hLve58zfxxmeh0GUKp4yFB8ltJHOnE=; b=HVSJC8sxishGkH87UWmwr+PnGqfPbvEvatzUxCf15RJLWtBIZiMmUmIelgjyxM/9/g lXAz30sGpQ8Fguq9lyMHyZ60eFmSfSwC5mVN3G+UA/APQY+jVvlqr3OaC/TsWuJPcNJE 2RLh6CLa6modNC6jSoF6pwptUBEPS5mGLOS8LT9IEO11zW2ehUICIZOC6fDRPV3eItRg sKfRhVrAHy8scG7zAfFGYjNRSVz+gS1CmBOo3G43HMd7NRkcQCw2dyz8Dkc9dxC+Jaqp 1sJRZbHFCwGYLSgg13krr4iESnnGRx85E4s9oQPXOLviSH6ytVV8fTvcIjZYD+qivQz9 6K8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cgpZMzE5; 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-6895-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6895-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fb9-20020a056a002d8900b006e6f6dd1735si14187446pfb.371.2024.04.25.15.21.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 15:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6895-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cgpZMzE5; 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-6895-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6895-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 81587282E70 for ; Thu, 25 Apr 2024 22:19:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DBF212BF28; Thu, 25 Apr 2024 22:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cgpZMzE5" 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 D3004149DE3 for ; Thu, 25 Apr 2024 22:19:18 +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=1714083560; cv=none; b=gVQhLaoVoENMV49VNNJ/H0GnxMCiYypybkbzeyzNP0EPmvVK/2WLfJt76NXhI92CvuC6aS6JP8nTh81SH5b54NXnKe3Ufqd8SoMXnnFjg+9CrYvHUA4q1N6BOuresIjoIS84jAuwJ0RUsX29xI3IlLfHB1kwK1u7807QsrslRag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714083560; c=relaxed/simple; bh=xy3gFYpj1HO+6YFJW5jnsTUePLRtmAQ87x1fvueoXVM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dKREHXuYH63y2k5zpUdZ4V7e+TKHjgTXxLS94EvwdsU7iTCvy3/BvdZABUl5ZrTBx4EFqnqwKsSJUx0dGSfjxqyd5OVgARJ9Ki5eMdQH4i2d/iyMW22kK3bepSnrSxEJU40fG4zR4MSFH2qR1n7d2qvJzLkPkRFICe5TTUUzfDM= 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=cgpZMzE5; 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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43PM28P4027237; Thu, 25 Apr 2024 22:19:15 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=dDvrBGe+5H3xFMGW44Jb ONxV3ZglbQwhoAsoJ58IyCw=; b=cgpZMzE5i9aAFDFZQcxSvS4WvW2MGqUyffGj hBHz+QgKXBB5nWcue24HHewG6sgfUWxQ1XwXnGuFbWDLgpDJ4vOxz7V0fLJbxNC2 ze5YthYnTIGAUr78N7sMbhMyDgGNJjSBvQ0EcIeD1PFRHXP28Jd5xle+h9II2L5j YtfdMy3QKrLlD/D7H0XG3htjdn9RRRw9gOOfU88shRcnSegyxv/XAJ8uFSlm7HSq 2aAAr7jNm5tgub+5bVUi3Xjpe8rExxeAyMc+dPokN1MuuonOm3KbPUFkSa15pM4W 00SmkrLJKcLJTr/CTRXRJAZ6V+Bisn+AESSeotVVtzyfeCEwgQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xqenh3tr6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 22:19:14 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43PMJDcW009321 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Apr 2024 22:19:13 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.1544.9; Thu, 25 Apr 2024 15:19:12 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu Subject: [PATCH V4 2/6] wifi: ath12k: Correct 6 GHz frequency value in rx status Date: Thu, 25 Apr 2024 15:18:58 -0700 Message-ID: <20240425221902.11553-3-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240425221902.11553-1-quic_pradeepc@quicinc.com> References: <20240425221902.11553-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: nasanex01b.na.qualcomm.com (10.46.141.250) 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: nPBC7Lj718O2y9rDSx3O09k6hChpCglT X-Proofpoint-GUID: nPBC7Lj718O2y9rDSx3O09k6hChpCglT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-25_21,2024-04-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 suspectscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404250163 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 Acked-by: Jeff Johnson --- 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 75df622f25d8..e5fb5cb000f0 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -2383,8 +2383,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) { @@ -2402,8 +2404,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 7a52d2082b79..e88ec9e1201a 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6022,8 +6022,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) { @@ -6044,8 +6046,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