]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/access.c
More Windows stuff.
[pciutils.git] / lib / access.c
index 4c47a0e10d6ece4dee9c15c2453236a38352bdac..5683eac8dd96a7b3e1b9c493024e155c227af2dc 100644 (file)
@@ -1,9 +1,7 @@
 /*
 /*
- *     $Id: access.c,v 1.5 1999/07/20 14:01:28 mj Exp $
- *
  *     The PCI Library -- User Access
  *
  *     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.
  */
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 
 static struct pci_methods *pci_methods[PCI_ACCESS_MAX] = {
   NULL,
 
 static struct pci_methods *pci_methods[PCI_ACCESS_MAX] = {
   NULL,
-#ifdef HAVE_PM_LINUX_PROC
+#ifdef PCI_HAVE_PM_LINUX_SYSFS
+  &pm_linux_sysfs,
+#else
+  NULL,
+#endif
+#ifdef PCI_HAVE_PM_LINUX_PROC
   &pm_linux_proc,
 #else
   NULL,
 #endif
   &pm_linux_proc,
 #else
   NULL,
 #endif
-#ifdef HAVE_PM_SYSCALLS
-  &pm_syscalls,
+#ifdef PCI_HAVE_PM_INTEL_CONF
+  &pm_intel_conf1,
+  &pm_intel_conf2,
 #else
   NULL,
 #else
   NULL,
+  NULL,
 #endif
 #endif
-#ifdef HAVE_PM_FBSD_DEVICE
+#ifdef PCI_HAVE_PM_FBSD_DEVICE
   &pm_fbsd_device,
 #else
   NULL,
 #endif
   &pm_fbsd_device,
 #else
   NULL,
 #endif
-#ifdef HAVE_PM_INTEL_CONF
-  &pm_intel_conf1,
-  &pm_intel_conf2,
+#ifdef PCI_HAVE_PM_AIX_DEVICE
+  &pm_aix_device,
 #else
   NULL,
 #else
   NULL,
+#endif
+#ifdef PCI_HAVE_PM_NBSD_LIBPCI
+  &pm_nbsd_libpci,
+#else
   NULL,
 #endif
   NULL,
 #endif
-#ifdef HAVE_PM_DUMP
+#ifdef PCI_HAVE_PM_DUMP
   &pm_dump,
 #else
   NULL,
   &pm_dump,
 #else
   NULL,
@@ -53,7 +61,7 @@ pci_alloc(void)
   int i;
 
   bzero(a, sizeof(*a));
   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);
   for(i=0; i<PCI_ACCESS_MAX; i++)
     if (pci_methods[i] && pci_methods[i]->config)
       pci_methods[i]->config(a);
@@ -111,7 +119,7 @@ pci_generic_debug(char *msg, ...)
 }
 
 static void
 }
 
 static void
-pci_null_debug(char * UNUSED msg, ...)
+pci_null_debug(char *msg UNUSED, ...)
 {
 }
 
 {
 }
 
@@ -186,6 +194,7 @@ pci_alloc_dev(struct pci_access *a)
   bzero(d, sizeof(*d));
   d->access = a;
   d->methods = a->methods;
   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;
   if (d->methods->init_dev)
     d->methods->init_dev(d);
   return d;
@@ -201,10 +210,11 @@ pci_link_dev(struct pci_access *a, struct pci_dev *d)
 }
 
 struct pci_dev *
 }
 
 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);
 
 {
   struct pci_dev *d = pci_alloc_dev(a);
 
+  d->domain = domain;
   d->bus = bus;
   d->dev = dev;
   d->func = func;
   d->bus = bus;
   d->dev = dev;
   d->func = func;