Changeset c6fe469 in mainline
- Timestamp:
- 2011-04-10T22:30:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 26d46d2
- Parents:
- 7628050
- Location:
- uspace/drv/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
r7628050 rc6fe469 51 51 static void batch_control(usb_transfer_batch_t *instance, 52 52 usb_direction_t data_dir, usb_direction_t status_dir); 53 static void batch_data(usb_transfer_batch_t *instance); 53 54 static void batch_call_in_and_dispose(usb_transfer_batch_t *instance); 54 55 static void batch_call_out_and_dispose(usb_transfer_batch_t *instance); … … 183 184 assert(instance->direction == USB_DIRECTION_IN); 184 185 instance->next_step = batch_call_in_and_dispose; 185 /* TODO: implement */186 batch_data(instance); 186 187 usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance); 187 188 } … … 195 196 instance->buffer_size); 196 197 instance->next_step = batch_call_out_and_dispose; 197 /* TODO: implement */198 batch_data(instance); 198 199 usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance); 199 200 } … … 204 205 instance->direction = USB_DIRECTION_IN; 205 206 instance->next_step = batch_call_in_and_dispose; 206 /* TODO: implement */207 batch_data(instance); 207 208 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); 208 209 } … … 213 214 instance->direction = USB_DIRECTION_IN; 214 215 instance->next_step = batch_call_in_and_dispose; 215 /* TODO: implement */216 batch_data(instance); 216 217 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); 217 218 } … … 274 275 } 275 276 /*----------------------------------------------------------------------------*/ 277 void batch_data(usb_transfer_batch_t *instance) 278 { 279 assert(instance); 280 ohci_batch_t *data = instance->private_data; 281 assert(data); 282 ed_init(data->ed, instance->ep); 283 ed_add_tds(data->ed, &data->tds[0], &data->tds[data->td_count - 1]); 284 usb_log_debug("Created ED(%p): %x:%x:%x:%x.\n", data->ed, 285 data->ed->status, data->ed->td_tail, data->ed->td_head, 286 data->ed->next); 287 288 /* data stage */ 289 size_t td_current = 1; 290 size_t remain_size = instance->buffer_size; 291 char *transfer_buffer = instance->transport_buffer; 292 while (remain_size > 0) { 293 size_t transfer_size = remain_size > OHCI_TD_MAX_TRANSFER ? 294 OHCI_TD_MAX_TRANSFER : remain_size; 295 296 td_init(&data->tds[td_current], instance->ep->direction, 297 transfer_buffer, transfer_size, -1); 298 td_set_next(&data->tds[td_current], &data->tds[td_current + 1]); 299 usb_log_debug("Created DATA TD: %x:%x:%x:%x.\n", 300 data->tds[td_current].status, data->tds[td_current].cbp, 301 data->tds[td_current].next, data->tds[td_current].be); 302 303 transfer_buffer += transfer_size; 304 remain_size -= transfer_size; 305 assert(td_current < data->td_count); 306 ++td_current; 307 } 308 } 309 /*----------------------------------------------------------------------------*/ 276 310 /** Helper function calls callback and correctly disposes of batch structure. 277 311 * -
uspace/drv/ohci/hc.c
r7628050 rc6fe469 147 147 break; 148 148 case USB_TRANSFER_BULK: 149 instance->registers->control &= ~C_BLE; 150 transfer_list_add_batch( 151 instance->transfers[batch->transfer_type], batch); 149 152 instance->registers->command_status |= CS_BLF; 150 153 usb_log_debug2("Set bulk transfer filled: %x.\n", 151 154 instance->registers->command_status); 155 instance->registers->control |= C_BLE; 156 break; 157 case USB_TRANSFER_INTERRUPT: 158 case USB_TRANSFER_ISOCHRONOUS: 159 instance->registers->control &= ~C_PLE; 160 transfer_list_add_batch( 161 instance->transfers[batch->transfer_type], batch); 162 instance->registers->control |= C_PLE; 152 163 break; 153 164 default:
Note:
See TracChangeset
for help on using the changeset viewer.