mirror of
https://github.com/opnsense/src.git
synced 2026-04-23 15:19:31 -04:00
Only clear endpoint stall if status was USBD_STALLED.
This avoids panicing the system by unplugging a hub. The interrupt transfer would sometimes arrive after the driver had been removed.
This commit is contained in:
parent
494e7e3923
commit
aa75eeda2f
6 changed files with 15 additions and 9 deletions
|
|
@ -861,7 +861,8 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("ugenintr: status=%d\n", status));
|
||||
usbd_clear_endpoint_stall_async(sce->pipeh);
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(sce->pipeh);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -351,7 +351,8 @@ uhid_intr(xfer, addr, status)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("uhid_intr: status=%d\n", status));
|
||||
sc->sc_state |= UHID_NEEDCLEAR;
|
||||
if (status == USBD_STALLED)
|
||||
sc->sc_state |= UHID_NEEDCLEAR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -577,10 +577,10 @@ uhub_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
|
|||
struct uhub_softc *sc = addr;
|
||||
|
||||
DPRINTFN(5,("uhub_intr: sc=%p\n", sc));
|
||||
if (status != USBD_NORMAL_COMPLETION)
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(sc->sc_ipipe);
|
||||
|
||||
usb_needs_explore(sc->sc_hub->bus);
|
||||
else if (status == USBD_NORMAL_COMPLETION)
|
||||
usb_needs_explore(sc->sc_hub->bus);
|
||||
}
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
|
|
|
|||
|
|
@ -700,7 +700,8 @@ ukbd_interrupt(keyboard_t *kbd, void *arg)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("ukbd_intr: status=%d\n", status));
|
||||
usbd_clear_endpoint_stall_async(state->ks_intrpipe);
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(state->ks_intrpipe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -479,7 +479,8 @@ umodemwritecb(xfer, priv, status)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("umodemwritecb: status=%d\n", status));
|
||||
usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
|
||||
/* XXX we should restart after some delay. */
|
||||
return;
|
||||
}
|
||||
|
|
@ -753,7 +754,8 @@ umodemreadcb(xfer, p, status)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("umodemreadcb: status=%d\n", status));
|
||||
usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
|
||||
/* XXX we should restart after some delay. */
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -421,7 +421,8 @@ ums_intr(xfer, addr, status)
|
|||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
DPRINTF(("ums_intr: status=%d\n", status));
|
||||
usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
|
||||
if (status == USBD_STALLED)
|
||||
usbd_clear_endpoint_stall_async(sc->sc_intrpipe);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue