How to get a device_t
Bernd Walter
ticso at cicely12.cicely.de
Wed Aug 6 08:51:48 PDT 2003
On Wed, Aug 06, 2003 at 03:34:01PM -0400, Eric Jacobs wrote:
> On Wed, 6 Aug 2003 13:00:13 +0200
> Bernd Walter <ticso at cicely12.cicely.de> wrote:
>
> >
> > Back to the original question:
> > How do I get the device_t from nexus?
> > Is there a get_nexus() function somewhere?
>
> You can do it this way:
>
> devclass_t nexusdc = devclass_find("nexus");
> device_t nexus = devclass_get_device(nexusdc, 0);
>
> It is in fact in the code path as "parent" in nexus_pcib_identify,
> but not in the special PCI bridge identification function. If you
> call BUS_ADD_CHILD at that time, you don't need to probe or attach
> your device; it will be automatically probed and attached later and
> you can whatever logic you want in your probe and attach routines.
Thank you - I think that were they key parts missing.
--
B.Walter BWCT http://www.bwct.de
ticso at bwct.de info at bwct.de
More information about the freebsd-hackers
mailing list