From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath10k: implement more versatile set_bitrate_mask
Date: Fri, 17 Apr 2015 10:06:28 +0300 [thread overview]
Message-ID: <87618v44jv.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1428672772-9275-1-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Fri, 10 Apr 2015 13:32:52 +0000")
Michal Kazior <michal.kazior@tieto.com> writes:
> Until now only a single fixed tx rate or nss was
> allowed to be set.
>
> The patch attempts to improve this by allowing
> most bitrate masks. The limitation is VHT MCS
> rates cannot be expressed separately using
> existing firmware interfaces and only the
> following VHT MCS ranges are supported: none, 0-7,
> 0-8, and 0-9.
>
> This keeps the old behaviour when requesting
> single tx rate or single nss. The new bitrate mask
> logic is only applied to other cases that would
> return -EINVAL until now.
>
> Depending on firmware revisions some combinations
> may crash firmware so use with care, please.
>
> This depends on "ath10k: don't use reassoc flag".
> Without it key cache would effectively be
> invalidated upon bitrate change leading to
> communication being no longer possible.
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
To reduce support questions from the users it would be nice to give few
good examples how to use this with iw. And also it makes it easier to
test the patch. If you could send something I can add it to the commit
log.
> +static u16
> +ath10k_peer_assoc_h_vht_limit(u16 tx_mcs_set,
> + const u16 vht_mcs_limit[NL80211_VHT_NSS_MAX])
> +{
> + int idx_limit;
> + int nss;
> + u16 mcs_map;
> + u16 mcs;
> +
> + for (nss = 0; nss < NL80211_VHT_NSS_MAX; nss++) {
> + mcs_map = ath10k_mac_get_max_vht_mcs_map(tx_mcs_set, nss) &
> + vht_mcs_limit[nss];
> +
> + if (mcs_map)
> + idx_limit = fls(mcs_map) - 1;
> + else
> + idx_limit = -1;
> +
> + switch (idx_limit) {
> + case 0: /* fall through */
> + case 1: /* fall through */
> + case 2: /* fall through */
> + case 3: /* fall through */
> + case 4: /* fall through */
> + case 5: /* fall through */
> + case 6: /* fall through */
> + default:
> + /* see ath10k_mac_can_set_bitrate_mask() */
> + WARN_ON(1);
> + /* fall through */
> + case -1:
> + mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED; break;
> + case 7:
> + mcs = IEEE80211_VHT_MCS_SUPPORT_0_7; break;
> + case 8:
> + mcs = IEEE80211_VHT_MCS_SUPPORT_0_8; break;
> + case 9:
> + mcs = IEEE80211_VHT_MCS_SUPPORT_0_9; break;
> + }
I moved the breaks into their own lines, I think that just easier to
read. This is the diff:
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index ace273f7ec73..069f399e4c25 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2277,13 +2277,17 @@ ath10k_peer_assoc_h_vht_limit(u16 tx_mcs_set,
WARN_ON(1);
/* fall through */
case -1:
- mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED; break;
+ mcs = IEEE80211_VHT_MCS_NOT_SUPPORTED;
+ break;
case 7:
- mcs = IEEE80211_VHT_MCS_SUPPORT_0_7; break;
+ mcs = IEEE80211_VHT_MCS_SUPPORT_0_7;
+ break;
case 8:
- mcs = IEEE80211_VHT_MCS_SUPPORT_0_8; break;
+ mcs = IEEE80211_VHT_MCS_SUPPORT_0_8;
+ break;
case 9:
- mcs = IEEE80211_VHT_MCS_SUPPORT_0_9; break;
+ mcs = IEEE80211_VHT_MCS_SUPPORT_0_9;
+ break;
}
tx_mcs_set &= ~(0x3 << (nss * 2));
--
Kalle Valo
next prev parent reply other threads:[~2015-04-17 7:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 13:32 [PATCH] ath10k: implement more versatile set_bitrate_mask Michal Kazior
2015-04-17 7:06 ` Kalle Valo [this message]
2015-04-17 7:30 ` Michal Kazior
2015-04-21 15:04 ` Kalle Valo
2015-04-22 6:27 ` Kalle Valo
2015-04-22 7:33 ` Michal Kazior
2015-04-24 14:31 ` Kalle Valo
2015-04-27 8:50 ` Kalle Valo
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=87618v44jv.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).