diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c index 889ddd83f..6a92876be 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.c @@ -2763,14 +2763,19 @@ static void xhci_complete ( struct xhci_host *xhci, union xhci_trb *pending; uint32_t eidx; struct xhci_endpoint *work_pipe; - uintptr_t vir_addr; + uintptr_t addr_offset; - vir_addr = usb_mem_page_phy2vir(trb->command); +// vir_addr = usb_mem_page_phy2vir(trb->command); + cmd_ring = xhci->cmds; + addr_offset = trb->command - xhci->cmds_phy; - cmd_trb = (void *)(uintptr_t)(vir_addr); - cmd_ring = XHCI_RING(cmd_trb); /* to align addr is ring base */ + + // cmd_trb = (void *)(uintptr_t)(vir_addr); + // cmd_ring = XHCI_RING(cmd_trb); /* to align addr is ring base */ pending = &cmd_ring->evt; /* preserve event trb pending to handle */ - eidx = cmd_trb - cmd_ring->ring + 1; /* calculate current evt trb index */ +// eidx = cmd_trb - cmd_ring->ring + 1; /* calculate current evt trb index */ + eidx = addr_offset / sizeof(union xhci_trb); /* calculate current evt trb index */ + work_pipe = xhci->cur_cmd_pipe; /* Ignore "command ring stopped" notifications */