summaryrefslogtreecommitdiffstats
path: root/src/drivers/usb/xhci.c
diff options
context:
space:
mode:
authorMichael Brown2015-12-07 00:41:26 +0100
committerMichael Brown2015-12-07 14:08:23 +0100
commiteb1fc1e9579a4f70bb28283bf3eadcf493fa0dcb (patch)
tree724bea4a4a87fd4625e45ba9811fa0b48c0dc97e /src/drivers/usb/xhci.c
parent[usb] Use port->disconnected to check for disconnected devices (diff)
downloadipxe-eb1fc1e9579a4f70bb28283bf3eadcf493fa0dcb.tar.gz
ipxe-eb1fc1e9579a4f70bb28283bf3eadcf493fa0dcb.tar.xz
ipxe-eb1fc1e9579a4f70bb28283bf3eadcf493fa0dcb.zip
[usb] Record USB device speed separately from current port speed
Record the speed of a USB device based on the port's speed at the time that the device was enabled. This allows us to remember the device's speed even after the device has been disconnected (and so the port's current speed has changed). In particular, this allows us to correctly identify the transaction translator for a low-speed or full-speed device after the device has been disconnected. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/usb/xhci.c')
-rw-r--r--src/drivers/usb/xhci.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/drivers/usb/xhci.c b/src/drivers/usb/xhci.c
index 110b4328..67de0a83 100644
--- a/src/drivers/usb/xhci.c
+++ b/src/drivers/usb/xhci.c
@@ -2753,7 +2753,6 @@ static void xhci_device_close ( struct usb_device *usb ) {
static int xhci_device_address ( struct usb_device *usb ) {
struct xhci_slot *slot = usb_get_hostdata ( usb );
struct xhci_device *xhci = slot->xhci;
- struct usb_port *port = usb->port;
struct usb_port *root_port;
int psiv;
int rc;
@@ -2766,7 +2765,7 @@ static int xhci_device_address ( struct usb_device *usb ) {
slot->port = root_port->address;
/* Calculate protocol speed ID */
- psiv = xhci_port_psiv ( xhci, slot->port, port->speed );
+ psiv = xhci_port_psiv ( xhci, slot->port, usb->speed );
if ( psiv < 0 ) {
rc = psiv;
return rc;