From c713f9c543a1f821d75e9e871678e46a8673f730 Mon Sep 17 00:00:00 2001 From: Ivo van Doorn Date: Mon, 14 Jun 2010 22:13:37 +0200 Subject: [PATCH] --- yaml --- r: 203068 b: refs/heads/master c: e6474c3c6d4839c73f363a0f44a347d804534758 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/rt2x00/rt61pci.c | 23 ++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 953a48760964..845d62c10b7b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5ea2f0255fe48af4864b41385fc28b4bc785ba6 +refs/heads/master: e6474c3c6d4839c73f363a0f44a347d804534758 diff --git a/trunk/drivers/net/wireless/rt2x00/rt61pci.c b/trunk/drivers/net/wireless/rt2x00/rt61pci.c index d1270118f7d3..7ca383478eeb 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt61pci.c +++ b/trunk/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.