diff mbox

[v2,1/9] rt2800: correctly report MCS TX parameters

Message ID 1479462241-9299-2-git-send-email-sgruszka@redhat.com (mailing list archive)
State Accepted
Commit cea5b03d8a10f718823692a617f738d9cbae193f
Delegated to: Kalle Valo
Headers show

Commit Message

Stanislaw Gruszka Nov. 18, 2016, 9:43 a.m. UTC
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(-)

Comments

Kalle Valo Nov. 23, 2016, 3:39 p.m. UTC | #1
Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> 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>

9 patches applied to wireless-drivers-next.git, thanks.

cea5b03d8a10 rt2800: correctly report MCS TX parameters
b29a1c1f08f3 rt2800usb: do not wipe out USB_DMA_CFG settings
770e4b730a73 rt2800: OFDM rates are mandatory
b4c449b1b803 rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZE
be82de9d64e2 rt2800: correct AUTO_RSP_CFG
231aeca1e19e rt2800: correct TX_SW_CFG1 for 5592
6c40063d5a61 rt2800: use RTS/CTS protection instead of CTS-to-self
8d79b0078278 rt2800: tune *_PROT_CFG parameters
159a55a64d44 rt2800: disable CCK rates on HT
diff mbox

Patch

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: