Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Dec 2007 14:12:17 -0800
From:      Marcel Moolenaar <marcelm@juniper.net>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        embedded@FreeBSD.org
Subject:   Re: ocpbus(4)
Message-ID:  <1EDE7CF9-586A-41CE-9B05-1E4A6431653D@juniper.net>
In-Reply-To: <20071228.134154.1136083975.imp@bsdimp.com>
References:  <B5E9CBD1-0F16-422C-9AFA-CC33D988630C@juniper.net> <20071228.125020.-1962668065.imp@bsdimp.com> <595F307F-8FC5-48D5-A69C-84660A768F23@juniper.net> <20071228.134154.1136083975.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Dec 28, 2007, at 12:41 PM, M. Warner Losh wrote:

> : > FreeBSD has two models for device enumeration.  One is where the
> : > parent bus decides, by whatever means, and one where the device  
> itself
> : > has enough information to allow the driver to decide.  I think  
> that
> : > trying to shoe-horn the second model into a situation where the  
> first
> : > model is actually better would be a disservice.
> :
> : When would the first be better?
>
> When there's no information about the children in the children.

When is there information about the children in the children?

Put differently: the only thing a PCI device driver knows is
that if the vendor is X and the device is Y, it can be used
with this driver. That's circumstantial. The same kind of
circumstantial information can be synthesized for any and all
busses that need external enumeration. It's merely a way of
consuming the information. I propose that device drivers are
the ultimate authority on wether they attach or not. Not the
busses.

> Unlike PCI, in this domain these devices don't have a device ID.

True. We synthesize IDs for drivers to match against. Those IDs
have nothing to do with hardware. It's just an agreement between
the abstract bus driver and the device driver so that the bus
knows how to flag a child for use by said driver. It's just an
indirection.

> With an enumeration like you suggest, one would need to create an
> enumeration for each and every one of these things, compile it into
> the kernel and then have some kind of translation layer that we get
> for free today with newbus and bus_enumerate_hinted_bus().

I think you misunderstand the concept.

-- 
Marcel Moolenaar
marcelm@juniper.net






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1EDE7CF9-586A-41CE-9B05-1E4A6431653D>