aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_debugfs.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-02-01 00:01:07 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-02-01 02:15:21 -0500
commit6858bcd073c9ff36f5d341dc6da011a53954fa9a (patch)
tree3f41f55759be4ef9cfa4b1d7a5f9b667d3c309b7 /net/bluetooth/hci_debugfs.c
parent5789f37cbc560aff45ff4d00673705eac92d3b4d (diff)
Bluetooth: Expose remote OOB information as debugfs entry
For debugging purposes it is good to know which OOB data is actually currently loaded for each controller. So expose that list via debugfs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_debugfs.c')
-rw-r--r--net/bluetooth/hci_debugfs.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index 5353f6ec8d68..65261e5d4b84 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -156,6 +156,35 @@ static const struct file_operations uuids_fops = {
156 .release = single_release, 156 .release = single_release,
157}; 157};
158 158
159static int remote_oob_show(struct seq_file *f, void *ptr)
160{
161 struct hci_dev *hdev = f->private;
162 struct oob_data *data;
163
164 hci_dev_lock(hdev);
165 list_for_each_entry(data, &hdev->remote_oob_data, list) {
166 seq_printf(f, "%pMR (type %u) %u %*phN %*phN %*phN %*phN\n",
167 &data->bdaddr, data->bdaddr_type, data->present,
168 16, data->hash192, 16, data->rand192,
169 16, data->hash256, 19, data->rand256);
170 }
171 hci_dev_unlock(hdev);
172
173 return 0;
174}
175
176static int remote_oob_open(struct inode *inode, struct file *file)
177{
178 return single_open(file, remote_oob_show, inode->i_private);
179}
180
181static const struct file_operations remote_oob_fops = {
182 .open = remote_oob_open,
183 .read = seq_read,
184 .llseek = seq_lseek,
185 .release = single_release,
186};
187
159static int conn_info_min_age_set(void *data, u64 val) 188static int conn_info_min_age_set(void *data, u64 val)
160{ 189{
161 struct hci_dev *hdev = data; 190 struct hci_dev *hdev = data;
@@ -264,6 +293,8 @@ void hci_debugfs_create_common(struct hci_dev *hdev)
264 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev, 293 debugfs_create_file("blacklist", 0444, hdev->debugfs, hdev,
265 &blacklist_fops); 294 &blacklist_fops);
266 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops); 295 debugfs_create_file("uuids", 0444, hdev->debugfs, hdev, &uuids_fops);
296 debugfs_create_file("remote_oob", 0400, hdev->debugfs, hdev,
297 &remote_oob_fops);
267 298
268 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev, 299 debugfs_create_file("conn_info_min_age", 0644, hdev->debugfs, hdev,
269 &conn_info_min_age_fops); 300 &conn_info_min_age_fops);