Changeset 2cf28b9 in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2017-10-25T15:22:45Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
62558202
Parents:
f668d60
Message:

xhci: connecting devices deeper than to roothub

It still does not work, because the address command fails, but there should not be any fundamental problem.

File:
1 edited

Legend:

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

    rf668d60 r2cf28b9  
    657657        int err = ENOMEM;
    658658
     659        /* Although we have the precise PSIV value on devices of tier 1,
     660         * we have to rely on reverse mapping on others. */
     661        if (!hc->speed_to_psiv[dev->base.speed]) {
     662                usb_log_error("Device reported an usb speed that cannot be mapped to HC port speed.");
     663                return EINVAL;
     664        }
     665
    659666        /* Setup and register device context */
    660667        dev->dev_ctx = malloc32(sizeof(xhci_device_ctx_t));
     
    672679
    673680        /* Initialize slot_ctx according to section 4.3.3 point 3. */
    674         XHCI_SLOT_ROOT_HUB_PORT_SET(ictx->slot_ctx, dev->base.port); // FIXME: This should be port at RH
     681        XHCI_SLOT_ROOT_HUB_PORT_SET(ictx->slot_ctx, dev->rh_port);
    675682        XHCI_SLOT_CTX_ENTRIES_SET(ictx->slot_ctx, 1);
    676 
    677         /* Attaching to root hub port, root string equals to 0. */
    678         XHCI_SLOT_ROUTE_STRING_SET(ictx->slot_ctx, 0); // FIXME: This is apparently valid in limited cases
     683        XHCI_SLOT_ROUTE_STRING_SET(ictx->slot_ctx, dev->route_str);
     684        XHCI_SLOT_SPEED_SET(ictx->slot_ctx, hc->speed_to_psiv[dev->base.speed]);
     685
     686        /* In a very specific case, we have to set also these. But before that,
     687         * we need to refactor how TT is handled in libusbhost. */
     688        XHCI_SLOT_TT_HUB_SLOT_ID_SET(ictx->slot_ctx, 0);
     689        XHCI_SLOT_TT_HUB_PORT_SET(ictx->slot_ctx, 0);
     690        XHCI_SLOT_MTT_SET(ictx->slot_ctx, 0);
    679691
    680692        /* Copy endpoint 0 context and set A1 flag. */
Note: See TracChangeset for help on using the changeset viewer.