Re: Dummy driver broken in pre-2.0.5

Thomas Bogendoerfer (tsbogend@bigbug.franken.de)
Sun, 19 May 1996 13:29:33 +0200 (MET DST)


> > * Thomas Bogendoerfer : Return ENODEV for dev_open, if there
> > * is no device open function.
>
> Maybe the right fix would have been so specify the abstract device
> layer; either open is optional, or it's required. If it's required,
> the above is OK, and the dummy driver is broken. But it could be the
> other way, too (Hey, we are talking about inheritance in an OO-sense
> here!)

I vote for makeing the open routine mandatory.

The reason, why I've changed the default return value of dev_open,
was a problem with a lance based ethernet card. When the lance driver
is unable to detect irq or dma, it leaves the device structure without
putting an open function in it. This is ok, but the lance driver has
already called ether_setup(), so it's possible to give the device
an IP address. As soon as IP sends a packet to the driver, the kernel
pancis.

If we don't make open mandatory (and undo my change for dev_open()),
we must change some of the ethernet drivers, to avoid the scenario
above.

Thomas.

-- 
That process _deserves_ to die ("My name is Linus Torvalds, prepare to 
die").                                [Linus Torvalds on linux-kernel]