static void usb_power_wdog(void *arg) { struct usb_bus *bus = arg; USB_BUS_LOCK_ASSERT(bus, MA_OWNED); usb_callout_reset(&bus->power_wdog, 4 * hz, usb_power_wdog, arg); #ifdef DDB /* * The following line of code is only here to recover from * DDB: */ usb_proc_rewakeup(&bus->explore_proc); /* recover from DDB */ #endif #if USB_HAVE_POWERD USB_BUS_UNLOCK(bus); usb_bus_power_update(bus); USB_BUS_LOCK(bus); #endif }
static void xhci_interrupt_poll(void *_sc) { struct xhci_softc *sc = _sc; USB_BUS_UNLOCK(&sc->sc_bus); xhci_interrupt(sc); USB_BUS_LOCK(&sc->sc_bus); usb_callout_reset(&sc->sc_callout, 1, (void *)&xhci_interrupt_poll, sc); }
static void usie_if_sync_cb(void *arg, int pending) { struct usie_softc *sc = arg; mtx_lock(&sc->sc_mtx); /* call twice */ usie_if_cmd(sc, USIE_HIP_SYNC2M); usie_if_cmd(sc, USIE_HIP_SYNC2M); usb_callout_reset(&sc->sc_if_sync_ch, 2 * hz, usie_if_sync_to, sc); mtx_unlock(&sc->sc_mtx); }
static void ue_watchdog(void *arg) { struct usb_ether *ue = arg; struct ifnet *ifp = ue->ue_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; ue_queue_command(ue, ue_tick_task, &ue->ue_tick_task[0].hdr, &ue->ue_tick_task[1].hdr); usb_callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); }
static void g_modem_timeout_reset(struct g_modem_softc *sc) { int i = g_modem_pattern_interval; sc->sc_tx_interval = i; if (i <= 0) i = 1; else if (i > 1023) i = 1023; i = USB_MS_TO_TICKS(i); usb_callout_reset(&sc->sc_callout, i, &g_modem_timeout, sc); }
static void ue_start_task(struct usb_proc_msg *_task) { struct usb_ether_cfg_task *task = (struct usb_ether_cfg_task *)_task; struct usb_ether *ue = task->ue; struct ifnet *ifp = ue->ue_ifp; UE_LOCK_ASSERT(ue, MA_OWNED); ue->ue_methods->ue_init(ue); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; if (ue->ue_methods->ue_tick != NULL) usb_callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); }
static void g_modem_watchdog_reset(struct g_modem_softc *sc) { usb_callout_reset(&sc->sc_watchdog, hz, &g_modem_watchdog, sc); }