[PATCH libpciaccess] config: provide a makefile for scanpci dev tool

Gaetan Nadon memsize at videotron.ca
Sun Aug 22 06:52:45 PDT 2010


There is no need for a scanpci shell script wrapper
Order of building ensures it always links
The pciaccess library does not need to be installed

The man page is moved to the man directory, as usual.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am         |    4 +-
 configure.ac        |    2 +
 man/Makefile.am     |   34 ++++++++
 man/scanpci.man     |   44 +++++++++++
 scanpci/.gitignore  |    1 +
 scanpci/Makefile.am |   29 +++++++
 scanpci/scanpci.c   |  215 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/.gitignore      |    2 -
 src/Makefile.am     |    4 -
 src/scanpci.c       |  215 ---------------------------------------------------
 src/scanpci.man     |   44 -----------
 11 files changed, 327 insertions(+), 267 deletions(-)
 create mode 100644 man/Makefile.am
 create mode 100644 man/scanpci.man
 create mode 100644 scanpci/.gitignore
 create mode 100644 scanpci/Makefile.am
 create mode 100644 scanpci/scanpci.c
 delete mode 100644 src/.gitignore
 delete mode 100644 src/scanpci.c
 delete mode 100644 src/scanpci.man

diff --git a/Makefile.am b/Makefile.am
index ff8db2f..ea30cd2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,13 +24,13 @@
 # Include autoconf macros from m4 subdir
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = src
+# Order: scanpci depends on libpciaccess built in src
+SUBDIRS = man src scanpci
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = pciaccess.pc
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
-EXTRA_DIST = src/scanpci.c src/scanpci.man 
 
 .PHONY: ChangeLog INSTALL
 
diff --git a/configure.ac b/configure.ac
index c0e1e9b..1c2a3ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,5 +123,7 @@ AC_SUBST(PCIACCESS_LIBS)
 		  
 
 AC_OUTPUT([Makefile
+	   man/Makefile
 	   src/Makefile
+	   scanpci/Makefile
            pciaccess.pc])
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644
index 0000000..45edd45
--- /dev/null
+++ b/man/Makefile.am
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+appman_PRE = scanpci.man
+noinst_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
+
+EXTRA_DIST = $(appman_PRE)
+CLEANFILES = $(noinst_DATA)
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+.man.$(APP_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/man/scanpci.man b/man/scanpci.man
new file mode 100644
index 0000000..a748edf
--- /dev/null
+++ b/man/scanpci.man
@@ -0,0 +1,44 @@
+.\" Copyright (C) 2000 The XFree86 Project, Inc.  All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a copy
+.\" of this software and associated documentation files (the "Software"), to
+.\" deal in the Software without restriction, including without limitation the
+.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+.\" sell copies of the Software, and to permit persons to whom the Software is
+.\" furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice shall be included in
+.\" all copies or substantial portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+.\" XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+.\" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+.\"
+.\" Except as contained in this notice, the name of the XFree86 Project shall
+.\" not be used in advertising or otherwise to promote the sale, use or other
+.\" dealings in this Software without prior written authorization from the
+.\" XFree86 Project.
+.\"
+.TH SCANPCI 1 __xorgversion__
+.SH NAME
+scanpci - scan/probe PCI buses
+.SH SYNOPSIS
+.B scanpci
+.RB [ \-v ]
+.SH DESCRIPTION
+.I Scanpci
+is a utility that can be used to scan PCI buses and report information
+about the configuration space settings for each PCI device.
+On most platforms,
+.I scanpci
+can only be run by the root user.
+.SH OPTIONS
+.TP 8
+.B \-v
+Print the configuration space information for each device in a verbose
+format.  Without this option, only a brief description is printed for
+each device.
+
diff --git a/scanpci/.gitignore b/scanpci/.gitignore
new file mode 100644
index 0000000..485d4b9
--- /dev/null
+++ b/scanpci/.gitignore
@@ -0,0 +1 @@
+scanpci
diff --git a/scanpci/Makefile.am b/scanpci/Makefile.am
new file mode 100644
index 0000000..6fdf86e
--- /dev/null
+++ b/scanpci/Makefile.am
@@ -0,0 +1,29 @@
+#
+# (C) Copyright IBM Corporation 2006
+# All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# on the rights to use, copy, modify, merge, publish, distribute, sub
+# license, and/or sell copies of the Software, and to permit persons to whom
+# the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+# IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+noinst_PROGRAMS = scanpci
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_LDFLAGS =  -L$(top_builddir)/src -lpciaccess
+
+scanpci_SOURCES = scanpci.c
diff --git a/scanpci/scanpci.c b/scanpci/scanpci.c
new file mode 100644
index 0000000..34ec664
--- /dev/null
+++ b/scanpci/scanpci.c
@@ -0,0 +1,215 @@
+/*
+ * (C) Copyright IBM Corporation 2006
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <err.h>
+#include <unistd.h>
+
+#include "pciaccess.h"
+
+
+static void
+print_pci_bridge( const struct pci_bridge_info * info )
+{
+    printf( "  Bus: primary=%02x, secondary=%02x, subordinate=%02x, "
+	    "sec-latency=%u\n",
+	    info->primary_bus,
+	    info->secondary_bus,
+	    info->subordinate_bus,
+	    info->secondary_latency_timer );
+    printf( "  I/O behind bridge: %08x-%08x\n",
+	    info->io_base,
+	    info->io_limit );
+    printf( "  Memory behind bridge: %08x-%08x\n",
+	    info->mem_base,
+	    info->mem_limit );
+    printf( "  Prefetchable memory behind bridge: %08llx-%08llx\n",
+	    info->prefetch_mem_base,
+	    info->prefetch_mem_limit );
+}
+
+static void
+print_pci_device( struct pci_device * dev, int verbose )
+{
+    const char * dev_name;
+    const char * vend_name;
+
+    vend_name = pci_device_get_vendor_name( dev );
+    dev_name = pci_device_get_device_name( dev );
+    if ( dev_name == NULL ) {
+	dev_name = "Device unknown";
+    }
+
+    printf("\npci ");
+    if (dev->domain != 0)
+	printf("domain 0x%04x ", dev->domain);
+    printf("bus 0x%04x cardnum 0x%02x function 0x%02x:"
+	   " vendor 0x%04x device 0x%04x\n",
+	   dev->bus, 
+	   dev->dev,
+	   dev->func,
+	   dev->vendor_id,
+	   dev->device_id );
+    if ( vend_name != NULL ) {
+	printf( " %s %s\n", vend_name, dev_name );
+    }
+    else {
+	printf( " %s\n", dev_name );
+    }
+    
+    if ( verbose ) {
+	unsigned   i;
+	uint16_t  command, status;
+	uint8_t   bist;
+	uint8_t   header_type;
+	uint8_t   latency_timer;
+	uint8_t   cache_line_size;
+	uint8_t   max_latency;
+	uint8_t   min_grant;
+	uint8_t   int_pin;
+
+
+	vend_name = pci_device_get_subvendor_name( dev );
+	dev_name = pci_device_get_subdevice_name( dev );
+	if ( dev_name == NULL ) {
+	    dev_name = "Card unknown";
+	}
+
+	printf( " CardVendor 0x%04x card 0x%04x (",
+		dev->subvendor_id,
+		dev->subdevice_id );
+	if ( vend_name != NULL ) {
+	    printf( "%s, %s)\n", vend_name, dev_name );
+	}
+	else {
+	    printf( "%s)\n", dev_name );
+	}
+
+	pci_device_cfg_read_u16( dev, & command, 4 );
+	pci_device_cfg_read_u16( dev, & status,  6 );
+	printf( "  STATUS    0x%04x  COMMAND 0x%04x\n", 
+		status,
+		command );
+	printf( "  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
+		(dev->device_class >> 16) & 0x0ff,
+		(dev->device_class >>  8) & 0x0ff,
+		(dev->device_class >>  0) & 0x0ff,
+		dev->revision );
+
+	pci_device_cfg_read_u8( dev, & cache_line_size, 12 );
+	pci_device_cfg_read_u8( dev, & latency_timer, 13 );
+	pci_device_cfg_read_u8( dev, & header_type, 14 );
+	pci_device_cfg_read_u8( dev, & bist, 15 );
+
+	printf( "  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
+		bist,
+		header_type,
+		latency_timer,
+		cache_line_size );
+	
+	pci_device_probe( dev );
+	for ( i = 0 ; i < 6 ; i++ ) {
+	    if ( dev->regions[i].base_addr != 0 ) {
+		printf( "  BASE%u     0x%08x SIZE %d  %s",
+			i,
+			(intptr_t) dev->regions[i].base_addr,
+			(size_t) dev->regions[i].size,
+			(dev->regions[i].is_IO) ? "I/O" : "MEM" );
+
+		if ( ! dev->regions[i].is_IO ) {
+		    if ( dev->regions[i].is_prefetchable ) {
+			printf( " PREFETCHABLE" );
+		    }
+		}
+		
+		printf( "\n" );
+	    }
+	}
+
+	if ( dev->rom_size ) {
+	    printf( "  BASEROM   0x%08x  addr 0x%08x\n",
+		    0, 0 );
+	}
+
+	pci_device_cfg_read_u8( dev, & int_pin, 61 );
+	pci_device_cfg_read_u8( dev, & min_grant, 62 );
+	pci_device_cfg_read_u8( dev, & max_latency, 63 );
+
+	printf( "  MAX_LAT   0x%02x  MIN_GNT 0x%02x  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
+		max_latency,
+		min_grant,
+		int_pin,
+		dev->irq );
+
+	if ( (dev->device_class >> 16) == 0x06 ) {
+	    const void * info;
+
+	    if ( (info = pci_device_get_bridge_info(dev)) != NULL ) {
+		print_pci_bridge( (const struct pci_bridge_info *) info );
+	    }
+	    else if ( (info = pci_device_get_pcmcia_bridge_info(dev)) != NULL ) {
+		/* Nothing yet. */
+	    }
+	}
+    }
+}
+
+
+int main( int argc, char ** argv )
+{
+    struct pci_device_iterator * iter;
+    struct pci_device * dev;
+    int ret;
+    int verbose = 0;
+    int c;
+    int errors = 0;
+
+    while ((c = getopt(argc, argv, "v")) != -1) {
+	switch (c) {
+	case 'v':
+	    verbose = 1;
+	    break;
+	case '?':
+	    errors++;
+	}
+    }
+    if (errors != 0) {
+	fprintf(stderr, "usage: %s [-v]\n", argv[0]);
+	exit(2);
+    }
+
+    ret = pci_system_init();
+    if (ret != 0)
+	err(1, "Couldn't initialize PCI system");
+
+    iter = pci_slot_match_iterator_create( NULL );
+
+    while ( (dev = pci_device_next( iter )) != NULL ) {
+	print_pci_device( dev, verbose );
+    }
+
+    pci_system_cleanup();
+    return 0;
+}
diff --git a/src/.gitignore b/src/.gitignore
deleted file mode 100644
index 5c8b286..0000000
--- a/src/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-scanpci
diff --git a/src/Makefile.am b/src/Makefile.am
index 0ee8449..0d774e0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,7 +77,3 @@ libpciaccessincludedir = $(includedir)
 libpciaccessinclude_HEADERS = \
     $(top_srcdir)/include/pciaccess.h
 
-noinst_PROGRAMS = scanpci
-
-scanpci_SOURCES = scanpci.c
-scanpci_LDADD = libpciaccess.la
diff --git a/src/scanpci.c b/src/scanpci.c
deleted file mode 100644
index 34ec664..0000000
--- a/src/scanpci.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * (C) Copyright IBM Corporation 2006
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
- * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <err.h>
-#include <unistd.h>
-
-#include "pciaccess.h"
-
-
-static void
-print_pci_bridge( const struct pci_bridge_info * info )
-{
-    printf( "  Bus: primary=%02x, secondary=%02x, subordinate=%02x, "
-	    "sec-latency=%u\n",
-	    info->primary_bus,
-	    info->secondary_bus,
-	    info->subordinate_bus,
-	    info->secondary_latency_timer );
-    printf( "  I/O behind bridge: %08x-%08x\n",
-	    info->io_base,
-	    info->io_limit );
-    printf( "  Memory behind bridge: %08x-%08x\n",
-	    info->mem_base,
-	    info->mem_limit );
-    printf( "  Prefetchable memory behind bridge: %08llx-%08llx\n",
-	    info->prefetch_mem_base,
-	    info->prefetch_mem_limit );
-}
-
-static void
-print_pci_device( struct pci_device * dev, int verbose )
-{
-    const char * dev_name;
-    const char * vend_name;
-
-    vend_name = pci_device_get_vendor_name( dev );
-    dev_name = pci_device_get_device_name( dev );
-    if ( dev_name == NULL ) {
-	dev_name = "Device unknown";
-    }
-
-    printf("\npci ");
-    if (dev->domain != 0)
-	printf("domain 0x%04x ", dev->domain);
-    printf("bus 0x%04x cardnum 0x%02x function 0x%02x:"
-	   " vendor 0x%04x device 0x%04x\n",
-	   dev->bus, 
-	   dev->dev,
-	   dev->func,
-	   dev->vendor_id,
-	   dev->device_id );
-    if ( vend_name != NULL ) {
-	printf( " %s %s\n", vend_name, dev_name );
-    }
-    else {
-	printf( " %s\n", dev_name );
-    }
-    
-    if ( verbose ) {
-	unsigned   i;
-	uint16_t  command, status;
-	uint8_t   bist;
-	uint8_t   header_type;
-	uint8_t   latency_timer;
-	uint8_t   cache_line_size;
-	uint8_t   max_latency;
-	uint8_t   min_grant;
-	uint8_t   int_pin;
-
-
-	vend_name = pci_device_get_subvendor_name( dev );
-	dev_name = pci_device_get_subdevice_name( dev );
-	if ( dev_name == NULL ) {
-	    dev_name = "Card unknown";
-	}
-
-	printf( " CardVendor 0x%04x card 0x%04x (",
-		dev->subvendor_id,
-		dev->subdevice_id );
-	if ( vend_name != NULL ) {
-	    printf( "%s, %s)\n", vend_name, dev_name );
-	}
-	else {
-	    printf( "%s)\n", dev_name );
-	}
-
-	pci_device_cfg_read_u16( dev, & command, 4 );
-	pci_device_cfg_read_u16( dev, & status,  6 );
-	printf( "  STATUS    0x%04x  COMMAND 0x%04x\n", 
-		status,
-		command );
-	printf( "  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
-		(dev->device_class >> 16) & 0x0ff,
-		(dev->device_class >>  8) & 0x0ff,
-		(dev->device_class >>  0) & 0x0ff,
-		dev->revision );
-
-	pci_device_cfg_read_u8( dev, & cache_line_size, 12 );
-	pci_device_cfg_read_u8( dev, & latency_timer, 13 );
-	pci_device_cfg_read_u8( dev, & header_type, 14 );
-	pci_device_cfg_read_u8( dev, & bist, 15 );
-
-	printf( "  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
-		bist,
-		header_type,
-		latency_timer,
-		cache_line_size );
-	
-	pci_device_probe( dev );
-	for ( i = 0 ; i < 6 ; i++ ) {
-	    if ( dev->regions[i].base_addr != 0 ) {
-		printf( "  BASE%u     0x%08x SIZE %d  %s",
-			i,
-			(intptr_t) dev->regions[i].base_addr,
-			(size_t) dev->regions[i].size,
-			(dev->regions[i].is_IO) ? "I/O" : "MEM" );
-
-		if ( ! dev->regions[i].is_IO ) {
-		    if ( dev->regions[i].is_prefetchable ) {
-			printf( " PREFETCHABLE" );
-		    }
-		}
-		
-		printf( "\n" );
-	    }
-	}
-
-	if ( dev->rom_size ) {
-	    printf( "  BASEROM   0x%08x  addr 0x%08x\n",
-		    0, 0 );
-	}
-
-	pci_device_cfg_read_u8( dev, & int_pin, 61 );
-	pci_device_cfg_read_u8( dev, & min_grant, 62 );
-	pci_device_cfg_read_u8( dev, & max_latency, 63 );
-
-	printf( "  MAX_LAT   0x%02x  MIN_GNT 0x%02x  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
-		max_latency,
-		min_grant,
-		int_pin,
-		dev->irq );
-
-	if ( (dev->device_class >> 16) == 0x06 ) {
-	    const void * info;
-
-	    if ( (info = pci_device_get_bridge_info(dev)) != NULL ) {
-		print_pci_bridge( (const struct pci_bridge_info *) info );
-	    }
-	    else if ( (info = pci_device_get_pcmcia_bridge_info(dev)) != NULL ) {
-		/* Nothing yet. */
-	    }
-	}
-    }
-}
-
-
-int main( int argc, char ** argv )
-{
-    struct pci_device_iterator * iter;
-    struct pci_device * dev;
-    int ret;
-    int verbose = 0;
-    int c;
-    int errors = 0;
-
-    while ((c = getopt(argc, argv, "v")) != -1) {
-	switch (c) {
-	case 'v':
-	    verbose = 1;
-	    break;
-	case '?':
-	    errors++;
-	}
-    }
-    if (errors != 0) {
-	fprintf(stderr, "usage: %s [-v]\n", argv[0]);
-	exit(2);
-    }
-
-    ret = pci_system_init();
-    if (ret != 0)
-	err(1, "Couldn't initialize PCI system");
-
-    iter = pci_slot_match_iterator_create( NULL );
-
-    while ( (dev = pci_device_next( iter )) != NULL ) {
-	print_pci_device( dev, verbose );
-    }
-
-    pci_system_cleanup();
-    return 0;
-}
diff --git a/src/scanpci.man b/src/scanpci.man
deleted file mode 100644
index aec7b2e..0000000
--- a/src/scanpci.man
+++ /dev/null
@@ -1,44 +0,0 @@
-.\" Copyright (C) 2000 The XFree86 Project, Inc.  All Rights Reserved.
-.\" 
-.\" Permission is hereby granted, free of charge, to any person obtaining a copy
-.\" of this software and associated documentation files (the "Software"), to
-.\" deal in the Software without restriction, including without limitation the
-.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-.\" sell copies of the Software, and to permit persons to whom the Software is
-.\" furnished to do so, subject to the following conditions:
-.\" 
-.\" The above copyright notice and this permission notice shall be included in
-.\" all copies or substantial portions of the Software.
-.\" 
-.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-.\" XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-.\" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-.\" 
-.\" Except as contained in this notice, the name of the XFree86 Project shall
-.\" not be used in advertising or otherwise to promote the sale, use or other
-.\" dealings in this Software without prior written authorization from the
-.\" XFree86 Project.
-.\" 
-.TH SCANPCI 1 __xorgversion__
-.SH NAME
-scanpci - scan/probe PCI buses
-.SH SYNOPSIS
-.B scanpci
-.RB [ \-v ]
-.SH DESCRIPTION
-.I Scanpci
-is a utility that can be used to scan PCI buses and report information
-about the configuration space settings for each PCI device.
-On most platforms,
-.I scanpci
-can only be run by the root user.
-.SH OPTIONS
-.TP 8
-.B \-v
-Print the configuration space information for each device in a verbose
-format.  Without this option, only a brief description is printed for
-each device.
-
-- 
1.6.0.4



More information about the xorg-devel mailing list