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 8f169c1d4..d07154f82 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 @@ -2669,11 +2669,24 @@ static void xhci_transfer ( struct xhci_host *xhci, struct xhci_trb_transfer *trb ) { struct xhci_slot *slot; struct xhci_endpoint *endpoint; - union xhci_trb *trans_trb = (void *)(uintptr_t)(trb->transfer); - struct xhci_ring *trans_ring = XHCI_RING(trans_trb); /* to align addr is ring base */ - union xhci_trb *pending = &trans_ring->evt; /* preserve event trb pending to handle */ - uint32_t eidx = trans_trb - trans_ring->ring + 1; /* calculate current evt trb index */ - int rc; + uintptr_t vir_addr; + union xhci_trb *trans_trb; + struct xhci_ring *trans_ring; + union xhci_trb *pending; + uint32_t eidx; + int rc; + + vir_addr = usb_mem_page_phy2vir(trb->transfer); + +#if 0 + if(!vir_addr) + return; +#endif + + trans_trb = (void *)(uintptr_t)(vir_addr); + trans_ring = XHCI_RING(trans_trb); /* to align addr is ring base */ + pending = &trans_ring->evt; /* preserve event trb pending to handle */ + eidx = trans_trb - trans_ring->ring + 1; /* calculate current evt trb index */ /* Identify slot */ if ( ( trb->slot > xhci->slots ) ||