From: Stanislaw Gruszka <sgruszka@redhat.com>
To: linux-wireless@vger.kernel.org
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
Mathias Kresin <dev@kresin.me>
Subject: [PATCH v2 1/9] rt2800: correctly report MCS TX parameters
Date: Fri, 18 Nov 2016 10:43:53 +0100 [thread overview]
Message-ID: <1479462241-9299-2-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1479462241-9299-1-git-send-email-sgruszka@redhat.com>
We should only set IEEE80211_HT_MCS_TX_RX_DIF when TX and RX MCS sets
are not equal, i.e. when number of tx streams is different than
number of RX streams.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index bf3f0a3..aab59f6 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -7464,7 +7464,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
char *default_power1;
char *default_power2;
char *default_power3;
- unsigned int i;
+ unsigned int i, tx_chains, rx_chains;
u32 reg;
/*
@@ -7589,21 +7589,24 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40;
- if (rt2x00dev->default_ant.tx_chain_num >= 2)
+ tx_chains = rt2x00dev->default_ant.tx_chain_num;
+ rx_chains = rt2x00dev->default_ant.rx_chain_num;
+
+ if (tx_chains >= 2)
spec->ht.cap |= IEEE80211_HT_CAP_TX_STBC;
- spec->ht.cap |= rt2x00dev->default_ant.rx_chain_num <<
- IEEE80211_HT_CAP_RX_STBC_SHIFT;
+ spec->ht.cap |= rx_chains << IEEE80211_HT_CAP_RX_STBC_SHIFT;
spec->ht.ampdu_factor = 3;
spec->ht.ampdu_density = 4;
- spec->ht.mcs.tx_params =
- IEEE80211_HT_MCS_TX_DEFINED |
- IEEE80211_HT_MCS_TX_RX_DIFF |
- ((rt2x00dev->default_ant.tx_chain_num - 1) <<
- IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
+ spec->ht.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
+ if (tx_chains != rx_chains) {
+ spec->ht.mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
+ spec->ht.mcs.tx_params |=
+ (tx_chains - 1) << IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
+ }
- switch (rt2x00dev->default_ant.rx_chain_num) {
+ switch (rx_chains) {
case 3:
spec->ht.mcs.rx_mask[2] = 0xff;
case 2:
--
1.8.3.1
next prev parent reply other threads:[~2016-11-18 9:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 9:43 [PATCH v2 0/9] rt2800: random fixes Stanislaw Gruszka
2016-11-18 9:43 ` Stanislaw Gruszka [this message]
2016-11-23 15:39 ` [v2,1/9] rt2800: correctly report MCS TX parameters Kalle Valo
2016-11-18 9:43 ` [PATCH v2 2/9] rt2800usb: do not wipe out USB_DMA_CFG settings Stanislaw Gruszka
2016-11-18 9:43 ` [PATCH v2 3/9] rt2800: OFDM rates are mandatory Stanislaw Gruszka
2016-11-18 9:43 ` [PATCH v2 4/9] rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZE Stanislaw Gruszka
2016-11-18 9:43 ` [PATCH v2 5/9] rt2800: correct AUTO_RSP_CFG Stanislaw Gruszka
2016-11-18 9:43 ` [PATCH v2 6/9] rt2800: correct TX_SW_CFG1 for 5592 Stanislaw Gruszka
2016-11-18 9:43 ` [PATCH v2 7/9] rt2800: use RTS/CTS protection instead of CTS-to-self Stanislaw Gruszka
2016-11-18 9:44 ` [PATCH v2 8/9] rt2800: tune *_PROT_CFG parameters Stanislaw Gruszka
2016-11-18 9:44 ` [PATCH v2 9/9] rt2800: disable CCK rates on HT Stanislaw Gruszka
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=1479462241-9299-2-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=dev@kresin.me \
--cc=helmut.schaa@googlemail.com \
--cc=linux-wireless@vger.kernel.org \
/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).