diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-19 03:24:56 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-11-03 15:49:36 -0500 |
commit | c931ceeb780560ff652a8f9875f88778439ee87e (patch) | |
tree | ca754722967ff1b9a4660ef38b0eae3d36f38a58 /drivers/net/wimax/i2400m/netdev.c | |
parent | 55a662d6468005ec3cd799fbd8d0ad03dfae6d2a (diff) |
wimax/i2400m: introduce i2400m_reset(), stopping TX and carrier
Currently the i2400m driver was resetting by just calling
i2400m->bus_reset(). However, this was missing stopping the TX queue
and downing the carrier. This was causing, for the corner case of the
driver reseting a device that refuses to go out of idle mode, that a
few packets would be queued and more than one reset would go through,
making the recovery a wee bit messy.
To avoid introducing the same cleanup in all the bus-specific driver,
introduced a i2400m_reset() function that takes care of house cleaning
and then calling the bus-level reset implementation.
The bulk of the changes in all files are just to rename the call from
i2400m->bus_reset() to i2400m_reset().
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers/net/wimax/i2400m/netdev.c')
-rw-r--r-- | drivers/net/wimax/i2400m/netdev.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index e7d1a51ee3fe..f67af4291f8c 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -171,8 +171,9 @@ void i2400m_wake_tx_work(struct work_struct *ws) | |||
171 | result = 0; | 171 | result = 0; |
172 | if (result < 0) { | 172 | if (result < 0) { |
173 | dev_err(dev, "WAKE&TX: device didn't get out of idle: " | 173 | dev_err(dev, "WAKE&TX: device didn't get out of idle: " |
174 | "%d\n", result); | 174 | "%d - resetting\n", result); |
175 | goto error; | 175 | i2400m_reset(i2400m, I2400M_RT_BUS); |
176 | goto error; | ||
176 | } | 177 | } |
177 | result = wait_event_timeout(i2400m->state_wq, | 178 | result = wait_event_timeout(i2400m->state_wq, |
178 | i2400m->state != I2400M_SS_IDLE, 5 * HZ); | 179 | i2400m->state != I2400M_SS_IDLE, 5 * HZ); |
@@ -180,7 +181,8 @@ void i2400m_wake_tx_work(struct work_struct *ws) | |||
180 | result = -ETIMEDOUT; | 181 | result = -ETIMEDOUT; |
181 | if (result < 0) { | 182 | if (result < 0) { |
182 | dev_err(dev, "WAKE&TX: error waiting for device to exit IDLE: " | 183 | dev_err(dev, "WAKE&TX: error waiting for device to exit IDLE: " |
183 | "%d\n", result); | 184 | "%d - resetting\n", result); |
185 | i2400m_reset(i2400m, I2400M_RT_BUS); | ||
184 | goto error; | 186 | goto error; |
185 | } | 187 | } |
186 | msleep(20); /* device still needs some time or it drops it */ | 188 | msleep(20); /* device still needs some time or it drops it */ |