Sisyphus repositório
Última atualização: 28 março 2020 | SRPMs: 17545 | Visitas: 17772790
en ru br
ALT Linux repositórios
S:3.6.4-alt1
D:2.99.1-alt0.2
5.0: 3.1.2-alt1
4.1: 3.0.0-alt1
4.0: 2.2.4-alt1
3.0: 2.1.11-alt10

Group :: Sistema/Kernel e hardware
RPM: pciutils

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: pciutils-2.1.11-sysfs-filter.diff
Download


--- lib/filter.c	2002-03-30 16:39:25.000000000 +0100
+++ lib/filter.c	2004-02-19 15:54:00.000000000 +0100
@@ -16,7 +16,7 @@
 void
 pci_filter_init(struct pci_access * UNUSED a, struct pci_filter *f)
 {
-  f->bus = f->slot = f->func = -1;
+  f->domain = f->bus = f->slot = f->func = -1;
   f->vendor = f->device = -1;
 }
 
@@ -25,28 +25,51 @@
 char *
 pci_filter_parse_slot(struct pci_filter *f, char *str)
 {
-  char *colon = strchr(str, ':');
-  char *dot = strchr((colon ? colon + 1 : str), '.');
-  char *mid = str;
+  char *d_colon = strchr(str, ':');
+  char *colon;
+  char *dot;
   char *e;
 
-  if (colon)
+  if (d_colon)
     {
-      *colon++ = 0;
-      mid = colon;
-      if (str[0] && strcmp(str, "*"))
-	{
-	  long int x = strtol(str, &e, 16);
-	  if ((e && *e) || (x < 0 || x > 0xff))
-	    return "Invalid bus number";
-	  f->bus = x;
-	}
+      *d_colon++ = 0;
+      colon = strchr(d_colon, ':');
+      if (colon)
+        {
+          *colon++ = 0;
+          if (str[0] && strcmp(str, "*"))
+            {
+              long int x = strtol(str, &e, 16);
+              if ((e && *e) || (x < 0 || x > 0xffff))
+                return "Invalid domain number";
+              f->domain = x;
+            }
+        }
+      else
+        {
+          colon = d_colon;
+          d_colon = str;
+        }
+      dot = strchr(colon, '.');
+      if (d_colon[0] && strcmp(d_colon, "*"))
+        {
+          long int x = strtol(d_colon, &e, 16);
+          if ((e && *e) || (x < 0 || x > 0xff))
+            return "Invalid bus number";
+          f->bus = x;
+        }
     }
+  else
+    {
+      dot = strchr(str, '.');
+      colon = str;
+    }
+
   if (dot)
     *dot++ = 0;
-  if (mid[0] && strcmp(mid, "*"))
+  if (colon[0] && strcmp(colon, "*"))
     {
-      long int x = strtol(mid, &e, 16);
+      long int x = strtol(colon, &e, 16);
       if ((e && *e) || (x < 0 || x > 0x1f))
 	return "Invalid slot number";
       f->slot = x;
@@ -94,7 +117,8 @@
 int
 pci_filter_match(struct pci_filter *f, struct pci_dev *d)
 {
-  if ((f->bus >= 0 && f->bus != d->bus) ||
+  if ((f->domain >= 0 && f->domain != d->domain) ||
+      (f->bus >= 0 && f->bus != d->bus) ||
       (f->slot >= 0 && f->slot != d->dev) ||
       (f->func >= 0 && f->func != d->func))
     return 0;
--- lib/pci.h	2003-01-04 12:04:39.000000000 +0100
+++ lib/pci.h	2004-02-19 16:43:28.000000000 +0100
@@ -176,7 +176,7 @@
  */
 
 struct pci_filter {
-  int bus, slot, func;			/* -1 = ANY */
+  int domain, bus, slot, func;			/* -1 = ANY */
   int vendor, device;
 };
 
--- lspci.c	2002-12-26 21:24:50.000000000 +0100
+++ lspci.c	2004-02-19 16:43:28.000000000 +0100
@@ -1519,7 +1519,7 @@
 	break;
       case 's':
 	if (msg = pci_filter_parse_slot(&filter, optarg))
-	  die("-f: %s", msg);
+	  die("-s: %s", msg);
 	break;
       case 'd':
 	if (msg = pci_filter_parse_id(&filter, optarg))
--- lspci.man	2003-01-04 13:51:16.000000000 +0100
+++ lspci.man	2004-02-19 16:36:01.000000000 +0100
@@ -55,12 +55,13 @@
 Show a tree-like diagram containing all buses, bridges, devices and connections
 between them.
 .TP
-.B -s [[<bus>]:][<slot>][.[<func>]]
-Show only devices in specified bus, slot and function. Each component of the device
-address can be omitted or set as "*" meaning "any value". All numbers are
-hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
-on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
-fourth function of each device.
+.B -s [[<domain>]:][[<bus>]:][<slot>][.[<func>]]
+Show only devices in specified domain, bus, slot and function. Each component of the device
+address can be omitted or set as "*" meaning "any value". If only one colon is present,
+all domains are considered, thus 0: is the same as :0: and :1 is the same as ::1.
+All numbers are hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all
+functions of device 0 on any bus in any domain, "0.3" selects third function of
+device 0 on all buses in all domains and ".4" shows only fourth function of each device.
 .TP
 .B -d [<vendor>]:[<device>]
 Show only devices with specified vendor and device ID. Both ID's are given in
--- setpci.man	2003-01-04 13:52:01.000000000 +0100
+++ setpci.man	2004-02-19 17:13:25.000000000 +0100
@@ -49,12 +49,13 @@
 Before each sequence of operations you need to select which devices you wish that
 operation to affect.
 .TP
-.B -s [[<bus>]:][<slot>][.[<func>]]
-Select devices in specified bus, slot and function. Each component of the device
-address can be omitted or set as "*" meaning "any value". All numbers are
-hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
-on any bus, "0.3" selects third function of device 0 on all busses and ".4" selects only
-fourth function of each device.
+.B -s [[<domain>]:][[<bus>]:][<slot>][.[<func>]]
+Select devices in specified domain, bus, slot and function. Each component of the device
+address can be omitted or set as "*" meaning "any value". If only one colon is present,
+all domains are considered, thus 0: is the same as :0: and :1 is the same as ::1.
+All numbers are hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all
+functions of device 0 on any bus in any domain, "0.3" selects third function of
+device 0 on all busses in all domains and ".4" selects only fourth function of each device.
 .TP
 .B -d [<vendor>]:[<device>]
 Select devices with specified vendor and device ID. Both ID's are given in
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009