From owner-freebsd-current@FreeBSD.ORG Wed Jun 11 14:49:08 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 25C7A37B408; Wed, 11 Jun 2003 14:49:08 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C63043F93; Wed, 11 Jun 2003 14:49:05 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h5BLlAkA024200; Wed, 11 Jun 2003 15:47:13 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 11 Jun 2003 15:45:31 -0600 (MDT) Message-Id: <20030611.154531.59692646.imp@bsdimp.com> To: gibbs@scsiguy.com From: "M. Warner Losh" In-Reply-To: <361340000.1055367125@caspian.scsiguy.com> References: <20030609210919.33379@hydrogen.funkthat.com> <20030609.224621.71095461.imp@bsdimp.com> <361340000.1055367125@caspian.scsiguy.com> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: gurney_j@resnet.uoregon.edu cc: freebsd-current@freebsd.org cc: gurney_j@efn.org cc: ticso@cicely.de cc: freebsd-sparc64@freebsd.org Subject: Re: PCI bus numbering and orphaned devices X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2003 21:49:10 -0000 In message: <361340000.1055367125@caspian.scsiguy.com> "Justin T. Gibbs" writes: : > I'm thinking that the loop should be more like: : > : > pcifunchigh = 0; : > f = 0; : > hdrtype = REG(PCIR_HEADERTYPE, 1); : > if (hdrtype & 0x7f > 2) : > continue; : : My only complaint about this is that if no device is present in the : slot, won't you just get all bits set in whatever you read? If so, : the headertype check should be better bounded. hdrtype would be 0xff. 0xff & 0x7f is 0x7f, which is greater than 2. What would the problem be? The only valid header types are 0, 1, and 2 (at least the only ones that we understand). Technically, if it is a header type we don't know, we're supposed to disable the device in the command register too. Warner