aboutsummaryrefslogtreecommitdiff
path: root/include/net/bluetooth
AgeCommit message (Collapse)AuthorFilesLines
2011-07-08Bluetooth: Add functions to manipulate the link key list for SMPVinicius Costa Gomes1-0/+5
As the LTK (the new type of key being handled now) has more data associated with it, we need to store this extra data and retrieve the keys based on that data. Methods for searching for a key and for adding a new LTK are introduced here. Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-08Bluetooth: Add new structures for supporting SM key distributionVinicius Costa Gomes3-0/+22
We need these changes because SMP keys may have more information associated with them, for example, in the LTK case, it has an encrypted diversifier (ediv) and a random number (rand). Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-08Bluetooth: Add support for SMP phase 3 (key distribution)Vinicius Costa Gomes1-0/+1
This adds support for generating and distributing all the keys specified in the third phase of SMP. This will make possible to re-establish secure connections, resolve private addresses and sign commands. For now, the values generated are random. Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-07Bluetooth: Remove L2CAP busy queueMat Martineau1-4/+0
The ERTM receive buffer is now handled in a way that does not require the busy queue and the associated polling code. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-07Bluetooth: Use event-driven approach for handling ERTM receive bufferMat Martineau1-0/+2
This change moves most L2CAP ERTM receive buffer handling out of the L2CAP core and in to the socket code. It's up to the higher layer (the socket code, in this case) to tell the core when its buffer is full or has space available. The recv op should always accept incoming ERTM data or else the connection will go down. Within the socket layer, an skb that does not fit in the socket receive buffer will be temporarily stored. When the socket is read from, that skb will be placed in the receive buffer if possible. Once adequate buffer space becomes available, the L2CAP core is informed and the ERTM local busy state is cleared. Receive buffer management for non-ERTM modes is unchanged. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-06Bluetooth: Add lmp_host_le_capable() macroAndre Guedes2-0/+6
Since we have the extended LMP features properly implemented, we should check the LMP_HOST_LE bit to know if the host supports LE. Signed-off-by: Andre Guedes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-06Bluetooth: Add enable_le module parameterAndre Guedes1-0/+1
This patch adds a new module parameter to enable/disable host LE support. By default host LE support is disabled. Signed-off-by: Andre Guedes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-06Bluetooth: Write LE Host Supported commandAndre Guedes1-0/+6
This patch adds a handler to Write LE Host Supported command complete events. Once this commands has completed successfully, we should read the extended LMP features and update the extfeatures field in hci_dev. Signed-off-by: Andre Guedes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-06Bluetooth: Add extfeatures to struct hci_devAndre Guedes2-0/+5
This new field holds the extended LMP features value. Some LE mechanism such as discovery procedure needs to read the extended LMP features to work properly. Signed-off-by: Andre Guedes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-07-01Bluetooth: Clean up unused struct hci_conn itemsGustavo F. Padovan1-2/+0
priv and lock are never used Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-30Bluetooth: Add bt_printkJoe Perches1-3/+6
Add a local logging function to emit bluetooth specific messages. Using vsprintf extension %pV saves code/text space. Convert the current BT_INFO and BT_ERR macros to use bt_printk. Remove __func__ from BT_ERR macro (and the uses). Prefix "Bluetooth: " to BT_ERR Remove __func__ from BT_DBG as function can be prefixed when using dynamic_debug. With allyesconfig: text data bss dec hex filename 129956 8632 36096 174684 2aa5c drivers/bluetooth/built-in.o.new2 134402 8632 36064 179098 2bb9a drivers/bluetooth/built-in.o.old 14778 1012 3408 19198 4afe net/bluetooth/bnep/built-in.o.new2 15067 1012 3408 19487 4c1f net/bluetooth/bnep/built-in.o.old 346595 19163 86080 451838 6e4fe net/bluetooth/built-in.o.new2 353751 19163 86064 458978 700e2 net/bluetooth/built-in.o.old 18483 1172 4264 23919 5d6f net/bluetooth/cmtp/built-in.o.new2 18927 1172 4264 24363 5f2b net/bluetooth/cmtp/built-in.o.old 19237 1172 5152 25561 63d9 net/bluetooth/hidp/built-in.o.new2 19581 1172 5152 25905 6531 net/bluetooth/hidp/built-in.o.old 59461 3884 14464 77809 12ff1 net/bluetooth/rfcomm/built-in.o.new2 61206 3884 14464 79554 136c2 net/bluetooth/rfcomm/built-in.o.old with x86 defconfig (and just bluetooth): $ size net/bluetooth/built-in.o.defconfig.* text data bss dec hex filename 66358 933 100 67391 1073f net/bluetooth/built-in.o.defconfig.new 66643 933 100 67676 1085c net/bluetooth/built-in.o.defconfig.old Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-30Bluetooth: Rename function bt_err to bt_to_errnoJoe Perches1-1/+1
Make it easier to use more normal logging styles later. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-24Merge branch 'master' of ↵John W. Linville7-65/+259
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/rtlwifi/pci.c include/linux/netlink.h
2011-06-16Bluetooth: Use bit operations on conn_stateGustavo F. Padovan1-12/+14
Instead of setting bits manually we use set_bit, test_bit, etc. Also remove L2CAP_ prefix from macros. Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-16Bluetooth: use bit operation on conf_stateGustavo F. Padovan1-9/+11
Instead of making the bit operations manually, we now use set_bit, test_bit, etc. Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-16Bluetooth: Add blacklisting support for mgmt interfaceAntti Julku1-0/+10
Management interface commands for blocking and unblocking devices. Signed-off-by: Antti Julku <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-16Bluetooth: Move blacklisting functions to hci_coreAntti Julku1-0/+2
Move blacklisting functions to hci_core.c, so that they can be used by both management interface and hci socket interface. Signed-off-by: Antti Julku <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-14Bluetooth: Add key size checks for SMPVinicius Costa Gomes2-0/+4
This patch implements a check in smp cmd pairing request and pairing response to verify if encryption key maximum size is compatible in both slave and master when SMP Pairing is requested. Keys are also masked to the correct negotiated size. Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-14Bluetooth: Add support for SMP timeoutVinicius Costa Gomes1-0/+2
This patch adds support for disconnecting the link when SMP procedure takes more than 30 seconds. SMP begins when either the Pairing Request command is sent or the Pairing Response is received, and it ends when the link is encrypted (or terminated). Vol 3, Part H Section 3.4. Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Update the security level when link is encryptedVinicius Costa Gomes1-0/+3
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add support for LE Start EncryptionVinicius Costa Gomes2-0/+40
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add SMP confirmation checks methodsAnderson Briglia1-0/+1
This patch includes support for generating and sending the random value used to produce the confirmation value. Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add SMP confirmation structsAnderson Briglia1-0/+5
This patch adds initial support for verifying the confirmation value that the remote side has sent. Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add support for using the crypto subsystemVinicius Costa Gomes1-0/+2
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 <[email protected]> Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add simple SMP pairing negotiationAnderson Briglia1-0/+17
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Implement the first SMP commandsAnderson Briglia1-0/+26
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 <[email protected]> Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: keep reference if any ERTM timer is enabledGustavo F. Padovan1-6/+9
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 <[email protected]>
2011-06-13Bluetooth: Make timer functions genericGustavo F. Padovan1-0/+2
We now plan to use l2cap_set_timer and l2cap_clear_timer in ERTM timers. Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add refcnt to struct l2cap_chanGustavo F. Padovan1-0/+2
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 <[email protected]>
2011-06-13Bluetooth: Add state tracking to struct l2cap_chanGustavo F. Padovan1-0/+3
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 <[email protected]>
2011-06-13Bluetooth: add close() callback to l2cap_chan_opsGustavo F. Padovan1-2/+1
close() calls l2cap_sock_kill() on l2cap_sock.c Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: add recv() callback to l2cap_chan_opsGustavo F. Padovan1-0/+1
This abstracts the call to sock_queue_recv_skb() into l2cap_chan_ops->recv(). Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-13Bluetooth: Add l2cap_chan_ops abstractionGustavo F. Padovan1-3/+9
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 <[email protected]>
2011-06-09Bluetooth: Clean up some code style issuesWaldemar Rymarkiewicz3-19/+35
Fix lines longer than 80 chars in length. Signed-off-by: Waldemar Rymarkiewicz <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Add BT_POWER L2CAP socket option.Jaikumar Ganesh3-1/+10
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Add 'dst_type' field to struct hci_connAndre Guedes1-0/+1
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Fix auth_complete_evt for legacy unitsWaldemar Rymarkiewicz1-0/+1
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Advertising entries lifetimeAndre Guedes1-0/+2
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Clear advertising cache before scanningAndre Guedes1-0/+6
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: LE advertising cacheAndre Guedes1-0/+13
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 <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Add advertising report meta event structsAnderson Briglia1-0/+19
This patch adds definitions and a new struct for Advertising Report Event from LE and Dual Mode controllers. Signed-off-by: Anderson Briglia <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Rename __l2cap_chan_close() to l2cap_chan_close()Gustavo F. Padovan1-1/+1
To make it consistent with the rest of the API. Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Remove export of l2cap_chan_clear_timer()Gustavo F. Padovan1-1/+0
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 <[email protected]>
2011-06-08Bluetooth: create channel timer to replace sk_timerGustavo F. Padovan1-2/+3
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 <[email protected]>
2011-06-08Bluetooth: Add chan->chan_type struct memberGustavo F. Padovan1-0/+5
chan_type says if our chan is raw(direclty access to HCI), connection less or connection oriented. Signed-off-by: Gustavo F. Padovan <[email protected]>
2011-06-08Bluetooth: Create l2cap_chan_send()Gustavo F. Padovan1-8/+1
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 <[email protected]>
2011-06-08Bluetooth: Create __l2cap_chan_close()Gustavo F. Padovan1-4/+1
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 <[email protected]>
2011-06-06net: remove interrupt.h inclusion from netdevice.hAlexey Dobriyan1-0/+1
* remove interrupt.g inclusion from netdevice.h -- not needed * fixup fallout, add interrupt.h and hardirq.h back where needed. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-05-16Merge branch 'master' of ↵John W. Linville2-3/+7
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-agn-tx.c net/mac80211/sta_info.h
2011-05-11Bluetooth: Double check sec req for pre 2.1 deviceWaldemar Rymarkiewicz1-0/+1
In case of pre v2.1 devices authentication request will return success immediately if the link key already exists without any authentication process. That means, it's not possible to re-authenticate the link if you already have combination key and for instance want to re-authenticate to get the high security (use 16 digit pin). Therefore, it's necessary to check security requirements on auth complete event to prevent not enough secure connection. Signed-off-by: Waldemar Rymarkiewicz <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>