OSDN Git Service

Bluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.
authorNick Pelly <npelly@google.com>
Sat, 19 Sep 2009 01:29:23 +0000 (18:29 -0700)
committerNick Pelly <npelly@google.com>
Sun, 20 Sep 2009 19:42:12 +0000 (12:42 -0700)
commitdb54c334cda5d9927ed8f46f1953fe041dcbad41
treef97399be83dc2fa3f81e9a5c3bd7759910775b13
parent00302ab404a5edcde9820233ff0a8af68e8018e3
Bluetooth: Increase timeout for legacy pairing from 10 seconds to 40 seconds.

Legacy pairing is a bit of a problem because on the incoming end it is
impossible to know pairing has begun:

2009-09-18 18:29:24.115692 > HCI Event: Connect Request (0x04) plen 10
    bdaddr 00:23:D4:04:51:7A class 0x58020c type ACL
2009-09-18 18:29:24.115966 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
    bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.117065 > HCI Event: Command Status (0x0f) plen 4
    Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
2009-09-18 18:29:24.282928 > HCI Event: Role Change (0x12) plen 8
    status 0x00 bdaddr 00:23:D4:04:51:7A role 0x00
    Role: Master
2009-09-18 18:29:24.291534 > HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 1 bdaddr 00:23:D4:04:51:7A type ACL encrypt 0x00
2009-09-18 18:29:24.291839 < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 1
2009-09-18 18:29:24.292144 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:23:D4:04:51:7A mode 1
2009-09-18 18:29:24.293823 > HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
2009-09-18 18:29:24.303588 > HCI Event: Max Slots Change (0x1b) plen 3
    handle 1 slots 5
2009-09-18 18:29:24.309448 > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 1
    Features: 0xff 0xff 0x2d 0xfe 0x9b 0xff 0x79 0x83
2009-09-18 18:29:24.345916 < HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:23:D4:04:51:7A mode 2 clkoffset 0x0000
2009-09-18 18:29:24.346923 > HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2009-09-18 18:29:24.375793 > HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:23:D4:04:51:7A name 'test'
2009-09-18 18:29:34.332190 < HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 1 reason 0x13

There are some mainline patches such as "Add different pairing timeout for
Legacy Pairing" but they do not address the HCI sequence above.

I think the real solution is to avoid using CreateBond(), and instead make
the profile connection immediately. This way both sides will use a longer
timeout because there is a higher level connection in progress, and we will
not end up with the useless HCI sequence above.

Signed-off-by: Nick Pelly <npelly@google.com>
include/net/bluetooth/hci_core.h