aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-10-25 08:20:45 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-01 18:27:02 -0400
commit27695fb415ab150e1972a882c2538bf9bf130cb0 (patch)
tree7b24d0d8d88d691f02856f2ff63cce553da23fe2
parentd5e911928bd8325918bda3df59e84b0c17a0cdab (diff)
Bluetooth: AMP: Process Logical Link complete evt
After receiving HCI Logical Link Complete event finish EFS configuration by sending L2CAP Conf Response with success code. 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/l2cap.h2
-rw-r--r--net/bluetooth/hci_event.c42
-rw-r--r--net/bluetooth/l2cap_core.c4
3 files changed, 46 insertions, 2 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 49783e948856..24c61ef933b5 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -810,5 +810,7 @@ void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
810void l2cap_chan_del(struct l2cap_chan *chan, int err); 810void l2cap_chan_del(struct l2cap_chan *chan, int err);
811void l2cap_send_conn_req(struct l2cap_chan *chan); 811void l2cap_send_conn_req(struct l2cap_chan *chan);
812void l2cap_move_start(struct l2cap_chan *chan); 812void l2cap_move_start(struct l2cap_chan *chan);
813void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
814 u8 status);
813 815
814#endif /* __L2CAP_H */ 816#endif /* __L2CAP_H */
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d2c45591f06d..aa79ed278959 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3695,6 +3695,44 @@ static void hci_phy_link_complete_evt(struct hci_dev *hdev,
3695 } 3695 }
3696} 3696}
3697 3697
3698static void hci_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
3699{
3700 struct hci_ev_logical_link_complete *ev = (void *) skb->data;
3701 struct hci_conn *hcon;
3702 struct hci_chan *hchan;
3703 struct amp_mgr *mgr;
3704
3705 BT_DBG("%s log_handle 0x%4.4x phy_handle 0x%2.2x status 0x%2.2x",
3706 hdev->name, le16_to_cpu(ev->handle), ev->phy_handle,
3707 ev->status);
3708
3709 hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle);
3710 if (!hcon)
3711 return;
3712
3713 /* Create AMP hchan */
3714 hchan = hci_chan_create(hcon);
3715 if (!hchan)
3716 return;
3717
3718 hchan->handle = le16_to_cpu(ev->handle);
3719
3720 BT_DBG("hcon %p mgr %p hchan %p", hcon, hcon->amp_mgr, hchan);
3721
3722 mgr = hcon->amp_mgr;
3723 if (mgr && mgr->bredr_chan) {
3724 struct l2cap_chan *bredr_chan = mgr->bredr_chan;
3725
3726 l2cap_chan_lock(bredr_chan);
3727
3728 bredr_chan->conn->mtu = hdev->block_mtu;
3729 l2cap_logical_cfm(bredr_chan, hchan, 0);
3730 hci_conn_hold(hcon);
3731
3732 l2cap_chan_unlock(bredr_chan);
3733 }
3734}
3735
3698static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 3736static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
3699{ 3737{
3700 struct hci_ev_le_conn_complete *ev = (void *) skb->data; 3738 struct hci_ev_le_conn_complete *ev = (void *) skb->data;
@@ -4026,6 +4064,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
4026 hci_phy_link_complete_evt(hdev, skb); 4064 hci_phy_link_complete_evt(hdev, skb);
4027 break; 4065 break;
4028 4066
4067 case HCI_EV_LOGICAL_LINK_COMPLETE:
4068 hci_loglink_complete_evt(hdev, skb);
4069 break;
4070
4029 case HCI_EV_NUM_COMP_BLOCKS: 4071 case HCI_EV_NUM_COMP_BLOCKS:
4030 hci_num_comp_blocks_evt(hdev, skb); 4072 hci_num_comp_blocks_evt(hdev, skb);
4031 break; 4073 break;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 600d8080f234..d1728af8e84f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4428,8 +4428,8 @@ static void l2cap_logical_finish_move(struct l2cap_chan *chan,
4428} 4428}
4429 4429
4430/* Call with chan locked */ 4430/* Call with chan locked */
4431static void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, 4431void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
4432 u8 status) 4432 u8 status)
4433{ 4433{
4434 BT_DBG("chan %p, hchan %p, status %d", chan, hchan, status); 4434 BT_DBG("chan %p, hchan %p, status %d", chan, hchan, status);
4435 4435