Changeset 4e9ecf4 in mainline
- Timestamp:
- 2011-08-31T22:58:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a790ad1
- Parents:
- 9c10e51
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/batch.h
r9c10e51 r4e9ecf4 44 44 struct usb_transfer_batch { 45 45 endpoint_t *ep; 46 link_t link;47 46 usbhc_iface_transfer_in_callback_t callback_in; 48 47 usbhc_iface_transfer_out_callback_t callback_out; 49 48 void *arg; 50 49 char *buffer; 51 char *data_buffer;52 50 size_t buffer_size; 53 51 char *setup_buffer; 54 52 size_t setup_size; 55 53 size_t transfered_size; 56 void (*next_step)(usb_transfer_batch_t *);57 54 int error; 58 55 ddf_fun_t *fun; … … 78 75 endpoint_t *ep, 79 76 char *buffer, 80 char *data_buffer,81 77 size_t buffer_size, 82 78 char *setup_buffer, … … 127 123 usb_transfer_batch_finish(instance, data, size); 128 124 } 129 /*----------------------------------------------------------------------------*/130 static inline usb_transfer_batch_t *usb_transfer_batch_from_link(link_t *l)131 {132 assert(l);133 return list_get_instance(l, usb_transfer_batch_t, link);134 }135 136 125 #endif 137 126 /** -
uspace/lib/usbhost/src/batch.c
r9c10e51 r4e9ecf4 43 43 endpoint_t *ep, 44 44 char *buffer, 45 char *data_buffer,46 45 size_t buffer_size, 47 46 char *setup_buffer, … … 57 56 usb_transfer_batch_t *instance = malloc(sizeof(usb_transfer_batch_t)); 58 57 if (instance) { 59 link_initialize(&instance->link);60 58 instance->ep = ep; 61 59 instance->callback_in = func_in; … … 63 61 instance->arg = arg; 64 62 instance->buffer = buffer; 65 instance->data_buffer = data_buffer;66 63 instance->buffer_size = buffer_size; 67 64 instance->setup_buffer = setup_buffer; … … 71 68 instance->private_data_dtor = private_data_dtor; 72 69 instance->transfered_size = 0; 73 instance->next_step = NULL;74 70 instance->error = EOK; 75 71 if (instance->ep) … … 113 109 assert(instance); 114 110 assert(instance->callback_in); 115 116 /* We are data in, we need data */117 if (instance->data_buffer && (instance->buffer != instance->data_buffer))118 memcpy(instance->buffer,119 instance->data_buffer, instance->buffer_size);120 111 121 112 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " completed (%zuB): %s.\n", -
uspace/lib/usbhost/src/iface.c
r9c10e51 r4e9ecf4 78 78 /* No private data and no private data dtor */ 79 79 usb_transfer_batch_t *batch = 80 usb_transfer_batch_get(ep, data, NULL, size, setup_data,81 setup_size,in, out, arg, fun, NULL, NULL);80 usb_transfer_batch_get(ep, data, size, setup_data, setup_size, 81 in, out, arg, fun, NULL, NULL); 82 82 if (!batch) { 83 83 return ENOMEM;
Note:
See TracChangeset
for help on using the changeset viewer.