diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2007-08-02 13:16:02 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:50:11 -0400 |
commit | d21b31fd53626f9c1d14fc676793dbe86b44d1c6 (patch) | |
tree | 3c5179f383c89bdffecd48565d7b38ed7db9e12c /drivers/net/wireless/libertas/main.c | |
parent | b37e5842f5ab66f8d0533ee62ffe35c26ae800a3 (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.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 9ccc9524153b..a3a17caae439 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, | |||
271 | { | 271 | { |
272 | struct cmd_ds_mesh_access mesh_access; | 272 | struct cmd_ds_mesh_access mesh_access; |
273 | uint32_t datum; | 273 | uint32_t datum; |
274 | wlan_private * priv = (to_net_dev(dev))->priv; | ||
275 | int ret; | ||
274 | 276 | ||
275 | memset(&mesh_access, 0, sizeof(mesh_access)); | 277 | memset(&mesh_access, 0, sizeof(mesh_access)); |
276 | sscanf(buf, "%d", &datum); | 278 | sscanf(buf, "%d", &datum); |
277 | mesh_access.data[0] = cpu_to_le32(datum); | 279 | mesh_access.data[0] = cpu_to_le32(datum); |
278 | 280 | ||
279 | libertas_prepare_and_send_command((to_net_dev(dev))->priv, | 281 | ret = libertas_prepare_and_send_command(priv, |
280 | CMD_MESH_ACCESS, | 282 | CMD_MESH_ACCESS, |
281 | CMD_ACT_MESH_SET_AUTOSTART_ENABLED, | 283 | CMD_ACT_MESH_SET_AUTOSTART_ENABLED, |
282 | CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); | 284 | CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); |
285 | if (ret == 0) | ||
286 | priv->mesh_autostart_enabled = datum ? 1 : 0; | ||
287 | |||
283 | return strlen(buf); | 288 | return strlen(buf); |
284 | } | 289 | } |
285 | 290 | ||
@@ -853,6 +858,7 @@ static int wlan_setup_station_hw(wlan_private * priv) | |||
853 | { | 858 | { |
854 | int ret = -1; | 859 | int ret = -1; |
855 | wlan_adapter *adapter = priv->adapter; | 860 | wlan_adapter *adapter = priv->adapter; |
861 | struct cmd_ds_mesh_access mesh_access; | ||
856 | 862 | ||
857 | lbs_deb_enter(LBS_DEB_FW); | 863 | lbs_deb_enter(LBS_DEB_FW); |
858 | 864 | ||
@@ -889,6 +895,21 @@ static int wlan_setup_station_hw(wlan_private * priv) | |||
889 | goto done; | 895 | goto done; |
890 | } | 896 | } |
891 | 897 | ||
898 | /* Disable mesh autostart */ | ||
899 | if (priv->mesh_dev) { | ||
900 | memset(&mesh_access, 0, sizeof(mesh_access)); | ||
901 | mesh_access.data[0] = cpu_to_le32(0); | ||
902 | ret = libertas_prepare_and_send_command(priv, | ||
903 | CMD_MESH_ACCESS, | ||
904 | CMD_ACT_MESH_SET_AUTOSTART_ENABLED, | ||
905 | CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access); | ||
906 | if (ret) { | ||
907 | ret = -1; | ||
908 | goto done; | ||
909 | } | ||
910 | priv->mesh_autostart_enabled = 0; | ||
911 | } | ||
912 | |||
892 | ret = 0; | 913 | ret = 0; |
893 | done: | 914 | done: |
894 | lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); | 915 | lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); |