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

Changeset a837544 in mainline


Ignore:
Timestamp:
2011-09-13T12:30:05Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
4cbb6e4
Parents:
3822f7c9
Message:

libusbhost: Use uint64_t to pass setup_data

Location:
uspace/lib/usbhost
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/batch.h

    r3822f7c9 ra837544  
    7878    char *buffer,
    7979    size_t buffer_size,
    80     char setup_buffer[USB_SETUP_PACKET_SIZE],
     80    uint64_t setup_buffer,
    8181    usbhc_iface_transfer_in_callback_t func_in,
    8282    usbhc_iface_transfer_out_callback_t func_out,
  • uspace/lib/usbhost/src/batch.c

    r3822f7c9 ra837544  
    4444    char *buffer,
    4545    size_t buffer_size,
    46     char setup_buffer[USB_SETUP_PACKET_SIZE],
     46    uint64_t setup_buffer,
    4747    usbhc_iface_transfer_in_callback_t func_in,
    4848    usbhc_iface_transfer_out_callback_t func_out,
     
    6868                instance->error = EOK;
    6969                if (ep && ep->transfer_type == USB_TRANSFER_CONTROL) {
    70                         assert(setup_buffer);
    71                         memcpy(instance->setup_buffer, setup_buffer,
     70                        memcpy(instance->setup_buffer, &setup_buffer,
    7271                            USB_SETUP_PACKET_SIZE);
    7372                        instance->setup_size = USB_SETUP_PACKET_SIZE;
  • uspace/lib/usbhost/src/iface.c

    r3822f7c9 ra837544  
    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,
     43    void *data, size_t size, uint64_t 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, NULL, callback, arg, "Interrupt OUT");
     238            0, NULL, callback, arg, "Interrupt OUT");
    239239}
    240240/*----------------------------------------------------------------------------*/
     
    254254{
    255255        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
    256             NULL, callback, NULL, arg, "Interrupt IN");
     256            0, callback, NULL, arg, "Interrupt IN");
    257257}
    258258/*----------------------------------------------------------------------------*/
     
    272272{
    273273        return send_batch(fun, target, USB_DIRECTION_OUT, data, size,
    274             NULL, NULL, callback, arg, "Bulk OUT");
     274            0, NULL, callback, arg, "Bulk OUT");
    275275}
    276276/*----------------------------------------------------------------------------*/
     
    290290{
    291291        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
    292             NULL, callback, NULL, arg, "Bulk IN");
     292            0, callback, NULL, arg, "Bulk IN");
    293293}
    294294/*----------------------------------------------------------------------------*/
     
    310310    usbhc_iface_transfer_out_callback_t callback, void *arg)
    311311{
     312        uint64_t setup_buffer;
     313        memcpy(&setup_buffer, setup_data, 8);
    312314        return send_batch(fun, target, USB_DIRECTION_BOTH, data, size,
    313             setup_data, NULL, callback, arg, "Control WRITE");
     315            setup_buffer, NULL, callback, arg, "Control WRITE");
    314316}
    315317/*----------------------------------------------------------------------------*/
     
    331333    usbhc_iface_transfer_in_callback_t callback, void *arg)
    332334{
     335        uint64_t setup_buffer;
     336        memcpy(&setup_buffer, setup_data, 8);
    333337        return send_batch(fun, target, USB_DIRECTION_BOTH, data, size,
    334             setup_data, callback, NULL, arg, "Control READ");
     338            setup_buffer, callback, NULL, arg, "Control READ");
    335339}
    336340/*----------------------------------------------------------------------------*/
     
    340344{
    341345        return send_batch(fun, target, USB_DIRECTION_IN, data, size,
    342             &setup_data, callback, NULL, arg, "READ");
     346            setup_data, callback, NULL, arg, "READ");
    343347}
    344348/*----------------------------------------------------------------------------*/
     
    348352{
    349353        return send_batch(fun, target, USB_DIRECTION_OUT, (uint8_t*)data, size,
    350             &setup_data, NULL, callback, arg, "WRITE");
     354            setup_data, NULL, callback, arg, "WRITE");
    351355}
    352356/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.