aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-03-28 07:29:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-04 16:20:01 -0400
commit166389375d5a3894aa00a9c2e490ac4b9af2a891 (patch)
treed1e2d7d4d639975c3cb263c71a88474719312409 /drivers/net/wireless/rt2x00
parent324732848c42bf79988479ee1b4359e15f08154b (diff)
rt2x00: Limit rt2x00pci rxdone processing to 16 entries at once
Instead of receiving an unlimited number of frames, stop after 16 entries and reschedule the rxdone tasklet. This allows other tasklets to be run inbetween. 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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c7
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.h5
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c6
6 files changed, 25 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 329f3283697b..137a24e520da 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1368,8 +1368,10 @@ static void rt2400pci_tbtt_tasklet(unsigned long data)
1368static void rt2400pci_rxdone_tasklet(unsigned long data) 1368static void rt2400pci_rxdone_tasklet(unsigned long data)
1369{ 1369{
1370 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 1370 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
1371 rt2x00pci_rxdone(rt2x00dev); 1371 if (rt2x00pci_rxdone(rt2x00dev))
1372 rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); 1372 tasklet_schedule(&rt2x00dev->rxdone_tasklet);
1373 else
1374 rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE);
1373} 1375}
1374 1376
1375static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) 1377static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 58277878889e..198fc0a0d77c 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1500,8 +1500,10 @@ static void rt2500pci_tbtt_tasklet(unsigned long data)
1500static void rt2500pci_rxdone_tasklet(unsigned long data) 1500static void rt2500pci_rxdone_tasklet(unsigned long data)
1501{ 1501{
1502 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 1502 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
1503 rt2x00pci_rxdone(rt2x00dev); 1503 if (rt2x00pci_rxdone(rt2x00dev))
1504 rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); 1504 tasklet_schedule(&rt2x00dev->rxdone_tasklet);
1505 else
1506 rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE);
1505} 1507}
1506 1508
1507static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance) 1509static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 808073aa9dcc..4672dc99fe46 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -806,8 +806,10 @@ static void rt2800pci_tbtt_tasklet(unsigned long data)
806static void rt2800pci_rxdone_tasklet(unsigned long data) 806static void rt2800pci_rxdone_tasklet(unsigned long data)
807{ 807{
808 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 808 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
809 rt2x00pci_rxdone(rt2x00dev); 809 if (rt2x00pci_rxdone(rt2x00dev))
810 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE); 810 tasklet_schedule(&rt2x00dev->rxdone_tasklet);
811 else
812 rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE);
811} 813}
812 814
813static void rt2800pci_autowake_tasklet(unsigned long data) 815static void rt2800pci_autowake_tasklet(unsigned long data)
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 4dd82b0b0520..9649bd0cd718 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -60,14 +60,15 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,
60} 60}
61EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); 61EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read);
62 62
63void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) 63bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
64{ 64{
65 struct data_queue *queue = rt2x00dev->rx; 65 struct data_queue *queue = rt2x00dev->rx;
66 struct queue_entry *entry; 66 struct queue_entry *entry;
67 struct queue_entry_priv_pci *entry_priv; 67 struct queue_entry_priv_pci *entry_priv;
68 struct skb_frame_desc *skbdesc; 68 struct skb_frame_desc *skbdesc;
69 int max_rx = 16;
69 70
70 while (1) { 71 while (--max_rx) {
71 entry = rt2x00queue_get_entry(queue, Q_INDEX); 72 entry = rt2x00queue_get_entry(queue, Q_INDEX);
72 entry_priv = entry->priv_data; 73 entry_priv = entry->priv_data;
73 74
@@ -93,6 +94,8 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
93 */ 94 */
94 rt2x00lib_rxdone(entry); 95 rt2x00lib_rxdone(entry);
95 } 96 }
97
98 return !max_rx;
96} 99}
97EXPORT_SYMBOL_GPL(rt2x00pci_rxdone); 100EXPORT_SYMBOL_GPL(rt2x00pci_rxdone);
98 101
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 746ce8fe8cf4..07961b8b369a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -101,8 +101,11 @@ struct queue_entry_priv_pci {
101/** 101/**
102 * rt2x00pci_rxdone - Handle RX done events 102 * rt2x00pci_rxdone - Handle RX done events
103 * @rt2x00dev: Device pointer, see &struct rt2x00_dev. 103 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
104 *
105 * Returns true if there are still rx frames pending and false if all
106 * pending rx frames were processed.
104 */ 107 */
105void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev); 108bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev);
106 109
107/* 110/*
108 * Device initialization handlers. 111 * Device initialization handlers.
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 77e8113b91e1..8ee1514a7943 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2313,8 +2313,10 @@ static void rt61pci_tbtt_tasklet(unsigned long data)
2313static void rt61pci_rxdone_tasklet(unsigned long data) 2313static void rt61pci_rxdone_tasklet(unsigned long data)
2314{ 2314{
2315 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 2315 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
2316 rt2x00pci_rxdone(rt2x00dev); 2316 if (rt2x00pci_rxdone(rt2x00dev))
2317 rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE); 2317 rt2x00pci_rxdone(rt2x00dev);
2318 else
2319 rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE);
2318} 2320}
2319 2321
2320static void rt61pci_autowake_tasklet(unsigned long data) 2322static void rt61pci_autowake_tasklet(unsigned long data)