Commit graph

288 commits

Author SHA1 Message Date
Rahul Kashyap
6fce61b725 Bluetooth: Hold wakelock until BT idle timer kicks in.
Holding a wakelock avoids suspend power collapse, which
allow the BT idle timer to kick in, which eventually
initiates BT low power modes.

CRs-Fixed: 361067
Change-Id: I93e3950b6f854e70dbce092a5529120ec008c2b8
Signed-off-by: Rahul Kashyap <rkashyap@codeaurora.org>
2013-02-25 11:39:35 -08:00
Brian Gix
2225011b7e Bluetooth: Add sockopts for LE Connection Params
Various LE profiles require very specific LE parameters for
both establishing and maintaining LE connections to remote
peripherals. These LE only parameters are encapsulated into
a single sockopts structure, and may be passed from user space.

CRs-Fixed: 335971
Change-Id: I408edb97ab0fa9717c7d3fe5fc8ad6ac179a2fff
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:39:33 -08:00
Prabhakaran Mc
3cce2ec821 Bluetooth: If link is encrypted, do not send encrpt link request
When BT2.1 link is in encrypted state, if HOST posts
SET_CONNECTION_ENCRYPTION with enable as on, in some cases
SoC fails to generate ENCRYPT_CHANGE event. Since the link is
already in encrypted state with current link key, HOST can avoid
repeated request for encrypting the link while doing service level
authentication. This patch avoids the repeated request for encrypting
the link after service level authentication from HOST, if the link
is already encrypted by current link key.

Change-Id: I9402d64310f0e4e6240ca6ed610e0108de061a12
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:27 -08:00
Prabhakaran Mc
0d59bab4d8 Bluetooth: Grace period to re-enable encryption
If the remote device does not support Encryption Pause,
It might disable Encryption during role switch. Allow a
Grace period of 500 ms for such devices to re-enable.

Change-Id: I8af8082e16e185fe8c15adaf07169cc73179c59f
CRs-fixed: 336828
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:25 -08:00
Prabhakaran Mc
3e9e6d91cd Bluetooth: Enforce MEDIUM_SECURITY for 2.0 pairing.
The Security levels have been decided based on
remote_features or remote_extended_features for 2.0
and 2.1 devices. In case of security mode - 3 pairing,
this data is not available since pairing happens before
ACL connection complete. This patch fixes this problem.

Change-Id: I0397d090fb1eecaf7b8cf385c3bf47c75fa5a8fb
CRs-fixed: 350377
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:24 -08:00
hyungseoung.yoo
fa388f3bbd Bluetooth: Keep master role when SCO or eSCO is active
This improves compatbility with a lot of headset / chipset
combinations. Ideally this should not be needed.

Change-Id: I8b676701e12e416aa7d60801b9d353b15d102709
Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
2013-02-25 11:39:19 -08:00
Prabhakaran Mc
f8b7075b04 Bluetooth: Modify security level at remote_features event for BT2.0 devices
For non SSP devices, MEDIUM_SECURITY has to be used for pairing. This
can be determined and set while receiving remote supported features
event for BT2.0 devices.

Change-Id: I24558d40be01c4232fff4a871e2b57e390d4128a
CRs-fixed: 345945
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:18 -08:00
Archana Ramachandran
4f5119df8a Bluetooth: Poll for RSSI updates from the remote device
This feature is required for implementing Low energy
proximity client immediate alert service. The proximtiy
client registers with the kernel for receiving RSSI updates
of the remote device. The kernel starts polling for RSSI
value using READ_RSSI HCI command and When it reaches
a particular threshold set by the proximity client,
updates are sent to the client.

Change-Id: I723dd140ad3bf02978c57b3ab127bb6768f28cca
CRs-fixed: 344936
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
2013-02-25 11:39:14 -08:00
Prabhakaran Mc
272bb5f22a Bluetooth: Set security level based on remote device features.
Connection security level is modified based on remote device's
extended feature. Deciding SSP capability of remote device
by EIR response is incorrect, because few BT2.1 devices do not
send EIR and few BT2.1 devices which send EIR do not support
SSP. SSP capability of remote device has to be decided based on
remote_extended_features event. This patch makes sure that
MEDIUM_SECURITY is set for non ssp devices' pairing process.

Change-Id: I328a35a30895f2ab6abaaeec51b364ecd633e642
CRs-fixed: 339166
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:12 -08:00
Royston Rodrigues
f58c570c3c Bluetooth: Clear HCI_INQUIRY flags for successive inquiry scans to succeed
HCI_INQUIRY flags wasn't cleared thereby causing successive inquiry scans
triggered via IOCTLs to fail as connection timeout. As a consequence
successive device scans triggered by Bluez tool (hcitool) failed.
Now HCI_INQUIRY flags are cleared irrespective of device type being BR/EDR
or LE.

Change-Id: Ic5e4804b52f18a46940f38d1e14e8c6825fa97bb
Signed-off-by: Royston Rodrigues <roystonr@codeaurora.org>
2013-02-25 11:39:11 -08:00
Sunny Kapdi
cdf6dea686 bluetooth: Add support for remote_features
Expose Bluetooth remote features to the userspace. A2DP profile
setup in the userspace would need this information to
determine if the remote side supports EDR ACL link or not.

Change-Id: Ib6713707baaf30ffe872247313b2185ae2897385
Signed-off-by: Sunny Kapdi <sunnyk@codeaurora.org>
2013-02-25 11:39:10 -08:00
Mat Martineau
bbe15d54ea Bluetooth: Lock sockets when closing HCI device
When a Bluetooth device is powered down while RFCOMM connections are
open, there are race conditions where RFCOMM tries to use an HCI
connection after the data structures have been deleted.  Since the
powerdown procedure runs in process context, it is possible to lock
sockets before accessing them to close connections.  This change adds
that locking, which will serialize socket access between processors
during powerdown.

Change-Id: I587720799b35d9ee6e66340bdeda8a2b9e2ea7b5
CRs-fixed: 336893
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2013-02-25 11:39:09 -08:00
Prabhakaran Mc
9dc6ceb379 Bluetooth: Handle error command status for AUTH_REQUESTED command
When AUTH_REQUESTED command status is error status, do the bonding
cleanup, so that there will not be any problem for next time
pairing process and in user space.

Change-Id: I0150382be902279b856099c840598c5be91d03ac
CRs-fixed: 331126
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:39:07 -08:00
Srinivas Krovvidi
72a89bac49 Bluetooth: Avoid link entering sniff mode during pairing process.
Found incoming connection issue with IOT devices when link enters
sniff mode during pairing process. The current change avoids link
entering sniff mode when link key is not available for connection.

Change-Id: I26fbbccec8d7b3faa91cba8f976fb0e44d7f5344
CRs-Fixed: 331520
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2013-02-25 11:38:58 -08:00
Srinivas Krovvidi
6fefa46cee Bluetooth: Reading remote device lmp_version from controller.
On ACL connection complete with a remote device, the remote
device lmp version should be available with Controller. The
current change is to read this information from controller to
host and update to bluez userspace through management APIs.

Change-Id: Ie152ed98fa0a6cf9ab170a6bb8c6a05b5b9dfcb0
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2013-02-25 11:38:54 -08:00
Mat Martineau
e8b0b4033e Bluetooth: Fix HCI channel reference counting
When an incoming HCI logical link event came in at the same time
a socket structure was deleted, it was possible to end up with a stale
pointer to the socket.  The socket and associated HCI channel struct
need to be properly reference counted so they are not freed
prematurely.

CRs-Fixed: 325023
Change-Id: Ia5724a9ce2000acd60a174c354be04029bac5324
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2013-02-25 11:38:50 -08:00
Srinivas Krovvidi
94010817b9 Bluetooth: Management API changes in Bluetooth to update remote Class.
When connection initiated from the remote device the class of device
information is required to be updated to userspace through this
event.

Change-Id: I97d715a0b80e12d414ecf03d099955c8b12c82b4
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2013-02-25 11:38:48 -08:00
Bhakthavatsala Raghavendra
48a39fa02b Bluetooth: Setting security level based on remote device capabilities
Security level will be set to MEDIUM in case where the remote device
is 2.0 device. This would prevent it from going to 16 digit pairing
in case where the remote device sends the EIR and still doesn't
support SSP

CRs-fixed: 318469
Change-Id: I9d03b2b628cc188de44f44cfc3f8e81fbf3cb79d
Signed-off-by: Bhakthavatsala Raghavendra <braghave@codeaurora.org>
2013-02-25 11:38:44 -08:00
Subramanian Srinivasan
3c5ce6e5cb Bluetooth: Avoid deadlock in management ops code
Fixes a deadlock issue due to spinlock being acquired
first in the process context and followed by a second
acquisition in the interrupt context

CRs-fixed: 319052
Change-Id: If17be9fa6f020dd1abd248f8999c2614251fc509
Signed-off-by: Subramanian Srinivasan <subrsrin@codeaurora.org>
2013-02-25 11:38:37 -08:00
Prabhakaran Mc
17c20ba4e9 Bluetooth: changes to implement mgmt_encrypt_link procedure
mgmt_encrypt_link procedure is added by implementing
MGMT_OP_ENCRYPT_LINK and MGMT_EV_ENCRYPT_CHANGE

Change-Id: Ibed6e24c67bbea83318a67c636e02a93518de29d
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:38:36 -08:00
Royston Rodrigues
cab30986ca Bluetooth: EIR to carry update local device name.
Whenever local device name is changed, EIR payload
is updated with the modified local device name.

CRs-fixed: 314228
Change-Id: Ib2ec05b6ac4f4a55612716f0567ee04056579ed6
Signed-off-by: Royston Rodrigues <roystonr@codeaurora.org>
2013-02-25 11:38:26 -08:00
Brian Gix
064afd8708 Bluetooth: Cache LE Address Type with LTK, and use for reconnections
LE-Only devices require that an Address Type (Public or Random) be
included in Connection Requests. This info is available at Pairing
but must be cached so that it is available at reconnection time.
This change includes the Address type with the Pairing data.

Change-Id: I50c78ad31d8be70f5c3f49a0529039e4a26daaac
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:38:24 -08:00
Brian Gix
326abc1bd7 Bluetooth: Timeout LE Connection requests
If LE devices stop advertising or go out of range, we need
to apply a timeout because the baseband doesn't.

Change-Id: I115672e21fd8aef56ac688b2df4664bb74b725e4
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:38:16 -08:00
Srinivas Krovvidi
315ced665e Bluetooth: Storing Link key persistantly based on the Auth Req.
Store the link key persistently if one of the following is true:
 1. this is a legacy link key
 2. this is a changed combination key and there was a previously
    stored one
 3. neither local nor remote side had no-bonding as a requirement
 4. the local side had dedicated bonding as a requirement
 5. the remote side is using dedicated bonding since in that case
    also the local requirements are set to dedicated bonding
 If none of the above match only keep the link key around for
 this connection and set the temporary flag for the device.

Change-Id: Ib41bbd16dd964fd21214d9e784579b7092658a66
CRs-Fixed: 309161
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2013-02-25 11:38:07 -08:00
Brian Gix
58507d6ea0 Bluetooth: Fix LE Pairing time-out
Timer that was started at beginning of LE Pairing did not correctly
terminate pairing process when it fired, and was not properly cleaned
up on pairing completion.

Change-Id: Idf51bc8bf85cd6939d1d42fc16c7ee3071ab2420
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:38:07 -08:00
Prabhakaran Mc
79da2d5cf4 Bluetooth: Remove old link key before reinitiating authentication
When remote device do not have link key, DUT will try to reinitiate
authentication process. We should remove the link key before
reinitiating authentication process. This was fixed in hciops in
Bluez user space. Adding this change for mgmtops to handle this
case in kernel space.

CRs-fixed: 307063
Change-Id: I6a3f7ee2b73b609a663bf18b21a6852230668c29
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:38:04 -08:00
Brian Gix
535024c78e Bluetooth: Fix Deadlock on Legacy Scan/Pair
Fix nested calls to hci_dev_lock().

Change-Id: I968faaae59f300bb5a45cd279028488bd7dfcb11
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:38:02 -08:00
Brian Gix
cfa732f906 Bluetooth: Add LE/BR flag to Connect notification
When remote device is connected outside the control of BlueZ, it
needs to be informed of whether the new connection is LE or BR/EDR.

Change-Id: I58efe8ed3cf5db2b7cc0b3417447b1e3abcdc1c2
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:38:00 -08:00
Brian Gix
b0fd66f9f6 Bluetooth: Fix balancing of hci_conn refcnts
When LE was added, the refcnt's for the hci_conns used were not balanced
and some of this bleeded over between LE pairing and Legacy pairing.

CRs-fixed: 305391
Change-Id: I31070ae827f2eb5a59b317a0ee4bd80eae9e2aa0
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:37:58 -08:00
Brian Gix
815e25827f Bluetooth: Fix Init Link Policy
Redundant calls to hci_setup_event_mask() prematurly exited Init state
when first call when erroneously detected as the last cmd sent.

CRs-fixed: 302804

Change-Id: Ifac887ba134c52df524ecfe289d2f930ba360a2c
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:37:55 -08:00
Prabhakaran Mc
4fd178a155 Bluetooth: SAP Authentication changes
SAP profile requires 16 pin length authentication for BT 1.2/2.0
devices as per specification. These changes were present for hciops
pluging, the current changes are for Management operations plugin.

Change-Id: I4c27c3f833a001dfe7a4abf3db42253939544658
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2013-02-25 11:37:51 -08:00
Brian Gix
dc7314fec4 Bluetooth: Fix Connection persistence, SSP caching
Fix key storage when not bonding
Fix when LE ACL is disconnected after use

Change-Id: I4425612ebc3720d614c43574ddfc449722eb26d2
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:37:49 -08:00
Brian Gix
d81a637f4d Bluetooth: Add LE SecMgr and mgmtops support
Enabled ECB Block encoding for Low Energy pairing
Implemented missing components of MGMTOPS interface
Differentiated as needed between BR/EDR pairing and LE pairing

Change-Id: Ifb26a9c8ca0c57286fcee92e840835560930c093
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2013-02-25 11:37:48 -08:00
Kun Han Kim
d69ac7ee48 Bluetooth: Added support for HFP 1.6 Wide Band Speech
Signed-off-by: Kun Han Kim <kunhank@codeaurora.org>
Change-Id: Ibc34a0170c1744ff50503a2c0c57dea721715aa8
2013-02-25 11:37:47 -08:00
Peter Krystad
706754941e Bluetooth: Aggregate Best Effort extended flow specs
When multiple Best Effort flow specs with known data rates exist
on an AMP logical link they must be combined and the Flow Spec Modify
command issued for the aggregate flow spec.

Change-Id: Iacab516c3caa4aac8415c107e7f2ec132ea5ddd2
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2013-02-25 11:37:46 -08:00
Mat Martineau
7da56f3cec Bluetooth: Fix cherry-pick problem affecting AMP initialization
Appended lines of code were intended to only apply to BR/EDR
initialization, but instead only affected AMP.  This change moves the
code to the BR/EDR block and more clearly differentiates the AMP and
BR/EDR code.

Change-Id: I99e6b95a0eaa6017f019cb8f8228a5da99c90663
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2013-02-25 11:37:33 -08:00
Rakesh KrishnaMoorthy
ce704ef898 Bluetooth: Reinitiating authentication process
This fix reinitiates the authentication process when remote
device doesnot have the link key for the current connection.

Change-Id: I7160b2690964125d3e0839273aafda18fa436b6c
Signed-off-by: Rakesh KrishnaMoorthy <rakeshk@codeaurora.org>
2013-02-25 11:37:24 -08:00
Santosh Sajjan
8966dc6d6d net: bluetooth: Add eSCO Hci reference (S3) parameter settings
Change-Id: Ic601b25389974752e6621c5a213c06c1d09ed913
CRs-fixed: 274928
Signed-off-by: Santosh Sajjan <ssajjan@codeaurora.org>
2013-02-25 11:37:23 -08:00
Peter Krystad
b897bc4434 Bluetooth: Use common fields for packet- and block-based flow control
Packet-based and block-based flow control use the same counting
method, so re-use the hci_dev fields instead of making a second set.

Change-Id: I2022ae49487a2a56f27d803f3bf522bd5350e60c
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2013-02-25 11:37:21 -08:00
Peter Krystad
843f44994b Bluetooth: HCI support for AMP controllers.
This adds support for AMP controllers to the Bluetooth HCI layer.
The architecture was agreed upon at the 2010 BlueZ Summit.
A new notion of an "HCI channel" is introduced, which corresponds
with AMP logical links.  AMP controllers are also a new device type,
with a new set of HCI commands and events that need to be supported.

Change-Id: I6dbf96f800cbd6878a37c0a463f5261c8681134c
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2013-02-25 11:37:10 -08:00
Stephen Boyd
069047086b Revert upstream bluetooth
This undoes all upstream bluetooth core changes since around
b79f44c (Bluetooth: Fix keeping the command timer running,
2011-04-11).

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:37:04 -08:00
Colin Cross
5500e4fab2 Merge commit 'v3.4' into android-3.4 2012-05-25 13:56:28 -07:00
Johan Hedberg
671267bf3a Bluetooth: mgmt: Fix device_connected sending order
The mgmt_ev_device_connected signal must be sent before any event
indications happen for sockets associated with the connection. Otherwise
e.g. device authorization for the sockets will fail with ENOTCONN as
user space things that there is no baseband link.

This patch fixes the issue by ensuring that the device_connected event
if sent (if it hasn't been so already) as soon as the first ACL data
packet arrives from the remote device.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-05-14 13:56:15 -04:00
Gustavo Padovan
a7d7723ae7 Bluetooth: notify userspace of security level change
It fixes L2CAP socket based security level elevation during a
connection. The HID profile needs this (for keyboards) and it is the only
way to achieve the security level elevation when using the management
interface to talk to the kernel (hence the management enabling patch
being the one that exposes this issue).

It enables the userspace a security level change when the socket is
already connected and create a way to notify the socket the result of the
request. At the moment of the request the socket is made non writable, if
the request fails the connections closes, otherwise the socket is made
writable again, POLL_OUT is emmited.

Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-05-14 13:51:25 -04:00
Colin Cross
f02fac6330 Merge commit 'v3.4-rc6' into android-3.4
Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/mm/mmu.c

Change-Id: If4f371a21c052fa597d107c44b128a093e4a8b91
2012-05-07 18:20:34 -07:00
John W. Linville
4dcc0637fc Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth 2012-04-27 15:16:43 -04:00
Szymon Janc
16cde9931b Bluetooth: Fix missing break in hci_cmd_complete_evt
Command complete event for HCI_OP_USER_PASSKEY_NEG_REPLY would result
in calling handler function also for HCI_OP_LE_SET_SCAN_PARAM. This
could result in undefined behaviour.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
2012-04-24 11:38:41 -03:00
Vishal Agarwal
6ec5bcadc2 Bluetooth: Temporary keys should be retained during connection
If a key is non persistent then it should not be used in future
connections but it should be kept for current connection. And it
should be removed when connecion is removed.

Signed-off-by: Vishal Agarwal <vishal.agarwal@stericsson.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2012-04-16 12:57:45 +03:00
hyungseoung.yoo
6dd16a70bc Bluetooth: Keep master role when SCO or eSCO is active
This improves compatbility with a lot of headset / chipset
combinations. Ideally this should not be needed.

Change-Id: I8b676701e12e416aa7d60801b9d353b15d102709
Signed-off-by: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
2012-04-09 13:57:49 -07:00
Nick Pelly
07021e2708 Bluetooth: Allow SCO/eSCO packet type selection for outgoing SCO connections.
__u16 sco_pkt_type is introduced to struct sockaddr_sco. It allows bitwise
selection of SCO/eSCO packet types. Currently those bits are:

0x0001 HV1 may be used.
0x0002 HV2 may be used.
0x0004 HV3 may be used.
0x0008 EV3 may be used.
0x0010 EV4 may be used.
0x0020 EV5 may be used.
0x0040 2-EV3 may be used.
0x0080 3-EV3 may be used.
0x0100 2-EV5 may be used.
0x0200 3-EV5 may be used.

This is similar to the Packet Type parameter in the HCI Setup Synchronous
Connection Command, except that we are not reversing the logic on the EDR bits.
This makes the use of sco_pkt_tpye forward portable for the use case of
white-listing packet types, which we expect will be the primary use case.

If sco_pkt_type is zero, or userspace uses the old struct sockaddr_sco,
then the default behavior is to allow all packet types.

Packet type selection is just a request made to the Bluetooth chipset, and
it is up to the link manager on the chipset to negiotiate and decide on the
actual packet types used. Furthermore, when a SCO/eSCO connection is eventually
made there is no way for the host stack to determine which packet type was used
(however it is possible to get the link type of SCO or eSCO).

sco_pkt_type is ignored for incoming SCO connections. It is possible
to add this in the future as a parameter to the Accept Synchronous Connection
Command, however its a little trickier because the kernel does not
currently preserve sockaddr_sco data between userspace calls to accept().

The most common use for sco_pkt_type will be to white-list only SCO packets,
which can be done with the hci.h constant SCO_ESCO_MASK.

This patch is motivated by broken Bluetooth carkits such as the Motorolo
HF850 (it claims to support eSCO, but will actually reject eSCO connections
after 5 seconds) and the 2007/2008 Infiniti G35/37 (fails to route audio
if a 2-EV5 packet type is negiotiated). With this patch userspace can maintain
a list of compatible packet types to workaround remote devices such as these.

Based on a patch by Marcel Holtmann.

Rebased to 2.6.39.

Change-Id: Ide1c89574fa4f6f1b9218282e1af17051eb86315
Signed-off-by: Nick Pelly <npelly@google.com>
2012-04-09 13:57:49 -07:00