diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-02-05 12:40:05 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-02-05 12:40:05 +0000 |
commit | 66048e3214adc8de4fff3beae1aa34facf307611 (patch) | |
tree | 9af602c41f2c21c9c1063800e30a6c81e2764cbf /src/drivers | |
parent | cc5a27f9cbbc43c485c4eceab4bd091714be7505 (diff) | |
download | ipxe-66048e3214adc8de4fff3beae1aa34facf307611.tar.gz |
[usb] Report xHCI host controller events
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/usb/xhci.c | 20 | ||||
-rw-r--r-- | src/drivers/usb/xhci.h | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/drivers/usb/xhci.c b/src/drivers/usb/xhci.c index b36e7799..cdebc47d 100644 --- a/src/drivers/usb/xhci.c +++ b/src/drivers/usb/xhci.c @@ -1616,6 +1616,22 @@ static void xhci_port_status ( struct xhci_device *xhci, } /** + * Handle host controller event + * + * @v xhci xHCI device + * @v host Host controller event + */ +static void xhci_host_controller ( struct xhci_device *xhci, + struct xhci_trb_host_controller *host ) { + int rc; + + /* Construct error */ + rc = -ECODE ( host->code ); + DBGC ( xhci, "XHCI %p host controller event (code %d): %s\n", + xhci, host->code, strerror ( rc ) ); +} + +/** * Poll event ring * * @v xhci xHCI device @@ -1656,6 +1672,10 @@ static void xhci_event_poll ( struct xhci_device *xhci ) { xhci_port_status ( xhci, &trb->port ); break; + case XHCI_TRB_HOST_CONTROLLER: + xhci_host_controller ( xhci, &trb->host ); + break; + default: DBGC ( xhci, "XHCI %p unrecognised event %#x\n:", xhci, event->cons ); diff --git a/src/drivers/usb/xhci.h b/src/drivers/usb/xhci.h index b9f6d9fe..7f768aa0 100644 --- a/src/drivers/usb/xhci.h +++ b/src/drivers/usb/xhci.h @@ -649,6 +649,25 @@ struct xhci_trb_port_status { /** A port status change transfer request block */ #define XHCI_TRB_PORT_STATUS XHCI_TRB_TYPE ( 34 ) +/** A port status change transfer request block */ +struct xhci_trb_host_controller { + /** Reserved */ + uint64_t reserved_a; + /** Reserved */ + uint8_t reserved_b[3]; + /** Completion code */ + uint8_t code; + /** Flags */ + uint8_t flags; + /** Type */ + uint8_t type; + /** Reserved */ + uint16_t reserved_c; +} __attribute__ (( packed )); + +/** A port status change transfer request block */ +#define XHCI_TRB_HOST_CONTROLLER XHCI_TRB_TYPE ( 37 ) + /** A transfer request block */ union xhci_trb { /** Template */ @@ -683,6 +702,8 @@ union xhci_trb { struct xhci_trb_complete complete; /** Port status changed event */ struct xhci_trb_port_status port; + /** Host controller event */ + struct xhci_trb_host_controller host; } __attribute__ (( packed )); /** An input control context */ |