Changeset 73e5b62 in mainline
- Timestamp:
- 2017-07-31T19:58:08Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7428b92
- Parents:
- c9bec1c
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/drv/bus/usb/xhci/hc.c ¶
rc9bec1c r73e5b62 198 198 int err; 199 199 200 hc->dcbaa = malloc32((1 + hc->max_slots) * sizeof( xhci_device_ctx_t*));200 hc->dcbaa = malloc32((1 + hc->max_slots) * sizeof(uint64_t)); 201 201 if (!hc->dcbaa) 202 202 return ENOMEM; 203 203 204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_device_ctx_t*)); 205 if (!hc->dcbaa_virt) { 206 err = ENOMEM; 207 goto err_dcbaa; 208 } 209 204 210 if ((err = xhci_trb_ring_init(&hc->command_ring, hc))) 205 goto err_dcbaa ;211 goto err_dcbaa_virt; 206 212 207 213 if ((err = xhci_event_ring_init(&hc->event_ring, hc))) … … 220 226 err_cmd_ring: 221 227 xhci_trb_ring_fini(&hc->command_ring); 228 err_dcbaa_virt: 229 free32(hc->dcbaa_virt); 222 230 err_dcbaa: 223 231 free32(hc->dcbaa); … … 468 476 /* Idx 0 already deallocated by xhci_scratchpad_free. */ 469 477 for (unsigned i = 1; i < hc->max_slots + 1; ++i) { 470 if (hc->dcbaa [i] != NULL) {471 free32(hc->dcbaa [i]);472 hc->dcbaa [i] = NULL;478 if (hc->dcbaa_virt[i] != NULL) { 479 free32(hc->dcbaa_virt[i]); 480 hc->dcbaa_virt[i] = NULL; 473 481 } 474 482 } 475 483 476 484 free32(hc->dcbaa); 485 free32(hc->dcbaa_virt); 477 486 } 478 487 -
TabularUnified uspace/drv/bus/usb/xhci/hc.h ¶
rc9bec1c r73e5b62 66 66 xhci_trb_ring_t command_ring; 67 67 xhci_event_ring_t event_ring; 68 xhci_device_ctx_t **dcbaa; 68 uint64_t *dcbaa; 69 xhci_device_ctx_t **dcbaa_virt; 69 70 xhci_scratchpad_t *scratchpad; 70 71 -
TabularUnified uspace/drv/bus/usb/xhci/scratchpad.c ¶
rc9bec1c r73e5b62 92 92 bufs->phys_bck = (uint64_t) phys_array; 93 93 94 hc->dcbaa[0] = (xhci_device_ctx_t *)bufs->phys_ptr;94 hc->dcbaa[0] = bufs->phys_ptr; 95 95 hc->scratchpad = bufs; 96 96 … … 131 131 free32((void *) scratchpad->phys_bck); 132 132 133 hc->dcbaa[0] = NULL; 133 hc->dcbaa[0] = 0; 134 hc->dcbaa_virt[0] = NULL; 134 135 return; 135 136 }
Note:
See TracChangeset
for help on using the changeset viewer.