Changeset 0cabd10 in mainline
- Timestamp:
- 2017-07-29T21:55:16Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c9bec1c
- Parents:
- 9f5b613
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
r9f5b613 r0cabd10 47 47 #define TRB_SET_TYPE(trb, type) (trb).control |= host2xhci(32, (type) << 10) 48 48 #define TRB_SET_EP(trb, ep) (trb).control |= host2xhci(32, ((ep) & 0x5) << 16) 49 #define TRB_SET_STREAM(trb, st) (trb).control |= host2xhci(32, ((st) & 0xFFFF) << 16) 49 50 #define TRB_SET_SUSP(trb, susp) (trb).control |= host2xhci(32, ((susp) & 0x1) << 23) 50 51 #define TRB_SET_SLOT(trb, slot) (trb).control |= host2xhci(32, (slot) << 24) 51 52 53 /** 54 * TODO: Not sure about SCT and DCS (see section 6.4.3.9). 55 */ 56 #define TRB_SET_DEQUEUE_PTR(trb, dptr) (trb).parameter |= host2xhci(64, (dptr)) 52 57 #define TRB_SET_ICTX(trb, phys) (trb).parameter |= host2xhci(32, phys_addr & (~0xF)) 53 58 … … 421 426 } 422 427 428 int xhci_send_set_dequeue_ptr_command(xhci_hc_t *hc, xhci_cmd_t *cmd, 429 uintptr_t dequeue_ptr, uint16_t stream_id, 430 uint32_t ep_id) 431 { 432 assert(hc); 433 assert(cmd); 434 435 xhci_trb_t trb; 436 memset(&trb, 0, sizeof(trb)); 437 438 TRB_SET_TYPE(trb, XHCI_TRB_TYPE_SET_TR_DEQUEUE_POINTER_CMD); 439 TRB_SET_EP(trb, ep_id); 440 TRB_SET_STREAM(trb, stream_id); 441 TRB_SET_SLOT(trb, cmd->slot_id); 442 TRB_SET_DEQUEUE_PTR(trb, dequeue_ptr); 443 444 /** 445 * TODO: Set DCS (see section 4.6.10). 446 */ 447 448 cmd = add_cmd(hc, cmd); 449 450 return enqueue_trb(hc, &trb, 0, 0); 451 } 452 423 453 int xhci_send_reset_device_command(xhci_hc_t *hc, xhci_cmd_t *cmd) 424 454 { -
uspace/drv/bus/usb/xhci/commands.h
r9f5b613 r0cabd10 74 74 int xhci_send_reset_endpoint_command(xhci_hc_t *, xhci_cmd_t *, uint32_t, uint8_t); 75 75 int xhci_send_stop_endpoint_command(xhci_hc_t *, xhci_cmd_t *, uint32_t, uint8_t); 76 // TODO: Set dequeue ptr (section 4.6.10). 76 int xhci_send_set_dequeue_ptr_command(xhci_hc_t *, xhci_cmd_t *, uintptr_t, uint16_t, uint32_t); 77 77 int xhci_send_reset_device_command(xhci_hc_t *, xhci_cmd_t *); 78 78 // TODO: Force event (optional normative, for VMM, section 4.6.12).
Note:
See TracChangeset
for help on using the changeset viewer.