From owner-freebsd-current@FreeBSD.ORG Mon Jun 9 21:09:35 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 AB33537B401; Mon, 9 Jun 2003 21:09:35 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6FD343F75; Mon, 9 Jun 2003 21:09:34 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h5A4f4vm023398; Tue, 10 Jun 2003 00:41:05 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h5A49Jhv097072; Mon, 9 Jun 2003 21:09:19 -0700 (PDT) (envelope-from jmg) Message-ID: <20030609210919.33379@hydrogen.funkthat.com> Date: Mon, 9 Jun 2003 21:09:19 -0700 From: John-Mark Gurney To: ticso@cicely.de References: <20030609165838.32044@hydrogen.funkthat.com> <20030610022706.GI509@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: <20030610022706.GI509@cicely12.cicely.de>; from Bernd Walter on Tue, Jun 10, 2003 at 04:27:07AM +0200 Organization: Cu Networking X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-current@freebsd.org cc: imp@freebsd.org 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 Reply-To: John-Mark Gurney 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 04:09:36 -0000 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. > > + */ > > + pcifunchigh = PCI_FUNCMAX; > > +#else > > pcifunchigh = 0; > > +#endif > > for (f = 0; f <= pcifunchigh; f++) { > > dinfo = pci_read_device(pcib, busno, s, f, dinfo_size); > > if (dinfo != NULL) { > > This is problematic as it ignores the fact about single function > devices which may react to all function numbers. Wouldn't this happen with the current logic? since if function 0 is found, it scans the rest... (Might be getting confused with SCSI buses). > What about reverting the logic: > Initialy set pcifunchigh = PCI_FUNCMAX and set pcifunchigh = 0 in case > we catched a single function device. > I don't think it should be sparc specific. Actually, I was thinking that we could check to see if the next word is not -1. The chip responds to the rest of the registers, but just doesn't respond to the DEVVENDOR (first word). So, if we check if the first function's first word returns -1, check the second word, and if that is not -1, then probe all the rest of the functions. -bash-2.05b$ pciconf -r pci1:5:0 0x0:0x4 ffffffff 02800002 I'm also thinking of adding support code to the pci bus to let the userland add a new device node to be probed. It shouldn't be too hard, but would be help in these cases. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."