Untitled
By: a guest | Mar 19th, 2010 | Syntax:
ASM (NASM) | Size: 0.58 KB | Hits: 68 | Expires: Never
static int smsc911x_soft_reset(device *dev)
{
unsigned int timeout;
unsigned int temp;
/* Reset the LAN911x */
smsc911x_reg_write(dev, HW_CFG, HW_CFG_SRST_);
timeout = 10;
do {
io_udelay(10);
temp = smsc911x_reg_read(dev, HW_CFG);
} while ((--timeout) && (temp & HW_CFG_SRST_));
SMSC_TRACE("tmp value: %x\n", temp);
if ((temp & HW_CFG_SRST_) == 0) {
SMSC_WARNING("Failed to complete reset\n");
return -EIO;
}
return 0;
}