aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c589_cs.c
diff options
context:
space:
mode:
authorKomuro <komurojun-mbn@nifty.com>2006-12-01 21:53:27 -0500
committerJeff Garzik <jeff@garzik.org>2007-01-23 00:19:12 -0500
commitd08d283974f96cb30d78ba24282a0a7d6709af32 (patch)
treeda3db84b381da3bdf7e7c1594dbd48dc151131b0 /drivers/net/pcmcia/3c589_cs.c
parent2596627c5c30b45aa206b7b1b864bf00de3c3503 (diff)
modify 3c589_cs to be SMP safe
1. EL3WINDOW is always 1 when lock is not held. 2. The second argument of el3_interrupt is 'void *dev_id', not 'struct el3_private *lp'. Signed-off-by: komurojun-mbn@nifty.com Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/pcmcia/3c589_cs.c')
-rw-r--r--drivers/net/pcmcia/3c589_cs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 342f4062de0b..461e8274ef69 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -606,11 +606,14 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
606{ 606{
607 kio_addr_t ioaddr = dev->base_addr; 607 kio_addr_t ioaddr = dev->base_addr;
608 struct el3_private *priv = netdev_priv(dev); 608 struct el3_private *priv = netdev_priv(dev);
609 unsigned long flags;
609 610
610 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " 611 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, "
611 "status %4.4x.\n", dev->name, (long)skb->len, 612 "status %4.4x.\n", dev->name, (long)skb->len,
612 inw(ioaddr + EL3_STATUS)); 613 inw(ioaddr + EL3_STATUS));
613 614
615 spin_lock_irqsave(&priv->lock, flags);
616
614 priv->stats.tx_bytes += skb->len; 617 priv->stats.tx_bytes += skb->len;
615 618
616 /* Put out the doubleword header... */ 619 /* Put out the doubleword header... */
@@ -628,6 +631,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
628 631
629 dev_kfree_skb(skb); 632 dev_kfree_skb(skb);
630 pop_tx_status(dev); 633 pop_tx_status(dev);
634 spin_unlock_irqrestore(&priv->lock, flags);
631 635
632 return 0; 636 return 0;
633} 637}
@@ -729,14 +733,13 @@ static void media_check(unsigned long arg)
729 733
730 if (!netif_device_present(dev)) goto reschedule; 734 if (!netif_device_present(dev)) goto reschedule;
731 735
732 EL3WINDOW(1);
733 /* Check for pending interrupt with expired latency timer: with 736 /* Check for pending interrupt with expired latency timer: with
734 this, we can limp along even if the interrupt is blocked */ 737 this, we can limp along even if the interrupt is blocked */
735 if ((inw(ioaddr + EL3_STATUS) & IntLatch) && 738 if ((inw(ioaddr + EL3_STATUS) & IntLatch) &&
736 (inb(ioaddr + EL3_TIMER) == 0xff)) { 739 (inb(ioaddr + EL3_TIMER) == 0xff)) {
737 if (!lp->fast_poll) 740 if (!lp->fast_poll)
738 printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); 741 printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name);
739 el3_interrupt(dev->irq, lp); 742 el3_interrupt(dev->irq, dev);
740 lp->fast_poll = HZ; 743 lp->fast_poll = HZ;
741 } 744 }
742 if (lp->fast_poll) { 745 if (lp->fast_poll) {