Changeset 9620a54 in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2017-10-29T10:51:59Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d33dc780
Parents:
62f8025
Message:

Small changes. Temporarily fixed no device problem for endpoint logging. Added similar macro for device logging. Changed log messages to adopt these macros. TRB rings can be freed again. Made ring finalizers noexcept. Upon detach, the entire slot is disabled prior to unregistering endpoints in order to prevent invalid HC commands. Removed active endpoints count from XHCI device. Device context is freed in HC, so DCBAA is not touched from anywhere else.

File:
1 edited

Legend:

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

    r62f8025 r9620a54  
    617617}
    618618
    619 int hc_disable_slot(xhci_hc_t *hc, uint32_t slot_id)
    620 {
     619int hc_disable_slot(xhci_hc_t *hc, xhci_device_t *dev)
     620{
     621        int err;
    621622        assert(hc);
    622         return xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = slot_id);
     623
     624        if ((err = xhci_cmd_sync_inline(hc, DISABLE_SLOT, .slot_id = dev->slot_id))) {
     625                return err;
     626        }
     627
     628        /* Free the device context. */
     629        hc->dcbaa[dev->slot_id] = 0;
     630        if (dev->dev_ctx) {
     631                free32(dev->dev_ctx);
     632                dev->dev_ctx = NULL;
     633        }
     634
     635        /* Mark the slot as invalid. */
     636        dev->slot_id = 0;
     637
     638        return EOK;
    623639}
    624640
     
    654670         * we have to rely on reverse mapping on others. */
    655671        if (!hc->speed_to_psiv[dev->base.speed]) {
    656                 usb_log_error("Device reported an usb speed that cannot be mapped to HC port speed.");
     672                usb_log_error("Device reported an USB speed that cannot be mapped to HC port speed.");
    657673                return EINVAL;
    658674        }
Note: See TracChangeset for help on using the changeset viewer.