From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 6 17:58:23 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 9CC9B37B401 for ; Wed, 6 Aug 2003 17:58:23 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7A6C43F93 for ; Wed, 6 Aug 2003 17:58:21 -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 h770wEaK002303 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 7 Aug 2003 02:58:17 +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 h770wDAx047772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Aug 2003 02:58:13 +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 h770wCNS038121; Thu, 7 Aug 2003 02:58:12 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h770wBGA038120; Thu, 7 Aug 2003 02:58:11 +0200 (CEST) Date: Thu, 7 Aug 2003 02:58:11 +0200 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20030807005810.GG35859@cicely12.cicely.de> References: <20030806110013.GE32228@cicely12.cicely.de> <20030806.175257.106532450.imp@bsdimp.com> <20030807001244.GF35859@cicely12.cicely.de> <20030806.183710.132444148.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030806.183710.132444148.imp@bsdimp.com> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-CURRENT alpha User-Agent: Mutt/1.5.4i cc: ticso@cicely12.cicely.de cc: freebsd-hackers@freebsd.org cc: phk@phk.freebsd.dk 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: Thu, 07 Aug 2003 00:58:23 -0000 On Wed, Aug 06, 2003 at 06:37:10PM -0600, M. Warner Losh wrote: > In message: <20030807001244.GF35859@cicely12.cicely.de> > Bernd Walter writes: > : On Wed, Aug 06, 2003 at 05:52:57PM -0600, M. Warner Losh wrote: > : > In message: <20030806110013.GE32228@cicely12.cicely.de> > : > Bernd Walter writes: > : > : Back to the original question: > : > : How do I get the device_t from nexus? > : > > : > You don't. You are assigned one. > : > > : > : Is there a get_nexus() function somewhere? > : > > : > No. You don't need it. > : > > : > Chances are you could create an identify routine that would attach the > : > bus to. The identify routine should be all you need. > : > : The point is that this special CPU can only be identified by its > : host bridge. > : That's the place were the MMCR bus has to be attached to nexus, so > : we need the handle within this function. > > Then why not just hang the bus off the host bridge? There's really no > compelling reason to have it on the nexus. The host bridge is not available yet at probing time of the host bridge. What we have is the host bridges parent (nexus) in the calling function. Either we hand out the parents device_t to nexus_pcib_is_host_bridge, or we find it out later. I thought it would be cleaner to not extend nexus_pcib_is_host_bridge arguments for a specialised case. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de