Changeset 306a36d in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2017-11-19T23:43:31Z (6 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ff14aede
Parents:
e76c0ea
Message:

xhci: configuration of endpoint 0

Moved fetching of the first 8B of device descriptor from usb2_bus to
hcd, and using it in xhci bus. Also, the value was previously read wrong
by the endpoint descriptor macros, although the value is raw in the
device descriptor - now fixed.

File:
1 edited

Legend:

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

    re76c0ea r306a36d  
    651651}
    652652
    653 // TODO: This currently assumes the device is attached to rh directly
    654 //      -> calculate route string
    655653int hc_address_device(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *ep0)
    656654{
     
    767765}
    768766
     767int hc_update_endpoint(xhci_hc_t *hc, uint32_t slot_id, uint8_t ep_idx, xhci_ep_ctx_t *ep_ctx)
     768{
     769        dma_buffer_t ictx_dma_buf;
     770        const int err = dma_buffer_alloc(&ictx_dma_buf, sizeof(xhci_input_ctx_t));
     771        if (err)
     772                return err;
     773
     774        xhci_input_ctx_t *ictx = ictx_dma_buf.virt;
     775        memset(ictx, 0, sizeof(xhci_input_ctx_t));
     776
     777        XHCI_INPUT_CTRL_CTX_ADD_SET(ictx->ctrl_ctx, ep_idx + 1);
     778        memcpy(&ictx->endpoint_ctx[ep_idx], ep_ctx, sizeof(xhci_ep_ctx_t));
     779
     780        return xhci_cmd_sync_inline(hc, EVALUATE_CONTEXT, .slot_id = slot_id, .input_ctx = ictx_dma_buf);
     781}
     782
    769783/**
    770784 * @}
Note: See TracChangeset for help on using the changeset viewer.