diff -ruN pciutils-2.2.3/.git/HEAD pciutils-2.2.4/.git/HEAD
--- pciutils-2.2.3/.git/HEAD	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/HEAD	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-ref: refs/heads/master
diff -ruN pciutils-2.2.3/.git/branches/origin pciutils-2.2.4/.git/branches/origin
--- pciutils-2.2.3/.git/branches/origin	2006-05-05 14:34:03.000000000 +0200
+++ pciutils-2.2.4/.git/branches/origin	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-git+ssh://atrey.karlin.mff.cuni.cz/home/mj/GIT/pciutils.git
diff -ruN pciutils-2.2.3/.git/config pciutils-2.2.4/.git/config
--- pciutils-2.2.3/.git/config	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/config	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-[core]
-	repositoryformatversion = 0
-	filemode = true
diff -ruN pciutils-2.2.3/.git/description pciutils-2.2.4/.git/description
--- pciutils-2.2.3/.git/description	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/description	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-Unnamed repository; edit this file to name it for gitweb.
diff -ruN pciutils-2.2.3/.git/hooks/applypatch-msg pciutils-2.2.4/.git/hooks/applypatch-msg
--- pciutils-2.2.3/.git/hooks/applypatch-msg	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/applypatch-msg	1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to check the commit log message taken by
-# applypatch from an e-mail message.
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit.  The hook is
-# allowed to edit the commit message file.
-#
-# To enable this hook, make this file executable.
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/commit-msg" &&
-	exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
-:
diff -ruN pciutils-2.2.3/.git/hooks/commit-msg pciutils-2.2.4/.git/hooks/commit-msg
--- pciutils-2.2.3/.git/hooks/commit-msg	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/commit-msg	1970-01-01 01:00:00.000000000 +0100
@@ -1,14 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to check the commit log message.
-# Called by git-commit with one argument, the name of the file
-# that has the commit message.  The hook should exit with non-zero
-# status after issuing an appropriate message if it wants to stop the
-# commit.  The hook is allowed to edit the commit message file.
-#
-# To enable this hook, make this file executable.
-
-# This example catches duplicate Signed-off-by lines.
-
-test "" = "$(grep '^Signed-off-by: ' "$1" |
-	 sort | uniq -c | sed -e '/^[ 	]*1 /d')"
diff -ruN pciutils-2.2.3/.git/hooks/post-commit pciutils-2.2.4/.git/hooks/post-commit
--- pciutils-2.2.3/.git/hooks/post-commit	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/post-commit	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# An example hook script that is called after a successful
-# commit is made.
-#
-# To enable this hook, make this file executable.
-
-: Nothing
diff -ruN pciutils-2.2.3/.git/hooks/post-update pciutils-2.2.4/.git/hooks/post-update
--- pciutils-2.2.3/.git/hooks/post-update	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/post-update	1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to prepare a packed repository for use over
-# dumb transports.
-#
-# To enable this hook, make this file executable by "chmod +x post-update".
-
-exec git-update-server-info
diff -ruN pciutils-2.2.3/.git/hooks/pre-applypatch pciutils-2.2.4/.git/hooks/pre-applypatch
--- pciutils-2.2.3/.git/hooks/pre-applypatch	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/pre-applypatch	1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed
-# by applypatch from an e-mail message.
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit.
-#
-# To enable this hook, make this file executable.
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/pre-commit" &&
-	exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
-:
-
diff -ruN pciutils-2.2.3/.git/hooks/pre-commit pciutils-2.2.4/.git/hooks/pre-commit
--- pciutils-2.2.3/.git/hooks/pre-commit	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/pre-commit	1970-01-01 01:00:00.000000000 +0100
@@ -1,71 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed.
-# Called by git-commit with no arguments.  The hook should
-# exit with non-zero status after issuing an appropriate message if
-# it wants to stop the commit.
-#
-# To enable this hook, make this file executable.
-
-# This is slightly modified from Andrew Morton's Perfect Patch.
-# Lines you introduce should not have trailing whitespace.
-# Also check for an indentation that has SP before a TAB.
-
-if git-rev-parse --verify HEAD 2>/dev/null
-then
-	git-diff-index -p -M --cached HEAD
-else
-	# NEEDSWORK: we should produce a diff with an empty tree here
-	# if we want to do the same verification for the initial import.
-	:
-fi |
-perl -e '
-    my $found_bad = 0;
-    my $filename;
-    my $reported_filename = "";
-    my $lineno;
-    sub bad_line {
-	my ($why, $line) = @_;
-	if (!$found_bad) {
-	    print STDERR "*\n";
-	    print STDERR "* You have some suspicious patch lines:\n";
-	    print STDERR "*\n";
-	    $found_bad = 1;
-	}
-	if ($reported_filename ne $filename) {
-	    print STDERR "* In $filename\n";
-	    $reported_filename = $filename;
-	}
-	print STDERR "* $why (line $lineno)\n";
-	print STDERR "$filename:$lineno:$line\n";
-    }
-    while (<>) {
-	if (m|^diff --git a/(.*) b/\1$|) {
-	    $filename = $1;
-	    next;
-	}
-	if (/^@@ -\S+ \+(\d+)/) {
-	    $lineno = $1 - 1;
-	    next;
-	}
-	if (/^ /) {
-	    $lineno++;
-	    next;
-	}
-	if (s/^\+//) {
-	    $lineno++;
-	    chomp;
-	    if (/\s$/) {
-		bad_line("trailing whitespace", $_);
-	    }
-	    if (/^\s* 	/) {
-		bad_line("indent SP followed by a TAB", $_);
-	    }
-	    if (/^(?:[<>=]){7}/) {
-		bad_line("unresolved merge conflict", $_);
-	    }
-	}
-    }
-    exit($found_bad);
-'
-
diff -ruN pciutils-2.2.3/.git/hooks/pre-rebase pciutils-2.2.4/.git/hooks/pre-rebase
--- pciutils-2.2.3/.git/hooks/pre-rebase	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/pre-rebase	1970-01-01 01:00:00.000000000 +0100
@@ -1,150 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2006 Junio C Hamano
-#
-
-publish=next
-basebranch="$1"
-if test "$#" = 2
-then
-	topic="refs/heads/$2"
-else
-	topic=`git symbolic-ref HEAD`
-fi
-
-case "$basebranch,$topic" in
-master,refs/heads/??/*)
-	;;
-*)
-	exit 0 ;# we do not interrupt others.
-	;;
-esac
-
-# Now we are dealing with a topic branch being rebased
-# on top of master.  Is it OK to rebase it?
-
-# Is topic fully merged to master?
-not_in_master=`git-rev-list --pretty=oneline ^master "$topic"`
-if test -z "$not_in_master"
-then
-	echo >&2 "$topic is fully merged to master; better remove it."
-	exit 1 ;# we could allow it, but there is no point.
-fi
-
-# Is topic ever merged to next?  If so you should not be rebasing it.
-only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort`
-only_next_2=`git-rev-list ^master           ${publish} | sort`
-if test "$only_next_1" = "$only_next_2"
-then
-	not_in_topic=`git-rev-list "^$topic" master`
-	if test -z "$not_in_topic"
-	then
-		echo >&2 "$topic is already up-to-date with master"
-		exit 1 ;# we could allow it, but there is no point.
-	else
-		exit 0
-	fi
-else
-	not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"`
-	perl -e '
-		my $topic = $ARGV[0];
-		my $msg = "* $topic has commits already merged to public branch:\n";
-		my (%not_in_next) = map {
-			/^([0-9a-f]+) /;
-			($1 => 1);
-		} split(/\n/, $ARGV[1]);
-		for my $elem (map {
-				/^([0-9a-f]+) (.*)$/;
-				[$1 => $2];
-			} split(/\n/, $ARGV[2])) {
-			if (!exists $not_in_next{$elem->[0]}) {
-				if ($msg) {
-					print STDERR $msg;
-					undef $msg;
-				}
-				print STDERR " $elem->[1]\n";
-			}
-		}
-	' "$topic" "$not_in_next" "$not_in_master"
-	exit 1
-fi
-
-exit 0
-
-################################################################
-
-This sample hook safeguards topic branches that have been
-published from being rewound.
-
-The workflow assumed here is:
-
- * Once a topic branch forks from "master", "master" is never
-   merged into it again (either directly or indirectly).
-
- * Once a topic branch is fully cooked and merged into "master",
-   it is deleted.  If you need to build on top of it to correct
-   earlier mistakes, a new topic branch is created by forking at
-   the tip of the "master".  This is not strictly necessary, but
-   it makes it easier to keep your history simple.
-
- * Whenever you need to test or publish your changes to topic
-   branches, merge them into "next" branch.
-
-The script, being an example, hardcodes the publish branch name
-to be "next", but it is trivial to make it configurable via
-$GIT_DIR/config mechanism.
-
-With this workflow, you would want to know:
-
-(1) ... if a topic branch has ever been merged to "next".  Young
-    topic branches can have stupid mistakes you would rather
-    clean up before publishing, and things that have not been
-    merged into other branches can be easily rebased without
-    affecting other people.  But once it is published, you would
-    not want to rewind it.
-
-(2) ... if a topic branch has been fully merged to "master".
-    Then you can delete it.  More importantly, you should not
-    build on top of it -- other people may already want to
-    change things related to the topic as patches against your
-    "master", so if you need further changes, it is better to
-    fork the topic (perhaps with the same name) afresh from the
-    tip of "master".
-
-Let's look at this example:
-
-		   o---o---o---o---o---o---o---o---o---o "next"
-		  /       /           /           /
-		 /   a---a---b A     /           /
-		/   /               /           /
-	       /   /   c---c---c---c B         /
-	      /   /   /             \         /
-	     /   /   /   b---b C     \       /
-	    /   /   /   /             \     /
-    ---o---o---o---o---o---o---o---o---o---o---o "master"
-
-
-A, B and C are topic branches.
-
- * A has one fix since it was merged up to "next".
-
- * B has finished.  It has been fully merged up to "master" and "next",
-   and is ready to be deleted.
-
- * C has not merged to "next" at all.
-
-We would want to allow C to be rebased, refuse A, and encourage
-B to be deleted.
-
-To compute (1):
-
-	git-rev-list ^master ^topic next
-	git-rev-list ^master        next
-
-	if these match, topic has not merged in next at all.
-
-To compute (2):
-
-	git-rev-list master..topic
-
-	if this is empty, it is fully merged to "master".
diff -ruN pciutils-2.2.3/.git/hooks/update pciutils-2.2.4/.git/hooks/update
--- pciutils-2.2.3/.git/hooks/update	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/hooks/update	1970-01-01 01:00:00.000000000 +0100
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to mail out commit update information.
-# It also blocks tags that aren't annotated.
-# Called by git-receive-pack with arguments: refname sha1-old sha1-new
-#
-# To enable this hook:
-# (1) change the recipient e-mail address
-# (2) make this file executable by "chmod +x update".
-#
-
-project=$(cat $GIT_DIR/description)
-recipients="commit-list@somewhere.com commit-list@somewhereelse.com"
-
-ref_type=$(git cat-file -t "$3")
-
-# Only allow annotated tags in a shared repo
-# Remove this code to treat dumb tags the same as everything else
-case "$1","$ref_type" in
-refs/tags/*,commit)
-	echo "*** Un-annotated tags are not allowed in this repo" >&2
-	echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate."
-	exit 1;;
-refs/tags/*,tag)
-	echo "### Pushing version '${1##refs/tags/}' to the masses" >&2
-	# recipients="release-announce@somwehere.com announce@somewhereelse.com"
-	;;
-esac
-
-# set this  to 'cat' to get a very detailed listing.
-# short only kicks in when an annotated tag is added
-short='git shortlog'
-
-# see 'date --help' for info on how to write this
-# The default is a human-readable iso8601-like format with minute
-# precision ('2006-01-25 15:58 +0100' for example)
-date_format="%F %R %z"
-
-(if expr "$2" : '0*$' >/dev/null
-then
-	# new ref
-	case "$1" in
-	refs/tags/*)
-		# a pushed and annotated tag (usually) means a new version
-		tag="${1##refs/tags/}"
-		if [ "$ref_type" = tag ]; then
-			eval $(git cat-file tag $3 | \
-				sed -n '4s/tagger \([^>]*>\)[^0-9]*\([0-9]*\).*/tagger="\1" ts="\2"/p')
-			date=$(date --date="1970-01-01 00:00:00 $ts seconds" +"$date_format")
-			echo "Tag '$tag' created by $tagger at $date"
-			git cat-file tag $3 | sed -n '5,$p'
-			echo
-		fi
-		prev=$(git describe "$3^" | sed 's/-g.*//')
-		# the first tag in a repo will yield no $prev
-		if [ -z "$prev" ]; then
-			echo "Changes since the dawn of time:"
-			git rev-list --pretty $3 | $short
-		else
-			echo "Changes since $prev:"
-			git rev-list --pretty $prev..$3 | $short
-			echo ---
-			git diff $prev..$3 | diffstat -p1
-			echo ---
-		fi
-		;;
-
-	refs/heads/*)
-		branch="${1##refs/heads/}"
-		echo "New branch '$branch' available with the following commits:"
-		git-rev-list --pretty "$3" $(git-rev-parse --not --all)
-		;;
-	esac
-else
-	base=$(git-merge-base "$2" "$3")
-	case "$base" in
-	"$2")
-		git diff "$3" "^$base" | diffstat -p1
-		echo
-		echo "New commits:"
-		;;
-	*)
-		echo "Rebased ref, commits from common ancestor:"
-		;;
-	esac
-	git-rev-list --pretty "$3" "^$base"
-fi) |
-mail -s "$project: Changes to '${1##refs/heads/}'" $recipients
-exit 0
Binary files pciutils-2.2.3/.git/index and pciutils-2.2.4/.git/index differ
diff -ruN pciutils-2.2.3/.git/info/exclude pciutils-2.2.4/.git/info/exclude
--- pciutils-2.2.3/.git/info/exclude	2006-05-05 14:03:34.000000000 +0200
+++ pciutils-2.2.4/.git/info/exclude	1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-# git-ls-files --others --exclude-from=.git/info/exclude
-# Lines that start with '#' are comments.
-# For a project mostly in C, the following would be a good set of
-# exclude patterns (uncomment them if you want to use them):
-# *.[oa]
-# *~
diff -ruN pciutils-2.2.3/.git/info/refs pciutils-2.2.4/.git/info/refs
--- pciutils-2.2.3/.git/info/refs	2006-05-05 14:39:17.000000000 +0200
+++ pciutils-2.2.4/.git/info/refs	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-b6359063c32299c3d09de4cbdbb66d5b3468887a	refs/heads/master
-b6359063c32299c3d09de4cbdbb66d5b3468887a	refs/heads/origin
Binary files pciutils-2.2.3/.git/objects/06/ba6ea36e08323010bd07bb7b8f25ffd846cc63 and pciutils-2.2.4/.git/objects/06/ba6ea36e08323010bd07bb7b8f25ffd846cc63 differ
Binary files pciutils-2.2.3/.git/objects/12/a9d487a67405a3f6ed0366814e8d5b8e75290d and pciutils-2.2.4/.git/objects/12/a9d487a67405a3f6ed0366814e8d5b8e75290d differ
Binary files pciutils-2.2.3/.git/objects/1d/5cf727a564396ba51127140457ad9b6cedac7d and pciutils-2.2.4/.git/objects/1d/5cf727a564396ba51127140457ad9b6cedac7d differ
Binary files pciutils-2.2.3/.git/objects/21/4c1c815595f3e5c94e8ded967e8a54199e0566 and pciutils-2.2.4/.git/objects/21/4c1c815595f3e5c94e8ded967e8a54199e0566 differ
Binary files pciutils-2.2.3/.git/objects/27/c57a47383d32b2bd17554017f639516bf28650 and pciutils-2.2.4/.git/objects/27/c57a47383d32b2bd17554017f639516bf28650 differ
Binary files pciutils-2.2.3/.git/objects/2a/e2d1aed3fcb4ca01a8fdf8633eb83ad9cffeb0 and pciutils-2.2.4/.git/objects/2a/e2d1aed3fcb4ca01a8fdf8633eb83ad9cffeb0 differ
Binary files pciutils-2.2.3/.git/objects/4b/69e877d4e43e658c8225e28924b9270a69467f and pciutils-2.2.4/.git/objects/4b/69e877d4e43e658c8225e28924b9270a69467f differ
Binary files pciutils-2.2.3/.git/objects/58/1ee65aab342772a8d0577514aba49097495478 and pciutils-2.2.4/.git/objects/58/1ee65aab342772a8d0577514aba49097495478 differ
Binary files pciutils-2.2.3/.git/objects/5f/173f36e051e37c44f33c49f20f310d3d7d335b and pciutils-2.2.4/.git/objects/5f/173f36e051e37c44f33c49f20f310d3d7d335b differ
Binary files pciutils-2.2.3/.git/objects/6e/4a5c60ad05d3db686536bd33a539e312cdc4a9 and pciutils-2.2.4/.git/objects/6e/4a5c60ad05d3db686536bd33a539e312cdc4a9 differ
Binary files pciutils-2.2.3/.git/objects/81/f35df787e584bf18277a1e050e9b99338469b2 and pciutils-2.2.4/.git/objects/81/f35df787e584bf18277a1e050e9b99338469b2 differ
Binary files pciutils-2.2.3/.git/objects/8a/8301681d34ca9f29746e69178f7c28cd826a5d and pciutils-2.2.4/.git/objects/8a/8301681d34ca9f29746e69178f7c28cd826a5d differ
Binary files pciutils-2.2.3/.git/objects/98/ee5621ac849d5178300bb7311fef6eb6afbf31 and pciutils-2.2.4/.git/objects/98/ee5621ac849d5178300bb7311fef6eb6afbf31 differ
Binary files pciutils-2.2.3/.git/objects/e6/54045f01b121eb7946b6322d8984987fb6954d and pciutils-2.2.4/.git/objects/e6/54045f01b121eb7946b6322d8984987fb6954d differ
diff -ruN pciutils-2.2.3/.git/objects/info/packs pciutils-2.2.4/.git/objects/info/packs
--- pciutils-2.2.3/.git/objects/info/packs	2006-05-05 14:39:17.000000000 +0200
+++ pciutils-2.2.4/.git/objects/info/packs	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-P pack-b595e4b7fa5b074fa96284e6725c56866636ac3e.pack
-
Binary files pciutils-2.2.3/.git/objects/pack/pack-b595e4b7fa5b074fa96284e6725c56866636ac3e.idx and pciutils-2.2.4/.git/objects/pack/pack-b595e4b7fa5b074fa96284e6725c56866636ac3e.idx differ
Binary files pciutils-2.2.3/.git/objects/pack/pack-b595e4b7fa5b074fa96284e6725c56866636ac3e.pack and pciutils-2.2.4/.git/objects/pack/pack-b595e4b7fa5b074fa96284e6725c56866636ac3e.pack differ
diff -ruN pciutils-2.2.3/.git/refs/heads/master pciutils-2.2.4/.git/refs/heads/master
--- pciutils-2.2.3/.git/refs/heads/master	2006-05-05 21:46:53.000000000 +0200
+++ pciutils-2.2.4/.git/refs/heads/master	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-2ae2d1aed3fcb4ca01a8fdf8633eb83ad9cffeb0
diff -ruN pciutils-2.2.3/.git/refs/heads/origin pciutils-2.2.4/.git/refs/heads/origin
--- pciutils-2.2.3/.git/refs/heads/origin	2006-05-05 21:46:55.000000000 +0200
+++ pciutils-2.2.4/.git/refs/heads/origin	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-2ae2d1aed3fcb4ca01a8fdf8633eb83ad9cffeb0
diff -ruN pciutils-2.2.3/.gitignore pciutils-2.2.4/.gitignore
--- pciutils-2.2.3/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ pciutils-2.2.4/.gitignore	2006-09-09 14:55:17.000000000 +0200
@@ -0,0 +1,7 @@
+*.a
+*.o
+*.8
+lspci
+setpci
+update-pciids
+pci.ids.gz
diff -ruN pciutils-2.2.3/.gitignore~ pciutils-2.2.4/.gitignore~
--- pciutils-2.2.3/.gitignore~	1970-01-01 01:00:00.000000000 +0100
+++ pciutils-2.2.4/.gitignore~	2006-09-09 11:47:39.000000000 +0200
@@ -0,0 +1,6 @@
+*.a
+*.o
+*.8
+lspci
+setpci
+update-pciids
diff -ruN pciutils-2.2.3/ChangeLog pciutils-2.2.4/ChangeLog
--- pciutils-2.2.3/ChangeLog	2006-05-05 21:46:27.000000000 +0200
+++ pciutils-2.2.4/ChangeLog	2006-09-09 14:56:52.000000000 +0200
@@ -1,3 +1,132 @@
+2006-09-09  Martin Mares  <mj@ucw.cz>
+
+	* Released as 2.2.4.
+
+	* maint/release: Remind the maintainer about the current PCI_LIB_VERSION.
+
+	* lib/pci.h: Updated PCI_LIB_VERSION.
+
+	* lspci.c (show_machine): In the `-m' mode, do proper shell escaping
+	if the fields printed contain quotes or backslashes.
+
+	* lspci.c (show_machine): Added a `-vmm' mode, which removes the misuse
+	of the `Device' tag for two different purposes.
+
+	* Makefile: Moved all system-dependent decisions to lib/configure,
+	since config.mk is included in the top-level Makefile anyway.
+
+	* lib/configure: When configuring for Linux, ignore the kernel version
+	and always build all access methods.
+
+	* Makefile (CFLAGS): Removed -Winline, it's not needed and triggers
+	at many non-interesting places with gcc 3.4.
+
+	* Whitespace cleanup of all source files.
+
+	* The pci.ids file can be stored compressed if zlib is available.
+	Added transparent decompression to lib/names.c, modified update-pciids.sh
+	to keep the file compressed if applicable, updated Makefiles.
+	Based on a patch by Matthew Wilcox, but all the bugs are mine.
+
+	* Makefile, README: Allow installation to be done to a different directory
+	from the one we will eventually be placed in by setting DESTDIR.
+	Patch by Matthew Wilcox.
+
+	* Added .gitignore files.
+
+	* Makefile (clean): Clean *.orig, too.
+
+	* Cleaned up usage of `char' and `byte'.
+
+	* lib/header.h: PCI_CLASS_DOCKING_OTHER should be 0x0a80, not 0x0a01.
+
+	* lib/header.h: Added PCI_CLASS_xxx constants for all classes currently
+	defined in the pci.ids file.
+
+2006-08-01  Martin Mares  <mj@ucw.cz>
+
+	* lib/i386-io-hurd.h: Fixed a silly typo.
+
+2006-07-30  Martin Mares  <mj@ucw.cz>
+
+	* lib/Makefile: Added a missing rule for obsd-device.o.
+
+	* lspci.c, lib/header.h: Added support for MSI per-vector masking.
+	Contributed by Petr Vandrovec.
+
+	* lspci.c, lib/header.h: Added support for the `bridge subsystem ID'
+	capability. Contributed by Petr Vandrovec.
+
+	* lspci.c (show_htype1): Fixed bug in printing of 64-bit prefetchable
+	memory windows. Fix by Petr Vandrovec.
+
+	* maint/release.pm: Exclude .git directory from releases.
+
+	* lib/i386-ports.c, lib/i386-io-*: Report failures during port access
+	initialization by a->warn() instead of calling printf() or perror()
+	directly.
+
+	* lib/i386-ports.c, lib/i386-io-*: Moved the logic which keeps track of
+	the port access state to generic code.
+
+	* lib/i386-io-hurd.h: Ask the kernel for I/O port access appropriately.
+	Contributed by Thomas Schwinge and Samuel Thibault.
+
+	* lib/i386-ports.c: Define _GNU_SOURCE, it's needed by the Hurd module.
+
+	* lib/header.h: Whitespace cleanups.
+
+	* lib/i386-io-windows.h: Fixed indentation and spelling.
+
+	* README.Windows: Mention that WinIO.dll is needed and where to get it.
+
+2006-06-27  Martin Mares  <mj@ucw.cz>
+
+	* lib/Makefile, Makefile: Added rules for building and cleaning the example.
+
+	* lib/example.c: Show how to use PCI_FILL_CLASS and used another register
+	for demonstrating the config space accesses. The example is still very
+	incomplete, though.
+
+	* lib/pci.h, lib/generic.c: Added PCI_FILL_CLASS.
+
+	* lib/sysfs.c: Fetch device ID and class from sysfs, because they can
+	be modified by kernel fixups.
+
+	* lspci.c: Use PCI_FILL_CLASS. Thanks to Matthew Willcox for the patch.
+
+2006-06-03  Martin Mares  <mj@ucw.cz>
+
+	* lspci.c: Introduced the -nn switch. Thanks to David N. Welton
+	for the idea.
+
+	* lib/names.c (pci_lookup_name): Introduced PCI_LOOKUP_MIXED and
+	cleaned up the name selection code.
+
+	* lib/names.c (pci_lookup_name): If PCI_LOOKUP_NO_NUMBERS is given,
+	pci_access->numeric_ids is ignored.
+
+	* lib/names.c (pci_lookup_name): When class is identified and
+	subclass isn't, display class name and subclass number.
+
+2006-05-31  Martin Mares  <mj@ucw.cz>
+
+	* setpci.c (main): Don't crash when an invalid width is specified.
+
+	* lspci.c, setpci.c, common.c: die() now uses the right program
+	name when printing an error message.
+
+2006-05-19  Martin Mares  <mj@ucw.cz>
+
+	* README: Mention the public GIT tree.
+
+	* README: Updated the list of ports.
+
+2006-05-10  Martin Mares  <mj@ucw.cz>
+
+	* lib/configure, lib/fbsd-device.c: Added support for GNU/kFreeBSD.
+	Thanks to Petr Salinger for the patch.
+
 2006-05-05  Martin Mares  <mj@ucw.cz>
 
 	* Released as 2.2.3.
@@ -1114,7 +1243,7 @@
 
 	* Started the "New Generation" branch and introduced the
 	PCI library.
-	
+
 	* lspci: Rewritten to use the library.
 
 Tue Jan 19 22:24:08 1999  Martin Mares  <mj@albireo.ucw.cz>
diff -ruN pciutils-2.2.3/Makefile pciutils-2.2.4/Makefile
--- pciutils-2.2.3/Makefile	2006-05-05 21:46:32.000000000 +0200
+++ pciutils-2.2.4/Makefile	2006-09-09 14:57:03.000000000 +0200
@@ -2,10 +2,10 @@
 # (c) 1998--2006 Martin Mares <mj@ucw.cz>
 
 OPT=-O2
-CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline
+CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
 
-VERSION=2.2.3
-DATE=2006-05-05
+VERSION=2.2.4
+DATE=2006-09-09
 
 PREFIX=/usr/local
 SBINDIR=$(PREFIX)/sbin
@@ -17,31 +17,22 @@
 PCILIB=lib/libpci.a
 PCIINC=lib/config.h lib/header.h lib/pci.h lib/types.h lib/sysdep.h
 
-ifeq ($(shell uname),NetBSD)
-PCILIB=lib/libpciutils.a
-LDFLAGS+=-lpci
-else
-ifeq ($(shell uname),AIX)
-CFLAGS=-g
-INSTALL=installbsd
-DIRINSTALL=mkdir -p
-endif
-endif
+-include lib/config.mk
 
 HOST=
 RELEASE=
 
 export
 
-all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids
+all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 $(PCI_IDS)
 
 $(PCILIB): $(PCIINC) force
 	$(MAKE) -C lib all
 
 force:
 
-lib/config.h:
-	cd lib && ./configure $(IDSDIR) $(VERSION) $(HOST) $(RELEASE)
+lib/config.h lib/config.mk:
+	cd lib && ./configure "$(IDSDIR)" "$(VERSION)" "$(HOST)" "$(RELEASE)" "$(ZLIB)"
 
 lspci: lspci.o common.o $(PCILIB)
 setpci: setpci.o common.o $(PCILIB)
@@ -51,32 +42,33 @@
 common.o: common.c pciutils.h $(PCIINC)
 
 update-pciids: update-pciids.sh
-	sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/pci.ids@"
+	sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
+	chmod +x $@
 
 %.8: %.man
 	M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#"
 
 clean:
-	rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core`
-	rm -f update-pciids lspci setpci lib/config.* *.8 pci.ids.*
+	rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core -o -name "*.orig"`
+	rm -f update-pciids lspci setpci lib/config.* lib/example *.8 pci.ids.*
 	rm -rf maint/dist
 
 distclean: clean
 
 install: all
 # -c is ignored on Linux, but required on FreeBSD
-	$(DIRINSTALL) -m 755 $(SBINDIR) $(IDSDIR) $(MANDIR)/man8
-	$(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR)
-	$(INSTALL) -c -m 755 update-pciids $(SBINDIR)
-	$(INSTALL) -c -m 644 pci.ids $(IDSDIR)
-	$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8
+	$(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8
+	$(INSTALL) -c -m 755 -s lspci setpci $(DESTDIR)$(SBINDIR)
+	$(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+	$(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+	$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
 
 uninstall: all
-	rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids
-	rm -f $(IDSDIR)/pci.ids
-	rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8
+	rm -f $(DESTDIR)$(SBINDIR)/lspci $(DESTDIR)$(SBINDIR)/setpci $(DESTDIR)$(SBINDIR)/update-pciids
+	rm -f $(DESTDIR)$(IDSDIR)/$(PCI_IDS)
+	rm -f $(DESTDIR)$(MANDIR)/man8/lspci.8 $(DESTDIR)$(MANDIR)/man8/setpci.8 $(DESTDIR)$(MANDIR)/man8/update-pciids.8
 
-get-ids:
-	cp ~/tree/pciids/pci.ids pci.ids
+pci.ids.gz: pci.ids
+	gzip -9 <$< >$@
 
-.PHONY: all clean distclean install uninstall get-ids force
+.PHONY: all clean distclean install uninstall force
diff -ruN pciutils-2.2.3/README pciutils-2.2.4/README
--- pciutils-2.2.3/README	2006-05-05 21:46:58.000000000 +0200
+++ pciutils-2.2.4/README	2006-09-09 14:57:21.000000000 +0200
@@ -1,4 +1,4 @@
-This package contains the PCI Utilities, version 2.2.3.
+This package contains the PCI Utilities, version 2.2.4.
 
 Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
 
@@ -12,8 +12,18 @@
 The PCI Utilities package contains a library for portable access to PCI bus
 configuration registers and several utilities based on this library.
 
-Currently, pciutils work on all versions of Linux and they also have somewhat
-experimental support for FreeBSD, NetBSD, AIX, GNU Hurd and Solaris/x86.
+In runs on the following systems:
+
+	Linux		(via /sys/bus/pci, /proc/bus/pci or i386 ports)
+	FreeBSD		(via /dev/pci)
+	NetBSD		(via libpci)
+	OpenBSD		(via /dev/pci)
+	GNU/kFreeBSD	(via /dev/pci)
+	Solaris/i386	(direct port access)
+	Aix		(via /dev/pci and odmget)
+	GNU Hurd	(direct port access)
+	Windows		(direct port access)
+
 It should be very easy to add support for other systems as well (volunteers
 wanted; if you want to try that, I'll be very glad to see the patches and
 include them in the next version).
@@ -35,9 +45,19 @@
 Just run "make" to compile the package and then "make install" to install it.
 
 If you want to change the default installation location, please override
-the ROOT and PREFIX variables specified in the Makefile -- e.g., you can
-use "make PREFIX=/opt/pciutils ROOT=/opt/pciutils install" to create
-a separate installation not interfering with the rest of your system.
+the PREFIX variable specified in the Makefile -- e.g., you can use
+"make PREFIX=/opt/pciutils install" to create a separate installation
+not interfering with the rest of your system.  Setting the DESTDIR variable
+will allow you to install to a different directory from the one you intend
+to eventually run it from.  This is useful for people who are packaging
+pciutils to install on other computers.
+
+The configure script will automatically enable support for a compressed
+pci.ids if you have zlib installed.  You can override its guess by using
+"make ZLIB=no" or "make ZLIB=yes".  If compressed support is enabled,
+pciutils will use pci.ids.gz in preference to pci.ids, even if the
+pci.ids file is newer.  If the pci.ids.gz file is missing, it will use
+pci.ids instead.
 
 When you are bored of dumping PCI registers, just use "make uninstall".
 
@@ -56,22 +76,17 @@
 sf.net web page.
 
 
-4. Available access methods
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The library (and therefore all the utilities) know a variety of methods for
-accessing the PCI registers. Here is a list of them, sorted by autodetection
-priority:
-
-   /proc/bus/pci	on all Linux systems since kernel 2.1.82.
-   /sys/bus/pci		on all Linux systems since kernel 2.5.xx.
-   direct port access	on i386 systems running Linux, GNU Hurd or Solaris/x86;
-			available only to root, useful if no other access
-			method is available or you want to hunt kernel bugs
-   /dev/pci		used on FreeBSD
-   lsdev + odmget	used on AIX
-   libpci		used on NetBSD
-   dumps		reading of dumps produced by `lspci -x'
-			(this one is not autodetected)
+4. Getting new versions
+~~~~~~~~~~~~~~~~~~~~~~~
+New versions of pciutils are available at the following places:
+
+	ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/
+	ftp://ftp.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)
+	ftp://metalab.unc.edu/pub/Linux/hardware/ (expect a couple of days delay)
+
+There is also a public GIT tree at:
+
+	git://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
 
 
 5. Using the library
diff -ruN pciutils-2.2.3/README.Windows pciutils-2.2.4/README.Windows
--- pciutils-2.2.3/README.Windows	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/README.Windows	2006-07-30 12:36:19.000000000 +0200
@@ -1,5 +1,8 @@
 Since 2.1.99-test5, pciutils should also be compilable on Windows. Thanks
 to Alexander Stock for contributing the port.
 
+To build this port, you need to install WinIO.dll first. You can get it
+from http://www.internals.com/.
+
 However, you need to use win32/config.h instead of the automatically
 generated lib/config.h as lib/configure does not run on Windows.
diff -ruN pciutils-2.2.3/TODO pciutils-2.2.4/TODO
--- pciutils-2.2.3/TODO	2006-05-05 14:18:35.000000000 +0200
+++ pciutils-2.2.4/TODO	2006-09-09 14:34:11.000000000 +0200
@@ -3,7 +3,6 @@
 - finish PCI Express support
 - reading of VPD
 - class 0805?
-- document syntax of machine-readable output
 
 PCIIDS:
 - another mirror at Atrey?
diff -ruN pciutils-2.2.3/common.c pciutils-2.2.4/common.c
--- pciutils-2.2.3/common.c	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/common.c	2006-05-31 18:02:56.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *	The PCI Utilities -- Common Functions
  *
- *	Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -20,7 +20,7 @@
   va_list args;
 
   va_start(args, msg);
-  fputs("lspci: ", stderr);
+  fprintf(stderr, "%s: ", program_name);
   vfprintf(stderr, msg, args);
   fputc('\n', stderr);
   exit(1);
diff -ruN pciutils-2.2.3/lib/.gitignore pciutils-2.2.4/lib/.gitignore
--- pciutils-2.2.3/lib/.gitignore	1970-01-01 01:00:00.000000000 +0100
+++ pciutils-2.2.4/lib/.gitignore	2006-09-09 11:47:39.000000000 +0200
@@ -0,0 +1,2 @@
+config.h
+config.mk
diff -ruN pciutils-2.2.3/lib/Makefile pciutils-2.2.4/lib/Makefile
--- pciutils-2.2.3/lib/Makefile	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.4/lib/Makefile	2006-07-30 14:02:07.000000000 +0200
@@ -62,9 +62,12 @@
 sysfs.o: sysfs.c $(INCL) pread.h
 generic.o: generic.c $(INCL)
 syscalls.o: syscalls.c $(INCL)
+obsd-device.o: obsd-device.c $(INCL)
 fbsd-device.o: fbsd-device.c $(INCL)
 aix-device.o: aix-device.c $(INCL)
 dump.o: dump.c $(INCL)
 names.o: names.c $(INCL)
 filter.o: filter.c $(INCL)
 nbsd-libpci.o: nbsd-libpci.c $(INCL)
+
+example: example.c $(PCILIB)
diff -ruN pciutils-2.2.3/lib/access.c pciutils-2.2.4/lib/access.c
--- pciutils-2.2.3/lib/access.c	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.4/lib/access.c	2006-09-09 12:38:11.000000000 +0200
@@ -66,7 +66,7 @@
   int i;
 
   bzero(a, sizeof(*a));
-  a->id_file_name = PCI_PATH_IDS;
+  pci_set_name_list_path(a, PCI_PATH_IDS_DIR "/" PCI_IDS, 0);
   for(i=0; i<PCI_ACCESS_MAX; i++)
     if (pci_methods[i] && pci_methods[i]->config)
       pci_methods[i]->config(a);
@@ -182,6 +182,7 @@
   if (a->methods)
     a->methods->cleanup(a);
   pci_free_name_list(a);
+  pci_set_name_list_path(a, NULL, 0);
   pci_mfree(a);
 }
 
diff -ruN pciutils-2.2.3/lib/aix-device.c pciutils-2.2.4/lib/aix-device.c
--- pciutils-2.2.3/lib/aix-device.c	2006-05-05 14:18:20.000000000 +0200
+++ pciutils-2.2.4/lib/aix-device.c	2006-09-09 12:52:32.000000000 +0200
@@ -236,7 +236,7 @@
 
   if (ioctl(fd, MIOPCFGET, &mdio) < 0)
     d->access->error("aix_read: ioctl(MIOPCFGET) failed");
-  
+
   return 1;
 }
 
diff -ruN pciutils-2.2.3/lib/configure pciutils-2.2.4/lib/configure
--- pciutils-2.2.3/lib/configure	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.4/lib/configure	2006-09-09 13:06:10.000000000 +0200
@@ -22,35 +22,37 @@
 else
 	cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
 fi
+if [ "$sys" = "GNU/kFreeBSD" ]
+then
+	sys=freebsd
+fi
 host=${3:-$cpu-$sys}
 host=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr 'A-Z' 'a-z'`
 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 rel=${4:-$rel}
 echo " $host $rel"
+zlib=$5
 
 c=config.h
+m=config.mk
 echo >$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
 echo >>$c "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`"
+rm -f $m
 
 echo_n "Looking for access methods..."
 
 case $sys in
 	linux*)
-		case $rel in
-			2.[1-9]*|[3-9]*)	echo_n " sysfs proc"
-						echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS'
-						echo >>$c '#define PCI_HAVE_PM_LINUX_PROC'
-						echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H'
-						echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
-						echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
-						ok=1
-						;;
-		esac
+		echo_n " sysfs proc"
+		echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS'
+		echo >>$c '#define PCI_HAVE_PM_LINUX_PROC'
+		echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H'
+		echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
+		echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
 		case $cpu in
 				i386)		echo_n " i386-ports"
 						echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
-						ok=1
 						;;
 		esac
 		echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
@@ -59,7 +61,6 @@
 		case $cpu in
 				i386)		echo_n " i386-ports"
 						echo >>$c "#define PCI_HAVE_PM_INTEL_CONF"
-						ok=1
 						;;
 				*)
 						echo " The PCI library is does not support Solaris for this architecture: $cpu"
@@ -67,34 +68,33 @@
 						;;
 		esac
 		;;
-		
 	freebsd)
 		echo_n " fbsd-device"
 		echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE'
 		echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
-		ok=1
 		;;
         openbsd)
 	        echo_n " obsd-device"
 		echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
 		echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
-		ok=1
 		;;
 	aix)
 		echo_n " aix-device"
 		echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE'
-		ok=1
+		echo >>$m 'CFLAGS=-g'
+		echo >>$m 'INSTALL=installbsd'
+		echo >>$m 'DIRINSTALL=mkdir -p'
 		;;
 	netbsd)
 		echo_n " nbsd-libpci"
 		echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
 		echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
-		ok=1
+		echo >>$m 'PCILIB=lib/libpciutils.a'
+		echo >>$m 'LDFLAGS+=-lpci'
 		;;
     	gnu)
 		echo_n " i386-ports"
 		echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
-		ok=1
 		;;
         *)
 		echo " Unfortunately, your OS is not supported by the PCI Library"
@@ -104,9 +104,26 @@
 
 echo >>$c '#define PCI_HAVE_PM_DUMP'
 echo " dump"
-if [ -z "$ok" ] ; then
-	echo "WARNING: No real configuration access method is available."
+
+echo_n "Checking for zlib support... "
+if [ "$zlib" = yes -o "$zlib" = no ] ; then
+	echo "$zlib (set manually)"
+else
+	if [ -f /usr/include/zlib.h ] ; then
+		zlib=yes
+	else
+		zlib=no
+	fi
+	echo "$zlib (auto-detected)"
+fi
+if [ "$zlib" = yes ] ; then
+	echo >>$c '#define PCI_COMPRESSED_IDS'
+	echo >>$c '#define PCI_IDS "pci.ids.gz"'
+	echo >>$m 'LDFLAGS+=-lz'
+else
+	echo >>$c '#define PCI_IDS "pci.ids"'
 fi
-echo >>$c "#define PCI_PATH_IDS \"$idsdir/pci.ids\""
+echo >>$c "#define PCI_PATH_IDS_DIR \"$idsdir\""
+
 echo >>$c "#define PCILIB_VERSION \"$version\""
-sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$c >config.mk
+sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m
diff -ruN pciutils-2.2.3/lib/example.c pciutils-2.2.4/lib/example.c
--- pciutils-2.2.3/lib/example.c	2006-05-05 14:10:39.000000000 +0200
+++ pciutils-2.2.4/lib/example.c	2006-06-27 15:08:02.000000000 +0200
@@ -21,11 +21,11 @@
   pci_scan_bus(pacc);		/* We want to get the list of devices */
   for(dev=pacc->devices; dev; dev=dev->next)	/* Iterate over all devices */
     {
-      pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES);	/* Fill in header info we need */
-      c = pci_read_word(dev, PCI_CLASS_DEVICE);	/* Read config register directly */
-      printf("%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d base0=%lx\n",
+      pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS);	/* Fill in header info we need */
+      c = pci_read_byte(dev, PCI_INTERRUPT_PIN);				/* Read config register directly */
+      printf("%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d (pin %d) base0=%lx\n",
 	     dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id,
-	     c, dev->irq, dev->base_addr[0]);
+	     dev->device_class, dev->irq, c, dev->base_addr[0]);
     }
   pci_cleanup(pacc);		/* Close everything */
   return 0;
diff -ruN pciutils-2.2.3/lib/fbsd-device.c pciutils-2.2.4/lib/fbsd-device.c
--- pciutils-2.2.3/lib/fbsd-device.c	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/lib/fbsd-device.c	2006-09-09 12:52:42.000000000 +0200
@@ -11,6 +11,13 @@
 #include <string.h>
 #include <unistd.h>
 #include <osreldate.h>
+#include <stdint.h>
+
+#ifdef __FreeBSD_kernel_version
+#  ifndef __FreeBSD_version
+#    define __FreeBSD_version __FreeBSD_kernel_version
+#  endif
+#endif
 
 #if __FreeBSD_version < 500000
 #  include <pci/pcivar.h>
@@ -83,10 +90,10 @@
 
   pi.pi_reg = pos;
   pi.pi_width = len;
-	
+
   if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0)
     d->access->error("fbsd_read: ioctl(PCIOCREAD) failed");
-  
+
   switch (len)
     {
     case 1:
@@ -121,7 +128,7 @@
 
   pi.pi_reg = pos;
   pi.pi_width = len;
-	
+
   switch (len)
     {
     case 1:
@@ -134,7 +141,7 @@
       pi.pi_data = ((u32 *) buf)[0];
       break;
     }
-  
+
   if (ioctl(d->access->fd, PCIOCWRITE, &pi) < 0)
     {
       d->access->error("fbsd_write: ioctl(PCIOCWRITE) failed");
diff -ruN pciutils-2.2.3/lib/generic.c pciutils-2.2.4/lib/generic.c
--- pciutils-2.2.3/lib/generic.c	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/lib/generic.c	2006-06-27 15:06:24.000000000 +0200
@@ -86,6 +86,8 @@
       d->vendor_id = pci_read_word(d, PCI_VENDOR_ID);
       d->device_id = pci_read_word(d, PCI_DEVICE_ID);
     }
+  if (flags & PCI_FILL_CLASS)
+      d->device_class = pci_read_word(d, PCI_CLASS_DEVICE);
   if (flags & PCI_FILL_IRQ)
     d->irq = pci_read_byte(d, PCI_INTERRUPT_LINE);
   if (flags & PCI_FILL_BASES)
diff -ruN pciutils-2.2.3/lib/header.h pciutils-2.2.4/lib/header.h
--- pciutils-2.2.3/lib/header.h	2006-05-05 14:18:30.000000000 +0200
+++ pciutils-2.2.4/lib/header.h	2006-09-09 10:53:22.000000000 +0200
@@ -31,7 +31,7 @@
 #define  PCI_STATUS_FAST_BACK	0x80	/* Accept fast-back to back */
 #define  PCI_STATUS_PARITY	0x100	/* Detected parity error */
 #define  PCI_STATUS_DEVSEL_MASK	0x600	/* DEVSEL timing */
-#define  PCI_STATUS_DEVSEL_FAST	0x000	
+#define  PCI_STATUS_DEVSEL_FAST	0x000
 #define  PCI_STATUS_DEVSEL_MEDIUM 0x200
 #define  PCI_STATUS_DEVSEL_SLOW 0x400
 #define  PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
@@ -60,8 +60,8 @@
 
 /*
  * Base addresses specify locations in memory or I/O space.
- * Decoded size can be determined by writing a value of 
- * 0xffffffff to the register, and reading it back.  Only 
+ * Decoded size can be determined by writing a value of
+ * 0xffffffff to the register, and reading it back.  Only
  * 1 bits are decoded.
  */
 #define PCI_BASE_ADDRESS_0	0x10	/* 32 bits */
@@ -85,7 +85,7 @@
 /* Header type 0 (normal devices) */
 #define PCI_CARDBUS_CIS		0x28
 #define PCI_SUBSYSTEM_VENDOR_ID	0x2c
-#define PCI_SUBSYSTEM_ID	0x2e  
+#define PCI_SUBSYSTEM_ID	0x2e
 #define PCI_ROM_ADDRESS		0x30	/* Bits 31..11 are address, 10..1 reserved */
 #define  PCI_ROM_ADDRESS_ENABLE	0x01
 #define PCI_ROM_ADDRESS_MASK	(~(pciaddr_t)0x7ff)
@@ -188,6 +188,7 @@
 #define  PCI_CAP_ID_VNDR	0x09	/* Vendor specific */
 #define  PCI_CAP_ID_DBG		0x0A	/* Debug port */
 #define  PCI_CAP_ID_CCRC	0x0B	/* CompactPCI Central Resource Control */
+#define  PCI_CAP_ID_SSVID	0x0D	/* Bridge subsystem vendor/device ID */
 #define  PCI_CAP_ID_AGP3	0x0E	/* AGP 8x */
 #define  PCI_CAP_ID_EXP		0x10	/* PCI Express */
 #define  PCI_CAP_ID_MSIX	0x11	/* MSI-X */
@@ -270,22 +271,27 @@
 /* Message Signalled Interrupts registers */
 
 #define PCI_MSI_FLAGS		2	/* Various flags */
-#define  PCI_MSI_FLAGS_64BIT	0x80	/* 64-bit addresses allowed */
-#define  PCI_MSI_FLAGS_QSIZE	0x70	/* Message queue size configured */
-#define  PCI_MSI_FLAGS_QMASK	0x0e	/* Maximum queue size available */
-#define  PCI_MSI_FLAGS_ENABLE	0x01	/* MSI feature enabled */
+#define  PCI_MSI_FLAGS_MASK_BIT	0x100	/* interrupt masking & reporting supported */
+#define  PCI_MSI_FLAGS_64BIT	0x080	/* 64-bit addresses allowed */
+#define  PCI_MSI_FLAGS_QSIZE	0x070	/* Message queue size configured */
+#define  PCI_MSI_FLAGS_QMASK	0x00e	/* Maximum queue size available */
+#define  PCI_MSI_FLAGS_ENABLE	0x001	/* MSI feature enabled */
 #define PCI_MSI_RFU		3	/* Rest of capability flags */
 #define PCI_MSI_ADDRESS_LO	4	/* Lower 32 bits */
 #define PCI_MSI_ADDRESS_HI	8	/* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
 #define PCI_MSI_DATA_32		8	/* 16 bits of data for 32-bit devices */
 #define PCI_MSI_DATA_64		12	/* 16 bits of data for 64-bit devices */
+#define PCI_MSI_MASK_BIT_32	12	/* per-vector masking for 32-bit devices */
+#define PCI_MSI_MASK_BIT_64	16	/* per-vector masking for 64-bit devices */
+#define PCI_MSI_PENDING_32	16	/* per-vector interrupt pending for 32-bit devices */
+#define PCI_MSI_PENDING_64	20	/* per-vector interrupt pending for 64-bit devices */
 
 /* PCI-X */
 #define PCI_PCIX_COMMAND                                                2 /* Command register offset */
 #define PCI_PCIX_COMMAND_DPERE                                     0x0001 /* Data Parity Error Recover Enable */
 #define PCI_PCIX_COMMAND_ERO                                       0x0002 /* Enable Relaxed Ordering */
 #define PCI_PCIX_COMMAND_MAX_MEM_READ_BYTE_COUNT                   0x000c /* Maximum Memory Read Byte Count */
-#define PCI_PCIX_COMMAND_MAX_OUTSTANDING_SPLIT_TRANS               0x0070  
+#define PCI_PCIX_COMMAND_MAX_OUTSTANDING_SPLIT_TRANS               0x0070
 #define PCI_PCIX_COMMAND_RESERVED                                   0xf80
 #define PCI_PCIX_STATUS                                                 4 /* Status register offset */
 #define PCI_PCIX_STATUS_FUNCTION                               0x00000007
@@ -774,6 +780,10 @@
 #define PCI_MSIX_PBA		8
 #define  PCI_MSIX_BIR		0x7
 
+/* Subsystem vendor/device ID for PCI bridges */
+#define PCI_SSVID_VENDOR	4
+#define PCI_SSVID_DEVICE	6
+
 /* Advanced Error Reporting */
 #define PCI_ERR_UNCOR_STATUS	4	/* Uncorrectable Error Status */
 #define  PCI_ERR_UNC_TRAIN	0x00000001	/* Training */
@@ -855,6 +865,9 @@
 #define PCI_CLASS_STORAGE_FLOPPY	0x0102
 #define PCI_CLASS_STORAGE_IPI		0x0103
 #define PCI_CLASS_STORAGE_RAID		0x0104
+#define PCI_CLASS_STORAGE_ATA		0x0105
+#define PCI_CLASS_STORAGE_SATA		0x0106
+#define PCI_CLASS_STORAGE_SAS		0x0107
 #define PCI_CLASS_STORAGE_OTHER		0x0180
 
 #define PCI_BASE_CLASS_NETWORK		0x02
@@ -862,16 +875,20 @@
 #define PCI_CLASS_NETWORK_TOKEN_RING	0x0201
 #define PCI_CLASS_NETWORK_FDDI		0x0202
 #define PCI_CLASS_NETWORK_ATM		0x0203
+#define PCI_CLASS_NETWORK_ISDN		0x0204
 #define PCI_CLASS_NETWORK_OTHER		0x0280
 
 #define PCI_BASE_CLASS_DISPLAY		0x03
 #define PCI_CLASS_DISPLAY_VGA		0x0300
 #define PCI_CLASS_DISPLAY_XGA		0x0301
+#define PCI_CLASS_DISPLAY_3D		0x0302
 #define PCI_CLASS_DISPLAY_OTHER		0x0380
 
 #define PCI_BASE_CLASS_MULTIMEDIA	0x04
 #define PCI_CLASS_MULTIMEDIA_VIDEO	0x0400
 #define PCI_CLASS_MULTIMEDIA_AUDIO	0x0401
+#define PCI_CLASS_MULTIMEDIA_PHONE	0x0402
+#define PCI_CLASS_MULTIMEDIA_AUDIO_DEV	0x0403
 #define PCI_CLASS_MULTIMEDIA_OTHER	0x0480
 
 #define PCI_BASE_CLASS_MEMORY		0x05
@@ -888,11 +905,16 @@
 #define  PCI_CLASS_BRIDGE_PCMCIA	0x0605
 #define  PCI_CLASS_BRIDGE_NUBUS		0x0606
 #define  PCI_CLASS_BRIDGE_CARDBUS	0x0607
+#define  PCI_CLASS_BRIDGE_RACEWAY	0x0608
+#define  PCI_CLASS_BRIDGE_PCI_SEMI	0x0609
+#define  PCI_CLASS_BRIDGE_IB_TO_PCI	0x060a
 #define  PCI_CLASS_BRIDGE_OTHER		0x0680
 
 #define PCI_BASE_CLASS_COMMUNICATION	0x07
 #define PCI_CLASS_COMMUNICATION_SERIAL	0x0700
 #define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701
+#define PCI_CLASS_COMMUNICATION_MSERIAL	0x0702
+#define PCI_CLASS_COMMUNICATION_MODEM	0x0703
 #define PCI_CLASS_COMMUNICATION_OTHER	0x0780
 
 #define PCI_BASE_CLASS_SYSTEM		0x08
@@ -900,17 +922,20 @@
 #define PCI_CLASS_SYSTEM_DMA		0x0801
 #define PCI_CLASS_SYSTEM_TIMER		0x0802
 #define PCI_CLASS_SYSTEM_RTC		0x0803
+#define PCI_CLASS_SYSTEM_PCI_HOTPLUG	0x0804
 #define PCI_CLASS_SYSTEM_OTHER		0x0880
 
 #define PCI_BASE_CLASS_INPUT		0x09
 #define PCI_CLASS_INPUT_KEYBOARD	0x0900
 #define PCI_CLASS_INPUT_PEN		0x0901
 #define PCI_CLASS_INPUT_MOUSE		0x0902
+#define PCI_CLASS_INPUT_SCANNER		0x0903
+#define PCI_CLASS_INPUT_GAMEPORT	0x0904
 #define PCI_CLASS_INPUT_OTHER		0x0980
 
 #define PCI_BASE_CLASS_DOCKING		0x0a
 #define PCI_CLASS_DOCKING_GENERIC	0x0a00
-#define PCI_CLASS_DOCKING_OTHER		0x0a01
+#define PCI_CLASS_DOCKING_OTHER		0x0a80
 
 #define PCI_BASE_CLASS_PROCESSOR	0x0b
 #define PCI_CLASS_PROCESSOR_386		0x0b00
@@ -918,6 +943,7 @@
 #define PCI_CLASS_PROCESSOR_PENTIUM	0x0b02
 #define PCI_CLASS_PROCESSOR_ALPHA	0x0b10
 #define PCI_CLASS_PROCESSOR_POWERPC	0x0b20
+#define PCI_CLASS_PROCESSOR_MIPS	0x0b30
 #define PCI_CLASS_PROCESSOR_CO		0x0b40
 
 #define PCI_BASE_CLASS_SERIAL		0x0c
@@ -926,6 +952,34 @@
 #define PCI_CLASS_SERIAL_SSA		0x0c02
 #define PCI_CLASS_SERIAL_USB		0x0c03
 #define PCI_CLASS_SERIAL_FIBER		0x0c04
+#define PCI_CLASS_SERIAL_SMBUS		0x0c05
+#define PCI_CLASS_SERIAL_INFINIBAND	0x0c06
+
+#define PCI_BASE_CLASS_WIRELESS		0x0d
+#define PCI_CLASS_WIRELESS_IRDA		0x0d00
+#define PCI_CLASS_WIRELESS_CONSUMER_IR	0x0d01
+#define PCI_CLASS_WIRELESS_RF		0x0d10
+#define PCI_CLASS_WIRELESS_OTHER	0x0d80
+
+#define PCI_BASE_CLASS_INTELLIGENT	0x0e
+#define PCI_CLASS_INTELLIGENT_I2O	0x0e00
+
+#define PCI_BASE_CLASS_SATELLITE	0x0f
+#define PCI_CLASS_SATELLITE_TV		0x0f00
+#define PCI_CLASS_SATELLITE_AUDIO	0x0f01
+#define PCI_CLASS_SATELLITE_VOICE	0x0f03
+#define PCI_CLASS_SATELLITE_DATA	0x0f04
+
+#define PCI_BASE_CLASS_CRYPT		0x10
+#define PCI_CLASS_CRYPT_NETWORK		0x1000
+#define PCI_CLASS_CRYPT_ENTERTAINMENT	0x1010
+#define PCI_CLASS_CRYPT_OTHER		0x1080
+
+#define PCI_BASE_CLASS_SIGNAL		0x11
+#define PCI_CLASS_SIGNAL_DPIO		0x1100
+#define PCI_CLASS_SIGNAL_PERF_CTR	0x1101
+#define PCI_CLASS_SIGNAL_SYNCHRONIZER	0x1110
+#define PCI_CLASS_SIGNAL_OTHER		0x1180
 
 #define PCI_CLASS_OTHERS		0xff
 
diff -ruN pciutils-2.2.3/lib/i386-io-hurd.h pciutils-2.2.4/lib/i386-io-hurd.h
--- pciutils-2.2.3/lib/i386-io-hurd.h	2006-05-05 14:18:11.000000000 +0200
+++ pciutils-2.2.4/lib/i386-io-hurd.h	2006-08-01 12:18:51.000000000 +0200
@@ -3,19 +3,48 @@
  *
  *	Copyright (c) 2003 Marco Gerards <metgerards@student.han.nl>
  *	Copyright (c) 2003 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 2006 Samuel Thibault <samuel.thibault@ens-lyon.org> and
+ *	                   Thomas Schwinge <tschwinge@gnu.org>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
 
 #include <sys/io.h>
 
+#include <mach/machine/mach_i386.h>
+#include <device/device.h>
+#include <hurd.h>
+
+#include <stdio.h>
+
+static mach_port_t io_port;
+
 static inline int
-intel_setup_io(void)
+intel_setup_io(struct pci_access *a)
 {
-  return 1;
+  mach_port_t device;
+
+  if ((errno = get_privileged_ports(NULL, &device)))
+    a->warning("i386-io-hurd: Can't get_privileged_ports(): %m");
+
+  if (!errno && (errno = device_open(device, D_READ | D_WRITE, "io", &io_port)))
+    a->warning("i386-io-hurd: Can't device_open(): %m");
+
+  mach_port_deallocate(mach_task_self(), device);
+
+  if (!errno && (errno = i386_io_port_add(mach_thread_self(), io_port)))
+    a->warning("i386-io-hurd: Can't i386_io_port_add(): %m");
+
+  return errno ? 0 : 1;
 }
 
 static inline int
-intel_cleanup_io(void)
+intel_cleanup_io(struct pci_access *a)
 {
+  if ((errno = i386_io_port_remove(mach_thread_self(), io_port)))
+    a->warning("i386-io-hurd: Can't i386_io_port_remove(): %m");
+
+  mach_port_deallocate(mach_task_self(), io_port);
+
+  return -1;
 }
diff -ruN pciutils-2.2.3/lib/i386-io-linux.h pciutils-2.2.4/lib/i386-io-linux.h
--- pciutils-2.2.3/lib/i386-io-linux.h	2006-05-05 14:18:11.000000000 +0200
+++ pciutils-2.2.4/lib/i386-io-linux.h	2006-07-30 13:21:12.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *	The PCI Library -- Access to i386 I/O ports on Linux
  *
- *	Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -12,20 +12,15 @@
 #include <asm/io.h>
 #endif
 
-static int intel_iopl_set = -1;
-
 static int
-intel_setup_io(void)
+intel_setup_io(struct pci_access *a UNUSED)
 {
-  if (intel_iopl_set < 0)
-    intel_iopl_set = (iopl(3) < 0) ? 0 : 1;
-  return intel_iopl_set;
+  return (iopl(3) < 0) ? 0 : 1;
 }
 
-static inline void
-intel_cleanup_io(void)
+static inline int
+intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  if (intel_iopl_set > 0)
-    iopl(3);
-  intel_iopl_set = -1;
+  iopl(3);
+  return -1;
 }
diff -ruN pciutils-2.2.3/lib/i386-io-sunos.h pciutils-2.2.4/lib/i386-io-sunos.h
--- pciutils-2.2.3/lib/i386-io-sunos.h	2006-05-05 14:18:11.000000000 +0200
+++ pciutils-2.2.4/lib/i386-io-sunos.h	2006-07-30 13:21:28.000000000 +0200
@@ -2,7 +2,7 @@
  *	The PCI Library -- Access to i386 I/O ports on Solaris
  *
  *	Copyright (c) 2003 Bill Moore <billm@eng.sun.com>
- *	Copyright (c) 2003 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 2003--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -10,29 +10,17 @@
 #include <sys/sysi86.h>
 #include <sys/psw.h>
 
-static int intel_iopl_set = -1;
-
 static int
-intel_setup_io(void)
+intel_setup_io(struct pci_access *a UNUSED)
 {
-  if (intel_iopl_set < 0)
-    {
-      if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
-	intel_iopl_set = 0;
-      else
-	intel_iopl_set = 1;
-    }
-  return intel_iopl_set;
+  return (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) ? 0 : 1;
 }
 
-static inline void
-intel_cleanup_io(void)
+static inline int
+intel_cleanup_io(struct pci_access *a UNUSED)
 {
-  if (intel_iopl_set > 0)
-    {
-      /* FIXME: How to switch off I/O port access? */
-    }
-  intel_iopl_set = -1;
+  /* FIXME: How to switch off I/O port access? */
+  return 1;
 }
 
 static inline u8
diff -ruN pciutils-2.2.3/lib/i386-io-windows.h pciutils-2.2.4/lib/i386-io-windows.h
--- pciutils-2.2.3/lib/i386-io-windows.h	2006-05-05 14:18:20.000000000 +0200
+++ pciutils-2.2.4/lib/i386-io-windows.h	2006-07-30 13:21:36.000000000 +0200
@@ -2,6 +2,7 @@
  *	The PCI Library -- Access to i386 I/O ports on Windows
  *
  *	Copyright (c) 2004 Alexander Stock <stock.alexander@gmx.de>
+ *	Copyright (c) 2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -9,57 +10,52 @@
 #include <io.h>
 #include <conio.h>
 #include <windows.h>
-  
+
 #define outb(x,y) _outp(y,x)
 #define outw(x,y) _outpw(y,x)
 #define outl(x,y) _outpd(y,x)
-  
+
 #define inb(x) _inp(x)
 #define inw(x) _inpw(x)
 #define inl(x) _inpd(x)
 
-static int intel_iopl_set = -1;
-
 static int
-intel_setup_io(void)
+intel_setup_io(struct pci_access *a)
 {
-  if (intel_iopl_set < 0)
+  typedef int (*MYPROC)(void);
+  MYPROC InitializeWinIo;
+  HMODULE lib;
+
+  intel_iopl_set = 0;
+
+  lib = LoadLibrary("WinIo.dll");
+  if (!lib)
     {
-      typedef int (*MYPROC)(void);
-      MYPROC InitializeWinIo;  
-      HMODULE lib;
-
-      intel_iopl_set = 0;
-
-      lib = LoadLibrary("WinIo.dll");
-      if (!lib)
-	{
-	  fprintf(stderr, "libpci: Couldn't load WinIo.dll.\n");
-	  return 0;
-	}
-      GetProcAddress(lib, "InitializeWinIo");
-  
-      InitializeWinIo = (MYPROC) GetProcAddress(lib, "InitializeWinIo");
-      if (!InitializeWinIo)
-	{
-	  fprintf(stderr, "libpci: Couldn't find InitialieWinIo function.\n");
-	  return 0;
-	}
-
-      if (!InitializeWinIo())
-	{
-	  fprintf(stderr, "libpci: InitializeWinIo() failed.\n");
-	  return 0;
-	}
+      a->warning("i386-io-windows: Couldn't load WinIo.dll.");
+      return 0;
+    }
+  /* XXX: Is this really needed? --mj */
+  GetProcAddress(lib, "InitializeWinIo");
 
-      intel_iopl_set=1;
+  InitializeWinIo = (MYPROC) GetProcAddress(lib, "InitializeWinIo");
+  if (!InitializeWinIo)
+    {
+      a->warning("i386-io-windows: Couldn't find InitializeWinIo function.");
+      return 0;
     }
-  return intel_iopl_set;
+
+  if (!InitializeWinIo())
+    {
+      a->warning("i386-io-windows: InitializeWinIo() failed.");
+      return 0;
+    }
+
+  return 1;
 }
 
-static inline void
-intel_cleanup_io(void)
+static inline int
+intel_cleanup_io(struct pci_access *a UNUSED)
 {
   //TODO: DeInitializeWinIo!
-  //intel_iopl_set = -1;
+  return 1;
 }
diff -ruN pciutils-2.2.3/lib/i386-ports.c pciutils-2.2.4/lib/i386-ports.c
--- pciutils-2.2.3/lib/i386-ports.c	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/lib/i386-ports.c	2006-07-30 13:21:03.000000000 +0200
@@ -1,15 +1,17 @@
 /*
  *	The PCI Library -- Direct Configuration access via i386 Ports
  *
- *	Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
 
-#include <unistd.h>
+#define _GNU_SOURCE
 
 #include "internal.h"
 
+#include <unistd.h>
+
 #if defined(PCI_OS_LINUX)
 #include "i386-io-linux.h"
 #elif defined(PCI_OS_GNU)
@@ -22,17 +24,28 @@
 #error Do not know how to access I/O ports on this OS.
 #endif
 
+static int conf12_io_enabled = -1;		/* -1=haven't tried, 0=failed, 1=succeeded */
+
+static int
+conf12_setup_io(struct pci_access *a)
+{
+  if (conf12_io_enabled < 0)
+    conf12_io_enabled = intel_setup_io(a);
+  return conf12_io_enabled;
+}
+
 static void
 conf12_init(struct pci_access *a)
 {
-  if (!intel_setup_io())
-    a->error("You need to be root to have access to I/O ports.");
+  if (!conf12_setup_io(a))
+    a->error("No permission to access I/O ports (you probably have to be root).");
 }
 
 static void
 conf12_cleanup(struct pci_access *a UNUSED)
 {
-  intel_cleanup_io();
+  if (conf12_io_enabled > 0)
+    conf12_io_enabled = intel_cleanup_io(a);
 }
 
 /*
@@ -82,7 +95,7 @@
   unsigned int tmp;
   int res = 0;
 
-  if (!intel_setup_io())
+  if (!conf12_setup_io(a))
     {
       a->debug("...no I/O permission");
       return 0;
@@ -159,7 +172,7 @@
 static int
 conf2_detect(struct pci_access *a)
 {
-  if (!intel_setup_io())
+  if (!conf12_setup_io(a))
     {
       a->debug("...no I/O permission");
       return 0;
diff -ruN pciutils-2.2.3/lib/internal.h pciutils-2.2.4/lib/internal.h
--- pciutils-2.2.3/lib/internal.h	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.4/lib/internal.h	2006-09-09 12:52:47.000000000 +0200
@@ -36,5 +36,5 @@
 int pci_link_dev(struct pci_access *, struct pci_dev *);
 
 extern struct pci_methods pm_intel_conf1, pm_intel_conf2, pm_linux_proc,
-	pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_obsd_device, 
+	pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_obsd_device,
 	pm_dump, pm_linux_sysfs;
diff -ruN pciutils-2.2.3/lib/names.c pciutils-2.2.4/lib/names.c
--- pciutils-2.2.3/lib/names.c	2006-05-05 14:18:32.000000000 +0200
+++ pciutils-2.2.4/lib/names.c	2006-09-09 12:46:39.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *	The PCI Library -- ID to Name Translation
  *
- *	Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -14,11 +14,53 @@
 
 #include "internal.h"
 
+#ifdef PCI_COMPRESSED_IDS
+#include <zlib.h>
+typedef gzFile pci_file;
+#define pci_gets(f, l, s)	gzgets(f, l, s)
+#define pci_eof(f)		gzeof(f)
+
+static pci_file pci_open(struct pci_access *a)
+{
+  pci_file result;
+  size_t len;
+  char *new_name;
+
+  result = gzopen(a->id_file_name, "r");
+  if (result)
+    return result;
+  len = strlen(a->id_file_name);
+  if (len >= 3 && memcmp(a->id_file_name + len - 3, ".gz", 3) != 0)
+    return result;
+  new_name = malloc(len - 2);
+  memcpy(new_name, a->id_file_name, len - 3);
+  new_name[len - 3] = 0;
+  pci_set_name_list_path(a, new_name, 1);
+  return gzopen(a->id_file_name, "r");
+}
+
+#define pci_close(f)		gzclose(f)
+#define PCI_ERROR(f, err)						\
+	if (!err) {							\
+		int errnum;						\
+		err = gzerror(f, &errnum);				\
+		if (errnum == Z_ERRNO)	err = "I/O error";		\
+		else if (errnum >= 0)	err = NULL;			\
+	}
+#else
+typedef FILE * pci_file;
+#define pci_gets(f, l, s)	fgets(l, s, f)
+#define pci_eof(f)		feof(f)
+#define pci_open(a)		fopen(a->id_file_name, "r")
+#define pci_close(f)		fclose(f)
+#define PCI_ERROR(f, err)	if (!err && ferror(f))	err = "I/O error";
+#endif
+
 struct id_entry {
   struct id_entry *next;
   u32 id12, id34;
   byte cat;
-  byte name[1];
+  char name[1];
 };
 
 enum id_entry_type {
@@ -81,19 +123,21 @@
   return h % HASH_SIZE;
 }
 
-static struct id_entry *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4)
+static char *id_lookup(struct pci_access *a, int cat, int id1, int id2, int id3, int id4)
 {
   struct id_entry *n;
   u32 id12 = id_pair(id1, id2);
   u32 id34 = id_pair(id3, id4);
 
+  if (!a->id_hash)
+    return NULL;
   n = a->id_hash[id_hash(cat, id12, id34)];
   while (n && (n->id12 != id12 || n->id34 != id34 || n->cat != cat))
     n = n->next;
-  return n;
+  return n ? n->name : NULL;
 }
 
-static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, byte *text)
+static int id_insert(struct pci_access *a, int cat, int id1, int id2, int id3, int id4, char *text)
 {
   u32 id12 = id_pair(id1, id2);
   u32 id34 = id_pair(id3, id4);
@@ -115,7 +159,7 @@
   return 0;
 }
 
-static int id_hex(byte *p, int cnt)
+static int id_hex(char *p, int cnt)
 {
   int x = 0;
   while (cnt--)
@@ -139,23 +183,23 @@
   return (c == ' ') || (c == '\t');
 }
 
-static const char *id_parse_list(struct pci_access *a, FILE *f, int *lino)
+static const char *id_parse_list(struct pci_access *a, pci_file f, int *lino)
 {
-  byte line[MAX_LINE];
-  byte *p;
+  char line[MAX_LINE];
+  char *p;
   int id1=0, id2=0, id3=0, id4=0;
   int cat = -1;
   int nest;
   static const char parse_error[] = "Parse error";
 
   *lino = 0;
-  while (fgets(line, sizeof(line), f))
+  while (pci_gets(f, line, sizeof(line)))
     {
       (*lino)++;
       p = line;
       while (*p && *p != '\n' && *p != '\r')
 	p++;
-      if (!*p && !feof(f))
+      if (!*p && !pci_eof(f))
 	return "Line too long";
       *p = 0;
       if (p > line && (p[-1] == ' ' || p[-1] == '\t'))
@@ -273,21 +317,22 @@
 int
 pci_load_name_list(struct pci_access *a)
 {
-  FILE *f;
+  pci_file f;
   int lino;
   const char *err;
 
   pci_free_name_list(a);
-  if (!(f = fopen(a->id_file_name, "r")))
+  a->hash_load_failed = 1;
+  if (!(f = pci_open(a)))
     return 0;
   a->id_hash = pci_malloc(a, sizeof(struct id_entry *) * HASH_SIZE);
   bzero(a->id_hash, sizeof(struct id_entry *) * HASH_SIZE);
   err = id_parse_list(a, f, &lino);
-  if (!err && ferror(f))
-    err = "I/O error";
-  fclose(f);
+  PCI_ERROR(f, err);
+  pci_close(f);
   if (err)
     a->error("%s at %s, line %d\n", err, a->id_file_name, lino);
+  a->hash_load_failed = 0;
   return 1;
 }
 
@@ -304,9 +349,10 @@
     }
 }
 
-static struct id_entry *id_lookup_subsys(struct pci_access *a, int iv, int id, int isv, int isd)
+static char *
+id_lookup_subsys(struct pci_access *a, int iv, int id, int isv, int isd)
 {
-  struct id_entry *d = NULL;
+  char *d = NULL;
   if (iv > 0 && id > 0)						/* Per-device lookup */
     d = id_lookup(a, ID_SUBSYSTEM, iv, id, isv, isd);
   if (!d)							/* Generic lookup */
@@ -316,168 +362,158 @@
   return d;
 }
 
+static char *
+format_name(char *buf, int size, int flags, char *name, char *num, char *unknown)
+{
+  int res;
+  if ((flags & PCI_LOOKUP_NO_NUMBERS) && !name)
+    return NULL;
+  else if (flags & PCI_LOOKUP_NUMERIC)
+    res = snprintf(buf, size, "%s", num);
+  else if (!name)
+    res = snprintf(buf, size, ((flags & PCI_LOOKUP_MIXED) ? "%s [%s]" : "%s %s"), unknown, num);
+  else if (!(flags & PCI_LOOKUP_MIXED))
+    res = snprintf(buf, size, "%s", name);
+  else
+    res = snprintf(buf, size, "%s [%s]", name, num);
+  if (res < 0 || res >= size)
+    return "<pci_lookup_name: buffer too small>";
+  else
+    return buf;
+}
+
+static char *
+format_name_pair(char *buf, int size, int flags, char *v, char *d, char *num)
+{
+  int res;
+  if ((flags & PCI_LOOKUP_NO_NUMBERS) && (!v || !d))
+    return NULL;
+  if (flags & PCI_LOOKUP_NUMERIC)
+    res = snprintf(buf, size, "%s", num);
+  else if (flags & PCI_LOOKUP_MIXED)
+    {
+      if (v && d)
+	res = snprintf(buf, size, "%s %s [%s]", v, d, num);
+      else if (!v)
+	res = snprintf(buf, size, "Unknown device [%s]", num);
+      else /* v && !d */
+	res = snprintf(buf, size, "%s Unknown device [%s]", v, num);
+    }
+  else
+    {
+      if (v && d)
+	res = snprintf(buf, size, "%s %s", v, d);
+      else if (!v)
+	res = snprintf(buf, size, "Unknown device %s", num);
+      else /* v && !d */
+	res = snprintf(buf, size, "%s Unknown device %s", v, num+5);
+    }
+  if (res < 0 || res >= size)
+    return "<pci_lookup_name: buffer too small>";
+  else
+    return buf;
+}
+
 char *
 pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, ...)
 {
   va_list args;
-  int num, res, synth;
-  struct id_entry *v, *d, *cls, *pif;
+  char *v, *d, *cls, *pif;
   int iv, id, isv, isd, icls, ipif;
+  char numbuf[16], pifbuf[32];
 
   va_start(args, flags);
 
-  num = 0;
-  if ((flags & PCI_LOOKUP_NUMERIC) || a->numeric_ids)
-    {
-      flags &= ~PCI_LOOKUP_NUMERIC;
-      num = 1;
-    }
-  else if (!a->id_hash)
+  if (!(flags & PCI_LOOKUP_NO_NUMBERS))
     {
-      if (!pci_load_name_list(a))
-	num = a->numeric_ids = 1;
+      if (a->numeric_ids > 1)
+	flags |= PCI_LOOKUP_MIXED;
+      else if (a->numeric_ids)
+	flags |= PCI_LOOKUP_NUMERIC;
     }
+  if (flags & PCI_LOOKUP_MIXED)
+    flags &= ~PCI_LOOKUP_NUMERIC;
 
-  if (flags & PCI_LOOKUP_NO_NUMBERS)
-    {
-      flags &= ~PCI_LOOKUP_NO_NUMBERS;
-      synth = 0;
-      if (num)
-	return NULL;
-    }
-  else
-    synth = 1;
+  if (!a->id_hash && !(flags & PCI_LOOKUP_NUMERIC) && !a->hash_load_failed)
+    pci_load_name_list(a);
 
-  switch (flags)
+  switch (flags & 0xffff)
     {
     case PCI_LOOKUP_VENDOR:
       iv = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x", iv);
-      else if (v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0))
-	return v->name;
-      else
-	res = snprintf(buf, size, "Unknown vendor %04x", iv);
-      break;
+      sprintf(numbuf, "%04x", iv);
+      return format_name(buf, size, flags, id_lookup(a, ID_VENDOR, iv, 0, 0, 0), numbuf, "Unknown vendor");
     case PCI_LOOKUP_DEVICE:
       iv = va_arg(args, int);
       id = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x", id);
-      else if (d = id_lookup(a, ID_DEVICE, iv, id, 0, 0))
-	return d->name;
-      else if (synth)
-	res = snprintf(buf, size, "Unknown device %04x", id);
-      else
-	return NULL;
-      break;
+      sprintf(numbuf, "%04x", id);
+      return format_name(buf, size, flags, id_lookup(a, ID_DEVICE, iv, id, 0, 0), numbuf, "Unknown device");
     case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE:
       iv = va_arg(args, int);
       id = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x:%04x", iv, id);
-      else
-	{
-	  v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0);
-	  d = id_lookup(a, ID_DEVICE, iv, id, 0, 0);
-	  if (v && d)
-	    res = snprintf(buf, size, "%s %s", v->name, d->name);
-	  else if (!synth)
-	    return NULL;
-	  else if (!v)
-	    res = snprintf(buf, size, "Unknown device %04x:%04x", iv, id);
-	  else	/* !d */
-	    res = snprintf(buf, size, "%s Unknown device %04x", v->name, id);
-	}
-      break;
+      sprintf(numbuf, "%04x:%04x", iv, id);
+      v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0);
+      d = id_lookup(a, ID_DEVICE, iv, id, 0, 0);
+      return format_name_pair(buf, size, flags, v, d, numbuf);
     case PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR:
       isv = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x", isv);
-      else if (v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0))
-	return v->name;
-      else if (synth)
-	res = snprintf(buf, size, "Unknown vendor %04x", isv);
-      else
-	return NULL;
-      break;
+      sprintf(numbuf, "%04x", isv);
+      v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0);
+      return format_name(buf, size, flags, v, numbuf, "Unknown vendor");
     case PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE:
       iv = va_arg(args, int);
       id = va_arg(args, int);
       isv = va_arg(args, int);
       isd = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x", isd);
-      else if (d = id_lookup_subsys(a, iv, id, isv, isd))
-	return d->name;
-      else if (synth)
-	res = snprintf(buf, size, "Unknown device %04x", isd);
-      else
-	return NULL;
-      break;
+      sprintf(numbuf, "%04x", isd);
+      return format_name(buf, size, flags, id_lookup_subsys(a, iv, id, isv, isd), numbuf, "Unknown device");
     case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM:
       iv = va_arg(args, int);
       id = va_arg(args, int);
       isv = va_arg(args, int);
       isd = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x:%04x", isv, isd);
-      else
-	{
-	  v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0);
-	  d = id_lookup_subsys(a, iv, id, isv, isd);
-	  if (v && d)
-	    res = snprintf(buf, size, "%s %s", v->name, d->name);
-	  else if (!synth)
-	    return NULL;
-	  else if (!v)
-	    res = snprintf(buf, size, "Unknown device %04x:%04x", isv, isd);
-	  else /* !d */
-	    res = snprintf(buf, size, "%s Unknown device %04x", v->name, isd);
-	}
-      break;
+      v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0);
+      d = id_lookup_subsys(a, iv, id, isv, isd);
+      sprintf(numbuf, "%04x:%04x", isv, isd);
+      return format_name_pair(buf, size, flags, v, d, numbuf);
     case PCI_LOOKUP_CLASS:
       icls = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%04x", icls);
-      else if (cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0))
-	return cls->name;
-      else if (cls = id_lookup(a, ID_CLASS, icls, 0, 0, 0))
-	res = snprintf(buf, size, "%s [%04x]", cls->name, icls);
-      else if (synth)
-	res = snprintf(buf, size, "Class %04x", icls);
-      else
-	return NULL;
-      break;
+      sprintf(numbuf, "%04x", icls);
+      cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0);
+      if (!cls && (cls = id_lookup(a, ID_CLASS, icls >> 8, 0, 0, 0)))
+	{
+	  if (!(flags & PCI_LOOKUP_NUMERIC)) /* Include full class number */
+	    flags |= PCI_LOOKUP_MIXED;
+	}
+      return format_name(buf, size, flags, cls, numbuf, ((flags & PCI_LOOKUP_MIXED) ? "Unknown class" : "Class"));
     case PCI_LOOKUP_PROGIF:
       icls = va_arg(args, int);
       ipif = va_arg(args, int);
-      if (num)
-	res = snprintf(buf, size, "%02x", ipif);
-      else if (pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0))
-	return pif->name;
-      else if (icls == 0x0101 && !(ipif & 0x70))
+      sprintf(numbuf, "%02x", ipif);
+      pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0);
+      if (!pif && icls == 0x0101 && !(ipif & 0x70))
 	{
 	  /* IDE controllers have complex prog-if semantics */
-	  res = snprintf(buf, size, "%s%s%s%s%s",
-			 (ipif & 0x80) ? "Master " : "",
-			 (ipif & 0x08) ? "SecP " : "",
-			 (ipif & 0x04) ? "SecO " : "",
-			 (ipif & 0x02) ? "PriP " : "",
-			 (ipif & 0x01) ? "PriO " : "");
-	  if (res > 0 && res < size)
-	    buf[--res] = 0;
+	  sprintf(pifbuf, "%s%s%s%s%s",
+		  (ipif & 0x80) ? " Master" : "",
+		  (ipif & 0x08) ? " SecP" : "",
+		  (ipif & 0x04) ? " SecO" : "",
+		  (ipif & 0x02) ? " PriP" : "",
+		  (ipif & 0x01) ? " PriO" : "");
+	  pif = pifbuf;
+	  if (*pif)
+	    pif++;
 	}
-      else if (synth)
-	res = snprintf(buf, size, "ProgIf %02x", ipif);
-      else
-	return NULL;
-      break;
+      return format_name(buf, size, flags, pif, numbuf, "ProgIf");
     default:
       return "<pci_lookup_name: invalid request>";
     }
-  if (res < 0 || res >= size)
-    return "<pci_lookup_name: buffer too small>";
-  else
-    return buf;
+}
+
+void pci_set_name_list_path(struct pci_access *a, char *name, int to_be_freed)
+{
+  if (a->free_id_name)
+    free(a->id_file_name);
+  a->id_file_name = name;
+  a->free_id_name = to_be_freed;
 }
diff -ruN pciutils-2.2.3/lib/nbsd-libpci.c pciutils-2.2.4/lib/nbsd-libpci.c
--- pciutils-2.2.3/lib/nbsd-libpci.c	2006-05-05 14:18:34.000000000 +0200
+++ pciutils-2.2.4/lib/nbsd-libpci.c	2006-09-09 12:52:54.000000000 +0200
@@ -78,7 +78,7 @@
 
   shift = 8*(pos % 4);
   pos &= ~3;
-	
+
   if (pcibus_conf_read(d->access->fd, d->bus, d->dev, d->func, pos, &val) < 0)
     d->access->error("nbsd_read: pci_bus_conf_read() failed");
 
@@ -135,7 +135,7 @@
       val = le32_to_cpu(*(u32*)buf);
       break;
     }
-  
+
   if (pcibus_conf_write(d->access->fd, d->bus, d->dev, d->func, pos, val) < 0)
     d->access->error("nbsd_write: pci_bus_conf_write() failed");
 
diff -ruN pciutils-2.2.3/lib/obsd-device.c pciutils-2.2.4/lib/obsd-device.c
--- pciutils-2.2.3/lib/obsd-device.c	2006-05-05 14:29:45.000000000 +0200
+++ pciutils-2.2.4/lib/obsd-device.c	2006-09-09 12:53:01.000000000 +0200
@@ -78,7 +78,7 @@
 
   pi.pi_reg = pos - (pos % 4);
   pi.pi_width = 4;
-	
+
   if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) {
 	  if (errno == ENXIO) {
 		  pi.pi_data = 0xffffffff;
@@ -122,7 +122,7 @@
 
   pi.pi_reg = pos;
   pi.pi_width = len;
-	
+
   switch (len)
     {
     case 1:
@@ -135,7 +135,7 @@
       pi.pi_data = ((u32 *) buf)[0];
       break;
     }
-  
+
   if (ioctl(d->access->fd, PCIOCWRITE, &pi) < 0)
     {
       d->access->error("obsd_write: ioctl(PCIOCWRITE) failed");
diff -ruN pciutils-2.2.3/lib/pci.h pciutils-2.2.4/lib/pci.h
--- pciutils-2.2.3/lib/pci.h	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.4/lib/pci.h	2006-09-09 14:46:06.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *	The PCI Library
  *
- *	Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -13,7 +13,7 @@
 #include "header.h"
 #include "types.h"
 
-#define PCI_LIB_VERSION 0x020200
+#define PCI_LIB_VERSION 0x020204
 
 /*
  *	PCI Access Structure
@@ -43,7 +43,8 @@
   int writeable;			/* Open in read/write mode */
   int buscentric;			/* Bus-centric view of the world */
   char *id_file_name;			/* Name of ID list file */
-  int numeric_ids;			/* Don't resolve device IDs to names */
+  int free_id_name;			/* Set if id_file_name is malloced */
+  int numeric_ids;			/* Enforce PCI_LOOKUP_NUMERIC (>1 => PCI_LOOKUP_MIXED) */
   int debugging;			/* Turn on debugging messages */
 
   /* Functions you can override: */
@@ -57,6 +58,7 @@
   struct pci_methods *methods;
   struct id_entry **id_hash;		/* names.c */
   struct id_bucket *current_id_bucket;
+  int hash_load_failed;
   int fd;				/* proc: fd */
   int fd_rw;				/* proc: fd opened read-write */
   struct pci_dev *cached_dev;		/* proc: device the fd is for */
@@ -85,6 +87,7 @@
   /* These fields are set by pci_fill_info() */
   int known_fields;			/* Set of info fields already known */
   u16 vendor_id, device_id;		/* Identity of the device */
+  u16 device_class;			/* PCI device class */
   int irq;				/* IRQ number */
   pciaddr_t base_addr[6];		/* Base addresses */
   pciaddr_t size[6];			/* Region sizes */
@@ -119,6 +122,7 @@
 #define PCI_FILL_BASES		4
 #define PCI_FILL_ROM_BASE	8
 #define PCI_FILL_SIZES		16
+#define PCI_FILL_CLASS		32
 #define PCI_FILL_RESCAN		0x10000
 
 void pci_setup_cache(struct pci_dev *, u8 *cache, int len);
@@ -157,6 +161,7 @@
 
 int pci_load_name_list(struct pci_access *a);	/* Called automatically by pci_lookup_*() when needed; returns success */
 void pci_free_name_list(struct pci_access *a);	/* Called automatically by pci_cleanup() */
+void pci_set_name_list_path(struct pci_access *a, char *name, int to_be_freed);
 
 enum pci_lookup_mode {
   PCI_LOOKUP_VENDOR = 1,		/* Vendor name (args: vendorID) */
@@ -165,7 +170,8 @@
   PCI_LOOKUP_SUBSYSTEM = 8,
   PCI_LOOKUP_PROGIF = 16,		/* Programming interface (args: classID, prog_if) */
   PCI_LOOKUP_NUMERIC = 0x10000,		/* Want only formatted numbers; default if access->numeric_ids is set */
-  PCI_LOOKUP_NO_NUMBERS = 0x20000	/* Return NULL if not found in the database; default is to print numerically */
+  PCI_LOOKUP_NO_NUMBERS = 0x20000,	/* Return NULL if not found in the database; default is to print numerically */
+  PCI_LOOKUP_MIXED = 0x40000,		/* Include both numbers and names */
 };
 
 #endif
diff -ruN pciutils-2.2.3/lib/sysfs.c pciutils-2.2.4/lib/sysfs.c
--- pciutils-2.2.3/lib/sysfs.c	2006-05-05 14:18:32.000000000 +0200
+++ pciutils-2.2.4/lib/sysfs.c	2006-06-27 15:10:05.000000000 +0200
@@ -163,18 +163,14 @@
 	{
 	  sysfs_get_resources(d);
 	  d->irq = sysfs_get_value(d, "irq");
-	  d->known_fields = PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES;
-#if 0
 	  /*
-	   *  We prefer reading these from the config registers, it's faster.
-	   *  However, it would be possible and maybe even useful to hack the kernel
-	   *  to believe that some device has a different ID. If you do it, just
-	   *  enable this piece of code.  --mj
+	   *  We could read these faster from the config registers, but we want to give
+	   *  the kernel a chance to fix up ID's and especially classes of broken devices.
 	   */
 	  d->vendor_id = sysfs_get_value(d, "vendor");
 	  d->device_id = sysfs_get_value(d, "device");
-	  d->known_fields |= PCI_FILL_IDENT;
-#endif
+	  d->device_class = sysfs_get_value(d, "class") >> 8;
+	  d->known_fields = PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES;
 	}
       pci_link_dev(a, d);
     }
diff -ruN pciutils-2.2.3/lspci.c pciutils-2.2.4/lspci.c
--- pciutils-2.2.3/lspci.c	2006-05-05 21:45:47.000000000 +0200
+++ pciutils-2.2.4/lspci.c	2006-09-09 14:32:29.000000000 +0200
@@ -25,6 +25,8 @@
 static int map_mode;			/* Bus mapping mode enabled */
 static int show_domains;		/* Show domain numbers (0=disabled, 1=auto-detected, 2=requested) */
 
+const char program_name[] = "lspci";
+
 static char options[] = "nvbxs:d:ti:mgMD" GENERIC_OPTIONS ;
 
 static char help_msg[] = "\
@@ -32,6 +34,7 @@
 \n\
 -v\t\tBe verbose\n\
 -n\t\tShow numeric ID's\n\
+-nn\t\tShow both textual and numeric ID's (names & numbers)\n\
 -b\t\tBus-centric view (PCI addresses and IRQ's instead of those seen by the CPU)\n\
 -x\t\tShow hex-dump of the standard portion of config space\n\
 -xxx\t\tShow hex-dump of the whole config space (dangerous; root only)\n\
@@ -127,7 +130,7 @@
 	d->config_cached += 64;
     }
   pci_setup_cache(p, d->config, d->config_cached);
-  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES);
+  pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | PCI_FILL_SIZES);
   return d;
 }
 
@@ -253,13 +256,13 @@
 {
   int c;
   struct pci_dev *p = d->dev;
-  byte classbuf[128], devbuf[128];
+  char classbuf[128], devbuf[128];
 
   show_slot_name(d);
   printf(" %s: %s",
 	 pci_lookup_name(pacc, classbuf, sizeof(classbuf),
 			 PCI_LOOKUP_CLASS,
-			 get_conf_word(d, PCI_CLASS_DEVICE)),
+			 p->device_class),
 	 pci_lookup_name(pacc, devbuf, sizeof(devbuf),
 			 PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
 			 p->vendor_id, p->device_id));
@@ -271,7 +274,7 @@
       c = get_conf_byte(d, PCI_CLASS_PROG);
       x = pci_lookup_name(pacc, devbuf, sizeof(devbuf),
 			  PCI_LOOKUP_PROGIF | PCI_LOOKUP_NO_NUMBERS,
-			  get_conf_word(d, PCI_CLASS_DEVICE), c);
+			  p->device_class, c);
       if (c || x)
 	{
 	  printf(" (prog-if %02x", c);
@@ -497,13 +500,13 @@
   static const byte max_outstanding[8] = { 1, 2, 3, 4, 8, 12, 16, 32 };
 
   printf("PCI-X non-bridge device\n");
-      
+
   if (verbose < 2)
     return;
 
   if (!config_fetch(d, where + PCI_PCIX_STATUS, 4))
     return;
-  
+
   command = get_conf_word(d, where + PCI_PCIX_COMMAND);
   status = get_conf_long(d, where + PCI_PCIX_STATUS);
   printf("\t\tCommand: DPERE%c ERO%c RBC=%d OST=%d\n",
@@ -531,18 +534,18 @@
 static void
 show_pcix_bridge(struct device *d, int where)
 {
-  static const byte * const sec_clock_freq[8] = { "conv", "66MHz", "100MHz", "133MHz", "?4", "?5", "?6", "?7" };
+  static const char * const sec_clock_freq[8] = { "conv", "66MHz", "100MHz", "133MHz", "?4", "?5", "?6", "?7" };
   u16 secstatus;
   u32 status, upstcr, downstcr;
-  
+
   printf("PCI-X bridge device\n");
-  
+
   if (verbose < 2)
     return;
-  
+
   if (!config_fetch(d, where + PCI_PCIX_BRIDGE_STATUS, 12))
     return;
-  
+
   secstatus = get_conf_word(d, where + PCI_PCIX_BRIDGE_SEC_STATUS);
   printf("\t\tSecondary Status: 64bit%c 133MHz%c SCD%c USC%c SCO%c SRD%c Freq=%s\n",
 	 FLAG(secstatus, PCI_PCIX_BRIDGE_SEC_STATUS_64BIT),
@@ -553,7 +556,7 @@
 	 FLAG(secstatus, PCI_PCIX_BRIDGE_SEC_STATUS_SPLIT_REQUEST_DELAYED),
 	 sec_clock_freq[(secstatus >> 6) & 7]);
   status = get_conf_long(d, where + PCI_PCIX_BRIDGE_STATUS);
-  printf("\t\tStatus: Dev=%02x:%02x.%d 64bit%c 133MHz%c SCD%c USC%c SCO%c SRD%c\n", 
+  printf("\t\tStatus: Dev=%02x:%02x.%d 64bit%c 133MHz%c SCD%c USC%c SCO%c SRD%c\n",
 	 ((status >> 8) & 0xff),
 	 ((status >> 3) & 0x1f),
 	 (status & PCI_PCIX_BRIDGE_STATUS_FUNCTION),
@@ -988,7 +991,8 @@
   u32 t;
   u16 w;
 
-  printf("Message Signalled Interrupts: 64bit%c Queue=%d/%d Enable%c\n",
+  printf("Message Signalled Interrupts: Mask%c 64bit%c Queue=%d/%d Enable%c\n",
+         FLAG(cap, PCI_MSI_FLAGS_MASK_BIT),
 	 FLAG(cap, PCI_MSI_FLAGS_64BIT),
 	 (cap & PCI_MSI_FLAGS_QSIZE) >> 4,
 	 (cap & PCI_MSI_FLAGS_QMASK) >> 1,
@@ -1009,6 +1013,26 @@
     w = get_conf_word(d, where + PCI_MSI_DATA_32);
   t = get_conf_long(d, where + PCI_MSI_ADDRESS_LO);
   printf("%08x  Data: %04x\n", t, w);
+  if (cap & PCI_MSI_FLAGS_MASK_BIT)
+    {
+      u32 mask, pending;
+
+      if (is64)
+	{
+	  if (!config_fetch(d, where + PCI_MSI_MASK_BIT_64, 8))
+	    return;
+	  mask = get_conf_long(d, where + PCI_MSI_MASK_BIT_64);
+	  pending = get_conf_long(d, where + PCI_MSI_PENDING_64);
+	}
+      else
+        {
+	  if (!config_fetch(d, where + PCI_MSI_MASK_BIT_32, 8))
+	    return;
+	  mask = get_conf_long(d, where + PCI_MSI_MASK_BIT_32);
+	  pending = get_conf_long(d, where + PCI_MSI_PENDING_32);
+	}
+      printf("\t\tMasking: %08x  Pending: %08x\n", mask, pending);
+    }
 }
 
 static void show_vendor(void)
@@ -1064,9 +1088,9 @@
 
   w = get_conf_word(d, where + PCI_EXP_DEVCTL);
   printf("\t\tDevice: Errors: Correctable%c Non-Fatal%c Fatal%c Unsupported%c\n",
-	FLAG(w, PCI_EXP_DEVCTL_CERE), 
-	FLAG(w, PCI_EXP_DEVCTL_NFERE), 
-	FLAG(w, PCI_EXP_DEVCTL_FERE), 
+	FLAG(w, PCI_EXP_DEVCTL_CERE),
+	FLAG(w, PCI_EXP_DEVCTL_NFERE),
+	FLAG(w, PCI_EXP_DEVCTL_FERE),
 	FLAG(w, PCI_EXP_DEVCTL_URRE));
   printf("\t\tDevice: RlxdOrd%c ExtTag%c PhantFunc%c AuxPwr%c NoSnoop%c\n",
 	FLAG(w, PCI_EXP_DEVCTL_RELAXED),
@@ -1269,6 +1293,22 @@
 }
 
 static void
+show_ssvid(struct device *d, int where)
+{
+  u16 subsys_v, subsys_d;
+  char ssnamebuf[256];
+
+  if (!config_fetch(d, where, 8))
+    return;
+  subsys_v = get_conf_word(d, where + PCI_SSVID_VENDOR);
+  subsys_d = get_conf_word(d, where + PCI_SSVID_DEVICE);
+  printf("Subsystem: %s\n",
+	   pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf),
+			   PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
+			   d->dev->vendor_id, d->dev->device_id, subsys_v, subsys_d));
+}
+
+static void
 show_aer(struct device *d UNUSED, int where UNUSED)
 {
   printf("Advanced Error Reporting\n");
@@ -1393,6 +1433,9 @@
 	    case PCI_CAP_ID_DBG:
 	      show_debug();
 	      break;
+	    case PCI_CAP_ID_SSVID:
+	      show_ssvid(d, where);
+	      break;
 	    case PCI_CAP_ID_EXP:
 	      show_express(d, where, cap);
 	      can_have_ext_caps = 1;
@@ -1484,7 +1527,7 @@
 		   get_conf_long(d, PCI_PREF_BASE_UPPER32),
 		   pref_base,
 		   get_conf_long(d, PCI_PREF_LIMIT_UPPER32),
-		   pref_limit);
+		   pref_limit + 0xfffff);
 	}
     }
 
@@ -1589,7 +1632,7 @@
   struct pci_dev *p = d->dev;
   word status = get_conf_word(d, PCI_STATUS);
   word cmd = get_conf_word(d, PCI_COMMAND);
-  word class = get_conf_word(d, PCI_CLASS_DEVICE);
+  word class = p->device_class;
   byte bist = get_conf_byte(d, PCI_BIST);
   byte htype = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f;
   byte latency = get_conf_byte(d, PCI_LATENCY_TIMER);
@@ -1759,6 +1802,19 @@
 }
 
 static void
+print_shell_escaped(char *c)
+{
+  printf(" \"");
+  while (*c)
+    {
+      if (*c == '"' || *c == '\\')
+	putchar('\\');
+      putchar(*c++);
+    }
+  putchar('"');
+}
+
+static void
 show_machine(struct device *d)
 {
   struct pci_dev *p = d->dev;
@@ -1783,11 +1839,11 @@
 
   if (verbose)
     {
-      printf("Device:\t");
+      printf((machine_readable >= 2) ? "Slot:\t" : "Device:\t");
       show_slot_name(d);
       putchar('\n');
       printf("Class:\t%s\n",
-	     pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS, get_conf_word(d, PCI_CLASS_DEVICE)));
+	     pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS, p->device_class));
       printf("Vendor:\t%s\n",
 	     pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id));
       printf("Device:\t%s\n",
@@ -1807,21 +1863,18 @@
   else
     {
       show_slot_name(d);
-      printf(" \"%s\" \"%s\" \"%s\"",
-	     pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS,
-			     get_conf_word(d, PCI_CLASS_DEVICE)),
-	     pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR,
-			     p->vendor_id, p->device_id),
-	     pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE,
-			     p->vendor_id, p->device_id));
+      print_shell_escaped(pci_lookup_name(pacc, classbuf, sizeof(classbuf), PCI_LOOKUP_CLASS, p->device_class));
+      print_shell_escaped(pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR, p->vendor_id, p->device_id));
+      print_shell_escaped(pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id));
       if (c = get_conf_byte(d, PCI_REVISION_ID))
 	printf(" -r%02x", c);
       if (c = get_conf_byte(d, PCI_CLASS_PROG))
 	printf(" -p%02x", c);
       if (sv_id && sv_id != 0xffff)
-	printf(" \"%s\" \"%s\"",
-	       pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, sv_id),
-	       pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, sv_id, sd_id));
+	{
+	  print_shell_escaped(pci_lookup_name(pacc, svbuf, sizeof(svbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR, sv_id));
+	  print_shell_escaped(pci_lookup_name(pacc, sdbuf, sizeof(sdbuf), PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE, p->vendor_id, p->device_id, sv_id, sd_id));
+	}
       else
 	printf(" \"\" \"\"");
       putchar('\n');
@@ -1933,7 +1986,7 @@
   last_br = &host_bridge.chain;
   for(d=first_dev; d; d=d->next)
     {
-      word class = get_conf_word(d, PCI_CLASS_DEVICE);
+      word class = d->dev->device_class;
       byte ht = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f;
       if (class == PCI_CLASS_BRIDGE_PCI &&
 	  (ht == PCI_HEADER_TYPE_BRIDGE || ht == PCI_HEADER_TYPE_CARDBUS))
@@ -1996,7 +2049,7 @@
 }
 
 static void
-print_it(byte *line, byte *p)
+print_it(char *line, char *p)
 {
   *p++ = '\n';
   *p = 0;
@@ -2008,10 +2061,10 @@
       *p = ' ';
 }
 
-static void show_tree_bridge(struct bridge *, byte *, byte *);
+static void show_tree_bridge(struct bridge *, char *, char *);
 
 static void
-show_tree_dev(struct device *d, byte *line, byte *p)
+show_tree_dev(struct device *d, char *line, char *p)
 {
   struct pci_dev *q = d->dev;
   struct bridge *b;
@@ -2037,7 +2090,7 @@
 }
 
 static void
-show_tree_bus(struct bus *b, byte *line, byte *p)
+show_tree_bus(struct bus *b, char*line, char *p)
 {
   if (!b->first_dev)
     print_it(line, p);
@@ -2064,7 +2117,7 @@
 }
 
 static void
-show_tree_bridge(struct bridge *b, byte *line, byte *p)
+show_tree_bridge(struct bridge *b, char *line, char *p)
 {
   *p++ = '-';
   if (!b->first_bus->sibling)
@@ -2076,7 +2129,7 @@
   else
     {
       struct bus *u = b->first_bus;
-      byte *k;
+      char *k;
 
       while (u->sibling)
         {
@@ -2289,7 +2342,7 @@
     switch (i)
       {
       case 'n':
-	pacc->numeric_ids = 1;
+	pacc->numeric_ids++;
 	break;
       case 'v':
 	verbose++;
@@ -2313,7 +2366,7 @@
 	show_tree++;
 	break;
       case 'i':
-	pacc->id_file_name = optarg;
+        pci_set_name_list_path(pacc, optarg, 0);
 	break;
       case 'm':
 	machine_readable++;
diff -ruN pciutils-2.2.3/lspci.man pciutils-2.2.4/lspci.man
--- pciutils-2.2.3/lspci.man	2006-05-05 14:18:35.000000000 +0200
+++ pciutils-2.2.4/lspci.man	2006-09-09 14:35:23.000000000 +0200
@@ -54,6 +54,9 @@
 Show PCI vendor and device codes as numbers instead of looking them up in the
 PCI ID list.
 .TP
+.B -nn
+Show PCI vendor and device codes as both numbers and names.
+.TP
 .B -x
 Show hexadecimal dump of the standard part of the configuration space (the first
 64 bytes or 128 bytes for CardBus bridges).
@@ -98,9 +101,12 @@
 as the PCI ID list instead of @IDSDIR@/pci.ids.
 .TP
 .B -m
-Dump PCI device data in machine readable form (both normal and verbose format supported)
-for easy parsing by scripts. Please don't use any other formats for this purpose, they
-are likely to change in the future versions of lspci.
+Dump PCI device data in a backward-compatible machine readable form.
+See below for details.
+.TP
+.B -mm
+Dump PCI device data in a machine readable form for easy parsing by scripts.
+See below for details.
 .TP
 .B -D
 Always show PCI domain numbers. By default, lspci suppresses them on machines which
@@ -114,7 +120,7 @@
 that the bus mapper doesn't support PCI domains and scans only domain 0.
 .TP
 .B --version
-Shows 
+Shows
 .I lspci
 version. This option should be used stand-alone.
 
@@ -184,6 +190,108 @@
 .B -G
 Increase debug level of the library.
 
+.SH MACHINE READABLE OUTPUT
+If you intend to process the output of lspci automatically, please use one of the
+machine-readable output formats
+.RB ( -m ,
+.BR -vm ,
+.BR -vmm )
+described in this section. All other formats are likely to change
+between versions of lspci.
+
+.P
+All numbers are always printed in hexadecimal. If you want to process numeric ID's instead of
+names, please add the
+.B -n
+switch.
+
+.SS Simple format (-m)
+
+In the simple format, each device is described on a single line, which is
+formatted as parameters suitable for passing to a shell script, i.e., values
+separated by whitespaces, quoted and escaped if necessary.
+Some of the arguments are positional: slot, class, vendor name, device name,
+subsystem vendor name and subsystem name (the last two are empty if
+the device has no subsystem); the remaining arguments are option-like:
+
+.TP
+.BI -r rev
+Revision number.
+
+.TP
+.BI -p progif
+Programming interface.
+
+.P
+The relative order of positional arguments and options is undefined.
+New options can be added in future versions, but they will always
+have a single argument not separated from the option by any spaces,
+so they can be easily ignored if not recognized.
+
+.SS Verbose format (-vmm)
+
+The verbose output is a sequence of records separated by blank lines.
+Each record describes a single device by a sequence of lines, each line
+containing a single
+.RI ` tag :
+.IR value '
+pair. The
+.I tag
+and the
+.I value
+are separated by a single tab character.
+Neither the records nor the lines within a record are in any particular order.
+Tags are case-sensitive.
+
+.P
+The following tags are defined:
+
+.TP
+.B Slot
+The name of the slot where the device resides
+.RI ([ domain :] bus : device . function ).
+This tag is always the first in a record.
+
+.TP
+.B Class
+Name of the class.
+
+.TP
+.B Vendor
+Name of the vendor.
+
+.TP
+.B Device
+Name of the device.
+
+.TP
+.B SVendor
+Name of the subsystem vendor (optional).
+
+.TP
+.B SDevice
+Name of the subsystem (optional).
+
+.TP
+.B Rev
+Revision number (optional).
+
+.TP
+.B ProgIf
+Programming interface (optional).
+
+.P
+New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
+
+.SS Backward-compatible verbose format (-vm)
+
+In this mode, lspci tries to be perfectly compatible with its old versions.
+It's almost the same as the regular verbose format, but the
+.B
+Device
+tag is used for both the slot and the device name, so it occurs twice
+in a single record. Please avoid using this format in any new code.
+
 .SH FILES
 .TP
 .B @IDSDIR@/pci.ids
@@ -192,6 +300,9 @@
 .B update-pciids
 utility to download the most recent version.
 .TP
+.B @IDSDIR@/pci.ids.gz
+If lspci is compiled with support for compression, this file is tried before pci.ids.
+.TP
 .B /proc/bus/pci
 An interface to PCI bus configuration space provided by the post-2.1.82 Linux
 kernels. Contains per-bus subdirectories with per-card config space files and a
diff -ruN pciutils-2.2.3/maint/release pciutils-2.2.4/maint/release
--- pciutils-2.2.3/maint/release	2006-05-05 14:18:33.000000000 +0200
+++ pciutils-2.2.4/maint/release	2006-09-09 14:51:18.000000000 +0200
@@ -1,11 +1,19 @@
 #!/usr/bin/perl
 # A simple script for making releases of the pciutils
-# (c) 2003--2004 Martin Mares <mj@ucw.cz>
+# (c) 2003--2006 Martin Mares <mj@ucw.cz>
 
 use strict;
 use warnings;
 require "maint/release.pm";
 
+# Check API version
+my $apiver = "???";
+open X, "lib/pci.h" or die;
+while (<X>) {
+	/^#define PCI_LIB_VERSION 0x(.{6})$/ and $apiver = $1;
+}
+print "API version is $apiver ... <confirm> "; <STDIN>;
+
 my $r = new UCW::Release("pciutils");
 my $ver = $r->GetVersionFromFile("Makefile", "VERSION=(.*)");
 $r->GetVersionsFromChangelog("ChangeLog", "Released as (.*)\.");
@@ -25,7 +33,7 @@
 push @{$r->{"uploads"}}, {
 	"url" => "ftp://metalab.unc.edu/incoming/linux/",
 	"filter" => '(\.tar\.gz|\.lsm)$'
-	} if $r->{"ALPHADIR"} ne "";
+	} if $r->{"ALPHADIR"} eq "";
 $r->ParseOptions;
 $r->InitDist("maint/dist");
 my $reldir = $r->GenPackage;
diff -ruN pciutils-2.2.3/maint/release.pm pciutils-2.2.4/maint/release.pm
--- pciutils-2.2.3/maint/release.pm	2006-05-05 14:18:26.000000000 +0200
+++ pciutils-2.2.4/maint/release.pm	2006-09-09 12:53:35.000000000 +0200
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 # A simple system for making software releases
-# (c) 2003 Martin Mares <mj@ucw.cz>
+# (c) 2003--2006 Martin Mares <mj@ucw.cz>
 
 package UCW::Release;
 use strict;
@@ -15,7 +15,7 @@
 		"PACKAGE" => $basename,
 		"rules" => [
 			# p=preprocess, s=subst, -=discard
-			'(^|/)(CVS|\.arch-ids|{arch}|tmp)/' => '-',
+			'(^|/)(CVS|\.arch-ids|{arch}|\.git|tmp)/' => '-',
 			'\.(lsm|spec)$' => 'ps',
 			'(^|/)README$' => 's'
 			],
@@ -147,7 +147,7 @@
 					$empty && next;
 					$empty = 1;
 				} else { $empty = 0; }
-			}		
+			}
 			print O;
 		}
 		close O;
diff -ruN pciutils-2.2.3/pciutils.h pciutils-2.2.4/pciutils.h
--- pciutils-2.2.3/pciutils.h	2006-05-05 14:18:24.000000000 +0200
+++ pciutils-2.2.4/pciutils.h	2006-05-31 18:01:34.000000000 +0200
@@ -15,6 +15,8 @@
 
 #define PCIUTILS_VERSION PCILIB_VERSION
 
+extern const char program_name[];
+
 void die(char *msg, ...) NONRET;
 void *xmalloc(unsigned int howmuch);
 void *xrealloc(void *ptr, unsigned int howmuch);
diff -ruN pciutils-2.2.3/pciutils.lsm pciutils-2.2.4/pciutils.lsm
--- pciutils-2.2.3/pciutils.lsm	2006-05-05 21:46:58.000000000 +0200
+++ pciutils-2.2.4/pciutils.lsm	2006-09-09 14:57:21.000000000 +0200
@@ -1,14 +1,14 @@
 Begin3
 Title:          The PCI Utilities
-Version:        2.2.3
-Entered-date:   060505
+Version:        2.2.4
+Entered-date:   060909
 Description:    This package contains various utilities for inspecting and
 		setting of devices connected to the PCI bus.
 Keywords:       kernel, pci, lspci, setpci, libpci
 Author:         mj@ucw.cz (Martin Mares)
 Maintained-by:  mj@ucw.cz (Martin Mares)
-Primary-site:   atrey.karlin.mff.cuni.cz pub/linux/pci/pciutils-2.2.3.tar.gz
-Alternate-site: ftp.kernel.org pub/software/utils/pciutils/pciutils-2.2.3.tar.gz
-Alternate-site: metalab.unc.edu pub/Linux/hardware/pciutils-2.2.3.tar.gz
+Primary-site:   atrey.karlin.mff.cuni.cz pub/linux/pci/pciutils-2.2.4.tar.gz
+Alternate-site: ftp.kernel.org pub/software/utils/pciutils/pciutils-2.2.4.tar.gz
+Alternate-site: metalab.unc.edu pub/Linux/hardware/pciutils-2.2.4.tar.gz
 Copying-policy: GPL
 End
diff -ruN pciutils-2.2.3/pciutils.spec pciutils-2.2.4/pciutils.spec
--- pciutils-2.2.3/pciutils.spec	2006-05-05 21:46:58.000000000 +0200
+++ pciutils-2.2.4/pciutils.spec	2006-09-09 14:57:21.000000000 +0200
@@ -1,5 +1,5 @@
 Name:		pciutils
-Version:	2.2.3
+Version:	2.2.4
 Release: 	1
 Source:		ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/%{name}-%{version}.tar.gz
 Copyright:	GNU GPL
diff -ruN pciutils-2.2.3/setpci.c pciutils-2.2.4/setpci.c
--- pciutils-2.2.3/setpci.c	2006-05-05 14:18:20.000000000 +0200
+++ pciutils-2.2.4/setpci.c	2006-05-31 18:03:18.000000000 +0200
@@ -1,7 +1,7 @@
 /*
  *	The PCI Utilities -- Manipulate PCI Configuration Registers
  *
- *	Copyright (c) 1998--2004 Martin Mares <mj@ucw.cz>
+ *	Copyright (c) 1998--2006 Martin Mares <mj@ucw.cz>
  *
  *	Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -18,6 +18,8 @@
 static int verbose;			/* Verbosity level */
 static int demo_mode;			/* Only show */
 
+const char program_name[] = "setpci";
+
 static struct pci_access *pacc;
 
 struct value {
@@ -435,7 +437,7 @@
 		case 'L':
 		  op->width = 4; break;
 		default:
-		  usage("Invalid width \"%s\"", *e);
+		  usage("Invalid width \"%c\"", *e);
 		}
 	    }
 	  else
diff -ruN pciutils-2.2.3/update-pciids.sh pciutils-2.2.4/update-pciids.sh
--- pciutils-2.2.3/update-pciids.sh	2006-05-05 14:18:34.000000000 +0200
+++ pciutils-2.2.4/update-pciids.sh	2006-09-09 12:36:17.000000000 +0200
@@ -3,8 +3,14 @@
 set -e
 SRC="http://pciids.sourceforge.net/v2.2/pci.ids"
 DEST=pci.ids
+PCI_COMPRESSED_IDS=
+GREP=grep
 
-if which bzip2 >/dev/null ; then
+if [ -n "$PCI_COMPRESSED_IDS" ] ; then
+	DECOMP="cat"
+	SRC="$SRC.gz"
+	GREP=zgrep
+elif which bzip2 >/dev/null ; then
 	DECOMP="bzip2 -d"
 	SRC="$SRC.bz2"
 elif which gzip >/dev/null ; then
@@ -36,7 +42,7 @@
 	exit 1
 fi
 
-if ! grep >/dev/null "^C " $DEST.neww ; then
+if ! $GREP >/dev/null "^C " $DEST.neww ; then
 	echo >&2 "update-pciids: missing class info, probably truncated file"
 	exit 1
 fi
diff -ruN pciutils-2.2.3/win32/config.h pciutils-2.2.4/win32/config.h
--- pciutils-2.2.3/win32/config.h	2006-05-05 21:46:58.000000000 +0200
+++ pciutils-2.2.4/win32/config.h	2006-09-09 14:57:21.000000000 +0200
@@ -2,4 +2,4 @@
 #define PCI_OS_WINDOWS
 #define PCI_HAVE_PM_INTEL_CONF
 #define PCI_PATH_IDS "pci.ids"
-#define PCILIB_VERSION "2.2.3"
+#define PCILIB_VERSION "2.2.4"
