Date: Tue, 10 Jun 2003 08:27:30 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: ticso@cicely.de, ticso@cicely12.cicely.de Cc: freebsd-sparc64@freebsd.org Subject: Re: PCI bus numbering and orphaned devices Message-ID: <20030610.082730.102566465.imp@bsdimp.com> In-Reply-To: <20030610121249.GE10527@cicely12.cicely.de> References: <20030609.224621.71095461.imp@bsdimp.com> <20030610115615.GB10527@cicely12.cicely.de> <20030610121249.GE10527@cicely12.cicely.de>
index | next in thread | previous in thread | raw e-mail
In message: <20030610121249.GE10527@cicely12.cicely.de>
Bernd Walter <ticso@cicely12.cicely.de> writes:
: 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.
That's what inspired me. Also, I'd expected that we'd need some kind
of tweaking to make it actually compile and be neat.
Warner
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030610.082730.102566465.imp>
