Changeset feb10c88 in mainline
- Timestamp:
- 2011-04-07T14:35:08Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e6bbcf
- Parents:
- 8f30c2e
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
r8f30c2e rfeb10c88 80 80 * transaction and callback. 81 81 */ 82 usb_transfer_batch_t * batch_get(ddf_fun_t *fun, usb_target_t target, 83 usb_transfer_type_t transfer_type, size_t max_packet_size, 84 usb_speed_t speed, char *buffer, size_t buffer_size, 85 char* setup_buffer, size_t setup_size, 82 usb_transfer_batch_t * batch_get(ddf_fun_t *fun, endpoint_t *ep, 83 char *buffer, size_t buffer_size, char* setup_buffer, size_t setup_size, 86 84 usbhc_iface_transfer_in_callback_t func_in, 87 usbhc_iface_transfer_out_callback_t func_out, void *arg, endpoint_t *ep 88 ) 85 usbhc_iface_transfer_out_callback_t func_out, void *arg) 89 86 { 90 87 assert(ep); … … 104 101 CHECK_NULL_DISPOSE_RETURN(instance, 105 102 "Failed to allocate batch instance.\n"); 103 usb_target_t target = 104 { .address = ep->address, .endpoint = ep->endpoint }; 106 105 usb_transfer_batch_init(instance, target, 107 transfer_type, speed,max_packet_size,106 ep->transfer_type, ep->speed, ep->max_packet_size, 108 107 buffer, NULL, buffer_size, NULL, setup_size, func_in, 109 108 func_out, arg, fun, ep, NULL); … … 116 115 instance->private_data = data; 117 116 118 data->transfers = (buffer_size + max_packet_size - 1) / max_packet_size; 119 if (transfer_type == USB_TRANSFER_CONTROL) { 117 data->transfers = 118 (buffer_size + ep->max_packet_size - 1) / ep->max_packet_size; 119 if (ep->transfer_type == USB_TRANSFER_CONTROL) { 120 120 data->transfers += 2; 121 121 } … … 179 179 instance, i, data->tds[i].status); 180 180 td_print_status(&data->tds[i]); 181 if (instance->ep != NULL) 182 endpoint_toggle_set(instance->ep, 183 td_toggle(&data->tds[i])); 181 assert(instance->ep != NULL); 182 183 endpoint_toggle_set(instance->ep, 184 td_toggle(&data->tds[i])); 184 185 if (i > 0) 185 186 goto substract_ret; -
uspace/drv/uhci-hcd/batch.h
r8f30c2e rfeb10c88 44 44 45 45 usb_transfer_batch_t * batch_get( 46 ddf_fun_t *fun, 47 usb_target_t target, 48 usb_transfer_type_t transfer_type, 49 size_t max_packet_size, 50 usb_speed_t speed, 51 char *buffer, 52 size_t size, 53 char *setup_buffer, 54 size_t setup_size, 46 ddf_fun_t *fun, endpoint_t *ep, char *buffer, size_t size, 47 char *setup_buffer, size_t setup_size, 55 48 usbhc_iface_transfer_in_callback_t func_in, 56 49 usbhc_iface_transfer_out_callback_t func_out, 57 void *arg, 58 endpoint_t *ep 59 ); 50 void *arg); 60 51 61 52 void batch_dispose(usb_transfer_batch_t *instance); -
uspace/drv/uhci-hcd/iface.c
r8f30c2e rfeb10c88 244 244 245 245 usb_transfer_batch_t *batch = 246 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 247 ep->speed, data, size, NULL, 0, NULL, callback, arg, ep); 246 batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg); 248 247 if (!batch) 249 248 return ENOMEM; … … 301 300 302 301 usb_transfer_batch_t *batch = 303 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 304 ep->speed, data, size, NULL, 0, callback, NULL, arg, ep); 302 batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg); 305 303 if (!batch) 306 304 return ENOMEM; … … 348 346 349 347 usb_transfer_batch_t *batch = 350 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 351 ep->speed, data, size, NULL, 0, NULL, callback, arg, ep); 348 batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg); 352 349 if (!batch) 353 350 return ENOMEM; … … 394 391 395 392 usb_transfer_batch_t *batch = 396 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 397 ep->speed, data, size, NULL, 0, callback, NULL, arg, ep); 393 batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg); 398 394 if (!batch) 399 395 return ENOMEM; … … 447 443 448 444 usb_transfer_batch_t *batch = 449 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 450 ep->speed, data, size, setup_data, setup_size, NULL, callback, 451 arg, ep); 445 batch_get(fun, ep, data, size, setup_data, setup_size, 446 NULL, callback, arg); 452 447 if (!batch) 453 448 return ENOMEM; … … 499 494 500 495 usb_transfer_batch_t *batch = 501 batch_get(fun, target, ep->transfer_type, ep->max_packet_size, 502 ep->speed, data, size, setup_data, setup_size, 503 callback, NULL, arg, ep); 496 batch_get(fun, ep, data, size, setup_data, setup_size, 497 callback, NULL, arg); 504 498 if (!batch) 505 499 return ENOMEM;
Note:
See TracChangeset
for help on using the changeset viewer.