Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 1999 11:56:32 -0800 (PST)
From:      Castor Fu <castor@geocast.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/10312: pciconf -l generates output incompatible with pciconf -r
Message-ID:  <Pine.GSO.4.03.9902281155400.18887-100000@geo.geocast.net>

next in thread | raw e-mail | index | archive | help


>Number:         10312
>Category:       bin
>Synopsis:       pciconf -l generates output incompatible with pciconf -r
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 28 12:00:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Castor Fu
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
Geocast Network Systems
>Environment:

	FreeBSD 3.1-RELEASE but the problem has been verified to occur with 
	the pciconf which is in RELENG_3 tag.

>Description:

	The change in the format of 'pciconf -l' to identify the 
	device associated with each card produces output where the
	first column of output can no longer be used as a selector
	for 'pciconf -[rwa] <selector>'.  This contradicts the
	manual page and may cause various scripts to fail.

>How-To-Repeat:

clf-0# pciconf -l
chip0@pci0:0:0: class=0x060000 card=0x00000000 chip=0x71008086 rev=0x01 hdr=0x00
chip1@pci0:1:0: class=0x060100 card=0x00000000 chip=0x71108086 rev=0x01 hdr=0x00
ide_pci0@pci0:1:1:      class=0x010180 card=0x00000000 chip=0x71118086 rev=0x01 hdr=0x00
uhci0@pci0:1:2: class=0x0c0300 card=0x00000000 chip=0x71128086 rev=0x01 hdr=0x00
chip2@pci0:1:3: class=0x068000 card=0x00000000 chip=0x71138086 rev=0x01 hdr=0x00
vga0@pci0:9:0:  class=0x030000 card=0x8a015333 chip=0x8a015333 rev=0x01 hdr=0x00
bktr0@pci0:10:0:        class=0x040000 card=0x00000000 chip=0x0350109e rev=0x12 hdr=0x00
de0@pci0:11:0:  class=0x020000 card=0x11001385 chip=0x00091011 rev=0x22 hdr=0x00
clf-0# pciconf -r de0@pci0:11:0: 12
pciconf: cannot parse selector de0@pci0:11:0:

>Fix:
	
Index: pciconf.c
===================================================================
RCS file: /cvs/src/usr.sbin/pciconf/pciconf.c,v
retrieving revision 1.7
diff -r1.7 pciconf.c
193c193,194
< 	char *ep = (char*) str;
---
> 	char *ep = strchr(str, '@');
> 	char *epbase;
195c196,203
< 	
---
> 
> 	if  (ep == 0) {
> 		ep = (char *) str;
> 	} else {
> 		ep++;
> 	}
> 	epbase = ep;
> 
207a216,217
> 		if (*ep == ':')
> 			ep++;
209,211c219
< 	if (*ep == ':')
< 		ep++;
< 	if (*ep || ep == str)
---
> 	if (*ep || ep == epbase)


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.03.9902281155400.18887-100000>