diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2011-01-20 05:40:27 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:40:07 -0500 |
commit | 8962ee74be48df16027100f657b2b12e8ef3d34d (patch) | |
tree | bbafd1e6cf773c4712c57f578c84f44eae012ec0 /net/bluetooth/hci_event.c | |
parent | f7520543ab40341edbc2aeee7fef68218be19a0a (diff) |
Bluetooth: Add disconnect managment command
This patch adds a disconnect command to the managment interface. Using
this command user space is able to force the disconnection of connected
devices. The command maps directly to the Disconnect HCI command.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 46ddb029912b..335c60bad96c 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1264,8 +1264,10 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
1264 | 1264 | ||
1265 | BT_DBG("%s status %d", hdev->name, ev->status); | 1265 | BT_DBG("%s status %d", hdev->name, ev->status); |
1266 | 1266 | ||
1267 | if (ev->status) | 1267 | if (ev->status) { |
1268 | mgmt_disconnect_failed(hdev->id); | ||
1268 | return; | 1269 | return; |
1270 | } | ||
1269 | 1271 | ||
1270 | hci_dev_lock(hdev); | 1272 | hci_dev_lock(hdev); |
1271 | 1273 | ||
@@ -1680,6 +1682,11 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
1680 | hci_cs_exit_sniff_mode(hdev, ev->status); | 1682 | hci_cs_exit_sniff_mode(hdev, ev->status); |
1681 | break; | 1683 | break; |
1682 | 1684 | ||
1685 | case HCI_OP_DISCONNECT: | ||
1686 | if (ev->status != 0) | ||
1687 | mgmt_disconnect_failed(hdev->id); | ||
1688 | break; | ||
1689 | |||
1683 | default: | 1690 | default: |
1684 | BT_DBG("%s opcode 0x%x", hdev->name, opcode); | 1691 | BT_DBG("%s opcode 0x%x", hdev->name, opcode); |
1685 | break; | 1692 | break; |