aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-02-18 07:53:58 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-02-19 02:44:29 -0500
commit3a6d576be9fe02b0c3ffa89ef6eac048e14eec84 (patch)
tree70bcc5b6861fe48521d9aab181c8d7e0db15c5de /net/bluetooth
parent539c496d88f7f96d42abde4e9d901c8f8167d615 (diff)
Bluetooth: Convert disconn_cfm to be triggered through hci_cb
This patch moves all the disconn_cfm callbacks to be based on the hci_cb list. This means making l2cap_disconn_cfm private to l2cap_core.c and sco_conn_cb private to sco.c respectively. Since the hci_conn type filtering isn't done any more on the wrapper level the callbacks themselves need to check that they were passed a relevant type of connection. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c2
-rw-r--r--net/bluetooth/hci_event.c2
-rw-r--r--net/bluetooth/l2cap_core.c6
-rw-r--r--net/bluetooth/sco.c6
4 files changed, 12 insertions, 4 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index e9206734e024..91ebb9cb31de 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1151,7 +1151,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev)
1151 list_for_each_entry_safe(c, n, &h->list, list) { 1151 list_for_each_entry_safe(c, n, &h->list, list) {
1152 c->state = BT_CLOSED; 1152 c->state = BT_CLOSED;
1153 1153
1154 hci_proto_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM); 1154 hci_disconn_cfm(c, HCI_ERROR_LOCAL_HOST_TERM);
1155 hci_conn_del(c); 1155 hci_conn_del(c);
1156 } 1156 }
1157} 1157}
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 0b599129c64c..e9b17b585ee8 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2444,7 +2444,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2444 2444
2445 type = conn->type; 2445 type = conn->type;
2446 2446
2447 hci_proto_disconn_cfm(conn, ev->reason); 2447 hci_disconn_cfm(conn, ev->reason);
2448 hci_conn_del(conn); 2448 hci_conn_del(conn);
2449 2449
2450 /* Re-enable advertising if necessary, since it might 2450 /* Re-enable advertising if necessary, since it might
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 6e2c3bdda7d3..91c682846bcf 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -7324,8 +7324,11 @@ int l2cap_disconn_ind(struct hci_conn *hcon)
7324 return conn->disc_reason; 7324 return conn->disc_reason;
7325} 7325}
7326 7326
7327void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason) 7327static void l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason)
7328{ 7328{
7329 if (hcon->type != ACL_LINK && hcon->type != LE_LINK)
7330 return;
7331
7329 BT_DBG("hcon %p reason %d", hcon, reason); 7332 BT_DBG("hcon %p reason %d", hcon, reason);
7330 7333
7331 l2cap_conn_del(hcon, bt_to_errno(reason)); 7334 l2cap_conn_del(hcon, bt_to_errno(reason));
@@ -7547,6 +7550,7 @@ drop:
7547static struct hci_cb l2cap_cb = { 7550static struct hci_cb l2cap_cb = {
7548 .name = "L2CAP", 7551 .name = "L2CAP",
7549 .connect_cfm = l2cap_connect_cfm, 7552 .connect_cfm = l2cap_connect_cfm,
7553 .disconn_cfm = l2cap_disconn_cfm,
7550 .security_cfm = l2cap_security_cfm, 7554 .security_cfm = l2cap_security_cfm,
7551}; 7555};
7552 7556
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 3c2e36f94b65..b94c3151896e 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1100,8 +1100,11 @@ static void sco_connect_cfm(struct hci_conn *hcon, __u8 status)
1100 sco_conn_del(hcon, bt_to_errno(status)); 1100 sco_conn_del(hcon, bt_to_errno(status));
1101} 1101}
1102 1102
1103void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) 1103static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)
1104{ 1104{
1105 if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK)
1106 return;
1107
1105 BT_DBG("hcon %p reason %d", hcon, reason); 1108 BT_DBG("hcon %p reason %d", hcon, reason);
1106 1109
1107 sco_conn_del(hcon, bt_to_errno(reason)); 1110 sco_conn_del(hcon, bt_to_errno(reason));
@@ -1129,6 +1132,7 @@ drop:
1129static struct hci_cb sco_cb = { 1132static struct hci_cb sco_cb = {
1130 .name = "SCO", 1133 .name = "SCO",
1131 .connect_cfm = sco_connect_cfm, 1134 .connect_cfm = sco_connect_cfm,
1135 .disconn_cfm = sco_disconn_cfm,
1132}; 1136};
1133 1137
1134static int sco_debugfs_show(struct seq_file *f, void *p) 1138static int sco_debugfs_show(struct seq_file *f, void *p)