aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-11-18 16:14:22 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-11-21 19:16:29 -0500
commit6bd57416127e92d35e6798925502c84e14a3a966 (patch)
treea77850c5390a072bc977d92327a07a14c0dda2a7 /net/bluetooth/hci_event.c
parente52726dece1d2e3976c0caf2f4e9e1c452d31282 (diff)
[Bluetooth] Handling pending connect attempts after inquiry
After an inquiry completed or got canceled the Bluetooth core should check for any pending connect attempts. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 65f094845719..bb94e6da223c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -57,6 +57,7 @@
57static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb) 57static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
58{ 58{
59 __u8 status; 59 __u8 status;
60 struct hci_conn *pend;
60 61
61 BT_DBG("%s ocf 0x%x", hdev->name, ocf); 62 BT_DBG("%s ocf 0x%x", hdev->name, ocf);
62 63
@@ -71,6 +72,15 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
71 clear_bit(HCI_INQUIRY, &hdev->flags); 72 clear_bit(HCI_INQUIRY, &hdev->flags);
72 hci_req_complete(hdev, status); 73 hci_req_complete(hdev, status);
73 } 74 }
75
76 hci_dev_lock(hdev);
77
78 pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
79 if (pend)
80 hci_acl_connect(pend);
81
82 hci_dev_unlock(hdev);
83
74 break; 84 break;
75 85
76 default: 86 default:
@@ -565,11 +575,20 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status)
565static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 575static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
566{ 576{
567 __u8 status = *((__u8 *) skb->data); 577 __u8 status = *((__u8 *) skb->data);
578 struct hci_conn *pend;
568 579
569 BT_DBG("%s status %d", hdev->name, status); 580 BT_DBG("%s status %d", hdev->name, status);
570 581
571 clear_bit(HCI_INQUIRY, &hdev->flags); 582 clear_bit(HCI_INQUIRY, &hdev->flags);
572 hci_req_complete(hdev, status); 583 hci_req_complete(hdev, status);
584
585 hci_dev_lock(hdev);
586
587 pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
588 if (pend)
589 hci_acl_connect(pend);
590
591 hci_dev_unlock(hdev);
573} 592}
574 593
575/* Inquiry Result */ 594/* Inquiry Result */