Changeset fb154e13 in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2018-01-12T22:48:57Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0e7380f
- Parents:
- 7242ba21
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r7242ba21 rfb154e13 476 476 * not cause an interrupt. 477 477 */ 478 xhci_rh_handle_port_change(&hc->rh); 478 for (uint8_t port = 1; port <= hc->rh.max_ports; ++port) 479 xhci_rh_handle_port_change(&hc->rh, port); 479 480 480 481 return EOK; … … 508 509 } 509 510 511 static int handle_port_status_change_event(xhci_hc_t *hc, xhci_trb_t *trb) 512 { 513 uint8_t port_id = XHCI_QWORD_EXTRACT(trb->parameter, 31, 24); 514 usb_log_debug("Port status change event detected for port %u.", port_id); 515 xhci_rh_handle_port_change(&hc->rh, port_id); 516 return EOK; 517 } 518 510 519 typedef int (*event_handler) (xhci_hc_t *, xhci_trb_t *trb); 511 520 512 521 static event_handler event_handlers [] = { 513 522 [XHCI_TRB_TYPE_COMMAND_COMPLETION_EVENT] = &xhci_handle_command_completion, 514 [XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT] = & xhci_rh_handle_port_status_change_event,523 [XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT] = &handle_port_status_change_event, 515 524 [XHCI_TRB_TYPE_TRANSFER_EVENT] = &xhci_handle_transfer_event, 516 525 [XHCI_TRB_TYPE_MFINDEX_WRAP_EVENT] = &xhci_handle_mfindex_wrap_event, … … 578 587 status = xhci2host(32, status); 579 588 580 if (status & XHCI_REG_MASK(XHCI_OP_PCD)) {581 usb_log_debug2("Root hub interrupt.");582 xhci_rh_handle_port_change(&hc->rh);583 status &= ~XHCI_REG_MASK(XHCI_OP_PCD);584 }585 586 589 if (status & XHCI_REG_MASK(XHCI_OP_HSE)) { 587 590 usb_log_error("Host controller error occured. Bad things gonna happen..."); … … 599 602 status &= ~XHCI_REG_MASK(XHCI_OP_SRE); 600 603 } 604 605 /* According to Note on p. 302, we may safely ignore the PCD bit. */ 606 status &= ~XHCI_REG_MASK(XHCI_OP_PCD); 601 607 602 608 if (status) {
Note:
See TracChangeset
for help on using the changeset viewer.