Skip to content

Commit

Permalink
wlcore: add smart_config_start/stop commands
Browse files Browse the repository at this point in the history
These commands configures the fw to enter and
exit smart_config mode.

Signed-off-by: Eliad Peller <eliad@wizery.com>
  • Loading branch information
elp committed May 13, 2013
1 parent 6c2a842 commit 138f70b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
53 changes: 53 additions & 0 deletions drivers/net/wireless/ti/wl18xx/cmd.c
Expand Up @@ -78,3 +78,56 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
out:
return ret;
}

int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap)
{
struct wl18xx_cmd_smart_config_start *cmd;
int ret = 0;

wl1271_debug(DEBUG_CMD, "cmd smart config start group_bitmap=0x%x",
group_bitmap);

cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd) {
ret = -ENOMEM;
goto out;
}

cmd->group_id_bitmask = cpu_to_le32(group_bitmap);

ret = wl1271_cmd_send(wl, CMD_SMART_CONFIG_START, cmd, sizeof(*cmd), 0);
if (ret < 0) {
wl1271_error("failed to send smart config start command");
goto out_free;
}

out_free:
kfree(cmd);
out:
return ret;
}

int wl18xx_cmd_smart_config_stop(struct wl1271 *wl)
{
struct wl1271_cmd_header *cmd;
int ret = 0;

wl1271_debug(DEBUG_CMD, "cmd smart config stop");

cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd) {
ret = -ENOMEM;
goto out;
}

ret = wl1271_cmd_send(wl, CMD_SMART_CONFIG_STOP, cmd, sizeof(*cmd), 0);
if (ret < 0) {
wl1271_error("failed to send smart config stop command");
goto out_free;
}

out_free:
kfree(cmd);
out:
return ret;
}
3 changes: 2 additions & 1 deletion drivers/net/wireless/ti/wl18xx/cmd.h
Expand Up @@ -62,5 +62,6 @@ struct wl18xx_cmd_smart_config_set_group_key {
int wl18xx_cmd_channel_switch(struct wl1271 *wl,
struct wl12xx_vif *wlvif,
struct ieee80211_channel_switch *ch_switch);

int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap);
int wl18xx_cmd_smart_config_stop(struct wl1271 *wl);
#endif

0 comments on commit 138f70b

Please sign in to comment.