From patchwork Mon Jun 3 19:01:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 10973911 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 B486515E6 for ; Mon, 3 Jun 2019 19:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2E352837E for ; Mon, 3 Jun 2019 19:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97020286B4; Mon, 3 Jun 2019 19:02:14 +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 6AEC72837E for ; Mon, 3 Jun 2019 19:02:13 +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=pSrqIWe6DgS5AQFZX+tavJhL9H8qnHoQKcNz4reUxbk=; b=KDzXU2K9vb3sof ULbHvjCei1NRmtnEseRBbwBiHY3nnaMmiZ2iO9nz4aAU0aAw6sVqEo7vHIaZ6pf2DQbUYN/0/xOeI wWkjVH0MHKLIzuTDH9P5JHrrO8MbbWf2yulKbhmibWzl/d8SkYleSFkhlZhmeLlAyY8FoKoO8FNx1 OaUwmFFhGSK3RramFCjl43dT+jRTMEHoziHMoqw5Tzwn5ZnTLcZuv3qyRYseBzXFlUMFZrpf7FF2J 0no1qxm+/FLR5PNnuetNiXw6kELwIr1N5lyivLo0QYIhcdbw/rRz3kfxDHLj6s0Hpcbc+JSrpN1xU 75rgo/WUOxx0aEz+6Vaw==; 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 1hXsDk-0002yJ-9W; Mon, 03 Jun 2019 19:02:12 +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 1hXsDg-0002tp-9y for ath11k@lists.infradead.org; Mon, 03 Jun 2019 19:02:09 +0000 Received: from p5dcfb250.dip0.t-ipconnect.de ([93.207.178.80] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hXsDe-0002zi-IJ; Mon, 03 Jun 2019 21:02:06 +0200 From: John Crispin To: Kalle Valo Subject: [PATCH V7 6/8] ath11k: add defines for max MCS rates per phymode Date: Mon, 3 Jun 2019 21:01:55 +0200 Message-Id: <20190603190157.25165-7-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190603190157.25165-1-john@phrozen.org> References: <20190603190157.25165-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190603_120208_491908_8F23A9E6 X-CRM114-Status: UNSURE ( 9.60 ) 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 330f22f9d3ff..c283766a50b8 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 40832008d949..df00d5100c82 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; }