diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-18 20:14:22 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-19 09:30:44 -0400 |
commit | 12c269d7e30ab044849eb1ae0c8e4850582f3c7b (patch) | |
tree | e14c9b28adfef2a50efac521172bad23ab944502 /net/bluetooth | |
parent | 922021854bd8a0221fcb05aec2c13409cffb924e (diff) |
Bluetooth: Expose setting if debug keys are used or not
The system can be figured to accept and use debug keys. Expose this
value in debugfs for debugging purposes.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_core.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index d47c8ec90ca0..94d5342a4da6 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -215,6 +215,24 @@ static const struct file_operations link_keys_fops = { | |||
215 | .release = single_release, | 215 | .release = single_release, |
216 | }; | 216 | }; |
217 | 217 | ||
218 | static ssize_t use_debug_keys_read(struct file *file, char __user *user_buf, | ||
219 | size_t count, loff_t *ppos) | ||
220 | { | ||
221 | struct hci_dev *hdev = file->private_data; | ||
222 | char buf[3]; | ||
223 | |||
224 | buf[0] = test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) ? 'Y': 'N'; | ||
225 | buf[1] = '\n'; | ||
226 | buf[2] = '\0'; | ||
227 | return simple_read_from_buffer(user_buf, count, ppos, buf, 2); | ||
228 | } | ||
229 | |||
230 | static const struct file_operations use_debug_keys_fops = { | ||
231 | .open = simple_open, | ||
232 | .read = use_debug_keys_read, | ||
233 | .llseek = default_llseek, | ||
234 | }; | ||
235 | |||
218 | static int dev_class_show(struct seq_file *f, void *ptr) | 236 | static int dev_class_show(struct seq_file *f, void *ptr) |
219 | { | 237 | { |
220 | struct hci_dev *hdev = f->private; | 238 | struct hci_dev *hdev = f->private; |
@@ -1166,6 +1184,8 @@ static int __hci_init(struct hci_dev *hdev) | |||
1166 | hdev, &inquiry_cache_fops); | 1184 | hdev, &inquiry_cache_fops); |
1167 | debugfs_create_file("link_keys", 0400, hdev->debugfs, | 1185 | debugfs_create_file("link_keys", 0400, hdev->debugfs, |
1168 | hdev, &link_keys_fops); | 1186 | hdev, &link_keys_fops); |
1187 | debugfs_create_file("use_debug_keys", 0444, hdev->debugfs, | ||
1188 | hdev, &use_debug_keys_fops); | ||
1169 | debugfs_create_file("dev_class", 0444, hdev->debugfs, | 1189 | debugfs_create_file("dev_class", 0444, hdev->debugfs, |
1170 | hdev, &dev_class_fops); | 1190 | hdev, &dev_class_fops); |
1171 | debugfs_create_file("voice_setting", 0444, hdev->debugfs, | 1191 | debugfs_create_file("voice_setting", 0444, hdev->debugfs, |