summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2013-03-27 16:21:12 +0400
committerEliad Peller <eliad@wizery.com>2013-07-22 14:01:47 +0400
commitd6ba9ff73313997ee049e311b2484bbc8c449d2d (patch)
tree86d9a5eb08f0066fb5397d6ced1c1b90d7587bc9
parent04523b07db0633a5ca2d0152149cb4e6b182dc04 (diff)
downloadwl18xx-d6ba9ff73313997ee049e311b2484bbc8c449d2d.tar.xz
wlcore: add smart_config set group key command
implement wlcore_cmd_smart_config_set_group_key which will be used in order to configure a key for a smart_config group. Signed-off-by: Eliad Peller <eliad@wizery.com>
-rw-r--r--drivers/net/wireless/ti/wl18xx/cmd.c36
-rw-r--r--drivers/net/wireless/ti/wl18xx/cmd.h2
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/cmd.c b/drivers/net/wireless/ti/wl18xx/cmd.c
index 86c1d7d803e..decde68c68c 100644
--- a/drivers/net/wireless/ti/wl18xx/cmd.c
+++ b/drivers/net/wireless/ti/wl18xx/cmd.c
@@ -131,3 +131,39 @@ out_free:
out:
return ret;
}
+
+int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id,
+ u8 key_len, u8 *key)
+{
+ struct wl18xx_cmd_smart_config_set_group_key *cmd;
+ int ret = 0;
+
+ wl1271_debug(DEBUG_CMD, "cmd smart config set group key id=0x%x",
+ group_id);
+
+ if (key_len != sizeof(cmd->key)) {
+ wl1271_error("invalid group key size: %d", key_len);
+ return -E2BIG;
+ }
+
+ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+ if (!cmd) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ cmd->group_id = cpu_to_le32(group_id);
+ memcpy(cmd->key, key, key_len);
+
+ ret = wl1271_cmd_send(wl, CMD_SMART_CONFIG_SET_GROUP_KEY, cmd,
+ sizeof(*cmd), 0);
+ if (ret < 0) {
+ wl1271_error("failed to send smart config set group key cmd");
+ goto out_free;
+ }
+
+out_free:
+ kfree(cmd);
+out:
+ return ret;
+}
diff --git a/drivers/net/wireless/ti/wl18xx/cmd.h b/drivers/net/wireless/ti/wl18xx/cmd.h
index 164fb595075..92499e2dfa8 100644
--- a/drivers/net/wireless/ti/wl18xx/cmd.h
+++ b/drivers/net/wireless/ti/wl18xx/cmd.h
@@ -64,4 +64,6 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
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);
+int wl18xx_cmd_smart_config_set_group_key(struct wl1271 *wl, u16 group_id,
+ u8 key_len, u8 *key);
#endif