提交 134c2a89 编写于 作者: M Marcel Holtmann 提交者: Johan Hedberg

Bluetooth: Add debugfs entry to show Secure Connections Only mode

For debugging purposes of Secure Connection Only support a simple
debugfs entry is used to indicate if this mode is active or not.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 2c068e0b
...@@ -124,6 +124,7 @@ enum { ...@@ -124,6 +124,7 @@ enum {
HCI_LE_SCAN, HCI_LE_SCAN,
HCI_SSP_ENABLED, HCI_SSP_ENABLED,
HCI_SC_ENABLED, HCI_SC_ENABLED,
HCI_SC_ONLY,
HCI_HS_ENABLED, HCI_HS_ENABLED,
HCI_LE_ENABLED, HCI_LE_ENABLED,
HCI_ADVERTISING, HCI_ADVERTISING,
......
...@@ -461,6 +461,24 @@ static const struct file_operations force_sc_support_fops = { ...@@ -461,6 +461,24 @@ static const struct file_operations force_sc_support_fops = {
.llseek = default_llseek, .llseek = default_llseek,
}; };
static ssize_t sc_only_mode_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct hci_dev *hdev = file->private_data;
char buf[3];
buf[0] = test_bit(HCI_SC_ONLY, &hdev->dev_flags) ? 'Y': 'N';
buf[1] = '\n';
buf[2] = '\0';
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
}
static const struct file_operations sc_only_mode_fops = {
.open = simple_open,
.read = sc_only_mode_read,
.llseek = default_llseek,
};
static int idle_timeout_set(void *data, u64 val) static int idle_timeout_set(void *data, u64 val)
{ {
struct hci_dev *hdev = data; struct hci_dev *hdev = data;
...@@ -1491,6 +1509,8 @@ static int __hci_init(struct hci_dev *hdev) ...@@ -1491,6 +1509,8 @@ static int __hci_init(struct hci_dev *hdev)
hdev, &ssp_debug_mode_fops); hdev, &ssp_debug_mode_fops);
debugfs_create_file("force_sc_support", 0644, hdev->debugfs, debugfs_create_file("force_sc_support", 0644, hdev->debugfs,
hdev, &force_sc_support_fops); hdev, &force_sc_support_fops);
debugfs_create_file("sc_only_mode", 0444, hdev->debugfs,
hdev, &sc_only_mode_fops);
} }
if (lmp_sniff_capable(hdev)) { if (lmp_sniff_capable(hdev)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册