From owner-freebsd-current@FreeBSD.ORG Tue Jun 10 05:13:03 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BB3437B401; Tue, 10 Jun 2003 05:13:03 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FA3543F85; Tue, 10 Jun 2003 05:13:02 -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]) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h5ACCrTh050627 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 10 Jun 2003 14:12:55 +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 h5ACCpOs060249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Jun 2003 14:12:51 +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 h5ACCp9F010806; Tue, 10 Jun 2003 14:12:51 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.9/8.12.9/Submit) id h5ACCo4T010805; Tue, 10 Jun 2003 14:12:50 +0200 (CEST) Date: Tue, 10 Jun 2003 14:12:50 +0200 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20030610121249.GE10527@cicely12.cicely.de> References: <20030609165838.32044@hydrogen.funkthat.com> <20030610022706.GI509@cicely12.cicely.de> <20030609210919.33379@hydrogen.funkthat.com> <20030609.224621.71095461.imp@bsdimp.com> <20030610115615.GB10527@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030610115615.GB10527@cicely12.cicely.de> X-Operating-System: FreeBSD cicely12.cicely.de 5.1-RELEASE alpha User-Agent: Mutt/1.5.4i cc: gurney_j@resnet.uoregon.edu cc: freebsd-current@freebsd.org cc: gurney_j@efn.org cc: freebsd-sparc64@freebsd.org cc: ticso@cicely.de Subject: Re: PCI bus numbering and orphaned devices X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2003 12:13:03 -0000 On Tue, Jun 10, 2003 at 01:56:15PM +0200, Bernd Walter wrote: > On Mon, Jun 09, 2003 at 10:46:21PM -0600, M. Warner Losh wrote: > > I'm thinking that the loop should be more like: > > > > pcifunchigh = 0; > > f = 0; > > hdrtype = REG(PCIR_HEADERTYPE, 1); > > if (hdrtype & 0x7f > 2) > > continue; > > if (hdrtype & 0x80) > s/0x80/PCIM_MFDEV/ > Maybe we should add a PCIM_REGLAYOUT as well. > > > pcifunchigh = PCI_FUNCMAX; > > for (f = 0; f <= pcifunchigh; f++) { > > dinfo = pci_read_device(pcib, busno, s, f, dinfo_size); > > if (dinfo != NULL) > > pci_add_child(dev, dinfo); > > } > > > > might be better code (REG likely needs to be correctly defined for > > this context). > > This needs to be tested on that given hardware. > I don't know if REG will work as expected because it asks function 0, > which is disabled. I've reread John-Mark's last mail about the readable registers. So - yes it should work. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de