coreboot/payloads/libpayload/drivers/usb
Julius Werner fd4529f37f libpayload: usbmsc: Remove DETACHED state from MSC device structure
The USB MSC device structure contains a "ready" state that can be either
"ready", "not ready" or "detached". The last one can only be assigned
when the device is completely unresponsive and gets forcefully logically
detached via usb_detach_device(). This call (at least in the current
version) also calls all destructors and frees the complete usbdev_t
structure (including the MSC specific part), which unfortunately makes
storing the "detached" state in that very structure a little pointless.

This patch reduces the "ready" value to a simple boolean and makes sure
that all detachment cases immediately return from the MSC driver,
carefully avoiding any use-after-free opportunities.

BUG=None
TEST=Unplug a USB stick from a Pit/Kirby in depthcharge and make sure
the machine doesn't crash.

Change-Id: Iff1c0849f9ce7c95d399bb9a1a0a94469951194d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170667
2013-09-27 01:05:39 +00:00
..
ehci.c
ehci.h
ehci_private.h
ehci_rh.c
generic_hub.c
generic_hub.h
ohci.c
ohci.h
ohci_private.h
ohci_rh.c
quirks.c
TODO
uhci.c
uhci.h
uhci_private.h
uhci_rh.c
usb.c
usb_dev.c
usbhid.c
usbhub.c libpayload: usbhub: Don't clear PSC unless it was set 2013-09-16 19:38:40 +00:00
usbinit.c libpayload: usb: Allow direct instantiation of MMIO host controllers 2013-09-17 03:22:00 +00:00
usbmsc.c libpayload: usbmsc: Remove DETACHED state from MSC device structure 2013-09-27 01:05:39 +00:00
xhci.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci.h
xhci_commands.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci_debug.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci_devconf.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci_events.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci_private.h libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00
xhci_rh.c libpayload: xhci: Make XHCI stack usable on ARM 2013-09-17 03:21:57 +00:00