libpayload: Add UNKNOWN_SPEED to usb_speed enum
xhci_rh_port_speed return -1 if the port is disabled. The usb_speed enum is unsigned so this results in a positive value which implies success. Adding a -1 to the enum will make it signed so the >= 0 check will work correctly. BUG=b:76831439 TEST=verified on grunt that -1 is returned when port is disabled. Change-Id: I98a373717d52dfb6ca4dcc53a00dc1b4c240a919 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/27476 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
e73e81d029
commit
c534a066d8
|
@ -95,7 +95,7 @@ xhci_rh_port_speed(usbdev_t *const dev, const int port)
|
||||||
>> PORTSC_PORT_SPEED_START)
|
>> PORTSC_PORT_SPEED_START)
|
||||||
- 1;
|
- 1;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return UNKNOWN_SPEED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,11 @@ typedef struct {
|
||||||
} endpoint_t;
|
} endpoint_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FULL_SPEED = 0, LOW_SPEED = 1, HIGH_SPEED = 2, SUPER_SPEED = 3,
|
UNKNOWN_SPEED = -1,
|
||||||
|
FULL_SPEED = 0,
|
||||||
|
LOW_SPEED = 1,
|
||||||
|
HIGH_SPEED = 2,
|
||||||
|
SUPER_SPEED = 3,
|
||||||
} usb_speed;
|
} usb_speed;
|
||||||
|
|
||||||
struct usbdev {
|
struct usbdev {
|
||||||
|
|
Loading…
Reference in New Issue