Changeset e9e24f2 in mainline


Ignore:
Timestamp:
2017-10-05T17:17:09Z (7 years ago)
Author:
Michal Staruch <salmelu@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ae03552e
Parents:
078e0e6
Message:

Basic commands transfer implementation

Location:
uspace
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/Makefile

    r078e0e6 re9e24f2  
    5151        scratchpad.c \
    5252        commands.c \
     53        transfers.c \
    5354        rh.c \
    5455        main.c
  • uspace/drv/bus/usb/xhci/hc.c

    r078e0e6 re9e24f2  
    4343#include "hw_struct/trb.h"
    4444#include "commands.h"
     45#include "transfers.h"
     46#include "trb_ring.h"
    4547
    4648/**
     
    457459        switch (batch->ep->transfer_type) {
    458460        case USB_TRANSFER_CONTROL:
    459                 /* TODO: Send setup stage TRB. */
    460                 /* TODO: Optionally, send data stage TRB followed by zero or
    461                          more normal TRB's. */
    462                 /* TODO: Send status stage TRB. */
    463                 /* TODO: Ring the appropriate doorbell. */
     461                xhci_schedule_control_transfer(hc, batch);
    464462                break;
    465463        case USB_TRANSFER_ISOCHRONOUS:
     
    482480        [XHCI_TRB_TYPE_COMMAND_COMPLETION_EVENT] = &xhci_handle_command_completion,
    483481        [XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT] = &xhci_handle_port_status_change_event,
     482        [XHCI_TRB_TYPE_TRANSFER_EVENT] = &xhci_handle_transfer_event,
    484483};
    485484
  • uspace/drv/bus/usb/xhci/hc.h

    r078e0e6 re9e24f2  
    7878        /* Command list */
    7979        list_t commands;
     80        list_t transfers;
    8081} xhci_hc_t;
    8182
  • uspace/drv/bus/usb/xhci/hw_struct/trb.h

    r078e0e6 re9e24f2  
    100100#define TRB_CYCLE(trb)          XHCI_DWORD_EXTRACT((trb).control, 0, 0)
    101101#define TRB_LINK_TC(trb)        XHCI_DWORD_EXTRACT((trb).control, 1, 1)
     102
     103#define TRB_TRANSFER_LENGTH(trb)        XHCI_DWORD_EXTRACT((trb).status, 23, 0)
     104#define TRB_COMPLETION_CODE(trb)        XHCI_DWORD_EXTRACT((trb).status, 31, 24)
    102105
    103106#define TRB_CTRL_SET_SETUP_WLENGTH(trb, val) \
  • uspace/drv/bus/usb/xhci/rh.c

    r078e0e6 re9e24f2  
    4444#include "hw_struct/trb.h"
    4545#include "rh.h"
     46#include "transfers.h"
    4647
    4748#define USB_MAP_VALUE(a, b) [USB_HUB_FEATURE_##a] = b
  • uspace/lib/usbhost/include/usb/host/endpoint.h

    r078e0e6 re9e24f2  
    4545typedef struct endpoint {
    4646        /** Reference count. */
    47         atomic_t refcnt;       
     47        atomic_t refcnt;
    4848        /** Part of linked list. */
    4949        link_t link;
     
    8585                /** Callback to set the value of toggle bit. */
    8686                void (*toggle_set)(void *, int);
     87                /** Device slot id. */
     88                uint8_t slot_id;
    8789        } hc_data;
    8890} endpoint_t;
Note: See TracChangeset for help on using the changeset viewer.