aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-10-25 08:20:44 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-01 18:27:02 -0400
commitd5e911928bd8325918bda3df59e84b0c17a0cdab (patch)
tree69dfd05dd7b445630683679271d7bdddb56c76af /net/bluetooth/hci_event.c
parent35ba9561b9b5dc1e5921b927440bd6d3844f0577 (diff)
Bluetooth: AMP: Process Physical Link Complete evt
Add processing for HCI Physical Link Complete event. Upon successful status received start L2CAP create channel process. 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>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index dc60d3161824..d2c45591f06d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3644,6 +3644,57 @@ unlock:
3644 hci_dev_unlock(hdev); 3644 hci_dev_unlock(hdev);
3645} 3645}
3646 3646
3647static void hci_phy_link_complete_evt(struct hci_dev *hdev,
3648 struct sk_buff *skb)
3649{
3650 struct hci_ev_phy_link_complete *ev = (void *) skb->data;
3651 struct hci_conn *hcon, *bredr_hcon;
3652
3653 BT_DBG("%s handle 0x%2.2x status 0x%2.2x", hdev->name, ev->phy_handle,
3654 ev->status);
3655
3656 hci_dev_lock(hdev);
3657
3658 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle);
3659 if (!hcon) {
3660 hci_dev_unlock(hdev);
3661 return;
3662 }
3663
3664 if (ev->status) {
3665 hci_conn_del(hcon);
3666 hci_dev_unlock(hdev);
3667 return;
3668 }
3669
3670 bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;
3671
3672 hcon->state = BT_CONNECTED;
3673 bacpy(&hcon->dst, &bredr_hcon->dst);
3674
3675 hci_conn_hold(hcon);
3676 hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
3677 hci_conn_put(hcon);
3678
3679 hci_conn_hold_device(hcon);
3680 hci_conn_add_sysfs(hcon);
3681
3682 hci_dev_unlock(hdev);
3683
3684 if (hcon->out) {
3685 struct hci_dev *bredr_hdev = hci_dev_hold(bredr_hcon->hdev);
3686
3687 if (!bredr_hdev)
3688 return;
3689
3690 /* Placeholder - create chan req
3691 l2cap_chan_create_cfm(bredr_hcon, hcon->remote_id);
3692 */
3693
3694 hci_dev_put(bredr_hdev);
3695 }
3696}
3697
3647static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 3698static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
3648{ 3699{
3649 struct hci_ev_le_conn_complete *ev = (void *) skb->data; 3700 struct hci_ev_le_conn_complete *ev = (void *) skb->data;
@@ -3971,6 +4022,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
3971 hci_remote_oob_data_request_evt(hdev, skb); 4022 hci_remote_oob_data_request_evt(hdev, skb);
3972 break; 4023 break;
3973 4024
4025 case HCI_EV_PHY_LINK_COMPLETE:
4026 hci_phy_link_complete_evt(hdev, skb);
4027 break;
4028
3974 case HCI_EV_NUM_COMP_BLOCKS: 4029 case HCI_EV_NUM_COMP_BLOCKS:
3975 hci_num_comp_blocks_evt(hdev, skb); 4030 hci_num_comp_blocks_evt(hdev, skb);
3976 break; 4031 break;