Subject: Re: Allowing ether_ifattach() to fail
To: Lennart Augustsson <lennart@augustsson.net>
From: David Brownlee <abs@netbsd.org>
List: tech-net
Date: 05/24/2000 13:51:00
On Wed, 24 May 2000, Lennart Augustsson wrote:

> John Hawkinson wrote:
> 
> > I'd like to allow ether_ifattach() to fail (and return failure).
> 
> > Careful examination of a bunch of drivers shows that they don't deal
> > very well with the case of *_attach() failing.
> 
> I would like to see a change in the config machinery so that
> *_attach() can fail, which would then stop the device from being
> accessible. As it is each driver (where attach can fail) needs to have
> a flag indicating if it is really working.  Ideally, an attach should
> never fail, but unfortunately that's now how the world works.  A
> device can stop working at any time, even during attach.
> 
> My proposed change is rather large.  Each device driver needs to be
> modified, but in a very simple way.  Just change the return type to
> `int' and add a `return 0'.

	Presumably this would also allow for some of the panic()s at
	attach time to be changed to simple failures to attach?

	Sounds like a very good plan...

		David/absolute
				       -- www.netbsd.org: No hype required --