Date: Wed, 3 Oct 2007 15:18:53 +0200 From: Marius Strobl <marius@alchemy.franken.de> To: Stefan =?unknown-8bit?Q?E=DFer?= <se@FreeBSD.org>, John Baldwin <jhb@FreeBSD.org>, Marcel Moolenaar <xcllnt@mac.com>, Michael Butler <imb@protected-networks.net>, current@FreeBSD.org Subject: Re: Patch for review (was: Re: Proposal to revise the new parsing of PCI selectors (was: Re: HEADS UP: [cvs commit: src UPDATING src/share/man/man4 pci.4?src/share/man/man9 pci.9?src/sys/amd64/include?legacyvar.h?src/sys/amd64/amd64 legacy.c?src/sys/amd64/pci pci_bus.c?src/sys/arm/xscale/i80321?i80321_pci.c src/sys/arm/xscale/ixp425 ...)) Message-ID: <20071003131853.GE98412@alchemy.franken.de> In-Reply-To: <20071003105357.GA27749@Gatekeeper.FreeBSD.org> References: <20070930114914.GB38896@alchemy.franken.de> <4700ECC8.4090702@FreeBSD.org> <20071001132548.GE55741@alchemy.franken.de> <200710011420.31077.jhb@freebsd.org> <20071003105357.GA27749@Gatekeeper.FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 03, 2007 at 12:53:57PM +0200, Stefan Eer wrote: > On 2007-10-01 14:20 -0400, John Baldwin <jhb@freebsd.org> wrote: > > On Monday 01 October 2007 09:25:48 am Marius Strobl wrote: > > > On Mon, Oct 01, 2007 at 02:49:12PM +0200, Stefan Esser wrote: > > > > Well, since it was me who chose to parse it that way, when pciconf > > > > saw the light of day, I can say that the logical extension appears > > > > to be the support of 3 formats for the PCI device selector: > > > > > > > > pci1:2:3:4 (full, domain/bus/slot/function, required if domain!=0) > > > > pci2:3:4 (abridged, in case the domain is "0") > > > > pci2:3 (abridged, in case the domain and function are "0") > > > > > > I'm ok with what you propose, I'd wait for John to comment > > > whether he sees any issues regarding the hints feature he is > > > working on though. > > > > This sounds good to me. > > Ok, I've tested the following patch, which also restores a feature > of the original code, when it was not clear, whether the separator > character was supposed to be ":" or "." (i.e., the new version does > accept both ":" and "." as separator). This would allow to use the > same selectors (with ".") in pciconf and the hints file ... > > I'd of course be willing to commit both changes separately (first > the parsing of selectors with 2, 3 or 4 elements, then equivalence > of ":" and "." as separators). > > The code wrapped in "#if 0" is not to be committed, I've included > it just in case anybody wants to perform some tests and to check > the parsing results. > > Regards, STefan > > > > Index: usr.sbin/pciconf/pciconf.c > =================================================================== > RCS file: /usr/cvs/src/usr.sbin/pciconf/pciconf.c,v > retrieving revision 1.28 > diff -u -3 -r1.28 pciconf.c > --- usr.sbin/pciconf/pciconf.c 30 Sep 2007 11:05:17 -0000 1.28 > +++ usr.sbin/pciconf/pciconf.c 3 Oct 2007 10:33:03 -0000 > @@ -486,6 +486,8 @@ > char *ep = strchr(str, '@'); > char *epbase; > struct pcisel sel; > + u_int8_t selarr[4]; > + int i; > Generally looks good. Note that the domain in theory can be a 32-bit value (chosen based on what the old alpha hose code used; Linux seems to limit it to 16-bit) though. Marius
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071003131853.GE98412>