All of lore.kernel.org
 help / color / mirror / Atom feed
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 9/9] rt2800: set max_psdu to 3 on usb devices
Date: Fri,  6 Jan 2017 14:05:18 +0100	[thread overview]
Message-ID: <1483707918-31480-10-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1483707918-31480-1-git-send-email-sgruszka@redhat.com>

All Ralink USB devices I have, including old ones, work well with
max_psdu = 3 (64kB tx AMPDUs).

Fix indent on the way.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 6cac311..de7a564 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -4743,15 +4743,16 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
 
 	rt2800_register_read(rt2x00dev, MAX_LEN_CFG, &reg);
 	rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE);
-	if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
-	    rt2x00_rt(rt2x00dev, RT2883) ||
-	    rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E)) {
+	if (rt2x00_is_usb(rt2x00dev)) {
+		drv_data->max_psdu = 3;
+	} else if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
+		   rt2x00_rt(rt2x00dev, RT2883) ||
+		   rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E)) {
 		drv_data->max_psdu = 2;
-		rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 2);
 	} else {
 		drv_data->max_psdu = 1;
-		rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 1);
 	}
+	rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, drv_data->max_psdu);
 	rt2x00_set_field32(&reg, MAX_LEN_CFG_MIN_PSDU, 10);
 	rt2x00_set_field32(&reg, MAX_LEN_CFG_MIN_MPDU, 10);
 	rt2800_register_write(rt2x00dev, MAX_LEN_CFG, reg);
-- 
2.7.4

      parent reply	other threads:[~2017-01-06 13:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 13:05 [PATCH 0/9] rt2800 patches 06.01.2017 Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 1/9] rt2800usb: remove watchdog Stanislaw Gruszka
2017-01-17 11:59   ` [1/9] " Kalle Valo
2017-01-06 13:05 ` [PATCH 2/9] rt2800: increase TX timeout Stanislaw Gruszka
2017-01-06 15:15   ` Felix Fietkau
2017-01-06 15:34     ` Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 3/9] rt2x00: save conf settings before reset tuner Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 4/9] rt2800: change default retry settings Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 5/9] rt2800: tune TX_RTS_CFG config Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 6/9] rt2800: fallback from mcs8 to mcs7 Stanislaw Gruszka
2017-01-12 11:10   ` Felix Fietkau
2017-01-13  9:09     ` Stanislaw Gruszka
2017-01-13 10:11   ` [6/9] " Kalle Valo
2017-01-06 13:05 ` [PATCH 7/9] rt2800usb: mark tx failure on timeout Stanislaw Gruszka
2017-01-06 13:05 ` [PATCH 8/9] rt2x00: do not flush empty queue Stanislaw Gruszka
2017-01-06 13:05 ` Stanislaw Gruszka [this message]

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=1483707918-31480-10-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 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.