Changeset 9162b27 in mainline
- Timestamp:
- 2017-11-20T22:15:11Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 375211d2
- Parents:
- 27b0ea0
- git-author:
- Aearsis <Hlavaty.Ondrej@…> (2017-11-20 22:12:13)
- git-committer:
- Aearsis <Hlavaty.Ondrej@…> (2017-11-20 22:15:11)
- Location:
- uspace/drv/bus/usb/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_batch.c
r27b0ea0 r9162b27 58 58 if (ohci_batch->tds) { 59 59 const ohci_endpoint_t *ohci_ep = 60 ohci_endpoint_get(ohci_batch-> usb_batch->ep);60 ohci_endpoint_get(ohci_batch->base.ep); 61 61 assert(ohci_ep); 62 62 for (unsigned i = 0; i < ohci_batch->td_count; ++i) { … … 72 72 /** Allocate memory and initialize internal data structure. 73 73 * 74 * @param[in] usb_batch Pointer to generic USB batch structure.74 * @param[in] ep Endpoint for which the batch will be created 75 75 * @return Valid pointer if all structures were successfully created, 76 76 * NULL otherwise. … … 176 176 177 177 usb_log_debug("Batch %p checking %zu td(s) for completion.\n", 178 ohci_batch->usb_batch, ohci_batch->td_count);178 &ohci_batch->base, ohci_batch->td_count); 179 179 usb_log_debug2("ED: %08x:%08x:%08x:%08x.\n", 180 180 ohci_batch->ed->status, ohci_batch->ed->td_head, … … 218 218 } else { 219 219 usb_log_debug("Batch %p found error TD(%zu):%08x.\n", 220 ohci_batch->usb_batch, i,220 &ohci_batch->base, i, 221 221 ohci_batch->tds[i]->status); 222 222 … … 248 248 ohci_batch->base.buffer_size); 249 249 250 const size_t setup_size = (ohci_batch->base.ep->transfer_type == USB_TRANSFER_CONTROL) 251 ? USB_SETUP_PACKET_SIZE 252 : 0; 253 250 254 if (ohci_batch->base.dir == USB_DIRECTION_IN) 251 memcpy(ohci_batch->base.buffer, ohci_batch->device_buffer, ohci_batch->base.transfered_size); 255 memcpy(ohci_batch->base.buffer, 256 ohci_batch->device_buffer + setup_size, 257 ohci_batch->base.transfered_size); 252 258 253 259 /* Store the remaining TD */ … … 313 319 /* Data stage */ 314 320 size_t td_current = 1; 315 size_t remain_size = ohci_batch-> usb_batch->buffer_size;321 size_t remain_size = ohci_batch->base.buffer_size; 316 322 while (remain_size > 0) { 317 323 const size_t transfer_size = … … 345 351 usb_log_debug2( 346 352 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 347 ohci_batch->usb_batch,348 usb_str_transfer_type(ohci_batch-> usb_batch->ep->transfer_type),353 &ohci_batch->base, 354 usb_str_transfer_type(ohci_batch->base.ep->transfer_type), 349 355 usb_str_direction(dir), 350 USB_TRANSFER_BATCH_ARGS( *ohci_batch->usb_batch));356 USB_TRANSFER_BATCH_ARGS(ohci_batch->base)); 351 357 } 352 358 … … 370 376 371 377 size_t td_current = 0; 372 size_t remain_size = ohci_batch-> usb_batch->buffer_size;378 size_t remain_size = ohci_batch->base.buffer_size; 373 379 char *buffer = ohci_batch->device_buffer; 374 380 while (remain_size > 0) { … … 393 399 usb_log_debug2( 394 400 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 395 ohci_batch->usb_batch,396 usb_str_transfer_type(ohci_batch-> usb_batch->ep->transfer_type),401 &ohci_batch->base, 402 usb_str_transfer_type(ohci_batch->base.ep->transfer_type), 397 403 usb_str_direction(dir), 398 USB_TRANSFER_BATCH_ARGS( *ohci_batch->usb_batch));404 USB_TRANSFER_BATCH_ARGS(ohci_batch->base)); 399 405 } 400 406 -
uspace/drv/bus/usb/ohci/ohci_batch.h
r27b0ea0 r9162b27 57 57 /** Data buffer, must be accessible by the OHCI hw. */ 58 58 char *device_buffer; 59 /** Generic USB transfer structure */60 usb_transfer_batch_t *usb_batch;61 59 } ohci_transfer_batch_t; 62 60
Note:
See TracChangeset
for help on using the changeset viewer.