summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of ↵John W. Linville2011-05-0511-465/+842
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/libertas/if_cs.c drivers/net/wireless/rtlwifi/pci.c net/bluetooth/l2cap_sock.c
| * Merge branch 'master' of ↵John W. Linville2011-04-2911-465/+842
| |\ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next-2.6
| | * Bluetooth: Fix updating conn->auth_type in hci_io_capa_request_evtJohan Hedberg2011-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some circumstances hci_get_auth_req will return a value different from the current conn->auth_type. In these cases update conn->auth_type so that when a user confirm request comes it doesn't falsely trigger auto-accept. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add store_hint parameter to mgmt_new_keyJohan Hedberg2011-04-282-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even for keys that shouldn't be stored some use cases require the knowledge of a new key having been created so that the conclusion of a successful pairing can be made. Therefore, always send the mgmt_new_key event but add a store_hint parameter to it to indicate to user space whether the key should be stored or not. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Remove old_key_type from mgmt_ev_new_keyJohan Hedberg2011-04-282-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | User space shouldn't have any need for the old key type so remove it from the corresponding Management interface event. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix connection key type updating for buggy controllersJohan Hedberg2011-04-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a controller generates a changed combination key as its first key the connection key type will not be correctly set. In these situations make sure the update the connection key type when such a buggy controller is detected. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix old_key_type logic for non-persistent keysJohan Hedberg2011-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Even if there's no previous key stored the connection might still be secured with a non-persistent key and in that case the key type in the hci_conn struct should be checked. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix link key persistent storage criteriaJohan Hedberg2011-04-283-4/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Link keys should only be stored if very specific criteria of the authentication process are fulfilled. This patch essentially copies the criteria that user space has so far been using to the kernel side so that the management interface works properly. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix logic in hci_pin_code_request_evtJohan Hedberg2011-04-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The mgmt_ev_pin_code_request event should not be sent to user space if the request gets rejected by the kernel due to the pairable flag not being set. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix reason code for pairing rejectionJohan Hedberg2011-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | "Pairing not allowed" is 0x18 and not 0x16. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add confirm_hint parameter to user confirmation requestsJohan Hedberg2011-04-282-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When accepting a pairing request which fulfills the SSP auto-accept criteria we need to push the request all the way to the user for confirmation. This patch adds a new hint to the user_confirm_request management event so user space can know when to show a numeric comparison dialog and when to show a simple yes/no confirmation dialog. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix HCI_CONN_AUTH_PEND flag for all authentication requestsJohan Hedberg2011-04-281-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | The HCI_CONN_AUTH_PEND flag should be set whenever requesting authentication so that multiple pending requests can't occur. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add variable SSP auto-accept delay supportJohan Hedberg2011-04-283-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some test systems require an arbitrary delay to the auto-accept test cases for Secure Simple Pairing in order for the tests to pass. Previously when this was handled in user space it was worked around by code modifications and recompilation, but now that it's on the kernel side it's more convenient if there's a debugfs interface for it. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add automated SSP user confirmation responsesJohan Hedberg2011-04-281-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds automated negative and positive (auto-accept) responses for Secure Simple Pairing user confirmation requests. The responses are only sent if the HCI_MGMT flag is set in order not to confuse older user space versions (without management interface support). Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add secure flag for mgmt_pin_code_reqWaldemar Rymarkiewicz2011-04-282-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the mgmt_pin_code_request interface to require secure pin code (16 digit) for authentication. This is a kernel part of the secure pin code requirement notification to user space agent. Code styling fix by Johan Hedberg. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Respect local MITM req in io_cap replyWaldemar Rymarkiewicz2011-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If host requires MITM protection notify that to controller in io capabilities reply even if the remote device requires no bonding. If it is not respected, host can get an unauthenticated link key while it expects authenticated one. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Ignore key unauthenticated for high securityWaldemar Rymarkiewicz2011-04-281-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | High security level for pre v2.1 devices requires combination link key authenticated by at least 16 digit PIN code. It's also necessary to update key_type and pin_length when the key exists and is sufficently secured for the connection as there will be no link key notify event in that case. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Map sec_level to link key requirementsWaldemar Rymarkiewicz2011-04-282-10/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | Keep the link key type together with connection and use it to map security level to link key requirements. Authenticate and/or encrypt connection if the link is insufficiently secure. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Don't modify sec_level if auth failedWaldemar Rymarkiewicz2011-04-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If authentication fails the security level should stay as it was set before the process has started. Setting BT_SECURITY_LOW can hide real security level on a link eg. having BT_SECURITY_MEDIUM on the link, re-authenticate with failure to get BT_SECURITY_HIGH, as a result we get BT_SECURITY_LOW on the link while the real security is still medium. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add definitions for link key typesWaldemar Rymarkiewicz2011-04-282-4/+5
| | | | | | | | | | | | | | | | | | | | | Introduce the link key types defs and use them instead of magic numbers. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add discovering event to the Management interfaceJohan Hedberg2011-04-282-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new event to the Management interface to track when local adapters are discovering remote devices. For now this only tracks BR/EDR discovery procedures. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Add basic discovery commands to the management interfaceJohan Hedberg2011-04-281-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds start_discovery and stop_discovery commands to the management interface. Right now their implementation is fairly simplistic and the parameters are fixed to what user space has defaulted to so far. This is the very initial phase for discovery implementation into the kernel. Next steps include name resolution, LE scanning and bdaddr type handling. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Don't export l2cap_sock_opsGustavo F. Padovan2011-04-281-1/+3
| | | | | | | | | | | | | | | | | | l2cap_sk_ops can be static, it's not used outside l2cap_sock.c Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Fix memory leak with L2CAP channelsGustavo F. Padovan2011-04-282-4/+8
| | | | | | | | | | | | | | | | | | A new l2cap_chan_free() is added to free the channels. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move conn to struct l2cap_chanGustavo F. Padovan2011-04-284-62/+55
| | | | | | | | | | | | | | | | | | | | | There is no need to the socket deal directly with the channel, most of the time it cares about the channel only. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move more vars to struct l2cap_chanGustavo F. Padovan2011-04-282-70/+72
| | | | | | | | | | | | | | | | | | In this commit, psm, scid and dcid. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move more channel info to struct l2cap_chanGustavo F. Padovan2011-04-285-103/+114
| | | | | | | | | | | | | | | | | | | | | In this commit, omtu, imtu, flush_to, mode and sport. It also remove the pi var from l2cap_sock_sendmsg(). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move more vars to struct l2cap_chanGustavo F. Padovan2011-04-273-67/+68
| | | | | | | | | | | | | | | | | | In this commit all ERTM and Streaming Mode specific vars. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move some more elements to struct l2cap_chanGustavo F. Padovan2011-04-272-60/+70
| | | | | | | | | | | | | | | | | | In this commit sec_level, force_reliable, role_switch and flushable. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Rename l2cap_do_connect() to l2cap_chan_connect()Gustavo F. Padovan2011-04-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | l2cap_chan_connect() is a much better name and reflects what this functions is doing (or will do once socket dependence is removed from the core). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Move conf_state to struct l2cap_chanGustavo F. Padovan2011-04-272-46/+52
| | | | | | | | | | | | | | | | | | First move of elements depending on user data. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Refactor L2CAP channel allocationGustavo F. Padovan2011-04-272-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | If the allocation happens at l2cap_sock_create() will be able to use the struct l2cap_chan to store channel info that comes from the user via setsockopt. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Merge master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth-2.6Gustavo F. Padovan2011-04-204-2/+11
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: net/bluetooth/l2cap_core.c net/bluetooth/l2cap_sock.c net/bluetooth/mgmt.c
| * | \ Merge branch 'master' of ↵John W. Linville2011-04-264-5/+12
| |\ \ \ | | |/ / | |/| / | | |/ git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
* | | Merge branch 'master' of ↵David S. Miller2011-04-264-5/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Resolved logic conflicts causing a build failure due to drivers/net/r8169.c changes using a patch from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
| * \ \ Merge branch 'master' of ↵David S. Miller2011-04-224-5/+12
| |\ \ \ | | | |/ | | |/| | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
| | * | Bluetooth: Only keeping SAR bits when retransmitting one frame.Ruiyi Zhang2011-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When retrasmitting one frame, only SAR bits in control field should be kept. Signed-off-by: Ruiyi Zhang <Ruiyi.zhang@atheros.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * | Bluetooth: fix shutdown on SCO socketsLuiz Augusto von Dentz2011-04-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <luiz.dentz-von@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * | Bluetooth: Fix keeping the command timer runningVinicius Costa Gomes2011-04-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the teardown path the reset command is sent to the controller, this event causes the command timer to be reactivated. So the timer is removed in two situations, when the adapter isn't marked as UP and when we know that some command has been sent. Reported-by: Keith Packard <keithp@keithp.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * | Bluetooth: Fix refcount balance for hci connectionVille Tervo2011-04-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hci_io_capa_reply_evt() holds reference for hciconnection. It's useless since hci_io_capa_request_evt()/hci_simple_pair_complete_evt() already protects the connection. In addition it leaves connection open after failed SSP pairing. Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* | | | bluetooth: Fix use-before-initiailized var.David S. Miller2011-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net/bluetooth/l2cap_core.c: In function ‘l2cap_recv_frame’: net/bluetooth/l2cap_core.c:3612:15: warning: ‘sk’ may be used uninitialized in this function net/bluetooth/l2cap_core.c:3612:15: note: ‘sk’ was declared here Actually the problem is in the inline function l2cap_data_channel(), we branch to the label 'done' which tests 'sk' before we set it to anything. Initialize it to NULL to fix this. Signed-off-by: David S. Miller <davem@davemloft.net>
* | | | Merge branch 'master' of ↵John W. Linville2011-04-253-666/+754
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-core.c drivers/net/wireless/rt2x00/rt2x00queue.c drivers/net/wireless/rt2x00/rt2x00queue.h
| * | | Bluetooth: Fix lockdep warning in L2CAPGustavo F. Padovan2011-04-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a regression from the L2CAP "rewrite" patches. Purge the tx_q already happens on l2cap_chan_del() so we don't need it at l2cap_disconnect_req(). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Fix another locking unbalanceGustavo F. Padovan2011-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | l2cap_get_sock_by_scid was changed to not lock the socket anymore, but I forgot to change all the users of this function. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Don't lock sock inside l2cap_get_sock_by_scid()Gustavo F. Padovan2011-04-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix an locking issue with the new l2cap_att_channel(). l2cap_att_channel() was trying to lock a locked socket. Reported-by: Anderson Lizardo <anderson.lizardo@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Fix Out Of Band pairing when mgmt interface is disabledSzymon Janc2011-04-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use kernel stored remote Out Of Band data only if management interface is enabled. Otherwise HCI_OP_REMOTE_OOB_DATA_NEG_REPLY was sent to controller even if remote Out Of Band data was present in bluetoothd. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Add proper handling of received LE dataGustavo F. Padovan2011-04-131-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Despite it works, handling through l2cap_data_channel() is wrongs. That function should handle only connection oriented data. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Fix wrong comparison in listen()Gustavo F. Padovan2011-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We should check for the pi->scid there. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Move tx queue to struct l2cap_chanGustavo F. Padovan2011-04-132-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | tx_q is the queue used by ERTM mode. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | | Bluetooth: Remove unneeded uninitialized_vars()Gustavo F. Padovan2011-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | That was unnecessary use of it. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
OpenPOWER on IntegriCloud