Commit Graph

19952 Commits

Author SHA1 Message Date
Bhasker Neti
ffdff571cb Bluetooth: Send power off notification earlier in the device close process
Notifying Bluez userspace of a shutdown earlier prevents new commands from
being sent. The extra commands were interfering with reinitialization of
the device

Change-Id: I862a658585ffa69348fbb4bdfba96f3916d0e5ef
Signed-off-by: Bhasker Neti <bneti@codeaurora.org>
2011-12-22 13:32:05 -08:00
Mat Martineau
380dcd40cd Bluetooth: Clear sk_send_head when purging ERTM transmit queue
In ERTM, the outgoing data queue contains both unsent data and unacked
data, and sk_send_head points to the first unsent packet. When
disconnecting a socket, it's possible for a process to attempt a
socket send while a disconnection is in progress and the outgoing data
queue has been purged. When this purge happens, sk_send_head must also
be set to NULL because the packet it was pointing to has been freed.

Change-Id: I87b37a13583fac705241549dfc492950c7c0ec0b
CRs-fixed: 326238
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-12-19 10:11:30 -08:00
Linux Build Service Account
4bdc331fc3 Merge "Bluetooth: Schedule HCI_TX task after connection cleanup" into msm-3.0 2011-12-18 11:16:47 -08:00
AnubhavGupta
01d9e363d8 Bluetooth: Schedule HCI_TX task after connection cleanup
After ACL  disconnection and removal of pending acl
acknowledgement, we have to schedule HCI_TX task. This will
allow other active connection to send ACL packets.

Change-Id: I3ddf61a3c7ff149b05e963159e10af0ab6ef6143
Signed-off-by: AnubhavGupta <anubhavg@codeaurora.org>
2011-12-17 17:26:47 +05:30
Linux Build Service Account
6af1b58f0b Merge "vfs: dont chain pipe/anon/socket on superblock s_inodes list" into msm-3.0 2011-12-16 21:09:57 -08:00
Eric Dumazet
88b3f3dc89 vfs: dont chain pipe/anon/socket on superblock s_inodes list
Workloads using pipes and sockets hit inode_sb_list_lock contention.

superblock s_inodes list is needed for quota, dirty, pagecache and
fsnotify management. pipe/anon/socket fs are clearly not candidates for
these.

Change-Id: I8ed74115fb164a96e5a726d2cb7f476f140c384d
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
2011-12-15 15:57:08 +05:30
Bhakthavatsala Raghavendra
6edb4f19c1 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>
2011-12-14 21:24:23 +05:30
Mat Martineau
0c04ef9553 Bluetooth: Check for skb copy/clone failures
During normal ERTM sends and resends, buffers are copied or cloned.
If the copy/clone fails, take sensible action rather than causing a
kernel panic.

Change-Id: Ib491cfb38dab30014ed08571dbd721dad0cc3714
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-12-09 22:43:27 -07:00
Peter Krystad
55f8d4ce3b Bluetooth: Check for possible divide by zero
Change-Id: Iee0bdf14f9fe7bfbe21e5344ec407356b23a69f4
CRs-fixed: 319934
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-12-09 08:10:19 -08:00
Peter Krystad
d6a9cebcd1 Bluetooth: Fix possible access of hci_chan after it is deleted
When the connection is not in BT_CONNECTED state it was possible
for code in hci_chan_modify() to attempt to access the hci_chan
structure after it had already been deleted by hci_chan_put().

Change-Id: I5ae352ac12aa3b456e7bcf30633015d98b03e44b
CRs-fixed: 319934
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-12-09 08:10:19 -08:00
Linux Build Service Account
c82aa018a6 Merge "Bluetooth: Use correct endianness in L2CAP configuration fallback" into msm-3.0 2011-12-08 14:54:13 -08:00
Linux Build Service Account
1671f939a5 Merge "Bluetooth: bnep: Fix deadlock in session deletion" into msm-3.0 2011-12-08 10:28:10 -08:00
Mat Martineau
ab043557f7 Bluetooth: Use correct endianness in L2CAP configuration fallback
Default RFC values should use le16 byte ordering. These values are
used only as a fallback when poorly-behaved remote devices do not send
a proper RFC option in an ERTM or streaming configuration response.

Change-Id: I51c9ae892f18229f568b354c92b64e3a8054b619
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-12-07 10:46:56 -08:00
Peter Hurley
2db3637b45 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.

Change-Id: I538cd17c102cb31b3212c794086a9c2baedb4b14
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>
[skrovvid@codeaurora.org: kthread_should_stop api call is avoided]
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2011-12-07 11:10:29 +05:30
Linux Build Service Account
fc662a1106 Merge "Bluetooth: Do not disconnect channel before failover complete" into msm-3.0 2011-12-06 14:52:29 -08:00
Linux Build Service Account
47dece1c78 Merge "Bluetooth: Move Discovery timers to hci_dev struct" into msm-3.0 2011-12-06 11:36:58 -08:00
Linux Build Service Account
5c5bed0c36 Merge "msm: nl80211: Add WAPI support for cfg80211." into msm-3.0 2011-12-06 11:36:58 -08:00
Peter Krystad
1f8a8a55d8 Bluetooth: Do not disconnect channel before failover complete
When the logical link disconnects clear the reference to the
l2cap connection before moving the channel. This prevents the
channel from being disconnected before failover to BR-EDR is
complete.

Change-Id: Id55a472a8dac49fbfca4fa47cffea59acf76ed1f
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
CRs-fixed: 321202
2011-12-06 09:30:37 -08:00
Brian Gix
6e349d0a90 Bluetooth: Move Discovery timers to hci_dev struct
To prevent timers from expiring on potentiatially free'd dynamic memory.

Change-Id: I8b9685150bcee72fa7ca71b221bc54b54516021e
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-12-05 07:46:16 -08:00
Subramanian Srinivasan
a727a49728 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>
2011-12-04 20:51:22 -08:00
Linux Build Service Account
eab3d79c40 Merge "Bluetooth: changes to implement mgmt_encrypt_link procedure" into msm-3.0 2011-12-03 19:45:06 -08:00
Mat Martineau
6b0bcce0a4 Bluetooth: Use default RFC values if none received
A well-behaved remote device should always send a reconfiguration and
flow control (RFC) option in the configuration response when using
ERTM or Streaming mode.  By using default RFC option values, the
configuration code can avoid using uninitialized data.

Change-Id: I8f9ef687b694d0b34c6d65d40b934bc7946d515e
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-11-30 12:00:14 -08:00
Prabhakaran Mc
46230fac90 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>
2011-11-30 18:11:21 +05:30
Linux Build Service Account
e7f5fcd146 Merge changes I4b01ddca,I15b9ab7d into msm-3.0
* changes:
  Bluetooth: Use hci dev number as AMP controller ID
  Bluetooth: Release module reference counts
2011-11-29 16:58:29 -08:00
Deepthi Gowri
5b26a95110 msm: nl80211: Add WAPI support for cfg80211.
This provides WAPI support for cfg80211.

Change-Id: I6ec1f6804cd9017bd332b4dd5ab06f18b390e120
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
2011-11-29 17:09:02 +05:30
Linux Build Service Account
5f6e33654c Merge "Bluetooth: Fix erroneous Pairing Failure condition" into msm-3.0 2011-11-23 07:59:32 -08:00
Mat Martineau
4106b99f11 Bluetooth: Keep persistent hdev flags after the device is closed.
Change-Id: Ifb9ccf93be53f2f3e6bb7773b4d39a6328dce73f
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-11-22 07:51:27 -08:00
Linux Build Service Account
201e87ef10 Merge "Bluetooth: Clear RFCOMM session timer when disconnecting last channel" into msm-3.0 2011-11-21 04:16:33 -08:00
Linux Build Service Account
2f0ec1450b Merge "Merge remote-tracking branch 'common/android-3.0' into msm-3.0" into msm-3.0 2011-11-18 21:35:29 -08:00
Linux Build Service Account
808cb2b2a7 Merge "Bluetooth: Remove _bh locking for AMP Manager" into msm-3.0 2011-11-17 21:34:56 -08:00
Mat Martineau
6890394894 Bluetooth: Clear RFCOMM session timer when disconnecting last channel
When the last RFCOMM data channel is closed, a timer is normally set
up to disconnect the control channel at a later time.  If the control
channel disconnect command is sent with the timer pending, the timer
needs to be cancelled.

If the timer is not cancelled in this situation, the reference
counting logic for the RFCOMM session does not work correctly when the
remote device closes the L2CAP connection.  The session is freed at
the wrong time, leading to a kernel panic.

CRs-fixed: 317859
Change-Id: I778fdf8dbff8afe0a1c157b02d39872262088584
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-11-17 14:24:46 -08:00
Brian Gix
2a335267a4 Bluetooth: Fix erroneous Pairing Failure condition
When local device is done sending LE pairing keys, it should not
be sending a pairing failure event to User space.

Change-Id: I49d77040e8f72567c0c7ece053aa58227c87a0f0
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-11-17 13:02:23 -08:00
Bryan Huntsman
d074fa2796 Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits)
  misc: remove kernel debugger core
  ARM: common: fiq_debugger: dump sysrq directly to console if enabled
  ARM: common: fiq_debugger: add irq context debug functions
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT
  net: wireless: bcmdhd: Call init_ioctl() only if was started properly
  net: wireless: bcmdhd: Fix possible memory leak in escan/iscan
  cpufreq: interactive governor: default 20ms timer
  cpufreq: interactive governor: go to intermediate hi speed before max
  cpufreq: interactive governor: scale to max only if at min speed
  cpufreq: interactive governor: apply intermediate load on current speed
  ARM: idle: update idle ticks before call idle end notifier
  input: gpio_input: don't print debounce message unless flag is set
  net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down
  net: wireless: bcmdhd: Improve suspend/resume processing
  net: wireless: bcmdhd: Check if FW is Ok for internal FW call
  tcp: Don't nuke connections for the wrong protocol
  ARM: common: fiq_debugger: make uart irq be no_suspend
  net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
  mm: avoid livelock on !__GFP_FS allocations
  ...

Conflicts:
	arch/arm/mm/cache-l2x0.c
	arch/arm/vfp/vfpmodule.c
	drivers/mmc/core/host.c
	kernel/power/wakelock.c
	net/bluetooth/hci_event.c

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
2011-11-16 13:52:50 -08:00
Peter Krystad
4e1c9fa806 Bluetooth: Use hci dev number as AMP controller ID
Previously an offset was added to the hci dev number to generate the
AMP controller ID, because it was possible for the PAL to register
as hci0, and 0 is invalid for an AMP controller ID. Since this commit
462bf76d29 it is not possible for
the PAL to register as hci0, so this offset is no longer necessary.

Change-Id: I4b01ddca5fad3aebeb4c138b5aee8819bb146f3d
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-11-16 09:47:51 -08:00
Peter Krystad
f7dcc79902 Bluetooth: Release module reference counts
In three places a reference was taken without being returned.

Change-Id: I15b9ab7de530a77832d8b10fe756cfdf0b01760f
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-11-15 14:40:45 -08:00
Peter Krystad
f52892066f Bluetooth: Remove _bh locking for AMP Manager
Since all AMP Manager processing is done on work queues no
bottom-half locking is required.

CRs-fixed: 318632
Change-Id: I3a07c412ccf30d62d68cc80124fad5700bcc0917
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
2011-11-15 14:40:37 -08:00
Brian Gix
dbf5929927 Bluetooth: Allow auto-accept if remote NoInNoOut
If we initiated a Dedicated pairing, and the remote device
is a NoInputNoOutput capable device, allow auto-acceptance
of pairing.

Change-Id: Ia5cc3e3d458cee98aef0493a423d29e9955638c3
CRs-fixed: 318144
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-11-11 21:51:10 -08:00
Lorenzo Colitti
adfa7bc8b4 tcp: Don't nuke connections for the wrong protocol
Currently, calling tcp_nuke_addr to reset IPv6 connections
resets IPv4 connections as well, because all Android
framework sockets are dual-stack (i.e., IPv6) sockets, and
we don't check the source address to see if the connection
was in fact an IPv4 connection.

Fix this by checking the source address and not resetting
the connection if it's a mapped address.

Also slightly tweak the IPv4 code path, which doesn't check
for mapped addresses either. This was not causing any
problems because tcp_is_local normally always returns true
for LOOPBACK4_IPV6 (127.0.0.6), because the loopback
interface is configured as as 127.0.0.0/8. However,
checking explicitly for LOOPBACK4_IPV6 makes the code a bit
more robust.

Bug: 5535055
Change-Id: I4d6ed3497c5b8643c864783cf681f088cf6b8d2a
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
2011-11-03 17:08:47 -07:00
Brian Gix
6e4531c6fb Bluetooth: Fix Init sequence when device is restarted
On some platforms, device state data can be left around, and some
commands may take longer than 1 second to execute. This change increases
the per command time-out, and reinitializes the features mask.

Change-Id: Ib707996b97139c97e9a0deacd4a11019cf75da8c
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-11-03 11:17:15 -07:00
Brian Gix
7f7e16c279 Bluetooth: Add API to set LE Connection Parameters
Include auto-setting connection parameters during Pairing for
low latenecy, and default (high latency) settings for non-Pairing
connections.

Change-Id: Ie8e3f65da52213451dcc01fce38d95ae07d1b13b
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2011-11-02 09:04:14 -07:00
Linux Build Service Account
0716b5e34f Merge "Bluetooth: Use proper sock reference counting in L2CAP" into msm-3.0 2011-11-01 09:26:52 -07:00
Linux Build Service Account
ca3690dbae Merge "Bluetooth: EIR to carry update local device name." into msm-3.0 2011-10-31 18:53:36 -07:00
Mat Martineau
f00ffac82c Bluetooth: Align socket option definitions with upstream kernel
The upstream kernel has acquired new BT socket options since
BT_AMP_POLICY was first defined, now BT_FLUSHABLE is option 8 and
BT_POWER is option 9.  It will save us some future pain if we align
with upstream code now and make BT_AMP_POLICY be option 10.

In addition, the option values for BT_AMP_POLICY were changed during
the upstreaming process.

CRs-fixed: 313757
Change-Id: Ia31e9c8cfd5207a6dd44e40a605d3021f5ce9fd9
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-31 15:08:45 -07:00
Mat Martineau
2f0cd84428 Bluetooth: Use proper sock reference counting in L2CAP
A socket can be shut down while pointer to that socket is stored in a
queued skbuff or in a pending workqueue struct. Correct use of socket
reference counting will make sure the socket struct stays around until
there are no remaining references.

Change-Id: Ic3679e023a46b224929b3cefb6370d7871e3368a
CRs-fixed: 313736
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-10-31 14:59:18 -07:00
Royston Rodrigues
c58c0c2253 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>
2011-10-31 10:47:09 +05:30
Brian Gix
cf95677cc3 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>
2011-10-30 18:32:10 -07:00
Linux Build Service Account
9e9224d409 Merge "Bluetooth: Don't use incomplete LE LTKs to secure link" into msm-3.0 2011-10-30 04:35:55 -07:00
Dmitry Shmidt
9f135b3d8d net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2011-10-28 10:35:37 -07:00
Linux Build Service Account
b89e7c3714 Merge "cne: Add reference count for Smart Wireless Interface Manager" into msm-3.0 2011-10-27 18:42:13 -07:00
Colin Cross
2bb3e31015 Merge commit 'v3.0.8' into android-3.0 2011-10-27 15:01:19 -07:00