aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-11-02 15:46:52 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-11-03 03:13:42 -0500
commit40f4938aa6bfe2d792c0665c16d9dd15a5c1b119 (patch)
tree098dda86a69f515eb3b173f1fc5a066003f5c191 /net
parent27c3fbe00b4beb373f1460b745164d699de94247 (diff)
Bluetooth: Consolidate whitelist debugfs entry into device_list
The debufs entry for the BR/EDR whitelist is confusing since there is a controller debugfs entry with the name white_list and both are two different things. With the BR/EDR whitelist, the actual interface in use is the device list and thus just include all values from the internal BR/EDR whitelist in the device_list debugfs entry. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a12e018ee21c..6c162c8809cf 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -200,31 +200,6 @@ static const struct file_operations blacklist_fops = {
200 .release = single_release, 200 .release = single_release,
201}; 201};
202 202
203static int whitelist_show(struct seq_file *f, void *p)
204{
205 struct hci_dev *hdev = f->private;
206 struct bdaddr_list *b;
207
208 hci_dev_lock(hdev);
209 list_for_each_entry(b, &hdev->whitelist, list)
210 seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
211 hci_dev_unlock(hdev);
212
213 return 0;
214}
215
216static int whitelist_open(struct inode *inode, struct file *file)
217{
218 return single_open(file, whitelist_show, inode->i_private);
219}
220
221static const struct file_operations whitelist_fops = {
222 .open = whitelist_open,
223 .read = seq_read,
224 .llseek = seq_lseek,
225 .release = single_release,
226};
227
228static int uuids_show(struct seq_file *f, void *p) 203static int uuids_show(struct seq_file *f, void *p)
229{ 204{
230 struct hci_dev *hdev = f->private; 205 struct hci_dev *hdev = f->private;
@@ -1030,10 +1005,13 @@ static int device_list_show(struct seq_file *f, void *ptr)
1030{ 1005{
1031 struct hci_dev *hdev = f->private; 1006 struct hci_dev *hdev = f->private;
1032 struct hci_conn_params *p; 1007 struct hci_conn_params *p;
1008 struct bdaddr_list *b;
1033 1009
1034 hci_dev_lock(hdev); 1010 hci_dev_lock(hdev);
1011 list_for_each_entry(b, &hdev->whitelist, list)
1012 seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
1035 list_for_each_entry(p, &hdev->le_conn_params, list) { 1013 list_for_each_entry(p, &hdev->le_conn_params, list) {
1036 seq_printf(f, "%pMR %u %u\n", &p->addr, p->addr_type, 1014 seq_printf(f, "%pMR (type %u) %u\n", &p->addr, p->addr_type,
1037 p->auto_connect); 1015 p->auto_connect);
1038 } 1016 }
1039 hci_dev_unlock(hdev); 1017 hci_dev_unlock(hdev);
@@ -1815,10 +1793,10 @@ static int __hci_init(struct hci_dev *hdev)
1815 &hdev->manufacturer); 1793 &hdev->manufacturer);
1816 debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver); 1794 debugfs_create_u8("hci_version", 0444, hdev->debugfs, &hdev->hci_ver);
1817 debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev); 1795 debugfs_create_u16("hci_revision", 0444, hdev->debugfs, &hdev->hci_rev);
1796 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,
1797 &device_list_fops);
1818 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev, 1798 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev,
1819 &blacklist_fops); 1799 &blacklist_fops);
1820 debugfs_create_file("whitelist", 0444, hdev->debugfs, hdev,
1821 &whitelist_fops);
1822 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops); 1800 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
1823 1801
1824 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev, 1802 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev,
@@ -1897,8 +1875,6 @@ static int __hci_init(struct hci_dev *hdev)
1897 hdev, &adv_min_interval_fops); 1875 hdev, &adv_min_interval_fops);
1898 debugfs_create_file("adv_max_interval", 0644, hdev->debugfs, 1876 debugfs_create_file("adv_max_interval", 0644, hdev->debugfs,
1899 hdev, &adv_max_interval_fops); 1877 hdev, &adv_max_interval_fops);
1900 debugfs_create_file("device_list", 0444, hdev->debugfs, hdev,
1901 &device_list_fops);
1902 debugfs_create_u16("discov_interleaved_timeout", 0644, 1878 debugfs_create_u16("discov_interleaved_timeout", 0644,
1903 hdev->debugfs, 1879 hdev->debugfs,
1904 &hdev->discov_interleaved_timeout); 1880 &hdev->discov_interleaved_timeout);