Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Oct 1999 21:00:29 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Warner Losh <imp@village.org>
Cc:        new-bus@freebsd.org
Subject:   Re: Asking the musical question...
Message-ID:  <Pine.BSF.4.10.9910142057000.306-100000@salmon.nlsystems.com>
In-Reply-To: <199910141930.NAA54711@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 Oct 1999, Warner Losh wrote:

> 
> Is there some way for a bus to ask "Is there a driver named foo that
> can that has a barbus attachment?"

Not right now. There should be a devclass_get_drivers() function at least
but there isn't. What I actually want is a decent set of iterators for the
newbus objects, particularly for the device tree. An iterator with an
optional filter function would be extremely handy for device searches.

> 
> Taking a step back, I'm trying to add a child to an instance of the
> pccard bus (there may be several in a system).  I know that it is
> named fdc or sio or whatever.  Do I just add a child with
> device_add_child(dev, NULL, -1, cisinfo) and let probing somehow
> magically take care of it (this was cribbed from pci.c)?  Or is there
> some other approved way of coping?  If it makes more sense to answer
> this question, please do so and ignore the first one :-)

Assuming the drivers have a way of recognising the device instance as one
of their own (e.g. by checking PnP IDs for isa), this is the best way to
do it. For 'unnamed' devices, the system presents the device to all
drivers in the parent's devclass and chooses the one which returns the
highest probe value. If the device is named (e.g. "sio") it will only be
presented to drivers whose name matches.

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




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-new-bus" 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.10.9910142057000.306-100000>