Changeset 047fbc8 in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2018-01-25T20:27:21Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a94cbfa
Parents:
629255a
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-25 20:27:16)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-25 20:27:21)
Message:

xhci rh: have standalone buffer for events

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.c

    r629255a r047fbc8  
    549549}
    550550
    551 static int handle_port_status_change_event(xhci_hc_t *hc, xhci_trb_t *trb)
    552 {
    553         uint8_t port_id = XHCI_QWORD_EXTRACT(trb->parameter, 31, 24);
    554         usb_log_debug("Port status change event detected for port %u.", port_id);
    555         xhci_rh_handle_port_change(&hc->rh, port_id);
    556         return EOK;
    557 }
    558 
    559551typedef int (*event_handler) (xhci_hc_t *, xhci_trb_t *trb);
    560552
     
    563555 */
    564556static event_handler event_handlers [] = {
    565         [XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT] = &handle_port_status_change_event,
    566557        [XHCI_TRB_TYPE_TRANSFER_EVENT] = &xhci_handle_transfer_event,
    567558};
     
    586577                return xhci_sw_ring_enqueue(&hc->sw_ring, trb);
    587578
     579        if (type == XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT)
     580                return xhci_sw_ring_enqueue(&hc->rh.event_ring, trb);
     581
    588582        return ENOTSUP;
    589583}
     
    606600        fibril_mutex_lock(&hc->event_fibril_completion.guard);
    607601        hc->event_fibril_completion.active = false;
    608         fibril_condvar_wait(&hc->event_fibril_completion.cv,
    609             &hc->event_fibril_completion.guard);
     602        fibril_condvar_broadcast(&hc->event_fibril_completion.cv);
    610603        fibril_mutex_unlock(&hc->event_fibril_completion.guard);
    611604
Note: See TracChangeset for help on using the changeset viewer.