]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/fbsd-device.c
Released as 2.99.1-alpha1.
[pciutils.git] / lib / fbsd-device.c
index 875480daa332f29882d7326539e36657b8440879..742c6419f54efa1dbdb1b64057c3402e40345624 100644 (file)
 static void
 fbsd_config(struct pci_access *a)
 {
-  a->method_params[PCI_ACCESS_FBSD_DEVICE] = PCI_PATH_FBSD_DEVICE;
+  pci_define_param(a, "fbsd.path", PCI_PATH_FBSD_DEVICE, "Path to the FreeBSD PCI device");
 }
 
 static int
 fbsd_detect(struct pci_access *a)
 {
-  char *name = a->method_params[PCI_ACCESS_FBSD_DEVICE];
+  char *name = pci_get_param(a, "fbsd.path");
 
   if (access(name, R_OK))
     {
@@ -53,7 +53,7 @@ fbsd_detect(struct pci_access *a)
 static void
 fbsd_init(struct pci_access *a)
 {
-  char *name = a->method_params[PCI_ACCESS_FBSD_DEVICE];
+  char *name = pci_get_param(a, "fbsd.path");
 
   a->fd = open(name, O_RDWR, 0);
   if (a->fd < 0)
@@ -154,7 +154,8 @@ fbsd_write(struct pci_dev *d, int pos, byte *buf, int len)
 }
 
 struct pci_methods pm_fbsd_device = {
-  "FreeBSD-device",
+  "fbsd-device",
+  "FreeBSD /dev/pci device",
   fbsd_config,
   fbsd_detect,
   fbsd_init,