[PATCH wireless-dev] adm8211: fix suspend code
From: Michael Wu <hidden>
Date: 2006-11-03 02:01:38
adm8211: fix suspend code Apparently, I forgot to port the suspend and resume code in the d80211 port of adm8211. Thanks to Johannes Berg for finding this. Signed-off-by: Michael Wu <redacted> --- drivers/net/wireless/d80211/adm8211/adm8211.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/d80211/adm8211/adm8211.c b/drivers/net/wireless/d80211/adm8211/adm8211.c index bc0c8b6..fcfd05a 100644
--- a/drivers/net/wireless/d80211/adm8211/adm8211.c
+++ b/drivers/net/wireless/d80211/adm8211/adm8211.c@@ -2135,26 +2135,31 @@ #ifdef CONFIG_PM static int adm8211_suspend(struct pci_dev *pdev, pm_message_t state) { struct net_device *dev = pci_get_drvdata(pdev); - netif_device_detach(dev); + struct adm8211_priv *priv = ieee80211_dev_hw_data(dev); - if (dev->flags & IFF_UP) - dev->stop(dev); + if (priv->mode != IEEE80211_IF_TYPE_MGMT) { + ieee80211_stop_queues(dev); + adm8211_stop(dev); + } pci_save_state(pdev); - pci_set_power_state(pdev, PCI_D3hot); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); return 0; } static int adm8211_resume(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); + struct adm8211_priv *priv = ieee80211_dev_hw_data(dev); + pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - if (dev->flags & IFF_UP) - dev->open(dev); + if (priv->mode != IEEE80211_IF_TYPE_MGMT) { + adm8211_open(dev); + ieee80211_start_queues(dev); + } - netif_device_attach(dev); return 0; } #endif /* CONFIG_PM */
Attachments
- (unnamed) [application/pgp-signature] 189 bytes