aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.j.brandewie@intel.com>2009-05-12 10:54:00 -0400
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-06-11 06:30:20 -0400
commit10b1de6b774a531c9054ee01e734a85ffbab179e (patch)
treeb56c38c7953faca21b1f4aee6709d5d3acfd3956 /drivers
parentead68239913cb9c19150facf1656517f81d66fcb (diff)
wimax/i2400m/sdio: Implement I2400M_RT_BUS reset type
This reset type causes the WiMAX function to be disabled and re-enabled, which will force the WiMAX device to reset and enter boot mode. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wimax/i2400m/i2400m-sdio.h2
-rw-r--r--drivers/net/wimax/i2400m/sdio.c20
2 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m-sdio.h b/drivers/net/wimax/i2400m/i2400m-sdio.h
index 08c2fb739234..207172165ba2 100644
--- a/drivers/net/wimax/i2400m/i2400m-sdio.h
+++ b/drivers/net/wimax/i2400m/i2400m-sdio.h
@@ -78,6 +78,8 @@ enum {
78 /* The number of ticks to wait for the device to signal that 78 /* The number of ticks to wait for the device to signal that
79 * it is ready */ 79 * it is ready */
80 I2400MS_INIT_SLEEP_INTERVAL = 10, 80 I2400MS_INIT_SLEEP_INTERVAL = 10,
81 /* How long to wait for the device to settle after reset */
82 I2400MS_SETTLE_TIME = 40,
81}; 83};
82 84
83 85
diff --git a/drivers/net/wimax/i2400m/sdio.c b/drivers/net/wimax/i2400m/sdio.c
index 777c981676fc..d6fac5ccf938 100644
--- a/drivers/net/wimax/i2400m/sdio.c
+++ b/drivers/net/wimax/i2400m/sdio.c
@@ -255,7 +255,7 @@ error_kzalloc:
255static 255static
256int i2400ms_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt) 256int i2400ms_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt)
257{ 257{
258 int result; 258 int result = 0;
259 struct i2400ms *i2400ms = 259 struct i2400ms *i2400ms =
260 container_of(i2400m, struct i2400ms, i2400m); 260 container_of(i2400m, struct i2400ms, i2400m);
261 struct device *dev = i2400m_dev(i2400m); 261 struct device *dev = i2400m_dev(i2400m);
@@ -280,8 +280,22 @@ int i2400ms_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt)
280 sizeof(i2400m_COLD_BOOT_BARKER)); 280 sizeof(i2400m_COLD_BOOT_BARKER));
281 else if (rt == I2400M_RT_BUS) { 281 else if (rt == I2400M_RT_BUS) {
282do_bus_reset: 282do_bus_reset:
283 dev_err(dev, "FIXME: SDIO bus reset not implemented\n"); 283 /* call netif_tx_disable() before sending IOE disable,
284 result = rt == I2400M_RT_WARM ? -ENODEV : -ENOSYS; 284 * so that all the tx from network layer are stopped
285 * while IOE is being reset. Make sure it is called
286 * only after register_netdev() was issued.
287 */
288 if (i2400m->wimax_dev.net_dev->reg_state == NETREG_REGISTERED)
289 netif_tx_disable(i2400m->wimax_dev.net_dev);
290
291 sdio_claim_host(i2400ms->func);
292 sdio_disable_func(i2400ms->func);
293 sdio_release_host(i2400ms->func);
294
295 /* Wait for the device to settle */
296 msleep(40);
297
298 result = i2400ms_enable_function(i2400ms->func);
285 } else 299 } else
286 BUG(); 300 BUG();
287 if (result < 0 && rt != I2400M_RT_BUS) { 301 if (result < 0 && rt != I2400M_RT_BUS) {