Changeset b4b534ac in mainline for uspace/lib/usbhost/src/usb_transfer_batch.c
- Timestamp:
- 2016-07-22T08:24:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f76d2c2
- Parents:
- 5b18137 (diff), 8351f9a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_transfer_batch.c
r5b18137 rb4b534ac 32 32 * USB transfer transaction structures (implementation). 33 33 */ 34 35 #include <usb/host/usb_transfer_batch.h> 36 #include <usb/debug.h> 37 38 #include <assert.h> 34 39 #include <errno.h> 35 40 #include <macros.h> 36 37 #include <usb/usb.h> 38 #include <usb/debug.h> 39 40 #include <usb/host/usb_transfer_batch.h> 41 #include <usb/host/hcd.h> 41 #include <mem.h> 42 #include <stdlib.h> 43 #include <usbhc_iface.h> 42 44 43 45 /** Allocate and initialize usb_transfer_batch structure. … … 61 63 usbhc_iface_transfer_in_callback_t func_in, 62 64 usbhc_iface_transfer_out_callback_t func_out, 63 void *arg, 64 ddf_fun_t *fun, 65 void *private_data, 66 void (*private_data_dtor)(void *) 65 void *arg 67 66 ) 68 67 { … … 81 80 instance->buffer_size = buffer_size; 82 81 instance->setup_size = 0; 83 instance->fun = fun;84 instance->private_data = private_data;85 instance->private_data_dtor = private_data_dtor;86 82 instance->transfered_size = 0; 87 83 instance->error = EOK; … … 110 106 endpoint_release(instance->ep); 111 107 } 112 if (instance->private_data) {113 assert(instance->private_data_dtor);114 instance->private_data_dtor(instance->private_data);115 }116 108 free(instance); 117 109 } … … 133 125 /* NOTE: Only one of these pointers should be set. */ 134 126 if (instance->callback_out) { 135 /* Check for commands that reset toggle bit */ 136 if (instance->ep->transfer_type == USB_TRANSFER_CONTROL 137 && error == EOK) { 138 const usb_target_t target = 139 {{ instance->ep->address, instance->ep->endpoint }}; 140 reset_ep_if_need(fun_to_hcd(instance->fun), target, 141 instance->setup_buffer); 142 } 143 instance->callback_out(instance->fun, error, instance->arg); 127 instance->callback_out(error, instance->arg); 144 128 } 145 129 … … 150 134 memcpy(instance->buffer, data, safe_size); 151 135 } 152 instance->callback_in(instance->fun, error, 153 safe_size, instance->arg); 136 instance->callback_in(error, safe_size, instance->arg); 154 137 } 155 138 }
Note:
See TracChangeset
for help on using the changeset viewer.