diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c index 075d29207..7633a3ec8 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/usb_hc_xhci.c @@ -1098,7 +1098,17 @@ int create_xhci_intr_service(void *para){ } - // tid = thread(); + tid = thread(bind_xhci_intr, "xhci_intr_procedure", para); + +/* Create thread error! */ + if(tid < 0){ + return -1; + }else if(tid > 0){ + xhci->tid_intr = tid; + }else{ +/* Child thread. do nothing except for the interrupt processing function. */ + } + return 0; } diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h index 1bceb42f5..5487ddfd0 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/port/xhci/xhci.h @@ -818,8 +818,6 @@ struct xhci_slot { unsigned int tt_id; /** Transaction translator port */ unsigned int tt_port; - /** Thread ID of the thread that is created to process xhci interrupt */ - unsigned int tid_intr; /** Endpoints, indexed by context ID */ struct xhci_endpoint *endpoint[XHCI_CTX_END]; @@ -922,6 +920,9 @@ struct xhci_host { uintptr_t eseg_addr; uintptr_t eseg_phy; + /* Thread ID of the thread that is created to process xhci interrupt */ + unsigned int tid_intr; + struct xhci_endpoint *cur_cmd_pipe; };