diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-05 06:36:05 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-12-05 06:46:10 -0500 |
commit | d8b7b1e49abe98d67f589d6326658a48d810f875 (patch) | |
tree | aa566c974437c47378c45c886b199adcc109b5ee /net/bluetooth/mgmt.c | |
parent | 04ab2749ea96a79f5eba3ca26d46f4283b5509a6 (diff) |
Bluetooth: Convert Unpair Device to use cmd_complete callback
This patch updates the Unpair Device code to take advantage of the
cmd_complete callback of struct pending_cmd.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d3ee7285c303..1accbb9d1a36 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -2821,6 +2821,8 @@ static int unpair_device(struct sock *sk, struct hci_dev *hdev, void *data, | |||
2821 | goto unlock; | 2821 | goto unlock; |
2822 | } | 2822 | } |
2823 | 2823 | ||
2824 | cmd->cmd_complete = addr_cmd_complete; | ||
2825 | |||
2824 | dc.handle = cpu_to_le16(conn->handle); | 2826 | dc.handle = cpu_to_le16(conn->handle); |
2825 | dc.reason = 0x13; /* Remote User Terminated Connection */ | 2827 | dc.reason = 0x13; /* Remote User Terminated Connection */ |
2826 | err = hci_send_cmd(hdev, HCI_OP_DISCONNECT, sizeof(dc), &dc); | 2828 | err = hci_send_cmd(hdev, HCI_OP_DISCONNECT, sizeof(dc), &dc); |
@@ -6430,16 +6432,10 @@ static void unpair_device_rsp(struct pending_cmd *cmd, void *data) | |||
6430 | { | 6432 | { |
6431 | struct hci_dev *hdev = data; | 6433 | struct hci_dev *hdev = data; |
6432 | struct mgmt_cp_unpair_device *cp = cmd->param; | 6434 | struct mgmt_cp_unpair_device *cp = cmd->param; |
6433 | struct mgmt_rp_unpair_device rp; | ||
6434 | |||
6435 | memset(&rp, 0, sizeof(rp)); | ||
6436 | bacpy(&rp.addr.bdaddr, &cp->addr.bdaddr); | ||
6437 | rp.addr.type = cp->addr.type; | ||
6438 | 6435 | ||
6439 | device_unpaired(hdev, &cp->addr.bdaddr, cp->addr.type, cmd->sk); | 6436 | device_unpaired(hdev, &cp->addr.bdaddr, cp->addr.type, cmd->sk); |
6440 | 6437 | ||
6441 | cmd_complete(cmd->sk, cmd->index, cmd->opcode, 0, &rp, sizeof(rp)); | 6438 | cmd->cmd_complete(cmd, 0); |
6442 | |||
6443 | mgmt_pending_remove(cmd); | 6439 | mgmt_pending_remove(cmd); |
6444 | } | 6440 | } |
6445 | 6441 | ||