Changeset 327f147 in mainline for uspace/lib/usbhost/src/bus.c


Ignore:
Timestamp:
2017-10-23T19:03:37Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b724494
Parents:
e160bfe8
Message:

usbhost: change parameters of methods

Pass (device_t, usb_target_t) to read and write, which finally allows to drop hash tables and access device right away. Then, all callbacks to complete transfer now uses usb_transfer_batch. This requires libdrv to include libusbhost, but it is not linked against it - it is there only to share definition of usb_transfer_batch_t.

File:
1 edited

Legend:

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

    re160bfe8 r327f147  
    9999}
    100100
    101 int bus_remove_ep(bus_t *bus, usb_target_t target, usb_direction_t dir)
    102 {
    103         assert(bus);
    104         endpoint_t *ep = bus_find_endpoint(bus, target, dir);
     101int bus_remove_ep(bus_t *bus, device_t *dev, usb_target_t target, usb_direction_t dir)
     102{
     103        assert(bus);
     104        endpoint_t *ep = bus_find_endpoint(bus, dev, target, dir);
    105105        if (!ep)
    106106                return ENOENT;
     
    200200/** Searches for an endpoint. Returns a reference.
    201201 */
    202 endpoint_t *bus_find_endpoint(bus_t *bus, usb_target_t target, usb_direction_t dir)
    203 {
    204         assert(bus);
    205 
    206         fibril_mutex_lock(&bus->guard);
    207         endpoint_t *ep = bus->ops.find_endpoint(bus, target, dir);
     202endpoint_t *bus_find_endpoint(bus_t *bus, device_t *device, usb_target_t endpoint, usb_direction_t dir)
     203{
     204        assert(bus);
     205
     206        fibril_mutex_lock(&bus->guard);
     207        endpoint_t *ep = bus->ops.find_endpoint(bus, device, endpoint, dir);
    208208        if (ep) {
    209209                /* Exporting reference */
Note: See TracChangeset for help on using the changeset viewer.