Changeset f18d82f0 in mainline
- Timestamp:
- 2011-08-31T21:45:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c10e51
- Parents:
- 70fb822
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/uhci_batch.c
r70fb822 rf18d82f0 66 66 assert(uhci_batch); 67 67 assert(uhci_batch->usb_batch); 68 /* Copy data unless we are sure we sent it */ 69 if (uhci_batch->usb_batch->ep->direction != USB_DIRECTION_OUT) { 70 memcpy(uhci_batch->usb_batch->buffer, 71 uhci_transfer_batch_data_buffer(uhci_batch), 72 uhci_batch->usb_batch->buffer_size); 73 } 74 if (uhci_batch->usb_batch->callback_out) 75 usb_transfer_batch_call_out(uhci_batch->usb_batch); 76 if (uhci_batch->usb_batch->callback_in) 77 usb_transfer_batch_call_in(uhci_batch->usb_batch); 68 usb_transfer_batch_finish(uhci_batch->usb_batch, 69 uhci_transfer_batch_data_buffer(uhci_batch), 70 uhci_batch->usb_batch->buffer_size); 78 71 uhci_transfer_batch_dispose(uhci_batch); 79 72 } -
uspace/lib/usbhost/include/usb/host/batch.h
r70fb822 rf18d82f0 90 90 ); 91 91 92 void usb_transfer_batch_finish(usb_transfer_batch_t *instance); 92 void usb_transfer_batch_finish(usb_transfer_batch_t *instance, 93 const void* data, size_t size); 93 94 void usb_transfer_batch_call_in(usb_transfer_batch_t *instance); 94 95 void usb_transfer_batch_call_out(usb_transfer_batch_t *instance); … … 120 121 /*----------------------------------------------------------------------------*/ 121 122 static inline void usb_transfer_batch_finish_error( 122 usb_transfer_batch_t *instance, int error)123 usb_transfer_batch_t *instance, const void* data, size_t size, int error) 123 124 { 124 125 assert(instance); 125 126 instance->error = error; 126 usb_transfer_batch_finish(instance );127 usb_transfer_batch_finish(instance, data, size); 127 128 } 128 129 /*----------------------------------------------------------------------------*/ -
uspace/lib/usbhost/src/batch.c
r70fb822 rf18d82f0 84 84 * 85 85 */ 86 void usb_transfer_batch_finish(usb_transfer_batch_t *instance) 86 void usb_transfer_batch_finish( 87 usb_transfer_batch_t *instance, const void *data, size_t size) 87 88 { 88 89 assert(instance); 89 if (instance->next_step) 90 instance->next_step(instance); 90 assert(instance->ep); 91 /* we care about the data and there are some to copy */ 92 if (instance->ep->direction != USB_DIRECTION_OUT 93 && data) { 94 const size_t min_size = 95 size < instance->buffer_size ? size : instance->buffer_size; 96 memcpy(instance->buffer, data, min_size); 97 } 98 if (instance->callback_out) 99 usb_transfer_batch_call_out(instance); 100 if (instance->callback_in) 101 usb_transfer_batch_call_in(instance); 102 91 103 } 92 104 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.