diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-10-31 09:46:31 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-11-01 18:27:07 -0400 |
commit | 606e2a10a6d23e900dad0b098a09438a5f7e0495 (patch) | |
tree | 9439603f4a6a2c238828e661ccbc889984ebcb3a | |
parent | 5ce66b59d787478f57a6f3368ff23d75a06e76e2 (diff) |
Bluetooth: AMP: Process Disc Logical Link
Add processing for HCI Disconnection Logical Link Complete
Event.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | include/net/bluetooth/amp.h | 1 | ||||
-rw-r--r-- | net/bluetooth/amp.c | 7 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 28 |
3 files changed, 36 insertions, 0 deletions
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h index 70d5c153de15..405fb9c987ef 100644 --- a/include/net/bluetooth/amp.h +++ b/include/net/bluetooth/amp.h | |||
@@ -47,5 +47,6 @@ void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | 47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); |
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | 48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); |
49 | void amp_create_logical_link(struct l2cap_chan *chan); | 49 | void amp_create_logical_link(struct l2cap_chan *chan); |
50 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
50 | 51 | ||
51 | #endif /* __AMP_H */ | 52 | #endif /* __AMP_H */ |
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c index fbb63605a27e..0f3fef34eabc 100644 --- a/net/bluetooth/amp.c +++ b/net/bluetooth/amp.c | |||
@@ -421,3 +421,10 @@ void amp_create_logical_link(struct l2cap_chan *chan) | |||
421 | done: | 421 | done: |
422 | hci_dev_put(hdev); | 422 | hci_dev_put(hdev); |
423 | } | 423 | } |
424 | |||
425 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason) | ||
426 | { | ||
427 | BT_DBG("hchan %p", hchan); | ||
428 | |||
429 | hci_chan_del(hchan); | ||
430 | } | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 14cad155af3c..07dce614f81a 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3741,6 +3741,30 @@ static void hci_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3741 | } | 3741 | } |
3742 | } | 3742 | } |
3743 | 3743 | ||
3744 | static void hci_disconn_loglink_complete_evt(struct hci_dev *hdev, | ||
3745 | struct sk_buff *skb) | ||
3746 | { | ||
3747 | struct hci_ev_disconn_logical_link_complete *ev = (void *) skb->data; | ||
3748 | struct hci_chan *hchan; | ||
3749 | |||
3750 | BT_DBG("%s log handle 0x%4.4x status 0x%2.2x", hdev->name, | ||
3751 | le16_to_cpu(ev->handle), ev->status); | ||
3752 | |||
3753 | if (ev->status) | ||
3754 | return; | ||
3755 | |||
3756 | hci_dev_lock(hdev); | ||
3757 | |||
3758 | hchan = hci_chan_lookup_handle(hdev, le16_to_cpu(ev->handle)); | ||
3759 | if (!hchan) | ||
3760 | goto unlock; | ||
3761 | |||
3762 | amp_destroy_logical_link(hchan, ev->reason); | ||
3763 | |||
3764 | unlock: | ||
3765 | hci_dev_unlock(hdev); | ||
3766 | } | ||
3767 | |||
3744 | static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | 3768 | static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) |
3745 | { | 3769 | { |
3746 | struct hci_ev_le_conn_complete *ev = (void *) skb->data; | 3770 | struct hci_ev_le_conn_complete *ev = (void *) skb->data; |
@@ -4076,6 +4100,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
4076 | hci_loglink_complete_evt(hdev, skb); | 4100 | hci_loglink_complete_evt(hdev, skb); |
4077 | break; | 4101 | break; |
4078 | 4102 | ||
4103 | case HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE: | ||
4104 | hci_disconn_loglink_complete_evt(hdev, skb); | ||
4105 | break; | ||
4106 | |||
4079 | case HCI_EV_NUM_COMP_BLOCKS: | 4107 | case HCI_EV_NUM_COMP_BLOCKS: |
4080 | hci_num_comp_blocks_evt(hdev, skb); | 4108 | hci_num_comp_blocks_evt(hdev, skb); |
4081 | break; | 4109 | break; |