chendengchuan
驱动牛犊
驱动牛犊
  • 注册日期2004-03-05
  • 最后登录2009-07-13
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望6点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
阅读:1463回复:0

请教UHCI主机rest的一个问题

楼主#
更多 发布于:2004-07-23 16:29
我最近在编写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
第二次运行时,就没有报告超时了,
本人颇感迷惑,请高手指点。
游客

返回顶部