Index: external/mit/libpciaccess/dist/src/netbsd_pci.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c,v retrieving revision 1.13 diff -p -r1.13 netbsd_pci.c *** external/mit/libpciaccess/dist/src/netbsd_pci.c 17 Mar 2014 02:42:09 -0000 1.13 --- external/mit/libpciaccess/dist/src/netbsd_pci.c 13 Jul 2014 04:24:28 -0000 *************** pci_device_netbsd_unmap_legacy(struct pc *** 841,846 **** --- 841,869 ---- return pci_device_netbsd_unmap_range(dev, &map); } + static int + pci_device_netbsd_has_kernel_driver(struct pci_device *dev) + { + #ifdef PCI_IOC_DRVNAME + /* + * NetBSD PCI_IOC_DRVNAME appears at the same time as pci_drvname(3) + */ + char drvname[16]; + + if (dev->bus >= nbuses) + return 0; + + /* + * vga(4) should be considered "not bound". + */ + if (pci_drvname(buses[dev->bus].fd, dev->dev, dev->func, + drvname, sizeof drvname) == 0 && + strncmp(drvname, "vga", 3) != 0) + return 1; + #endif + return 0; + } + static const struct pci_system_methods netbsd_pci_methods = { .destroy = pci_system_netbsd_destroy, .destroy_device = NULL, *************** static const struct pci_system_methods n *** 865,870 **** --- 888,894 ---- .write8 = pci_device_netbsd_write8, .map_legacy = pci_device_netbsd_map_legacy, .unmap_legacy = pci_device_netbsd_unmap_legacy, + .has_kernel_driver = pci_device_netbsd_has_kernel_driver, }; int