]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/fbsd-device.c
Darwin: Renamed to darwin.c
[pciutils.git] / lib / fbsd-device.c
index 875480daa332f29882d7326539e36657b8440879..ab04954b6682a320e0b9215115a0801307ca3499 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,
@@ -163,6 +164,7 @@ struct pci_methods pm_fbsd_device = {
   pci_generic_fill_info,
   fbsd_read,
   fbsd_write,
+  NULL,                                 /* read_vpd */
   NULL,                                 /* dev_init */
   NULL                                  /* dev_cleanup */
 };