From owner-freebsd-current@FreeBSD.ORG Mon Oct 1 13:18:45 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3792016A473 for ; Mon, 1 Oct 2007 13:18:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from spacemail1-out.mgmt.space.net (spacemail1-out.mgmt.Space.Net [194.97.149.146]) by mx1.freebsd.org (Postfix) with ESMTP id A463A13C48E for ; Mon, 1 Oct 2007 13:18:44 +0000 (UTC) (envelope-from se@FreeBSD.org) X-SpaceNet-SBRS: None X-IronPort-AV: E=Sophos;i="4.21,216,1188770400"; d="scan'208";a="62538917" Received: from mail.atsec.com ([195.30.252.105]) by spacemail1-out.mgmt.space.net with ESMTP; 01 Oct 2007 14:49:14 +0200 Received: from [10.2.2.88] (frueh.atsec.com [217.110.13.170]) (Authenticated sender: se@atsec.com) by mail.atsec.com (Postfix) with ESMTP id CE64B720902; Mon, 1 Oct 2007 14:49:13 +0200 (CEST) Message-ID: <4700ECC8.4090702@FreeBSD.org> Date: Mon, 01 Oct 2007 14:49:12 +0200 From: Stefan Esser User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Marius Strobl References: <20070930114914.GB38896@alchemy.franken.de> <47001D02.4080700@protected-networks.net> <20070930221748.GC55741@alchemy.franken.de> <0FE79DBF-2E3B-4785-B192-666E02BFFB6D@mac.com> <20070930231620.GD55741@alchemy.franken.de> In-Reply-To: <20070930231620.GD55741@alchemy.franken.de> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcel Moolenaar , Michael Butler , current@freebsd.org Subject: 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 ...) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2007 13:18:45 -0000 Marius Strobl wrote: > On Sun, Sep 30, 2007 at 03:34:57PM -0700, Marcel Moolenaar wrote: >> On Sep 30, 2007, at 3:17 PM, Marius Strobl wrote: >> >>>> Where it would previously succeed, I now get .. >>>> >>>> toshi# pciconf -wb pci0:30:0 0x1a 8 >>>> pciconf: ioctl(PCIOCWRITE): Operation not supported by device >>>> >>> As mentioned the format of the location strings has changed, >>> you probably need to use pci0:0:30:0. >> If compatibility is a concern, we may be able to make the parsing >> a bit more smart without too much complexity. We can count the >> number of colons for exampl,e and assume missing elements are 0. >> So, if one enters pci1:2:3, the domain will be 0. If one enters >> pci4:5, both the domain and bus will be 0, etc. >> >> Just a thought... >> > > Unfortunately, for pciconf(8) the function is already optional > so pci1:2:3 would be ambiguous. 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") Since most devices are on a system with just a single PCI host adapter, the two abridged formats could still be used, as before. Just in case of multiple PCI domains, the full 4 value form was required for any domain other than "0". No compatibility problems, and the 3 value form would keep the current meaning (it would become domain/bus/slot now). This appears to be in compliance with POLA. It means, that all the current scripts (which may be shared between 6.x and 7.x) can stay unmodified, since the 2- and 3-value formats keep their semantics. And if PCI domains are used, its obvious there are no compatibility issues (since they are no present in 6.x). Since this was a change to my original code, I'd like to make the change I outlined above, unless there are strong objections. Regards, STefan PS: I can provide a patch for review later this day.