[usb] Use port->disconnected to check for disconnected devices
authorMichael Brown <mcb30@ipxe.org>
Sun, 6 Dec 2015 23:22:37 +0000 (23:22 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 7 Dec 2015 13:08:22 +0000 (13:08 +0000)
commit15ce7ce355b3cfb5ec8bc2d51528b08f02f4648b
tree0c8628f693944e02af6db1ea17ef5d5fb5f46427
parent7f65a08f3e2606a5102fb68acf6ccf5fc283ecb6
[usb] Use port->disconnected to check for disconnected devices

The usb_message() and usb_stream() functions currently check for
port->speed==USB_SPEED_NONE to determine whether or not a device has
been unplugged.  This test will give a false negative result if a new
device has been plugged in before the hotplug mechanism has finished
handling the removal of the old device.

Fix by checking instead the port->disconnected flag, which is now
cleared only after completing the removal of the old device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/usb.c
src/drivers/usb/usbhub.c