diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-11-26 23:04:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-11-26 23:04:51 +0000 |
commit | 2e9340b95b0f97b36f84fdc1bd91a98705ad353c (patch) | |
tree | 53d8d5b8f223645a1913eccbe16bd3c6ac547f54 /sys-apps/pciutils | |
parent | Version bump. (diff) | |
download | historical-2e9340b95b0f97b36f84fdc1bd91a98705ad353c.tar.gz historical-2e9340b95b0f97b36f84fdc1bd91a98705ad353c.tar.bz2 historical-2e9340b95b0f97b36f84fdc1bd91a98705ad353c.zip |
old
Diffstat (limited to 'sys-apps/pciutils')
-rw-r--r-- | sys-apps/pciutils/files/2.1.11-scan.patch | 12 | ||||
-rw-r--r-- | sys-apps/pciutils/files/digest-pciutils-2.1.11-r5 | 6 | ||||
-rw-r--r-- | sys-apps/pciutils/files/digest-pciutils-2.2.3 | 6 | ||||
-rw-r--r-- | sys-apps/pciutils/files/pcimodules-pciutils-2.1.11.diff | 339 | ||||
-rw-r--r-- | sys-apps/pciutils/files/pciutils-2.1.11-bsd.patch | 47 | ||||
-rw-r--r-- | sys-apps/pciutils/files/pciutils-2.1.11-gentoo-paths.patch | 21 | ||||
-rw-r--r-- | sys-apps/pciutils/files/pciutils-2.1.11-sysfs.patch | 384 | ||||
-rw-r--r-- | sys-apps/pciutils/pciutils-2.1.11-r5.ebuild | 77 | ||||
-rw-r--r-- | sys-apps/pciutils/pciutils-2.2.3.ebuild | 63 |
9 files changed, 0 insertions, 955 deletions
diff --git a/sys-apps/pciutils/files/2.1.11-scan.patch b/sys-apps/pciutils/files/2.1.11-scan.patch deleted file mode 100644 index 590c21dd1902..000000000000 --- a/sys-apps/pciutils/files/2.1.11-scan.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- pciutils-2.1.10/lib/access.c.foo Wed Feb 12 15:44:05 2003 -+++ pciutils-2.1.10/lib/access.c Wed Feb 12 15:44:33 2003 -@@ -180,7 +180,8 @@ - void - pci_scan_bus(struct pci_access *a) - { -- a->methods->scan(a); -+ if (a->methods) -+ a->methods->scan(a); - } - - struct pci_dev * diff --git a/sys-apps/pciutils/files/digest-pciutils-2.1.11-r5 b/sys-apps/pciutils/files/digest-pciutils-2.1.11-r5 deleted file mode 100644 index 62e9d8f85c78..000000000000 --- a/sys-apps/pciutils/files/digest-pciutils-2.1.11-r5 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 29d45fd4f233e88fabe08fd2ac4d8ccf pci.ids-20041019.bz2 86174 -RMD160 bb7c3f274f4d5b8d4ec9b5c567530db16c3d58a3 pci.ids-20041019.bz2 86174 -SHA256 d28b0b5d2a8282a3eac9498959e3e1eb5ce7c35e55b1345b71ff75f3cadc65da pci.ids-20041019.bz2 86174 -MD5 1d40f90aaae69594790bdb8ff90b4a41 pciutils-2.1.11.tar.gz 120948 -RMD160 46b6aed92fb9a8b81e7bd0da23ed13963ce15456 pciutils-2.1.11.tar.gz 120948 -SHA256 1170456bd1402d45823faa9b1d886479055bb3360d87945ff7d15f4b1e89b8ff pciutils-2.1.11.tar.gz 120948 diff --git a/sys-apps/pciutils/files/digest-pciutils-2.2.3 b/sys-apps/pciutils/files/digest-pciutils-2.2.3 deleted file mode 100644 index 5190675617ab..000000000000 --- a/sys-apps/pciutils/files/digest-pciutils-2.2.3 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 3b14976e7077587eec23c2d71cc5b022 pci.ids-20060608.bz2 108285 -RMD160 0768e2232a6003711de498ef8e7df805d4c880c7 pci.ids-20060608.bz2 108285 -SHA256 81418596523d437b260573d727d77130e91890f84265b58907f1175fa81224ed pci.ids-20060608.bz2 108285 -MD5 39747279aad46e7a6a3e1ea636d055b4 pciutils-2.2.3.tar.gz 1121334 -RMD160 429b3b21f4cb079c2f3620a4c4d14c6dc610a098 pciutils-2.2.3.tar.gz 1121334 -SHA256 e501df7734738d0625a3765498e1c4625a2fbaf408c86599eca2070c57bc4d4b pciutils-2.2.3.tar.gz 1121334 diff --git a/sys-apps/pciutils/files/pcimodules-pciutils-2.1.11.diff b/sys-apps/pciutils/files/pcimodules-pciutils-2.1.11.diff deleted file mode 100644 index e3023b8a97bf..000000000000 --- a/sys-apps/pciutils/files/pcimodules-pciutils-2.1.11.diff +++ /dev/null @@ -1,339 +0,0 @@ ---- ./Makefile.orig 2003-01-04 04:53:01.000000000 -0800 -+++ ./Makefile 2003-02-20 23:22:56.000000000 -0800 -@@ -31,7 +31,7 @@ - - export - --all: lib lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids -+all: lib lspci setpci pcimodules lspci.8 setpci.8 update-pciids update-pciids.8 pcimodules.8 pci.ids - - lib: lib/config.h - $(MAKE) -C lib all -@@ -39,9 +39,11 @@ - lib/config.h: - cd lib && ./configure $(SHAREDIR) $(VERSION) - -+pcimodules: pcimodules.o common.o lib/$(PCILIB) - lspci: lspci.o common.o lib/$(PCILIB) - setpci: setpci.o common.o lib/$(PCILIB) - -+pcimodules.o: pcimodules.c pciutils.h - lspci.o: lspci.c pciutils.h - setpci.o: setpci.c pciutils.h - common.o: common.c pciutils.h -@@ -59,15 +61,15 @@ - install: all - # -c is ignored on Linux, but required on FreeBSD - $(DIRINSTALL) -m 755 $(SBINDIR) $(SHAREDIR) $(MANDIR)/man8 -- $(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR) -+ $(INSTALL) -c -m 755 -s lspci setpci pcimodules $(SBINDIR) - $(INSTALL) -c -m 755 update-pciids $(SBINDIR) - $(INSTALL) -c -m 644 pci.ids $(SHAREDIR) -- $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8 -+ $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 pcimodules.8 $(MANDIR)/man8 - - uninstall: all -- rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids -+ rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids $(SBINDIR)/pcimodules - rm -f $(SHAREDIR)/pci.ids -- rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8 -+ rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8 $(MANDIR)/man8/pcimodules.8 - - get-ids: - cp ~/tree/pciids/pci.ids pci.ids ---- ./lspci.c.orig 2002-12-26 12:24:50.000000000 -0800 -+++ ./lspci.c 2003-02-20 23:22:36.000000000 -0800 -@@ -107,8 +107,11 @@ - d = xmalloc(sizeof(struct device)); - bzero(d, sizeof(*d)); - d->dev = p; -- if (!pci_read_block(p, 0, d->config, how_much)) -- die("Unable to read %d bytes of configuration space.", how_much); -+ if (!pci_read_block(p, 0, d->config, how_much)) { -+ fprintf(stderr, "Unable to read %d bytes of configuration space.", -+ how_much); -+ return NULL; -+ } - if (how_much < 128 && (d->config[PCI_HEADER_TYPE] & 0x7f) == PCI_HEADER_TYPE_CARDBUS) - { - /* For cardbus bridges, we need to fetch 64 bytes more to get the full standard header... */ ---- ./pcimodules.c.orig 2003-02-20 23:22:36.000000000 -0800 -+++ ./pcimodules.c 2003-02-20 23:22:36.000000000 -0800 -@@ -0,0 +1,182 @@ -+/* -+ * pcimodules: Load all kernel modules for PCI device currently -+ * plugged into any PCI slot. -+ * -+ * Copyright 2000 Yggdrasil Computing, Incorporated -+ * This file may be copied under the terms and conditions of version -+ * two of the GNU General Public License, as published by the Free -+ * Software Foundation (Cambridge, Massachusetts, USA). -+ * -+ * This file is based on pciutils/lib/example.c, which has the following -+ * authorship and copyright statement: -+ * -+ * Written by Martin Mares and put to public domain. You can do -+ * with it anything you want, but I don't give you any warranty. -+ */ -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <string.h> -+#include <unistd.h> -+#include <sys/utsname.h> -+#include <sys/param.h> -+#include <sys/types.h> -+ -+#define _GNU_SOURCE -+#include <getopt.h> -+ -+#include "pciutils.h" -+ -+#define MODDIR "/lib/modules" -+#define PCIMAP "modules.pcimap" -+ -+#define LINELENGTH 8000 -+ -+#define DEVICE_ANY 0xffffffff -+#define VENDOR_ANY 0xffffffff -+ -+#include "lib/pci.h" -+ -+struct pcimap_entry { -+ unsigned int vendor, subsys_vendor, dev, subsys_dev, class, class_mask; -+ char *module; -+ struct pcimap_entry *next; -+}; -+ -+static struct pcimap_entry *pcimap_list = NULL; -+ -+#define OPT_STRING "h" -+static struct option long_options[] = { -+ {"class", required_argument, NULL, 'c'}, -+ {"classmask", required_argument, NULL, 'm'}, -+ {"help", no_argument, NULL, 'h'}, -+ { 0, 0, 0, 0} -+}; -+ -+static unsigned long desired_class; -+static unsigned long desired_classmask; /* Default is 0: accept all classes.*/ -+ -+void -+read_pcimap(void) -+{ -+ struct utsname utsname; -+ char filename[MAXPATHLEN]; -+ FILE *pcimap_file; -+ char line[LINELENGTH]; -+ struct pcimap_entry *entry; -+ unsigned int driver_data; -+ char *prevmodule = ""; -+ char module[LINELENGTH]; -+ -+ if (uname(&utsname) < 0) { -+ perror("uname"); -+ exit(1); -+ } -+ sprintf(filename, "%s/%s/%s", MODDIR, utsname.release, PCIMAP); -+ if ((pcimap_file = fopen(filename, "r")) == NULL) { -+ perror(filename); -+ exit(1); -+ } -+ -+ while(fgets(line, LINELENGTH, pcimap_file) != NULL) { -+ if (line[0] == '#') -+ continue; -+ -+ entry = xmalloc(sizeof(struct pcimap_entry)); -+ -+ if (sscanf(line, "%s 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x", -+ module, -+ &entry->vendor, &entry->dev, -+ &entry->subsys_vendor, &entry->subsys_dev, -+ &entry->class, &entry->class_mask, -+ &driver_data) != 8) { -+ fprintf (stderr, -+ "modules.pcimap unparsable line: %s.\n", line); -+ free(entry); -+ continue; -+ } -+ -+ /* Optimize memory allocation a bit, in case someday we -+ have Linux systems with ~100,000 modules. It also -+ allows us to just compare pointers to avoid trying -+ to load a module twice. */ -+ if (strcmp(module, prevmodule) != 0) { -+ prevmodule = xmalloc(strlen(module)+1); -+ strcpy(prevmodule, module); -+ } -+ entry->module = prevmodule; -+ entry->next = pcimap_list; -+ pcimap_list = entry; -+ } -+ fclose(pcimap_file); -+} -+ -+/* Return a filled in pci_access->dev tree, with the device classes -+ stored in dev->aux. -+*/ -+static void -+match_pci_modules(void) -+{ -+ struct pci_access *pacc; -+ struct pci_dev *dev; -+ unsigned int class, subsys_dev, subsys_vendor; -+ struct pcimap_entry *map; -+ const char *prevmodule = ""; -+ -+ pacc = pci_alloc(); /* Get the pci_access structure */ -+ /* Set all options you want -- here we stick with the defaults */ -+ pci_init(pacc); /* Initialize the PCI library */ -+ pci_scan_bus(pacc); /* We want to get the list of devices */ -+ for(dev=pacc->devices; dev; dev=dev->next) { -+ pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES); -+ class = (pci_read_word(dev, PCI_CLASS_DEVICE) << 8) -+ | pci_read_byte(dev, PCI_CLASS_PROG); -+ subsys_dev = pci_read_word(dev, PCI_SUBSYSTEM_ID); -+ subsys_vendor = pci_read_word(dev,PCI_SUBSYSTEM_VENDOR_ID); -+ for(map = pcimap_list; map != NULL; map = map->next) { -+ if (((map->class ^ class) & map->class_mask) == 0 && -+ ((desired_class ^ class) & desired_classmask)==0 && -+ (map->dev == DEVICE_ANY || -+ map->dev == dev->device_id) && -+ (map->vendor == VENDOR_ANY || -+ map->vendor == dev->vendor_id) && -+ (map->subsys_dev == DEVICE_ANY || -+ map->subsys_dev == subsys_dev) && -+ (map->subsys_vendor == VENDOR_ANY || -+ map->subsys_vendor == subsys_vendor) && -+ prevmodule != map->module) { -+ printf("%s\n", map->module); -+ prevmodule = map->module; -+ } -+ } -+ -+ } -+ pci_cleanup(pacc); -+} -+ -+int -+main (int argc, char **argv) -+{ -+ int opt_index = 0; -+ int opt; -+ -+ while ((opt = getopt_long(argc, argv, OPT_STRING, long_options, -+ &opt_index)) != -1) { -+ switch(opt) { -+ case 'c': -+ desired_class = strtol(optarg, NULL, 0); -+ break; -+ case 'm': -+ desired_classmask = strtol(optarg, NULL, 0); -+ break; -+ case 'h': -+ printf ("Usage: pcimodules [--help]\n" -+ " Lists kernel modules corresponding to PCI devices currently plugged" -+ " into the computer.\n"); -+ } -+ } -+ -+ read_pcimap(); -+ match_pci_modules(); -+ return 0; -+} ---- ./pcimodules.man.orig 2003-02-20 23:22:36.000000000 -0800 -+++ ./pcimodules.man 2003-02-20 23:22:36.000000000 -0800 -@@ -0,0 +1,92 @@ -+.TH pcimodules 8 "@TODAY@" "@VERSION@" "Linux PCI Utilities" -+.IX pcimodules -+.SH NAME -+pcimodules \- List kernel driver modules available for all currently plugged -+in PCI devices -+.SH SYNOPSIS -+.B pcimodules -+.RB [ --class class_id ] -+.RB [ --classmask mask ] -+.RB [ --help ] -+.SH DESCRIPTION -+.B pcimodules -+lists all driver modules for all currently plugged in PCI devices. -+.B pcimodules -+should be run at boot time, and whenever a PCI device is "hot plugged" -+into the system. This can be done by the following Bourne shell syntax: -+.IP -+ for module in $(pcimodules) ; do -+.IP -+ modprobe -s -k "$module" -+.IP -+ done -+.PP -+When a PCI device is removed from the system, the Linux kernel will -+decrement a usage count on PCI driver module. If this count drops -+to zero (i.e., there are no PCI drivers), then the -+.B modprobe -r -+process that is normally configured to run from cron every few minutes -+will eventually remove the unneeded module. -+.PP -+The --class and --classmask arguments can be used to limit the search -+to certain classes of PCI devices. This is useful, for example, to -+generate a list of ethernet card drivers to be loaded when the kernel -+has indicated that it is trying to resolve an unknown network interface. -+.PP -+Modules are listed in the order in which the PCI devices are physically -+arranged so that the computer owner can arrange things like having scsi -+device 0 be on a controller that is not alphabetically the first scsi -+controller. -+.SH OPTIONS -+.TP -+.B --class class --classmask mask -+.PP -+--class and --classmask limit the search to PCI -+cards in particular classes. These arguments are always used together. -+The arguments to --class and --classmask -+can be given as hexadecimal numbers by prefixing a leading "0x". -+Note that the classes used by pcimodules are in "Linux" format, -+meaning the class value that you see with lspci would be shifted -+left eight bits, with the new low eight bits programming interface ID. -+An examples of how to use class and classmask is provided below. -+.B --help, -h -+Print a help message and exit. -+.SH EXAMPLES -+.TP -+pcimodules -+lists all modules corresponding to currently plugged in PCI devices. -+.TP -+pcimodules --class 0x200000 --classmask 0xffff00 -+lists all modules corresponding to currently plugged in ethernet PCI devices. -+.SH FILES -+.TP -+.B /lib/modules/<kernel-version>/modules.pcimap -+This file is automatically generated by -+.B depmod, -+and used by -+.B pcimodules -+to determine which modules correspond to which PCI ID's. -+.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 -+.I devices -+file containing a list of all PCI devices. -+ -+.SH SEE ALSO -+.BR lspci (8) -+ -+.SH MAINTAINER -+The Linux PCI Utilities are maintained by Martin Mares <mj@suse.cz>. -+ -+.SH AUTHOR -+.B pcimodules -+was written by Adam J. Richter <adam@yggdrasil.com>, based on public -+domain example code by Martin Mares <mj@suse.cz>. -+ -+.SH COPYRIGHT -+.B pcimodules -+is copyright 2000, Yggdrasil Computing, Incorporated, and may -+be copied under the terms and conditions of version 2 of the GNU -+General Public License as published by the Free Software Foundation -+(Cambrige, Massachusetts, United States of America). diff --git a/sys-apps/pciutils/files/pciutils-2.1.11-bsd.patch b/sys-apps/pciutils/files/pciutils-2.1.11-bsd.patch deleted file mode 100644 index d2668366f372..000000000000 --- a/sys-apps/pciutils/files/pciutils-2.1.11-bsd.patch +++ /dev/null @@ -1,47 +0,0 @@ -Fixup support for FreeBSD. - -Patch by Diego Pettenò. - -http://bugs.gentoo.org/103241 - ---- lib/fbsd-device.c -+++ lib/fbsd-device.c -@@ -13,10 +13,21 @@ - - #include <fcntl.h> - #include <string.h> -+#include <errno.h> - #include <unistd.h> -+#include <osreldate.h> - --#include <pci/pcivar.h> --#include <pci/pci_ioctl.h> -+#if __FreeBSD_version < 500000 -+# include <pci/pcivar.h> -+#else -+# include <dev/pci/pcivar.h> -+#endif -+ -+#if __FreeBSD_version < 430000 -+# include <pci/pci_ioctl.h> -+#else -+# include <sys/pciio.h> -+#endif - - #include "internal.h" - -@@ -75,8 +86,12 @@ - pi.pi_reg = pos; - pi.pi_width = len; - -- if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) -- d->access->error("fbsd_read: ioctl(PCIOCREAD) failed"); -+ if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) { -+ if (errno == ENODEV) -+ return 0; -+ else -+ d->access->error("fbsd_read: ioctl(PCIOCREAD) failed"); -+ } - - switch (len) - { diff --git a/sys-apps/pciutils/files/pciutils-2.1.11-gentoo-paths.patch b/sys-apps/pciutils/files/pciutils-2.1.11-gentoo-paths.patch deleted file mode 100644 index d9dc59d2a4bc..000000000000 --- a/sys-apps/pciutils/files/pciutils-2.1.11-gentoo-paths.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- pciutils-2.1.11/lspci.man -+++ pciutils-2.1.11/lspci.man -@@ -70,7 +70,7 @@ - Use - .B - <file> --as PCI ID database instead of /usr/share/pci.ids. -+as PCI ID database instead of @SHAREDIR@/pci.ids. - .TP - .B -p <dir> - Use ---- pciutils-2.1.11/Makefile -+++ pciutils-2.1.11/Makefile -@@ -12,5 +12,5 @@ - --PREFIX=/usr/local -+PREFIX=/usr - SBINDIR=$(PREFIX)/sbin --SHAREDIR=$(PREFIX)/share -+SHAREDIR=$(PREFIX)/share/misc - MANDIR=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi) diff --git a/sys-apps/pciutils/files/pciutils-2.1.11-sysfs.patch b/sys-apps/pciutils/files/pciutils-2.1.11-sysfs.patch deleted file mode 100644 index 4a123c85f695..000000000000 --- a/sys-apps/pciutils/files/pciutils-2.1.11-sysfs.patch +++ /dev/null @@ -1,384 +0,0 @@ ---- pciutils-2.1.11/lib/configure -+++ pciutils-2.1.11/lib/configure -@@ -33,7 +33,8 @@ - case $sys in - Linux) - case $rel in -- 2.[1-9]*|[3-9]*) echo_n " proc" -+ 2.[1-9]*|[3-9]*) echo_n "sysfs proc" -+ echo >>$c '#define HAVE_PM_LINUX_SYSFS' - echo >>$c '#define HAVE_PM_LINUX_PROC' - echo >>$c '#define HAVE_LINUX_BYTEORDER_H' - echo >>$c '#define PATH_PROC_BUS_PCI "/proc/bus/pci"' ---- pciutils-2.1.11/lib/Makefile -+++ pciutils-2.1.11/lib/Makefile -@@ -9,6 +9,10 @@ - - PCILIB=libpci.a - -+ifdef HAVE_PM_LINUX_SYSFS -+OBJS += sysfs.o -+endif -+ - ifdef HAVE_PM_LINUX_PROC - OBJS += proc.o - endif ---- pciutils-2.1.11/lib/access.c -+++ pciutils-2.1.11/lib/access.c -@@ -17,6 +17,11 @@ - - static struct pci_methods *pci_methods[PCI_ACCESS_MAX] = { - NULL, -+#ifdef HAVE_PM_LINUX_SYSFS -+ &pm_linux_sysfs, -+#else -+ NULL, -+#endif - #ifdef HAVE_PM_LINUX_PROC - &pm_linux_proc, - #else ---- pciutils-2.1.11/lib/internal.h -+++ pciutils-2.1.11/lib/internal.h -@@ -91,4 +91,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_syscalls, pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_dump; -+ pm_linux_sysfs, pm_syscalls, pm_fbsd_device, pm_aix_device, -+ pm_nbsd_libpci, pm_dump; ---- pciutils-2.1.11/lib/pci.h -+++ pciutils-2.1.11/lib/pci.h -@@ -74,6 +74,7 @@ - enum pci_access_type { - /* Known access methods, remember to update access.c as well */ - PCI_ACCESS_AUTO, /* Autodetection (params: none) */ -+ PCI_ACCESS_SYSFS_BUS_PCI, /* Linux /sys/bus/pci (params: none) */ - PCI_ACCESS_PROC_BUS_PCI, /* Linux /proc/bus/pci (params: path) */ - PCI_ACCESS_I386_TYPE1, /* i386 ports, type 1 (params: none) */ - PCI_ACCESS_I386_TYPE2, /* i386 ports, type 2 (params: none) */ -@@ -127,6 +128,7 @@ - - struct pci_dev { - struct pci_dev *next; /* Next device in the chain */ -+ int domain; /* domains can have the same bus #s */ - word bus; /* Higher byte can select host bridges */ - byte dev, func; /* Device and function */ - ---- pciutils-2.1.11/lib/sysfs.c -+++ pciutils-2.1.11/lib/sysfs.c -@@ -0,0 +1,292 @@ -+/* -+ * $Id: pciutils-2.1.11-sysfs.patch,v 1.1 2005/06/12 21:17:43 vapier Exp $ -+ * -+ * The PCI Library -- Configuration Access via /sys/bus/pci -+ * -+ * Copyrigh (c) 2003 Matthew Wilcox <willy@fc.hp.com> -+ * Copyright (c) 1997--1999 Martin Mares <mj@ucw.cz> -+ * -+ * Can be freely distributed and used under the terms of the GNU GPL. -+ */ -+ -+#define _GNU_SOURCE -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <unistd.h> -+#include <errno.h> -+#include <dirent.h> -+#include <fcntl.h> -+#include <sys/types.h> -+ -+#include "internal.h" -+ -+#define SYSFS_PATH "/sys/bus/pci/devices" -+ -+#include <sys/utsname.h> // to get the kernel version -+ -+/* -+ * We'd like to use pread/pwrite for configuration space accesses, but -+ * unfortunately it isn't simple at all since all libc's until glibc 2.1 -+ * don't define it. -+ */ -+ -+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ > 0 -+/* glibc 2.1 or newer -> pread/pwrite supported automatically */ -+ -+#elif defined(i386) && defined(__GLIBC__) -+/* glibc 2.0 on i386 -> call syscalls directly */ -+#include <asm/unistd.h> -+#include <syscall-list.h> -+#ifndef SYS_pread -+#define SYS_pread 180 -+#endif -+static int pread(unsigned int fd, void *buf, size_t size, loff_t where) -+{ return syscall(SYS_pread, fd, buf, size, where); } -+#ifndef SYS_pwrite -+#define SYS_pwrite 181 -+#endif -+static int pwrite(unsigned int fd, void *buf, size_t size, loff_t where) -+{ return syscall(SYS_pwrite, fd, buf, size, where); } -+ -+#elif defined(i386) -+/* old libc on i386 -> call syscalls directly the old way */ -+#include <asm/unistd.h> -+static _syscall5(int, pread, unsigned int, fd, void *, buf, size_t, size, u32, where_lo, u32, where_hi); -+static _syscall5(int, pwrite, unsigned int, fd, void *, buf, size_t, size, u32, where_lo, u32, where_hi); -+static int do_read(struct pci_dev *d UNUSED, int fd, void *buf, size_t size, int where) { return pread(fd, buf, size, where, 0); } -+static int do_write(struct pci_dev *d UNUSED, int fd, void *buf, size_t size, int where) { return pwrite(fd, buf, size, where, 0); } -+#define HAVE_DO_READ -+ -+#else -+/* In all other cases we use lseek/read/write instead to be safe */ -+#define make_rw_glue(op) \ -+ static int do_##op(struct pci_dev *d, int fd, void *buf, size_t size, int where) \ -+ { \ -+ struct pci_access *a = d->access; \ -+ int r; \ -+ if (a->fd_pos != where && lseek(fd, where, SEEK_SET) < 0) \ -+ return -1; \ -+ r = op(fd, buf, size); \ -+ if (r < 0) \ -+ a->fd_pos = -1; \ -+ else \ -+ a->fd_pos = where + r; \ -+ return r; \ -+ } -+make_rw_glue(read) -+make_rw_glue(write) -+#define HAVE_DO_READ -+#endif -+ -+#ifndef HAVE_DO_READ -+#define do_read(d,f,b,l,p) pread(f,b,l,p) -+#define do_write(d,f,b,l,p) pwrite(f,b,l,p) -+#endif -+ -+static void -+sysfs_config(struct pci_access *a) -+{ -+#if 0 -+ a->method_params[PCI_ACCESS_PROC_BUS_PCI] = PATH_PROC_BUS_PCI; -+#endif -+} -+ -+static int sysfs_detect(struct pci_access *a) -+{ -+ -+ if (access(SYSFS_PATH, R_OK)) { -+ /* do not warn on no 2.6 kernels */ -+ struct utsname *buf; -+ buf = (struct utsname *) malloc(sizeof(struct utsname)); -+ if(buf) { -+ int res; -+ uname(buf); -+ res=strncmp("2.6", buf->release, 3); -+ if(res==0) { -+ //a->warning("kernel version %s\n", buf->release); -+ a->warning("Cannot open %s", SYSFS_PATH); -+ } -+ } -+ return 0; -+ } -+ a->debug("...using %s", SYSFS_PATH); -+ return 1; -+} -+ -+static void sysfs_init(struct pci_access *a) -+{ -+ a->fd = -1; -+} -+ -+static void sysfs_cleanup(struct pci_access *a) -+{ -+ if (a->fd >= 0) { -+ close(a->fd); -+ a->fd = -1; -+ } -+} -+ -+static int sysfs_get_value(char *name, char *object) -+{ -+ int fd, len; -+ char buf[256]; -+ sprintf(buf, "%s/%s/%s", SYSFS_PATH, name, object); -+ fd = open(buf, O_RDONLY); -+ if (fd < 0) -+ return 0; -+ len = read(fd, buf, 256); -+ close(fd); -+ buf[len] = '\0'; -+ return strtol(buf, NULL, 0); -+} -+ -+static int sysfs_get_resources(char *name, struct pci_dev *d) -+{ -+ char buf[256]; -+ FILE *file; -+ int i; -+ sprintf(buf, "%s/%s/%s", SYSFS_PATH, name, "resource"); -+ file = fopen(buf, "r"); -+ if (!file) -+ return errno; -+ for (i = 0; i < 7; i++) { -+ unsigned long long start, end, size = 0; -+ if (!fgets(buf, 256, file)) -+ break; -+ sscanf(buf, "%llx %llx", &start, &end); -+ if (start) -+ size = end - start + 1; -+ if (i < 6) { -+ d->base_addr[i] = start; -+ d->size[i] = size; -+ } else { -+ d->rom_base_addr = start; -+ d->rom_size = size; -+ } -+ } -+ fclose(file); -+ return 0; -+} -+ -+static void sysfs_scan(struct pci_access *a) -+{ -+ DIR *dir; -+ struct dirent *entry; -+ -+ dir = opendir(SYSFS_PATH); -+ if (!dir) -+ a->error("Cannot open %s", SYSFS_PATH); -+ while ((entry = readdir(dir))) { -+ struct pci_dev *d; -+ unsigned int dev, func; -+ -+ /* ".", ".." or a special non-device perhaps */ -+ if (entry->d_name[0] == '.') -+ continue; -+ -+ d = pci_alloc_dev(a); -+ if (sscanf(entry->d_name, "%04x:%02hx:%02x.%d", -+ &d->domain, &d->bus, &dev, &func) < 4) { -+ a->error("Couldn't parse %s", entry->d_name); -+ pci_free_dev(d); -+ continue; -+ } -+ d->dev = dev; -+ d->func = func; -+ d->vendor_id = sysfs_get_value(entry->d_name, "vendor"); -+ d->device_id = sysfs_get_value(entry->d_name, "device"); -+ d->irq = sysfs_get_value(entry->d_name, "irq"); -+ d->hdrtype = pci_read_byte(d, PCI_HEADER_TYPE); -+ -+ if (sysfs_get_resources(entry->d_name, d) != 0) -+ a->error("when reading resources"); -+ d->known_fields = PCI_FILL_IDENT; -+ if (!a->buscentric) { -+ d->known_fields |= PCI_FILL_IRQ | PCI_FILL_BASES | -+ PCI_FILL_ROM_BASE | PCI_FILL_SIZES; -+ } -+ pci_link_dev(a, d); -+ } -+ closedir(dir); -+} -+ -+static int -+sysfs_setup(struct pci_dev *d, int rw) -+{ -+ struct pci_access *a = d->access; -+ -+ if (a->cached_dev != d || a->fd_rw < rw) { -+ char buf[256]; -+ if (a->fd >= 0) -+ close(a->fd); -+ if (snprintf(buf, sizeof(buf), "%s/%04x:%02x:%02x.%d/config", -+ SYSFS_PATH, d->domain, d->bus, d->dev, -+ d->func) == sizeof(buf)) -+ a->error("File name too long"); -+ a->fd_rw = a->writeable || rw; -+ a->fd = open(buf, a->fd_rw ? O_RDWR : O_RDONLY); -+ if (a->fd < 0) -+ a->warning("Cannot open %s", buf); -+ a->cached_dev = d; -+ a->fd_pos = 0; -+ } -+ return a->fd; -+} -+ -+static int sysfs_read(struct pci_dev *d, int pos, byte *buf, int len) -+{ -+ int fd = sysfs_setup(d, 0); -+ int res; -+ -+ if (fd < 0) -+ return 0; -+ res = do_read(d, fd, buf, len, pos); -+ if (res < 0) { -+ d->access->warning("sysfs_read: read failed: %s", strerror(errno)); -+ return 0; -+ } else if (res != len) { -+ d->access->warning("sysfs_read: tried to read %d bytes at %d, but got only %d", len, pos, res); -+ return 0; -+ } -+ return 1; -+} -+ -+static int sysfs_write(struct pci_dev *d, int pos, byte *buf, int len) -+{ -+ int fd = sysfs_setup(d, 1); -+ int res; -+ -+ if (fd < 0) -+ return 0; -+ res = do_write(d, fd, buf, len, pos); -+ if (res < 0) { -+ d->access->warning("sysfs_write: write failed: %s", strerror(errno)); -+ return 0; -+ } else if (res != len) { -+ d->access->warning("sysfs_write: tried to write %d bytes at %d, but got only %d", len, pos, res); -+ return 0; -+ } -+ return 1; -+} -+ -+static void sysfs_cleanup_dev(struct pci_dev *d) -+{ -+ if (d->access->cached_dev == d) -+ d->access->cached_dev = NULL; -+} -+ -+struct pci_methods pm_linux_sysfs = { -+ SYSFS_PATH, -+ sysfs_config, -+ sysfs_detect, -+ sysfs_init, -+ sysfs_cleanup, -+ sysfs_scan, -+ pci_generic_fill_info, -+ sysfs_read, -+ sysfs_write, -+ NULL, /* init_dev */ -+ sysfs_cleanup_dev -+}; ---- pciutils-2.1.11/lspci.c -+++ pciutils-2.1.11/lspci.c -@@ -188,6 +188,10 @@ - const struct pci_dev *a = (*(const struct device **)A)->dev; - const struct pci_dev *b = (*(const struct device **)B)->dev; - -+ if (a->domain < b->domain) -+ return -1; -+ if (a->domain > b->domain) -+ return 1; - if (a->bus < b->bus) - return -1; - if (a->bus > b->bus) -@@ -239,7 +243,8 @@ - struct pci_dev *p = d->dev; - byte classbuf[128], devbuf[128]; - -- printf("%02x:%02x.%x %s: %s", -+ printf("%04x:%02x:%02x.%x %s: %s", -+ p->domain, - p->bus, - p->dev, - p->func, diff --git a/sys-apps/pciutils/pciutils-2.1.11-r5.ebuild b/sys-apps/pciutils/pciutils-2.1.11-r5.ebuild deleted file mode 100644 index 740456bfbc46..000000000000 --- a/sys-apps/pciutils/pciutils-2.1.11-r5.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-2.1.11-r5.ebuild,v 1.12 2006/06/21 20:52:24 vapier Exp $ - -inherit eutils flag-o-matic toolchain-funcs - -STAMP=20041019 -DESCRIPTION="Various utilities dealing with the PCI bus" -HOMEPAGE="http://atrey.karlin.mff.cuni.cz/~mj/pciutils.html" -SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz - mirror://gentoo/pci.ids-${STAMP}.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86" -IUSE="" - -DEPEND="" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}"/pcimodules-${P}.diff - epatch "${FILESDIR}"/${P}-sysfs.patch #38645 - epatch "${FILESDIR}"/${P}-gentoo-paths.patch - epatch "${FILESDIR}"/${PV}-scan.patch #from fedora - epatch "${FILESDIR}"/${P}-bsd.patch #103241 - - # Unconditionally use -fPIC for libs (#55238) - # Make sure we respect $AR / $RANLIB / $CFLAGS - sed -i \ - -e "/^include/s/$/\nCFLAGS+=-fPIC/" \ - -e '/ar rcs/s:ar:$(AR):' \ - -e 's:ranlib:$(RANLIB):' \ - lib/Makefile \ - || die "sed lib/Makefile failed" - sed -i \ - -e "s:-O2:${CFLAGS}:" Makefile \ - || die "sed Makefile failed" - - # fix command line overflow which did not allow for null terminator - # when using lspci -vvv (AGPx1 and AGPx2 and AGPx4) bug #41422 - sed -i -e s/'rate\[8\]'/'rate\[9\]'/g lspci.c \ - || die "sed failed on lspci.c" - - sed -i 's:wget -O:wget --connect-timeout=60 -O:' update-pciids.sh - ebegin "Updating pci.ids from the web" - if ! ./update-pciids.sh &> /dev/null ; then - # if we cant update, use a cached version - mv "${WORKDIR}"/pci.ids-${STAMP} "${S}"/pci.ids - fi - eend 0 -} - -src_compile() { - tc-export AR CC RANLIB - # we run the lib target ourselves to work around broken - # dependency tracking inside of the makefile - emake lib || die "emake lib failed" - emake PREFIX=/usr SHAREDIR=/usr/share/misc || die "emake failed" -} - -src_install() { - into / - dosbin setpci lspci pcimodules update-pciids || die "dosbin failed" - doman *.8 - - insinto /usr/share/misc - doins pci.ids || die "pciids failed" - - into /usr - dolib lib/libpci.a || die "libpci failed" - - insinto /usr/include/pci - doins lib/*.h || die "headers failed" -} diff --git a/sys-apps/pciutils/pciutils-2.2.3.ebuild b/sys-apps/pciutils/pciutils-2.2.3.ebuild deleted file mode 100644 index 365c420703df..000000000000 --- a/sys-apps/pciutils/pciutils-2.2.3.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-2.2.3.ebuild,v 1.2 2006/06/21 20:52:24 vapier Exp $ - -inherit eutils flag-o-matic toolchain-funcs - -STAMP=20060608 -DESCRIPTION="Various utilities dealing with the PCI bus" -HOMEPAGE="http://atrey.karlin.mff.cuni.cz/~mj/pciutils.html" -SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz - mirror://gentoo/pci.ids-${STAMP}.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" -IUSE="" - -DEPEND="" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}"/pcimodules-${PN}-2.2.0.patch - epatch "${FILESDIR}"/${PN}-2.2.0-shared-lib.patch - - # Set Gentoo paths - # and do not strip (breaks cross-compile), portage handles stripping - sed -i \ - -e '/^PREFIX=/s:=.*:=/usr:' \ - -e '/^IDSDIR=/s:=.*:=$(PREFIX)/share/misc:' \ - -e '/INSTALL.* -s lspci /s: -s lspci : lspci :' \ - Makefile || die - - # Make sure we respect $AR / $RANLIB - sed -i \ - -e '/ar rcs/s:ar:$(AR):' \ - -e 's:ranlib:$(RANLIB):' \ - lib/Makefile \ - || die "sed lib/Makefile failed" - - sed -i 's:wget -O:wget --connect-timeout=60 -O:' update-pciids.sh - ebegin "Updating pci.ids from the web" - if ! ./update-pciids.sh &> /dev/null ; then - # if we cant update, use a cached version - mv "${WORKDIR}"/pci.ids-${STAMP} "${S}"/pci.ids - fi - eend 0 -} - -src_compile() { - tc-export AR CC RANLIB - emake OPT="${CFLAGS}" || die "emake failed" -} - -src_install() { - dodir /usr/share/man - make install PREFIX="${D}"/usr || die - - dolib lib/libpci.* || die "libpci failed" - insinto /usr/include/pci - doins lib/{config,header,pci,types}.h || die "headers failed" -} |