Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79191
b: refs/heads/master
c: ab25eca
h: refs/heads/master
i:
  79189: 084b427
  79187: 3b5b40f
  79183: 08a74ac
v: v3
  • Loading branch information
David Woodhouse authored and David S. Miller committed Jan 28, 2008
1 parent f88197b commit f9f243d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3db2bb411512d1ebd6233b3985d98f4fe7ea8a8
refs/heads/master: ab25ecaea5459f2206dbae25106cff67a24d309e
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/libertas/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ int lbs_mesh_config(struct lbs_private *priv, int enable);

int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
uint8_t gpio, uint8_t gap);
int lbs_suspend(struct lbs_private *priv);
int lbs_resume(struct lbs_private *priv);

#endif /* _LBS_CMD_H */
47 changes: 47 additions & 0 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,53 @@ static int lbs_thread(void *data)
return 0;
}

static int lbs_suspend_callback(struct lbs_private *priv, unsigned long dummy,
struct cmd_header *cmd)
{
lbs_deb_fw("HOST_SLEEP_ACTIVATE succeeded\n");

netif_device_detach(priv->dev);
if (priv->mesh_dev)
netif_device_detach(priv->mesh_dev);

priv->fw_ready = 0;
return 0;
}


int lbs_suspend(struct lbs_private *priv)
{
struct cmd_header cmd;
int ret;

memset(&cmd, 0, sizeof(cmd));

ret = __lbs_cmd(priv, CMD_802_11_HOST_SLEEP_ACTIVATE, &cmd,
sizeof(cmd), lbs_suspend_callback, 0);
if (ret)
lbs_pr_info("HOST_SLEEP_ACTIVATE failed: %d\n", ret);

return ret;
}
EXPORT_SYMBOL_GPL(lbs_suspend);

int lbs_resume(struct lbs_private *priv)
{
priv->fw_ready = 1;

/* Firmware doesn't seem to give us RX packets any more
until we send it some command. Might as well update */
lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
0, 0, NULL);

netif_device_attach(priv->dev);
if (priv->mesh_dev)
netif_device_attach(priv->mesh_dev);

return 0;
}
EXPORT_SYMBOL_GPL(lbs_resume);

/**
* @brief This function downloads firmware image, gets
* HW spec from firmware and set basic parameters to
Expand Down

0 comments on commit f9f243d

Please sign in to comment.