14 Jun, 2011
8 commits
-
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
-
We now plan to use l2cap_set_timer and l2cap_clear_timer in ERTM timers.
Signed-off-by: Gustavo F. Padovan
-
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
-
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.Signed-off-by: Gustavo F. Padovan
-
close() calls l2cap_sock_kill() on l2cap_sock.c
Signed-off-by: Gustavo F. Padovan
-
This abstracts the call to sock_queue_recv_skb() into
l2cap_chan_ops->recv().Signed-off-by: Gustavo F. Padovan
-
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.cSigned-off-by: Gustavo F. Padovan
-
As a first step to remove l2cap_sock_alloc() and l2cap_sock_init() from
l2cap_core.cSigned-off-by: Gustavo F. Padovan
10 Jun, 2011
8 commits
-
Conflicts:
net/bluetooth/rfcomm/sock.c -
Fix lines longer than 80 chars in length.
Signed-off-by: Waldemar Rymarkiewicz
Signed-off-by: Gustavo F. Padovan -
Signed-off-by: David S. Miller
Signed-off-by: Gustavo F. Padovan -
Some old hci controllers do not accept any mask so leave the
default mask on for these devices.< HCI Command: Set Event Mask (0x03|0x0001) plen 8
Mask: 0xfffffbff00000000
> HCI Event: Command Complete (0x0e) plen 4
Set Event Mask (0x03|0x0001) ncmd 1
status 0x12
Error: Invalid HCI Command ParametersSigned-off-by: Ville Tervo
Tested-by: Corey Boyle
Tested-by: Ed Tomlinson
Signed-off-by: Gustavo F. Padovan -
Signed-off-by: David S. Miller
Signed-off-by: Gustavo F. Padovan -
shutdown should wait for SCO link to be properly disconnected before
detroying the socket, otherwise an application using the socket may
assume link is properly disconnected before it really happens which
can be a problem when e.g synchronizing profile switch.Signed-off-by: Luiz Augusto von Dentz
Signed-off-by: Gustavo F. Padovan -
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
correctpresumably due to buf_size being signed causing GCC to fail to
see that buf_size can't become negative.Cc: Marcel Holtmann
Cc: Gustavo F. Padovan
Signed-off-by: Stephen Boyd
Signed-off-by: Gustavo F. Padovan -
Structures "l2cap_conninfo" and "rfcomm_conninfo" have one padding
byte each. This byte in "cinfo" is copied to userspace uninitialized.Signed-off-by: Filip Palian
Acked-by: Marcel Holtmann
Signed-off-by: Gustavo F. Padovan
09 Jun, 2011
24 commits
-
Local busy is encoded in a bitfield, but was not masked out correctly.
Signed-off-by: Mat Martineau
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
Signed-off-by: Waldemar Rymarkiewicz
Signed-off-by: Gustavo F. Padovan -
sparse complains about a few things that should
be static.Signed-off-by: Johannes Berg
Signed-off-by: Gustavo F. Padovan -
Set the 'peer_addr_type' field of the LE Create Connection command
sent in hci_le_connect().Signed-off-by: Andre Guedes
Acked-by: Ville Tervo
Signed-off-by: Gustavo F. Padovan -
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.Signed-off-by: Andre Guedes
Acked-by: Ville Tervo
Signed-off-by: Gustavo F. Padovan -
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
Acked-by: Ville Tervo
Signed-off-by: Gustavo F. Padovan -
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.Signed-off-by: Andre Guedes
Signed-off-by: Gustavo F. Padovan -
Replace if(conn) with if(!conn) checking to avoid too many nested statements
Signed-off-by: Waldemar Rymarkiewicz
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
This patch adds a function to handle LE Advertising Report Meta
Events.Signed-off-by: Andre Guedes
Signed-off-by: Anderson Briglia
Signed-off-by: Gustavo F. Padovan -
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
Signed-off-by: Gustavo F. Padovan -
This patch adds definitions and a new struct for Advertising Report
Event from LE and Dual Mode controllers.Signed-off-by: Anderson Briglia
Signed-off-by: Gustavo F. Padovan -
To make it consistent with the rest of the API.
Signed-off-by: Gustavo F. Padovan
-
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
-
The new timer does not belong to struct sock, tought it still touch some
sock things, but this will be sorted out soon.Signed-off-by: Gustavo F. Padovan
-
chan_type says if our chan is raw(direclty access to HCI),
connection less or connection oriented.Signed-off-by: Gustavo F. Padovan
-
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
-
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