Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrei Emeltchenko and committed by
Gustavo Padovan
d5e91192 35ba9561

+55
+55
net/bluetooth/hci_event.c
··· 3644 3644 hci_dev_unlock(hdev); 3645 3645 } 3646 3646 3647 + static 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 + 3647 3698 static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 3648 3699 { 3649 3700 struct hci_ev_le_conn_complete *ev = (void *) skb->data; ··· 4020 3969 4021 3970 case HCI_EV_REMOTE_OOB_DATA_REQUEST: 4022 3971 hci_remote_oob_data_request_evt(hdev, skb); 3972 + break; 3973 + 3974 + case HCI_EV_PHY_LINK_COMPLETE: 3975 + hci_phy_link_complete_evt(hdev, skb); 4023 3976 break; 4024 3977 4025 3978 case HCI_EV_NUM_COMP_BLOCKS: