Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 19th, 2010 | Syntax: ASM (NASM) | Size: 0.58 KB | Hits: 68 | Expires: Never
Copy text to clipboard
  1. static int smsc911x_soft_reset(device *dev)
  2. {
  3.         unsigned int timeout;
  4.         unsigned int temp;
  5.  
  6.         /* Reset the LAN911x */
  7.         smsc911x_reg_write(dev, HW_CFG, HW_CFG_SRST_);
  8.         timeout = 10;
  9.         do {
  10.                 io_udelay(10);
  11.                 temp = smsc911x_reg_read(dev, HW_CFG);
  12.         } while ((--timeout) && (temp & HW_CFG_SRST_));
  13.  
  14.                 SMSC_TRACE("tmp value: %x\n", temp);
  15.  
  16.         if ((temp & HW_CFG_SRST_) == 0) {
  17.                 SMSC_WARNING("Failed to complete reset\n");
  18.                 return -EIO;
  19.         }
  20.         return 0;
  21. }