{"shas":[["19f9b1aa14404b9f30db8a07e321c7ae67307bdb","44592b4eea36663c86b994bb0ea99d15309c1c7d@holtmann.org","Squished commit of Bluetooth fixes from Google\n\n    Bluetooth: Fix connection establishment with low security requirement\n\n    The Bluetooth 2.1 specification introduced four different security modes\n    that can be mapped using Legacy Pairing and Simple Pairing. With the\n    usage of Simple Pairing it is required that all connections (except\n    the ones for SDP) are encrypted. So even the low security requirement\n    mandates an encrypted connection when using Simple Pairing. When using\n    Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required\n    since it causes interoperability issues.\n\n    To support this properly the low security requirement translates into\n    different host controller transactions depending if Simple Pairing is\n    supported or not. However in case of Simple Pairing the command to\n    switch on encryption after a successful authentication is not triggered\n    for the low security mode. This patch fixes this and actually makes\n    the logic to differentiate between Simple Pairing and Legacy Pairing\n    a lot simpler.\n\n    Based on a report by Ville Tervo <ville.tervo@nokia.com>\n\n    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>\n\n    Bluetooth: Set general bonding security for ACL by default\n\n    This patch fixes double pairing issues with SSP.\n\n    It was observed that when pairing with SSP bluez asks confirmation\n    2 times.\n    http://www.spinics.net/lists/linux-bluetooth/msg02473.html\n\n    This also causes bug when we initiate SSP connection from Vista.\n\n    The reason is because bluetoothd does not store link keys since\n    ioctl  HCIGETAUTHINFO returns 0. Setting default general\n    bonding fixes these issues.\n\n    Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>\n\n    Bluetooth: Enter active mode before establishing a SCO link.\n    When in sniff mode with a long interval time (1.28s) it can take 4+ seconds to\n    establish a SCO link. Fix by requesting active mode before requesting SCO\n    connection. This improves SCO setup time to ~500ms.\n\n    Bluetooth headsets that use a long interval time, and exhibit the long SCO\n    connection time include Motorola H790, HX1 and H17. They have a CSR 2.1 chipset\n\n    Verified this behavior and fix with host Bluetooth chipsets: BCM4329 and\n    TI1271.\n\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Add ACL MTU, available buffers and total buffers to hci_conn_info.\n\n    This provides userspace debugging tools access to ACL flow control state.\n\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Introduce L2CAP_LM_FLUSHABLE to allow flushing of ACL packets.\n\n    With Bluetooth 2.1 ACL packets can be flushable or non-flushable. This changes\n    makes the default ACL packet non-flushable, and allows selection of flushable\n    packets on a per-L2CAP socket basis with L2CAP_LM_FLUSHABLE.\n\n    Note the HCI Write Automatic Flush Timeout command also needs to be issued\n    to set the flush timeout to non-zero.\n\n    Need to featurize this change to Bluetooth 2.1 chipsets only before pushing\n    upstream.\n\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Hack: Do not use power_save feature.\n    power_save is a feature to allow HID devices to control the sniff mode.\n    Unfortunately it also prevents us exiting sniff mode on some A2DP devices\n    that do not explicitly exit sniff mode themselves, resulting in skipping\n    audio.\n\n    Marcel is trying to finalize a setsockopt() API to control whether power_save\n    is enabled on a per socket basis. In the mean-time, turn off power_save for\n    Android, since we do not have official HID support, and this is causing\n    problems for A2DP which we do support.\n\n    (Note the power_save logic is reversed, 0 is on, 1 is off).\n\n    Change-Id: Ife4478055128b81669bf49308d2e2199e1aa11a1\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Allow SCO/eSCO packet type selection for outgoing SCO connections.\n\n    __u16 sco_pkt_type is introduced to struct sockaddr_sco. It allows bitwise\n    selection of SCO/eSCO packet types. Currently those bits are:\n\n    0x0001 HV1 may be used.\n    0x0002 HV2 may be used.\n    0x0004 HV3 may be used.\n    0x0008 EV3 may be used.\n    0x0010 EV4 may be used.\n    0x0020 EV5 may be used.\n    0x0040 2-EV3 may be used.\n    0x0080 3-EV3 may be used.\n    0x0100 2-EV5 may be used.\n    0x0200 3-EV5 may be used.\n\n    This is similar to the Packet Type parameter in the HCI Setup Synchronous\n    Connection Command, except that we are not reversing the logic on the EDR bits.\n    This makes the use of sco_pkt_tpye forward portable for the use case of\n    white-listing packet types, which we expect will be the primary use case.\n\n    If sco_pkt_type is zero, or userspace uses the old struct sockaddr_sco,\n    then the default behavior is to allow all packet types.\n\n    Packet type selection is just a request made to the Bluetooth chipset, and\n    it is up to the link manager on the chipset to negiotiate and decide on the\n    actual packet types used. Furthermore, when a SCO/eSCO connection is eventually\n    made there is no way for the host stack to determine which packet type was used\n    (however it is possible to get the link type of SCO or eSCO).\n\n    sco_pkt_type is ignored for incoming SCO connections. It is possible\n    to add this in the future as a parameter to the Accept Synchronous Connection\n    Command, however its a little trickier because the kernel does not\n    currently preserve sockaddr_sco data between userspace calls to accept().\n\n    The most common use for sco_pkt_type will be to white-list only SCO packets,\n    which can be done with the hci.h constant SCO_ESCO_MASK.\n\n    This patch is motivated by broken Bluetooth carkits such as the Motorolo\n    HF850 (it claims to support eSCO, but will actually reject eSCO connections\n    after 5 seconds) and the 2007/2008 Infiniti G35/37 (fails to route audio\n    if a 2-EV5 packet type is negiotiated). With this patch userspace can maintain\n    a list of compatible packet types to workaround remote devices such as these.\n\n    Based on a patch by Marcel Holtmann.\n\n    Change-Id: I304d8fda5b4145254820a3003820163bf53de5a5\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Hack: Don't dereference null pointer.\n\n    This avoids the S305 panic during incoming connection.\n\n    S305 sends PSM 25 L2CAP connection request before the L2CAP info response.\n    When we receive that info response we crash on null pointer here.\n\n    Bug: 2127637\n    Change-Id: Ib637516251f46fa9a9c87ac015dc2f27df5a27fd\n    Signed-off-by: Nick Pelly <npelly@google.com>\n\n    Bluetooth: Defer SCO setup if mode change is pending\n    Certain headsets such as the Motorola H350 will reject SCO and eSCO\n    connection requests while the ACL is transitioning from sniff mode\n    to active mode. Add synchronization so that SCO and eSCO connection\n    requests will wait until the ACL has fully transitioned to active mode.\n\n    < HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2\n        handle 12\n    > HCI Event: Command Status (0x0f) plen 4\n        Exit Sniff Mode (0x02|0x0004) status 0x00 ncmd 1\n    < HCI Command:  Setup Synchronous Connection (0x01|0x0028) plen 17\n        handle 12 voice setting 0x0040\n    > HCI Event: Command Status (0x0f) plen 4\n        Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1\n    > HCI Event: Number of Completed Packets (0x13) plen 5\n        handle 12 packets 1\n    > HCI Event: Mode Change (0x14) plen 6\n        status 0x00 handle 12 mode 0x00 interval 0\n        Mode: Active\n    > HCI Event: Synchronous Connect Complete (0x2c) plen 17\n        status 0x10 handle 14 bdaddr 00:1A:0E:50:28:A4 type SCO\n        Error: Connection Accept Timeout Exceeded\n\n    Signed-off-by: Ron Shaffer <rshaffer@codeaurora.org>\n    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>","Marcel Holtmann"]],"ref":"refs/heads/2.6.29","size":1,"head":"19f9b1aa14404b9f30db8a07e321c7ae67307bdb","push_id":35558792}