]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/obsd-device.c
Control symbol exports in libpci.
[pciutils.git] / lib / obsd-device.c
index 721f2f53c31d81193ff6b735fd41283253854043..62395b376f2b5917d84f1797cede1faebfc5eece 100644 (file)
 static void
 obsd_config(struct pci_access *a)
 {
-  a->method_params[PCI_ACCESS_OBSD_DEVICE] = PCI_PATH_OBSD_DEVICE;
+  pci_define_param(a, "obsd.path", PCI_PATH_OBSD_DEVICE, "Path to the OpenBSD PCI device");
 }
 
 static int
 obsd_detect(struct pci_access *a)
 {
-  char *name = a->method_params[PCI_ACCESS_OBSD_DEVICE];
+  char *name = pci_get_param(a, "obsd.path");
 
   if (access(name, R_OK))
     {
@@ -39,7 +39,7 @@ obsd_detect(struct pci_access *a)
 static void
 obsd_init(struct pci_access *a)
 {
-  char *name = a->method_params[PCI_ACCESS_OBSD_DEVICE];
+  char *name = pci_get_param(a, "obsd.path");
 
   a->fd = open(name, O_RDWR, 0);
   if (a->fd < 0)
@@ -136,7 +136,8 @@ obsd_write(struct pci_dev *d, int pos, byte *buf, int len)
 }
 
 struct pci_methods pm_obsd_device = {
-  "OpenBSD-device",
+  "obsd-device",
+  "/dev/pci on OpenBSD",
   obsd_config,
   obsd_detect,
   obsd_init,