Changeset c46c356 in mainline


Ignore:
Timestamp:
2017-07-23T19:23:52Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2e7692f
Parents:
e50bdd92
Message:

Added command list deallocation during hc finalization.

Location:
uspace/drv/bus/usb/xhci
Files:
3 edited

Legend:

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

    re50bdd92 rc46c356  
    5050        list_initialize(&hc->commands);
    5151        return EOK;
     52}
     53
     54void xhci_fini_commands(xhci_hc_t *hc)
     55{
     56        // Note: Untested.
     57        assert(hc);
     58
     59        // We assume that the hc is dying/stopping, so we ignore
     60        // the ownership of the commands.
     61        list_foreach(hc->commands, link, xhci_cmd_t, cmd) {
     62                xhci_free_command(cmd);
     63        }
    5264}
    5365
  • uspace/drv/bus/usb/xhci/commands.h

    re50bdd92 rc46c356  
    5757
    5858int xhci_init_commands(xhci_hc_t *);
     59void xhci_fini_commands(xhci_hc_t *);
    5960int xhci_wait_for_command(xhci_cmd_t *, uint32_t);
    6061xhci_cmd_t *xhci_alloc_command(void);
  • uspace/drv/bus/usb/xhci/hc.c

    re50bdd92 rc46c356  
    489489        xhci_event_ring_fini(&hc->event_ring);
    490490        hc_dcbaa_fini(hc);
     491        xhci_fini_commands(hc);
    491492        pio_disable(hc->base, RNGSZ(hc->mmio_range));
    492493        usb_log_info("HC(%p): Finalized.", hc);
Note: See TracChangeset for help on using the changeset viewer.