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

Changeset 1ea0bbf in mainline


Ignore:
Timestamp:
2017-12-18T14:47:57Z (4 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master
Children:
32fb6bce
Parents:
6a1211c
Message:

usbdiag: addressing endpoints by their numbers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbdiag/device.c

    r6a1211c r1ea0bbf  
    4444#define NAME "usbdiag"
    4545
    46 static const usb_endpoint_description_t bulk_in_ep = {
    47         .transfer_type = USB_TRANSFER_BULK,
    48         .direction = USB_DIRECTION_IN,
    49         .interface_class = 0xDC,
    50         .interface_subclass = 0x00,
    51         .interface_protocol = 0x01,
    52         .flags = 0
    53 };
     46#define EP_DIR_OUT    0
     47#define EP_DIR_IN     0x80
     48#define EP_INT_IN     (EP_DIR_IN | 0x01)
     49#define EP_INT_OUT    (EP_DIR_OUT | 0x02)
     50#define EP_BULK_IN    (EP_DIR_IN | 0x03)
     51#define EP_BULK_OUT   (EP_DIR_OUT | 0x04)
     52#define EP_ISOC_IN    (EP_DIR_IN | 0x05)
     53#define EP_ISOC_OUT   (EP_DIR_OUT | 0x06)
    5454
    55 static const usb_endpoint_description_t bulk_out_ep = {
    56         .transfer_type = USB_TRANSFER_BULK,
    57         .direction = USB_DIRECTION_OUT,
    58         .interface_class = 0xDC,
    59         .interface_subclass = 0x00,
    60         .interface_protocol = 0x01,
    61         .flags = 0
    62 };
    6355
    6456static int some_test(ddf_fun_t *fun, int x, int *y)
     
    122114        dev->fun = fun;
    123115
    124         usb_endpoint_mapping_t *epm_out = usb_device_get_mapped_ep_desc(dev->usb_dev, &bulk_out_ep);
    125         usb_endpoint_mapping_t *epm_in = usb_device_get_mapped_ep_desc(dev->usb_dev, &bulk_in_ep);
     116        usb_endpoint_mapping_t *epm_out = usb_device_get_mapped_ep(dev->usb_dev, EP_BULK_OUT);
     117        usb_endpoint_mapping_t *epm_in = usb_device_get_mapped_ep(dev->usb_dev, EP_BULK_IN);
    126118
    127119        if (!epm_in || !epm_out || !epm_in->present || !epm_out->present) {
Note: See TracChangeset for help on using the changeset viewer.