summaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/304-rt2x00-Update-from-rt2860-driver-rt2800pci.patch
blob: e28bac054762f6d677f62572197f0c2e35120bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 690559385626e98e2a91c280a8bca195f071756c Mon Sep 17 00:00:00 2001
From: Ivo van Doorn <IvDoorn@gmail.com>
Date: Tue, 28 Apr 2009 20:12:43 +0200
Subject: [PATCH 4/4] rt2x00: Update from rt2860 driver (rt2800pci)

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |   10 +++++++---
 drivers/net/wireless/rt2x00/rt2800pci.h |    2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -2048,13 +2048,17 @@ static void rt2800pci_disable_radio(stru
 static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
 			       enum dev_state state)
 {
-	rt2x00pci_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0);
+	/*
+	 * Always put the device to sleep (even when we intend to wakup!)
+	 * if the device is booting and wasn't asleep it will return
+	 * failure when attempting to wakup.
+	 */
+	rt2800pci_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2);
 
 	if (state == STATE_AWAKE) {
 		rt2800pci_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0);
 		rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP);
-	} else
-		rt2800pci_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2);
+	}
 
 	return 0;
 }
--- a/drivers/net/wireless/rt2x00/rt2800pci.h
+++ b/drivers/net/wireless/rt2x00/rt2800pci.h
@@ -1714,6 +1714,7 @@ struct mac_iveiv_entry {
 #define MCU_SLEEP			0x30
 #define MCU_WAKEUP			0x31
 #define MCU_RADIO_OFF			0x35
+#define MCU_CURRENT			0x36
 #define MCU_LED				0x50
 #define MCU_LED_STRENGTH		0x51
 #define MCU_LED_1			0x52
@@ -1722,6 +1723,7 @@ struct mac_iveiv_entry {
 #define MCU_RADAR			0x60
 #define MCU_BOOT_SIGNAL			0x72
 #define MCU_BBP_SIGNAL			0x80
+#define MCU_POWER_SAVE			0x83
 
 /*
  * MCU mailbox tokens