From c534a066d8808e97eee9ccd2ac2bc936961a129b Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 16 Jul 2018 09:21:10 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/27476 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- payloads/libpayload/include/usb/usb.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload/include/usb') diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h index ef1892661c..79c4586c4a 100644 --- a/payloads/libpayload/include/usb/usb.h +++ b/payloads/libpayload/include/usb/usb.h @@ -187,7 +187,11 @@ typedef struct { } endpoint_t; 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; struct usbdev { -- cgit v1.2.3