Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2199523ybm; Sun, 31 May 2020 11:57:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwkWtlIECA0rG26ZBvPFeY52iubrJ2vuD3mRPmlytfo0PlKVVpsq5YteKdXnqiK8qhTeWk X-Received: by 2002:a17:906:af4d:: with SMTP id ly13mr2906247ejb.250.1590951441099; Sun, 31 May 2020 11:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590951441; cv=none; d=google.com; s=arc-20160816; b=KWMNDTkccoAgGiSgzvjMm4ND7WUTuIvNSJeugPaSsoKHaKvhdhcEJc9A2vINO7cjvF hZPpmRGe3gAwvCOB0n3TVt+p/SBe1zQA4W6d4SL+1kZJgLj0IxYQ0Etxn8I7lJF+bNMt yXdr2uJ+52HDbCkd63utoqm9Pjl7Q9wHkwebzVfUaauogD3FCTfAZTKPnEpUNtBWzMGL CyQdmH+CgTwtw+EUc5eIVgX8QjBQTJTUhNGHOyVQSSoeOYvlCQcR88K7CWNTzIuuT2ox Ky75TSn2buodihifY5xlN2O+v6d7y2P3EHfQiYsGXxx/KOzFO+veCtuGjNbbD+6Wi1ge 5Mew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=FQptBZajWaZ3NrQgAKAUWkYi3OxWNYWWjg0iN1qp3FQ=; b=XZ1QWAQ82kQ1hP27FIjuxXFBwZWHjB3voksBbGXE6MLzmZcsqLLv86G5dkEcebLrSy 6A24JUy/ZuxXbX0c4SOvefVGkLll2STaBZxgVr+F9hi40we/xlBToAtrQFR2WI3WSxGm cWoaAO5AZGwuirsAwrfqSUxGH7wywafIUot+ZmfTJjDhckUyKfmczRc79BmIPLgywUG9 6T9KFNTo9Qq2FNoAvY6u8CqLb2Jv9tFaaAReVCP0fbDaqOVOQXrGp2I4V2qQlzwxOpJn 8E7GjHjRuVVgbwhbGNWWejkRevQxweb25Vo0BGtEhQasJRGUGbShXZIlfXGPZ9ZNX88V n9Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=qmVXoEIh; 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 v7si9530072edr.33.2020.05.31.11.56.40; Sun, 31 May 2020 11:57:21 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=qmVXoEIh; 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 S1728330AbgEaS4Y (ORCPT + 99 others); Sun, 31 May 2020 14:56:24 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:53805 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbgEaS4X (ORCPT ); Sun, 31 May 2020 14:56:23 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1590951383; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=FQptBZajWaZ3NrQgAKAUWkYi3OxWNYWWjg0iN1qp3FQ=; b=qmVXoEIhXLc0t8qFLoSE3EL3UvK28WlXru5q5oGRlf6e7zzDUP58Ct93ZvkKfaZ2kwvfEYTG i0Y5FubMA11dGf0ir8LKZMnJLtbERF+MhwTSKuYlVLwK/uVfMOjHMCRjLhpvfp54vEOp5Ffb xwHKDzrkUuITMZ8r9Njkv08mKNc= 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-n03.prod.us-east-1.postgun.com with SMTP id 5ed3fdc8c0031c71c24abca4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 31 May 2020 18:56:08 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A2BA1C433CB; Sun, 31 May 2020 18:56:07 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pradeepc2-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pradeepc) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0A5F3C43391; Sun, 31 May 2020 18:56:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0A5F3C43391 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=none smtp.mailfrom=pradeepc@codeaurora.org From: Pradeep Kumar Chitrapu To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Pradeep Kumar Chitrapu Subject: [PATCH v4 3/8] ath11k: Use freq instead of channel number in rx path Date: Sun, 31 May 2020 11:55:55 -0700 Message-Id: <20200531185600.20789-4-pradeepc@codeaurora.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200531185600.20789-1-pradeepc@codeaurora.org> References: <20200531185600.20789-1-pradeepc@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As 6GHz cahnnel numbers overlap with those of 5GHz and 2GHz bands, it is necessary to use frequency when determining the band info in rx path. Signed-off-by: Pradeep Kumar Chitrapu --- drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +++++- drivers/net/wireless/ath/ath11k/wmi.c | 5 ++++- drivers/net/wireless/ath/ath11k/wmi.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 85670608c3e2..326143c8c995 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -2162,6 +2162,7 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc, struct ieee80211_rx_status *rx_status) { u8 channel_num; + u32 center_freq; rx_status->freq = 0; rx_status->rate_idx = 0; @@ -2172,8 +2173,11 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, struct hal_rx_desc *rx_desc, rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc); + center_freq = ath11k_dp_rx_h_msdu_start_freq(rx_desc) >> 16; - if (channel_num >= 1 && channel_num <= 14) { + if (center_freq >= 5935 && center_freq <= 7105) + rx_status->band = NL80211_BAND_6GHZ; + else if (channel_num >= 1 && channel_num <= 14) { rx_status->band = NL80211_BAND_2GHZ; } else if (channel_num >= 36 && channel_num <= 173) { rx_status->band = NL80211_BAND_5GHZ; diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 291fb274134f..500108fa59d9 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -3833,6 +3833,7 @@ static int ath11k_pull_mgmt_rx_params_tlv(struct ath11k_base *ab, } hdr->pdev_id = ev->pdev_id; + hdr->chan_freq = ev->chan_freq; hdr->channel = ev->channel; hdr->snr = ev->snr; hdr->rate = ev->rate; @@ -5204,7 +5205,9 @@ 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.channel >= 1 && rx_ev.channel <= 14) { + if (rx_ev.chan_freq >= ATH11K_MIN_6G_FREQ) { + status->band = NL80211_BAND_6GHZ; + } 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) { status->band = NL80211_BAND_5GHZ; diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index b9f3e559ced7..afa3c4cf90e9 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -4228,6 +4228,7 @@ struct wmi_pdev_temperature_event { #define WLAN_MGMT_TXRX_HOST_MAX_ANTENNA 4 struct mgmt_rx_event_params { + u32 chan_freq; u32 channel; u32 snr; u8 rssi_ctl[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA]; @@ -4257,6 +4258,7 @@ struct wmi_mgmt_rx_hdr { u32 rx_tsf_l32; u32 rx_tsf_u32; u32 pdev_id; + u32 chan_freq; } __packed; #define MAX_ANTENNA_EIGHT 8 -- 2.17.1