Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2957566lqp; Mon, 25 Mar 2024 14:32:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0nJpGJRnGyvpkAHMZq1Yh8dsb9hD35VDgdbEPJH2CC1cRbB9ZvfaEdZNU3pghMLRu0in/Zo+2xcWCoLKEwfO5+418iXSM2C+cwe5Y/A== X-Google-Smtp-Source: AGHT+IEoBp/8pT+3azKPPGp2Wsw8nrAl48bt8LJnrZFnXZM95BGAMDuGWsFXKYW12l66FvU2YUvZ X-Received: by 2002:a19:5f1c:0:b0:515:952b:7886 with SMTP id t28-20020a195f1c000000b00515952b7886mr6993882lfb.61.1711402330194; Mon, 25 Mar 2024 14:32:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711402330; cv=pass; d=google.com; s=arc-20160816; b=DJfVTFPyQwE1lQWuD6dOCDf9TfHDRLMBNEuc5G/WEJevplpQ3XNlaRxQreAxRWi4Ef H8quEwjH7c28KJhEqPk54nAum2OPAPa42rUY4sXkRniuyyvcvwqEiXpwLUvd9vRFAe+U oEiffEO5cw8GC4/UtzFXcRgpzqaLcasu8/jAf272YwSOTO2r+o+4aGmdgqbztr3T+DRV 9NJWtnZAcr39ITX4efPdo3Dfx+IKeXMBA8bZJLdRI+2+KVlPxVGZnaXVKjkSJYMJkc/9 Dli3cXlrTQRpYa08ckUIXqa2q/o3hnohn1l7xUA4k/J6IJW2O/4iHOPqBc3b7kZgE5aL sn6Q== 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=UvkE4YQgKOBx3q1gq4hAuaWC5aowd4EJXhDpJ7/dhvU=; fh=sG9jhBHEsNc76hLve58zfxxmeh0GUKp4yFB8ltJHOnE=; b=sxDyOrdJC/Dmca09DsupQBiwNpCL+/EwOb3wHEqTtJXrFiuk+r6naZEoPJ43SY8pvD +LBsZUJulptEnRK9c0TBGiuyjiV8d0EDJzoxaad3K6aGU5bVVBEkx1JLWA74FPfbCenq ubpZcL2lpX7DTpvoy70+Hu6zG7a+9IJ5/XwQAQingRe3YUpH6gaYAW8jrSUhtwotdUlW mYDk7+DN2QLEWD9GrqHqBi5vqm553oaSSznAhOKfcmGhotWHIEJUtpRw5FwLMWHc0Yk6 iyid5rEJ4C9Wc4h0Tt0pRs5mzgbaOY7LUX6B3sYI4oXhN1SgjTugjKA9oryFanKVIhW4 Yp8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EXbaf9IF; 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-5248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5248-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 j13-20020a170906254d00b00a44105e1ba9si2891571ejb.117.2024.03.25.14.32.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5248-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=EXbaf9IF; 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-5248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5248-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 F21D41FA2D9E for ; Mon, 25 Mar 2024 21:23:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A1B76D1AB; Mon, 25 Mar 2024 21:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="EXbaf9IF" 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 554F66CDD8 for ; Mon, 25 Mar 2024 21:23:23 +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=1711401805; cv=none; b=ZtoOvdwsD7xxAPA8it1l/damVbaTwmi95uWBcg15kCgayFDyDvwiODhOk5K96wGLGYYBXMP0BE9XcmqFi5YcqFhuVYzQYzf0eYFJyLkzFjKdo1IF82llFCihV46rROA7MhHq6YxsUctcPdn0syHndTENRQGNhXdoZrLjbxziOTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711401805; c=relaxed/simple; bh=GWLIhwdeHQ1lqoW6DpEeZa6M+hFmXCtfssjyGbAu29E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p/gOBQjMNT6+UwZjjuMgnPB4g9Bm9Wt9ks4Q0tSyYO2SFJjXJEm4maDnV07X2VoeL2tMnIHARRQalpDl8x7nReYPewBn6g32Pqndm96+/KVOpLQ4IFnnS/zJNDn4xE9utVVLVPCozLf5MpcSy/4AdD+XifnrQKGQe8khMxdbjH0= 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=EXbaf9IF; 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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42PLH1rW006399; Mon, 25 Mar 2024 21:23:18 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=UvkE4YQgKOBx3q1gq4hA uaWC5aowd4EJXhDpJ7/dhvU=; b=EXbaf9IFYoxrlaE/koHzrwsJDJkPAWftl/V8 9MlVIkOx/oGd97VJJb0cVpA3io2O/Cf+xhjQiEMyNvJnYX021v7YBnr1SnGpgo5a 5sGD0EL+0mKHIVJ6LP1I43ueugS6BzNYL1An1a3iEId+INT4KKGkWVEPOVznM1X8 LpaGvHcHHiHlCE5i6ePC0DHdS9bQHPZDSMIgDyB7XtJIPzkPxRJOw3AwVja7C6RE 8ZNrpTPcH+wn57acteHUtIJxxywTMwosk3XamnQL6rM7t8Ll92BuWVuh2XzoWxr3 w1uRzcgyWMpcuCnlhyj7v0uLhYlQ/PYKLNHsJsYyRA2mddlSZg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x3626hpav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 21:23:18 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42PLNHbi031587 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 21:23:17 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; Mon, 25 Mar 2024 14:23:17 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu Subject: [PATCH 2/6] wifi: ath12k: Correct 6 GHz frequency value in rx status Date: Mon, 25 Mar 2024 14:23:00 -0700 Message-ID: <20240325212304.28241-3-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240325212304.28241-1-quic_pradeepc@quicinc.com> References: <20240325212304.28241-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: 9y7bXN_KZGNPP3EKDN_Cas3uk6epvQo_ X-Proofpoint-GUID: 9y7bXN_KZGNPP3EKDN_Cas3uk6epvQo_ 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-25_21,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 malwarescore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403250132 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 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