Changeset 56db65d in mainline for uspace/lib/usbhost/src/bus.c


Ignore:
Timestamp:
2017-10-24T11:06:32Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0206d35
Parents:
894f58c
Message:

usbhost: provide usb_endpoint_desc_t to bus when registering endpoint

This finishes the path of arbitrary information fetched from device all the way down to registering the endpoint in the bus.

File:
1 edited

Legend:

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

    r894f58c r56db65d  
    6666}
    6767
    68 int bus_add_ep(bus_t *bus, device_t *device, usb_endpoint_t endpoint,
    69     usb_direction_t dir, usb_transfer_type_t type, size_t max_packet_size,
    70     unsigned packets, size_t size)
     68int bus_add_ep(bus_t *bus, device_t *device, const usb_endpoint_desc_t *desc)
    7169{
    7270        assert(bus);
     
    7876                return ENOMEM;
    7977
    80         ep->target = (usb_target_t) {
    81                 .address = device->address,
    82                 .endpoint = endpoint,
    83         };
    84 
    8578        ep->device = device;
    86         ep->direction = dir;
    87         ep->transfer_type = type;
    88         ep->max_packet_size = max_packet_size;
    89         ep->packets = packets;
    90 
    91         ep->bandwidth = bus_count_bw(ep, size);
    92 
    93         const int err = bus_register_endpoint(bus, ep);
     79        const int err = bus_register_endpoint(bus, ep, desc);
    9480
    9581        /* drop Temporary reference */
     
    165151}
    166152
    167 int bus_register_endpoint(bus_t *bus, endpoint_t *ep)
     153int bus_register_endpoint(bus_t *bus, endpoint_t *ep, const usb_endpoint_desc_t *desc)
    168154{
    169155        assert(bus);
     
    174160
    175161        fibril_mutex_lock(&bus->guard);
    176         const int r = bus->ops.register_endpoint(bus, ep);
     162        const int r = bus->ops.register_endpoint(bus, ep, desc);
    177163        fibril_mutex_unlock(&bus->guard);
    178164
Note: See TracChangeset for help on using the changeset viewer.