Changeset 5620bd4 in mainline for uspace/drv/uhci-hcd/batch.c
- Timestamp:
- 2011-03-06T18:38:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57c0a7e
- Parents:
- 98807e16
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
r98807e16 r5620bd4 49 49 static void batch_control(batch_t *instance, 50 50 usb_packet_id data_stage, usb_packet_id status_stage); 51 static void batch_data(batch_t *instance, usb_packet_id pid , device_keeper_t *keeper);51 static void batch_data(batch_t *instance, usb_packet_id pid); 52 52 static void batch_call_in(batch_t *instance); 53 53 static void batch_call_out(batch_t *instance); … … 61 61 char* setup_buffer, size_t setup_size, 62 62 usbhc_iface_transfer_in_callback_t func_in, 63 usbhc_iface_transfer_out_callback_t func_out, void *arg) 63 usbhc_iface_transfer_out_callback_t func_out, void *arg, 64 device_keeper_t *manager 65 ) 64 66 { 65 67 assert(func_in == NULL || func_out == NULL); … … 137 139 instance->arg = arg; 138 140 instance->speed = speed; 141 instance->manager = manager; 139 142 140 143 queue_head_element_td(instance->qh, addr_to_phys(instance->tds)); … … 194 197 } 195 198 /*----------------------------------------------------------------------------*/ 196 void batch_interrupt_in(batch_t *instance , device_keeper_t *keeper)197 { 198 assert(instance); 199 batch_data(instance, USB_PID_IN , keeper);199 void batch_interrupt_in(batch_t *instance) 200 { 201 assert(instance); 202 batch_data(instance, USB_PID_IN); 200 203 instance->next_step = batch_call_in_and_dispose; 201 204 usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance); … … 203 206 } 204 207 /*----------------------------------------------------------------------------*/ 205 void batch_interrupt_out(batch_t *instance , device_keeper_t *keeper)208 void batch_interrupt_out(batch_t *instance) 206 209 { 207 210 assert(instance); 208 211 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 209 batch_data(instance, USB_PID_OUT , keeper);212 batch_data(instance, USB_PID_OUT); 210 213 instance->next_step = batch_call_out_and_dispose; 211 214 usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance); … … 213 216 } 214 217 /*----------------------------------------------------------------------------*/ 215 void batch_bulk_in(batch_t *instance , device_keeper_t *keeper)216 { 217 assert(instance); 218 batch_data(instance, USB_PID_IN , keeper);218 void batch_bulk_in(batch_t *instance) 219 { 220 assert(instance); 221 batch_data(instance, USB_PID_IN); 219 222 instance->next_step = batch_call_in_and_dispose; 220 223 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); … … 222 225 } 223 226 /*----------------------------------------------------------------------------*/ 224 void batch_bulk_out(batch_t *instance , device_keeper_t *keeper)227 void batch_bulk_out(batch_t *instance) 225 228 { 226 229 assert(instance); 227 230 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 228 batch_data(instance, USB_PID_OUT , keeper);231 batch_data(instance, USB_PID_OUT); 229 232 instance->next_step = batch_call_out_and_dispose; 230 233 usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance); … … 232 235 } 233 236 /*----------------------------------------------------------------------------*/ 234 void batch_data(batch_t *instance, usb_packet_id pid , device_keeper_t *keeper)237 void batch_data(batch_t *instance, usb_packet_id pid) 235 238 { 236 239 assert(instance); 237 240 const bool low_speed = instance->speed == USB_SPEED_LOW; 238 int toggle = device_keeper_get_toggle( keeper, instance->target);241 int toggle = device_keeper_get_toggle(instance->manager, instance->target); 239 242 assert(toggle == 0 || toggle == 1); 240 243 … … 262 265 remain_size -= packet_size; 263 266 } 264 device_keeper_set_toggle( keeper, instance->target, toggle);267 device_keeper_set_toggle(instance->manager, instance->target, toggle); 265 268 266 269 instance->tds[packet - 1].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
Note:
See TracChangeset
for help on using the changeset viewer.