X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fplip.c;h=1e965427b0e987faae6ae26bfe3d07e1aad8bfa7;hb=57f8f7b60db6f1ed2c6918ab9230c4623a9dbe37;hp=b5e9981d10605a57d53817fa8cfb3ee7b257146e;hpb=c4ec20717313daafba59225f812db89595952b83;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/plip.c b/drivers/net/plip.c index b5e9981d106..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 @@ -143,7 +143,7 @@ static void plip_bh(struct work_struct *work); static void plip_timer_bh(struct work_struct *work); /* Interrupt handler */ -static void plip_interrupt(int irq, void *dev_id); +static void plip_interrupt(void *dev_id); /* Functions for DEV methods */ static int plip_tx_packet(struct sk_buff *skb, struct net_device *dev); @@ -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) @@ -380,12 +380,12 @@ plip_timer_bh(struct work_struct *work) container_of(work, struct net_local, timer.work); if (!(atomic_read (&nl->kill_timer))) { - plip_interrupt (-1, nl->dev); + plip_interrupt (nl->dev); 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++; @@ -897,23 +897,24 @@ plip_error(struct net_device *dev, struct net_local *nl, /* Handle the parallel port interrupts. */ static void -plip_interrupt(int irq, void *dev_id) +plip_interrupt(void *dev_id) { struct net_device *dev = 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(int irq, 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);