aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-10-15 11:30:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-16 02:14:30 -0400
commit4c67bc74f016b0d360b8573e18969c0ff7926974 (patch)
treed5eec3da59b642f48e7fcc2034b6d90b5fa54e01 /net/bluetooth/hci_event.c
parente9c4bec63eac001651d6d30239dd4175cc3698ef (diff)
[Bluetooth] Support concurrent connect requests
Most Bluetooth chips don't support concurrent connect requests, because this would involve a multiple baseband page with only one radio. In the case an upper layer like L2CAP requests a concurrent connect these chips return the error "Command Disallowed" for the second request. If this happens it the responsibility of the Bluetooth core to queue the request and try again after the previous connect attempt has been completed. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d43d0c890975..65f094845719 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -414,9 +414,12 @@ static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
414 414
415 if (status) { 415 if (status) {
416 if (conn && conn->state == BT_CONNECT) { 416 if (conn && conn->state == BT_CONNECT) {
417 conn->state = BT_CLOSED; 417 if (status != 0x0c || conn->attempt > 2) {
418 hci_proto_connect_cfm(conn, status); 418 conn->state = BT_CLOSED;
419 hci_conn_del(conn); 419 hci_proto_connect_cfm(conn, status);
420 hci_conn_del(conn);
421 } else
422 conn->state = BT_CONNECT2;
420 } 423 }
421 } else { 424 } else {
422 if (!conn) { 425 if (!conn) {
@@ -728,7 +731,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
728static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 731static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
729{ 732{
730 struct hci_ev_conn_complete *ev = (struct hci_ev_conn_complete *) skb->data; 733 struct hci_ev_conn_complete *ev = (struct hci_ev_conn_complete *) skb->data;
731 struct hci_conn *conn; 734 struct hci_conn *conn, *pend;
732 735
733 BT_DBG("%s", hdev->name); 736 BT_DBG("%s", hdev->name);
734 737
@@ -801,6 +804,10 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
801 if (ev->status) 804 if (ev->status)
802 hci_conn_del(conn); 805 hci_conn_del(conn);
803 806
807 pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
808 if (pend)
809 hci_acl_connect(pend);
810
804 hci_dev_unlock(hdev); 811 hci_dev_unlock(hdev);
805} 812}
806 813