parport_share.c

NIIBE Yutaka (gniibe@mri.co.jp)
Sat, 8 Nov 1997 14:26:28 +0900


Hello,

>From 2.1.60, PLIP does not work. It's because of the clean up of
irq2dev_map. Specifically, plip_interrupt is invoked with 2nd
argument as "struct parport *", while it expects "struct device *".

Reading lp.c, it seems for me that changing plip.c is the right
solution, like:
==============================
--- plip.c~ Wed Nov 5 14:10:03 1997
+++ plip.c Sat Nov 8 05:18:57 1997
@@ -797,7 +797,9 @@
static void
plip_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
- struct device *dev = dev_id;
+ struct parport *pb = (struct parport *) dev_id;
+ struct pardevice *pd = pb->cad;
+ struct device *dev = (struct device *)pd->private;
struct net_local *nl;
struct plip_local *rcv;
unsigned char c0;
==============================

However, considering the consistency among other network drivers and
reading parport_share.c, I think that the intention of the field
private in struct pardevice was:
==============================
--- parport_share.c~ Tue Sep 16 19:22:45 1997
+++ parport_share.c Sat Nov 8 05:04:49 1997
@@ -279,7 +279,7 @@
free_irq(dev->port->irq, dev->port);
request_irq(dev->port->irq, dev->irq_func ? dev->irq_func :
parport_null_intr_func, SA_INTERRUPT, dev->name,
- dev->port);
+ dev->private);
}

/* Restore control registers */
@@ -306,7 +306,7 @@
if (dev->port->irq >= 0) {
free_irq(dev->port->irq, dev->port);
request_irq(dev->port->irq, parport_null_intr_func,
- SA_INTERRUPT, dev->port->name, dev->port);
+ SA_INTERRUPT, dev->port->name, dev->private);
}

/* Walk the list, offering a wakeup callback to everybody other
==============================
Wasn't it?

Please change plip.c or (parport_share.c and lp.c). Thanks.

--