Changeset 327f147 in mainline for uspace/lib/drv/include/usb_iface.h


Ignore:
Timestamp:
2017-10-23T19:03:37Z (7 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/drv/include/usb_iface.h

    re160bfe8 r327f147  
    6464    size_t);
    6565
    66 /** Callback for outgoing transfer. */
    67 typedef void (*usb_iface_transfer_out_callback_t)(int, void *);
     66/** Defined in usb/host/usb_transfer_batch.h */
     67typedef struct usb_transfer_batch usb_transfer_batch_t;
    6868
    69 /** Callback for incoming transfer. */
    70 typedef void (*usb_iface_transfer_in_callback_t)(int, size_t, void *);
     69/** Callback for outgoing transfer - clone of usb_transfer_batch_callback_t */
     70typedef int (*usb_iface_transfer_callback_t)(usb_transfer_batch_t *);
    7171
    7272/** USB device communication interface. */
     
    8484        int (*unregister_endpoint)(ddf_fun_t *, usb_endpoint_desc_t *);
    8585
    86         int (*read)(ddf_fun_t *, usb_endpoint_t, uint64_t, uint8_t *, size_t,
    87             usb_iface_transfer_in_callback_t, void *);
    88         int (*write)(ddf_fun_t *, usb_endpoint_t, uint64_t, const uint8_t *,
    89             size_t, usb_iface_transfer_out_callback_t, void *);
     86        int (*read)(ddf_fun_t *, usb_target_t,
     87                uint64_t, char *, size_t,
     88                usb_iface_transfer_callback_t, void *);
     89        int (*write)(ddf_fun_t *, usb_target_t,
     90                uint64_t, const char *, size_t,
     91                usb_iface_transfer_callback_t, void *);
    9092} usb_iface_t;
    9193
Note: See TracChangeset for help on using the changeset viewer.