aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index dd432ea61947..1ea119ed3d22 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -820,6 +820,53 @@ static int lbs_thread(void *data)
820 return 0; 820 return 0;
821} 821}
822 822
823static int lbs_suspend_callback(struct lbs_private *priv, unsigned long dummy,
824 struct cmd_header *cmd)
825{
826 lbs_deb_fw("HOST_SLEEP_ACTIVATE succeeded\n");
827
828 netif_device_detach(priv->dev);
829 if (priv->mesh_dev)
830 netif_device_detach(priv->mesh_dev);
831
832 priv->fw_ready = 0;
833 return 0;
834}
835
836
837int lbs_suspend(struct lbs_private *priv)
838{
839 struct cmd_header cmd;
840 int ret;
841
842 memset(&cmd, 0, sizeof(cmd));
843
844 ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd,
845 sizeof(cmd), lbs_suspend_callback, 0);
846 if (ret)
847 lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret);
848
849 return ret;
850}
851EXPORT_SYMBOL_GPL(lbs_suspend);
852
853int lbs_resume(struct lbs_private *priv)
854{
855 priv->fw_ready = 1;
856
857 /* Firmware doesn't seem to give us RX packets any more
858 until we send it some command. Might as well update */
859 lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
860 0, 0, NULL);
861
862 netif_device_attach(priv->dev);
863 if (priv->mesh_dev)
864 netif_device_attach(priv->mesh_dev);
865
866 return 0;
867}
868EXPORT_SYMBOL_GPL(lbs_resume);
869
823/** 870/**
824 * @brief This function downloads firmware image, gets 871 * @brief This function downloads firmware image, gets
825 * HW spec from firmware and set basic parameters to 872 * HW spec from firmware and set basic parameters to