Replanting xhci_event_process function

This commit is contained in:
xj 2024-08-01 20:09:00 -07:00
parent 6ab2083403
commit 3928cd46b7
1 changed files with 15 additions and 8 deletions

View File

@ -2794,11 +2794,13 @@ static void xhci_host_controller ( struct xhci_host *xhci,
void xhci_event_process(struct xhci_host *xhci) {
struct xhci_ring *evts = xhci->evts;
unsigned int evt_type;
uint32_t nidx;
uint32_t cs;
union xhci_trb *trb;
uint32_t control;
uint64_t erdp;
uint32_t nidx;
uint32_t cs;
union xhci_trb *trb;
uint32_t control;
uint64_t erdp;
uintptr_t evts_phy = xhci->evts_phy;
/* check and ack event */
for (;;) {
@ -2854,9 +2856,14 @@ void xhci_event_process(struct xhci_host *xhci) {
evts->nidx = nidx;
/* Update dequeue pointer if applicable */
erdp = (uint64_t)(unsigned long)(evts->ring + nidx);
xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB,
xhci->run + XHCI_RUN_ERDP ( 0 ) );
// erdp = (uint64_t)(unsigned long)(evts->ring + nidx);
erdp = (uint64_t)(unsigned long)(evts_phy + nidx * sizeof(union xhci_trb));
#if 0
xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB,
xhci->run + XHCI_RUN_ERDP ( 0 ) );
#endif
xhci_writeq ( xhci, (uintptr_t)( erdp ) | XHCI_RUN_ERDP_EHB,
xhci->run_addr + XHCI_RUN_ERDP ( 0 ) );
}
return;