Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:53 +0000 (18:50 -0300)]
Bluetooth: Add support for Pairing features exchange
This patch implements a simple version of the SMP Pairing Features
exchange procedure (Vol. 3 Part H, Section 2.3.5.1).
For now, everything that would cause a Pairing Method different of
Just Works to be chosen is rejected.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:52 +0000 (18:50 -0300)]
Bluetooth: Add support for building pairing commands
Before we are able to do a proper exchange of pairing parameters,
we need a unified way of building pairing requests and responses.
For IO Capability we use the value that was set by userspace,
using the management interface.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:51 +0000 (18:50 -0300)]
Bluetooth: Update the security level when link is encrypted
If the pending security level is greater than the current security
level and the link is now encrypted, we should update the link
security level.
This is only useful for LE links, when the only event generated
when SMP is sucessful in the Encrypt Change event.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:50 +0000 (18:50 -0300)]
Bluetooth: Fix initial security level of LE links
As the default security level (BT_SECURITY_SDP) doesn't make sense for
LE links, initialize LE links with something that makes sense.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 27 Jan 2011 00:42:57 +0000 (21:42 -0300)]
Bluetooth: Add support for resuming socket when SMP is finished
This adds support for resuming the user space traffic when SMP
negotiation is complete.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:48 +0000 (18:50 -0300)]
Bluetooth: Remove debug statements
Now that these commands are sent to the controller we can use hcidump
to verify that the correct values are produced.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:47 +0000 (18:50 -0300)]
Bluetooth: Add support for LE Start Encryption
This adds support for starting SMP Phase 2 Encryption, when the initial
SMP negotiation is successful. This adds the LE Start Encryption and LE
Long Term Key Request commands and related events.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 9 Jun 2011 21:50:46 +0000 (18:50 -0300)]
Bluetooth: Add SMP confirmation checks methods
This patch includes support for generating and sending the random value
used to produce the confirmation value.
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 9 Jun 2011 21:50:45 +0000 (18:50 -0300)]
Bluetooth: Add SMP confirmation structs
This patch adds initial support for verifying the confirmation value
that the remote side has sent.
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 9 Jun 2011 21:50:44 +0000 (18:50 -0300)]
Bluetooth: Add LE SMP Cryptoolbox functions
This patch implements SMP crypto functions called ah, c1, s1 and e.
It also implements auxiliary functions. All These functions are needed
for SMP keys generation.
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org>
Signed-off-by: Bruna Moreira <bruna.moreira@openbossa.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vinicius Costa Gomes [Thu, 9 Jun 2011 21:50:43 +0000 (18:50 -0300)]
Bluetooth: Add support for using the crypto subsystem
This will allow using the crypto subsystem for encrypting data. As SMP
(Security Manager Protocol) is implemented almost entirely on the host
side and the crypto module already implements the needed methods
(AES-128), it makes sense to use it.
There's now a new module option to enable/disable SMP support.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 9 Jun 2011 21:50:42 +0000 (18:50 -0300)]
Bluetooth: Add simple SMP pairing negotiation
This implementation only exchanges SMP messages between the Host and the
Remote. No keys are being generated. TK and STK generation will be
provided in further patches.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Tue, 7 Jun 2011 21:46:31 +0000 (18:46 -0300)]
Bluetooth: Start SMP procedure
Start SMP procedure for LE connections. This modification intercepts
l2cap received frames and call proper SMP functions to start the SMP
procedure. By now, no keys are being used.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 9 Jun 2011 21:50:40 +0000 (18:50 -0300)]
Bluetooth: Implement the first SMP commands
These simple commands will allow the SMP procedure to be started
and terminated with a not supported error. This is the first step
toward something useful.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 8 Jun 2011 22:09:13 +0000 (19:09 -0300)]
Bluetooth: Don't forget to check for LE_LINK
Otherwise the wrong error can be returned.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Tue, 17 May 2011 18:13:19 +0000 (15:13 -0300)]
Bluetooth: keep reference if any ERTM timer is enabled
ERTM use the generic L2CAP timer functions to keep a reference to the
channel. This is useful for avoiding crashes.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Tue, 17 May 2011 17:59:01 +0000 (14:59 -0300)]
Bluetooth: Make timer functions generic
We now plan to use l2cap_set_timer and l2cap_clear_timer in ERTM timers.
Change-Id: Ie62b01e003f8885ae89c73e2e64195c21cbadddd
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Tue, 17 May 2011 17:34:52 +0000 (14:34 -0300)]
Bluetooth: Add refcnt to struct l2cap_chan
struct l2cap_chan has now its own refcnt that is compatible with the
socket refcnt, i.e., we won't see sk_refcnt = 0 and chan->refcnt > 0.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Fri, 3 Jun 2011 03:19:47 +0000 (00:19 -0300)]
Bluetooth: Add state tracking to struct l2cap_chan
Now socket state is tracked by struct sock and channel state is tracked by
chan->state. At this point both says the same, but this is going to change
when we add AMP Support for example.
Change-Id: Idbf873f5e8dd94f5b2482ba960c52193d28ce5dd
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 16 May 2011 21:23:24 +0000 (18:23 -0300)]
Bluetooth: add close() callback to l2cap_chan_ops
close() calls l2cap_sock_kill() on l2cap_sock.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 16 May 2011 20:57:22 +0000 (17:57 -0300)]
Bluetooth: add recv() callback to l2cap_chan_ops
This abstracts the call to sock_queue_recv_skb() into
l2cap_chan_ops->recv().
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 16 May 2011 20:24:37 +0000 (17:24 -0300)]
Bluetooth: Add l2cap_chan_ops abstraction
Add an abstraction layer between L2CAP core and its users (only
l2cap_sock.c now). The first function implemented is new_connection() that
replaces calls to l2cap_sock_alloc() in l2cap_core.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 16 May 2011 19:42:01 +0000 (16:42 -0300)]
Bluetooth: Merge l2cap_chan_create() in the l2cap_sock_alloc()
As a first step to remove l2cap_sock_alloc() and l2cap_sock_init() from
l2cap_core.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Tue, 7 Jun 2011 09:18:06 +0000 (11:18 +0200)]
Bluetooth: Clean up some code style issues
Fix lines longer than 80 chars in length.
Change-Id: I448077965c5f7723a4a9537977bfa664cfe104fd
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
David Miller [Thu, 19 May 2011 21:50:05 +0000 (17:50 -0400)]
Bluetooth: Kill set but unused variable 'cmd' in cmtp_recv_capimsg()
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Stephen Boyd [Thu, 12 May 2011 23:50:09 +0000 (16:50 -0700)]
Bluetooth: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning
Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following
warning:
In function 'copy_from_user',
inlined from 'rfcomm_sock_setsockopt' at
net/bluetooth/rfcomm/sock.c:705:
arch/x86/include/asm/uaccess_64.h:65:
warning: call to 'copy_from_user_overflow' declared with
attribute warning: copy_from_user() buffer size is not provably
correct
presumably due to buf_size being signed causing GCC to fail to
see that buf_size can't become negative.
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Mat Martineau [Fri, 3 Jun 2011 23:21:10 +0000 (16:21 -0700)]
Bluetooth: Fix check for the ERTM local busy state
Local busy is encoded in a bitfield, but was not masked out correctly.
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Mat Martineau [Fri, 3 Jun 2011 23:21:07 +0000 (16:21 -0700)]
Bluetooth: Restore accidentally-deleted line
When code was moved from l2cap_core.c to l2cap_sock.c in commit
6de0702b5b93da0ef097aa092b4597fbc024ebba, one line was dropped
from the old __l2cap_sock_close() implementation. This sk_state
change should still be in l2cap_chan_close().
Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Thu, 2 Jun 2011 12:24:52 +0000 (14:24 +0200)]
Bluetooth: Simplify hci_conn_accept_secure check
If the link key is secure (authenticated or combination 16 digit)
the sec_level will be always BT_SECURITY_HIGH. Therefore, instead
of checking the link key type simply check the sec_level on the link.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Jaikumar Ganesh [Tue, 24 May 2011 01:06:04 +0000 (18:06 -0700)]
Bluetooth: Add BT_POWER L2CAP socket option.
Add BT_POWER socket option used to control the power
characteristics of the underlying ACL link. When the remote end
has put the link in sniff mode and the host stack wants to send
data we need need to explicitly exit sniff mode to work well with
certain devices (For example, A2DP on Plantronics Voyager 855).
However, this causes problems with HID devices.
Hence, moving into active mode when sending data, irrespective
of who set the sniff mode has been made as a socket option. By
default, we will move into active mode. HID devices can set the
L2CAP socket option to prevent this from happening.
Currently, this has been implemented for L2CAP sockets. This has been
tested with incoming and outgoing L2CAP sockets for HID and A2DP.
Based on discussions on linux-bluetooth and patches submitted by
Andrei Emeltchenko.
Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Wed, 1 Jun 2011 15:28:48 +0000 (17:28 +0200)]
Bluetooth: Verify a pin code in pin_code_reply
As we cannot relay on a userspace mgmt api implementation we should verify
if pin_code_reply in fact contains the secure pin code.
If userspace replied with unsecure pincode when secure was required we will
send pin_code_neg_reply to the controller.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Wed, 1 Jun 2011 15:28:47 +0000 (17:28 +0200)]
Bluetooth: Remove a magic number
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johannes Berg [Wed, 1 Jun 2011 06:54:45 +0000 (08:54 +0200)]
Bluetooth: fix sparse & gcc warnings
sparse complains about a few things that should
be static.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:57 +0000 (14:20 -0300)]
Bluetooth: Set 'peer_addr_type' in hci_le_connect()
Set the 'peer_addr_type' field of the LE Create Connection command
sent in hci_le_connect().
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:56 +0000 (14:20 -0300)]
Bluetooth: Check advertising cache in hci_connect()
When connecting to a LE device, we need to check the advertising
cache in order to know the address type of that device.
If its advertising entry is not found, the connection is not
established and hci_connect() returns error.
Change-Id: I234912abc53b859becbe79625b08bc3b6eacc143
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:55 +0000 (14:20 -0300)]
Bluetooth: Remove useless check in hci_connect()
There is no need to check the connection's state since hci_conn_add()
has just created a new connection and its state has been set properly.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:54 +0000 (14:20 -0300)]
Bluetooth: Add 'dst_type' field to struct hci_conn
This patch adds a new field (dst_type) to the struct hci_conn which
holds the type of the destination address (bdaddr_t dst). This
approach is needed in order to use the struct hci_conn as an
abstraction of LE connections in HCI Layer. For non-LE this field
is ignored.
This patch also set properly the 'dst_type' field after initializing
LE hci_conn structures.
Change-Id: I1e363bb6de263fdb1fe976a5a16ed5debc9b8c0c
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Tue, 31 May 2011 13:49:26 +0000 (15:49 +0200)]
Bluetooth: Refactor hci_auth_complete_evt function
Replace if(conn) with if(!conn) checking to avoid too many nested statements
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Waldemar Rymarkiewicz [Tue, 31 May 2011 13:49:25 +0000 (15:49 +0200)]
Bluetooth: Fix auth_complete_evt for legacy units
Legacy devices don't re-authenticate the link properly if a link key
already exists. Thus, don't update sec_level for this case even if
hci_auth_complete_evt indicates success. Otherwise the sec_level will
not reflect a real security on the link.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:53 +0000 (16:23 -0300)]
Bluetooth: Advertising entries lifetime
This patch adds a timer to clear 'adv_entries' after three minutes.
After some amount of time, the advertising entries cached during
the last LE scan should be considered expired and they should be
removed from the advertising cache.
It was chosen a three minutes timeout as an initial attempt. This
value might change in future.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:52 +0000 (16:23 -0300)]
Bluetooth: Clear advertising cache before scanning
The LE advertising cache should be cleared before performing a LE
scanning. This will force the cache to contain only fresh advertising
entries.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:51 +0000 (16:23 -0300)]
Bluetooth: Add Advertising Report Meta Event handler
This patch adds a function to handle LE Advertising Report Meta
Events.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:50 +0000 (16:23 -0300)]
Bluetooth: LE advertising cache
This patch implements the LE advertising cache. It stores sensitive
information (bdaddr and bdaddr_type so far) gathered from LE
advertising report events.
Only advertising entries from connectables devices are added to the
cache.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Briglia [Thu, 26 May 2011 19:23:49 +0000 (16:23 -0300)]
Bluetooth: Add advertising report meta event structs
This patch adds definitions and a new struct for Advertising Report
Event from LE and Dual Mode controllers.
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 4 May 2011 22:42:50 +0000 (19:42 -0300)]
Bluetooth: Rename __l2cap_chan_close() to l2cap_chan_close()
To make it consistent with the rest of the API.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 4 May 2011 22:35:27 +0000 (19:35 -0300)]
Bluetooth: Remove export of l2cap_chan_clear_timer()
The call to l2cap_chan_clear_timer() is not really needed in l2cap_sock.c.
This patch also adds a call to l2cap_chan_clear_timer() to the only place
in __l2cap_sock_close() that wasn't calling it. It's safe call it there
because l2cap_chan_clear_timer() check first for timer_peding().
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 2 May 2011 21:25:01 +0000 (18:25 -0300)]
Bluetooth: create channel timer to replace sk_timer
The new timer does not belong to struct sock, tought it still touch some
sock things, but this will be sorted out soon.
Change-Id: I55dc122657f3b8e80e76acf8c479e2d5c9889af5
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 2 May 2011 20:13:55 +0000 (17:13 -0300)]
Bluetooth: Add chan->chan_type struct member
chan_type says if our chan is raw(direclty access to HCI),
connection less or connection oriented.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Thu, 28 Apr 2011 21:50:17 +0000 (18:50 -0300)]
Bluetooth: Create l2cap_chan_send()
This move all the sending logic to l2cap_core.c, but we still have a
socket dependence there, struct msghdr. It will be removed in some of the
further commits.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Thu, 28 Apr 2011 20:55:53 +0000 (17:55 -0300)]
Bluetooth: Create __l2cap_chan_close()
This is actually __l2cap_sock_close() renamed to __l2cap_chan_close().
At a first look it may not make sense, but with the further cleanups that
will come it will.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Fri, 20 May 2011 18:50:41 +0000 (11:50 -0700)]
Bluetooth: Remove unnecessary use of hci_dev_list_lock
The get_connections function has no need to use hci_dev_list_lock. The
code was there probably because of a copy-paste mistake.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
David Miller [Thu, 19 May 2011 22:09:00 +0000 (18:09 -0400)]
Bluetooth: Kill set but not used variable 'l2cap_sk' in rfcomm_sock_getsockopt_old()
Change-Id: I33c0404c6dcf1d3e8bc39e8c583f073329add294
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 18 May 2011 21:14:45 +0000 (18:14 -0300)]
Bluetooth: fix set but not used warning
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Ruiyi Zhang [Fri, 13 May 2011 05:07:52 +0000 (13:07 +0800)]
Bluetooth: Allow unsegmented SDU retries on sock_queue_rcv_skb failure
In L2CAP_SDU_UNSEGMENTED case, if sock_queue_rcv_skb returns error,
l2cap_ertm_reassembly_sdu should not return 0 so as to insert the
skb into BUSY_QUEUE for later retries.
Signed-off-by: Ruiyi Zhang <Ruiyi.Zhang@Atheros.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Dmitry Shmidt [Mon, 11 Jul 2011 17:48:09 +0000 (10:48 -0700)]
net: wireless: bcmdhd: Fix crash if event queue is empty
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Mon, 11 Jul 2011 17:45:33 +0000 (10:45 -0700)]
net: wireless: bcmdhd: Fix CFG80211 suspend/resume if interface is down
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Fri, 8 Jul 2011 22:33:58 +0000 (15:33 -0700)]
net: wireless: bcmdhd: Add setband/getband private commands
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Fri, 8 Jul 2011 00:04:44 +0000 (17:04 -0700)]
net: wireless: bcmdhd: Add packet filtering commands
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Rebecca Schultz Zavin [Fri, 8 Jul 2011 00:07:56 +0000 (17:07 -0700)]
gpu: ion: Validate handles passed via the kernel api
Before freeing or sharing handles, confirm that they
are valid in the provided client
Change-Id: I06ec599c0b277fcb5417325a12ecbf8b2d248a7b
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Dima Zavin [Fri, 8 Jul 2011 00:27:59 +0000 (17:27 -0700)]
plist: Remove the need to supply locks to plist heads
This was legacy code brought over from the RT tree and
is no longer necessary.
Signed-off-by: Dima Zavin <dima@android.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Walker <dwalker@codeaurora.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Link: http://lkml.kernel.org/r/1310084879-10351-2-git-send-email-dima@android.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Dmitry Shmidt [Thu, 7 Jul 2011 21:57:23 +0000 (14:57 -0700)]
net: wireless: bcmdhd: Fix private command output
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
JP Abgrall [Thu, 7 Jul 2011 03:09:38 +0000 (20:09 -0700)]
netfitler: xt_qtaguid: add another missing spin_unlock.
This time the symptom is caused by tagging the same socket twice
without untagging it in between.
This would cause it to not unlock, and return.
Signed-off-by: JP Abgrall <jpa@google.com>
Iliyan Malchev [Wed, 6 Jul 2011 23:53:21 +0000 (16:53 -0700)]
ion: fix ION_HEAP_<xxx>_MASK definitions
Signed-off-by: Iliyan Malchev <malchev@google.com>
Todd Poynor [Sat, 2 Jul 2011 00:19:56 +0000 (17:19 -0700)]
USB: OTG: Take wakelock when VBUS present
Enabled by default, can disable with:
echo N > /sys/module/otg_wakelock/parameters/enabled
Change-Id: I34974624c52ae23490852b44c270d2f326cf6116
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Choi, Jong-Hwan [Thu, 7 Jul 2011 00:07:04 +0000 (09:07 +0900)]
gpu: ion: Fix deferencing ERR_PTR
Change-Id: I986c380d75591571890f1a2cba1405e66789b25c
Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
Choi, Jong-Hwan [Thu, 7 Jul 2011 00:06:17 +0000 (09:06 +0900)]
gpu: ion: Fix possible memory leak
Change-Id: I66f5ad2c95513dfab9f4fc5ae2fcb1316f486d34
Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
Rebecca Schultz Zavin [Thu, 7 Jul 2011 01:07:24 +0000 (18:07 -0700)]
gpu: ion: Remove redunant code from ion_open
ion_client_create now does a lookup, so this need not
also be done from ion_open
Change-Id: Icb101bbf514bf2e40b4b5d9b320130bf185349aa
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 7 Jul 2011 01:07:01 +0000 (18:07 -0700)]
gpu: ion: Fix bug in ion client destroy
ion_client_destroy kernel api should only delete the client
if it's refcount has gone to zero.
Change-Id: Iaa662bd82d67279a9807e01f9a24aebe3d21c17d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
JP Abgrall [Wed, 6 Jul 2011 19:05:49 +0000 (12:05 -0700)]
netfilter: qtaguid: fix bad-arg handling when tagging socket
When processing args passed to the procfs ctrl, if the tag was
invalid it would exit without releasing the spin_lock...
Bye bye scheduling.
Signed-off-by: JP Abgrall <jpa@google.com>
Change-Id: Ic1480ae9d37bba687586094cf6d0274db9c5b28a
Rebecca Schultz Zavin [Sat, 2 Jul 2011 03:41:25 +0000 (20:41 -0700)]
gpu: ion: Fix bug in ion_client_create
If a process already had a client, ion_client_create
would loop forever.
Change-Id: I723207b5872dfc11be04ca27d38a3cf39c4a1426
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Dmitry Shmidt [Thu, 30 Jun 2011 21:05:42 +0000 (14:05 -0700)]
net: wireless: bcmdhd: Set interface name to 'wlan' by default
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Thu, 30 Jun 2011 17:09:06 +0000 (10:09 -0700)]
net: wireless: bcmdhd: Fix pm_notifier unregistration
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Thu, 30 Jun 2011 17:04:16 +0000 (10:04 -0700)]
net: wireless: bcmdhd: Postpone driver init call
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Thu, 30 Jun 2011 16:54:27 +0000 (09:54 -0700)]
net: wireless: bcmdhd: Add private start/stop commands
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Wed, 29 Jun 2011 23:03:25 +0000 (16:03 -0700)]
net: wireless: bcmdhd: Fix MAC address setting
If MAC address setting fails from wifi_get_mac_addr() it will be picked up
from nvram.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Greg Goldman [Wed, 29 Jun 2011 21:34:18 +0000 (14:34 -0700)]
Update to 5.90.125.33
Add logic to get MAC address before firmware is loaded
Change-Id: I2151a0fcc5aab914cfec8bfedf761b9f06445d1a
Signed-off-by: Howard M. Harte <hharte@broadcom.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Tue, 28 Jun 2011 22:09:49 +0000 (15:09 -0700)]
net: wireless: bcmdhd: Add SETFWPATH private command
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Tue, 28 Jun 2011 20:57:55 +0000 (13:57 -0700)]
net: wireless: bcmdhd: Fix wd_timer_valid field protection
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Lin Ma [Tue, 28 Jun 2011 01:53:59 +0000 (18:53 -0700)]
Update to 5.90.125.32:
* Move Android specific functions to wl_android (wifi control functions,
wifi device, pre-alloc buffer.)
* Link Android start/stop commands to interface up/down (download firmware
when primary interfacde is up.)
* Fix a issue in driver unload, the same IRQ can not be disabled twice
(set_irq_wake)
Change-Id: Id49c4f746f69371323c9a34834c3b628b78ff713
Signed-off-by: Howard M. Harte <hharte@broadcom.com>
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Rebecca Schultz Zavin [Fri, 1 Jul 2011 02:16:59 +0000 (19:16 -0700)]
gpu: ion: Remove incorrect error message
The function name is wrong here, and this function may
sometimes be called to see if a value passed from userspace
is an ion handle. Since it's not really an error when it
fails, remove the log message.
Change-Id: I7bee0e7ffb72b4c4768774a3586f97e306700c21
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Fri, 1 Jul 2011 01:09:05 +0000 (18:09 -0700)]
gpu: ion: Fix bug in ion_buffer_add
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Rebecca Schultz Zavin [Thu, 30 Jun 2011 19:19:55 +0000 (12:19 -0700)]
gpu: ion: Several fixes
Fix some cases where locks were not released on error paths
Change heap->prio to heap->id to make meaning clearer
Fix kernel doc to match sources
Rebecca Schultz Zavin [Thu, 30 Jun 2011 02:44:29 +0000 (19:44 -0700)]
gpu: ion: Add ION Memory Manager
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Colin Cross [Wed, 29 Jun 2011 20:43:12 +0000 (13:43 -0700)]
Revert "PM: Prevent waiting forever on asynchronous resume after abort"
This reverts commit
fa92a3d6959546baa27e892188d3e9bb79c31741.
Colin Cross [Wed, 29 Jun 2011 20:42:56 +0000 (13:42 -0700)]
Revert "PM: Wait for completion of the parent resume before resuming"
This reverts commit
a0f07aae54e87a9fad6d19c0e57398f54d858f06.
JP Abgrall [Tue, 28 Jun 2011 06:31:46 +0000 (23:31 -0700)]
nf: qtaguid: make procfs entry for ctrl return correct data.
(This is a direct cherry-pick from 2.6.39: I3b925802)
Fixed procreader for /proc/net/xt_qtaguid/ctrl: it would just
fill the output with the same entry.
Simplify the **start handling.
Signed-off-by: JP Abgrall <jpa@google.com>
Change-Id: I3b92580228f2b57795bb2d0d6197fc95ab6be552
JP Abgrall [Tue, 28 Jun 2011 04:03:04 +0000 (21:03 -0700)]
nf: qtaguid: workaround xt_socket_get_sk() returning bad SKs.
(This is a direct cherry pick from 2.6.39: Id2a9912b)
* xt_socket_get_sk() returns invalid sockets when the sk_state is TCP_TIME_WAIT.
Added detection of time-wait.
* Added more constrained usage: qtaguid insures that xt_socket_get*_sk() is
not invoked for unexpected hooks or protocols (but I have not seen those
active at the point where the returned sk is bad).
Signed-off-by: JP Abgrall <jpa@google.com>
Change-Id: Id2a9912bb451a3e59d012fc55bbbd40fbb90693f
Dmitry Shmidt [Fri, 24 Jun 2011 17:16:22 +0000 (10:16 -0700)]
net: wireless: bcmdhd: Fix memory poisoning in wl_free_wdev()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Thu, 23 Jun 2011 17:41:27 +0000 (10:41 -0700)]
net: wireless: bcmdhd: Set proper debug messages for private IOCTL
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Colin Cross [Wed, 22 Jun 2011 23:05:47 +0000 (16:05 -0700)]
mm: ashmem: Fix arguments to ashmem_shrink
The arguments to shrink functions have changed, update
ashmem_shrink to match.
Change-Id: Id279d22d761a2a7c4965c957960eef804d06cc07
Signed-off-by: Colin Cross <ccross@android.com>
Colin Cross [Wed, 22 Jun 2011 23:05:47 +0000 (16:05 -0700)]
android: lowmemorykiller: Fix arguments to lowmem_shrink
The arguments to shrink functions have changed, update
lowmem_shrink to match.
Change-Id: I48f436e0509c416dc0b18db500234f7b1d6d42e1
Signed-off-by: Colin Cross <ccross@android.com>
Dmitry Shmidt [Wed, 22 Jun 2011 18:06:16 +0000 (11:06 -0700)]
net: wireless: bcmdhd: Add RSSI and SETSUSPENDOPT private commands
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Colin Cross [Wed, 22 Jun 2011 21:27:37 +0000 (14:27 -0700)]
net: ipv4: tcp: Fix crash in tcp_nuke_addr
ip_route_output_key can return an ERR_PTR, don't dereference it.
Change-Id: I6b86a451b2bdb33873d79b3cf90c11dbe72bc081
Signed-off-by: Colin Cross <ccross@android.com>
Dmitry Shmidt [Tue, 21 Jun 2011 23:19:35 +0000 (16:19 -0700)]
net: wireless: bcmdhd: Fix failure in register_sysctl_table() call
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Dmitry Shmidt [Mon, 20 Jun 2011 20:54:48 +0000 (13:54 -0700)]
net: wireless: bcmdhd: Fix 3.0 compilation for CFG80211
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
JP Abgrall [Thu, 16 Jun 2011 21:37:03 +0000 (14:37 -0700)]
netfilter: have ip*t REJECT set the sock err when an icmp is to be sent
Allow the REJECT --reject-with icmp*blabla to also set the matching error
locally on the socket affected by the reject.
This allows the process to see an error almost as if it received it
via ICMP.
It avoids the local process who's ingress packet is rejected to have to
wait for a pseudo-eternity until some timeout kicks in.
Ideally, this should be enabled with a new iptables flag similar to
--reject-with-sock-err
For now it is enabled with CONFIG_IP*_NF_TARGET_REJECT_SKERR option.
Change-Id: I649a4fd5940029ec0b3233e5abb205da6984891e
Signed-off-by: JP Abgrall <jpa@google.com>
JP Abgrall [Mon, 20 Jun 2011 19:41:46 +0000 (12:41 -0700)]
netfilter: add xt_qtaguid matching module
This module allows tracking stats at the socket level for given UIDs.
It replaces xt_owner.
If the --uid-owner is not specified, it will just count stats based on
who the skb belongs to. This will even happen on incoming skbs as it
looks into the skb via xt_socket magic to see who owns it.
If an skb is lost, it will be assigned to uid=0.
To control what sockets of what UIDs are tagged by what, one uses:
echo t $sock_fd $accounting_tag $the_billed_uid \
> /proc/net/xt_qtaguid/ctrl
So whenever an skb belongs to a sock_fd, it will be accounted against
$the_billed_uid
and matching stats will show up under the uid with the given
$accounting_tag.
Because the number of allocations for the stats structs is not that big:
~500 apps * 32 per app
we'll just do it atomic. This avoids walking lists many times, and
the fancy worker thread handling. Slabs will grow when needed later.
It use netdevice and inetaddr notifications instead of hooks in the core dev
code to track when a device comes and goes. This removes the need for
exposed iface_stat.h.
Put procfs dirs in /proc/net/xt_qtaguid/
ctrl
stats
iface_stat/<iface>/...
The uid stats are obtainable in ./stats.
Change-Id: I01af4fd91c8de651668d3decb76d9bdc1e343919
Signed-off-by: JP Abgrall <jpa@google.com>
JP Abgrall [Wed, 15 Jun 2011 23:52:40 +0000 (16:52 -0700)]
nf: xt_socket: export the fancy sock finder code
The socket matching function has some nifty logic to get the struct sock
from the skb or from the connection tracker.
We export this so other xt_* can use it, similarly to ho how
xt_socket uses nf_tproxy_get_sock.
Change-Id: I11c58f59087e7f7ae09e4abd4b937cd3370fa2fd
Signed-off-by: JP Abgrall <jpa@google.com>
Mike Lockwood [Thu, 2 Jun 2011 02:17:36 +0000 (22:17 -0400)]
USB: gadget: f_mtp: Add PTP variant of MTP USB function
This is the same as MTP but with PTP interface descriptor.
Also removed obsolete ioctl for switching between MTP and PTP mode
Signed-off-by: Mike Lockwood <lockwood@android.com>
Mike Lockwood [Mon, 2 May 2011 00:36:19 +0000 (20:36 -0400)]
USB: gadget: f_mtp: Add support for queueing multiple interrupt requests
Fixes problem sending "store added" events when there are multiple stores
Signed-off-by: Mike Lockwood <lockwood@android.com>