aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2007-12-05 23:59:28 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-07 15:09:06 -0500
commit7962024e9d16e9349d76b553326f3fa7be64305e (patch)
tree4d12ca9d0219967ab2dc90b5dc3a0adb8283c84a /drivers/net/s2io.c
parent17cf803a57c89c5afe6d5299ac9416683c3240dd (diff)
S2io: Check for register initialization completion before accesing device registers
- Making sure register initialisation is complete before proceeding further. The driver must wait until initialization is complete before attempting to access any other device registers. Signed-off-by: Surjit Reang <surjit.reang@neterion.com> Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index d5113dd712c2..121cb100f93a 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -84,7 +84,7 @@
84#include "s2io.h" 84#include "s2io.h"
85#include "s2io-regs.h" 85#include "s2io-regs.h"
86 86
87#define DRV_VERSION "2.0.26.6" 87#define DRV_VERSION "2.0.26.10"
88 88
89/* S2io Driver name & version. */ 89/* S2io Driver name & version. */
90static char s2io_driver_name[] = "Neterion"; 90static char s2io_driver_name[] = "Neterion";
@@ -1100,6 +1100,20 @@ static int init_nic(struct s2io_nic *nic)
1100 msleep(500); 1100 msleep(500);
1101 val64 = readq(&bar0->sw_reset); 1101 val64 = readq(&bar0->sw_reset);
1102 1102
1103 /* Ensure that it's safe to access registers by checking
1104 * RIC_RUNNING bit is reset. Check is valid only for XframeII.
1105 */
1106 if (nic->device_type == XFRAME_II_DEVICE) {
1107 for (i = 0; i < 50; i++) {
1108 val64 = readq(&bar0->adapter_status);
1109 if (!(val64 & ADAPTER_STATUS_RIC_RUNNING))
1110 break;
1111 msleep(10);
1112 }
1113 if (i == 50)
1114 return -ENODEV;
1115 }
1116
1103 /* Enable Receiving broadcasts */ 1117 /* Enable Receiving broadcasts */
1104 add = &bar0->mac_cfg; 1118 add = &bar0->mac_cfg;
1105 val64 = readq(&bar0->mac_cfg); 1119 val64 = readq(&bar0->mac_cfg);