Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp411453pxv; Thu, 22 Jul 2021 03:21:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6ABYUritowKodJlMaqis+B63Q26D6/BPocAi76yaai7Df7sS60j6mzaf0H/DmaiFaMVAg X-Received: by 2002:a17:906:2acc:: with SMTP id m12mr43743682eje.231.1626949317390; Thu, 22 Jul 2021 03:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626949317; cv=none; d=google.com; s=arc-20160816; b=fjEgKizdB3qfk3ZV9Ie2a5EN46R4HCrZfvTl3Wmgi4cHPkm6LU4R3oindRTBfnhqi4 I+8feKLBd+4KPdKbOvmDHzin4fZNhT5cB1VOvV1pWqWjekLeKuOIevJHRtRdyg8OPKTm st7vFg8usY9bKIPKRD57gWd3F2zubwiJIM8JLrxFW4y272Hq2fgq2iGIHseRPXUE2J5O NXAHhsRWW9QQHj5eAXFN4l8jcxHlA/4LgRM8+ELU4N2vnX1HgsYDux51+FfXZQuXaTNS LfH1iXbguf37JLryqaTtl4vaJokFxmzjAAa3tpWwHJe9TP9hoM4WieR62QmtIhlogY4y KMIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:sender:dkim-signature; bh=Z6he0fZsKF9btV5t8ENd5pIp0RgzPSh7F0zadVElmwk=; b=z3Whag9Z/qpiL4PFvSouQpnmvtMnzgrZfFmaT7rNUbdyM+3LO4EYkPJ8yjbaXhB9mt JRltU0YrczZGNtZcX5HXOIuYA9llNPcmT5rihEGQJxqgdg6pQGTBpEf/6um6pSuLp7jg TCFpu9TZLhZtmuIqX8XPoLuRqmwspxTwVEsJ4Sih1xBKRkoa/vn4cVkjZY+zasnRDiwN Gf1guBgWzVPJ2fgNEXAqbjxIL3SBnpE4HUA1+6fkRKStSoBTFbQ7tcYu4IDMTTRSn9rw GZDb3gYc86d3S7KlyhhiM3Iji/QqQNwXZI4JEEt+LXwI/9HiS04SV+kE+N107Plvq1m6 dqHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=tDRnhsMZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si30053860edp.85.2021.07.22.03.21.24; Thu, 22 Jul 2021 03:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=tDRnhsMZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231355AbhGVJka (ORCPT + 99 others); Thu, 22 Jul 2021 05:40:30 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:38344 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbhGVJka (ORCPT ); Thu, 22 Jul 2021 05:40:30 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1626949265; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Z6he0fZsKF9btV5t8ENd5pIp0RgzPSh7F0zadVElmwk=; b=tDRnhsMZ7Bniew+KFH1rsFsRGNqGk69gRznTj8XtMyJmNLNX6eIrVk4GzhZwEcnBaqCYVDdY ys6mMzZuI05zhoT6ZFpOtuZ61GulkClQCj6iiy4LWXer/7QWSJQZG5tpqt/6PduDQ64eAIeC D430/7jLTPZYdDKnmC4UexTRXIA= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 60f94690e31d882d187541aa (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 22 Jul 2021 10:21:04 GMT Sender: jouni=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D850DC433F1; Thu, 22 Jul 2021 10:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from jouni.codeaurora.org (85-76-67-217-nat.elisa-mobile.fi [85.76.67.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jouni) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1A9F5C433D3; Thu, 22 Jul 2021 10:21:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1A9F5C433D3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=jouni@codeaurora.org From: Jouni Malinen To: Kalle Valo Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, Pradeep Kumar Chitrapu , Jouni Malinen Subject: [PATCH 2/3] ath11k: fix packet drops due to incorrect 6 GHz freq value in rx status Date: Thu, 22 Jul 2021 13:20:53 +0300 Message-Id: <20210722102054.43419-2-jouni@codeaurora.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722102054.43419-1-jouni@codeaurora.org> References: <20210722102054.43419-1-jouni@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Pradeep Kumar Chitrapu Frequency in rx status is being filled incorrectly in the 6 GHz band as channel number received is invalid in this case which is causing packet drops. So fix that. Fixes: 5dcf42f8b79d ("ath11k: Use freq instead of channel number in rx path") Signed-off-by: Pradeep Kumar Chitrapu Signed-off-by: Jouni Malinen --- drivers/net/wireless/ath/ath11k/dp_rx.c | 9 ++++++--- drivers/net/wireless/ath/ath11k/wmi.c | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 9d9af6d65afd..90da56316e7e 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -2393,8 +2393,10 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *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 >= ATH11K_MIN_6G_FREQ && + center_freq <= ATH11K_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) { @@ -2412,8 +2414,9 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc, rx_desc, sizeof(struct hal_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); ath11k_dp_rx_h_rate(ar, rx_desc, rx_status); } diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 5e196829ecf3..e7429d17030b 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -6184,8 +6184,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_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 >= ATH11K_MIN_6G_FREQ) { + if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ && + rx_ev.chan_freq <= ATH11K_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 <= ATH11K_MAX_5G_CHAN) { @@ -6206,8 +6208,10 @@ static void ath11k_mgmt_rx_event(struct ath11k_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 + ATH11K_DEFAULT_NOISE_FLOOR; status->rate_idx = ath11k_mac_bitrate_to_idx(sband, rx_ev.rate / 100); -- 2.25.1