Changeset decfc8d1 in mainline
- Timestamp:
- 2017-08-20T18:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3d8a3bd
- Parents:
- 8b415cc
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r8b415cc rdecfc8d1 202 202 return ENOMEM; 203 203 204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_ device_ctx_t*));204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_virt_device_ctx_t)); 205 205 if (!hc->dcbaa_virt) { 206 206 err = ENOMEM; … … 507 507 /* Idx 0 already deallocated by xhci_scratchpad_free. */ 508 508 for (unsigned i = 1; i < hc->max_slots + 1; ++i) { 509 if (hc->dcbaa_virt[i]) { 510 if (hc->dcbaa_virt[i]->dev_ctx) 511 free32(hc->dcbaa_virt[i]->dev_ctx); 512 513 for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) { 514 trb_ring = hc->dcbaa_virt[i]->trs[i]; 515 if (trb_ring) { 516 xhci_trb_ring_fini(trb_ring); 517 free32(trb_ring); 518 } 509 if (hc->dcbaa_virt[i].dev_ctx) { 510 free32(hc->dcbaa_virt[i].dev_ctx); 511 hc->dcbaa_virt[i].dev_ctx = NULL; 512 } 513 514 for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) { 515 trb_ring = hc->dcbaa_virt[i].trs[i]; 516 if (trb_ring) { 517 hc->dcbaa_virt[i].trs[i] = NULL; 518 xhci_trb_ring_fini(trb_ring); 519 free32(trb_ring); 519 520 } 520 521 free32(hc->dcbaa_virt[i]);522 hc->dcbaa_virt[i] = NULL;523 521 } 524 522 } -
uspace/drv/bus/usb/xhci/hc.h
r8b415cc rdecfc8d1 73 73 xhci_event_ring_t event_ring; 74 74 uint64_t *dcbaa; 75 xhci_virt_device_ctx_t * *dcbaa_virt;75 xhci_virt_device_ctx_t *dcbaa_virt; 76 76 xhci_scratchpad_t *scratchpad; 77 77 -
uspace/drv/bus/usb/xhci/rh.c
r8b415cc rdecfc8d1 126 126 127 127 hc->dcbaa[slot_id] = addr_to_phys(dctx); 128 hc->dcbaa_virt[slot_id]->dev_ctx = dctx; 128 129 memset(&hc->dcbaa_virt[slot_id], 0, sizeof(xhci_virt_device_ctx_t)); 130 hc->dcbaa_virt[slot_id].dev_ctx = dctx; 129 131 130 132 cmd = xhci_alloc_command(); … … 145 147 free32(dctx); 146 148 hc->dcbaa[slot_id] = 0; 147 hc->dcbaa_virt[slot_id] = NULL;149 memset(&hc->dcbaa_virt[slot_id], 0, sizeof(xhci_virt_device_ctx_t)); 148 150 } 149 151 err_ring: -
uspace/drv/bus/usb/xhci/scratchpad.c
r8b415cc rdecfc8d1 132 132 133 133 hc->dcbaa[0] = 0; 134 hc->dcbaa_virt[0] = NULL; 134 memset(&hc->dcbaa_virt[0], 0, sizeof(xhci_virt_device_ctx_t)); 135 135 136 return; 136 137 }
Note:
See TracChangeset
for help on using the changeset viewer.