aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndi Kleen <andi@basil.nowhere.org>2006-11-28 14:12:29 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-11-28 14:12:29 -0500
commita3550a9c543556cf7764be81aeb17c6dab440753 (patch)
treee8c8bf721cc917c8842c4a007ad4b3f68eb7aa1e /net/bluetooth
parent9a14f2964b459c18198ee59ff7212321def82df7 (diff)
parent2ea5814472c3c910aed5c5b60f1f3b1000e353f1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_event.c19
-rw-r--r--net/bluetooth/hci_sock.c11
-rw-r--r--net/bluetooth/hci_sysfs.c4
-rw-r--r--net/bluetooth/l2cap.c11
-rw-r--r--net/bluetooth/rfcomm/tty.c2
5 files changed, 37 insertions, 10 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 */
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index f26a9eb49945..711a085eca5b 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
120 if (!hci_test_bit(evt, &flt->event_mask)) 120 if (!hci_test_bit(evt, &flt->event_mask))
121 continue; 121 continue;
122 122
123 if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && 123 if (flt->opcode &&
124 flt->opcode != *(__u16 *)(skb->data + 3)) || 124 ((evt == HCI_EV_CMD_COMPLETE &&
125 (evt == HCI_EV_CMD_STATUS && 125 flt->opcode !=
126 flt->opcode != *(__u16 *)(skb->data + 4)))) 126 get_unaligned((__u16 *)(skb->data + 3))) ||
127 (evt == HCI_EV_CMD_STATUS &&
128 flt->opcode !=
129 get_unaligned((__u16 *)(skb->data + 4)))))
127 continue; 130 continue;
128 } 131 }
129 132
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 954eb74eb370..3eeeb7a86e75 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -259,7 +259,9 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
259 259
260 BT_DBG("conn %p", conn); 260 BT_DBG("conn %p", conn);
261 261
262 conn->dev.parent = &hdev->dev; 262 conn->dev.bus = &bt_bus;
263 conn->dev.parent = &hdev->dev;
264
263 conn->dev.release = bt_release; 265 conn->dev.release = bt_release;
264 266
265 snprintf(conn->dev.bus_id, BUS_ID_SIZE, 267 snprintf(conn->dev.bus_id, BUS_ID_SIZE,
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 2b3dcb8f90fa..bbf78e6a7bc3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1353,12 +1353,12 @@ static inline int l2cap_conf_output(struct sock *sk, void **ptr)
1353 1353
1354 /* Configure output options and let the other side know 1354 /* Configure output options and let the other side know
1355 * which ones we don't like. */ 1355 * which ones we don't like. */
1356 if (pi->conf_mtu < pi->omtu) { 1356 if (pi->conf_mtu < pi->omtu)
1357 l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
1358 result = L2CAP_CONF_UNACCEPT; 1357 result = L2CAP_CONF_UNACCEPT;
1359 } else { 1358 else
1360 pi->omtu = pi->conf_mtu; 1359 pi->omtu = pi->conf_mtu;
1361 } 1360
1361 l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
1362 1362
1363 BT_DBG("sk %p result %d", sk, result); 1363 BT_DBG("sk %p result %d", sk, result);
1364 return result; 1364 return result;
@@ -1533,6 +1533,9 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
1533 if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid))) 1533 if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid)))
1534 return -ENOENT; 1534 return -ENOENT;
1535 1535
1536 if (sk->sk_state == BT_DISCONN)
1537 goto unlock;
1538
1536 l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req)); 1539 l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req));
1537 1540
1538 if (flags & 0x0001) { 1541 if (flags & 0x0001) {
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index b8e3a5f1c8a8..1fb5d42f37ae 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -765,7 +765,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old)
765 765
766 BT_DBG("tty %p termios %p", tty, old); 766 BT_DBG("tty %p termios %p", tty, old);
767 767
768 if (!dev) 768 if (!dev || !dev->dlc || !dev->dlc->session)
769 return; 769 return;
770 770
771 /* Handle turning off CRTSCTS */ 771 /* Handle turning off CRTSCTS */