Changeset 706a3e2 in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2017-08-18T16:21:33Z (8 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ff9e1d
Parents:
e439f468
Message:

Dcbaa_virt now points to virtual device contexts that contain pointers to trb rings of each of their endpoints for deallocation.

File:
1 edited

Legend:

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

    re439f468 r706a3e2  
    483483static void hc_dcbaa_fini(xhci_hc_t *hc)
    484484{
     485        xhci_trb_ring_t* trb_ring;
    485486        xhci_scratchpad_free(hc);
    486487
    487488        /* Idx 0 already deallocated by xhci_scratchpad_free. */
    488489        for (unsigned i = 1; i < hc->max_slots + 1; ++i) {
    489                 if (hc->dcbaa_virt[i] != NULL) {
     490                if (hc->dcbaa_virt[i]) {
     491                        if (hc->dcbaa_virt[i]->dev_ctx)
     492                                free32(hc->dcbaa_virt[i]->dev_ctx);
     493
     494                        for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) {
     495                                trb_ring = hc->dcbaa_virt[i]->trs[i];
     496                                if (trb_ring) {
     497                                        xhci_trb_ring_fini(trb_ring);
     498                                        free32(trb_ring);
     499                                }
     500                        }
     501
    490502                        free32(hc->dcbaa_virt[i]);
    491503                        hc->dcbaa_virt[i] = NULL;
Note: See TracChangeset for help on using the changeset viewer.