Commit Graph

1019 Commits

Author SHA1 Message Date
Linux Build Service Account
ede570c880 Merge "Bluetooth: Generate generic Fails for undeliverable ATT messages" into msm-3.0 2011-10-20 22:35:31 -07:00
Brian Gix
7eaa64dda6 Bluetooth: Generate generic Fails for undeliverable ATT messages
Change-Id: I04f9ec62b15abb090cb90d81442a83caf8caa447
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-19 13:20:02 -07:00
Brian Gix
8a7f164195 Bluetooth: Fix Limited Discoverability for MGMTOPS
CRs-fixed: 309551
Change-Id: I42c46c62dcb4b227d9ac48146ee61cb52063a6ae
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-18 13:13:57 -07:00
Brian Gix
570efc917a Bluetooth: Fix error returned to bluez on LE Pairing Failure
Change-Id: I1e7908e133d53b41bdd58a54a2e293526e96e160
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-14 13:55:25 -07:00
Brian Gix
8d0b7d6797 Bluetooth: Fix LE pairing scenarios when initiated remotely
Fix setting of ENCRYPTION_PENDING and Connection refcnt's that could
be out of sync due to remote slave issued security requests.

Change-Id: Ie72abd0648182db0ef60693820139f40ef2e4bf6
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-14 13:55:24 -07:00
Linux Build Service Account
e4fe87773c Merge "Bluetooth: Socket lookup for a fixed L2CAP channel" into msm-3.0 2011-10-14 01:07:55 -07:00
Linux Build Service Account
4e4b1b1d69 Merge "Bluetooth: Timeout LE Connection requests" into msm-3.0 2011-10-12 19:55:56 -07:00
Inga Stotland
f214b6e656 Bluetooth: Socket lookup for a fixed L2CAP channel
Socket lookup for a fixed channel should be done based on both remote and
local device addresses.

Change-Id: I35f39bea8ade6fd5d8695640251efc54bf21beae
Signed-off-by: Inga Stotland <ingas@codeaurora.org>
2011-10-12 13:09:28 -07:00
Brian Gix
114f3a6d3c 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>
2011-10-11 11:03:06 -07:00
Brian Gix
58ba077931 Bluetooth: Complete LE Auth failure notification
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-11 09:59:28 -07:00
Peter Krystad
462bf76d29 Bluetooth: Guarantee BR-EDR device will be registered as hci0
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-11 09:59:24 -07:00
Brian Gix
fdd3892444 Bluetooth: Add EIR flags to LE Adv data cache
Use the EIR flags to prevent LE pairing attempts to
BR/EDR capable (Dual Mode) devices.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-04 17:14:22 -07:00
Brian Gix
065e8ff2cd Bluetooth: Balance LE hdev refcnt when not pairing.
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-04 17:14:08 -07:00
Srinivas Krovvidi
9ff51459ca 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.

CRs-Fixed: 309161
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2011-10-04 17:13:59 -07:00
Brian Gix
e9ceb522ff 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.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:21:22 -07:00
Peter Krystad
7400e7f5ec Revert "Bluetooth: check L2CAP length in first ACL fragment"
This reverts commit 8979481328

CRs-fixed: 305959
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-03 16:21:15 -07:00
Mat Martineau
604c6475ca Bluetooth: AMP move collision loser should not change move state
During a move collision, both devices start out thinking they are the
initiator. The loser of the collision switches from the initiator role
to the responder role when receiving a move request from the remote
device.  However, a move response will also be received by the loser
after the role switch has occurred.

The loser of the collision was incorrectly modifying the AMP move
state in the move response handler.  This kept it from sending a move
channel response to the remote device, which stalled the channel move
process.

This change makes sure the AMP move state remains valid, so the
channel move succeeds.

CRs-fixed: 308382
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:54 -07:00
Mat Martineau
8cd0df0792 Bluetooth: Change socket release context
When sock_put() is called on an L2CAP socket, if the reference count
on a sock goes to 0, l2cap_sock_release() is called. As part of the
release, l2cap_sock_shutdown() locks the socket. This is not allowable
in interrupt context.  This change makes calls to sock_put() on the
system workqueue, where it can safely lock.

This addresses "scheduling while atomic" issues in both the Bluetooth
mgmt_ops pairing code and when RFCOMM sessions are deleted in a
security_cfm callback.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:50 -07:00
Prabhakaran Mc
b04401d45b 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
Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2011-10-03 16:20:30 -07:00
Mat Martineau
55f2a62dff Bluetooth: Wait for info response before accepting AMP connection
An incoming AMP "create channel" connection would trigger an info
request and an AMP physical accept sequence at the same time.  Since
accepting an AMP physical link is a local operation, it would complete
quickly and send a config request before the info response was
received.

If there is an outstanding info request, the AMP physical link should
not be accepted yet.  Existing logic in l2cap_conn_start() will accept
the physical link when the info response is received.

CRs-fixed: 307243
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:20:27 -07:00
Brian Gix
3dd7017dd3 Bluetooth: Fix Deadlock on Legacy Scan/Pair
Fix nested calls to hci_dev_lock().

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:20:18 -07:00
Inga Stotland
5029fc2ccc Bluetooth: Fix logic in hci_power_on().
If hci_dev_open() returns no error or EALREADY, allow the power on
sequence to proceed.

Signed-off-by: Inga Stotland <ingas@codeaurora.org>

Conflicts:

	net/bluetooth/hci_core.c
2011-10-03 16:19:53 -07:00
Brian Gix
2e2f50d997 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.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:44 -07:00
Brian Gix
e57c1673ac Bluetooth: Fix LE Pairing on previous connections
There was a crashing issue when pairing was performed on LE connections
that were already up, due to a NULL function pointer being followed.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:44 -07:00
Brian Gix
adebcf9fca Bluetooth: Fix dead-lock failure during LE scan
Timer being deleted durings it's time-out callback execution caused
spinlock deadlock on multicore systems.

CRs-fixed: 305677
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:43 -07:00
Brian Gix
6d5fb8a1b1 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
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:43 -07:00
Peter Krystad
1fc44074b0 Bluetooth: Only send mgmt_ops messages for BR-EDR devices
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-10-03 16:19:29 -07:00
Brian Gix
64bd5309f8 Bluetooth: Fix balance of hci_dev_get/hci_dev_put
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:19:16 -07:00
Brian Gix
dfdd9360af Bluetooth: Fix Connection persistence, SSP caching
Fix key storage when not bonding
Fix when LE ACL is disconnected after use

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:52 -07:00
Kun Han Kim
15b911f615 Bluetooth: Added support for HFP 1.6 Wide Band Speech
Signed-off-by: Kun Han Kim <kunhank@codeaurora.org>
2011-10-03 16:18:52 -07:00
Brian Gix
a68668b4e3 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

Signed-off-by: Brian Gix <bgix@codeaurora.org>

Conflicts:

	net/bluetooth/mgmt.c
2011-10-03 16:18:51 -07:00
Brian Gix
bc1f0e4bff 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

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:32 -07:00
Srinivas Krovvidi
85aab23108 Bluetooth: Changes to handle cfm cb only after dlc is linked to session.
CRs-Fixed: 304043
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2011-10-03 16:18:19 -07:00
Brian Gix
cfb536b329 Bluetooth: Fix kernel hci_dev_open timeout reset
Handle -EALREADY error in hci_sock of hci_dev_open as indication that
the HCI device is already open. This was causing reset inducing timeout,
and removed unused/useless check of failure in power-up code.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:15 -07:00
Mallikarjuna GB
2da40bfbf2 Bluetooth : RFCOMM Frame size change
RFCOMM Frame size changes to accomodate the credits in the data packet.
Earlier implementation was not considering the 1 Byte required for
Credits information in data packet and hence was considering the
RFCOMM header plus FCS as 5 Bytes.
Because of this if the remote device sends a data packet with
negotiated frame size and credits information,packet size exceeds L2CAPMTU
and will be discarded by L2CAP.

CRs-fixed: 303518

Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
2011-10-03 16:18:13 -07:00
Brian Gix
842bc5e174 Bluetooth: Fix size of data for LTK Randomizer
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-10-03 16:18:05 -07:00
Prabhakaran Mc
6001a71683 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.

Signed-off-by: Prabhakaran Mc <prabhakaranmc@codeaurora.org>
2011-10-03 16:18:03 -07:00
Inga Stotland
bd6a49a2a0 Bluetooth: Handle disconnect for LE links.
Additional check whether the disconnect request is
coming on LE link.

Signed-off-by: Inga Stotland <ingas@codeaurora.org>
2011-10-03 16:17:15 -07:00
Mat Martineau
f058a44078 Bluetooth: Revert "Bluetooth: Increase AUTO_OFF timeout for HCI devices"
This reverts commit 24fac10d7e110035f61cf4bd69018adc84f15fc1.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:16:52 -07:00
Mat Martineau
c78ee412f7 Bluetooth: Increase AUTO_OFF timeout for HCI devices
The previous timeout (2 seconds) was too short for use with the 8960.
New timeout is 20 seconds.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-03 16:16:40 -07:00
Peter Krystad
f453bb396a Bluetooth: Add support for L2CAP Extended Flow Spec option.
Add send and receive of Extended Flow Spec option during L2CAP
lockstep configuration and passing the flow specs to HCI.

Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>

Conflicts:

	include/net/bluetooth/hci.h
	include/net/bluetooth/hci_core.h
	net/bluetooth/l2cap_core.c
2011-10-03 10:27:04 -07:00
Matt Wagantall
f63a88968a msm: clock-8x60: Add local control of vpe_axi_clk and vpe_axi_clk
The MAXI_EN2 register is no longer owned by the RPM. Add local
control of the VPE and Rotator AXI clocks which are in it.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2011-10-03 10:25:57 -07:00
Bryan Huntsman
3f2bc4d6eb Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-10-03 09:57:10 -07:00
Peter Hurley
5e4fcd2c55 Bluetooth: Fix l2cap conn failures for ssp devices
Commit 330605423c fixed l2cap conn establishment for non-ssp remote
devices by not setting HCI_CONN_ENCRYPT_PEND every time conn security
is tested (which was always returning failure on any subsequent
security checks).

However, this broke l2cap conn establishment for ssp remote devices
when an ACL link was already established at SDP-level security. This
fix ensures that encryption must be pending whenever authentication
is also pending.

Change-Id: I6876ea5134e90d1f3d0f84e8ed40b92977b3df64
Signed-off-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>
2011-08-29 15:24:13 -07:00
Peter Hurley
3bded00785 Bluetooth: hidp: Don't release device ref if never held
When an hidp connection is added for a boot protocol input
device, don't release a device reference that was never
acquired. The device reference is acquired when the session
is linked to the session list (which hasn't happened yet when
hidp_setup_input is called).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:42:58 -07:00
Peter Hurley
e5e416a415 Bluetooth: hidp: Only free input device if failed register
When an hidp connection is added for a boot protocol input
device, only free the allocated device if device registration fails.
Subsequent failures should only unregister the device (the input
device api documents that unregister will also free the allocated
device).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:42:27 -07:00
Peter Hurley
6b7f77eb6a Bluetooth: hidp: Fix memory leak of cached report descriptor
Free the cached HID report descriptor on thread terminate.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:42:08 -07:00
Peter Hurley
3f8c499e5d Bluetooth: hidp: Fix session cleanup on failed conn add
Once the session thread is running, cleanup must be
handled by the session thread only.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:23:59 -07:00
Peter Hurley
8624f2bb85 Bluetooth: bnep: Fix deadlock in session deletion
Commit f4d7cd4a4c introduced the usage of kthread API.
kthread_stop is a blocking function which returns only when
the thread exits. In this case, the thread can't exit because it's
waiting for the write lock, which is being held by bnep_del_connection()
which is waiting for the thread to exit -- deadlock.

Use atomic_t/wake_up_process instead to signal to the thread to exit.

Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:19:03 -07:00
Szymon Janc
dfe4ecda30 Bluetooth: Don't use cmd_timer to timeout HCI reset command
No command should be send before Command Complete event for HCI
reset is received. This fix regression introduced by commit
6bd32326cda(Bluetooth: Use proper timer for hci command timout)
for chips whose reset command takes longer to complete (e.g. CSR)
resulting in next command being send before HCI reset completed.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-08-11 18:18:45 -07:00