From b3df3a2261f5862cce6c5ec9272e9ab8a2e25c8a Mon Sep 17 00:00:00 2001 From: Helmut Schaa Date: Mon, 14 Jun 2010 22:11:09 +0200 Subject: [PATCH] --- yaml --- r: 203062 b: refs/heads/master c: 3afa626a05a1d9fceedb397a66e85c13e3ff2c26 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/rt2x00/rt2800pci.c | 23 ++++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index d85b328cd053..bac0ff92dc9a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 52b58facff34318e8d98617480fc188edfc71386 +refs/heads/master: 3afa626a05a1d9fceedb397a66e85c13e3ff2c26 diff --git a/trunk/drivers/net/wireless/rt2x00/rt2800pci.c b/trunk/drivers/net/wireless/rt2x00/rt2800pci.c index eeecedb63cd0..e870366ad871 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/trunk/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);