aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-04-28 14:28:54 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-28 15:02:30 -0400
commit9f61656a60c9506e3e4cd41af5efbcf6a30ee3b9 (patch)
treebfeb4576c064f441c0262548165fa5ba9f19b032 /net/bluetooth/hci_event.c
parent7a828908a026d801c6192fd32cfb35d6843f1539 (diff)
Bluetooth: Add variable SSP auto-accept delay support
Some test systems require an arbitrary delay to the auto-accept test cases for Secure Simple Pairing in order for the tests to pass. Previously when this was handled in user space it was worked around by code modifications and recompilation, but now that it's on the kernel side it's more convenient if there's a debugfs interface for it. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 514e10e1e0ff..a479389668ef 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2515,7 +2515,15 @@ static inline void hci_user_confirm_request_evt(struct hci_dev *hdev,
2515 /* If no side requires MITM protection; auto-accept */ 2515 /* If no side requires MITM protection; auto-accept */
2516 if ((!loc_mitm || conn->remote_cap == 0x03) && 2516 if ((!loc_mitm || conn->remote_cap == 0x03) &&
2517 (!rem_mitm || conn->io_capability == 0x03)) { 2517 (!rem_mitm || conn->io_capability == 0x03)) {
2518 BT_DBG("Auto-accept of user confirmation"); 2518 BT_DBG("Auto-accept of user confirmation with %ums delay",
2519 hdev->auto_accept_delay);
2520
2521 if (hdev->auto_accept_delay > 0) {
2522 int delay = msecs_to_jiffies(hdev->auto_accept_delay);
2523 mod_timer(&conn->auto_accept_timer, jiffies + delay);
2524 goto unlock;
2525 }
2526
2519 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY, 2527 hci_send_cmd(hdev, HCI_OP_USER_CONFIRM_REPLY,
2520 sizeof(ev->bdaddr), &ev->bdaddr); 2528 sizeof(ev->bdaddr), &ev->bdaddr);
2521 goto unlock; 2529 goto unlock;