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

Changeset a00ac07 in mainline


Ignore:
Timestamp:
2011-09-13T11:39:48Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
3822f7c9
Parents:
ffe3fe1
Message:

libusbhost: Use static area for setup_buffer

Location:
uspace/lib/usbhost
Files:
3 edited

Legend:

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

    rffe3fe1 ra00ac07  
    4141#include <usb/host/endpoint.h>
    4242
     43#define USB_SETUP_PACKET_SIZE 8
     44
    4345typedef struct usb_transfer_batch usb_transfer_batch_t;
    4446struct usb_transfer_batch {
     
    4951        char *buffer;
    5052        size_t buffer_size;
    51         char *setup_buffer;
     53        char setup_buffer[USB_SETUP_PACKET_SIZE];
    5254        size_t setup_size;
    5355        size_t transfered_size;
     
    7678    char *buffer,
    7779    size_t buffer_size,
    78     char *setup_buffer,
    79     size_t setup_size,
     80    char setup_buffer[USB_SETUP_PACKET_SIZE],
    8081    usbhc_iface_transfer_in_callback_t func_in,
    8182    usbhc_iface_transfer_out_callback_t func_out,
  • uspace/lib/usbhost/src/batch.c

    rffe3fe1 ra00ac07  
    4444    char *buffer,
    4545    size_t buffer_size,
    46     char *setup_buffer,
    47     size_t setup_size,
     46    char setup_buffer[USB_SETUP_PACKET_SIZE],
    4847    usbhc_iface_transfer_in_callback_t func_in,
    4948    usbhc_iface_transfer_out_callback_t func_out,
     
    6261                instance->buffer = buffer;
    6362                instance->buffer_size = buffer_size;
    64                 instance->setup_buffer = setup_buffer;
    65                 instance->setup_size = setup_size;
     63                instance->setup_size = 0;
    6664                instance->fun = fun;
    6765                instance->private_data = private_data;
     
    6967                instance->transfered_size = 0;
    7068                instance->error = EOK;
     69                if (ep && ep->transfer_type == USB_TRANSFER_CONTROL) {
     70                        assert(setup_buffer);
     71                        memcpy(instance->setup_buffer, setup_buffer,
     72                            USB_SETUP_PACKET_SIZE);
     73                        instance->setup_size = USB_SETUP_PACKET_SIZE;
     74                }
    7175                if (instance->ep)
    7276                        endpoint_use(instance->ep);
  • uspace/lib/usbhost/src/iface.c

    rffe3fe1 ra00ac07  
    7878        /* No private data and no private data dtor */
    7979        usb_transfer_batch_t *batch =
    80             usb_transfer_batch_get(ep, data, size, setup_data, setup_size,
     80            usb_transfer_batch_get(ep, data, size, setup_data,
    8181            in, out, arg, fun, NULL, NULL);
    8282        if (!batch) {
Note: See TracChangeset for help on using the changeset viewer.