android_kernel_motorola_sm6225/net/bluetooth
Jaganath Kanakkassery 7b064edae3 Bluetooth: Fix authentication if acl data comes before remote feature evt
If remote device sends l2cap info request before read_remote_ext_feature
completes then mgmt_connected will be sent in hci_acldata_packet() and
remote name request wont be sent and eventually authentication wont happen

Hcidump log of the issue

< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr BC:85:1F:74:7F:29 ptype 0xcc18 rswitch 0x01 clkoffset 0x4bf7 (valid)
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 12 bdaddr BC:85:1F:74:7F:29 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 12
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 12
    Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 12 slots 5
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 12 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> ACL data: handle 12 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
< ACL data: handle 12 flags 0x00 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x00b8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Fixed Channels
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 12 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> ACL data: handle 12 flags 0x02 dlen 10
    L2CAP(s): Info req: type 3
< ACL data: handle 12 flags 0x00 dlen 20
    L2CAP(s): Info rsp: type 3 result 0
      Fixed channel list 0x00000002
        L2CAP Signalling Channel
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 2

This patch moves sending mgmt_connected from hci_acldata_packet() to
l2cap_connect_req() since this code is to handle the scenario remote
device sends l2cap connect req too fast

Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
2013-01-10 03:26:18 -02:00
..
bnep Bluetooth: Remove unnecessary include export.h 2012-11-01 20:27:04 -02:00
cmtp Bluetooth: Replace include linux/module.h with linux/export.h 2012-10-24 00:44:05 -02:00
hidp Bluetooth: Fix incorrect strncpy() in hidp_setup_hid() 2013-01-09 17:39:05 -02:00
rfcomm Bluetooth: Add missing lock nesting notation 2012-12-03 15:59:10 -02:00
a2mp.c Bluetooth: Rename ctrl_id to remote_amp_id 2012-11-01 20:27:11 -02:00
af_bluetooth.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2012-10-19 15:22:27 -04:00
amp.c Bluetooth: Set local_amp_id after getting Phylink Completed evt 2012-11-20 15:54:44 -02:00
hci_conn.c Bluetooth: Add put(hcon) when deleting hchan 2012-11-01 20:27:03 -02:00
hci_core.c Bluetooth: Fix authentication if acl data comes before remote feature evt 2013-01-10 03:26:18 -02:00
hci_event.c Bluetooth: Fix sending HCI commands after reset 2013-01-09 17:05:14 -02:00
hci_sock.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-09-28 14:40:49 -04:00
hci_sysfs.c Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr 2012-09-27 18:10:15 -03:00
Kconfig Bluetooth: trivial: Remove newline before EOF 2012-10-24 00:42:47 -02:00
l2cap_core.c Bluetooth: Fix authentication if acl data comes before remote feature evt 2013-01-10 03:26:18 -02:00
l2cap_sock.c Bluetooth: Start channel move when socket option is changed 2012-10-24 00:26:30 -02:00
lib.c bluetooth: Remove unneeded batostr function 2012-09-27 18:10:43 -03:00
Makefile Bluetooth: AMP: Use HCI cmd to Read Loc AMP Assoc 2012-09-27 17:10:32 -03:00
mgmt.c Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2012-12-03 13:46:03 -05:00
sco.c Revert "Bluetooth: Fix possible deadlock in SCO code" 2012-12-03 16:00:04 -02:00
smp.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2012-11-21 12:57:56 -05:00