aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-04-12 16:26:40 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-27 22:21:16 -0400
commitea9375607f8b312cf4389d68909330ed32a622ef (patch)
tree20a508ac2a259790095668450e47d7d2e935e891 /drivers/net
parent8de901150f3c58b019b2a3ce497d23ab662dbb8b (diff)
[PATCH] smc91x: more tweaks to help with RX overruns
Signed-off-by: Nicolas Pitre <nico@cam.org> Index: linux-2.6/drivers/net/smc91x.c ===================================================================
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/smc91x.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index a6c0628fdb21..fd80048f7f7a 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -129,7 +129,7 @@ MODULE_PARM_DESC(nowait, "set to 1 for no wait state");
129/* 129/*
130 * Transmit timeout, default 5 seconds. 130 * Transmit timeout, default 5 seconds.
131 */ 131 */
132static int watchdog = 5000; 132static int watchdog = 1000;
133module_param(watchdog, int, 0400); 133module_param(watchdog, int, 0400);
134MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds"); 134MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
135 135
@@ -660,15 +660,14 @@ static void smc_hardware_send_pkt(unsigned long data)
660 SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG); 660 SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG);
661 661
662 /* 662 /*
663 * If THROTTLE_TX_PKTS is set, we look at the TX_EMPTY flag 663 * If THROTTLE_TX_PKTS is set, we stop the queue here. This will
664 * before queueing this packet for TX, and if it's clear then 664 * have the effect of having at most one packet queued for TX
665 * we stop the queue here. This will have the effect of 665 * in the chip's memory at all time.
666 * having at most 2 packets queued for TX in the chip's memory 666 *
667 * at all time. If THROTTLE_TX_PKTS is not set then the queue 667 * If THROTTLE_TX_PKTS is not set then the queue is stopped only
668 * is stopped only when memory allocation (MC_ALLOC) does not 668 * when memory allocation (MC_ALLOC) does not succeed right away.
669 * succeed right away.
670 */ 669 */
671 if (THROTTLE_TX_PKTS && !(SMC_GET_INT() & IM_TX_EMPTY_INT)) 670 if (THROTTLE_TX_PKTS)
672 netif_stop_queue(dev); 671 netif_stop_queue(dev);
673 672
674 /* queue the packet for TX */ 673 /* queue the packet for TX */
@@ -1311,15 +1310,16 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1311 if (!status) 1310 if (!status)
1312 break; 1311 break;
1313 1312
1314 if (status & IM_RCV_INT) { 1313 if (status & IM_TX_INT) {
1315 DBG(3, "%s: RX irq\n", dev->name); 1314 /* do this before RX as it will free memory quickly */
1316 smc_rcv(dev);
1317 } else if (status & IM_TX_INT) {
1318 DBG(3, "%s: TX int\n", dev->name); 1315 DBG(3, "%s: TX int\n", dev->name);
1319 smc_tx(dev); 1316 smc_tx(dev);
1320 SMC_ACK_INT(IM_TX_INT); 1317 SMC_ACK_INT(IM_TX_INT);
1321 if (THROTTLE_TX_PKTS) 1318 if (THROTTLE_TX_PKTS)
1322 netif_wake_queue(dev); 1319 netif_wake_queue(dev);
1320 } else if (status & IM_RCV_INT) {
1321 DBG(3, "%s: RX irq\n", dev->name);
1322 smc_rcv(dev);
1323 } else if (status & IM_ALLOC_INT) { 1323 } else if (status & IM_ALLOC_INT) {
1324 DBG(3, "%s: Allocation irq\n", dev->name); 1324 DBG(3, "%s: Allocation irq\n", dev->name);
1325 tasklet_hi_schedule(&lp->tx_task); 1325 tasklet_hi_schedule(&lp->tx_task);