Hi,

This patch makes "pciconf -a" do the right thing as opposed to always
failing with this message:

pciconf: ioctl(PCIOCATTACHED): Inappropriate ioctl for device

Any objections if I commit this?

best
Neel

Index: sys/dev/pci/pci_user.c
===================================================================
--- sys/dev/pci/pci_user.c      (revision 210396)
+++ sys/dev/pci/pci_user.c      (working copy)
@@ -735,6 +735,16 @@
                        bio->pbi_enabled = (value & PCIM_CMD_PORTEN) != 0;
                error = 0;
                break;
+       case PCIOCATTACHED:
+               error = 0;
+               io = (struct pci_io *)data;
+               pcidev = pci_find_dbsf(io->pi_sel.pc_domain, io->pi_sel.pc_bus,
+                                      io->pi_sel.pc_dev, io->pi_sel.pc_func);
+               if (pcidev != NULL)
+                       io->pi_data = device_is_attached(pcidev);
+               else
+                       error = ENODEV;
+               break;
        default:
                error = ENOTTY;
                break;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to