Re: [Etherboot-developers] Re: rtl_disable and random kernel crash.
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Ken Y. <ke...@nl...> - 2001-04-06 03:45:20
|
||static void rtl_disable(struct nic *nic)
||{
|| int i;
||
|| /* reset the chip */
|| outb(CmdReset, ioaddr + ChipCmd);
||
|| /* Check that the chip has finished the reset. */
|| for (i = 1000; i > 0; i--)
|| if ((inb(ioaddr + ChipCmd) & CmdReset) == 0)
|| break;
||}
Actually I would make that:
static void rtl_disable(struct nic *nic)
{
/* reset the chip */
outb(CmdReset, ioaddr + ChipCmd);
/* 10 ms timeout */
load_timer2(10*TICKS_PER_MS);
while ((inb(ioaddr + ChipCmd) & CmdReset) != 0 && timer2_running())
/* wait */;
}
and add #include "timer.h" near the top. The hardware timer is more
consistent than a counting loop.
|