Changeset 481af21e in mainline
- Timestamp:
- 2017-07-12T19:44:01Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8315ed
- Parents:
- fd9f4ffe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
rfd9f4ffe r481af21e 43 43 #include "hw_struct/trb.h" 44 44 45 static in t ring_doorbell(xhci_hc_t *hc, unsigned doorbell, unsigned target)45 static inline int ring_doorbell(xhci_hc_t *hc, unsigned doorbell, unsigned target) 46 46 { 47 47 uint32_t v = host2xhci(32, target & BIT_RRANGE(uint32_t, 7)); 48 48 pio_write_32(&hc->db_arry[doorbell], v); 49 return EOK; 50 } 51 52 static inline int enqueue_trb(xhci_hc_t *hc, xhci_trb_t *trb, 53 unsigned doorbell, unsigned target) 54 { 55 xhci_trb_ring_enqueue(&hc->command_ring, trb); 56 ring_doorbell(hc, doorbell, target); 57 58 xhci_dump_trb(trb); 59 usb_log_debug2("HC(%p): Sent TRB", hc); 60 49 61 return EOK; 50 62 } … … 57 69 trb.control = host2xhci(32, XHCI_TRB_TYPE_NO_OP_CMD << 10); 58 70 59 xhci_trb_ring_enqueue(&hc->command_ring, &trb); 60 ring_doorbell(hc, 0, 0); 61 62 xhci_dump_trb(&trb); 63 usb_log_debug2("HC(%p): Sent TRB", hc); 64 return EOK; 71 return enqueue_trb(hc, &trb, 0, 0); 65 72 } 66 73 … … 72 79 trb.control = host2xhci(32, XHCI_TRB_TYPE_ENABLE_SLOT_CMD << 10); 73 80 trb.control |= host2xhci(32, XHCI_REG_RD(hc->xecp, XHCI_EC_SP_SLOT_TYPE) << 16); 81 trb.control |= host2xhci(32, hc->command_ring.pcs); 74 82 75 83 // TODO: Setup input control context. 76 84 77 xhci_trb_ring_enqueue(&hc->command_ring, &trb); 78 ring_doorbell(hc, 0, 0); 79 80 xhci_dump_trb(&trb); 81 usb_log_debug2("HC(%p): Sent TRB", hc); 82 return EOK; 85 return enqueue_trb(hc, &trb, 0, 0); 83 86 } 84 87
Note:
See TracChangeset
for help on using the changeset viewer.