From: John Crispin <john@phrozen.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Shashidhar Lakkavalli <slakkavalli@datto.com>,
ath11k@lists.infradead.org, John Crispin <john@phrozen.org>
Subject: [PATCH V6 06/11] ath11k: add defines for max MCS rates per phymode
Date: Tue, 28 May 2019 08:47:58 +0200 [thread overview]
Message-ID: <20190528064803.24419-7-john@phrozen.org> (raw)
In-Reply-To: <20190528064803.24419-1-john@phrozen.org>
Use defines rather than magic numbers.
Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
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;
}
--
2.20.1
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2019-05-28 6:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 6:47 [PATCH V6 00/11] ath11k: add HE support John Crispin
2019-05-28 6:47 ` [PATCH V6 01/11] mac80211: propagate HE operation info into bss_conf John Crispin
2019-05-28 6:47 ` [PATCH V6 02/11] ath11k: fix some whitespace errors John Crispin
2019-05-28 6:47 ` [PATCH V6 03/11] ath11k: move phymode selection from function to array lookup John Crispin
2019-05-29 15:47 ` Kalle Valo
2019-05-28 6:47 ` [PATCH V6 04/11] ath11k: add HE handling to the debug code John Crispin
2019-05-28 6:47 ` [PATCH V6 05/11] ath11k: extend reading of FW capabilities John Crispin
2019-05-28 6:47 ` John Crispin [this message]
2019-05-28 6:47 ` [PATCH V6 07/11] ath11k: handle rx status for HE frames John Crispin
2019-05-28 6:48 ` [PATCH V6 08/11] ath11k: add HE support John Crispin
2019-05-28 6:48 ` [PATCH V6 09/11] ath11k: add sta_statistics callback John Crispin
2019-05-29 15:30 ` Kalle Valo
2019-05-28 6:48 ` [PATCH V6 10/11] ath11k: properly convert bw John Crispin
2019-05-29 15:31 ` Kalle Valo
2019-05-28 6:48 ` [PATCH V6 11/11] ath11k: add HE rate reporting John Crispin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190528064803.24419-7-john@phrozen.org \
--to=john@phrozen.org \
--cc=ath11k@lists.infradead.org \
--cc=kvalo@codeaurora.org \
--cc=slakkavalli@datto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.