Changeset 4e732f1a in mainline for uspace/lib/usbhost/src


Ignore:
Timestamp:
2014-01-24T02:10:16Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
42de21a
Parents:
3de7a62
Message:

usb: Add support for multiple packets per microframe.

Location:
uspace/lib/usbhost/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/ddf_helpers.c

    r3de7a62 r4e732f1a  
    110110    ddf_fun_t *fun, usb_endpoint_t endpoint,
    111111    usb_transfer_type_t transfer_type, usb_direction_t direction,
    112     size_t max_packet_size, unsigned interval)
     112    size_t max_packet_size, unsigned packets, unsigned interval)
    113113{
    114114        assert(fun);
     
    126126
    127127        return hcd_add_ep(hcd, target, direction, transfer_type,
    128             max_packet_size, size, dev->tt_address, dev->port);
     128            max_packet_size, packets, size, dev->tt_address, dev->port);
    129129}
    130130
     
    491491        ret = hcd_add_ep(hcd,
    492492            default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    493             CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE,
     493            CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 1,
    494494            tt_address, port);
    495495
     
    517517        /* Register EP on the new address */
    518518        ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    519             desc.max_packet_size, desc.max_packet_size, tt_address, port);
     519            ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)),
     520            ED_MPS_TRANS_OPPORTUNITIES_GET(uint16_usb2host(desc.max_packet_size)),
     521            ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)),
     522            tt_address, port);
    520523        if (ret != EOK) {
    521524                hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
  • uspace/lib/usbhost/src/endpoint.c

    r3de7a62 r4e732f1a  
    5050endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    5151    usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    52     size_t max_packet_size, size_t bw, usb_address_t tt_address, unsigned tt_p)
     52    size_t max_packet_size, unsigned packets, size_t bw,
     53    usb_address_t tt_address, unsigned tt_p)
    5354{
    5455        endpoint_t *instance = malloc(sizeof(endpoint_t));
     
    6061                instance->speed = speed;
    6162                instance->max_packet_size = max_packet_size;
     63                instance->packets = packets;
    6264                instance->bandwidth = bw;
    6365                instance->toggle = 0;
  • uspace/lib/usbhost/src/hcd.c

    r3de7a62 r4e732f1a  
    132132
    133133int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,
    134     usb_transfer_type_t type, size_t max_packet_size, size_t size,
    135     usb_address_t tt_address, unsigned tt_port)
     134    usb_transfer_type_t type, size_t max_packet_size, unsigned packets,
     135    size_t size, usb_address_t tt_address, unsigned tt_port)
    136136{
    137137        assert(hcd);
    138138        return usb_bus_add_ep(&hcd->bus, target.address,
    139             target.endpoint, dir, type, max_packet_size, size, register_helper,
    140             hcd, tt_address, tt_port);
     139            target.endpoint, dir, type, max_packet_size, packets, size,
     140            register_helper, hcd, tt_address, tt_port);
    141141}
    142142
  • uspace/lib/usbhost/src/usb_bus.c

    r3de7a62 r4e732f1a  
    301301int usb_bus_add_ep(usb_bus_t *instance,
    302302    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction,
    303     usb_transfer_type_t type, size_t max_packet_size, size_t data_size,
    304     ep_add_callback_t callback, void *arg, usb_address_t tt_address,
    305     unsigned tt_port)
     303    usb_transfer_type_t type, size_t max_packet_size, unsigned packets,
     304    size_t data_size, ep_add_callback_t callback, void *arg,
     305    usb_address_t tt_address, unsigned tt_port)
    306306{
    307307        assert(instance);
     
    337337
    338338        ep = endpoint_create(address, endpoint, direction, type, speed,
    339             max_packet_size, bw, tt_address, tt_port);
     339            max_packet_size, packets, bw, tt_address, tt_port);
    340340        if (!ep) {
    341341                fibril_mutex_unlock(&instance->guard);
Note: See TracChangeset for help on using the changeset viewer.