diff options
Diffstat (limited to 'drivers/net/wimax/i2400m/driver.c')
-rw-r--r-- | drivers/net/wimax/i2400m/driver.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c index cc58a864bd06..96a615fe09de 100644 --- a/drivers/net/wimax/i2400m/driver.c +++ b/drivers/net/wimax/i2400m/driver.c | |||
@@ -255,7 +255,7 @@ int i2400m_op_reset(struct wimax_dev *wimax_dev) | |||
255 | mutex_lock(&i2400m->init_mutex); | 255 | mutex_lock(&i2400m->init_mutex); |
256 | i2400m->reset_ctx = &ctx; | 256 | i2400m->reset_ctx = &ctx; |
257 | mutex_unlock(&i2400m->init_mutex); | 257 | mutex_unlock(&i2400m->init_mutex); |
258 | result = i2400m->bus_reset(i2400m, I2400M_RT_WARM); | 258 | result = i2400m_reset(i2400m, I2400M_RT_WARM); |
259 | if (result < 0) | 259 | if (result < 0) |
260 | goto out; | 260 | goto out; |
261 | result = wait_for_completion_timeout(&ctx.completion, 4*HZ); | 261 | result = wait_for_completion_timeout(&ctx.completion, 4*HZ); |
@@ -710,7 +710,7 @@ out_unlock: | |||
710 | mutex_unlock(&i2400m->init_mutex); | 710 | mutex_unlock(&i2400m->init_mutex); |
711 | if (result == -EUCLEAN) { | 711 | if (result == -EUCLEAN) { |
712 | /* ops, need to clean up [w/ init_mutex not held] */ | 712 | /* ops, need to clean up [w/ init_mutex not held] */ |
713 | result = i2400m->bus_reset(i2400m, I2400M_RT_BUS); | 713 | result = i2400m_reset(i2400m, I2400M_RT_BUS); |
714 | if (result >= 0) | 714 | if (result >= 0) |
715 | result = -ENODEV; | 715 | result = -ENODEV; |
716 | } | 716 | } |
@@ -815,6 +815,24 @@ void i2400m_init(struct i2400m *i2400m) | |||
815 | EXPORT_SYMBOL_GPL(i2400m_init); | 815 | EXPORT_SYMBOL_GPL(i2400m_init); |
816 | 816 | ||
817 | 817 | ||
818 | int i2400m_reset(struct i2400m *i2400m, enum i2400m_reset_type rt) | ||
819 | { | ||
820 | struct net_device *net_dev = i2400m->wimax_dev.net_dev; | ||
821 | |||
822 | /* | ||
823 | * Make sure we stop TXs and down the carrier before | ||
824 | * resetting; this is needed to avoid things like | ||
825 | * i2400m_wake_tx() scheduling stuff in parallel. | ||
826 | */ | ||
827 | if (net_dev->reg_state == NETREG_REGISTERED) { | ||
828 | netif_tx_disable(net_dev); | ||
829 | netif_carrier_off(net_dev); | ||
830 | } | ||
831 | return i2400m->bus_reset(i2400m, rt); | ||
832 | } | ||
833 | EXPORT_SYMBOL_GPL(i2400m_reset); | ||
834 | |||
835 | |||
818 | /** | 836 | /** |
819 | * i2400m_setup - bus-generic setup function for the i2400m device | 837 | * i2400m_setup - bus-generic setup function for the i2400m device |
820 | * | 838 | * |