Obtain the interrupt number according to the usb id

This commit is contained in:
songyanguang 2024-08-30 10:10:54 +08:00
parent 08e1fba932
commit 137247d918
1 changed files with 13 additions and 2 deletions

View File

@ -1080,8 +1080,19 @@ IPC_SERVER_INTERFACE(Ipc_xhci_intr, 1);
IPC_SERVER_REGISTER_INTERFACES(IpcXhciIntrHandler, 1, Ipc_xhci_intr);
int bind_xhci_intr(void *para){
int irq_no = USB3_0_INTERRUPT_NO;
struct xhci_host *xhci = (struct xhci_host *)para;
if (register_irq(USB3_0_INTERRUPT_NO, Ipc_xhci_intr) < 0) {
USB_LOG_DBG("bind_xhci_intr xhci pointer=%08x\n", xhci);
if (USB3_0_ID == xhci->bus->id) {
irq_no = USB3_0_INTERRUPT_NO;
}
if (USB3_1_ID == xhci->bus->id) {
irq_no = USB3_1_INTERRUPT_NO;
}
USB_LOG_DBG("bind_xhci_intr irq_no=%d\n", irq_no);
if (register_irq(irq_no, Ipc_xhci_intr) < 0) {
printf("bind failed!\n");
exit(1);
}
@ -1108,7 +1119,7 @@ int create_xhci_intr_service(void *para){
return -1;
}
USB_LOG_DBG("create_xhci_intr_service xhci pointer=%08x\n", xhci);
tid = thread(bind_xhci_intr, "xhci_intr_procedure", para);
/* Create thread error! */