Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a6a5b25 in mainline


Ignore:
Timestamp:
2013-01-26T22:15:54Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
3e23316
Parents:
b06d35a
Message:

libusbdev: Add searching for pipes using ep and ep description.

Location:
uspace/lib/usbdev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/driver.h

    rb06d35a ra6a5b25  
    160160
    161161usb_pipe_t *usb_device_get_default_pipe(usb_device_t *);
    162 usb_pipe_t *usb_device_get_pipe(usb_device_t *, usb_endpoint_t, usb_direction_t);
     162usb_endpoint_mapping_t * usb_device_get_mapped_ep_desc(usb_device_t *,
     163    const usb_endpoint_description_t *);
     164usb_endpoint_mapping_t * usb_device_get_mapped_ep(usb_device_t *,
     165    usb_endpoint_t);
    163166
    164167int usb_device_get_iface_number(usb_device_t *);
  • uspace/lib/usbdev/src/devdrv.c

    rb06d35a ra6a5b25  
    262262}
    263263
     264usb_endpoint_mapping_t *usb_device_get_mapped_ep_desc(usb_device_t *usb_dev,
     265    const usb_endpoint_description_t *desc)
     266{
     267        assert(usb_dev);
     268        for (unsigned i = 0; i < usb_dev->pipes_count; ++i) {
     269                if (usb_dev->pipes[i].description == desc)
     270                        return &usb_dev->pipes[i];
     271        }
     272        return NULL;
     273}
     274
     275usb_endpoint_mapping_t * usb_device_get_mapped_ep(
     276    usb_device_t *usb_dev, usb_endpoint_t ep)
     277{
     278        assert(usb_dev);
     279        for (unsigned i = 0; i < usb_dev->pipes_count; ++i) {
     280                if (usb_dev->pipes[i].pipe.endpoint_no == ep)
     281                        return &usb_dev->pipes[i];
     282        }
     283        return NULL;
     284}
     285
    264286int usb_device_get_iface_number(usb_device_t *usb_dev)
    265287{
Note: See TracChangeset for help on using the changeset viewer.