阅读:1504回复:0
请教UHCI主机rest的一个问题
我最近在编写uhci1.1主机驱动的程序,这将作为bios的一个模块加载。但是主机控制器rest超时,此函数如下:
inline void start_hc(struct uhci *dev) { unsigned int io_addr = dev->io_addr; int timeout = 100; /* * Reset the HC - this will force us to get a * new notification of any already connected * ports due to the virtual disconnect that it * implies. */ outw(USBCMD_HCRESET, io_addr + USBCMD); while (inw(io_addr + USBCMD) & USBCMD_HCRESET) { delay(10); if (!--timeout) { printf("uhci: USBCMD_HCRESET timed out!\n"); break; } } /* Turn on all interrupts */ outw(USBINTR_TIMEOUT | USBINTR_RESUME | USBINTR_IOC | USBINTR_SP, io_addr + USBINTR); /* Start at frame 0 */ outw(0, io_addr + USBFRNUM); outl((dev->fl), io_addr + USBFLBASEADD); /* Run and mark it configured with a 64-byte max packet */ outw(USBCMD_RS | USBCMD_CF | USBCMD_MAXP, io_addr + USBCMD); } 我将其编译,在DOS下第一次运行,报告超时: uhci: USBCMD_HCRESET timed out 第二次运行时,就没有报告超时了, 本人颇感迷惑,请高手指点。 |
|