]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/proc.c
pciids, not ids.
[pciutils.git] / lib / proc.c
index 5b67d65311d85f033144b8019ea673d0c30412a3..6bcf44b0b830cf2792b2de285b9183ad6f0d6e71 100644 (file)
@@ -1,9 +1,9 @@
 /*
 /*
- *     $Id: proc.c,v 1.6 1999/08/31 05:58:07 ecd Exp $
+ *     $Id: proc.c,v 1.10 2002/12/26 20:24:08 mj Exp $
  *
  *     The PCI Library -- Configuration Access via /proc/bus/pci
  *
  *
  *     The PCI Library -- Configuration Access via /proc/bus/pci
  *
- *     Copyright (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ *     Copyright (c) 1997--1999 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -46,13 +46,16 @@ static int pwrite(unsigned int fd, void *buf, size_t size, loff_t where)
 #elif defined(i386)
 /* old libc on i386 -> call syscalls directly the old way */
 #include <asm/unistd.h>
 #elif defined(i386)
 /* old libc on i386 -> call syscalls directly the old way */
 #include <asm/unistd.h>
-static _syscall4(int, pread, unsigned int, fd, void *, buf, size_t, size, loff_t, where);
-static _syscall4(int, pwrite, unsigned int, fd, void *, buf, size_t, size, loff_t, where);
+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) \
 
 #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, loff_t where)     \
+       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;                                                                                \
        {                                                                                       \
          struct pci_access *a = d->access;                                                     \
          int r;                                                                                \
@@ -157,6 +160,7 @@ proc_scan(struct pci_access *a)
       d->func = PCI_FUNC(dfn & 0xff);
       d->vendor_id = vend >> 16U;
       d->device_id = vend & 0xffff;
       d->func = PCI_FUNC(dfn & 0xff);
       d->vendor_id = vend >> 16U;
       d->device_id = vend & 0xffff;
+      d->hdrtype = pci_read_byte(d, PCI_HEADER_TYPE);
       known = PCI_FILL_IDENT;
       if (!a->buscentric)
        {
       known = PCI_FILL_IDENT;
       if (!a->buscentric)
        {