aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-31 18:07:51 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-02-01 02:12:56 -0500
commit6e07231a80de33a3721c971e560316d04db16de8 (patch)
tree1ef6f58b5aaa16fc8d27e6b562833a309a1fb3fb /net/bluetooth
parent41bcfd50d52c83d43fe75fba7938a592dcb6589b (diff)
Bluetooth: Expose Secure Simple Pairing debug mode setting in debugfs
The value of the ssp_debug_mode should be accessible via debugfs to be able to determine if a BR/EDR controller generates debugs keys or not. 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_debugfs.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index ead89a5ad9ce..51a424cfa94a 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -354,6 +354,24 @@ static int voice_setting_get(void *data, u64 *val)
354DEFINE_SIMPLE_ATTRIBUTE(voice_setting_fops, voice_setting_get, 354DEFINE_SIMPLE_ATTRIBUTE(voice_setting_fops, voice_setting_get,
355 NULL, "0x%4.4llx\n"); 355 NULL, "0x%4.4llx\n");
356 356
357static ssize_t ssp_debug_mode_read(struct file *file, char __user *user_buf,
358 size_t count, loff_t *ppos)
359{
360 struct hci_dev *hdev = file->private_data;
361 char buf[3];
362
363 buf[0] = hdev->ssp_debug_mode ? 'Y': 'N';
364 buf[1] = '\n';
365 buf[2] = '\0';
366 return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
367}
368
369static const struct file_operations ssp_debug_mode_fops = {
370 .open = simple_open,
371 .read = ssp_debug_mode_read,
372 .llseek = default_llseek,
373};
374
357static int auto_accept_delay_set(void *data, u64 val) 375static int auto_accept_delay_set(void *data, u64 val)
358{ 376{
359 struct hci_dev *hdev = data; 377 struct hci_dev *hdev = data;
@@ -474,9 +492,12 @@ void hci_debugfs_create_bredr(struct hci_dev *hdev)
474 debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev, 492 debugfs_create_file("voice_setting", 0444, hdev->debugfs, hdev,
475 &voice_setting_fops); 493 &voice_setting_fops);
476 494
477 if (lmp_ssp_capable(hdev)) 495 if (lmp_ssp_capable(hdev)) {
496 debugfs_create_file("ssp_debug_mode", 0444, hdev->debugfs,
497 hdev, &ssp_debug_mode_fops);
478 debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs, 498 debugfs_create_file("auto_accept_delay", 0644, hdev->debugfs,
479 hdev, &auto_accept_delay_fops); 499 hdev, &auto_accept_delay_fops);
500 }
480 501
481 if (lmp_sniff_capable(hdev)) { 502 if (lmp_sniff_capable(hdev)) {
482 debugfs_create_file("idle_timeout", 0644, hdev->debugfs, 503 debugfs_create_file("idle_timeout", 0644, hdev->debugfs,