From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 08:51:48 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 76E6A37B401 for ; Wed, 6 Aug 2003 08:51:48 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39A6843F85 for ; Wed, 6 Aug 2003 08:51:47 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h76FpYaK094229 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 6 Aug 2003 17:51:37 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.9/8.12.9) with ESMTP id h76FpXAx044917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Aug 2003 17:51:33 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.9/8.12.9) with ESMTP id h76FpWNS036313; Wed, 6 Aug 2003 17:51:32 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h76FpWAJ036312; Wed, 6 Aug 2003 17:51:32 +0200 (CEST) Date: Wed, 6 Aug 2003 17:51:31 +0200 From: Bernd Walter To: Eric Jacobs Message-ID: <20030806155131.GD35859@cicely12.cicely.de> References: <20030806104001.GD32228@cicely12.cicely.de> <40470.1060166743@critter.freebsd.dk> <20030806110013.GE32228@cicely12.cicely.de> <20030806153401.79a57974.eaja@erols.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030806153401.79a57974.eaja@erols.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: How to get a device_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 15:51:48 -0000 On Wed, Aug 06, 2003 at 03:34:01PM -0400, Eric Jacobs wrote: > On Wed, 6 Aug 2003 13:00:13 +0200 > Bernd Walter 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@bwct.de info@bwct.de