Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2003 15:34:01 -0400
From:      Eric Jacobs <eaja@erols.com>
To:        ticso@cicely.de
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to get a device_t
Message-ID:  <20030806153401.79a57974.eaja@erols.com>
In-Reply-To: <20030806110013.GE32228@cicely12.cicely.de>
References:  <20030806104001.GD32228@cicely12.cicely.de> <40470.1060166743@critter.freebsd.dk> <20030806110013.GE32228@cicely12.cicely.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 6 Aug 2003 13:00:13 +0200
Bernd Walter <ticso@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.

Eric



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030806153401.79a57974.eaja>