Remove source files that have been dead since day-1 of this branch.
This commit is contained in:
		
							parent
							
								
									eb95128f61
								
							
						
					
					
						commit
						7dff8d98a9
					
				| 
						 | 
					@ -1,32 +0,0 @@
 | 
				
			||||||
module_LTLIBRARIES = libscanpci.la libpcidata.la
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
libpcidata_la_LDFLAGS = -avoid-version
 | 
					 | 
				
			||||||
libscanpci_la_LDFLAGS = -avoid-version
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
libpcidata_la_SOURCES = xf86PciData.c
 | 
					 | 
				
			||||||
libscanpci_la_SOURCES = xf86ScanPci.c
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
INCLUDES = $(XORG_INCS)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
AM_CFLAGS = $(XORG_CFLAGS)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
BUILT_SOURCES = xf86PciIds.h
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
EXTRA_DIST = \
 | 
					 | 
				
			||||||
	xf86PciData.h \
 | 
					 | 
				
			||||||
	xf86PciIds.h \
 | 
					 | 
				
			||||||
	xf86PciStdIds.h \
 | 
					 | 
				
			||||||
	xf86PciStr.h \
 | 
					 | 
				
			||||||
	xf86ScanPci.h \
 | 
					 | 
				
			||||||
	pci.ids \
 | 
					 | 
				
			||||||
	extrapci.ids \
 | 
					 | 
				
			||||||
	pciid2c.pl
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
xf86PciData.c:
 | 
					 | 
				
			||||||
	echo "#define PCIDATA" > $@
 | 
					 | 
				
			||||||
	echo "#include \"$(srcdir)/xf86ScanPci.c\"" >> $@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
xf86PciIds.h: $(srcdir)/../common/xf86PciInfo.h
 | 
					 | 
				
			||||||
	cat $(srcdir)/pci.ids $(srcdir)/extrapci.ids | $(PERL) $(srcdir)/pciid2c.pl $(srcdir)/../common/xf86PciInfo.h > xf86PciIds.h
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
DISTCLEANFILES = xf86PciData.c xf86PciIds.h
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,48 +0,0 @@
 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	Modifications and additions to the standard list of PCI IDs in
 | 
					 | 
				
			||||||
#	pci.ids.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	To modify an entry, simply add the modified version here.
 | 
					 | 
				
			||||||
#	To leave part of an entry unchanged, use '"' for the name
 | 
					 | 
				
			||||||
#	(e.g., leave the vendor name unchanged while adding/modifying
 | 
					 | 
				
			||||||
#	a device).  To delete an entry, set the name to '-'.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	One syntax extension is allowing a 16-bit class value to be
 | 
					 | 
				
			||||||
#	specified for a device (see the syntax description below).
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	Don't make gratuitous changes, and please send back
 | 
					 | 
				
			||||||
#	changes/additions that aren't XFree86-specific to the pciids
 | 
					 | 
				
			||||||
#	project (http://pciids.sf.net/).
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#	$XdotOrg: xserver/xorg/hw/xfree86/scanpci/extrapci.ids,v 1.6 2005/09/19 18:54:05 alanc Exp $
 | 
					 | 
				
			||||||
#	$XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.11 2003/12/18 16:22:27 dawes Exp $
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Vendors, devices and subsystems. Please keep sorted.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Syntax:
 | 
					 | 
				
			||||||
# vendor  vendor_name
 | 
					 | 
				
			||||||
#	device  device_name				<-- single tab
 | 
					 | 
				
			||||||
#		C  class				<-- two tabs
 | 
					 | 
				
			||||||
#		subvendor subdevice  subsystem_name	<-- two tabs
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Use lower-case hex digits for all numeric values.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Example: Add a new chipset for vendor who's ID is xyzw
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# xyzw	"
 | 
					 | 
				
			||||||
#	20ce	New Chipset Description
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
1102	"
 | 
					 | 
				
			||||||
	0002	"
 | 
					 | 
				
			||||||
		C  0401
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Some NVIDIA cards that are not in the master pci.ids file yet.
 | 
					 | 
				
			||||||
10de	"
 | 
					 | 
				
			||||||
	0046	NV40 [GeForce 6800 GT]
 | 
					 | 
				
			||||||
	0048	GeForce 6800 XT
 | 
					 | 
				
			||||||
	0147	GeForce 6700 XL
 | 
					 | 
				
			||||||
	0160	GeForce 6500
 | 
					 | 
				
			||||||
	0163	GeForce 6200 LE
 | 
					 | 
				
			||||||
	0169	GeForce 6250
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -1,389 +0,0 @@
 | 
				
			||||||
#!/usr/bin/perl
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# $XdotOrg$
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Automatically generate the data structures for PCI vendor/device lists
 | 
					 | 
				
			||||||
# from the pci.ids file.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# It should be run as:
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#   perl pciid2c.pl ../common/xf86PciInfo.h < pci.ids > xf86PciStdIds.h
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Copyright © 2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
# and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Author: David Dawes
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.3 2003/08/24 17:37:10 dawes Exp $
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if (@ARGV[0]) {
 | 
					 | 
				
			||||||
    $infofile = @ARGV[0];
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# The basic pci.ids format is:
 | 
					 | 
				
			||||||
#   - Vendor lines start with four (lower case) hex digits
 | 
					 | 
				
			||||||
#   - Device lines start with one tab followed by four hex digits
 | 
					 | 
				
			||||||
#   - Subsystem lines start with two tabs followed by two sets of four
 | 
					 | 
				
			||||||
#     hex digits.
 | 
					 | 
				
			||||||
#   - Class overrides for devices start with two tabs followed by a "C",
 | 
					 | 
				
			||||||
#     followed by four hex digits with the class/subclass value.
 | 
					 | 
				
			||||||
#   - Class lines start with a "C".
 | 
					 | 
				
			||||||
#   - Comment lines start with a '#'.
 | 
					 | 
				
			||||||
#   - Blank lines are ignored.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# We allow for extra lines to be appended to modify existing entries or
 | 
					 | 
				
			||||||
# add new ones.  To add/modify Device entries without modifying the
 | 
					 | 
				
			||||||
# Vendor name, a special vendor name of '"' is used (mnemonic: "ditto").
 | 
					 | 
				
			||||||
# Similarly for adding subsystem names without modifying (or adding)
 | 
					 | 
				
			||||||
# a corresponding device entry.  To rename an existing entry, simply
 | 
					 | 
				
			||||||
# provide the new name.  To remove an existing entry, use the special
 | 
					 | 
				
			||||||
# name '-'.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
while (<STDIN>) {
 | 
					 | 
				
			||||||
    # Process data lines
 | 
					 | 
				
			||||||
    if (/^([0-9a-f]{4})\s+(.*)/) {
 | 
					 | 
				
			||||||
	$vendor = $1;
 | 
					 | 
				
			||||||
	if ($2 eq '-') {
 | 
					 | 
				
			||||||
	    delete($vendors{$vendor});
 | 
					 | 
				
			||||||
	} elsif ($2 ne '"') {
 | 
					 | 
				
			||||||
	    $vendors{$vendor} = $2;
 | 
					 | 
				
			||||||
	    # Remove " characters
 | 
					 | 
				
			||||||
	    $vendors{$vendor} =~ s/"//g;
 | 
					 | 
				
			||||||
	    # Remove multiple "?" sequences to avoid trigraphs
 | 
					 | 
				
			||||||
	    $vendors{$vendor} =~ s/\?+/\?/g;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } elsif (/^\t([0-9a-f]{4})\s+(.*)/) {
 | 
					 | 
				
			||||||
	$device = $1;
 | 
					 | 
				
			||||||
	if ($2 eq '-') {
 | 
					 | 
				
			||||||
	    delete($devices{$vendor}{$device});
 | 
					 | 
				
			||||||
	} elsif ($2 ne '"') {
 | 
					 | 
				
			||||||
	    $devices{$vendor}{$device} = $2;
 | 
					 | 
				
			||||||
	    # Remove " characters
 | 
					 | 
				
			||||||
	    $devices{$vendor}{$device} =~ s/"//g;
 | 
					 | 
				
			||||||
	    # Remove multiple "?" sequences to avoid trigraphs
 | 
					 | 
				
			||||||
	    $devices{$vendor}{$device} =~ s/\?+/\?/g;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } elsif (/^\t\t([0-9a-f]{4})\s+([0-9a-f]{4})\s+(.*)/) {
 | 
					 | 
				
			||||||
	$v = $1;
 | 
					 | 
				
			||||||
	$s = $2;
 | 
					 | 
				
			||||||
	if ($3 eq '-') {
 | 
					 | 
				
			||||||
	    delete($subsystems{$v}{$s});
 | 
					 | 
				
			||||||
	    delete($devsubsystems{$vendor}{$device}{"$v-$s"});
 | 
					 | 
				
			||||||
	} elsif ($3 ne '"') {
 | 
					 | 
				
			||||||
	    if ($subsystems{$v}{$s}) {
 | 
					 | 
				
			||||||
		#print STDERR "Duplicate subsytem: $v, $s, \"$subsystems{$v}{$s}\", \"$3\"\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    $subsystems{$v}{$s} = $3;
 | 
					 | 
				
			||||||
	    # Remove " characters
 | 
					 | 
				
			||||||
	    $subsystems{$v}{$s} =~ s/"//g;
 | 
					 | 
				
			||||||
	    # Remove multiple "?" sequences to avoid trigraphs
 | 
					 | 
				
			||||||
	    $subsystems{$v}{$s} =~ s/\?+/\?/g;
 | 
					 | 
				
			||||||
	    $devsubsystems{$vendor}{$device}{"$v-$s"} = $subsystems{$v}{$s};
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } elsif (/^\t\tC\s+([0-9a-f]{4})/) {
 | 
					 | 
				
			||||||
	$classes{$vendor}{$device} = $1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    # Ignore all other lines.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Find which vendors are "video" vendors.
 | 
					 | 
				
			||||||
if ($infofile) {
 | 
					 | 
				
			||||||
    open(INFO, "<$infofile") || die "Can't open $infofile";
 | 
					 | 
				
			||||||
    while (<INFO>) {
 | 
					 | 
				
			||||||
	if (/^#define\s+PCI_VENDOR_.*0x([0-9a-fA-F]{4})/) {
 | 
					 | 
				
			||||||
	    $vendor = $1;
 | 
					 | 
				
			||||||
	    $vendor =~ tr/A-F/a-f/;
 | 
					 | 
				
			||||||
	    $video{$vendor} = 1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# This layout is quite different from that used in the old xf86PciInfo.h
 | 
					 | 
				
			||||||
# file.  One main difference is that the list is initialised at runtime.
 | 
					 | 
				
			||||||
# It's currently a flat list.  This could be improved.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Print out header information.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
$proj = "XdotOrg";
 | 
					 | 
				
			||||||
print "/* \$$proj\$ */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * It is generated by pciid2c.pl using data from the following files:
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 *    ../etc/pci.ids
 | 
					 | 
				
			||||||
 *    ../etc/extrapci.ids
 | 
					 | 
				
			||||||
 *    ../common/xf86PciInfo.h
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright © 2002 by the XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * The pci.ids file and the data it contains are from the Linux PCI ID's
 | 
					 | 
				
			||||||
 * Project (http://pciids.sf.net/).  It is maintained by Martin Mares
 | 
					 | 
				
			||||||
 * <mj\@ucw.cz> and other volunteers.  The pci.ids file is licensed under
 | 
					 | 
				
			||||||
 * the BSD 3-clause or GPL version 2 or later licenses.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include \"xf86PciInfo.h\"
 | 
					 | 
				
			||||||
#ifndef NULL
 | 
					 | 
				
			||||||
#define NULL (void *)0
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# The following #ifdefs are used:
 | 
					 | 
				
			||||||
#  - INIT_SUBSYS_INFO -- initialise subsystem data
 | 
					 | 
				
			||||||
#  - INIT_VENDOR_SUBSYS_INFO -- initialise a vendor<->subsystem table.
 | 
					 | 
				
			||||||
#  - VENDOR_INCLUDE_NONVIDEO -- include data for non-video vendors.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Define static variables with all of the strings.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    print "static const char pci_vendor_${vendor}[] = \"$vendors{$vendor}\";\n";
 | 
					 | 
				
			||||||
    foreach $device (sort keys %{$devices{$vendor}}) {
 | 
					 | 
				
			||||||
	print "static const char pci_device_${vendor}_${device}[] = " .
 | 
					 | 
				
			||||||
	      "\"$devices{$vendor}{$device}\";\n";
 | 
					 | 
				
			||||||
	foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
 | 
					 | 
				
			||||||
	    $s = $subsys;
 | 
					 | 
				
			||||||
	    ($v) = split /-/, $s;
 | 
					 | 
				
			||||||
	    if ($infofile && !$video{$vendor} && $video{$v}) {
 | 
					 | 
				
			||||||
		print "#endif\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    $s =~ s/-/_/;
 | 
					 | 
				
			||||||
	    print "#ifdef INIT_SUBSYS_INFO\n";
 | 
					 | 
				
			||||||
	    print "static const char pci_subsys_${vendor}_${device}_${s}[] = " .
 | 
					 | 
				
			||||||
		  "\"$devsubsystems{$vendor}{$device}{$subsys}\";\n";
 | 
					 | 
				
			||||||
	    print "#endif\n";
 | 
					 | 
				
			||||||
	    if ($infofile && !$video{$vendor} && $video{$v}) {
 | 
					 | 
				
			||||||
		print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#endif\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Pre-initialise the table structures (from the inner to the outer).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# First, the subsys structures.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
print "#ifdef INIT_SUBSYS_INFO\n";
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	$pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	undef($pre);
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    foreach $device (sort keys %{$devices{$vendor}}) {
 | 
					 | 
				
			||||||
	foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
 | 
					 | 
				
			||||||
	    $s = $subsys;
 | 
					 | 
				
			||||||
	    $s =~ tr/-/_/;
 | 
					 | 
				
			||||||
	    ($vid, $sid) = split /_/, $s;
 | 
					 | 
				
			||||||
	    if ($pre) {
 | 
					 | 
				
			||||||
		print $pre;
 | 
					 | 
				
			||||||
		undef($pre);
 | 
					 | 
				
			||||||
		$post = "#endif\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    if ($infofile && !$video{$vendor} && $video{$vid}) {
 | 
					 | 
				
			||||||
		print "#endif\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    print "static const pciSubsystemInfo " .
 | 
					 | 
				
			||||||
		  "pci_ss_info_${vendor}_${device}_$s =\n";
 | 
					 | 
				
			||||||
	    print "\t{0x$vid, 0x$sid, pci_subsys_${vendor}_${device}_$s, 0};\n";
 | 
					 | 
				
			||||||
	    print "#undef pci_ss_info_$s\n";
 | 
					 | 
				
			||||||
	    print "#define pci_ss_info_$s pci_ss_info_${vendor}_${device}_$s\n";
 | 
					 | 
				
			||||||
	    if ($infofile && !$video{$vendor} && $video{$vid}) {
 | 
					 | 
				
			||||||
		print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ($post) {
 | 
					 | 
				
			||||||
	print $post;
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Next, the list of per vendor+device subsystem arrays
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	$pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	undef($pre);
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    foreach $device (sort keys %{$devices{$vendor}}) {
 | 
					 | 
				
			||||||
	if (scalar(keys %{$devsubsystems{$vendor}{$device}}) > 0) {
 | 
					 | 
				
			||||||
	    if ($pre) {
 | 
					 | 
				
			||||||
		print $pre;
 | 
					 | 
				
			||||||
		undef($pre);
 | 
					 | 
				
			||||||
		$post = "#endif\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    print "static const pciSubsystemInfo *pci_ss_list_${vendor}_${device}[] = {\n";
 | 
					 | 
				
			||||||
	    foreach $sub (sort keys %{$devsubsystems{$vendor}{$device}}) {
 | 
					 | 
				
			||||||
		$sub =~ s/-/_/;
 | 
					 | 
				
			||||||
		print "\t&pci_ss_info_${vendor}_${device}_${sub},\n";
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    print "\tNULL\n};\n";
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    print "#define pci_ss_list_${vendor}_${device} NULL\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ($post) {
 | 
					 | 
				
			||||||
	print $post;
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Next, the list of per vendor subsystem arrays
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
print "#ifdef INIT_VENDOR_SUBSYS_INFO\n";
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if (scalar(keys %{$subsystems{$vendor}}) > 0) {
 | 
					 | 
				
			||||||
	if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	    print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	print "static const pciSubsystemInfo *pci_ss_list_${vendor}[] = {\n";
 | 
					 | 
				
			||||||
	foreach $sub (sort keys %{$subsystems{$vendor}}) {
 | 
					 | 
				
			||||||
	    print "\t&pci_ss_info_${vendor}_${sub},\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	print "\tNULL\n};\n";
 | 
					 | 
				
			||||||
	if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	    print "#endif\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	print "#define pci_ss_list_${vendor} NULL\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
print "#endif /* INIT_VENDOR_SUBSYS_INFO */\n";
 | 
					 | 
				
			||||||
print "#endif /* INIT_SUBSYS_INFO */\n";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Next the device structures
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	$pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	undef($pre);
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    foreach $device (sort keys %{$devices{$vendor}}) {
 | 
					 | 
				
			||||||
	if ($pre) {
 | 
					 | 
				
			||||||
	    print $pre;
 | 
					 | 
				
			||||||
	    undef($pre);
 | 
					 | 
				
			||||||
	    $post = "#endif\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if ($classes{$vendor}{$device}) {
 | 
					 | 
				
			||||||
	    $class = "0x$classes{$vendor}{$device}";
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    $class = "0";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	print "static const pciDeviceInfo " .
 | 
					 | 
				
			||||||
	      "pci_dev_info_${vendor}_${device} = {\n";
 | 
					 | 
				
			||||||
	print "\t0x$device, pci_device_${vendor}_${device},\n";
 | 
					 | 
				
			||||||
	print "#ifdef INIT_SUBSYS_INFO\n";
 | 
					 | 
				
			||||||
	print "\tpci_ss_list_${vendor}_${device},\n";
 | 
					 | 
				
			||||||
	print "#else\n";
 | 
					 | 
				
			||||||
	print "\tNULL,\n";
 | 
					 | 
				
			||||||
	print "#endif\n";
 | 
					 | 
				
			||||||
	print "\t$class\n};\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ($post) {
 | 
					 | 
				
			||||||
	print $post;
 | 
					 | 
				
			||||||
	undef($post);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Next, the list of per vendor device arrays
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if (scalar(keys %{$devices{$vendor}}) > 0) {
 | 
					 | 
				
			||||||
	if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	    print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	print "static const pciDeviceInfo *pci_dev_list_${vendor}[] = {\n";
 | 
					 | 
				
			||||||
	foreach $device (sort keys %{$devices{$vendor}}) {
 | 
					 | 
				
			||||||
	    print "\t&pci_dev_info_${vendor}_${device},\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	print "\tNULL\n};\n";
 | 
					 | 
				
			||||||
	if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	    print "#endif\n";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	print "#define pci_dev_list_${vendor} NULL\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Next, the main vendor list
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
print "
 | 
					 | 
				
			||||||
static const pciVendorInfo pciVendorInfoList[] = {
 | 
					 | 
				
			||||||
";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    print "\t{0x$vendor, pci_vendor_$vendor, pci_dev_list_$vendor},\n";
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#endif\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
print "\t{0x0000, NULL, NULL}\n};\n";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Finally, the main vendor/subsystem list
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
print "
 | 
					 | 
				
			||||||
#if defined(INIT_VENDOR_SUBSYS_INFO) && defined(INIT_SUBSYS_INFO)
 | 
					 | 
				
			||||||
static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
 | 
					 | 
				
			||||||
";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
foreach $vendor (sort keys %vendors) {
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    print "\t{0x$vendor, pci_vendor_$vendor, pci_ss_list_$vendor},\n";
 | 
					 | 
				
			||||||
    if ($infofile && !$video{$vendor}) {
 | 
					 | 
				
			||||||
	print "#endif\n";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
print "\t{0x0000, NULL, NULL}\n};\n";
 | 
					 | 
				
			||||||
print "#endif\n";
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,70 +0,0 @@
 | 
				
			||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
 * and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef HAVE_XORG_CONFIG_H
 | 
					 | 
				
			||||||
#include <xorg-config.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef PCI_DATA_H_
 | 
					 | 
				
			||||||
#define PCI_DATA_H_
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define NOVENDOR 0xFFFF
 | 
					 | 
				
			||||||
#define NODEVICE 0xFFFF
 | 
					 | 
				
			||||||
#define NOSUBSYS 0xFFFF
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef Bool (*ScanPciSetupProcPtr)(void);
 | 
					 | 
				
			||||||
typedef void (*ScanPciCloseProcPtr)(void);
 | 
					 | 
				
			||||||
typedef int (*ScanPciFindByDeviceProcPtr)(
 | 
					 | 
				
			||||||
			unsigned short vendor, unsigned short device,
 | 
					 | 
				
			||||||
			unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
			const char **vname, const char **dname,
 | 
					 | 
				
			||||||
			const char **svname, const char **sname);
 | 
					 | 
				
			||||||
typedef int (*ScanPciFindBySubsysProcPtr)(
 | 
					 | 
				
			||||||
			unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
			const char **svname, const char **sname);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Whoever loads this module needs to define these and initialise them
 | 
					 | 
				
			||||||
 * after loading.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
extern ScanPciSetupProcPtr xf86SetupPciIds;
 | 
					 | 
				
			||||||
extern ScanPciCloseProcPtr xf86ClosePciIds;
 | 
					 | 
				
			||||||
extern ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice;
 | 
					 | 
				
			||||||
extern ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Bool ScanPciSetupPciIds(void);
 | 
					 | 
				
			||||||
void ScanPciClosePciIds(void);
 | 
					 | 
				
			||||||
int ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
 | 
					 | 
				
			||||||
				unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
				const char **vname, const char **dname,
 | 
					 | 
				
			||||||
				const char **svname, const char **sname);
 | 
					 | 
				
			||||||
int ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
				const char **svname, const char **sname);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -1,67 +0,0 @@
 | 
				
			||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.2 2003/08/24 17:37:10 dawes Exp $ */
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (c) 2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
 * and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Structs used to hold the pre-parsed pci.ids data.  These are private
 | 
					 | 
				
			||||||
 * to the scanpci and pcidata modules.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef HAVE_XORG_CONFIG_H
 | 
					 | 
				
			||||||
#include <xorg-config.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef _XF86_PCISTR_H
 | 
					 | 
				
			||||||
#define _XF86_PCISTR_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct {
 | 
					 | 
				
			||||||
    unsigned short VendorID;
 | 
					 | 
				
			||||||
    unsigned short SubsystemID;
 | 
					 | 
				
			||||||
    const char *SubsystemName;
 | 
					 | 
				
			||||||
    unsigned short class;
 | 
					 | 
				
			||||||
} pciSubsystemInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct {
 | 
					 | 
				
			||||||
    unsigned short DeviceID;
 | 
					 | 
				
			||||||
    const char *DeviceName;
 | 
					 | 
				
			||||||
    const pciSubsystemInfo **Subsystem;
 | 
					 | 
				
			||||||
    unsigned short class;
 | 
					 | 
				
			||||||
} pciDeviceInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct {
 | 
					 | 
				
			||||||
    unsigned short VendorID;
 | 
					 | 
				
			||||||
    const char *VendorName;
 | 
					 | 
				
			||||||
    const pciDeviceInfo **Device;
 | 
					 | 
				
			||||||
} pciVendorInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct {
 | 
					 | 
				
			||||||
    unsigned short VendorID;
 | 
					 | 
				
			||||||
    const char *VendorName;
 | 
					 | 
				
			||||||
    const pciSubsystemInfo **Subsystem;
 | 
					 | 
				
			||||||
} pciVendorSubsysInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* _XF86_PCISTR_H */
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,346 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Display the Subsystem Vendor Id and Subsystem Id in order to identify
 | 
					 | 
				
			||||||
 * the cards installed in this computer
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * A lot of this comes from Robin Cutshaw's scanpci
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (c) 1995-2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
 * and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * This file is used to build both the scanpci and pcidata modules.
 | 
					 | 
				
			||||||
 * The interfaces have changed compared with XFree86 4.2.0 and earlier.
 | 
					 | 
				
			||||||
 * The data is no longer exported directly.  Lookup functions are provided.
 | 
					 | 
				
			||||||
 * This means that the data format can change in the future without affecting
 | 
					 | 
				
			||||||
 * the exported interfaces.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * The namespaces for pcidata and scanpci clash, so both modules can't be
 | 
					 | 
				
			||||||
 * loaded at the same time.  The X server should only load the scanpci module
 | 
					 | 
				
			||||||
 * when run with the '-scanpci' flag.  The main difference between the
 | 
					 | 
				
			||||||
 * two modules is size.  pcidata only holds the subset of data that is
 | 
					 | 
				
			||||||
 * "interesting" to the X server.  "Interesting" is determined by the
 | 
					 | 
				
			||||||
 * PCI_VENDOR_* defines in ../common/xf86PciInfo.h.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* XXX This is including a lot of stuff that modules should not include! */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef HAVE_XORG_CONFIG_H
 | 
					 | 
				
			||||||
#include <xorg-config.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <X11/X.h>
 | 
					 | 
				
			||||||
#include "os.h"
 | 
					 | 
				
			||||||
#include "xf86.h"
 | 
					 | 
				
			||||||
#include "xf86Priv.h"
 | 
					 | 
				
			||||||
#include "xf86Pci.h"
 | 
					 | 
				
			||||||
#include "xf86_OSproc.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <ctype.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef PCIDATA
 | 
					 | 
				
			||||||
#define VENDOR_INCLUDE_NONVIDEO
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#define INIT_SUBSYS_INFO
 | 
					 | 
				
			||||||
#define INIT_VENDOR_SUBSYS_INFO
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "xf86PciStr.h"
 | 
					 | 
				
			||||||
#include "xf86PciIds.h"
 | 
					 | 
				
			||||||
#include "xf86ScanPci.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "xf86Module.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef PCIDATA
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static XF86ModuleVersionInfo pciDataVersRec = {
 | 
					 | 
				
			||||||
	"pcidata",
 | 
					 | 
				
			||||||
	MODULEVENDORSTRING,
 | 
					 | 
				
			||||||
	MODINFOSTRING1,
 | 
					 | 
				
			||||||
	MODINFOSTRING2,
 | 
					 | 
				
			||||||
	XORG_VERSION_CURRENT,
 | 
					 | 
				
			||||||
	1, 0, 0,
 | 
					 | 
				
			||||||
	ABI_CLASS_VIDEODRV,
 | 
					 | 
				
			||||||
	ABI_VIDEODRV_VERSION,
 | 
					 | 
				
			||||||
	NULL,
 | 
					 | 
				
			||||||
	{0, 0, 0, 0}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
_X_EXPORT XF86ModuleData pcidataModuleData = { &pciDataVersRec, NULL, NULL };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#else 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static XF86ModuleVersionInfo scanPciVersRec = {
 | 
					 | 
				
			||||||
	"scanpci",
 | 
					 | 
				
			||||||
	MODULEVENDORSTRING,
 | 
					 | 
				
			||||||
	MODINFOSTRING1,
 | 
					 | 
				
			||||||
	MODINFOSTRING2,
 | 
					 | 
				
			||||||
	XORG_VERSION_CURRENT,
 | 
					 | 
				
			||||||
	1, 0, 0,
 | 
					 | 
				
			||||||
	ABI_CLASS_VIDEODRV,
 | 
					 | 
				
			||||||
	ABI_VIDEODRV_VERSION,
 | 
					 | 
				
			||||||
	NULL,
 | 
					 | 
				
			||||||
	{0, 0, 0, 0}
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
_X_EXPORT XF86ModuleData scanpciModuleData = { &scanPciVersRec, NULL, NULL };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* PCIDATA */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Initialisation/Close hooks, in case they're ever needed. */
 | 
					 | 
				
			||||||
Bool
 | 
					 | 
				
			||||||
ScanPciSetupPciIds(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    return TRUE;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					 | 
				
			||||||
ScanPciClosePciIds(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    return;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * The return value is the number of strings found, or -1 for an error.
 | 
					 | 
				
			||||||
 * Requested strings that aren't found are set to NULL.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int
 | 
					 | 
				
			||||||
ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
 | 
					 | 
				
			||||||
			 unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
			 const char **vname, const char **dname,
 | 
					 | 
				
			||||||
			 const char **svname, const char **sname)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i, j, k;
 | 
					 | 
				
			||||||
    const pciDeviceInfo **pDev;
 | 
					 | 
				
			||||||
    const pciSubsystemInfo **pSub;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* It's an error to not provide the Vendor */
 | 
					 | 
				
			||||||
    if (vendor == NOVENDOR)
 | 
					 | 
				
			||||||
	return -1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Initialise returns requested/provided to NULL */
 | 
					 | 
				
			||||||
    if (vname)
 | 
					 | 
				
			||||||
	*vname = NULL;
 | 
					 | 
				
			||||||
    if (device != NODEVICE && dname)
 | 
					 | 
				
			||||||
	*dname = NULL;
 | 
					 | 
				
			||||||
    if (svendor != NOVENDOR && svname)
 | 
					 | 
				
			||||||
	*svname = NULL;
 | 
					 | 
				
			||||||
    if (subsys != NOSUBSYS && sname)
 | 
					 | 
				
			||||||
	*sname = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (i = 0; pciVendorInfoList[i].VendorName; i++) {
 | 
					 | 
				
			||||||
	if (vendor == pciVendorInfoList[i].VendorID) {
 | 
					 | 
				
			||||||
	    if (vname) {
 | 
					 | 
				
			||||||
		*vname = pciVendorInfoList[i].VendorName;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    if (device == NODEVICE) {
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    pDev = pciVendorInfoList[i].Device;
 | 
					 | 
				
			||||||
	    if (!pDev) {
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    for (j = 0; pDev[j]; j++) {
 | 
					 | 
				
			||||||
		if (device == pDev[j]->DeviceID) {
 | 
					 | 
				
			||||||
		    if (dname) {
 | 
					 | 
				
			||||||
			*dname = pDev[j]->DeviceName;
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    if (svendor == NOVENDOR) {
 | 
					 | 
				
			||||||
			return 2;
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    for (k = 0; pciVendorInfoList[k].VendorName; k++) {
 | 
					 | 
				
			||||||
			if (svendor &&
 | 
					 | 
				
			||||||
			    svendor == pciVendorInfoList[k].VendorID) {
 | 
					 | 
				
			||||||
			    if (svname) {
 | 
					 | 
				
			||||||
				*svname = pciVendorInfoList[k].VendorName;
 | 
					 | 
				
			||||||
			    }
 | 
					 | 
				
			||||||
			    if (subsys == NOSUBSYS) {
 | 
					 | 
				
			||||||
				return 3;
 | 
					 | 
				
			||||||
			    }
 | 
					 | 
				
			||||||
			    break;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    if (!pciVendorInfoList[k].VendorName) {
 | 
					 | 
				
			||||||
			return 2;
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    pSub = pDev[j]->Subsystem;
 | 
					 | 
				
			||||||
		    if (!pSub) {
 | 
					 | 
				
			||||||
			return 3;
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    for (k = 0; pSub[k]; k++) {
 | 
					 | 
				
			||||||
			if (svendor == pSub[k]->VendorID &&
 | 
					 | 
				
			||||||
			    subsys == pSub[k]->SubsystemID) {
 | 
					 | 
				
			||||||
			    if (sname)
 | 
					 | 
				
			||||||
				*sname = pSub[k]->SubsystemName;
 | 
					 | 
				
			||||||
			    return 4;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    /* No vendor/subsys match */
 | 
					 | 
				
			||||||
		    return 3;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    /* No device match */
 | 
					 | 
				
			||||||
	    return 1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    /* No vendor match */
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Bool
 | 
					 | 
				
			||||||
ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
 | 
					 | 
				
			||||||
			 const char **svname, const char **sname)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i, j;
 | 
					 | 
				
			||||||
    const pciSubsystemInfo **pSub;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* It's an error to not provide the Vendor */
 | 
					 | 
				
			||||||
    if (svendor == NOVENDOR)
 | 
					 | 
				
			||||||
	return -1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Initialise returns requested/provided to NULL */
 | 
					 | 
				
			||||||
    if (svname)
 | 
					 | 
				
			||||||
	*svname = NULL;
 | 
					 | 
				
			||||||
    if (subsys != NOSUBSYS && sname)
 | 
					 | 
				
			||||||
	*sname = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (i = 0; pciVendorSubsysInfoList[i].VendorName; i++) {
 | 
					 | 
				
			||||||
	if (svendor == pciVendorSubsysInfoList[i].VendorID) {
 | 
					 | 
				
			||||||
	    if (svname) {
 | 
					 | 
				
			||||||
		*svname = pciVendorSubsysInfoList[i].VendorName;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    if (subsys == NOSUBSYS) {
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    pSub = pciVendorSubsysInfoList[i].Subsystem;
 | 
					 | 
				
			||||||
	    if (!pSub) {
 | 
					 | 
				
			||||||
		return 1;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    for (j = 0; pSub[j]; j++) {
 | 
					 | 
				
			||||||
		if (subsys == pSub[j]->SubsystemID) {
 | 
					 | 
				
			||||||
		    if (sname) {
 | 
					 | 
				
			||||||
			*sname = pSub[j]->SubsystemName;
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	    /* No subsys match */
 | 
					 | 
				
			||||||
	    return 1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    /* No vendor match */
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef PCIDATA
 | 
					 | 
				
			||||||
void
 | 
					 | 
				
			||||||
ScanPciDisplayPCICardInfo(int verbosity)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    pciConfigPtr pcrp, *pcrpp;
 | 
					 | 
				
			||||||
    int i;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xf86EnableIO();
 | 
					 | 
				
			||||||
    pcrpp = xf86scanpci(0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (pcrpp == NULL) {
 | 
					 | 
				
			||||||
        xf86MsgVerb(X_NONE,0,"No PCI info available\n");
 | 
					 | 
				
			||||||
	return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    xf86MsgVerb(X_NONE,0,"Probing for PCI devices (Bus:Device:Function)\n\n");
 | 
					 | 
				
			||||||
    for (i = 0; (pcrp = pcrpp[i]); i++) {
 | 
					 | 
				
			||||||
	const char *svendorname = NULL, *subsysname = NULL;
 | 
					 | 
				
			||||||
	const char *vendorname = NULL, *devicename = NULL;
 | 
					 | 
				
			||||||
	Bool noCard = FALSE;
 | 
					 | 
				
			||||||
	const char *prefix1 = "", *prefix2 = "";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	xf86MsgVerb(X_NONE, -verbosity, "(%d:%d:%d) ",
 | 
					 | 
				
			||||||
		    pcrp->busnum, pcrp->devnum, pcrp->funcnum);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/*
 | 
					 | 
				
			||||||
	 * Lookup as much as we can about the device.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
 | 
					 | 
				
			||||||
	    ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
 | 
					 | 
				
			||||||
				     NOVENDOR, NOSUBSYS,
 | 
					 | 
				
			||||||
				     &vendorname, &devicename, NULL, NULL);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
 | 
					 | 
				
			||||||
				     pcrp->pci_subsys_vendor,
 | 
					 | 
				
			||||||
				     pcrp->pci_subsys_card,
 | 
					 | 
				
			||||||
				     &vendorname, &devicename,
 | 
					 | 
				
			||||||
				     &svendorname, &subsysname);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (svendorname)
 | 
					 | 
				
			||||||
	    xf86MsgVerb(X_NONE, -verbosity, "%s ", svendorname);
 | 
					 | 
				
			||||||
	if (subsysname)
 | 
					 | 
				
			||||||
	    xf86MsgVerb(X_NONE, -verbosity, "%s ", subsysname);
 | 
					 | 
				
			||||||
	if (svendorname && !subsysname) {
 | 
					 | 
				
			||||||
	    if (pcrp->pci_subsys_card && pcrp->pci_subsys_card != NOSUBSYS) {
 | 
					 | 
				
			||||||
		xf86MsgVerb(X_NONE, -verbosity, "unknown card (0x%04x) ",
 | 
					 | 
				
			||||||
			    pcrp->pci_subsys_card);
 | 
					 | 
				
			||||||
	    } else {
 | 
					 | 
				
			||||||
		xf86MsgVerb(X_NONE, -verbosity, "card ");
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (!svendorname && !subsysname) {
 | 
					 | 
				
			||||||
	    /*
 | 
					 | 
				
			||||||
	     * We didn't find a text representation of the information 
 | 
					 | 
				
			||||||
	     * about the card.
 | 
					 | 
				
			||||||
	     */
 | 
					 | 
				
			||||||
	    if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
 | 
					 | 
				
			||||||
		/*
 | 
					 | 
				
			||||||
		 * If there was information and we just couldn't interpret
 | 
					 | 
				
			||||||
		 * it, print it out as unknown, anyway.
 | 
					 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		xf86MsgVerb(X_NONE, -verbosity,
 | 
					 | 
				
			||||||
			    "unknown card (0x%04x/0x%04x) ",
 | 
					 | 
				
			||||||
			    pcrp->pci_subsys_vendor, pcrp->pci_subsys_card);
 | 
					 | 
				
			||||||
	    } else
 | 
					 | 
				
			||||||
		noCard = TRUE;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (!noCard) {
 | 
					 | 
				
			||||||
	    prefix1 = "using a ";
 | 
					 | 
				
			||||||
	    prefix2 = "using an ";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (vendorname && devicename) {
 | 
					 | 
				
			||||||
	    xf86MsgVerb(X_NONE, -verbosity,"%s%s %s\n", prefix1, vendorname,
 | 
					 | 
				
			||||||
			devicename);
 | 
					 | 
				
			||||||
	} else if (vendorname) {
 | 
					 | 
				
			||||||
	    xf86MsgVerb(X_NONE, -verbosity,
 | 
					 | 
				
			||||||
			"%sunknown chip (DeviceId 0x%04x) from %s\n",
 | 
					 | 
				
			||||||
			prefix2, pcrp->pci_device, vendorname);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    xf86MsgVerb(X_NONE, -verbosity,
 | 
					 | 
				
			||||||
			"%sunknown chipset(0x%04x/0x%04x)\n",
 | 
					 | 
				
			||||||
			prefix2, pcrp->pci_vendor, pcrp->pci_device);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,49 +0,0 @@
 | 
				
			||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (c) 2000-2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
 * and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef HAVE_XORG_CONFIG_H
 | 
					 | 
				
			||||||
#include <xorg-config.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef SCANPCI_H_
 | 
					 | 
				
			||||||
#define SCANPCI_H_
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "xf86PciData.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef void (*ScanPciDisplayCardInfoProcPtr)(int verbosity);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Whoever loads this module needs to define these and initialise them
 | 
					 | 
				
			||||||
 * after loading.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
extern ScanPciDisplayCardInfoProcPtr xf86DisplayPCICardInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void ScanPciDisplayPCICardInfo(int verbosity);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,3 +0,0 @@
 | 
				
			||||||
pcitweak.1
 | 
					 | 
				
			||||||
pcitweak.1x
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,60 +0,0 @@
 | 
				
			||||||
# Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
 | 
					 | 
				
			||||||
# to whom the Software is furnished to do so, provided that the above
 | 
					 | 
				
			||||||
# copyright notice(s) and this permission notice appear in all copies of
 | 
					 | 
				
			||||||
# the Software and that both the above copyright notice(s) and this
 | 
					 | 
				
			||||||
# permission notice appear in supporting documentation.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
# 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
 | 
					 | 
				
			||||||
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 | 
					 | 
				
			||||||
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
 | 
					 | 
				
			||||||
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
 | 
					 | 
				
			||||||
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 | 
					 | 
				
			||||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 | 
					 | 
				
			||||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
# Except as contained in this notice, the name of a copyright holder
 | 
					 | 
				
			||||||
# shall not be used in advertising or otherwise to promote the sale, use
 | 
					 | 
				
			||||||
# or other dealings in this Software without prior written authorization
 | 
					 | 
				
			||||||
# of the copyright holder.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bin_PROGRAMS = pcitweak
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
XFREE86_SRCDIR 	= $(top_srcdir)/hw/xfree86
 | 
					 | 
				
			||||||
DUMMYLIB_SRCDIR	= $(XFREE86_SRCDIR)/dummylib
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
INCLUDES = $(XORG_INCS) -I$(DUMMYLIB_SRCDIR)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pcitweak_CFLAGS = $(XORG_CFLAGS)
 | 
					 | 
				
			||||||
pcitweak_LDADD = \
 | 
					 | 
				
			||||||
	../../os-support/libxorgos.la \
 | 
					 | 
				
			||||||
	../../dummylib/libdummy-nonserver.a \
 | 
					 | 
				
			||||||
	${SYS_LIBS}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pcitweak_SOURCES =	\
 | 
					 | 
				
			||||||
	pcitweak.c
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
appmandir = $(APP_MAN_DIR)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
appman_PRE = pcitweak.man
 | 
					 | 
				
			||||||
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
include $(top_srcdir)/cpprules.in
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
EXTRA_DIST = pcitweak.man.pre
 | 
					 | 
				
			||||||
BUILT_SOURCES = $(appman_PRE)
 | 
					 | 
				
			||||||
CLEANFILES = $(appman_PRE) $(appman_DATA)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SUFFIXES += .$(APP_MAN_SUFFIX) .man
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
.man.$(APP_MAN_SUFFIX):
 | 
					 | 
				
			||||||
	-rm -f $@
 | 
					 | 
				
			||||||
	$(LN_S) $< $@
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,242 +0,0 @@
 | 
				
			||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.17 2003/08/24 17:37:01 dawes Exp $ */
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
 | 
					 | 
				
			||||||
 * and author(s) 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 copyright holder(s) and author(s).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * pcitweak.c
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Author: David Dawes <dawes@xfree86.org>
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <X11/X.h>
 | 
					 | 
				
			||||||
#include "os.h"
 | 
					 | 
				
			||||||
#include "xf86.h"
 | 
					 | 
				
			||||||
#include "xf86Priv.h"
 | 
					 | 
				
			||||||
#include "xf86_OSproc.h"
 | 
					 | 
				
			||||||
#include "xf86Pci.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef __CYGWIN__
 | 
					 | 
				
			||||||
#include <getopt.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdarg.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#ifdef __linux__
 | 
					 | 
				
			||||||
/* to get getopt on Linux */
 | 
					 | 
				
			||||||
#ifndef __USE_POSIX2
 | 
					 | 
				
			||||||
#define __USE_POSIX2
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#include <unistd.h>
 | 
					 | 
				
			||||||
#if defined(ISC) || defined(Lynx)
 | 
					 | 
				
			||||||
extern char *optarg;
 | 
					 | 
				
			||||||
extern int optind, opterr;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pciVideoPtr *xf86PciVideoInfo = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void usage(void);
 | 
					 | 
				
			||||||
static Bool parsePciBusString(const char *id, int *bus, int *device, int *func);
 | 
					 | 
				
			||||||
static char *myname = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int
 | 
					 | 
				
			||||||
main(int argc, char *argv[])
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int c;
 | 
					 | 
				
			||||||
    PCITAG tag;
 | 
					 | 
				
			||||||
    int bus, device, func;
 | 
					 | 
				
			||||||
    Bool list = FALSE, rd = FALSE, wr = FALSE;
 | 
					 | 
				
			||||||
    Bool byte = FALSE, halfword = FALSE;
 | 
					 | 
				
			||||||
    int offset = 0;
 | 
					 | 
				
			||||||
    CARD32 value = 0;
 | 
					 | 
				
			||||||
    char *id = NULL, *end;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    myname = argv[0];
 | 
					 | 
				
			||||||
    while ((c = getopt(argc, argv, "bhlr:w:")) != -1) {
 | 
					 | 
				
			||||||
	switch (c) {
 | 
					 | 
				
			||||||
	case 'b':
 | 
					 | 
				
			||||||
	    byte = TRUE;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'h':
 | 
					 | 
				
			||||||
	    halfword = TRUE;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'l':
 | 
					 | 
				
			||||||
	    list = TRUE;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'r':
 | 
					 | 
				
			||||||
	    rd = TRUE;
 | 
					 | 
				
			||||||
	    id = optarg;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'w':
 | 
					 | 
				
			||||||
	    wr = TRUE;
 | 
					 | 
				
			||||||
	    id = optarg;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case '?':
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
	    usage();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    argc -= optind;
 | 
					 | 
				
			||||||
    argv += optind;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (list) {
 | 
					 | 
				
			||||||
	xf86Verbose = 2;
 | 
					 | 
				
			||||||
	xf86EnableIO();
 | 
					 | 
				
			||||||
	xf86scanpci(0);
 | 
					 | 
				
			||||||
	xf86DisableIO();
 | 
					 | 
				
			||||||
	exit(0);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (rd && wr)
 | 
					 | 
				
			||||||
	usage();
 | 
					 | 
				
			||||||
    if (wr && argc != 2)
 | 
					 | 
				
			||||||
	usage();
 | 
					 | 
				
			||||||
    if (rd && argc != 1)
 | 
					 | 
				
			||||||
	usage();
 | 
					 | 
				
			||||||
    if (byte && halfword)
 | 
					 | 
				
			||||||
	usage();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (rd || wr) {
 | 
					 | 
				
			||||||
	if (!parsePciBusString(id, &bus, &device, &func)) {
 | 
					 | 
				
			||||||
	    fprintf(stderr, "%s: Bad PCI ID string\n", myname);
 | 
					 | 
				
			||||||
	    usage();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	offset = strtoul(argv[0], &end, 0);
 | 
					 | 
				
			||||||
	if (*end != '\0') {
 | 
					 | 
				
			||||||
	    fprintf(stderr, "%s: Bad offset\n", myname);
 | 
					 | 
				
			||||||
	    usage();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (halfword) {
 | 
					 | 
				
			||||||
	    if (offset % 2) {
 | 
					 | 
				
			||||||
		fprintf(stderr, "%s: offset must be a multiple of two\n",
 | 
					 | 
				
			||||||
			myname);
 | 
					 | 
				
			||||||
		exit(1);
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	} else if (!byte) {
 | 
					 | 
				
			||||||
	    if (offset % 4) {
 | 
					 | 
				
			||||||
		fprintf(stderr, "%s: offset must be a multiple of four\n",
 | 
					 | 
				
			||||||
			myname);
 | 
					 | 
				
			||||||
		exit(1);
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
	usage();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    if (wr) {
 | 
					 | 
				
			||||||
	value = strtoul(argv[1], &end, 0);
 | 
					 | 
				
			||||||
	if (*end != '\0') {
 | 
					 | 
				
			||||||
	    fprintf(stderr, "%s: Bad value\n", myname);
 | 
					 | 
				
			||||||
	    usage();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xf86EnableIO();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /*
 | 
					 | 
				
			||||||
     * This is needed to setup all the buses.  Otherwise secondary buses
 | 
					 | 
				
			||||||
     * can't be accessed.
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    xf86scanpci(0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    tag = pciTag(bus, device, func);
 | 
					 | 
				
			||||||
    if (rd) {
 | 
					 | 
				
			||||||
	if (byte) {
 | 
					 | 
				
			||||||
	    printf("0x%02x\n", (unsigned int)pciReadByte(tag, offset) & 0xFF);
 | 
					 | 
				
			||||||
	} else if (halfword) {
 | 
					 | 
				
			||||||
	    printf("0x%04x\n", (unsigned int)pciReadWord(tag, offset) & 0xFFFF);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("0x%08lx\n", (unsigned long)pciReadLong(tag, offset));
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    } else if (wr) {
 | 
					 | 
				
			||||||
	if (byte) {
 | 
					 | 
				
			||||||
	    pciWriteByte(tag, offset, value & 0xFF);
 | 
					 | 
				
			||||||
	} else if (halfword) {
 | 
					 | 
				
			||||||
	    pciWriteWord(tag, offset, value & 0xFFFF);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    pciWriteLong(tag, offset, value);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xf86DisableIO();
 | 
					 | 
				
			||||||
    exit(0);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
usage()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    fprintf(stderr, "usage:\tpcitweak -l\n"
 | 
					 | 
				
			||||||
		    "\tpcitweak -r ID [-b | -h] offset\n"
 | 
					 | 
				
			||||||
		    "\tpcitweak -w ID [-b | -h] offset value\n"
 | 
					 | 
				
			||||||
		    "\n"
 | 
					 | 
				
			||||||
		    "\t\t-l  -- list\n"
 | 
					 | 
				
			||||||
		    "\t\t-r  -- read\n"
 | 
					 | 
				
			||||||
		    "\t\t-w  -- write\n"
 | 
					 | 
				
			||||||
		    "\t\t-b  -- read/write a single byte\n"
 | 
					 | 
				
			||||||
		    "\t\t-h  -- read/write a single halfword (16 bit)\n"
 | 
					 | 
				
			||||||
		    "\t\tID  -- PCI ID string in form bus:dev:func "
 | 
					 | 
				
			||||||
					"(all in hex)\n");
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
    exit(1);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Bool
 | 
					 | 
				
			||||||
parsePciBusString(const char *busID, int *bus, int *device, int *func)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    /*
 | 
					 | 
				
			||||||
     * The format is assumed to be "bus:device:func", where bus, device
 | 
					 | 
				
			||||||
     * and func are hexadecimal integers.  func may be omitted and assumed to
 | 
					 | 
				
			||||||
     * be zero, although it doing this isn't encouraged.
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    char *p, *s, *end;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    s = strdup(busID);
 | 
					 | 
				
			||||||
    p = strtok(s, ":");
 | 
					 | 
				
			||||||
    if (p == NULL || *p == 0)
 | 
					 | 
				
			||||||
	return FALSE;
 | 
					 | 
				
			||||||
    *bus = strtoul(p, &end, 16);
 | 
					 | 
				
			||||||
    if (*end != '\0')
 | 
					 | 
				
			||||||
	return FALSE;
 | 
					 | 
				
			||||||
    p = strtok(NULL, ":");
 | 
					 | 
				
			||||||
    if (p == NULL || *p == 0)
 | 
					 | 
				
			||||||
	return FALSE;
 | 
					 | 
				
			||||||
    *device = strtoul(p, &end, 16);
 | 
					 | 
				
			||||||
    if (*end != '\0')
 | 
					 | 
				
			||||||
	return FALSE;
 | 
					 | 
				
			||||||
    *func = 0;
 | 
					 | 
				
			||||||
    p = strtok(NULL, ":");
 | 
					 | 
				
			||||||
    if (p == NULL || *p == 0)
 | 
					 | 
				
			||||||
	return TRUE;
 | 
					 | 
				
			||||||
    *func = strtoul(p, &end, 16);
 | 
					 | 
				
			||||||
    if (*end != '\0')
 | 
					 | 
				
			||||||
	return FALSE;
 | 
					 | 
				
			||||||
    return TRUE;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "xf86getpagesize.c"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,64 +0,0 @@
 | 
				
			||||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.3 2001/01/27 18:20:56 dawes Exp $ 
 | 
					 | 
				
			||||||
.TH PCITWEAK 1 __vendorversion__
 | 
					 | 
				
			||||||
.SH NAME
 | 
					 | 
				
			||||||
pcitweak - read/write PCI config space
 | 
					 | 
				
			||||||
.SH SYNOPSIS
 | 
					 | 
				
			||||||
.B pcitweak
 | 
					 | 
				
			||||||
.B \-l
 | 
					 | 
				
			||||||
.br
 | 
					 | 
				
			||||||
.B pcitweak
 | 
					 | 
				
			||||||
.B \-r
 | 
					 | 
				
			||||||
.I PCI-ID
 | 
					 | 
				
			||||||
.RB [ \-b | \-h ]
 | 
					 | 
				
			||||||
.I offset
 | 
					 | 
				
			||||||
.br
 | 
					 | 
				
			||||||
.B pcitweak
 | 
					 | 
				
			||||||
.B \-w
 | 
					 | 
				
			||||||
.I PCI-ID
 | 
					 | 
				
			||||||
.RB [ \-b | \-h ]
 | 
					 | 
				
			||||||
.I offset
 | 
					 | 
				
			||||||
.I value
 | 
					 | 
				
			||||||
.SH DESCRIPTION
 | 
					 | 
				
			||||||
.I Pcitweak
 | 
					 | 
				
			||||||
is a utility that can be used to examine or change registers in the PCI
 | 
					 | 
				
			||||||
configuration space.  On most platforms
 | 
					 | 
				
			||||||
.I pcitweak
 | 
					 | 
				
			||||||
can only be run by the root user.
 | 
					 | 
				
			||||||
.SH OPTIONS
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-l
 | 
					 | 
				
			||||||
Probe the PCI buses and print a line for each detected device.  Each line
 | 
					 | 
				
			||||||
contains the bus location (bus:device:function), chip vendor/device, card
 | 
					 | 
				
			||||||
(subsystem) vendor/card, revision, class and header type.  All values
 | 
					 | 
				
			||||||
printed are in hexadecimal.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.BI "\-r " PCI-ID
 | 
					 | 
				
			||||||
Read the PCI configuration space register at
 | 
					 | 
				
			||||||
.I offset
 | 
					 | 
				
			||||||
for the PCI device at bus location
 | 
					 | 
				
			||||||
.IR PCI-ID .
 | 
					 | 
				
			||||||
.I PCI-ID
 | 
					 | 
				
			||||||
should be given in the form bus:device:function, with each value in
 | 
					 | 
				
			||||||
hexadecimal.  By default, a 32-bit register is read.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.BI "\-w " PCI-ID
 | 
					 | 
				
			||||||
Write
 | 
					 | 
				
			||||||
.I value
 | 
					 | 
				
			||||||
to the PCI configuration space register at
 | 
					 | 
				
			||||||
.I offset
 | 
					 | 
				
			||||||
for the PCI device at bus location
 | 
					 | 
				
			||||||
.IR PCI-ID .
 | 
					 | 
				
			||||||
.I PCI-ID
 | 
					 | 
				
			||||||
should be given in the form bus:device:function, with each value in
 | 
					 | 
				
			||||||
hexadecimal.  By default, a 32-bit register is written.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-b
 | 
					 | 
				
			||||||
Read or write an 8-bit value (byte).
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-h
 | 
					 | 
				
			||||||
Read or write a 16-bit value (halfword).
 | 
					 | 
				
			||||||
.SH "SEE ALSO"
 | 
					 | 
				
			||||||
scanpci(1)
 | 
					 | 
				
			||||||
.SH AUTHORS
 | 
					 | 
				
			||||||
David Dawes
 | 
					 | 
				
			||||||
.RI ( dawes@xfree86.org ).
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,2 +0,0 @@
 | 
				
			||||||
scanpci.1
 | 
					 | 
				
			||||||
scanpci.1x
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,62 +0,0 @@
 | 
				
			||||||
# Copyright 2005 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
 | 
					 | 
				
			||||||
# to whom the Software is furnished to do so, provided that the above
 | 
					 | 
				
			||||||
# copyright notice(s) and this permission notice appear in all copies of
 | 
					 | 
				
			||||||
# the Software and that both the above copyright notice(s) and this
 | 
					 | 
				
			||||||
# permission notice appear in supporting documentation.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
# 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
 | 
					 | 
				
			||||||
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 | 
					 | 
				
			||||||
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
 | 
					 | 
				
			||||||
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
 | 
					 | 
				
			||||||
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 | 
					 | 
				
			||||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 | 
					 | 
				
			||||||
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
# Except as contained in this notice, the name of a copyright holder
 | 
					 | 
				
			||||||
# shall not be used in advertising or otherwise to promote the sale, use
 | 
					 | 
				
			||||||
# or other dealings in this Software without prior written authorization
 | 
					 | 
				
			||||||
# of the copyright holder.
 | 
					 | 
				
			||||||
# 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bin_PROGRAMS = scanpci
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
XFREE86_SRCDIR 	= $(top_srcdir)/hw/xfree86
 | 
					 | 
				
			||||||
SCANPCI_SRCDIR 	= $(XFREE86_SRCDIR)/scanpci 
 | 
					 | 
				
			||||||
DUMMYLIB_SRCDIR	= $(XFREE86_SRCDIR)/dummylib
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
INCLUDES = $(XORG_INCS) -I$(SCANPCI_SRCDIR) -I$(DUMMYLIB_SRCDIR)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
scanpci_CFLAGS = $(XORG_CFLAGS)
 | 
					 | 
				
			||||||
scanpci_LDADD = \
 | 
					 | 
				
			||||||
	../../scanpci/libscanpci.la \
 | 
					 | 
				
			||||||
	../../os-support/libxorgos.la \
 | 
					 | 
				
			||||||
	../../dummylib/libdummy-nonserver.a \
 | 
					 | 
				
			||||||
	${SYS_LIBS}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
scanpci_SOURCES =	\
 | 
					 | 
				
			||||||
	scanpci.c
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
appmandir = $(APP_MAN_DIR)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
appman_PRE = scanpci.man
 | 
					 | 
				
			||||||
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
include $(top_srcdir)/cpprules.in
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
EXTRA_DIST = scanpci.man.pre
 | 
					 | 
				
			||||||
BUILT_SOURCES = $(appman_PRE)
 | 
					 | 
				
			||||||
CLEANFILES = $(appman_PRE) $(appman_DATA)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SUFFIXES += .$(APP_MAN_SUFFIX) .man
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
.man.$(APP_MAN_SUFFIX):
 | 
					 | 
				
			||||||
	-rm -f $@
 | 
					 | 
				
			||||||
	$(LN_S) $< $@
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,780 +0,0 @@
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * Copyright 2000 by Egbert Eich
 | 
					 | 
				
			||||||
 * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
 | 
					 | 
				
			||||||
 * Copyright 2002 by David Dawes
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Permission to use, copy, modify, distribute, and sell this software and its
 | 
					 | 
				
			||||||
 * documentation for any purpose is hereby granted without fee, provided that
 | 
					 | 
				
			||||||
 * the above copyright notice appear in all copies and that both that
 | 
					 | 
				
			||||||
 * copyright notice and this permission notice appear in supporting
 | 
					 | 
				
			||||||
 * documentation, and that the names of the above listed copyright holder(s)
 | 
					 | 
				
			||||||
 * not be used in advertising or publicity pertaining to distribution of
 | 
					 | 
				
			||||||
 * the software without specific, written prior permission.  The above listed
 | 
					 | 
				
			||||||
 * copyright holder(s) make(s) no representations about the suitability of this
 | 
					 | 
				
			||||||
 * software for any purpose.  It is provided "as is" without express or
 | 
					 | 
				
			||||||
 * implied warranty.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
 | 
					 | 
				
			||||||
 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 | 
					 | 
				
			||||||
 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
 | 
					 | 
				
			||||||
 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
 | 
					 | 
				
			||||||
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 | 
					 | 
				
			||||||
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 | 
					 | 
				
			||||||
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.91tsi Exp $ */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <X11/X.h>
 | 
					 | 
				
			||||||
#include "os.h"
 | 
					 | 
				
			||||||
#include "xf86.h"
 | 
					 | 
				
			||||||
#include "xf86Priv.h"
 | 
					 | 
				
			||||||
#include "xf86_OSproc.h"
 | 
					 | 
				
			||||||
#include "xf86Pci.h"
 | 
					 | 
				
			||||||
#include "xf86PciInfo.h"
 | 
					 | 
				
			||||||
#include "xf86ScanPci.h"
 | 
					 | 
				
			||||||
#include "dummylib.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdarg.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#ifdef __linux__
 | 
					 | 
				
			||||||
/* to get getopt on Linux */
 | 
					 | 
				
			||||||
#ifndef __USE_POSIX2
 | 
					 | 
				
			||||||
#define __USE_POSIX2
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
#include <unistd.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if defined(ISC) || defined(Lynx)
 | 
					 | 
				
			||||||
extern char *optarg;
 | 
					 | 
				
			||||||
extern int optind, opterr;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pciVideoPtr *xf86PciVideoInfo = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void usage(void);
 | 
					 | 
				
			||||||
static void identify_card(pciConfigPtr pcr, int verbose);
 | 
					 | 
				
			||||||
static void print_default_class(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_bridge_pci_class(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_mach64(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_i128(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_dc21050(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_simba(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_460gx_sac(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_460gx_pxb(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
static void print_460gx_gxb(pciConfigPtr pcr);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define MAX_DEV_PER_VENDOR 40
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct {
 | 
					 | 
				
			||||||
    unsigned int Vendor;
 | 
					 | 
				
			||||||
    struct {
 | 
					 | 
				
			||||||
	int DeviceID;
 | 
					 | 
				
			||||||
	void(*func)(pciConfigPtr);
 | 
					 | 
				
			||||||
    } Device[MAX_DEV_PER_VENDOR];
 | 
					 | 
				
			||||||
} pciVendorDevFuncInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static pciVendorDevFuncInfo vendorDeviceFuncInfo[] = {
 | 
					 | 
				
			||||||
    { PCI_VENDOR_ATI, {
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64CT, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64CX, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64ET, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GB, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GD, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GI, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GL, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GM, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GN, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GO, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GP, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GQ, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GR, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GS, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GT, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GU, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GV, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GW, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GX, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GY, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64GZ, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LB, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LD, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LG, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LI, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LM, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LN, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LP, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LQ, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LR, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64LS, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64VT, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64VU, print_mach64 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_MACH64VV, print_mach64 },
 | 
					 | 
				
			||||||
	{ 0x0000,  NULL } } },
 | 
					 | 
				
			||||||
    { PCI_VENDOR_DIGITAL, {
 | 
					 | 
				
			||||||
	{ PCI_CHIP_DC21050, print_dc21050},
 | 
					 | 
				
			||||||
	{ 0x0000, NULL } } },
 | 
					 | 
				
			||||||
    { PCI_VENDOR_NUMNINE, {
 | 
					 | 
				
			||||||
	{ PCI_CHIP_I128, print_i128 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_I128_2, print_i128 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_I128_T2R, print_i128 },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_I128_T2R4, print_i128 },
 | 
					 | 
				
			||||||
	{ 0x0000, NULL } } },
 | 
					 | 
				
			||||||
    { PCI_VENDOR_SUN, {
 | 
					 | 
				
			||||||
	{ PCI_CHIP_SIMBA, print_simba },
 | 
					 | 
				
			||||||
	{ 0x0000, NULL } } },
 | 
					 | 
				
			||||||
    { PCI_VENDOR_INTEL, {
 | 
					 | 
				
			||||||
	{ PCI_CHIP_460GX_SAC, print_460gx_sac },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_460GX_PXB, print_460gx_pxb },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_460GX_GXB_1, print_460gx_gxb },
 | 
					 | 
				
			||||||
	{ PCI_CHIP_460GX_WXB, print_460gx_pxb },	/* Uncertain */
 | 
					 | 
				
			||||||
	{ 0x0000, NULL } } },
 | 
					 | 
				
			||||||
    { 0x0000, {
 | 
					 | 
				
			||||||
	{ 0x0000, NULL } } }
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
usage(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf("Usage: scanpci [-v12OfV]\n");
 | 
					 | 
				
			||||||
    printf("           -v print config space\n");
 | 
					 | 
				
			||||||
    printf("           -1 config type 1\n");
 | 
					 | 
				
			||||||
    printf("           -2 config type 2\n");
 | 
					 | 
				
			||||||
    printf("           -O use OS config support\n");
 | 
					 | 
				
			||||||
    printf("           -f force config type\n");
 | 
					 | 
				
			||||||
    printf("           -V set message verbosity level\n");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int
 | 
					 | 
				
			||||||
main(int argc, char *argv[])
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    pciConfigPtr *pcrpp = NULL;
 | 
					 | 
				
			||||||
    int Verbose = 0;
 | 
					 | 
				
			||||||
    int i = 0;
 | 
					 | 
				
			||||||
    int force = 0;
 | 
					 | 
				
			||||||
    int c;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xf86Info.pciFlags = PCIProbe1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while ((c = getopt(argc, argv, "?v12OfV:")) != -1)
 | 
					 | 
				
			||||||
	switch(c) {
 | 
					 | 
				
			||||||
	case 'v':
 | 
					 | 
				
			||||||
	    Verbose = 1;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case '1':
 | 
					 | 
				
			||||||
	    xf86Info.pciFlags = PCIProbe1;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case '2':
 | 
					 | 
				
			||||||
	    xf86Info.pciFlags = PCIProbe2;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'O':
 | 
					 | 
				
			||||||
	    xf86Info.pciFlags = PCIOsConfig;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'f':
 | 
					 | 
				
			||||||
	    force = 1;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case 'V':
 | 
					 | 
				
			||||||
	    xf86Verbose = atoi(optarg);
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case '?':
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
	    usage();
 | 
					 | 
				
			||||||
	    exit (1);
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (force)
 | 
					 | 
				
			||||||
	switch (xf86Info.pciFlags) {
 | 
					 | 
				
			||||||
	case PCIProbe1:
 | 
					 | 
				
			||||||
	    xf86Info.pciFlags = PCIForceConfig1;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	case PCIProbe2:
 | 
					 | 
				
			||||||
	    xf86Info.pciFlags = PCIForceConfig2;
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
	    break;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pcrpp = xf86scanpci(0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!pcrpp) {
 | 
					 | 
				
			||||||
	printf("No PCI devices found\n");
 | 
					 | 
				
			||||||
	xf86DisableIO();
 | 
					 | 
				
			||||||
	exit (1);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (pcrpp[i])
 | 
					 | 
				
			||||||
	identify_card(pcrpp[i++],Verbose);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    xf86DisableIO();
 | 
					 | 
				
			||||||
    exit(0);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
identify_card(pciConfigPtr pcr, int verbose)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i, j;
 | 
					 | 
				
			||||||
    int foundit = 0;
 | 
					 | 
				
			||||||
    int foundvendor = 0;
 | 
					 | 
				
			||||||
    const char *vname = NULL, *dname = NULL, *svname = NULL, *sname = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pciVendorDevFuncInfo *vdf = vendorDeviceFuncInfo;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!ScanPciSetupPciIds()) {
 | 
					 | 
				
			||||||
	fprintf(stderr, "xf86SetupPciIds() failed\n");
 | 
					 | 
				
			||||||
	exit(1);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    printf("\npci bus 0x%04x cardnum 0x%02x function 0x%02x:"
 | 
					 | 
				
			||||||
	   " vendor 0x%04x device 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->busnum, pcr->devnum, pcr->funcnum,
 | 
					 | 
				
			||||||
	   pcr->pci_vendor, pcr->pci_device);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ScanPciFindPciNamesByDevice(pcr->pci_vendor, pcr->pci_device,
 | 
					 | 
				
			||||||
			     pcr->pci_subsys_vendor, pcr->pci_subsys_card,
 | 
					 | 
				
			||||||
			     &vname, &dname, &svname, &sname);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (vname) {
 | 
					 | 
				
			||||||
	printf(" %s ", vname);
 | 
					 | 
				
			||||||
	if (dname) {
 | 
					 | 
				
			||||||
	    printf("%s", dname);
 | 
					 | 
				
			||||||
	    foundit = 1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!foundit)
 | 
					 | 
				
			||||||
	printf(" Device unknown\n");
 | 
					 | 
				
			||||||
    else {
 | 
					 | 
				
			||||||
	printf("\n");
 | 
					 | 
				
			||||||
	if (verbose) {
 | 
					 | 
				
			||||||
	    for (i = 0;  vdf[i].Vendor;  i++) {
 | 
					 | 
				
			||||||
		if (vdf[i].Vendor == pcr->pci_vendor) {
 | 
					 | 
				
			||||||
		    for (j = 0;  vdf[i].Device[j].DeviceID;  j++) {
 | 
					 | 
				
			||||||
			if (vdf[i].Device[j].DeviceID == pcr->pci_device) {
 | 
					 | 
				
			||||||
			    (*vdf[i].Device[j].func)(pcr);
 | 
					 | 
				
			||||||
			    return;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		    }
 | 
					 | 
				
			||||||
		    break;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (verbose && !(pcr->pci_header_type & 0x7f) &&
 | 
					 | 
				
			||||||
	(pcr->pci_subsys_vendor != 0 || pcr->pci_subsys_card != 0) &&
 | 
					 | 
				
			||||||
	((pcr->pci_subsys_vendor != NOVENDOR)
 | 
					 | 
				
			||||||
	 || (pcr->pci_subsys_card != NOSUBSYS)) &&
 | 
					 | 
				
			||||||
	(pcr->pci_vendor != pcr->pci_subsys_vendor ||
 | 
					 | 
				
			||||||
	 pcr->pci_device != pcr->pci_subsys_card)) {
 | 
					 | 
				
			||||||
	foundit = 0;
 | 
					 | 
				
			||||||
	foundvendor = 0;
 | 
					 | 
				
			||||||
	printf(" CardVendor 0x%04x card 0x%04x",
 | 
					 | 
				
			||||||
	       pcr->pci_subsys_vendor, pcr->pci_subsys_card);
 | 
					 | 
				
			||||||
	if (svname) {
 | 
					 | 
				
			||||||
	    printf(" (%s", svname);
 | 
					 | 
				
			||||||
	    foundvendor = 1;
 | 
					 | 
				
			||||||
	    if (sname) {
 | 
					 | 
				
			||||||
		printf(" %s)", sname);
 | 
					 | 
				
			||||||
		foundit = 1;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!foundit) {
 | 
					 | 
				
			||||||
	    if (!foundvendor)
 | 
					 | 
				
			||||||
		printf(" (");
 | 
					 | 
				
			||||||
	    else
 | 
					 | 
				
			||||||
		printf(", ");
 | 
					 | 
				
			||||||
	    printf("Card unknown)");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	printf("\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (verbose) {
 | 
					 | 
				
			||||||
	printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
	printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	       pcr->pci_rev_id);
 | 
					 | 
				
			||||||
	if ((pcr->pci_base_class == PCI_CLASS_BRIDGE) &&
 | 
					 | 
				
			||||||
	    (pcr->pci_sub_class == PCI_SUBCLASS_BRIDGE_PCI))
 | 
					 | 
				
			||||||
	    print_bridge_pci_class(pcr);
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
	    print_default_class(pcr);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_default_class(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf("  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
 | 
					 | 
				
			||||||
	   pcr->pci_cache_line_size);
 | 
					 | 
				
			||||||
    if (pcr->pci_base0) {
 | 
					 | 
				
			||||||
	if ((pcr->pci_base0 & 0x7) == 0x4) {
 | 
					 | 
				
			||||||
	    printf("  BASE0     0x%08x%08x  addr 0x%08x%08x  MEM%s 64BIT\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base1, (int)pcr->pci_base0,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base1,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base0 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base0 & 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  BASE0     0x%08x  addr 0x%08x  %s%s\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base0,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base0 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base0 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
		   ((pcr->pci_base0 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ((pcr->pci_base1) && ((pcr->pci_base0 & 0x7) != 0x4)) {
 | 
					 | 
				
			||||||
	if ((pcr->pci_base1 & 0x7) == 0x4) {
 | 
					 | 
				
			||||||
	    printf("  BASE1     0x%08x%08x  addr 0x%08x%08x  MEM%s 64BIT\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base2, (int)pcr->pci_base1,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base2,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base1 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base1 & 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  BASE1     0x%08x  addr 0x%08x  %s%s\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base1,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base1 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base1 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
		   ((pcr->pci_base1 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ((pcr->pci_base2) && ((pcr->pci_base1 & 0x7) != 0x4)) {
 | 
					 | 
				
			||||||
	if ((pcr->pci_base2 & 0x7) == 0x4) {
 | 
					 | 
				
			||||||
	    printf("  BASE2     0x%08x%08x  addr 0x%08x%08x  MEM%s 64BIT\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base3, (int)pcr->pci_base2,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base3,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base2 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base2 & 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  BASE2     0x%08x  addr 0x%08x  %s%s\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base2,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base2 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base2 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
		   ((pcr->pci_base2 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ((pcr->pci_base3) && ((pcr->pci_base2 & 0x7) != 0x4)) {
 | 
					 | 
				
			||||||
	if ((pcr->pci_base3 & 0x7) == 0x4) {
 | 
					 | 
				
			||||||
	    printf("  BASE3     0x%08x%08x  addr 0x%08x%08x  MEM%s 64BIT\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base4, (int)pcr->pci_base3,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base4,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base3 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base3 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base3 & 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  BASE3     0x%08x  addr 0x%08x  %s%s\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base3,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base3 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base3 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base3 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
		   ((pcr->pci_base3 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ((pcr->pci_base4) && ((pcr->pci_base3 & 0x7) != 0x4)) {
 | 
					 | 
				
			||||||
	if ((pcr->pci_base4 & 0x7) == 0x4) {
 | 
					 | 
				
			||||||
	    printf("  BASE4     0x%08x%08x  addr 0x%08x%08x  MEM%s 64BIT\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base5, (int)pcr->pci_base4,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base5,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base4 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base4 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base4 & 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  BASE4     0x%08x  addr 0x%08x  %s%s\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_base4,
 | 
					 | 
				
			||||||
		   (int)(pcr->pci_base4 &
 | 
					 | 
				
			||||||
			 (pcr->pci_base4 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
		   (pcr->pci_base4 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
		   ((pcr->pci_base4 & 0x9) == 0x8) ? " PREFETCHABLE" :"");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if ((pcr->pci_base5) && ((pcr->pci_base4 & 0x7) != 0x4)) {
 | 
					 | 
				
			||||||
	printf("  BASE5     0x%08x  addr 0x%08x  %s%s%s\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_base5,
 | 
					 | 
				
			||||||
	       (int)(pcr->pci_base5 &
 | 
					 | 
				
			||||||
		     (pcr->pci_base5 & 0x1 ?  0xFFFFFFFC : 0xFFFFFFF0)),
 | 
					 | 
				
			||||||
	       (pcr->pci_base5 & 0x1) ? "I/O" : "MEM",
 | 
					 | 
				
			||||||
	       ((pcr->pci_base5 & 0x9) == 0x8) ? " PREFETCHABLE" :"",
 | 
					 | 
				
			||||||
	       ((pcr->pci_base5 & 0x7) == 0x4) ? " 64BIT" : "");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (pcr->pci_baserom)
 | 
					 | 
				
			||||||
	printf("  BASEROM   0x%08x  addr 0x%08x  %sdecode-enabled\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
 | 
					 | 
				
			||||||
	       pcr->pci_baserom & 0x1 ? "" : "not-");
 | 
					 | 
				
			||||||
    if (pcr->pci_max_min_ipin_iline)
 | 
					 | 
				
			||||||
	printf("  MAX_LAT   0x%02x  MIN_GNT 0x%02x"
 | 
					 | 
				
			||||||
	       "  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_max_lat, pcr->pci_min_gnt,
 | 
					 | 
				
			||||||
	       pcr->pci_int_pin, pcr->pci_int_line);
 | 
					 | 
				
			||||||
    if (pcr->pci_user_config)
 | 
					 | 
				
			||||||
	printf("  BYTE_0    0x%02x  BYTE_1  0x%02x"
 | 
					 | 
				
			||||||
	       "  BYTE_2  0x%02x  BYTE_3  0x%02x\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_user_config_0, (int)pcr->pci_user_config_1,
 | 
					 | 
				
			||||||
	       (int)pcr->pci_user_config_2, (int)pcr->pci_user_config_3);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define PCI_B_FAST_B_B 0x80
 | 
					 | 
				
			||||||
#define PCI_B_SB_RESET 0x40
 | 
					 | 
				
			||||||
#define PCI_B_M_ABORT  0x20
 | 
					 | 
				
			||||||
#define PCI_B_VGA_EN   0x08
 | 
					 | 
				
			||||||
#define PCI_B_ISA_EN   0x04
 | 
					 | 
				
			||||||
#define PCI_B_SERR_EN  0x02
 | 
					 | 
				
			||||||
#define PCI_B_P_ERR    0x01
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_bridge_pci_class(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf("  HEADER    0x%02x  LATENCY 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_header_type, pcr->pci_latency_timer);
 | 
					 | 
				
			||||||
    printf("  PRIBUS    0x%02x  SECBUS 0x%02x  SUBBUS 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
 | 
					 | 
				
			||||||
	   pcr->pci_subordinate_bus_number);
 | 
					 | 
				
			||||||
    printf("  SECLT     0x%02x  SECSTATUS 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_secondary_latency_timer, pcr->pci_secondary_status);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (pcr->pci_io_base || pcr->pci_io_limit ||
 | 
					 | 
				
			||||||
	pcr->pci_upper_io_base || pcr->pci_upper_io_limit) {
 | 
					 | 
				
			||||||
	if (((pcr->pci_io_base & 0x0f) == 0x01) ||
 | 
					 | 
				
			||||||
	    ((pcr->pci_io_limit & 0x0f) == 0x01)) {
 | 
					 | 
				
			||||||
	    printf("  IOBASE    0x%04x%04x  IOLIM 0x%04x%04x\n",
 | 
					 | 
				
			||||||
		   pcr->pci_upper_io_base, (pcr->pci_io_base & 0x00f0) << 8,
 | 
					 | 
				
			||||||
		   pcr->pci_upper_io_limit, (pcr->pci_io_limit << 8) | 0x0fff);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  IOBASE    0x%04x  IOLIM 0x%04x\n",
 | 
					 | 
				
			||||||
		   (pcr->pci_io_base & 0x00f0) << 8,
 | 
					 | 
				
			||||||
		   (pcr->pci_io_limit << 8) | 0x0fff);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (pcr->pci_mem_base || pcr->pci_mem_limit)
 | 
					 | 
				
			||||||
	printf("  NOPREFETCH_MEMBASE 0x%08x  MEMLIM 0x%08x\n",
 | 
					 | 
				
			||||||
	       (pcr->pci_mem_base & 0x00fff0) << 16,
 | 
					 | 
				
			||||||
	       (pcr->pci_mem_limit << 16) | 0x0fffff);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (pcr->pci_prefetch_mem_base || pcr->pci_prefetch_mem_limit ||
 | 
					 | 
				
			||||||
	pcr->pci_prefetch_upper_mem_base ||
 | 
					 | 
				
			||||||
	pcr->pci_prefetch_upper_mem_limit) {
 | 
					 | 
				
			||||||
	if (((pcr->pci_prefetch_mem_base & 0x0f) == 0x01) ||
 | 
					 | 
				
			||||||
	    ((pcr->pci_prefetch_mem_limit & 0x0f) == 0x01)) {
 | 
					 | 
				
			||||||
	    printf("  PREFETCH_MEMBASE   0x%08x%08x  MEMLIM 0x%08x%08x\n",
 | 
					 | 
				
			||||||
		   (int)pcr->pci_prefetch_upper_mem_base,
 | 
					 | 
				
			||||||
		   (pcr->pci_prefetch_mem_base & 0x00fff0) << 16,
 | 
					 | 
				
			||||||
		   (int)pcr->pci_prefetch_upper_mem_limit,
 | 
					 | 
				
			||||||
		   (pcr->pci_prefetch_mem_limit << 16) | 0x0fffff);
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
	    printf("  PREFETCH_MEMBASE   0x%08x  MEMLIM 0x%08x\n",
 | 
					 | 
				
			||||||
		   (pcr->pci_prefetch_mem_base & 0x00fff0) << 16,
 | 
					 | 
				
			||||||
		   (pcr->pci_prefetch_mem_limit << 16) | 0x0fffff);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    printf("  %sFAST_B2B %sSEC_BUS_RST %sM_ABRT %sVGA_EN %sISA_EN"
 | 
					 | 
				
			||||||
	   " %sSERR_EN %sPERR_EN\n",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_FAST_B_B) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_SB_RESET) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_M_ABORT) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_VGA_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_ISA_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_SERR_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_P_ERR) ? "" : "NO_");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_mach64(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    CARD32 sparse_io = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    printf(" CardVendor 0x%04x card 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_subsys_vendor, pcr->pci_subsys_card);
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class,
 | 
					 | 
				
			||||||
	   pcr->pci_prog_if, pcr->pci_rev_id);
 | 
					 | 
				
			||||||
    printf("  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
 | 
					 | 
				
			||||||
	   pcr->pci_cache_line_size);
 | 
					 | 
				
			||||||
    if (pcr->pci_base0)
 | 
					 | 
				
			||||||
	printf("  APBASE    0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_base0, (int)(pcr->pci_base0 &
 | 
					 | 
				
			||||||
		(pcr->pci_base0 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
 | 
					 | 
				
			||||||
    if (pcr->pci_base1)
 | 
					 | 
				
			||||||
	printf("  BLOCKIO   0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_base1, (int)(pcr->pci_base1 &
 | 
					 | 
				
			||||||
		(pcr->pci_base1 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
 | 
					 | 
				
			||||||
    if (pcr->pci_base2)
 | 
					 | 
				
			||||||
	printf("  REGBASE   0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_base2, (int)(pcr->pci_base2 &
 | 
					 | 
				
			||||||
		(pcr->pci_base2 & 0x1 ? 0xFFFFFFFC : 0xFFFFFFF0)));
 | 
					 | 
				
			||||||
    if (pcr->pci_baserom)
 | 
					 | 
				
			||||||
	printf("  BASEROM   0x%08x  addr 0x%08x  %sdecode-enabled\n",
 | 
					 | 
				
			||||||
	       (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
 | 
					 | 
				
			||||||
	       pcr->pci_baserom & 0x1 ? "" : "not-");
 | 
					 | 
				
			||||||
    if (pcr->pci_max_min_ipin_iline)
 | 
					 | 
				
			||||||
	printf("  MAX_LAT   0x%02x  MIN_GNT 0x%02x"
 | 
					 | 
				
			||||||
	       "  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_max_lat, pcr->pci_min_gnt,
 | 
					 | 
				
			||||||
	       pcr->pci_int_pin, pcr->pci_int_line);
 | 
					 | 
				
			||||||
    switch (pcr->pci_user_config_0 & 0x03) {
 | 
					 | 
				
			||||||
    case 0:
 | 
					 | 
				
			||||||
	sparse_io = 0x2ec;
 | 
					 | 
				
			||||||
	break;
 | 
					 | 
				
			||||||
    case 1:
 | 
					 | 
				
			||||||
	sparse_io = 0x1cc;
 | 
					 | 
				
			||||||
	break;
 | 
					 | 
				
			||||||
    case 2:
 | 
					 | 
				
			||||||
	sparse_io = 0x1c8;
 | 
					 | 
				
			||||||
	break;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    printf("  SPARSEIO  0x%03x    %s IO enabled    %sable 0x46E8\n",
 | 
					 | 
				
			||||||
	   (int)sparse_io, pcr->pci_user_config_0 & 0x04 ? "Block" : "Sparse",
 | 
					 | 
				
			||||||
	   pcr->pci_user_config_0 & 0x08 ? "Dis" : "En");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_i128(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf(" CardVendor 0x%04x card 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_subsys_vendor, pcr->pci_subsys_card);
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
    printf("  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
 | 
					 | 
				
			||||||
	   pcr->pci_cache_line_size);
 | 
					 | 
				
			||||||
    printf("  MW0_AD    0x%08x  addr 0x%08x  %spre-fetchable\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base0, (int)(pcr->pci_base0 & 0xFFC00000),
 | 
					 | 
				
			||||||
	   pcr->pci_base0 & 0x8 ? "" : "not-");
 | 
					 | 
				
			||||||
    printf("  MW1_AD    0x%08x  addr 0x%08x  %spre-fetchable\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base1, (int)(pcr->pci_base1 & 0xFFC00000),
 | 
					 | 
				
			||||||
	   pcr->pci_base1 & 0x8 ? "" : "not-");
 | 
					 | 
				
			||||||
    printf("  XYW_AD(A) 0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base2, (int)(pcr->pci_base2 & 0xFFC00000));
 | 
					 | 
				
			||||||
    printf("  XYW_AD(B) 0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base3, (int)(pcr->pci_base3 & 0xFFC00000));
 | 
					 | 
				
			||||||
    printf("  RBASE_G   0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base4, (int)(pcr->pci_base4 & 0xFFFF0000));
 | 
					 | 
				
			||||||
    printf("  IO        0x%08x  addr 0x%08x\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_base5, (int)(pcr->pci_base5 & 0xFFFFFF00));
 | 
					 | 
				
			||||||
    printf("  RBASE_E   0x%08x  addr 0x%08x  %sdecode-enabled\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
 | 
					 | 
				
			||||||
	   pcr->pci_baserom & 0x1 ? "" : "not-");
 | 
					 | 
				
			||||||
    if (pcr->pci_max_min_ipin_iline)
 | 
					 | 
				
			||||||
	printf("  MAX_LAT   0x%02x  MIN_GNT 0x%02x"
 | 
					 | 
				
			||||||
	       "  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_max_lat, pcr->pci_min_gnt,
 | 
					 | 
				
			||||||
	       pcr->pci_int_pin, pcr->pci_int_line);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_dc21050(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
    printf("  BIST      0x%02x  HEADER 0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_bist, pcr->pci_header_type, pcr->pci_latency_timer,
 | 
					 | 
				
			||||||
	   pcr->pci_cache_line_size);
 | 
					 | 
				
			||||||
    printf("  PRIBUS    0x%02x  SECBUS 0x%02x  SUBBUS 0x%02x  SECLT 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
 | 
					 | 
				
			||||||
	   pcr->pci_subordinate_bus_number, pcr->pci_secondary_latency_timer);
 | 
					 | 
				
			||||||
    printf("  IOBASE    0x%02x  IOLIM 0x%02x  SECSTATUS 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_io_base << 8, (pcr->pci_io_limit << 8) | 0xfff,
 | 
					 | 
				
			||||||
	   pcr->pci_secondary_status);
 | 
					 | 
				
			||||||
    printf("  NOPREFETCH_MEMBASE 0x%08x  MEMLIM 0x%08x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_mem_base << 16, (pcr->pci_mem_limit << 16) | 0xfffff);
 | 
					 | 
				
			||||||
    printf("  PREFETCH_MEMBASE   0x%08x  MEMLIM 0x%08x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_prefetch_mem_base << 16,
 | 
					 | 
				
			||||||
	   (pcr->pci_prefetch_mem_limit << 16) | 0xfffff);
 | 
					 | 
				
			||||||
    printf("  RBASE_E   0x%08x  addr 0x%08x  %sdecode-enabled\n",
 | 
					 | 
				
			||||||
	   (int)pcr->pci_baserom, (int)(pcr->pci_baserom & 0xFFFF8000),
 | 
					 | 
				
			||||||
	   pcr->pci_baserom & 0x1 ? "" : "not-");
 | 
					 | 
				
			||||||
    if (pcr->pci_max_min_ipin_iline)
 | 
					 | 
				
			||||||
	printf("  MAX_LAT   0x%02x  MIN_GNT 0x%02x"
 | 
					 | 
				
			||||||
	       "  INT_PIN 0x%02x  INT_LINE 0x%02x\n",
 | 
					 | 
				
			||||||
	       pcr->pci_max_lat, pcr->pci_min_gnt,
 | 
					 | 
				
			||||||
	       pcr->pci_int_pin, pcr->pci_int_line);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_simba(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int   i;
 | 
					 | 
				
			||||||
    CARD8 io, mem;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
    printf("  HEADER    0x%02x  LATENCY 0x%02x  CACHE 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_header_type, pcr->pci_latency_timer,
 | 
					 | 
				
			||||||
	   pcr->pci_cache_line_size);
 | 
					 | 
				
			||||||
    printf("  PRIBUS    0x%02x  SECBUS 0x%02x  SUBBUS 0x%02x  SECLT 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_primary_bus_number, pcr->pci_secondary_bus_number,
 | 
					 | 
				
			||||||
	   pcr->pci_subordinate_bus_number, pcr->pci_secondary_latency_timer);
 | 
					 | 
				
			||||||
    printf("  SECSTATUS 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_secondary_status);
 | 
					 | 
				
			||||||
    printf("  %sFAST_B2B %sSEC_BUS_RST %sM_ABRT %sVGA_EN %sISA_EN"
 | 
					 | 
				
			||||||
	   " %sSERR_EN %sPERR_EN\n",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_FAST_B_B) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_SB_RESET) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_M_ABORT) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_VGA_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_ISA_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_SERR_EN) ? "" : "NO_",
 | 
					 | 
				
			||||||
	   (pcr->pci_bridge_control & PCI_B_P_ERR) ? "" : "NO_");
 | 
					 | 
				
			||||||
    printf("  TICK      0x%08lx         SECCNTL 0x%02x\n", (long)
 | 
					 | 
				
			||||||
	   pciReadLong(pcr->tag, 0x00b0), pciReadByte(pcr->tag, 0x00dd));
 | 
					 | 
				
			||||||
    printf("  MASTER RETRIES:  PRIMARY 0x%02x,  SECONDARY 0x%02x\n",
 | 
					 | 
				
			||||||
	   pciReadByte(pcr->tag, 0x00c0), pciReadByte(pcr->tag, 0x00dc));
 | 
					 | 
				
			||||||
    printf("  TARGET RETRIES:  PIO     0x%02x,  DMA       0x%02x\n",
 | 
					 | 
				
			||||||
	   pciReadByte(pcr->tag, 0x00d8), pciReadByte(pcr->tag, 0x00da));
 | 
					 | 
				
			||||||
    printf("  TARGET LATENCY:  PIO     0x%02x,  DMA       0x%02x\n",
 | 
					 | 
				
			||||||
	   pciReadByte(pcr->tag, 0x00d9), pciReadByte(pcr->tag, 0x00db));
 | 
					 | 
				
			||||||
    printf("  DMA AFSR  0x%08lx%08lx    AFAR 0x%08lx%08lx\n",
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00cc),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00c8),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00d4),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00d0));
 | 
					 | 
				
			||||||
    printf("  PIO AFSR  0x%08lx%08lx    AFAR 0x%08lx%08lx\n",
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00ec),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00e8),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00f4),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00f0));
 | 
					 | 
				
			||||||
    printf("  PCI CNTL  0x%08lx%08lx    DIAG 0x%08lx%08lx\n",
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00e4),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00e0),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00fc),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x00f8));
 | 
					 | 
				
			||||||
    printf("  MAPS:            I/O     0x%02x,  MEM       0x%02x\n",
 | 
					 | 
				
			||||||
	   (io  = pciReadByte(pcr->tag, 0x00de)),
 | 
					 | 
				
			||||||
	   (mem = pciReadByte(pcr->tag, 0x00df)));
 | 
					 | 
				
			||||||
    for (i = 0;  i < 8;  i++)
 | 
					 | 
				
			||||||
	if (io & (1 << i))
 | 
					 | 
				
			||||||
	    printf("  BUS I/O  0x%06x-0x%06x\n", i << 21, ((i + 1) << 21) - 1);
 | 
					 | 
				
			||||||
    for (i = 0;  i < 8;  i++)
 | 
					 | 
				
			||||||
	if (mem & (1 << i))
 | 
					 | 
				
			||||||
	    printf("  BUS MEM  0x%08x-0x%08x\n", i << 29, ((i + 1) << 29) - 1);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static int cbn_460gx = -1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_460gx_sac(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    CARD32 tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Print generalities */
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    tmp = pcr->pci_user_config;
 | 
					 | 
				
			||||||
    pcr->pci_user_config = 0;
 | 
					 | 
				
			||||||
    print_default_class(pcr);
 | 
					 | 
				
			||||||
    pcr->pci_user_config = tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Only print what XFree86 might be interested in */
 | 
					 | 
				
			||||||
    if (pcr->busnum == 0) {
 | 
					 | 
				
			||||||
	if ((pcr->devnum != 0x10) || (pcr->funcnum != 0))
 | 
					 | 
				
			||||||
	    return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Get Chipset Bus Number */
 | 
					 | 
				
			||||||
	cbn_460gx = (unsigned int)pciReadByte(pcr->tag, 0x0040);
 | 
					 | 
				
			||||||
	printf("  CBN       0x%02x  CBUSES 0x%02x\n",
 | 
					 | 
				
			||||||
	       cbn_460gx, pciReadByte(pcr->tag, 0x0044));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if ((pcr->busnum != cbn_460gx) || (pcr->funcnum != 0))
 | 
					 | 
				
			||||||
	return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    switch (pcr->devnum) {
 | 
					 | 
				
			||||||
    case 0:
 | 
					 | 
				
			||||||
	printf("  F16NUM    0x%02x  F16CPL 0x%02x  DEVNPRES 0x%08lx\n",
 | 
					 | 
				
			||||||
	       pciReadByte(pcr->tag, 0x0060), pciReadByte(pcr->tag, 0x0078),
 | 
					 | 
				
			||||||
	       (long)pciReadLong(pcr->tag, 0x0070));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case 0x10:
 | 
					 | 
				
			||||||
	printf("  TOM       0x%04x  IORD  0x%04x\n",
 | 
					 | 
				
			||||||
	       pciReadWord(pcr->tag, 0x0050), pciReadWord(pcr->tag, 0x008E));
 | 
					 | 
				
			||||||
	/* Fall through */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case 0x11:  case 0x12:  case 0x13:
 | 
					 | 
				
			||||||
    case 0x14:  case 0x15:  case 0x16:  case 0x17:
 | 
					 | 
				
			||||||
	printf("  BUSNO     0x%02x    SUBNO 0x%02x\n",
 | 
					 | 
				
			||||||
	       pciReadByte(pcr->tag, 0x0048), pciReadByte(pcr->tag, 0x0049));
 | 
					 | 
				
			||||||
	printf("  VGASE     0x%02x    PCIS  0x%02x    IOR 0x%02x\n",
 | 
					 | 
				
			||||||
	       pciReadByte(pcr->tag, 0x0080), pciReadByte(pcr->tag, 0x0084),
 | 
					 | 
				
			||||||
	       pciReadByte(pcr->tag, 0x008C));
 | 
					 | 
				
			||||||
	/* Fall through */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    default:
 | 
					 | 
				
			||||||
	return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_460gx_pxb(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    CARD32 tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Print generalities */
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    tmp = pcr->pci_user_config;
 | 
					 | 
				
			||||||
    pcr->pci_user_config = 0;
 | 
					 | 
				
			||||||
    print_default_class(pcr);
 | 
					 | 
				
			||||||
    pcr->pci_user_config = tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Only print what XFree86 might be interested in */
 | 
					 | 
				
			||||||
    printf("  ERRCMD    0x%02x  GAPEN 0x%02x\n",
 | 
					 | 
				
			||||||
	   pciReadByte(pcr->tag, 0x0046), pciReadByte(pcr->tag, 0x0060));
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
print_460gx_gxb(pciConfigPtr pcr)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    CARD32 tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Print generalities */
 | 
					 | 
				
			||||||
    printf("  STATUS    0x%04x  COMMAND 0x%04x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_status, pcr->pci_command);
 | 
					 | 
				
			||||||
    printf("  CLASS     0x%02x 0x%02x 0x%02x  REVISION 0x%02x\n",
 | 
					 | 
				
			||||||
	   pcr->pci_base_class, pcr->pci_sub_class, pcr->pci_prog_if,
 | 
					 | 
				
			||||||
	   pcr->pci_rev_id);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    tmp = pcr->pci_user_config;
 | 
					 | 
				
			||||||
    pcr->pci_user_config = 0;
 | 
					 | 
				
			||||||
    print_default_class(pcr);
 | 
					 | 
				
			||||||
    pcr->pci_user_config = tmp;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* Only print what XFree86 might be interested in */
 | 
					 | 
				
			||||||
    printf("  BAPBASE   0x%08lx%08lx   AGPSIZ  0x%02x   VGAGE     0x%02x\n",
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x009C),
 | 
					 | 
				
			||||||
	   (long)pciReadLong(pcr->tag, 0x0098),
 | 
					 | 
				
			||||||
	   pciReadByte(pcr->tag, 0x00A2), pciReadByte(pcr->tag, 0x0060));
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "xf86getpagesize.c"
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,42 +0,0 @@
 | 
				
			||||||
.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.2 2000/12/11 20:18:45 dawes Exp $ 
 | 
					 | 
				
			||||||
.TH SCANPCI 1 __vendorversion__
 | 
					 | 
				
			||||||
.SH NAME
 | 
					 | 
				
			||||||
scanpci - scan/probe PCI buses
 | 
					 | 
				
			||||||
.SH SYNOPSIS
 | 
					 | 
				
			||||||
.B scanpci
 | 
					 | 
				
			||||||
.RB [ \-v12OfV ]
 | 
					 | 
				
			||||||
.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.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-1
 | 
					 | 
				
			||||||
Use PCI config type 1.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-2
 | 
					 | 
				
			||||||
Use PCI config type 2.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-f
 | 
					 | 
				
			||||||
Used in conjunction with the above two options, this forces the specified
 | 
					 | 
				
			||||||
configuration type to be used for config space access.
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.B \-O
 | 
					 | 
				
			||||||
Use the OS's PCI config space access mechanism to access the PCI config
 | 
					 | 
				
			||||||
space (when available).
 | 
					 | 
				
			||||||
.TP 8
 | 
					 | 
				
			||||||
.BI "\-V " n
 | 
					 | 
				
			||||||
Set the verbosity level to
 | 
					 | 
				
			||||||
.I n
 | 
					 | 
				
			||||||
for the internal PCI scanner.  This is primarily for debugging use.
 | 
					 | 
				
			||||||
.SH "SEE ALSO"
 | 
					 | 
				
			||||||
pcitweak(1)
 | 
					 | 
				
			||||||
.SH AUTHORS
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue