aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-06 08:12:42 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:09 -0400
commit6d7f9877a66a3abe0b04b63d1de4659919e21a92 (patch)
treec89cd9767c0a8aaef89e799b3a821262f703d7d5 /drivers/net/wireless
parent3a84732a5c9758a4bd59088787cac23508ef8b62 (diff)
[PATCH] rt2x00: Store "STARTED" state during suspend
Store the started state into a new flag DEVICE_STARTED_SUSPEND and set this when suspending while the device was started. We can't check for is_interface_present() since only mac80211 knows if there are monitor interfaces present. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 5d30ca6680b6..d280d0ec9042 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -508,6 +508,7 @@ struct rt2x00_dev {
508#define CONFIG_EXTERNAL_LNA_BG 13 508#define CONFIG_EXTERNAL_LNA_BG 13
509#define CONFIG_DOUBLE_ANTENNA 14 509#define CONFIG_DOUBLE_ANTENNA 14
510#define CONFIG_DISABLE_LINK_TUNING 15 510#define CONFIG_DISABLE_LINK_TUNING 15
511#define DEVICE_STARTED_SUSPEND 16
511 512
512 /* 513 /*
513 * Chipset identification. 514 * Chipset identification.
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index b6a5c3481126..f25475318c9b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1088,12 +1088,13 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state)
1088 */ 1088 */
1089 if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags)) 1089 if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags))
1090 goto exit; 1090 goto exit;
1091 __set_bit(DEVICE_STARTED_SUSPEND, &rt2x00dev->flags);
1091 1092
1092 /* 1093 /*
1093 * Disable radio and unitialize all items 1094 * Disable radio and unitialize all items
1094 * that must be recreated on resume. 1095 * that must be recreated on resume.
1095 */ 1096 */
1096 rt2x00lib_disable_radio(rt2x00dev); 1097 rt2x00mac_stop(rt2x00dev->hw);
1097 rt2x00lib_uninitialize(rt2x00dev); 1098 rt2x00lib_uninitialize(rt2x00dev);
1098 rt2x00debug_deregister(rt2x00dev); 1099 rt2x00debug_deregister(rt2x00dev);
1099 1100
@@ -1123,9 +1124,9 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
1123 rt2x00debug_register(rt2x00dev); 1124 rt2x00debug_register(rt2x00dev);
1124 1125
1125 /* 1126 /*
1126 * Only continue if mac80211 has open interfaces. 1127 * Only continue if mac80211 had open interfaces.
1127 */ 1128 */
1128 if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags)) 1129 if (!__test_and_clear_bit(DEVICE_STARTED_SUSPEND, &rt2x00dev->flags))
1129 return 0; 1130 return 0;
1130 1131
1131 /* 1132 /*