diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-05-06 16:38:28 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-05-08 14:57:14 +0100 |
commit | f6604627ff71d42bb63a3d81c2986a9d296d55cb (patch) | |
tree | 8eb038959b4e3429c4c15e9a1a7a5bd73e68c2b2 /src/include/ipxe/usb.h | |
parent | b88ab14ba38d0eb2123975ed78c8eb04ba13cf72 (diff) | |
download | ipxe-f6604627ff71d42bb63a3d81c2986a9d296d55cb.tar.gz |
[usb] Detect missed disconnections
The USB core will currently fail to detect disconnections if a new
device has attached by the time the port is examined in
usb_hotplug().
Fix by recording the fact that a disconnection has taken place
whenever the "connection status changed" (CSC) bit is observed to be
set. (Whether the change represents a disconnection or a
reconnection, it indicates that the port has experienced some time of
being disconnected.)
Note that the time at which a disconnection can be detected varies by
hub type. In particular: root hubs can observe the CSC bit when
polling, and so will record the disconnection before calling
usb_port_changed(), but USB hubs read the port status (and hence the
CSC bit) only during the call to hub_speed(), long after the call to
usb_port_changed().
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/usb.h')
-rw-r--r-- | src/include/ipxe/usb.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/ipxe/usb.h b/src/include/ipxe/usb.h index 991a6f44e..50d8a6fd8 100644 --- a/src/include/ipxe/usb.h +++ b/src/include/ipxe/usb.h @@ -747,6 +747,12 @@ struct usb_port { unsigned int protocol; /** Port speed */ unsigned int speed; + /** Port disconnection has been detected + * + * This should be set whenever the underlying hardware reports + * a connection status change. + */ + int disconnected; /** Port has an attached device */ int attached; /** Currently attached device (if in use) |