summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of ↵John W. Linville2012-09-244-15/+51
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
| * Bluetooth: mgmt: Implement support for passkey notificationJohan Hedberg2012-09-183-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Secure Simple Pairing with devices that have KeyboardOnly as their IO capability. Such devices will cause a passkey notification on our side and optionally also keypress notifications. Without this patch some keyboards cannot be paired using the mgmt interface. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Cc: stable@vger.kernel.org Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: debug: Print refcnt for hci_devAndrei Emeltchenko2012-09-081-0/+6
| | | | | | | | | | | | | | Add debug output for HCI kref. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: trivial: Make hci_chan_del return voidAndrei Emeltchenko2012-09-081-1/+1
| | | | | | | | | | | | | | Return code is not needed in hci_chan_del Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Remove unneeded zero initAndrei Emeltchenko2012-09-081-9/+0
| | | | | | | | | | | | | | | | hdev is allocated with kzalloc so zero initialization is not needed. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Use kref for l2cap channel reference countingSyam Sidhardhan2012-08-211-2/+1
| | | | | | | | | | | | | | | | | | | | This patch changes the struct l2cap_chan and associated code to use kref api for object refcounting and freeing. Suggested-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: mgmt: Add device disconnect reasonMikel Astiz2012-08-212-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MGMT_EV_DEVICE_DISCONNECTED will now expose the disconnection reason to userland, distinguishing four possible values: 0x00 Reason not known or unspecified 0x01 Connection timeout 0x02 Connection terminated by local host 0x03 Connection terminated by remote host Note that the local/remote distinction just determines which side terminated the low-level connection, regardless of the disconnection of the higher-level profiles. This can sometimes be misleading and thus must be used with care. For example, some hardware combinations would report a locally initiated disconnection even if the user turned Bluetooth off in the remote side. Signed-off-by: Mikel Astiz <mikel.astiz@bmw-carit.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Add more HCI error codesMikel Astiz2012-08-211-0/+3
| | | | | | | | | | | | | | | | Add more HCI error codes as defined in the specification. Signed-off-by: Mikel Astiz <mikel.astiz@bmw-carit.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
| * Bluetooth: Remove some functions from being exportedVinicius Costa Gomes2012-08-151-2/+0
| | | | | | | | | | | | | | | | Some connection related functions are only used inside hci_conn.c so no need to have them exported. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Merge branch 'master' of ↵John W. Linville2012-09-071-1/+1
|\ \ | |/ |/| | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * Bluetooth: Change signature of smp_conn_security()Vinicius Costa Gomes2012-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | To make it clear that it may be called from contexts that may not have any knowledge of L2CAP, we change the connection parameter, to receive a hci_conn. This also makes it clear that it is checking the security of the link. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Fix hci_le_conn_complete_evtAndre Guedes2012-08-061-0/+2
| | | | | | | | | | | | | | | | | | We need to check the 'Role' parameter from the LE Connection Complete Event in order to properly set 'out' and 'link_mode' fields from hci_conn structure. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: /proc/net/ entries for bluetooth protocolsMasatake YAMATO2012-08-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lsof command can tell the type of socket processes are using. Internal lsof uses inode numbers on socket fs to resolve the type of sockets. Files under /proc/net/, such as tcp, udp, unix, etc provides such inode information. Unfortunately bluetooth related protocols don't provide such inode information. This patch series introduces /proc/net files for the protocols. This patch against af_bluetooth.c provides facility to the implementation of protocols. This patch extends bt_sock_list and introduces two exported function bt_procfs_init, bt_procfs_cleanup. The type bt_sock_list is already used in some of implementation of protocols. bt_procfs_init prepare seq_operations which converts protocol own bt_sock_list data to protocol own proc entry when the entry is accessed. What I, lsof user, need is just inode number of bluetooth socket. However, people may want more information. The bt_procfs_init takes a function pointer for customizing the show handler of seq_operations. In v4 patch, __acquires and __releases attributes are added to suppress sparse warning. Suggested by Andrei Emeltchenko. In v5 patch, linux/proc_fs.h is included to use PDE. Build error is reported by Fengguang Wu. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Free the l2cap channel list only when refcount is zeroJaganath Kanakkassery2012-08-061-1/+0
| | | | | | | | | | | | | | | | | | | | Move the l2cap channel list chan->global_l under the refcnt protection and free it based on the refcnt. Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com> Reviewed-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Move l2cap_chan_hold/put to l2cap_core.cJaganath Kanakkassery2012-08-061-14/+2
| | | | | | | | | | | | | | | | | | | | Refactor the code in order to use the l2cap_chan_destroy() from l2cap_chan_put() under the refcnt protection. Signed-off-by: Jaganath Kanakkassery <jaganath.k@samsung.com> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com> Reviewed-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Make connect / disconnect cfm functions return voidAndrei Emeltchenko2012-08-061-4/+4
| | | | | | | | | | | | | | | | Return values are never used because callers hci_proto_connect_cfm and hci_proto_disconn_cfm return void. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Define AMP controller statusesAndrei Emeltchenko2012-08-061-0/+9
| | | | | | | | | | | | | | | | AMP status codes copied from Bluez patch sent by Peter Krystad <pkrystad@codeaurora.org>. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: trivial: Fix mixing spaces and tabs in smpAndrei Emeltchenko2012-08-061-4/+4
| | | | | | | | | | | | | | Change spaces to tabs in smp code Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: debug: Fix printing refcnt for hci_connAndrei Emeltchenko2012-08-061-4/+2
| | | | | | | | | | | | | | | | Use the same style for refcnt printing through all Bluetooth code taking the reference the l2cap_chan refcnt printing. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: mgmt: Managing only BR/EDR HCI controllersAndrei Emeltchenko2012-08-061-1/+1
| | | | | | | | | | | | | | | | | | Add check that HCI controller is BR/EDR. AMP controller shall not be managed by mgmt interface and consequently user space. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Remove missing codeAndre Guedes2012-08-061-6/+0
|/ | | | | | | | | This patch removes the struct adv_entry since it is not used anymore. This struct should have been removed in commit 479453d (Bluetooth: Remove advertising cache). Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: Use tx window from config response for ack timingMat Martineau2012-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This change addresses an L2CAP ERTM throughput problem when a remote device does not fully utilize the available transmit window. The L2CAP ERTM transmit window size determines the maximum number of unacked frames that may be outstanding at any time. It is configured separately for each direction of an ERTM connection. Each side sends a configuration request with a tx_win field indicating how many unacked frames it is capable of receiving before sending an ack. The configuration response's tx_win field shows how many frames the transmitter will actually send before waiting for an ack. It's important to trace both the actual transmit window (to check for validity of incoming frames) and the number of frames that the transmitter will send before waiting (to send acks at the appropriate time). Now there are separate tx_win and ack_win values. ack_win is updated based on configuration responses, and is used to determine when acks are sent. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: debug: Print l2cap_chan refcountAndrei Emeltchenko2012-07-111-0/+4
| | | | | | | Improve debug output. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: Improve debugging messages for hci_connAndrei Emeltchenko2012-06-301-0/+6
| | | | | | | | | Improve debugging of hci_conn objects by: adding print to hci_conn refcounting, adding object spcifier when missing, change conn to hcon since conn is heavily used for l2cap_conn objects and this is misleading. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: Use AUTO_OFF constant in jiffiesAndrei Emeltchenko2012-06-191-1/+2
| | | | | | | | Move AUTO_OFF_TIMEOUT to other constants changing name to HCI_AUTO_OFF_TIMEOUT and convert to jiffies. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: Fix flags of mgmt_device_found eventJefferson Delfes2012-06-121-1/+1
| | | | | | | | Change flags field to matches userspace structure. This field needs to be converted to little endian before forward it. Signed-off-by: Jefferson Delfes <jefferson.delfes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Bluetooth: Update HCI timeouts constants to use msecs_to_jiffiesAndrei Emeltchenko2012-06-122-6/+6
| | | | | | | | | | | | | The HCI constants are always used in form of jiffies. So just include the conversion from msecs in the define itself. This has the advantage of making the code where the timeout is used more readable and avoiding unnecessary conversions. The patch is similar to commit ba13ccd9 doing the same job for L2CAP Reported-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* Merge branch 'for-upstream' of ↵Gustavo Padovan2012-06-111-0/+6
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Conflicts: net/bluetooth/hci_event.c
| * Bluetooth: Add support for encryption key refreshJohan Hedberg2012-06-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | With LE/SMP the completion of a security level elavation from medium to high is indicated by a HCI Encryption Key Refresh Complete event. The necessary behavior upon receiving this event is a mix of what's done for auth_complete and encryption_change, which is also where most of the event handling code has been copied from. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Create empty l2cap ops functionGustavo Padovan2012-06-051-0/+12
| | | | | | | | | | | | | | | | A2MP doesn't use part of the L2CAP chan ops API so we just create general empty function instead of the A2MP specific one. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* | Bluetooth: Rename L2CAP_LE_DEFAULT_MTUAndre Guedes2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | This patch renames L2CAP_LE_DEFAULT_MTU macro to L2CAP_LE_MIN_MTU since it represents the minimum MTU value, not the default MTU value for LE. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Remove unused HCI timeouts definitionsSzymon Janc2012-06-051-2/+0
| | | | | | | | | | | | | | | | Those are not used anywhere in code (and never were since introduction in 2006) so just remove them. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Manage incoming connectionsAndrei Emeltchenko2012-06-051-0/+4
| | | | | | | | | | | | | | | | Handle incoming A2MP connection by creating AMP manager and processing A2MP messages. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Handling fixed channelsAndrei Emeltchenko2012-06-051-0/+1
| | | | | | | | | | | | | | A2MP fixed channel do not have sk Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Process A2MP Discover RequestAndrei Emeltchenko2012-06-053-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds helper functions to count HCI devs and process A2MP Discover Request, code makes sure that first controller in the list is BREDR one. Trace is shown below: ... > ACL data: handle 11 flags 0x02 dlen 16 A2MP: Discover req: mtu/mps 670 mask: 0x0000 < ACL data: handle 11 flags 0x00 dlen 22 A2MP: Discover rsp: mtu/mps 670 mask: 0x0000 Controller list: id 0 type 0 (BR-EDR) status 0x01 (Bluetooth only) id 1 type 1 (802.11 AMP) status 0x01 (Bluetooth only) ... Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Define A2MP status codesAndrei Emeltchenko2012-06-051-0/+10
| | | | | | | | | | | | | | | | A2MP status codes copied from Bluez patch sent by Peter Krystad <pkrystad@codeaurora.org>. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Definitions for A2MP commandsAndrei Emeltchenko2012-06-051-0/+73
| | | | | | | | | | | | | | Define A2MP command IDs and packet structures. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Build and Send msg helpersAndrei Emeltchenko2012-06-051-0/+7
| | | | | | | | | | | | | | Helper function to build and send A2MP messages. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: AMP Manager basic functionsAndrei Emeltchenko2012-06-052-0/+31
| | | | | | | | | | | | | | Define AMP Manager and some basic functions. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: A2MP: Create A2MP channelAndrei Emeltchenko2012-06-051-0/+6
| | | | | | | | | | | | | | Create and initialize fixed A2MP channel Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Add l2cap_chan->ops->ready()Andrei Emeltchenko2012-06-051-0/+1
| | | | | | | | | | | | | | | | This move socket specific code to l2cap_sock.c. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Move clean up code and set of SOCK_ZAPPED to l2cap_sock.cAndrei Emeltchenko2012-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | This remove a bit more of socket code from l2cap core, this calls set the SOCK_ZAPPED and do some clean up depending on the socket state. Reported-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Use chan as parameters for l2cap chan opsGustavo Padovan2012-06-051-4/+6
| | | | | | | | | | | | | | Use chan instead of void * makes more sense here. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Define HCI AMP cmd structAndrei Emeltchenko2012-06-051-0/+81
| | | | | | | | | | | | | | | | Add HCI commands to deal with Bluetooth AMP controllers. Those commands will be used by bluetooth and softamp code. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Define and use PSM identifiersAndrei Emeltchenko2012-06-051-0/+4
| | | | | | | | | | | | | | | | Define assigned Protocol and Service Multiplexor (PSM) identifiers and use them instead of magic numbers. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
* | Bluetooth: Define L2CAP conf continuation flagAndrei Emeltchenko2012-06-051-0/+3
| | | | | | | | | | | | | | | | Define Continuation flag which the only flag used from Flags field in L2CAP Configuration Request and Response. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Remove unnecessary headers includeGustavo Padovan2012-06-053-5/+0
| | | | | | | | | | | | | | | | | | Most of the include were unnecessary or already included by some other header. Replace module.h by export.h where possible. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Fix coding style in include/net/bluetoothGustavo Padovan2012-06-053-19/+23
| | | | | | | | | | | | | | | | Fix all warning and errors reported by checkpatch but license trailing whitespace and bdaddr_t definition. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Use defined link key sizeAndrei Emeltchenko2012-06-052-3/+5
| | | | | | | | | | | | | | Remove magic number with defined link key size. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* | Bluetooth: Rename HCI_QUIRK_NO_RESET to HCI_QUIRK_RESET_ON_CLOSESzymon Janc2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | HCI_QUIRK_NO_RESET name is misleading - purpose of this quirk is to reset device on close instead of init, not to not reset at all. Rename it to HCI_QUIRK_RESET_ON_CLOSE to avoid confusion. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
OpenPOWER on IntegriCloud