Commit c68fb7ff authored by Szymon Janc's avatar Szymon Janc Committed by Gustavo F. Padovan

Bluetooth: Rename cmd to param in pending_cmd

This field holds not whole command but only command specific
parameters.
Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent e0e185ef
...@@ -36,7 +36,7 @@ struct pending_cmd { ...@@ -36,7 +36,7 @@ struct pending_cmd {
struct list_head list; struct list_head list;
__u16 opcode; __u16 opcode;
int index; int index;
void *cmd; void *param;
struct sock *sk; struct sock *sk;
void *user_data; void *user_data;
}; };
...@@ -217,7 +217,7 @@ static int read_controller_info(struct sock *sk, u16 index) ...@@ -217,7 +217,7 @@ static int read_controller_info(struct sock *sk, u16 index)
static void mgmt_pending_free(struct pending_cmd *cmd) static void mgmt_pending_free(struct pending_cmd *cmd)
{ {
sock_put(cmd->sk); sock_put(cmd->sk);
kfree(cmd->cmd); kfree(cmd->param);
kfree(cmd); kfree(cmd);
} }
...@@ -233,13 +233,13 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode, ...@@ -233,13 +233,13 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
cmd->opcode = opcode; cmd->opcode = opcode;
cmd->index = index; cmd->index = index;
cmd->cmd = kmalloc(len, GFP_ATOMIC); cmd->param = kmalloc(len, GFP_ATOMIC);
if (!cmd->cmd) { if (!cmd->param) {
kfree(cmd); kfree(cmd);
return NULL; return NULL;
} }
memcpy(cmd->cmd, data, len); memcpy(cmd->param, data, len);
cmd->sk = sk; cmd->sk = sk;
sock_hold(sk); sock_hold(sk);
...@@ -1426,7 +1426,7 @@ struct cmd_lookup { ...@@ -1426,7 +1426,7 @@ struct cmd_lookup {
static void mode_rsp(struct pending_cmd *cmd, void *data) static void mode_rsp(struct pending_cmd *cmd, void *data)
{ {
struct mgmt_mode *cp = cmd->cmd; struct mgmt_mode *cp = cmd->param;
struct cmd_lookup *match = data; struct cmd_lookup *match = data;
if (cp->val != match->val) if (cp->val != match->val)
...@@ -1525,7 +1525,7 @@ int mgmt_connected(u16 index, bdaddr_t *bdaddr) ...@@ -1525,7 +1525,7 @@ int mgmt_connected(u16 index, bdaddr_t *bdaddr)
static void disconnect_rsp(struct pending_cmd *cmd, void *data) static void disconnect_rsp(struct pending_cmd *cmd, void *data)
{ {
struct mgmt_cp_disconnect *cp = cmd->cmd; struct mgmt_cp_disconnect *cp = cmd->param;
struct sock **sk = data; struct sock **sk = data;
struct mgmt_rp_disconnect rp; struct mgmt_rp_disconnect rp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment