* [PATCH 01/14] rt2x00: clarify meaning of txdone flags
@ 2010-06-14 20:08 Ivo van Doorn
2010-06-14 20:09 ` [PATCH 02/14] rt2x00: don't use TXDONE_FALLBACK as success indicator Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:08 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
Update the documentation of the available txdone flags to better express
how they should be used.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00queue.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index f791708..55872c4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -213,9 +213,16 @@ struct rxdone_entry_desc {
/**
* enum txdone_entry_desc_flags: Flags for &struct txdone_entry_desc
*
+ * Every txdone report has to contain the basic result of the
+ * transmission, either &TXDONE_UNKNOWN, &TXDONE_SUCCESS or
+ * &TXDONE_FAILURE. The flag &TXDONE_FALLBACK can be used in
+ * conjunction with all of these flags but should only be set
+ * if retires > 0. The flag &TXDONE_EXCESSIVE_RETRY can only be used
+ * in conjunction with &TXDONE_FAILURE.
+ *
* @TXDONE_UNKNOWN: Hardware could not determine success of transmission.
* @TXDONE_SUCCESS: Frame was successfully send
- * @TXDONE_FALLBACK: Frame was successfully send using a fallback rate.
+ * @TXDONE_FALLBACK: Hardware used fallback rates for retries
* @TXDONE_FAILURE: Frame was not successfully send
* @TXDONE_EXCESSIVE_RETRY: In addition to &TXDONE_FAILURE, the
* frame transmission failed due to excessive retries.
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 02/14] rt2x00: don't use TXDONE_FALLBACK as success indicator
2010-06-14 20:08 [PATCH 01/14] rt2x00: clarify meaning of txdone flags Ivo van Doorn
@ 2010-06-14 20:09 ` Ivo van Doorn
2010-06-14 20:09 ` [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:09 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
TXDONE_FALLBACK doesn't express if the frame was sent successful or not. It
only tells us that the hw used fallback rates for retries. Hence, don't use
TXDONE_FALLBACK as success indicator.
Before this patch we reported success to the rate control algorithm which
was wrong in a number of cases and might have lead to improper tx rate
selections.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00dev.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 0b8efe8..8faee4c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -236,8 +236,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,
*/
success =
test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
- test_bit(TXDONE_UNKNOWN, &txdesc->flags) ||
- test_bit(TXDONE_FALLBACK, &txdesc->flags);
+ test_bit(TXDONE_UNKNOWN, &txdesc->flags);
/*
* Update TX statistics.
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried
2010-06-14 20:09 ` [PATCH 02/14] rt2x00: don't use TXDONE_FALLBACK as success indicator Ivo van Doorn
@ 2010-06-14 20:09 ` Ivo van Doorn
2010-06-14 20:10 ` [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:09 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
TXDONE_FALLBACK expresses that fallback rates were used for retries. Hence,
it only makes sense to set the flag if retries > 0.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b5a871e..eeecedb 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -903,8 +903,12 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
txdesc.retry = 7;
}
- __set_bit(TXDONE_FALLBACK, &txdesc.flags);
-
+ /*
+ * the frame was retried at least once
+ * -> hw used fallback rates
+ */
+ if (txdesc.retry)
+ __set_bit(TXDONE_FALLBACK, &txdesc.flags);
rt2x00pci_txdone(entry, &txdesc);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling
2010-06-14 20:09 ` [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried Ivo van Doorn
@ 2010-06-14 20:10 ` Ivo van Doorn
2010-06-14 20:10 ` [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:10 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
IEEE80211_TX_CTL_MORE_FRAMES indicates that more frames are queued for tx
but has nothing to do with fragmentation. Hence, don't set ENTRY_TXD_MORE_FRAG
but only ENTRY_TXD_BURST to not kick the tx queues immediately.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 35858b1..f916371 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -353,13 +353,18 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
/*
* Check if more fragments are pending
*/
- if (ieee80211_has_morefrags(hdr->frame_control) ||
- (tx_info->flags & IEEE80211_TX_CTL_MORE_FRAMES)) {
+ if (ieee80211_has_morefrags(hdr->frame_control)) {
__set_bit(ENTRY_TXD_BURST, &txdesc->flags);
__set_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags);
}
/*
+ * Check if more frames (!= fragments) are pending
+ */
+ if (tx_info->flags & IEEE80211_TX_CTL_MORE_FRAMES)
+ __set_bit(ENTRY_TXD_BURST, &txdesc->flags);
+
+ /*
* Beacons and probe responses require the tsf timestamp
* to be inserted into the frame, except for a frame that has been injected
* through a monitor interface. This latter is needed for testing a
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER
2010-06-14 20:10 ` [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling Ivo van Doorn
@ 2010-06-14 20:10 ` Ivo van Doorn
2010-06-14 20:11 ` [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:10 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
Add a comment about the meaning of BBP1_TX_POWER stating all possible values.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 16bfaa8..b308421 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1557,7 +1557,9 @@ struct mac_iveiv_entry {
*/
/*
- * BBP 1: TX Antenna
+ * BBP 1: TX Antenna & Power
+ * POWER: 0 - normal, 1 - drop tx power by 6dBm, 2 - drop tx power by 12dBm,
+ * 3 - increase tx power by 6dBm
*/
#define BBP1_TX_POWER FIELD8(0x07)
#define BBP1_TX_ANTENNA FIELD8(0x18)
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling
2010-06-14 20:10 ` [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER Ivo van Doorn
@ 2010-06-14 20:11 ` Ivo van Doorn
2010-06-14 20:11 ` [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:11 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
Currently rt2800pci will read TX_STA_FIFO until the previously read value
matches the current value. However, it is obvious that TX_STA_FIFO only
contains values that can easily be the same for multiple consecutive frames
(especially when communicating with only one other STA). Hence, we often
ended up with reading only the first entry and ignoring the rest.
One result was that when the TX_STA_FIFO contained multiple entires, only
the first one was read and properly handled while the others remained in the
tx queue.
Thus, drop this check but introduce a maximum number of reads. All legacy
drivers use the size of the tx ring as limit but state that the TX_STA_FIFO
has only 16 entries. So, let's just stick with the tx ring size for now.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index eeecedb..afa30ea 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -813,29 +813,24 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
struct txdone_entry_desc txdesc;
u32 word;
u32 reg;
- u32 old_reg;
int wcid, ack, pid, tx_wcid, tx_ack, tx_pid;
u16 mcs, real_mcs;
+ int i;
/*
- * During each loop we will compare the freshly read
- * TX_STA_FIFO register value with the value read from
- * the previous loop. If the 2 values are equal then
- * we should stop processing because the chance it
- * quite big that the device has been unplugged and
- * we risk going into an endless loop.
+ * TX_STA_FIFO is a stack of X entries, hence read TX_STA_FIFO
+ * at most X times and also stop processing once the TX_STA_FIFO_VALID
+ * flag is not set anymore.
+ *
+ * The legacy drivers use X=TX_RING_SIZE but state in a comment
+ * that the TX_STA_FIFO stack has a size of 16. We stick to our
+ * tx ring size for now.
*/
- old_reg = 0;
-
- while (1) {
+ for (i = 0; i < TX_ENTRIES; i++) {
rt2800_register_read(rt2x00dev, TX_STA_FIFO, ®);
if (!rt2x00_get_field32(reg, TX_STA_FIFO_VALID))
break;
- if (old_reg == reg)
- break;
- old_reg = reg;
-
wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower
2010-06-14 20:11 ` [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling Ivo van Doorn
@ 2010-06-14 20:11 ` Ivo van Doorn
2010-06-14 20:12 ` [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:11 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
Fix typo in rt2800_config_txpower.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index ae20e67..f158322 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1079,7 +1079,7 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
u8 r1;
rt2800_bbp_read(rt2x00dev, 1, &r1);
- rt2x00_set_field8(®, BBP1_TX_POWER, 0);
+ rt2x00_set_field8(&r1, BBP1_TX_POWER, 0);
rt2800_bbp_write(rt2x00dev, 1, r1);
rt2800_register_read(rt2x00dev, TX_PWR_CFG_0, ®);
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value
2010-06-14 20:11 ` [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower Ivo van Doorn
@ 2010-06-14 20:12 ` Ivo van Doorn
2010-06-14 20:12 ` [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
Set up max_rates and max_rate_tries with suitable values even if we do not
support the whole functionality.
As rt2800 has a global fallback table we cannot specify more then one tx rate
per frame but since the hw will try several different rates (based on the
fallback table) we should still initialize max_rates to the maximum number of
rates we are going to try. Otherwise mac80211 will truncate our reported tx
rates and the rc algortihm will end up with incorrect data choosing unsuitable
rates for tx.
This improves throughput on rt2800 devices considerable.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f158322..6d4df3e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2497,6 +2497,18 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_addr(rt2x00dev,
EEPROM_MAC_ADDR_0));
+ /*
+ * As rt2800 has a global fallback table we cannot specify
+ * more then one tx rate per frame but since the hw will
+ * try several rates (based on the fallback table) we should
+ * still initialize max_rates to the maximum number of rates
+ * we are going to try. Otherwise mac80211 will truncate our
+ * reported tx rates and the rc algortihm will end up with
+ * incorrect data.
+ */
+ rt2x00dev->hw->max_rates = 7;
+ rt2x00dev->hw->max_rate_tries = 1;
+
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
/*
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate
2010-06-14 20:12 ` [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value Ivo van Doorn
@ 2010-06-14 20:12 ` Ivo van Doorn
2010-06-14 20:12 ` [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Helmut Schaa <helmut.schaa@googlemail.com>
In some corner cases the reported tx rates/retries didn't match the really
used ones.
The hardware lowers the tx rate on each consecutive retry by 1 (but won't
fall back from MCS to legacy rates) _until_ it reaches the lowest one.
In case the frame wasn't sent succesful the number of retries is 7 and if
a rate index <7 was used the previous code reported negative rate indexes
which were then ignored by the rate control algorithm and mac80211.
Instead, report the remaining number of retries to have happened with
the lowest rate (index 0). This should give the rate control algorithm
slightly more accurate information about the used tx rates/retries.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00dev.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index e7a208d..918451a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -258,11 +258,22 @@ void rt2x00lib_txdone(struct queue_entry *entry,
/*
* Frame was send with retries, hardware tried
* different rates to send out the frame, at each
- * retry it lowered the rate 1 step.
+ * retry it lowered the rate 1 step except when the
+ * lowest rate was used.
*/
for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) {
tx_info->status.rates[i].idx = rate_idx - i;
tx_info->status.rates[i].flags = rate_flags;
+
+ if (rate_idx - i == 0) {
+ /*
+ * The lowest rate (index 0) was used until the
+ * number of max retries was reached.
+ */
+ tx_info->status.rates[i].count = retry_rates - i;
+ i++;
+ break;
+ }
tx_info->status.rates[i].count = 1;
}
if (i < (IEEE80211_TX_MAX_RATES - 1))
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb
2010-06-14 20:12 ` [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate Ivo van Doorn
@ 2010-06-14 20:12 ` Ivo van Doorn
2010-06-14 20:13 ` [PATCH 11/14] rt2x00: Update author rt2800lib Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Ivo van Doorn <IvDoorn@gmail.com>
Explicitly enable the usage of fallback rates for
the transmission of frames with rt61pci and rt73usb hardware.
Note that for txdone reporting, only rt61pci is capable of
reporting the fallback rates, for USB it is not possible
to determine the number of retries. However the device will
use the fallback rates, so it might still help in the performance.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 22 ++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt73usb.c | 3 +++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 243df08..d127011 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -931,6 +931,9 @@ static void rt61pci_config_retry_limit(struct rt2x00_dev *rt2x00dev,
u32 reg;
rt2x00pci_register_read(rt2x00dev, TXRX_CSR4, ®);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
libconf->conf->long_frame_max_tx_count);
rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
@@ -2130,6 +2133,13 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
}
txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT);
+ /*
+ * the frame was retried at least once
+ * -> hw used fallback rates
+ */
+ if (txdesc.retry)
+ __set_bit(TXDONE_FALLBACK, &txdesc.flags);
+
rt2x00pci_txdone(entry, &txdesc);
}
}
@@ -2587,6 +2597,18 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
EEPROM_MAC_ADDR_0));
/*
+ * As rt61 has a global fallback table we cannot specify
+ * more then one tx rate per frame but since the hw will
+ * try several rates (based on the fallback table) we should
+ * still initialize max_rates to the maximum number of rates
+ * we are going to try. Otherwise mac80211 will truncate our
+ * reported tx rates and the rc algortihm will end up with
+ * incorrect data.
+ */
+ rt2x00dev->hw->max_rates = 7;
+ rt2x00dev->hw->max_rate_tries = 1;
+
+ /*
* Initialize hw_mode information.
*/
spec->supported_bands = SUPPORT_BAND_2GHZ;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 113ad69..d06d90f 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -816,6 +816,9 @@ static void rt73usb_config_retry_limit(struct rt2x00_dev *rt2x00dev,
u32 reg;
rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, ®);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
libconf->conf->long_frame_max_tx_count);
rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 11/14] rt2x00: Update author rt2800lib
2010-06-14 20:12 ` [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb Ivo van Doorn
@ 2010-06-14 20:13 ` Ivo van Doorn
2010-06-14 20:13 ` [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Ivo van Doorn <IvDoorn@gmail.com>
rt2800lib has been under development of the rt2x00 project,
so add it to the author string for the module information.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 6d4df3e..a83477a 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1,9 +1,9 @@
/*
+ Copyright (C) 2010 Ivo van Doorn <IvDoorn@gmail.com>
Copyright (C) 2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Copyright (C) 2009 Gertjan van Wingerde <gwingerde@gmail.com>
Based on the original rt2800pci.c and rt2800usb.c.
- Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com>
Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
@@ -41,10 +41,6 @@
#include "rt2800lib.h"
#include "rt2800.h"
-MODULE_AUTHOR("Bartlomiej Zolnierkiewicz");
-MODULE_DESCRIPTION("rt2800 library");
-MODULE_LICENSE("GPL");
-
/*
* Register access.
* All access to the CSR registers will go through the methods
@@ -2761,3 +2757,9 @@ const struct ieee80211_ops rt2800_mac80211_ops = {
.rfkill_poll = rt2x00mac_rfkill_poll,
};
EXPORT_SYMBOL_GPL(rt2800_mac80211_ops);
+
+MODULE_AUTHOR(DRV_PROJECT ", Bartlomiej Zolnierkiewicz");
+MODULE_VERSION(DRV_VERSION);
+MODULE_DESCRIPTION("Ralink RT2800 library");
+MODULE_LICENSE("GPL");
+
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries
2010-06-14 20:13 ` [PATCH 11/14] rt2x00: Update author rt2800lib Ivo van Doorn
@ 2010-06-14 20:13 ` Ivo van Doorn
2010-06-14 20:13 ` [PATCH 13/14] rt2x00: Enable HW crypto by default Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Ivo van Doorn <IvDoorn@gmail.com>
Similar to rt2800pci, remove the check for duplicate
register reading, and instead limit the for-loop to
the maximum number of TX entries inside a queue.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index d127011..f7ee31e 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2052,29 +2052,24 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
struct txdone_entry_desc txdesc;
u32 word;
u32 reg;
- u32 old_reg;
int type;
int index;
+ int i;
/*
- * During each loop we will compare the freshly read
- * STA_CSR4 register value with the value read from
- * the previous loop. If the 2 values are equal then
- * we should stop processing because the chance is
- * quite big that the device has been unplugged and
- * we risk going into an endless loop.
+ * TX_STA_FIFO is a stack of X entries, hence read TX_STA_FIFO
+ * at most X times and also stop processing once the TX_STA_FIFO_VALID
+ * flag is not set anymore.
+ *
+ * The legacy drivers use X=TX_RING_SIZE but state in a comment
+ * that the TX_STA_FIFO stack has a size of 16. We stick to our
+ * tx ring size for now.
*/
- old_reg = 0;
-
- while (1) {
+ for (i = 0; i < TX_ENTRIES; i++) {
rt2x00pci_register_read(rt2x00dev, STA_CSR4, ®);
if (!rt2x00_get_field32(reg, STA_CSR4_VALID))
break;
- if (old_reg == reg)
- break;
- old_reg = reg;
-
/*
* Skip this entry when it contains an invalid
* queue identication number.
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 13/14] rt2x00: Enable HW crypto by default
2010-06-14 20:13 ` [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries Ivo van Doorn
@ 2010-06-14 20:13 ` Ivo van Doorn
2010-06-14 20:14 ` [PATCH 14/14] rt2x00: Synchronize WCID initialization with legacy driver Ivo van Doorn
0 siblings, 1 reply; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Ivo van Doorn <IvDoorn@gmail.com>
Hardware cryptography seems to be working
on a 11G network with WPA/WPA2 cryptography
enabled. WEP still needs to be tested...
Signed-of-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2800usb.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index afa30ea..165da7b 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -51,7 +51,7 @@
/*
* Allow hardware encryption to be disabled.
*/
-static int modparam_nohwcrypt = 1;
+static int modparam_nohwcrypt = 0;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index c437960..f18c12a 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -45,7 +45,7 @@
/*
* Allow hardware encryption to be disabled.
*/
-static int modparam_nohwcrypt = 1;
+static int modparam_nohwcrypt = 0;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 14/14] rt2x00: Synchronize WCID initialization with legacy driver
2010-06-14 20:13 ` [PATCH 13/14] rt2x00: Enable HW crypto by default Ivo van Doorn
@ 2010-06-14 20:14 ` Ivo van Doorn
0 siblings, 0 replies; 14+ messages in thread
From: Ivo van Doorn @ 2010-06-14 20:14 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
From: Ivo van Doorn <IvDoorn@gmail.com>
Legacy rt2870 driver handles WCID differently then we expected,
the BSSID and Cipher value are 3 bit values, while the 4th bit
should be set elsewhere in an extended field.
After this, rt2800usb reports frames have been decrypted
successfully, indicating that the Hardware decryption now is
working correctly.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800.h | 4 ++++
drivers/net/wireless/rt2x00/rt2800lib.c | 31 ++++++++++++++++++++++---------
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index b308421..3ed87ba 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1436,6 +1436,10 @@ struct mac_iveiv_entry {
#define MAC_WCID_ATTRIBUTE_CIPHER FIELD32(0x0000000e)
#define MAC_WCID_ATTRIBUTE_BSS_IDX FIELD32(0x00000070)
#define MAC_WCID_ATTRIBUTE_RX_WIUDF FIELD32(0x00000380)
+#define MAC_WCID_ATTRIBUTE_CIPHER_EXT FIELD32(0x00000400)
+#define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT FIELD32(0x00000800)
+#define MAC_WCID_ATTRIBUTE_WAPI_MCBC FIELD32(0x00008000)
+#define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX FIELD32(0xff000000)
/*
* SHARED_KEY_MODE:
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a83477a..636bfd6 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -554,15 +554,28 @@ static void rt2800_config_wcid_attr(struct rt2x00_dev *rt2x00dev,
offset = MAC_WCID_ATTR_ENTRY(key->hw_key_idx);
- rt2800_register_read(rt2x00dev, offset, ®);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_KEYTAB,
- !!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE));
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER,
- (crypto->cmd == SET_KEY) * crypto->cipher);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX,
- (crypto->cmd == SET_KEY) * crypto->bssidx);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_RX_WIUDF, crypto->cipher);
- rt2800_register_write(rt2x00dev, offset, reg);
+ if (crypto->cmd == SET_KEY) {
+ rt2800_register_read(rt2x00dev, offset, ®);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_KEYTAB,
+ !!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE));
+ /*
+ * Both the cipher as the BSS Idx numbers are split in a main
+ * value of 3 bits, and a extended field for adding one additional
+ * bit to the value.
+ */
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER,
+ (crypto->cipher & 0x7));
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER_EXT,
+ (crypto->cipher & 0x8) >> 3);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX,
+ (crypto->bssidx & 0x7));
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX_EXT,
+ (crypto->bssidx & 0x8) >> 3);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_RX_WIUDF, crypto->cipher);
+ rt2800_register_write(rt2x00dev, offset, reg);
+ } else {
+ rt2800_register_write(rt2x00dev, offset, 0);
+ }
offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
--
1.6.6.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-06-14 20:15 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-14 20:08 [PATCH 01/14] rt2x00: clarify meaning of txdone flags Ivo van Doorn
2010-06-14 20:09 ` [PATCH 02/14] rt2x00: don't use TXDONE_FALLBACK as success indicator Ivo van Doorn
2010-06-14 20:09 ` [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried Ivo van Doorn
2010-06-14 20:10 ` [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling Ivo van Doorn
2010-06-14 20:10 ` [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER Ivo van Doorn
2010-06-14 20:11 ` [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling Ivo van Doorn
2010-06-14 20:11 ` [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower Ivo van Doorn
2010-06-14 20:12 ` [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value Ivo van Doorn
2010-06-14 20:12 ` [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate Ivo van Doorn
2010-06-14 20:12 ` [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb Ivo van Doorn
2010-06-14 20:13 ` [PATCH 11/14] rt2x00: Update author rt2800lib Ivo van Doorn
2010-06-14 20:13 ` [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries Ivo van Doorn
2010-06-14 20:13 ` [PATCH 13/14] rt2x00: Enable HW crypto by default Ivo van Doorn
2010-06-14 20:14 ` [PATCH 14/14] rt2x00: Synchronize WCID initialization with legacy driver Ivo van Doorn
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).