summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: Fix mgmt handling of power on failuresJohan Hedberg2013-06-121-0/+1
| | | | | | | | | | | | | | | If hci_dev_open fails we need to ensure that the corresponding mgmt_set_powered command gets an appropriate response. This patch fixes the missing response by adding a new mgmt_set_powered_failed function that's used to indicate a power on failure to mgmt. Since a situation with the device being rfkilled may require special handling in user space the patch uses a new dedicated mgmt status code for this. 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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Bluetooth: mgmt: Implement support for passkey notificationJohan Hedberg2012-09-181-0/+7
| | | | | | | | | | | | | 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: mgmt: Add device disconnect reasonMikel Astiz2012-08-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | 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: 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: Add management command for setting Device IDMarcel Holtmann2012-05-091-0/+9
| | | | | | | | The Device ID details need to be programmed into the kernel for every controller at least once. So provide management command for this. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* Bluetooth: mgmt: Fix timeout typeAndrei Emeltchenko2012-03-281-1/+1
| | | | | | | | | Silence sparse warnings: net/bluetooth/mgmt.c:865:19: warning: cast to restricted __le16 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
* Bluetooth: Use correct type for userspace exported structsGustavo F. Padovan2012-03-071-3/+3
| | | | | | It should be __u8 instead of u8. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix coding style in mgmt.hGustavo F. Padovan2012-03-071-79/+78
| | | | | | Align struct definition in a proper way. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: mgmt: Add new error code for invalid indexJohan Hedberg2012-03-021-0/+1
| | | | | | | | The index is part of the command header and not its parameters so it makes sense to distinguish this from the invalid parameters error. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add defines for command sizesJohan Hedberg2012-03-011-0/+34
| | | | | | | | | These defines are shorter than "sizeof(struct mgmt_cp_foo_bar...)" and will be helpful when extending the command lookup table to contain the expected command size information. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add flags parameter to device_connectedJohan Hedberg2012-02-231-0/+1
| | | | | | | | This patch updates the Device Connected events to match the latest API by adding a flags parameter to them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Fix device_found parametersJohan Hedberg2012-02-231-1/+4
| | | | | | | | According to the latest mgmt API there's a flags field instead of a separate confirm_name paramter. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add hdev->short_name for EIR generationJohan Hedberg2012-02-231-1/+1
| | | | | | | | | | It's possible to provide a short name through the mgmt interface and this name can be used for EIR generation when the full name doesn't fit there. This patch adds the preliminary tracking of the provided short name. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix parameter list for setting local nameMarcel Holtmann2012-02-211-0/+1
| | | | | | | | The parameter list for setting the local name via management interface was missing the short name parameter. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* Bluetooth: mgmt: Add address type parameter to Discovering eventJohan Hedberg2012-02-211-0/+4
| | | | | | | | This patch adds an address type parameter to the Discovering event. The value matches that given to Start/Stop Discovery. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add address type parameter to Stop Discovery commandJohan Hedberg2012-02-211-0/+3
| | | | | | | | This patch adds an address type parameter to the Stop Discovery command which should match the value given to Start Discovery. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Move status parameters into the cmd_complete headerJohan Hedberg2012-02-191-7/+1
| | | | | | | | | | | Instead of having status paramters part of each individual command response it's simpler to just have the status as part of the command complete header. This patch updates the code to follow this convention and thereby also ensures compliance with the latest mgmt API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Change ordering of cmd_status paramtersJohan Hedberg2012-02-191-1/+1
| | | | | | | | In accordance to the latest mgmt API specification the opcode comes first and then the status. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Prepare start_discoveryAndre Guedes2012-02-191-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does some code refactoring in start_discovery function in order to prepare it for interleaved discovery support. MGMT_ADDR_* macros were moved to hci_core.h since they are now used to define discovery type macros. Discovery type macros were defined according to mgmt-api.txt specification: Possible values for the Type parameter are a bit-wise or of the following bits: 1 BR/EDR 2 LE Public 3 LE Random By combining these e.g. the following values are possible: 1 BR/EDR 6 LE (public & random) 7 BR/EDR/LE (interleaved discovery) Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* Bluetooth: Add Intel copyright to mgmt filesJohan Hedberg2012-02-171-0/+1
| | | | | | | This patch adds the appropriate Intel copyright to mgmt files. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add address type to confirm name commandJohan Hedberg2012-02-171-2/+2
| | | | | | | | The latest mgmt API includes an address type for all messages containing an address. This patch updates the confirm name command to match this. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add address type to PIN code messagesJohan Hedberg2012-02-171-4/+4
| | | | | | | | The latest mgmt API includes address types for all messages containing an address. This patch updates the PIN code messages to match this. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Add address type to link key messagesJohan Hedberg2012-02-171-1/+1
| | | | | | | | The latest mgmt API includes an address type wherever there's an address present. This patch updates the link key messages to match it. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Implement Read Supported Commands commands for mgmtJohan Hedberg2012-02-151-0/+7
| | | | | | | | | This patch implements the Read Supported Commands mgmt command which was recently added to the API specification. It returns a list of supported commands and events to user space. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add Device Unpaired mgmt eventJohan Hedberg2012-02-131-0/+5
| | | | | | | | | | | This patch add a new Device Unpaired mgmt event. This will be sent to all mgmt sockets except the one that requested unpairing (that socket will get a command complete instead). The event is also reserved for future SMP updates where a remote device will be able to request pairing revocation from us. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add address type to mgmt_ev_auth_failedJohan Hedberg2012-02-131-1/+1
| | | | | | | | This patch updates the Authentication Failed mgmt event to match the latest API specification by adding an address type to it. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add address type to mgmt blacklist messagesJohan Hedberg2012-02-131-4/+4
| | | | | | | | | This patch updates the implmentation for mgmt_block_device and mgmt_unblock_device and their corresponding events to match the latest API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add address type to Out Of Band mgmt messagesJohan Hedberg2012-02-131-2/+2
| | | | | | | | | This patch updates the implementation for these mgmt to be up to date with the latest API specification. Right now the address type isn't actually used for anything but that might change in the future. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add address type to user_confirm and user_passkey messagesJohan Hedberg2012-02-131-8/+8
| | | | | | | | | This patch upadate the user confirm and user passkey mgmt messages to match the latest API specification by adding an address type parameter to them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Update mgmt_disconnect to match latest APIJohan Hedberg2012-02-131-2/+2
| | | | | | | | This patch adds an address type parameter to the disconnect command and response in order to match the latest mgmt API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Update and rename mgmt_remove_keys to mgmt_unpair_deviceJohan Hedberg2012-02-131-17/+17
| | | | | | | | | This patch renames the mgmt_remove_keys command to mgmt_unpair_device and updates its parameters to match the latest API (specifically, it adds an address type parameter to the command and its response). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: mgmt: Implement Cancel Pair Device commandJohan Hedberg2012-02-131-0/+1
| | | | | | | | | This patch implements the Cancel Pair Device command for mgmt. It's used by user space to cancel an ongoing pairing attempt which was triggered by the Pair Device command. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Update mgmt.h to match latest API specJohan Hedberg2012-02-131-62/+64
| | | | | | | | This patch updates the opcodes for mgmt commands and events to match the latest user space API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add structures for the new LTK exchange messagesVinicius Costa Gomes2012-02-131-0/+22
| | | | | | | | | | | | | | | | This defines two new messages, one event that will inform userspace that a new Long Term Key was exchanged and one that will allow userspace to load LTKs into the kernel. Besides the information necessary for the restablishement of the secure link, we added some extra information: "authenticated" that informs if the key can be used to establish an authenticated link, and "master" that informs the role in that the key should be used. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
* Bluetooth: Update device_connected and device_found events to latest APIJohan Hedberg2012-02-131-9/+8
| | | | | | | | | | | | This patch updates mgmt_ev_device_connected and mgmt_ev_device found to include an EIR-encoded remote name and class whenever possible. With this addition the mgmt_ev_remote_name event becomes unnecessary and can be removed. Since the connected event doesn't map to hci_conn_complete anymore a HCI_CONN_MGMT_CONNECTED flag is added to track when mgmt has been notified about a connection. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Merge device class into the EIR data in mgmt_ev_device_foundJohan Hedberg2012-02-131-1/+0
| | | | | | | | There's no need to have a separate device class field since the same information can be encoded into the EIR data. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add eir_len parameter to mgmt_ev_device_foundJohan Hedberg2012-02-131-1/+2
| | | | | | | | | | This patch add a two byte eir_len parameter mgmt_ev_device_found. Since it's unlikely that the data will in the short term be much bigger than conventional EIR lengths just use a small stack based buffer for now to avoid dynamic memory allocation & freeing. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Rename mgmt connected events to match user spaceJohan Hedberg2012-02-131-2/+2
| | | | | | | | User space uses device_(dis)connected instead of just (dis)connected so rename the defines and functions to match this. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add missing mgmt_confirm_name command definitionJohan Hedberg2011-12-191-0/+10
| | | | | | | | | | This patch adds the necessary structs for the Confirm Name command. This ensures that the protocol definitions are up to date with the latest mgmt specification. The actual implementation of the command will follow in a later patch-set. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Fix mgmt_(block,unblock)_device opcodesJohan Hedberg2011-12-191-2/+2
| | | | | | | | | | This patch fixes the opcodes of the Block/Unblock device commands to match with what user-space expects and to confirm with the latest mgmt specification. The reason the values were wrong was a missing Confirm Name command definition (which will be added by a subsequent patch). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add missing confirm_name field to mgmt_ev_device_foundJohan Hedberg2011-12-191-0/+1
| | | | | | | | | | | This patch adds a missing confirm_name field to mgmt_ev_device_found. Support for setting the correct value for this field is not implemented yet, but having it part of the struct definition ensures that user-space gets correct sized device_found events and is thereby able to do at least rudimentary parsing of them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Update ordering and opcodes of mgmt messagesJohan Hedberg2011-12-181-66/+81
| | | | | | | | | This patch updates the ordering and opcodes of mgmt messages to match the latest API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Remove mgmt_set_service_cacheJohan Hedberg2011-12-181-5/+0
| | | | | | | | | | | Instead of having an explicit service cache command we can make the mgmt API simpler by implicitly enabling the cache when mgmt_read_info is called for the first time and disabling it when mgmt_set_dev_class is called. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Move mgmt_set_fast_connectable to the right locationJohan Hedberg2011-12-181-5/+2
| | | | | | | | | | Fast connectable is logically after the connectable property so that's where it should show up in the code as well (it's also after connectable in the settings bitfield). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Update mgmt_read_info and related mgmt messagesJohan Hedberg2011-12-181-11/+18
| | | | | | | | | | This patch updates the mgmt_read_info and related messages to the latest management API which uses a bitfield of settings instead of individual boolean values. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add MGMT event for Passkey EntryBrian Gix2011-11-211-0/+5
| | | | | Signed-off-by: Brian Gix <bgix@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add MGMT opcodes for Passkey EntryBrian Gix2011-11-161-0/+11
| | | | | | Signed-off-by: Brian Gix <bgix@codeaurora.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Pass all message parameters to mgmt_start_discoveryJohan Hedberg2011-11-161-0/+3
| | | | | | | | | | | The mgmt_start_discovery command contains the type of discovery that should be started so this should be passed to the start_discovery function. This patch doesn't yet add any action depending on the type of the requested discovery. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Create a unique mgmt error code hierarchyJohan Hedberg2011-11-161-0/+17
| | | | | | | | | | | | | The management protocol uses a single byte for error codes (aka command status). In some places this value is directly copied from HCI and in other a POSIX error number is used. This makes it impossible for user-space to uniquily decipher the meaning of an error. To solve this issue a new mgmt-specific set of error codes is added along with a conversion table for HCI status values. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
* Bluetooth: Add address type to mgmt_pair_deviceJohan Hedberg2011-11-161-2/+2
| | | | | | | | | | | | The kernel needs to know whether it should connect to a device over BR/EDR or over LE. This is particularly important in the future when dual-mode device may be connectable also over LE. It is also important if/when we decide to move the LE advertisement cache from the kernel into user-space. Adding the type to the mgmt command also ensures conformance with the latest mgmt API spec. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
OpenPOWER on IntegriCloud