Search Linux Wireless

[PATCH 16/24] rt2x00: Call all configure handlers during resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 4800d5b02a237838913df950e557cf17f2f70dde Mon Sep 17 00:00:00 2001
From: Ivo van Doorn <IvDoorn@xxxxxxxxx>
Date: Sun, 29 Jul 2007 14:19:31 +0200
Subject: [PATCH 16/24] rt2x00: Call all configure handlers during resume

All configure handlers should be called during
resume operation to bring the device back into
the correct state to make the device work again.

Signed-off-by: Ivo van Doorn <IvDoorn@xxxxxxxxx>
---
 drivers/net/wireless/rt2x00dev.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00dev.c b/drivers/net/wireless/rt2x00dev.c
index 0220107..4989cdb 100644
--- a/drivers/net/wireless/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00dev.c
@@ -1078,6 +1078,9 @@ EXPORT_SYMBOL_GPL(rt2x00lib_suspend);
 
 int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
 {
+	const struct rt2x00lib_ops *lib = rt2x00dev->ops->lib;
+	struct ieee80211_conf *conf = &rt2x00dev->hw->conf;
+	struct interface *intf = &rt2x00dev->interface;
 	int retval;
 
 	NOTICE(rt2x00dev, "Waking up.\n");
@@ -1095,10 +1098,27 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
 		return retval;
 
 	/*
+	 * Configure the device to the original state.
+	 */
+	lib->config_type(rt2x00dev, intf->type);
+	lib->config_promisc(rt2x00dev, test_bit(INTERFACE_ENABLED_PROMISC,
+						&rt2x00dev->flags));
+	lib->config_bssid(rt2x00dev, intf->bssid);
+	lib->config_phymode(rt2x00dev, conf->phymode);
+	lib->config_channel(rt2x00dev, conf->channel_val,
+			    conf->channel, conf->power_level);
+	lib->config_antenna(rt2x00dev, conf->antenna_sel_tx,
+			    conf->antenna_sel_rx);
+	lib->config_duration(rt2x00dev,
+			     (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME),
+			     conf->beacon_int);
+	lib->reset_tuner(rt2x00dev);
+
+	/*
 	 * We only need to continue when in Master or Ad-hoc mode.
 	 */
-	if (rt2x00dev->interface.type != IEEE80211_IF_TYPE_AP &&
-	    rt2x00dev->interface.type != IEEE80211_IF_TYPE_IBSS)
+	if (intf->type != IEEE80211_IF_TYPE_AP &&
+	    intf->type != IEEE80211_IF_TYPE_IBSS)
 		return 0;
 
 	/*
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux