X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fplip.c;h=1e965427b0e987faae6ae26bfe3d07e1aad8bfa7;hb=a99606d25eb6981e13d332e18774e203ded66709;hp=5071fcd8a0bd18a08cc21b4b7e48a625a971017e;hpb=95b00786f3b8fa99f53931361beeb4c10504ad87;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 5071fcd8a0b..1e965427b0e 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -106,6 +106,7 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" #include #include #include +#include #include #include @@ -114,7 +115,6 @@ static const char version[] = "NET3 PLIP version 2.4-parport gniibe@mri.co.jp\n" #include #include #include -#include /* Maximum number of devices to support. */ #define PLIP_MAX 8 @@ -221,7 +221,7 @@ struct net_local { int should_relinquish; spinlock_t lock; atomic_t kill_timer; - struct semaphore killed_timer_sem; + struct completion killed_timer_cmp; }; static inline void enable_parport_interrupts (struct net_device *dev) @@ -385,7 +385,7 @@ plip_timer_bh(struct work_struct *work) schedule_delayed_work(&nl->timer, 1); } else { - up (&nl->killed_timer_sem); + complete(&nl->killed_timer_cmp); } } @@ -663,7 +663,7 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl, case PLIP_PK_DONE: /* Inform the upper layer for the arrival of a packet. */ rcv->skb->protocol=plip_type_trans(rcv->skb, dev); - netif_rx(rcv->skb); + netif_rx_ni(rcv->skb); dev->last_rx = jiffies; dev->stats.rx_bytes += rcv->length.h; dev->stats.rx_packets++; @@ -903,17 +903,18 @@ plip_interrupt(void *dev_id) struct net_local *nl; struct plip_local *rcv; unsigned char c0; + unsigned long flags; nl = netdev_priv(dev); rcv = &nl->rcv_data; - spin_lock_irq (&nl->lock); + spin_lock_irqsave (&nl->lock, flags); c0 = read_status(dev); if ((c0 & 0xf8) != 0xc0) { if ((dev->irq != -1) && (net_debug > 1)) printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); - spin_unlock_irq (&nl->lock); + spin_unlock_irqrestore (&nl->lock, flags); return; } @@ -942,7 +943,7 @@ plip_interrupt(void *dev_id) break; } - spin_unlock_irq(&nl->lock); + spin_unlock_irqrestore(&nl->lock, flags); } static int @@ -1112,9 +1113,9 @@ plip_close(struct net_device *dev) if (dev->irq == -1) { - init_MUTEX_LOCKED (&nl->killed_timer_sem); + init_completion(&nl->killed_timer_cmp); atomic_set (&nl->kill_timer, 1); - down (&nl->killed_timer_sem); + wait_for_completion(&nl->killed_timer_cmp); } #ifdef NOTDEF @@ -1269,7 +1270,7 @@ static void plip_attach (struct parport *port) nl = netdev_priv(dev); nl->dev = dev; - nl->pardev = parport_register_device(port, name, plip_preempt, + nl->pardev = parport_register_device(port, dev->name, plip_preempt, plip_wakeup, plip_interrupt, 0, dev);