diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-03-30 17:50:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-06 16:52:07 -0400 |
commit | 5731858d0047cad309d334c4cd6ccb6199bf28fe (patch) | |
tree | 7fd0c4738843b41a6490a57d20cfea6a6d76ff2a /drivers/net/wireless/rt2x00 | |
parent | 8a64c0f6b7ec7f758c4ef445e49f479e27fa2236 (diff) |
rt2x00: Disable auto wakeup before waking up device.
In all drivers ensure that auto wakeup is disabled before waking up the device.
This is needed to prevent connection stability issues and problems in waking up
the device.
Based upon a patch from Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 6 |
5 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index c22b04042d5c..08a4789fc2d8 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -525,6 +525,10 @@ static void rt2400pci_config_ps(struct rt2x00_dev *rt2x00dev, | |||
525 | 525 | ||
526 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 1); | 526 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 1); |
527 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); | 527 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); |
528 | } else { | ||
529 | rt2x00pci_register_read(rt2x00dev, CSR20, ®); | ||
530 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 0); | ||
531 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); | ||
528 | } | 532 | } |
529 | 533 | ||
530 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | 534 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 52bbcf1bd17c..d084d70e5fe2 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -573,6 +573,10 @@ static void rt2500pci_config_ps(struct rt2x00_dev *rt2x00dev, | |||
573 | 573 | ||
574 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 1); | 574 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 1); |
575 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); | 575 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); |
576 | } else { | ||
577 | rt2x00pci_register_read(rt2x00dev, CSR20, ®); | ||
578 | rt2x00_set_field32(®, CSR20_AUTOWAKE, 0); | ||
579 | rt2x00pci_register_write(rt2x00dev, CSR20, reg); | ||
576 | } | 580 | } |
577 | 581 | ||
578 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | 582 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index ee34c137e7cd..c1eec17fe186 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -648,6 +648,10 @@ static void rt2500usb_config_ps(struct rt2x00_dev *rt2x00dev, | |||
648 | 648 | ||
649 | rt2x00_set_field16(®, MAC_CSR18_AUTO_WAKE, 1); | 649 | rt2x00_set_field16(®, MAC_CSR18_AUTO_WAKE, 1); |
650 | rt2500usb_register_write(rt2x00dev, MAC_CSR18, reg); | 650 | rt2500usb_register_write(rt2x00dev, MAC_CSR18, reg); |
651 | } else { | ||
652 | rt2500usb_register_read(rt2x00dev, MAC_CSR18, ®); | ||
653 | rt2x00_set_field16(®, MAC_CSR18_AUTO_WAKE, 0); | ||
654 | rt2500usb_register_write(rt2x00dev, MAC_CSR18, reg); | ||
651 | } | 655 | } |
652 | 656 | ||
653 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | 657 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 18d4d8e4ae6b..d1694912310e 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -1014,13 +1014,13 @@ static void rt2800_config_ps(struct rt2x00_dev *rt2x00dev, | |||
1014 | 1014 | ||
1015 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | 1015 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); |
1016 | } else { | 1016 | } else { |
1017 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | ||
1018 | |||
1019 | rt2800_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); | 1017 | rt2800_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); |
1020 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 0); | 1018 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 0); |
1021 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, 0); | 1019 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, 0); |
1022 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 0); | 1020 | rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 0); |
1023 | rt2800_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); | 1021 | rt2800_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); |
1022 | |||
1023 | rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); | ||
1024 | } | 1024 | } |
1025 | } | 1025 | } |
1026 | 1026 | ||
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 47f3e4a26d77..7ebe14b64fe8 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -860,15 +860,15 @@ static void rt73usb_config_ps(struct rt2x00_dev *rt2x00dev, | |||
860 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0, | 860 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0, |
861 | USB_MODE_SLEEP, REGISTER_TIMEOUT); | 861 | USB_MODE_SLEEP, REGISTER_TIMEOUT); |
862 | } else { | 862 | } else { |
863 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0, | ||
864 | USB_MODE_WAKEUP, REGISTER_TIMEOUT); | ||
865 | |||
866 | rt2x00usb_register_read(rt2x00dev, MAC_CSR11, ®); | 863 | rt2x00usb_register_read(rt2x00dev, MAC_CSR11, ®); |
867 | rt2x00_set_field32(®, MAC_CSR11_DELAY_AFTER_TBCN, 0); | 864 | rt2x00_set_field32(®, MAC_CSR11_DELAY_AFTER_TBCN, 0); |
868 | rt2x00_set_field32(®, MAC_CSR11_TBCN_BEFORE_WAKEUP, 0); | 865 | rt2x00_set_field32(®, MAC_CSR11_TBCN_BEFORE_WAKEUP, 0); |
869 | rt2x00_set_field32(®, MAC_CSR11_AUTOWAKE, 0); | 866 | rt2x00_set_field32(®, MAC_CSR11_AUTOWAKE, 0); |
870 | rt2x00_set_field32(®, MAC_CSR11_WAKEUP_LATENCY, 0); | 867 | rt2x00_set_field32(®, MAC_CSR11_WAKEUP_LATENCY, 0); |
871 | rt2x00usb_register_write(rt2x00dev, MAC_CSR11, reg); | 868 | rt2x00usb_register_write(rt2x00dev, MAC_CSR11, reg); |
869 | |||
870 | rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE, 0, | ||
871 | USB_MODE_WAKEUP, REGISTER_TIMEOUT); | ||
872 | } | 872 | } |
873 | } | 873 | } |
874 | 874 | ||