Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jun 1999 10:16:05 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Bill Paul <wpaul@freebsd.org>
Cc:        Peter Wemm <peter@freebsd.org>, cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/isa sio.c
Message-ID:  <Pine.BSF.4.05.9906211013410.80685-100000@herring.nlsystems.com>
In-Reply-To: <19990620184802.D11BF14C17@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 20 Jun 1999, Bill Paul wrote:

> > On Sun, 20 Jun 1999, Peter Wemm wrote:
> > 
> > > peter       1999/06/20 06:10:11 PDT
> > > 
> > >   Modified files:
> > >     sys/isa              sio.c 
> > >   Log:
> > >   Use the proper interfaces to find if a device is enabled, don't dig into
> > >   the bus mechanism's private internals!
> > 
> > Well spotted. For future reference, bus_private.h may not be included by
> > any drivers. Any driver which includes this header should be considered
> > broken.
> 
> Granted an individual driver shouldn't be sticking its grubby mits
> in struct device_t, but what about code to implement a custom bus?
> When I was experimenting with the miibus stuff, I decided I needed to
> enumerate the children of the miibus devclass manually and check the
> return values of their probe routines so that I could prioritize
> them (which subr_bus won't let me do). This requires bus_private.h.
> My plan was to provide routine in sys/dev/miibus/miibus.c to do
> this so that I wouldn't need to grope around struct device_t in any
> drivers though.

There is an api device_get_children() which returns all the kids in an
array (which must be freed). Since this is a bit clumsy, I hope to provide
some other ways of enumerating the children, perhaps feeding them to a
callback function. It would be helpful to know what you need when
enumerating.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9906211013410.80685-100000>