]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/hurd.c
Makefile: don't hardcode gcc
[pciutils.git] / lib / hurd.c
index 873bb78b48557ac07b5203465cdf76bfa0b58cf4..90cf89f7c0695aa8bc1cdf0f4d6cbf9e6c2a57e3 100644 (file)
@@ -103,7 +103,7 @@ device_port_lookup(struct pci_dev *d)
   device_port = file_name_lookup(server, 0, 0);
 
   if (device_port == MACH_PORT_NULL)
-    a->error("Cannot find the PCI arbiter");
+    d->access->error("Cannot find the PCI arbiter");
 
   *((mach_port_t *) d->aux) = device_port;
   return device_port;
@@ -118,8 +118,6 @@ enum_devices(const char *parent, struct pci_access *a, int domain, int bus,
   DIR *dir;
   struct dirent *entry;
   char path[NAME_MAX];
-  uint32_t vd;
-  uint8_t ht;
   struct pci_dev *d;
 
   dir = opendir(parent);
@@ -191,16 +189,7 @@ enum_devices(const char *parent, struct pci_access *a, int domain, int bus,
          d->bus = bus;
          d->dev = dev;
          d->func = func;
-
          pci_link_dev(a, d);
-
-         vd = pci_read_long(d, PCI_VENDOR_ID);
-         ht = pci_read_byte(d, PCI_HEADER_TYPE);
-
-         d->vendor_id = vd & 0xffff;
-         d->device_id = vd >> 16U;
-         d->known_fields = PCI_FILL_IDENT;
-         d->hdrtype = ht;
        }
     }
 
@@ -229,10 +218,9 @@ hurd_read(struct pci_dev *d, int pos, byte * buf, int len)
   mach_port_t device_port = device_port_lookup(d);
 
   if (len > 4)
-    return pci_generic_block_read(d, pos, buf, nread);
+    return pci_generic_block_read(d, pos, buf, len);
 
   data = (char *) buf;
-  nread = len;
   err = pci_conf_read(device_port, pos, &data, &nread, len);
 
   if (data != (char *) buf)
@@ -265,7 +253,6 @@ hurd_write(struct pci_dev *d, int pos, byte * buf, int len)
   if (len > 4)
     return pci_generic_block_write(d, pos, buf, len);
 
-  nwrote = len;
   err = pci_conf_write(device_port, pos, (char *) buf, len, &nwrote);
 
   return !err && nwrote == (size_t) len;