]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/access.c
More Windows stuff.
[pciutils.git] / lib / access.c
index a5e2616281bfe41cb9c059412a3b105461df2698..5683eac8dd96a7b3e1b9c493024e155c227af2dc 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *     $Id: access.c,v 1.4 1999/07/07 11:23:08 mj Exp $
- *
  *     The PCI Library -- User Access
  *
- *     Copyright (c) 1997--1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ *     Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 
 static struct pci_methods *pci_methods[PCI_ACCESS_MAX] = {
   NULL,
-#ifdef HAVE_PM_LINUX_PROC
-  &pm_linux_proc,
+#ifdef PCI_HAVE_PM_LINUX_SYSFS
+  &pm_linux_sysfs,
 #else
   NULL,
 #endif
-#ifdef HAVE_PM_SYSCALLS
-  &pm_syscalls,
+#ifdef PCI_HAVE_PM_LINUX_PROC
+  &pm_linux_proc,
 #else
   NULL,
 #endif
-#ifdef HAVE_PM_INTEL_CONF
+#ifdef PCI_HAVE_PM_INTEL_CONF
   &pm_intel_conf1,
   &pm_intel_conf2,
 #else
   NULL,
   NULL,
 #endif
-#ifdef HAVE_PM_DUMP
+#ifdef PCI_HAVE_PM_FBSD_DEVICE
+  &pm_fbsd_device,
+#else
+  NULL,
+#endif
+#ifdef PCI_HAVE_PM_AIX_DEVICE
+  &pm_aix_device,
+#else
+  NULL,
+#endif
+#ifdef PCI_HAVE_PM_NBSD_LIBPCI
+  &pm_nbsd_libpci,
+#else
+  NULL,
+#endif
+#ifdef PCI_HAVE_PM_DUMP
   &pm_dump,
 #else
   NULL,
@@ -48,7 +61,7 @@ pci_alloc(void)
   int i;
 
   bzero(a, sizeof(*a));
-  a->id_file_name = PATH_PCI_IDS;
+  a->id_file_name = PCI_PATH_IDS;
   for(i=0; i<PCI_ACCESS_MAX; i++)
     if (pci_methods[i] && pci_methods[i]->config)
       pci_methods[i]->config(a);
@@ -106,7 +119,7 @@ pci_generic_debug(char *msg, ...)
 }
 
 static void
-pci_null_debug(char * UNUSED msg, ...)
+pci_null_debug(char *msg UNUSED, ...)
 {
 }
 
@@ -181,6 +194,7 @@ pci_alloc_dev(struct pci_access *a)
   bzero(d, sizeof(*d));
   d->access = a;
   d->methods = a->methods;
+  d->hdrtype = -1;
   if (d->methods->init_dev)
     d->methods->init_dev(d);
   return d;
@@ -196,10 +210,11 @@ pci_link_dev(struct pci_access *a, struct pci_dev *d)
 }
 
 struct pci_dev *
-pci_get_dev(struct pci_access *a, int bus, int dev, int func)
+pci_get_dev(struct pci_access *a, int domain, int bus, int dev, int func)
 {
   struct pci_dev *d = pci_alloc_dev(a);
 
+  d->domain = domain;
   d->bus = bus;
   d->dev = dev;
   d->func = func;