Date: Wed, 11 Jun 2003 15:45:31 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: gibbs@scsiguy.com Cc: freebsd-sparc64@freebsd.org Subject: Re: PCI bus numbering and orphaned devices Message-ID: <20030611.154531.59692646.imp@bsdimp.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <361340000.1055367125@caspian.scsiguy.com> "Justin T. Gibbs" <gibbs@scsiguy.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030611.154531.59692646.imp>