Commit Graph

19967 Commits

Author SHA1 Message Date
Srinivas Krovvidi
d352b26f74 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>
2012-01-20 08:22:56 +05:30
Linux Build Service Account
b6dad9fd3d Merge "Bluetooth: Discovery Timer stability fixes" into msm-3.0 2012-01-16 01:17:20 -08:00
Linux Build Service Account
a3f14c0989 Merge "Bluetooth: Support for writing hci flush timeout parameter." into msm-3.0 2012-01-14 18:24:57 -08:00
Srinivas Krovvidi
10734198ae Bluetooth: Support for writing hci flush timeout parameter.
Added Flush Timeout parameter setting for l2cap channel. Bluetooth
profiles using l2cap can set this parameter to flush out the data
when it cannot be sent over the air with in timeout duration.

Change-Id: I60420c5be3a790aff26bc30e8089fdca47a99222
Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
2012-01-14 16:37:21 -07:00
Brian Gix
568dde90e7 Bluetooth: Discovery Timer stability fixes
This change prevents running timers from being re-initialized
which causes system instablility. Also prevents starting a
discovery operation when already in progress.

CRs-fixed: 328673
Change-Id: Icda36a25fdcb40dab4f95f9cc39ca124b299e308
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2012-01-13 10:07:23 -08:00
Brian Gix
3cd62049b5 Bluetooth: Explicitly stop all timers before frees
As a preventative measure, timers on dynamic memory structures must be
not running, or stopped, prior to freeing. Since it is safe to delete
timers whether running or not, all timers are deleted.

CRs-fixed: 328673
Change-Id: I255d99cb2419fad07caf445920050cf2d05ffe4d
Signed-off-by: Brian Gix <bgix@codeaurora.org>
2012-01-13 09:39:12 -08:00
Mat Martineau
9f8d467343 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>
2012-01-09 08:52:39 -08:00
Linux Build Service Account
d5cf63fe92 Merge "Bluetooth: Initialize incoming connection link policy" into msm-3.0 2012-01-05 15:28:47 -08:00
Rahul Kashyap
d5553baa74 Bluetooth: Initialize incoming connection link policy
Upon properly initializing the incoming connection
link policy, the link is able to enter sniff mode.

CRs-fixed: 327571
Change-Id: Ib21c09234f823f011aad158ae232f3060085183e
Signed-off-by: Rahul Kashyap <rkashyap@codeaurora.org>
2012-01-03 11:51:10 +05:30
Srinivas Krovvidi
0916aed523 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>
2011-12-29 18:37:27 +05:30
Deepthi Gowri
6f79e1678d nl80211/cfg80211: Add crypto settings into NEW_BEACON
This removes need from drivers to parse the beacon tail/head data
to figure out what crypto settings are to be used in AP mode in case
the Beacon and Probe Response frames are fully constructed in the
driver/firmware.

nl80211/cfg80211: Allow SSID to be specified in new beacon command

This makes it easier for drivers that generate Beacon and Probe Response
frames internally (in firmware most likely) in AP mode.

nl80211/cfg80211: Add extra IE configuration to AP mode setup

The NL80211_CMD_NEW_BEACON command is, in practice, requesting AP mode
operations to be started. Add new attributes to provide extra IEs
(e.g., WPS IE, P2P IE) for drivers that build Beacon, Probe Response,
and (Re)Association Response frames internally (likely in firmware).

Change-Id: Ib91cd3fa2bad68e3724db98985e3f3bac72715f0
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
2011-12-23 20:27:04 +05:30
Linux Build Service Account
fbb897c144 Merge "Bluetooth: Update ERTM state before sending packets" into msm-3.0 2011-12-23 02:36:17 -08:00
Linux Build Service Account
510503d38e Merge "Bluetooth: Send power off notification earlier in the device close process" into msm-3.0 2011-12-23 02:36:17 -08:00
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
ff10539146 Bluetooth: Update ERTM state before sending packets
Since l2cap_ertm_send() runs in process context, it may be preempted
by incoming data being processed in tasklet context.  In order to
avoid race conditions where a packet is acknowledged before the
transmit queue is properly updated, ERTM state should be set up for
the next transmit before the packet is actually sent.

CRs-fixed: 326238
Change-Id: I3df0e93118a357dbd34ff26ad74d7c0c38bf5121
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
2011-12-22 12:06:08 -08:00
Deepthi Gowri
7ad229d902 cfg80211/nl80211: Send AssocReq IEs to user space in AP mode
When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
IEs from the (Re)Association Request frame that was processed in
firmware need to be made available for user space (e.g., RSN IE for
hostapd). Allow this to be done with cfg80211_new_sta().

Add a comment pointing out the use of enum station_info_flags for
all new struct station_info fields. In addition, memset the sinfo
buffer to zero before use on all paths in the current tree to avoid
leaving uninitialized pointers in the data.

Change-Id: Ia2220d58ee81c1b7ca905cfc8eb55b6a84779d38
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
2011-12-22 10:53:33 +05:30
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