diff options
-rw-r--r-- | net/bluetooth/Makefile | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 7 | ||||
-rw-r--r-- | net/bluetooth/hci_debugfs.c | 41 | ||||
-rw-r--r-- | net/bluetooth/hci_debugfs.h | 25 |
4 files changed, 74 insertions, 1 deletions
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile index 0a176fc9e291..364cff1ad4b1 100644 --- a/net/bluetooth/Makefile +++ b/net/bluetooth/Makefile | |||
@@ -13,6 +13,6 @@ bluetooth_6lowpan-y := 6lowpan.o | |||
13 | 13 | ||
14 | bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ | 14 | bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ |
15 | hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ | 15 | hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ |
16 | a2mp.o amp.o ecc.o hci_request.o | 16 | a2mp.o amp.o ecc.o hci_request.o hci_debugfs.o |
17 | 17 | ||
18 | subdir-ccflags-y += -D__CHECK_ENDIAN__ | 18 | subdir-ccflags-y += -D__CHECK_ENDIAN__ |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 91dca121dbb6..b3ab2bfb3f86 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <net/bluetooth/mgmt.h> | 38 | #include <net/bluetooth/mgmt.h> |
39 | 39 | ||
40 | #include "hci_request.h" | 40 | #include "hci_request.h" |
41 | #include "hci_debugfs.h" | ||
41 | #include "smp.h" | 42 | #include "smp.h" |
42 | 43 | ||
43 | static void hci_rx_work(struct work_struct *work); | 44 | static void hci_rx_work(struct work_struct *work); |
@@ -1865,6 +1866,8 @@ static int __hci_init(struct hci_dev *hdev) | |||
1865 | debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev, | 1866 | debugfs_create_file("conn_info_max_age", 0644, hdev->debugfs, hdev, |
1866 | &conn_info_max_age_fops); | 1867 | &conn_info_max_age_fops); |
1867 | 1868 | ||
1869 | hci_debugfs_create_common(hdev); | ||
1870 | |||
1868 | if (lmp_bredr_capable(hdev)) { | 1871 | if (lmp_bredr_capable(hdev)) { |
1869 | debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, | 1872 | debugfs_create_file("inquiry_cache", 0444, hdev->debugfs, |
1870 | hdev, &inquiry_cache_fops); | 1873 | hdev, &inquiry_cache_fops); |
@@ -1874,6 +1877,8 @@ static int __hci_init(struct hci_dev *hdev) | |||
1874 | hdev, &dev_class_fops); | 1877 | hdev, &dev_class_fops); |
1875 | debugfs_create_file("voice_setting", 0444, hdev->debugfs, | 1878 | debugfs_create_file("voice_setting", 0444, hdev->debugfs, |
1876 | hdev, &voice_setting_fops); | 1879 | hdev, &voice_setting_fops); |
1880 | |||
1881 | hci_debugfs_create_bredr(hdev); | ||
1877 | } | 1882 | } |
1878 | 1883 | ||
1879 | if (lmp_ssp_capable(hdev)) { | 1884 | if (lmp_ssp_capable(hdev)) { |
@@ -1944,6 +1949,8 @@ static int __hci_init(struct hci_dev *hdev) | |||
1944 | hdev->debugfs, | 1949 | hdev->debugfs, |
1945 | &hdev->discov_interleaved_timeout); | 1950 | &hdev->discov_interleaved_timeout); |
1946 | 1951 | ||
1952 | hci_debugfs_create_le(hdev); | ||
1953 | |||
1947 | smp_register(hdev); | 1954 | smp_register(hdev); |
1948 | } | 1955 | } |
1949 | 1956 | ||
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c new file mode 100644 index 000000000000..b8cf0734cc3d --- /dev/null +++ b/net/bluetooth/hci_debugfs.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | BlueZ - Bluetooth protocol stack for Linux | ||
3 | |||
4 | Copyright (C) 2014 Intel Corporation | ||
5 | |||
6 | This program is free software; you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License version 2 as | ||
8 | published by the Free Software Foundation; | ||
9 | |||
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | |||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
21 | SOFTWARE IS DISCLAIMED. | ||
22 | */ | ||
23 | |||
24 | #include <linux/debugfs.h> | ||
25 | |||
26 | #include <net/bluetooth/bluetooth.h> | ||
27 | #include <net/bluetooth/hci_core.h> | ||
28 | |||
29 | #include "hci_debugfs.h" | ||
30 | |||
31 | void hci_debugfs_create_common(struct hci_dev *hdev) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | void hci_debugfs_create_bredr(struct hci_dev *hdev) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void hci_debugfs_create_le(struct hci_dev *hdev) | ||
40 | { | ||
41 | } | ||
diff --git a/net/bluetooth/hci_debugfs.h b/net/bluetooth/hci_debugfs.h new file mode 100644 index 000000000000..f191100b50c5 --- /dev/null +++ b/net/bluetooth/hci_debugfs.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | BlueZ - Bluetooth protocol stack for Linux | ||
3 | Copyright (C) 2014 Intel Corporation | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License version 2 as | ||
7 | published by the Free Software Foundation; | ||
8 | |||
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
10 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
11 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
12 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
13 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
17 | |||
18 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
19 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
20 | SOFTWARE IS DISCLAIMED. | ||
21 | */ | ||
22 | |||
23 | void hci_debugfs_create_common(struct hci_dev *hdev); | ||
24 | void hci_debugfs_create_bredr(struct hci_dev *hdev); | ||
25 | void hci_debugfs_create_le(struct hci_dev *hdev); | ||