aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-05-13 15:16:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-24 15:07:41 -0400
commit9655a6ec19ca656af246fb80817aa337892aefbf (patch)
treededf4a99d4ba98bb0260c7e3317db2750530921d /drivers/net/wireless/rt2x00/rt73usb.c
parent3dc3fc52ea1537f5f37ab301d2b1468a0e79988f (diff)
rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions.
(Based on a patch created by Ondrej Zary) In some circumstances the Ralink devices do not properly go to sleep or wake up, with timeouts occurring. Fix this by retrying telling the device that it has to wake up or sleep. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index e35bd19c3c5..6e0d82efe92 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1366,7 +1366,7 @@ static void rt73usb_disable_radio(struct rt2x00_dev *rt2x00dev)
1366 1366
1367static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state) 1367static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1368{ 1368{
1369 u32 reg; 1369 u32 reg, reg2;
1370 unsigned int i; 1370 unsigned int i;
1371 char put_to_sleep; 1371 char put_to_sleep;
1372 1372
@@ -1383,10 +1383,11 @@ static int rt73usb_set_state(struct rt2x00_dev *rt2x00dev, enum dev_state state)
1383 * device has entered the correct state. 1383 * device has entered the correct state.
1384 */ 1384 */
1385 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 1385 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
1386 rt2x00usb_register_read(rt2x00dev, MAC_CSR12, &reg); 1386 rt2x00usb_register_read(rt2x00dev, MAC_CSR12, &reg2);
1387 state = rt2x00_get_field32(reg, MAC_CSR12_BBP_CURRENT_STATE); 1387 state = rt2x00_get_field32(reg2, MAC_CSR12_BBP_CURRENT_STATE);
1388 if (state == !put_to_sleep) 1388 if (state == !put_to_sleep)
1389 return 0; 1389 return 0;
1390 rt2x00usb_register_write(rt2x00dev, MAC_CSR12, reg);
1390 msleep(10); 1391 msleep(10);
1391 } 1392 }
1392 1393