From patchwork Tue May 28 06:47:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 10963867 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A72313AD for ; Tue, 28 May 2019 06:48:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A39B28681 for ; Tue, 28 May 2019 06:48:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E8E928682; Tue, 28 May 2019 06:48:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E8552867F for ; Tue, 28 May 2019 06:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cg4k0cFd/7GvjMl5tPXoA7t1TTlzdboQmBHPLtdeOkM=; b=bsxnUauX+vkqwN LLM/bLyenyJFjmUU9Xb5Nojkaty1xv2Gjr3y4uTVg/fMRojPEGgHDNr2N+HNCN1bmnKt9KQGBohdp S7J5VQA7wtmoxtOx3d2X49HVLspVqvgfmhcqKlzuhbGa0JRB2kfgXwmAuFZ4PcgIFpqz9dwfWAFbM xd52hGGO/ITtj6HnRcIsgPlmJ6yHSnxUXFayGLIpcgV1YtrvOINeiI3GYt2i3+Zw363Gcp30kq7LA HapROUsUkWUNLpfu2nTEraSz4crTX/5y7weugYO7avMIxmmscKxtxAWCOZhRUxVRMOCkijpNxur2w BA6hW9KDMNq4Jby5eOyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVVuH-0001vb-9c; Tue, 28 May 2019 06:48:21 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVVuC-0001rg-2t for ath11k@lists.infradead.org; Tue, 28 May 2019 06:48:18 +0000 Received: from p5dcfb1b7.dip0.t-ipconnect.de ([93.207.177.183] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hVVuA-0001w3-7g; Tue, 28 May 2019 08:48:14 +0200 From: John Crispin To: Kalle Valo Subject: [PATCH V6 06/11] ath11k: add defines for max MCS rates per phymode Date: Tue, 28 May 2019 08:47:58 +0200 Message-Id: <20190528064803.24419-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190528064803.24419-1-john@phrozen.org> References: <20190528064803.24419-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190527_234816_286430_0F55B285 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shashidhar Lakkavalli , ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use defines rather than magic numbers. Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin --- drivers/net/wireless/ath/ath11k/core.h | 4 ++++ drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 239bd98b3f8f..010ff8336376 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -49,6 +49,10 @@ enum wme_ac { WME_NUM_AC }; +#define ATH11K_HT_MCS_MAX 7 +#define ATH11K_VHT_MCS_MAX 9 +#define ATH11K_HE_MCS_MAX 11 + static inline enum wme_ac ath11k_tid_to_ac(u32 tid) { return (((tid == 0) || (tid == 3)) ? WME_AC_BE : diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 62820c20f7c1..e52a54cd2b79 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -1705,7 +1705,7 @@ static void ath11k_dp_rx_h_rate(struct ath11k *ar, void *rx_desc, break; case RX_MSDU_START_PKT_TYPE_11N: rx_status->encoding = RX_ENC_HT; - if (rate_mcs > 7) { + if (rate_mcs > ATH11K_HT_MCS_MAX) { ath11k_warn(ar->ab, "Received with invalid mcs in HT mode %d\n", rate_mcs); break; } @@ -1717,7 +1717,7 @@ static void ath11k_dp_rx_h_rate(struct ath11k *ar, void *rx_desc, case RX_MSDU_START_PKT_TYPE_11AC: rx_status->encoding = RX_ENC_VHT; rx_status->rate_idx = rate_mcs; - if (rate_mcs > 9) { + if (rate_mcs > ATH11K_VHT_MCS_MAX) { ath11k_warn(ar->ab, "Received with invalid mcs in VHT mode %d\n", rate_mcs); break; }