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

Changeset 3822f7c9 in mainline


Ignore:
Timestamp:
2011-09-13T12:00:16Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
a837544
Parents:
a00ac07
Message:

libusbhost: Remove unused setup_size parameter, implement read/write iface.

File:
1 edited

Legend:

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

    ra00ac07 r3822f7c9  
    4141static inline int send_batch(
    4242    ddf_fun_t *fun, usb_target_t target, usb_direction_t direction,
    43     void *data, size_t size, void * setup_data, size_t setup_size,
     43    void *data, size_t size, void * setup_data,
    4444    usbhc_iface_transfer_in_callback_t in,
    4545    usbhc_iface_transfer_out_callback_t out, void *arg, const char* name)
     
    236236{
    237237        return send_batch(fun, target, USB_DIRECTION_OUT, data, size,
    238             NULL, 0, NULL, callback, arg, "Interrupt OUT");
     238            NULL, NULL, callback, arg, "Interrupt OUT");
    239239}
    240240/*----------------------------------------------------------------------------*/
     
    254254{
    255255        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
    256             NULL, 0, callback, NULL, arg, "Interrupt IN");
     256            NULL, callback, NULL, arg, "Interrupt IN");
    257257}
    258258/*----------------------------------------------------------------------------*/
     
    272272{
    273273        return send_batch(fun, target, USB_DIRECTION_OUT, data, size,
    274             NULL, 0, NULL, callback, arg, "Bulk OUT");
     274            NULL, NULL, callback, arg, "Bulk OUT");
    275275}
    276276/*----------------------------------------------------------------------------*/
     
    290290{
    291291        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
    292             NULL, 0, callback, NULL, arg, "Bulk IN");
     292            NULL, callback, NULL, arg, "Bulk IN");
    293293}
    294294/*----------------------------------------------------------------------------*/
     
    311311{
    312312        return send_batch(fun, target, USB_DIRECTION_BOTH, data, size,
    313             setup_data, setup_size, NULL, callback, arg, "Control WRITE");
     313            setup_data, NULL, callback, arg, "Control WRITE");
    314314}
    315315/*----------------------------------------------------------------------------*/
     
    332332{
    333333        return send_batch(fun, target, USB_DIRECTION_BOTH, data, size,
    334             setup_data, setup_size, callback, NULL, arg, "Control READ");
     334            setup_data, callback, NULL, arg, "Control READ");
     335}
     336/*----------------------------------------------------------------------------*/
     337static int usb_read(ddf_fun_t *fun, usb_target_t target, uint64_t setup_data,
     338    uint8_t *data, size_t size, usbhc_iface_transfer_in_callback_t callback,
     339    void *arg)
     340{
     341        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
     342            &setup_data, callback, NULL, arg, "READ");
     343}
     344/*----------------------------------------------------------------------------*/
     345static int usb_write(ddf_fun_t *fun, usb_target_t target, uint64_t setup_data,
     346    const uint8_t *data, size_t size,
     347    usbhc_iface_transfer_out_callback_t callback, void *arg)
     348{
     349        return send_batch(fun, target, USB_DIRECTION_OUT, (uint8_t*)data, size,
     350            &setup_data, NULL, callback, arg, "WRITE");
    335351}
    336352/*----------------------------------------------------------------------------*/
     
    352368        .control_write = control_write,
    353369        .control_read = control_read,
     370
     371        .read = usb_read,
     372        .write = usb_write,
    354373};
    355374/**
Note: See TracChangeset for help on using the changeset viewer.