Changeset a00ac07 in mainline
- Timestamp:
- 2011-09-13T11:39:48Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3822f7c9
- Parents:
- ffe3fe1
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/batch.h
rffe3fe1 ra00ac07 41 41 #include <usb/host/endpoint.h> 42 42 43 #define USB_SETUP_PACKET_SIZE 8 44 43 45 typedef struct usb_transfer_batch usb_transfer_batch_t; 44 46 struct usb_transfer_batch { … … 49 51 char *buffer; 50 52 size_t buffer_size; 51 char *setup_buffer;53 char setup_buffer[USB_SETUP_PACKET_SIZE]; 52 54 size_t setup_size; 53 55 size_t transfered_size; … … 76 78 char *buffer, 77 79 size_t buffer_size, 78 char *setup_buffer, 79 size_t setup_size, 80 char setup_buffer[USB_SETUP_PACKET_SIZE], 80 81 usbhc_iface_transfer_in_callback_t func_in, 81 82 usbhc_iface_transfer_out_callback_t func_out, -
uspace/lib/usbhost/src/batch.c
rffe3fe1 ra00ac07 44 44 char *buffer, 45 45 size_t buffer_size, 46 char *setup_buffer, 47 size_t setup_size, 46 char setup_buffer[USB_SETUP_PACKET_SIZE], 48 47 usbhc_iface_transfer_in_callback_t func_in, 49 48 usbhc_iface_transfer_out_callback_t func_out, … … 62 61 instance->buffer = buffer; 63 62 instance->buffer_size = buffer_size; 64 instance->setup_buffer = setup_buffer; 65 instance->setup_size = setup_size; 63 instance->setup_size = 0; 66 64 instance->fun = fun; 67 65 instance->private_data = private_data; … … 69 67 instance->transfered_size = 0; 70 68 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 } 71 75 if (instance->ep) 72 76 endpoint_use(instance->ep); -
uspace/lib/usbhost/src/iface.c
rffe3fe1 ra00ac07 78 78 /* No private data and no private data dtor */ 79 79 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, 81 81 in, out, arg, fun, NULL, NULL); 82 82 if (!batch) {
Note:
See TracChangeset
for help on using the changeset viewer.