Changeset c4d4fa2 in mainline
- Timestamp:
- 2017-07-23T19:13:15Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e50bdd92
- Parents:
- a06fd64
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
ra06fd64 rc4d4fa2 52 52 } 53 53 54 int xhci_wait_for_command(xhci_ hc_t *hc, xhci_cmd_t *cmd, uint32_t timeout)54 int xhci_wait_for_command(xhci_cmd_t *cmd, uint32_t timeout) 55 55 { 56 56 uint32_t time = 0; … … 85 85 void xhci_free_command(xhci_cmd_t *cmd) 86 86 { 87 // TODO: If we decide to copy trb, free it here.88 87 if (cmd->ictx) 89 88 free32(cmd->ictx); 89 if (cmd->trb) 90 free32(cmd->trb); 90 91 91 92 free32(cmd); … … 382 383 { 383 384 // TODO: Update dequeue ptrs. 384 // TODO: Possibly clone command trb, as it may get overwritten before385 // it is processed (if somebody polls the command completion).386 385 assert(hc); 387 386 assert(trb); … … 393 392 xhci_cmd_t *command; 394 393 xhci_trb_t *command_trb; 395 396 code = XHCI_DWORD_EXTRACT(trb->status, 31, 24);397 slot_id = XHCI_DWORD_EXTRACT(trb->control, 31, 24);398 (void) slot_id;399 394 400 395 command = get_next_command(hc); … … 451 446 command->completed = true; 452 447 453 if (!command->has_owner) 448 if (!command->has_owner) { 454 449 xhci_free_command(command); 450 } else { 451 /* Copy the trb for later use so that we can free space on the cmd ring. */ 452 command->trb = malloc32(sizeof(xhci_trb_t)); 453 xhci_trb_copy(command->trb, command_trb); 454 } 455 455 456 456 return EOK; -
uspace/drv/bus/usb/xhci/commands.h
ra06fd64 rc4d4fa2 57 57 58 58 int xhci_init_commands(xhci_hc_t *); 59 int xhci_wait_for_command(xhci_ hc_t *, xhci_cmd_t *, uint32_t);59 int xhci_wait_for_command(xhci_cmd_t *, uint32_t); 60 60 xhci_cmd_t *xhci_alloc_command(void); 61 61 void xhci_free_command(xhci_cmd_t *);
Note:
See TracChangeset
for help on using the changeset viewer.