Package: pciutils
Version: 1:2.1.11-15.1
Severity: important
Tags: patch

Hi
I just tried to build the new kudzu package and found that it won't
build. The problem is that there is a patch for pciutils is missing.
I attached the patch, so please include them, we (Debian-Edu) want to
release soon and use the newest kudzu, but for that we need a new
pciutils.

Greetings
Steffen 

code: 

diff -ru pciutils-2.1.99-test8/lib/example.c pciutils/lib/example.c
--- pciutils-2.1.99-test8/lib/example.c 2000-03-09 03:38:33.000000000 -0500
+++ pciutils/lib/example.c      2004-09-02 18:06:58.000000000 -0400
@@ -21,7 +21,7 @@
   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 */
+      pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS);    
/* 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",
             dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id,
diff -ru pciutils-2.1.99-test8/lib/generic.c pciutils/lib/generic.c
--- pciutils-2.1.99-test8/lib/generic.c 2004-08-13 16:15:23.000000000 -0400
+++ pciutils/lib/generic.c      2004-09-02 18:06:41.000000000 -0400
@@ -46,7 +46,8 @@
          d->func = t->func;
          d->vendor_id = vd & 0xffff;
          d->device_id = vd >> 16U;
-         d->known_fields = PCI_FILL_IDENT;
+         d->device_class = pci_read_byte(t,PCI_CLASS_DEVICE+1) << 8 | 
pci_read_byte(t, PCI_CLASS_DEVICE);
+         d->known_fields = PCI_FILL_IDENT | PCI_FILL_CLASS;
          d->hdrtype = ht;
          pci_link_dev(a, d);
          switch (ht)
@@ -86,6 +87,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_byte(d, PCI_CLASS_DEVICE+1) << 8 | 
pci_read_byte(d, PCI_CLASS_DEVICE);
   if (flags & PCI_FILL_IRQ)
     d->irq = pci_read_byte(d, PCI_INTERRUPT_LINE);
   if (flags & PCI_FILL_BASES)
diff -ru pciutils-2.1.99-test8/lib/pci.h pciutils/lib/pci.h
--- pciutils-2.1.99-test8/lib/pci.h     2004-08-13 16:56:24.000000000 -0400
+++ pciutils/lib/pci.h  2004-09-02 18:06:26.000000000 -0400
@@ -83,6 +83,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 */
@@ -117,6 +118,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);
diff -ru pciutils-2.1.99-test8/lib/sysfs.c pciutils/lib/sysfs.c
--- pciutils-2.1.99-test8/lib/sysfs.c   2004-08-13 16:14:24.000000000 -0400
+++ pciutils/lib/sysfs.c        2004-09-02 18:07:48.000000000 -0400
@@ -170,7 +170,6 @@
          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
@@ -179,8 +178,8 @@
           */
          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_link_dev(a, d);
     }
diff -ru pciutils-2.1.99-test8/lspci.c pciutils/lspci.c
--- pciutils-2.1.99-test8/lspci.c       2004-08-13 15:49:02.000000000 -0400
+++ pciutils/lspci.c    2004-09-02 18:08:13.000000000 -0400
@@ -110,7 +110,7 @@
        die("Unable to read cardbus bridge extension data.");
     }
   pci_setup_cache(p, d->config, d->config_cnt);
-  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;
 }

@@ -229,7 +229,7 @@
   printf(" %s: %s",
         pci_lookup_name(pacc, classbuf, sizeof(classbuf),
                         PCI_LOOKUP_CLASS,
-                        get_conf_word(d, PCI_CLASS_DEVICE), 0, 0, 0),
+                        p->device_class, 0, 0, 0),
         pci_lookup_name(pacc, devbuf, sizeof(devbuf),
                         PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
                         p->vendor_id, p->device_id, 0, 0));
@@ -241,7 +241,7 @@
       c = get_conf_byte(d, PCI_CLASS_PROG);
       x = pci_lookup_name(pacc, devbuf, sizeof(devbuf),
                          PCI_LOOKUP_PROGIF,
-                         get_conf_word(d, PCI_CLASS_DEVICE), c, 0, 0);
+                         p->device_class, c, 0, 0);
       if (c || x)
        {
          printf(" (prog-if %02x", c);
@@ -1542,7 +1542,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);
@@ -1735,7 +1735,7 @@
       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), 0, 0, 0));
+            pci_lookup_name(pacc, classbuf, sizeof(classbuf), 
PCI_LOOKUP_CLASS, p->device_class, 0, 0, 0));
       printf("Vendor:\t%s\n",
             pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR, 
p->vendor_id, p->device_id, 0, 0));
       printf("Device:\t%s\n",
@@ -1757,7 +1757,7 @@
       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), 0, 0, 0),
+                            p->device_class, 0, 0, 0),
             pci_lookup_name(pacc, vendbuf, sizeof(vendbuf), PCI_LOOKUP_VENDOR,
                             p->vendor_id, p->device_id, 0, 0),
             pci_lookup_name(pacc, devbuf, sizeof(devbuf), PCI_LOOKUP_DEVICE,
@@ -1883,7 +1883,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))
                                                                                
     


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages pciutils depends on:
ii  libc6                         2.3.5-7    GNU C Library: Shared libraries an

pciutils recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to