[usb] Report xHCI host controller events

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-02-05 12:40:05 +00:00
parent cc5a27f9cb
commit 66048e3214
2 changed files with 41 additions and 0 deletions

View File

@@ -1615,6 +1615,22 @@ static void xhci_port_status ( struct xhci_device *xhci,
usb_port_changed ( usb_port ( xhci->bus->hub, port->port ) );
}
/**
* 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
*
@@ -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 );