Changeset a1eb7c67 in mainline
- Timestamp:
- 2017-10-03T11:36:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- adb4e683
- Parents:
- a2b0ba3
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/trb_ring.c
ra2b0ba3 ra1eb7c67 208 208 209 209 usb_log_debug2("TRB ring(%p): Enqueued TRB %p", ring, trb); 210 usb_log_error("RING->PCS: %u", ring->pcs);211 210 ring->enqueue_trb++; 212 211 … … 264 263 ring->ccs = 1; 265 264 265 fibril_mutex_initialize(&ring->guard); 266 266 267 usb_log_debug("Initialized event ring."); 267 268 … … 295 296 int xhci_event_ring_dequeue(xhci_event_ring_t *ring, xhci_trb_t *event) 296 297 { 298 fibril_mutex_lock(&ring->guard); 299 297 300 /** 298 301 * The ERDP reported to the HC is a half-phase off the one we need to … … 301 304 ring->dequeue_ptr = event_ring_dequeue_phys(ring); 302 305 303 if (TRB_CYCLE(*ring->dequeue_trb) != ring->ccs) 306 if (TRB_CYCLE(*ring->dequeue_trb) != ring->ccs) { 307 fibril_mutex_unlock(&ring->guard); 304 308 return ENOENT; /* The ring is empty. */ 309 } 305 310 306 311 memcpy(event, ring->dequeue_trb, sizeof(xhci_trb_t)); … … 323 328 } 324 329 325 return EOK; 326 } 330 fibril_mutex_unlock(&ring->guard); 331 return EOK; 332 } -
uspace/drv/bus/usb/xhci/trb_ring.h
ra2b0ba3 ra1eb7c67 106 106 107 107 bool ccs; /* Consumer Cycle State: section 4.9.2 */ 108 109 fibril_mutex_t guard; 108 110 } xhci_event_ring_t; 109 111
Note:
See TracChangeset
for help on using the changeset viewer.