pci probing "fixed" (was Re: PCI bus numbering and orphaned devices)

2003-06-12 Thread John-Mark Gurney
Well, I implemented PCI probing as per the UltraSparc IIi user's manual, and now, I get quite a bit more than I bargined for: bash-2.05b$ pciconf -l | wc 38 2283106 The complete pciconf -l -v is at: http://people.freebsd.org/~jmg/pciconf-lv.sparc64 Now, I seem to be getting duplicat

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Justin T. Gibbs
: > 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 : slo

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> "Justin T. Gibbs" <[EMAIL PROTECTED]> writes: : > I'm thinking that the loop should be more like: : > : > pcifunchigh = 0; : > f = 0; : > hdrtype = REG(PCIR_HEADERTYPE, 1); : > if (hdrtype & 0x7f > 2) : >

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Justin T. Gibbs
+* +* If we don't hardware the bus down, pciconf gets confused. */ if (sc->secbus != 0) { - child = device_add_child(dev, "pci", -1); + child = device_add_child(dev, "pci", sc->secbus); if (child != NULL)

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Justin T. Gibbs
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 s

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Bernd Walter
On Wed, Jun 11, 2003 at 04:26:27PM +0200, Thomas Moestl wrote: > On Tue, 2003/06/10 at 16:41:44 -0700, John-Mark Gurney wrote: > > Ok, the only problem is that is then we have the same problem the ACPI > > code does in that hot swapping cards would have a problem. Since it > > appears to me that t

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Thomas Moestl
On Wed, 2003/06/11 at 08:34:39 -0600, M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > Thomas Moestl <[EMAIL PROTECTED]> writes: > : On Tue, 2003/06/10 at 16:41:44 -0700, John-Mark Gurney wrote: > : > Thomas Moestl wrote this message on Wed, Jun 11, 2003 at 01:02 +0200: > : > O

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Thomas Moestl <[EMAIL PROTECTED]> writes: : On Tue, 2003/06/10 at 16:41:44 -0700, John-Mark Gurney wrote: : > Thomas Moestl wrote this message on Wed, Jun 11, 2003 at 01:02 +0200: : > > On Tue, 2003/06/10 at 15:34:36 -0700, John-Mark Gurney wrote: : > > T

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Thomas Moestl
On Tue, 2003/06/10 at 16:41:44 -0700, John-Mark Gurney wrote: > Thomas Moestl wrote this message on Wed, Jun 11, 2003 at 01:02 +0200: > > On Tue, 2003/06/10 at 15:34:36 -0700, John-Mark Gurney wrote: > > There's a similar problem with hme devices in some Netra models, and > > so far I have just ign

Re: PCI bus numbering and orphaned devices

2003-06-11 Thread Thomas Moestl
On Wed, 2003/06/11 at 01:16:50 +0200, Bernd Walter wrote: > On Tue, Jun 10, 2003 at 03:34:36PM -0700, John-Mark Gurney wrote: > > M. Warner Losh wrote this message on Tue, Jun 10, 2003 at 08:27 -0600: > > > : > > hdrtype = REG(PCIR_HEADERTYPE, 1); > > > : > This needs to be tested on th

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread John-Mark Gurney
Bernd Walter wrote this message on Wed, Jun 11, 2003 at 01:16 +0200: > On Tue, Jun 10, 2003 at 03:34:36PM -0700, John-Mark Gurney wrote: > > So, the question is, does other arch's do something nasty like this > > too? Should I change the check to just do ofw_pci_find_node? Is this > > why pciconf

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread John-Mark Gurney
Thomas Moestl wrote this message on Wed, Jun 11, 2003 at 01:02 +0200: > On Tue, 2003/06/10 at 15:34:36 -0700, John-Mark Gurney wrote: > > > > Ok, attached is a patched I tried, > > Hmmm, you seem to have forgotten to actually attach it. Ok, this time I'll attach it! > > but sad to say, this doe

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread Bernd Walter
On Tue, Jun 10, 2003 at 03:34:36PM -0700, John-Mark Gurney wrote: > M. Warner Losh wrote this message on Tue, Jun 10, 2003 at 08:27 -0600: > > : > > hdrtype = REG(PCIR_HEADERTYPE, 1); > > : > This needs to be tested on that given hardware. > > : > I don't know if REG will work as expe

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread Thomas Moestl
On Tue, 2003/06/10 at 15:34:36 -0700, John-Mark Gurney wrote: > M. Warner Losh wrote this message on Tue, Jun 10, 2003 at 08:27 -0600: > > : > > hdrtype = REG(PCIR_HEADERTYPE, 1); > > : > This needs to be tested on that given hardware. > > : > I don't know if REG will work as expected

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread John-Mark Gurney
M. Warner Losh wrote this message on Tue, Jun 10, 2003 at 08:27 -0600: > : > > hdrtype = REG(PCIR_HEADERTYPE, 1); > : > 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

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Bernd Walter <[EMAIL PROTECTED]> 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: : > > : > > pcifu

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread Bernd Walter
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); > >

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread Bernd Walter
On Mon, Jun 09, 2003 at 10:46:21PM -0600, M. Warner Losh wrote: > In message: <[EMAIL PROTECTED]> > John-Mark Gurney <[EMAIL PROTECTED]> writes: > : > > +#ifdef __sparc64__ > : > > + /* > : > > +* XXX - some sparc hardware has valid hardware when the > : >

Re: PCI bus numbering and orphaned devices

2003-06-10 Thread Thomas Moestl
On Mon, 2003/06/09 at 16:58:38 -0700, John-Mark Gurney wrote: > Hello, > > I've recently started work on making FreeBSD work better on a sparc64 > box that a friend has. It's a Netra AX1105-500 (UltraSPARC-IIe 500MHz). > > So far I have found out that the pci bus numbering has problems. We > do

Re: PCI bus numbering and orphaned devices

2003-06-09 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Bernd Walter <[EMAIL PROTECTED]> writes: : On Mon, Jun 09, 2003 at 04:58:38PM -0700, John-Mark Gurney wrote: : > Hello, : > : > I've recently started work on making FreeBSD work better on a sparc64 : > box that a friend has. It's a Netra AX1105-500 (Ult

Re: PCI bus numbering and orphaned devices

2003-06-09 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> John-Mark Gurney <[EMAIL PROTECTED]> writes: : > > +#ifdef __sparc64__ : > > + /* : > > + * XXX - some sparc hardware has valid hardware when the : > > + * function 0 doesn't probe. Scan all functions. : > > + */ : > >

Re: PCI bus numbering and orphaned devices

2003-06-09 Thread John-Mark Gurney
Bernd Walter scribbled this message on Jun 10: > On Mon, Jun 09, 2003 at 04:58:38PM -0700, John-Mark Gurney wrote: > > +#ifdef __sparc64__ > > + /* > > +* XXX - some sparc hardware has valid hardware when the > > +* function 0 doesn't probe. Scan all functions. >

Re: PCI bus numbering and orphaned devices

2003-06-09 Thread Bernd Walter
On Mon, Jun 09, 2003 at 04:58:38PM -0700, John-Mark Gurney wrote: > Hello, > > I've recently started work on making FreeBSD work better on a sparc64 > box that a friend has. It's a Netra AX1105-500 (UltraSPARC-IIe 500MHz). > > So far I have found out that the pci bus numbering has problems. We

PCI bus numbering and orphaned devices

2003-06-09 Thread John-Mark Gurney
Hello, I've recently started work on making FreeBSD work better on a sparc64 box that a friend has. It's a Netra AX1105-500 (UltraSPARC-IIe 500MHz). So far I have found out that the pci bus numbering has problems. We don't attach pci busses as they are numbered in the bridge/OFW info. This caus