diff options
author | Ian Moffett <ian@osmora.org> | 2024-04-04 19:42:38 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-04-04 19:42:38 -0400 |
commit | 0b02ace561f4910559cd932e2b95c971241bb58f (patch) | |
tree | 3694016543825de06b9bf89ccc22dd75024ae311 /sys/dev/usb/xhci.c | |
parent | 8d6088386c1fa0bf09678b328bee19768f138dcb (diff) |
kernel: xhci: Improve documentation
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/usb/xhci.c')
-rw-r--r-- | sys/dev/usb/xhci.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 2550768..26e155c 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -121,7 +121,15 @@ xhci_submit_cmd(struct xhci_hc *hc, struct xhci_trb trb) *cmd_db = 0; if (hc->cmd_count >= XHCI_CMDRING_LEN - 1) { - /* Create raw link TRB and ring the doorbell */ + /* + * Create raw link TRB and ring the doorbell. We want the + * xHC to flip its cycle bit so it doesn't confuse existing + * entries (that we'll overwrite) in the ring with current + * entries, so we set the Toggle Cycle bit. + * + * See the xHCI spec, section 6.4.4.1 for information regarding + * the format of link TRBs. + */ hc->cmd_ring[hc->cmd_ptr++] = VIRT_TO_PHYS(hc->cmd_ring) & 0xFFFFFFFF; hc->cmd_ring[hc->cmd_ptr++] = VIRT_TO_PHYS(hc->cmd_ring) >> 32; hc->cmd_ring[hc->cmd_ptr++] = 0; |