aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2007-08-02 13:16:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:50:11 -0700
commitd21b31fd53626f9c1d14fc676793dbe86b44d1c6 (patch)
tree3c5179f383c89bdffecd48565d7b38ed7db9e12c /drivers/net/wireless/libertas/main.c
parentb37e5842f5ab66f8d0533ee62ffe35c26ae800a3 (diff)
[PATCH] libertas: keep mesh autostart enabled while asleep
After loading the firmware, mesh autostart will be disabled. After that, the user will still be able to enable or disable it at will. On suspend, it will be always activated and later on resume it will go back to the state it had before going to sleep. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.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.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 9ccc9524153..a3a17caae43 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -271,15 +271,20 @@ static ssize_t libertas_autostart_enabled_set(struct device * dev,
{
struct cmd_ds_mesh_access mesh_access;
uint32_t datum;
+ wlan_private * priv = (to_net_dev(dev))->priv;
+ int ret;
memset(&mesh_access, 0, sizeof(mesh_access));
sscanf(buf, "%d", &datum);
mesh_access.data[0] = cpu_to_le32(datum);
- libertas_prepare_and_send_command((to_net_dev(dev))->priv,
+ ret = libertas_prepare_and_send_command(priv,
CMD_MESH_ACCESS,
CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
+ if (ret == 0)
+ priv->mesh_autostart_enabled = datum ? 1 : 0;
+
return strlen(buf);
}
@@ -853,6 +858,7 @@ static int wlan_setup_station_hw(wlan_private * priv)
{
int ret = -1;
wlan_adapter *adapter = priv->adapter;
+ struct cmd_ds_mesh_access mesh_access;
lbs_deb_enter(LBS_DEB_FW);
@@ -889,6 +895,21 @@ static int wlan_setup_station_hw(wlan_private * priv)
goto done;
}
+ /* Disable mesh autostart */
+ if (priv->mesh_dev) {
+ memset(&mesh_access, 0, sizeof(mesh_access));
+ mesh_access.data[0] = cpu_to_le32(0);
+ ret = libertas_prepare_and_send_command(priv,
+ CMD_MESH_ACCESS,
+ CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
+ CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
+ if (ret) {
+ ret = -1;
+ goto done;
+ }
+ priv->mesh_autostart_enabled = 0;
+ }
+
ret = 0;
done:
lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);