aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-09-06 09:14:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-09-09 11:18:14 -0400
commit4789666e13fb0b2d45feb1b4a5119a1b997ec84c (patch)
tree2071e79396f94d56177eab6386b5ce09e799abb8 /drivers/net/wireless
parentfd413da852991e96c555ad7253cc481bc133e221 (diff)
rt2x00: Hardcode TX ack timeout and consume time
The calculated values for the ACK timeout and ACK consume time are different then the values as used by the Legacy drivers. After testing from James Ledwith it appeared that the calculated values caused a high amount of TX failures, and the values from the Legacy drivers were the most optimal to prevent TX failure due to excessive retries. The symptoms of this problem: - Rate control module always falls back to 1Mbs - Low throughput when bitrate was fixed Possible side-effects (not confirmed but highly likely) - Problems with DHCP - Broken connections due to lack of probe response This should fix at least: Kernel bugzilla reports: [13362], [13009], [9273] Fedora bugzilla reports: [443203] but possible some additional bugs as well. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
8 files changed, 7 insertions, 28 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 164df9347a2f..798f625e38f7 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -331,9 +331,8 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev,
331 preamble_mask = erp->short_preamble << 3; 331 preamble_mask = erp->short_preamble << 3;
332 332
333 rt2x00pci_register_read(rt2x00dev, TXCSR1, &reg); 333 rt2x00pci_register_read(rt2x00dev, TXCSR1, &reg);
334 rt2x00_set_field32(&reg, TXCSR1_ACK_TIMEOUT, erp->ack_timeout); 334 rt2x00_set_field32(&reg, TXCSR1_ACK_TIMEOUT, 0x1ff);
335 rt2x00_set_field32(&reg, TXCSR1_ACK_CONSUME_TIME, 335 rt2x00_set_field32(&reg, TXCSR1_ACK_CONSUME_TIME, 0x13a);
336 erp->ack_consume_time);
337 rt2x00_set_field32(&reg, TXCSR1_TSF_OFFSET, IEEE80211_HEADER); 336 rt2x00_set_field32(&reg, TXCSR1_TSF_OFFSET, IEEE80211_HEADER);
338 rt2x00_set_field32(&reg, TXCSR1_AUTORESPONDER, 1); 337 rt2x00_set_field32(&reg, TXCSR1_AUTORESPONDER, 1);
339 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 338 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 4186582f2770..2e872ac69826 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -337,9 +337,8 @@ static void rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev,
337 preamble_mask = erp->short_preamble << 3; 337 preamble_mask = erp->short_preamble << 3;
338 338
339 rt2x00pci_register_read(rt2x00dev, TXCSR1, &reg); 339 rt2x00pci_register_read(rt2x00dev, TXCSR1, &reg);
340 rt2x00_set_field32(&reg, TXCSR1_ACK_TIMEOUT, erp->ack_timeout); 340 rt2x00_set_field32(&reg, TXCSR1_ACK_TIMEOUT, 0x162);
341 rt2x00_set_field32(&reg, TXCSR1_ACK_CONSUME_TIME, 341 rt2x00_set_field32(&reg, TXCSR1_ACK_CONSUME_TIME, 0xa2);
342 erp->ack_consume_time);
343 rt2x00_set_field32(&reg, TXCSR1_TSF_OFFSET, IEEE80211_HEADER); 342 rt2x00_set_field32(&reg, TXCSR1_TSF_OFFSET, IEEE80211_HEADER);
344 rt2x00_set_field32(&reg, TXCSR1_AUTORESPONDER, 1); 343 rt2x00_set_field32(&reg, TXCSR1_AUTORESPONDER, 1);
345 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 344 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index b04f59bab3b0..22dd6d9e2981 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -488,10 +488,6 @@ static void rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev,
488{ 488{
489 u16 reg; 489 u16 reg;
490 490
491 rt2500usb_register_read(rt2x00dev, TXRX_CSR1, &reg);
492 rt2x00_set_field16(&reg, TXRX_CSR1_ACK_TIMEOUT, erp->ack_timeout);
493 rt2500usb_register_write(rt2x00dev, TXRX_CSR1, reg);
494
495 rt2500usb_register_read(rt2x00dev, TXRX_CSR10, &reg); 491 rt2500usb_register_read(rt2x00dev, TXRX_CSR10, &reg);
496 rt2x00_set_field16(&reg, TXRX_CSR10_AUTORESPOND_PREAMBLE, 492 rt2x00_set_field16(&reg, TXRX_CSR10_AUTORESPOND_PREAMBLE,
497 !!erp->short_preamble); 493 !!erp->short_preamble);
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 639dc6cc04b9..a084077a1c61 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -580,8 +580,7 @@ static void rt2800usb_config_erp(struct rt2x00_dev *rt2x00dev,
580 u32 reg; 580 u32 reg;
581 581
582 rt2x00usb_register_read(rt2x00dev, TX_TIMEOUT_CFG, &reg); 582 rt2x00usb_register_read(rt2x00dev, TX_TIMEOUT_CFG, &reg);
583 rt2x00_set_field32(&reg, TX_TIMEOUT_CFG_RX_ACK_TIMEOUT, 583 rt2x00_set_field32(&reg, TX_TIMEOUT_CFG_RX_ACK_TIMEOUT, 0x20);
584 DIV_ROUND_UP(erp->ack_timeout, erp->slot_time));
585 rt2x00usb_register_write(rt2x00dev, TX_TIMEOUT_CFG, reg); 584 rt2x00usb_register_write(rt2x00dev, TX_TIMEOUT_CFG, reg);
586 585
587 rt2x00usb_register_read(rt2x00dev, AUTO_RSP_CFG, &reg); 586 rt2x00usb_register_read(rt2x00dev, AUTO_RSP_CFG, &reg);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 555a777db6df..27bc6b7fbfde 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -417,9 +417,6 @@ struct rt2x00lib_erp {
417 int short_preamble; 417 int short_preamble;
418 int cts_protection; 418 int cts_protection;
419 419
420 int ack_timeout;
421 int ack_consume_time;
422
423 u32 basic_rates; 420 u32 basic_rates;
424 421
425 int slot_time; 422 int slot_time;
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 3501788ab498..40a201e2e151 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -94,17 +94,6 @@ void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
94 erp.difs = bss_conf->use_short_slot ? SHORT_DIFS : DIFS; 94 erp.difs = bss_conf->use_short_slot ? SHORT_DIFS : DIFS;
95 erp.eifs = bss_conf->use_short_slot ? SHORT_EIFS : EIFS; 95 erp.eifs = bss_conf->use_short_slot ? SHORT_EIFS : EIFS;
96 96
97 erp.ack_timeout = PLCP + erp.difs + GET_DURATION(ACK_SIZE, 10);
98 erp.ack_consume_time = SIFS + PLCP + GET_DURATION(ACK_SIZE, 10);
99
100 if (bss_conf->use_short_preamble) {
101 erp.ack_timeout += SHORT_PREAMBLE;
102 erp.ack_consume_time += SHORT_PREAMBLE;
103 } else {
104 erp.ack_timeout += PREAMBLE;
105 erp.ack_consume_time += PREAMBLE;
106 }
107
108 erp.basic_rates = bss_conf->basic_rates; 97 erp.basic_rates = bss_conf->basic_rates;
109 erp.beacon_int = bss_conf->beacon_int; 98 erp.beacon_int = bss_conf->beacon_int;
110 99
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index f4b4b86da4da..b20e3eac9d67 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -598,7 +598,7 @@ static void rt61pci_config_erp(struct rt2x00_dev *rt2x00dev,
598 u32 reg; 598 u32 reg;
599 599
600 rt2x00pci_register_read(rt2x00dev, TXRX_CSR0, &reg); 600 rt2x00pci_register_read(rt2x00dev, TXRX_CSR0, &reg);
601 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout); 601 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, 0x32);
602 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER); 602 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER);
603 rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg); 603 rt2x00pci_register_write(rt2x00dev, TXRX_CSR0, reg);
604 604
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 90e117263051..1cbd9b4a3efc 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -561,7 +561,7 @@ static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev,
561 u32 reg; 561 u32 reg;
562 562
563 rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, &reg); 563 rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
564 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout); 564 rt2x00_set_field32(&reg, TXRX_CSR0_RX_ACK_TIMEOUT, 0x32);
565 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER); 565 rt2x00_set_field32(&reg, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER);
566 rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); 566 rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg);
567 567