Changeset a837544 in mainline
- Timestamp:
- 2011-09-13T12:30:05Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4cbb6e4
- Parents:
- 3822f7c9
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/batch.h
r3822f7c9 ra837544 78 78 char *buffer, 79 79 size_t buffer_size, 80 char setup_buffer[USB_SETUP_PACKET_SIZE],80 uint64_t setup_buffer, 81 81 usbhc_iface_transfer_in_callback_t func_in, 82 82 usbhc_iface_transfer_out_callback_t func_out, -
uspace/lib/usbhost/src/batch.c
r3822f7c9 ra837544 44 44 char *buffer, 45 45 size_t buffer_size, 46 char setup_buffer[USB_SETUP_PACKET_SIZE],46 uint64_t setup_buffer, 47 47 usbhc_iface_transfer_in_callback_t func_in, 48 48 usbhc_iface_transfer_out_callback_t func_out, … … 68 68 instance->error = EOK; 69 69 if (ep && ep->transfer_type == USB_TRANSFER_CONTROL) { 70 assert(setup_buffer); 71 memcpy(instance->setup_buffer, setup_buffer, 70 memcpy(instance->setup_buffer, &setup_buffer, 72 71 USB_SETUP_PACKET_SIZE); 73 72 instance->setup_size = USB_SETUP_PACKET_SIZE; -
uspace/lib/usbhost/src/iface.c
r3822f7c9 ra837544 41 41 static inline int send_batch( 42 42 ddf_fun_t *fun, usb_target_t target, usb_direction_t direction, 43 void *data, size_t size, void *setup_data,43 void *data, size_t size, uint64_t setup_data, 44 44 usbhc_iface_transfer_in_callback_t in, 45 45 usbhc_iface_transfer_out_callback_t out, void *arg, const char* name) … … 236 236 { 237 237 return send_batch(fun, target, USB_DIRECTION_OUT, data, size, 238 NULL, NULL, callback, arg, "Interrupt OUT");238 0, NULL, callback, arg, "Interrupt OUT"); 239 239 } 240 240 /*----------------------------------------------------------------------------*/ … … 254 254 { 255 255 return send_batch(fun, target, USB_DIRECTION_IN, data, size, 256 NULL, callback, NULL, arg, "Interrupt IN");256 0, callback, NULL, arg, "Interrupt IN"); 257 257 } 258 258 /*----------------------------------------------------------------------------*/ … … 272 272 { 273 273 return send_batch(fun, target, USB_DIRECTION_OUT, data, size, 274 NULL, NULL, callback, arg, "Bulk OUT");274 0, NULL, callback, arg, "Bulk OUT"); 275 275 } 276 276 /*----------------------------------------------------------------------------*/ … … 290 290 { 291 291 return send_batch(fun, target, USB_DIRECTION_IN, data, size, 292 NULL, callback, NULL, arg, "Bulk IN");292 0, callback, NULL, arg, "Bulk IN"); 293 293 } 294 294 /*----------------------------------------------------------------------------*/ … … 310 310 usbhc_iface_transfer_out_callback_t callback, void *arg) 311 311 { 312 uint64_t setup_buffer; 313 memcpy(&setup_buffer, setup_data, 8); 312 314 return send_batch(fun, target, USB_DIRECTION_BOTH, data, size, 313 setup_ data, NULL, callback, arg, "Control WRITE");315 setup_buffer, NULL, callback, arg, "Control WRITE"); 314 316 } 315 317 /*----------------------------------------------------------------------------*/ … … 331 333 usbhc_iface_transfer_in_callback_t callback, void *arg) 332 334 { 335 uint64_t setup_buffer; 336 memcpy(&setup_buffer, setup_data, 8); 333 337 return send_batch(fun, target, USB_DIRECTION_BOTH, data, size, 334 setup_ data, callback, NULL, arg, "Control READ");338 setup_buffer, callback, NULL, arg, "Control READ"); 335 339 } 336 340 /*----------------------------------------------------------------------------*/ … … 340 344 { 341 345 return send_batch(fun, target, USB_DIRECTION_IN, data, size, 342 &setup_data, callback, NULL, arg, "READ");346 setup_data, callback, NULL, arg, "READ"); 343 347 } 344 348 /*----------------------------------------------------------------------------*/ … … 348 352 { 349 353 return send_batch(fun, target, USB_DIRECTION_OUT, (uint8_t*)data, size, 350 &setup_data, NULL, callback, arg, "WRITE");354 setup_data, NULL, callback, arg, "WRITE"); 351 355 } 352 356 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.