summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2010-07-08 06:43:48 +0530
committerJohn W. Linville <linville@tuxdriver.com>2010-07-12 16:05:31 -0400
commit1311843c58ca606bab8bfe4cf6c0fe50deb9986d (patch)
treef716fbf88c163e33ef622ecb5e9c1d37df006bc7 /drivers/net/wireless/libertas/main.c
parent643f82e32f14faf0d0944c804203a6681b6b0a1e (diff)
downloadblackbird-op-linux-1311843c58ca606bab8bfe4cf6c0fe50deb9986d.tar.gz
blackbird-op-linux-1311843c58ca606bab8bfe4cf6c0fe50deb9986d.zip
libertas: Added support for host sleep feature
Existing "ethtool -s ethX wol X" command configures hostsleep parameters, but those are activated only during suspend/resume, there is no way to configure host sleep without actual suspend. This patch adds debugfs command to enable/disable host sleep based on already configured host sleep parameters using wol command. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index b519fc70f04f..2a0b590a93f1 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -544,20 +544,8 @@ static int lbs_thread(void *data)
return 0;
}
-static int lbs_ret_host_sleep_activate(struct lbs_private *priv,
- unsigned long dummy,
- struct cmd_header *cmd)
-{
- lbs_deb_enter(LBS_DEB_FW);
- priv->is_host_sleep_activated = 1;
- wake_up_interruptible(&priv->host_sleep_q);
- lbs_deb_leave(LBS_DEB_FW);
- return 0;
-}
-
int lbs_suspend(struct lbs_private *priv)
{
- struct cmd_header cmd;
int ret;
lbs_deb_enter(LBS_DEB_FW);
@@ -571,25 +559,8 @@ int lbs_suspend(struct lbs_private *priv)
priv->deep_sleep_required = 1;
}
- memset(&cmd, 0, sizeof(cmd));
- ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
- (struct wol_config *)NULL);
- if (ret) {
- lbs_pr_info("Host sleep configuration failed: %d\n", ret);
- return ret;
- }
- if (priv->psstate == PS_STATE_FULL_POWER) {
- ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd,
- sizeof(cmd), lbs_ret_host_sleep_activate, 0);
- if (ret)
- lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret);
- }
+ ret = lbs_set_host_sleep(priv, 1);
- if (!wait_event_interruptible_timeout(priv->host_sleep_q,
- priv->is_host_sleep_activated, (10 * HZ))) {
- lbs_pr_err("host_sleep_q: timer expired\n");
- ret = -1;
- }
netif_device_detach(priv->dev);
if (priv->mesh_dev)
netif_device_detach(priv->mesh_dev);
@@ -602,11 +573,10 @@ EXPORT_SYMBOL_GPL(lbs_suspend);
int lbs_resume(struct lbs_private *priv)
{
int ret;
- uint32_t criteria = EHS_REMOVE_WAKEUP;
lbs_deb_enter(LBS_DEB_FW);
- ret = lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
+ ret = lbs_set_host_sleep(priv, 0);
netif_device_attach(priv->dev);
if (priv->mesh_dev)
OpenPOWER on IntegriCloud