void usbpf_detach(struct usb_bus *ubus) { if (ubus->ifp != NULL) usbpf_clone_destroy(usbpf_cloner, ubus->ifp); if (bootverbose) device_printf(ubus->parent, "usbpf: Detached\n"); }
static void usbpf_uninit(void) { int devlcnt; device_t *devlp; devclass_t dc; struct usb_bus *ubus; int error; int i; if_clone_detach(&usbpf_cloner); dc = devclass_find(USBUSNAME); if (dc == NULL) return; error = devclass_get_devices(dc, &devlp, &devlcnt); if (error) return; for (i = 0; i < devlcnt; i++) { ubus = device_get_softc(devlp[i]); if (ubus != NULL && ubus->ifp != NULL) usbpf_clone_destroy(&usbpf_cloner, ubus->ifp); } }