• Home
  • Raw
  • Download

Lines Matching refs:cmd

93 int mgmt_cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status)  in mgmt_cmd_status()  argument
100 BT_DBG("sock %p, index %u, cmd %u, status %u", sk, index, cmd, status); in mgmt_cmd_status()
114 ev->opcode = cpu_to_le16(cmd); in mgmt_cmd_status()
136 int mgmt_cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status, in mgmt_cmd_complete() argument
157 ev->opcode = cpu_to_le16(cmd); in mgmt_cmd_complete()
187 struct mgmt_pending_cmd *cmd; in mgmt_pending_find() local
189 list_for_each_entry(cmd, &hdev->mgmt_pending, list) { in mgmt_pending_find()
190 if (hci_sock_get_channel(cmd->sk) != channel) in mgmt_pending_find()
192 if (cmd->opcode == opcode) in mgmt_pending_find()
193 return cmd; in mgmt_pending_find()
204 struct mgmt_pending_cmd *cmd; in mgmt_pending_find_data() local
206 list_for_each_entry(cmd, &hdev->mgmt_pending, list) { in mgmt_pending_find_data()
207 if (cmd->user_data != data) in mgmt_pending_find_data()
209 if (cmd->opcode == opcode) in mgmt_pending_find_data()
210 return cmd; in mgmt_pending_find_data()
217 void (*cb)(struct mgmt_pending_cmd *cmd, void *data), in mgmt_pending_foreach() argument
220 struct mgmt_pending_cmd *cmd, *tmp; in mgmt_pending_foreach() local
222 list_for_each_entry_safe(cmd, tmp, &hdev->mgmt_pending, list) { in mgmt_pending_foreach()
223 if (opcode > 0 && cmd->opcode != opcode) in mgmt_pending_foreach()
226 cb(cmd, data); in mgmt_pending_foreach()
234 struct mgmt_pending_cmd *cmd; in mgmt_pending_add() local
236 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); in mgmt_pending_add()
237 if (!cmd) in mgmt_pending_add()
240 cmd->opcode = opcode; in mgmt_pending_add()
241 cmd->index = hdev->id; in mgmt_pending_add()
243 cmd->param = kmemdup(data, len, GFP_KERNEL); in mgmt_pending_add()
244 if (!cmd->param) { in mgmt_pending_add()
245 kfree(cmd); in mgmt_pending_add()
249 cmd->param_len = len; in mgmt_pending_add()
251 cmd->sk = sk; in mgmt_pending_add()
254 list_add(&cmd->list, &hdev->mgmt_pending); in mgmt_pending_add()
256 return cmd; in mgmt_pending_add()
259 void mgmt_pending_free(struct mgmt_pending_cmd *cmd) in mgmt_pending_free() argument
261 sock_put(cmd->sk); in mgmt_pending_free()
262 kfree(cmd->param); in mgmt_pending_free()
263 kfree(cmd); in mgmt_pending_free()
266 void mgmt_pending_remove(struct mgmt_pending_cmd *cmd) in mgmt_pending_remove() argument
268 list_del(&cmd->list); in mgmt_pending_remove()
269 mgmt_pending_free(cmd); in mgmt_pending_remove()