diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-06-15 04:50:28 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-06-30 10:41:24 -0400 |
commit | 38b3fef1730319e2730af3fc9f73698e3a9aeb4a (patch) | |
tree | 28a2d3cebb79bf7ce6dff00f27da730cc92562f5 /net/bluetooth/hci_conn.c | |
parent | b82c29d81df0ead8b66041702d1dd88e778ab806 (diff) |
Bluetooth: Improve debugging messages for hci_conn
Improve debugging of hci_conn objects by: adding print to hci_conn
refcounting, adding object spcifier when missing, change conn to hcon
since conn is heavily used for l2cap_conn objects and this is misleading.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r-- | net/bluetooth/hci_conn.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 2fcced377e50..9bbef6e95d2c 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -107,7 +107,7 @@ static void hci_acl_connect_cancel(struct hci_conn *conn) | |||
107 | { | 107 | { |
108 | struct hci_cp_create_conn_cancel cp; | 108 | struct hci_cp_create_conn_cancel cp; |
109 | 109 | ||
110 | BT_DBG("%p", conn); | 110 | BT_DBG("hcon %p", conn); |
111 | 111 | ||
112 | if (conn->hdev->hci_ver < BLUETOOTH_VER_1_2) | 112 | if (conn->hdev->hci_ver < BLUETOOTH_VER_1_2) |
113 | return; | 113 | return; |
@@ -120,7 +120,7 @@ void hci_acl_disconn(struct hci_conn *conn, __u8 reason) | |||
120 | { | 120 | { |
121 | struct hci_cp_disconnect cp; | 121 | struct hci_cp_disconnect cp; |
122 | 122 | ||
123 | BT_DBG("%p", conn); | 123 | BT_DBG("hcon %p", conn); |
124 | 124 | ||
125 | conn->state = BT_DISCONN; | 125 | conn->state = BT_DISCONN; |
126 | 126 | ||
@@ -134,7 +134,7 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle) | |||
134 | struct hci_dev *hdev = conn->hdev; | 134 | struct hci_dev *hdev = conn->hdev; |
135 | struct hci_cp_add_sco cp; | 135 | struct hci_cp_add_sco cp; |
136 | 136 | ||
137 | BT_DBG("%p", conn); | 137 | BT_DBG("hcon %p", conn); |
138 | 138 | ||
139 | conn->state = BT_CONNECT; | 139 | conn->state = BT_CONNECT; |
140 | conn->out = true; | 140 | conn->out = true; |
@@ -152,7 +152,7 @@ void hci_setup_sync(struct hci_conn *conn, __u16 handle) | |||
152 | struct hci_dev *hdev = conn->hdev; | 152 | struct hci_dev *hdev = conn->hdev; |
153 | struct hci_cp_setup_sync_conn cp; | 153 | struct hci_cp_setup_sync_conn cp; |
154 | 154 | ||
155 | BT_DBG("%p", conn); | 155 | BT_DBG("hcon %p", conn); |
156 | 156 | ||
157 | conn->state = BT_CONNECT; | 157 | conn->state = BT_CONNECT; |
158 | conn->out = true; | 158 | conn->out = true; |
@@ -196,7 +196,7 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], | |||
196 | struct hci_dev *hdev = conn->hdev; | 196 | struct hci_dev *hdev = conn->hdev; |
197 | struct hci_cp_le_start_enc cp; | 197 | struct hci_cp_le_start_enc cp; |
198 | 198 | ||
199 | BT_DBG("%p", conn); | 199 | BT_DBG("hcon %p", conn); |
200 | 200 | ||
201 | memset(&cp, 0, sizeof(cp)); | 201 | memset(&cp, 0, sizeof(cp)); |
202 | 202 | ||
@@ -213,11 +213,11 @@ void hci_sco_setup(struct hci_conn *conn, __u8 status) | |||
213 | { | 213 | { |
214 | struct hci_conn *sco = conn->link; | 214 | struct hci_conn *sco = conn->link; |
215 | 215 | ||
216 | BT_DBG("%p", conn); | ||
217 | |||
218 | if (!sco) | 216 | if (!sco) |
219 | return; | 217 | return; |
220 | 218 | ||
219 | BT_DBG("hcon %p", conn); | ||
220 | |||
221 | if (!status) { | 221 | if (!status) { |
222 | if (lmp_esco_capable(conn->hdev)) | 222 | if (lmp_esco_capable(conn->hdev)) |
223 | hci_setup_sync(sco, conn->handle); | 223 | hci_setup_sync(sco, conn->handle); |
@@ -235,7 +235,7 @@ static void hci_conn_timeout(struct work_struct *work) | |||
235 | disc_work.work); | 235 | disc_work.work); |
236 | __u8 reason; | 236 | __u8 reason; |
237 | 237 | ||
238 | BT_DBG("conn %p state %s", conn, state_to_string(conn->state)); | 238 | BT_DBG("hcon %p state %s", conn, state_to_string(conn->state)); |
239 | 239 | ||
240 | if (atomic_read(&conn->refcnt)) | 240 | if (atomic_read(&conn->refcnt)) |
241 | return; | 241 | return; |
@@ -266,7 +266,7 @@ static void hci_conn_enter_sniff_mode(struct hci_conn *conn) | |||
266 | { | 266 | { |
267 | struct hci_dev *hdev = conn->hdev; | 267 | struct hci_dev *hdev = conn->hdev; |
268 | 268 | ||
269 | BT_DBG("conn %p mode %d", conn, conn->mode); | 269 | BT_DBG("hcon %p mode %d", conn, conn->mode); |
270 | 270 | ||
271 | if (test_bit(HCI_RAW, &hdev->flags)) | 271 | if (test_bit(HCI_RAW, &hdev->flags)) |
272 | return; | 272 | return; |
@@ -301,7 +301,7 @@ static void hci_conn_idle(unsigned long arg) | |||
301 | { | 301 | { |
302 | struct hci_conn *conn = (void *) arg; | 302 | struct hci_conn *conn = (void *) arg; |
303 | 303 | ||
304 | BT_DBG("conn %p mode %d", conn, conn->mode); | 304 | BT_DBG("hcon %p mode %d", conn, conn->mode); |
305 | 305 | ||
306 | hci_conn_enter_sniff_mode(conn); | 306 | hci_conn_enter_sniff_mode(conn); |
307 | } | 307 | } |
@@ -382,7 +382,7 @@ int hci_conn_del(struct hci_conn *conn) | |||
382 | { | 382 | { |
383 | struct hci_dev *hdev = conn->hdev; | 383 | struct hci_dev *hdev = conn->hdev; |
384 | 384 | ||
385 | BT_DBG("%s conn %p handle %d", hdev->name, conn, conn->handle); | 385 | BT_DBG("%s hcon %p handle %d", hdev->name, conn, conn->handle); |
386 | 386 | ||
387 | del_timer(&conn->idle_timer); | 387 | del_timer(&conn->idle_timer); |
388 | 388 | ||
@@ -557,7 +557,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | |||
557 | /* Check link security requirement */ | 557 | /* Check link security requirement */ |
558 | int hci_conn_check_link_mode(struct hci_conn *conn) | 558 | int hci_conn_check_link_mode(struct hci_conn *conn) |
559 | { | 559 | { |
560 | BT_DBG("conn %p", conn); | 560 | BT_DBG("hcon %p", conn); |
561 | 561 | ||
562 | if (hci_conn_ssp_enabled(conn) && !(conn->link_mode & HCI_LM_ENCRYPT)) | 562 | if (hci_conn_ssp_enabled(conn) && !(conn->link_mode & HCI_LM_ENCRYPT)) |
563 | return 0; | 563 | return 0; |
@@ -568,7 +568,7 @@ int hci_conn_check_link_mode(struct hci_conn *conn) | |||
568 | /* Authenticate remote device */ | 568 | /* Authenticate remote device */ |
569 | static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | 569 | static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) |
570 | { | 570 | { |
571 | BT_DBG("conn %p", conn); | 571 | BT_DBG("hcon %p", conn); |
572 | 572 | ||
573 | if (conn->pending_sec_level > sec_level) | 573 | if (conn->pending_sec_level > sec_level) |
574 | sec_level = conn->pending_sec_level; | 574 | sec_level = conn->pending_sec_level; |
@@ -602,7 +602,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
602 | /* Encrypt the the link */ | 602 | /* Encrypt the the link */ |
603 | static void hci_conn_encrypt(struct hci_conn *conn) | 603 | static void hci_conn_encrypt(struct hci_conn *conn) |
604 | { | 604 | { |
605 | BT_DBG("conn %p", conn); | 605 | BT_DBG("hcon %p", conn); |
606 | 606 | ||
607 | if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) { | 607 | if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) { |
608 | struct hci_cp_set_conn_encrypt cp; | 608 | struct hci_cp_set_conn_encrypt cp; |
@@ -616,7 +616,7 @@ static void hci_conn_encrypt(struct hci_conn *conn) | |||
616 | /* Enable security */ | 616 | /* Enable security */ |
617 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | 617 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) |
618 | { | 618 | { |
619 | BT_DBG("conn %p", conn); | 619 | BT_DBG("hcon %p", conn); |
620 | 620 | ||
621 | /* For sdp we don't need the link key. */ | 621 | /* For sdp we don't need the link key. */ |
622 | if (sec_level == BT_SECURITY_SDP) | 622 | if (sec_level == BT_SECURITY_SDP) |
@@ -669,7 +669,7 @@ EXPORT_SYMBOL(hci_conn_security); | |||
669 | /* Check secure link requirement */ | 669 | /* Check secure link requirement */ |
670 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level) | 670 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level) |
671 | { | 671 | { |
672 | BT_DBG("conn %p", conn); | 672 | BT_DBG("hcon %p", conn); |
673 | 673 | ||
674 | if (sec_level != BT_SECURITY_HIGH) | 674 | if (sec_level != BT_SECURITY_HIGH) |
675 | return 1; /* Accept if non-secure is required */ | 675 | return 1; /* Accept if non-secure is required */ |
@@ -684,7 +684,7 @@ EXPORT_SYMBOL(hci_conn_check_secure); | |||
684 | /* Change link key */ | 684 | /* Change link key */ |
685 | int hci_conn_change_link_key(struct hci_conn *conn) | 685 | int hci_conn_change_link_key(struct hci_conn *conn) |
686 | { | 686 | { |
687 | BT_DBG("conn %p", conn); | 687 | BT_DBG("hcon %p", conn); |
688 | 688 | ||
689 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { | 689 | if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { |
690 | struct hci_cp_change_conn_link_key cp; | 690 | struct hci_cp_change_conn_link_key cp; |
@@ -699,7 +699,7 @@ int hci_conn_change_link_key(struct hci_conn *conn) | |||
699 | /* Switch role */ | 699 | /* Switch role */ |
700 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role) | 700 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role) |
701 | { | 701 | { |
702 | BT_DBG("conn %p", conn); | 702 | BT_DBG("hcon %p", conn); |
703 | 703 | ||
704 | if (!role && conn->link_mode & HCI_LM_MASTER) | 704 | if (!role && conn->link_mode & HCI_LM_MASTER) |
705 | return 1; | 705 | return 1; |
@@ -720,7 +720,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active) | |||
720 | { | 720 | { |
721 | struct hci_dev *hdev = conn->hdev; | 721 | struct hci_dev *hdev = conn->hdev; |
722 | 722 | ||
723 | BT_DBG("conn %p mode %d", conn, conn->mode); | 723 | BT_DBG("hcon %p mode %d", conn, conn->mode); |
724 | 724 | ||
725 | if (test_bit(HCI_RAW, &hdev->flags)) | 725 | if (test_bit(HCI_RAW, &hdev->flags)) |
726 | return; | 726 | return; |
@@ -894,7 +894,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn) | |||
894 | struct hci_dev *hdev = conn->hdev; | 894 | struct hci_dev *hdev = conn->hdev; |
895 | struct hci_chan *chan; | 895 | struct hci_chan *chan; |
896 | 896 | ||
897 | BT_DBG("%s conn %p", hdev->name, conn); | 897 | BT_DBG("%s hcon %p", hdev->name, conn); |
898 | 898 | ||
899 | chan = kzalloc(sizeof(struct hci_chan), GFP_KERNEL); | 899 | chan = kzalloc(sizeof(struct hci_chan), GFP_KERNEL); |
900 | if (!chan) | 900 | if (!chan) |
@@ -913,7 +913,7 @@ int hci_chan_del(struct hci_chan *chan) | |||
913 | struct hci_conn *conn = chan->conn; | 913 | struct hci_conn *conn = chan->conn; |
914 | struct hci_dev *hdev = conn->hdev; | 914 | struct hci_dev *hdev = conn->hdev; |
915 | 915 | ||
916 | BT_DBG("%s conn %p chan %p", hdev->name, conn, chan); | 916 | BT_DBG("%s hcon %p chan %p", hdev->name, conn, chan); |
917 | 917 | ||
918 | list_del_rcu(&chan->list); | 918 | list_del_rcu(&chan->list); |
919 | 919 | ||
@@ -929,7 +929,7 @@ void hci_chan_list_flush(struct hci_conn *conn) | |||
929 | { | 929 | { |
930 | struct hci_chan *chan, *n; | 930 | struct hci_chan *chan, *n; |
931 | 931 | ||
932 | BT_DBG("conn %p", conn); | 932 | BT_DBG("hcon %p", conn); |
933 | 933 | ||
934 | list_for_each_entry_safe(chan, n, &conn->chan_list, list) | 934 | list_for_each_entry_safe(chan, n, &conn->chan_list, list) |
935 | hci_chan_del(chan); | 935 | hci_chan_del(chan); |