18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci   BlueZ - Bluetooth protocol stack for Linux
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci   Copyright (C) 2010  Nokia Corporation
58c2ecf20Sopenharmony_ci   Copyright (C) 2011-2012  Intel Corporation
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci   This program is free software; you can redistribute it and/or modify
88c2ecf20Sopenharmony_ci   it under the terms of the GNU General Public License version 2 as
98c2ecf20Sopenharmony_ci   published by the Free Software Foundation;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
128c2ecf20Sopenharmony_ci   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
138c2ecf20Sopenharmony_ci   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
148c2ecf20Sopenharmony_ci   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
158c2ecf20Sopenharmony_ci   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
168c2ecf20Sopenharmony_ci   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
178c2ecf20Sopenharmony_ci   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
188c2ecf20Sopenharmony_ci   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
218c2ecf20Sopenharmony_ci   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
228c2ecf20Sopenharmony_ci   SOFTWARE IS DISCLAIMED.
238c2ecf20Sopenharmony_ci*/
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define MGMT_INDEX_NONE			0xFFFF
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define MGMT_STATUS_SUCCESS		0x00
288c2ecf20Sopenharmony_ci#define MGMT_STATUS_UNKNOWN_COMMAND	0x01
298c2ecf20Sopenharmony_ci#define MGMT_STATUS_NOT_CONNECTED	0x02
308c2ecf20Sopenharmony_ci#define MGMT_STATUS_FAILED		0x03
318c2ecf20Sopenharmony_ci#define MGMT_STATUS_CONNECT_FAILED	0x04
328c2ecf20Sopenharmony_ci#define MGMT_STATUS_AUTH_FAILED		0x05
338c2ecf20Sopenharmony_ci#define MGMT_STATUS_NOT_PAIRED		0x06
348c2ecf20Sopenharmony_ci#define MGMT_STATUS_NO_RESOURCES	0x07
358c2ecf20Sopenharmony_ci#define MGMT_STATUS_TIMEOUT		0x08
368c2ecf20Sopenharmony_ci#define MGMT_STATUS_ALREADY_CONNECTED	0x09
378c2ecf20Sopenharmony_ci#define MGMT_STATUS_BUSY		0x0a
388c2ecf20Sopenharmony_ci#define MGMT_STATUS_REJECTED		0x0b
398c2ecf20Sopenharmony_ci#define MGMT_STATUS_NOT_SUPPORTED	0x0c
408c2ecf20Sopenharmony_ci#define MGMT_STATUS_INVALID_PARAMS	0x0d
418c2ecf20Sopenharmony_ci#define MGMT_STATUS_DISCONNECTED	0x0e
428c2ecf20Sopenharmony_ci#define MGMT_STATUS_NOT_POWERED		0x0f
438c2ecf20Sopenharmony_ci#define MGMT_STATUS_CANCELLED		0x10
448c2ecf20Sopenharmony_ci#define MGMT_STATUS_INVALID_INDEX	0x11
458c2ecf20Sopenharmony_ci#define MGMT_STATUS_RFKILLED		0x12
468c2ecf20Sopenharmony_ci#define MGMT_STATUS_ALREADY_PAIRED	0x13
478c2ecf20Sopenharmony_ci#define MGMT_STATUS_PERMISSION_DENIED	0x14
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_cistruct mgmt_hdr {
508c2ecf20Sopenharmony_ci	__le16	opcode;
518c2ecf20Sopenharmony_ci	__le16	index;
528c2ecf20Sopenharmony_ci	__le16	len;
538c2ecf20Sopenharmony_ci} __packed;
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_cistruct mgmt_tlv {
568c2ecf20Sopenharmony_ci	__le16 type;
578c2ecf20Sopenharmony_ci	__u8   length;
588c2ecf20Sopenharmony_ci	__u8   value[];
598c2ecf20Sopenharmony_ci} __packed;
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_cistruct mgmt_addr_info {
628c2ecf20Sopenharmony_ci	bdaddr_t	bdaddr;
638c2ecf20Sopenharmony_ci	__u8		type;
648c2ecf20Sopenharmony_ci} __packed;
658c2ecf20Sopenharmony_ci#define MGMT_ADDR_INFO_SIZE		7
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define MGMT_OP_READ_VERSION		0x0001
688c2ecf20Sopenharmony_ci#define MGMT_READ_VERSION_SIZE		0
698c2ecf20Sopenharmony_cistruct mgmt_rp_read_version {
708c2ecf20Sopenharmony_ci	__u8	version;
718c2ecf20Sopenharmony_ci	__le16	revision;
728c2ecf20Sopenharmony_ci} __packed;
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define MGMT_OP_READ_COMMANDS		0x0002
758c2ecf20Sopenharmony_ci#define MGMT_READ_COMMANDS_SIZE		0
768c2ecf20Sopenharmony_cistruct mgmt_rp_read_commands {
778c2ecf20Sopenharmony_ci	__le16	num_commands;
788c2ecf20Sopenharmony_ci	__le16	num_events;
798c2ecf20Sopenharmony_ci	__le16	opcodes[];
808c2ecf20Sopenharmony_ci} __packed;
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci#define MGMT_OP_READ_INDEX_LIST		0x0003
838c2ecf20Sopenharmony_ci#define MGMT_READ_INDEX_LIST_SIZE	0
848c2ecf20Sopenharmony_cistruct mgmt_rp_read_index_list {
858c2ecf20Sopenharmony_ci	__le16	num_controllers;
868c2ecf20Sopenharmony_ci	__le16	index[];
878c2ecf20Sopenharmony_ci} __packed;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/* Reserve one extra byte for names in management messages so that they
908c2ecf20Sopenharmony_ci * are always guaranteed to be nul-terminated */
918c2ecf20Sopenharmony_ci#define MGMT_MAX_NAME_LENGTH		(HCI_MAX_NAME_LENGTH + 1)
928c2ecf20Sopenharmony_ci#define MGMT_MAX_SHORT_NAME_LENGTH	(HCI_MAX_SHORT_NAME_LENGTH + 1)
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define MGMT_SETTING_POWERED		0x00000001
958c2ecf20Sopenharmony_ci#define MGMT_SETTING_CONNECTABLE	0x00000002
968c2ecf20Sopenharmony_ci#define MGMT_SETTING_FAST_CONNECTABLE	0x00000004
978c2ecf20Sopenharmony_ci#define MGMT_SETTING_DISCOVERABLE	0x00000008
988c2ecf20Sopenharmony_ci#define MGMT_SETTING_BONDABLE		0x00000010
998c2ecf20Sopenharmony_ci#define MGMT_SETTING_LINK_SECURITY	0x00000020
1008c2ecf20Sopenharmony_ci#define MGMT_SETTING_SSP		0x00000040
1018c2ecf20Sopenharmony_ci#define MGMT_SETTING_BREDR		0x00000080
1028c2ecf20Sopenharmony_ci#define MGMT_SETTING_HS			0x00000100
1038c2ecf20Sopenharmony_ci#define MGMT_SETTING_LE			0x00000200
1048c2ecf20Sopenharmony_ci#define MGMT_SETTING_ADVERTISING	0x00000400
1058c2ecf20Sopenharmony_ci#define MGMT_SETTING_SECURE_CONN	0x00000800
1068c2ecf20Sopenharmony_ci#define MGMT_SETTING_DEBUG_KEYS		0x00001000
1078c2ecf20Sopenharmony_ci#define MGMT_SETTING_PRIVACY		0x00002000
1088c2ecf20Sopenharmony_ci#define MGMT_SETTING_CONFIGURATION	0x00004000
1098c2ecf20Sopenharmony_ci#define MGMT_SETTING_STATIC_ADDRESS	0x00008000
1108c2ecf20Sopenharmony_ci#define MGMT_SETTING_PHY_CONFIGURATION	0x00010000
1118c2ecf20Sopenharmony_ci#define MGMT_SETTING_WIDEBAND_SPEECH	0x00020000
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define MGMT_OP_READ_INFO		0x0004
1148c2ecf20Sopenharmony_ci#define MGMT_READ_INFO_SIZE		0
1158c2ecf20Sopenharmony_cistruct mgmt_rp_read_info {
1168c2ecf20Sopenharmony_ci	bdaddr_t	bdaddr;
1178c2ecf20Sopenharmony_ci	__u8		version;
1188c2ecf20Sopenharmony_ci	__le16		manufacturer;
1198c2ecf20Sopenharmony_ci	__le32		supported_settings;
1208c2ecf20Sopenharmony_ci	__le32		current_settings;
1218c2ecf20Sopenharmony_ci	__u8		dev_class[3];
1228c2ecf20Sopenharmony_ci	__u8		name[MGMT_MAX_NAME_LENGTH];
1238c2ecf20Sopenharmony_ci	__u8		short_name[MGMT_MAX_SHORT_NAME_LENGTH];
1248c2ecf20Sopenharmony_ci} __packed;
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_cistruct mgmt_mode {
1278c2ecf20Sopenharmony_ci	__u8 val;
1288c2ecf20Sopenharmony_ci} __packed;
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci#define MGMT_SETTING_SIZE		1
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define MGMT_OP_SET_POWERED		0x0005
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DISCOVERABLE	0x0006
1358c2ecf20Sopenharmony_cistruct mgmt_cp_set_discoverable {
1368c2ecf20Sopenharmony_ci	__u8	val;
1378c2ecf20Sopenharmony_ci	__le16	timeout;
1388c2ecf20Sopenharmony_ci} __packed;
1398c2ecf20Sopenharmony_ci#define MGMT_SET_DISCOVERABLE_SIZE	3
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci#define MGMT_OP_SET_CONNECTABLE		0x0007
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#define MGMT_OP_SET_FAST_CONNECTABLE	0x0008
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci#define MGMT_OP_SET_BONDABLE		0x0009
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci#define MGMT_OP_SET_LINK_SECURITY	0x000A
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define MGMT_OP_SET_SSP			0x000B
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define MGMT_OP_SET_HS			0x000C
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci#define MGMT_OP_SET_LE			0x000D
1548c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEV_CLASS		0x000E
1558c2ecf20Sopenharmony_cistruct mgmt_cp_set_dev_class {
1568c2ecf20Sopenharmony_ci	__u8	major;
1578c2ecf20Sopenharmony_ci	__u8	minor;
1588c2ecf20Sopenharmony_ci} __packed;
1598c2ecf20Sopenharmony_ci#define MGMT_SET_DEV_CLASS_SIZE		2
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci#define MGMT_OP_SET_LOCAL_NAME		0x000F
1628c2ecf20Sopenharmony_cistruct mgmt_cp_set_local_name {
1638c2ecf20Sopenharmony_ci	__u8	name[MGMT_MAX_NAME_LENGTH];
1648c2ecf20Sopenharmony_ci	__u8	short_name[MGMT_MAX_SHORT_NAME_LENGTH];
1658c2ecf20Sopenharmony_ci} __packed;
1668c2ecf20Sopenharmony_ci#define MGMT_SET_LOCAL_NAME_SIZE	260
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define MGMT_OP_ADD_UUID		0x0010
1698c2ecf20Sopenharmony_cistruct mgmt_cp_add_uuid {
1708c2ecf20Sopenharmony_ci	__u8	uuid[16];
1718c2ecf20Sopenharmony_ci	__u8	svc_hint;
1728c2ecf20Sopenharmony_ci} __packed;
1738c2ecf20Sopenharmony_ci#define MGMT_ADD_UUID_SIZE		17
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define MGMT_OP_REMOVE_UUID		0x0011
1768c2ecf20Sopenharmony_cistruct mgmt_cp_remove_uuid {
1778c2ecf20Sopenharmony_ci	__u8	uuid[16];
1788c2ecf20Sopenharmony_ci} __packed;
1798c2ecf20Sopenharmony_ci#define MGMT_REMOVE_UUID_SIZE		16
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_cistruct mgmt_link_key_info {
1828c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
1838c2ecf20Sopenharmony_ci	__u8	type;
1848c2ecf20Sopenharmony_ci	__u8	val[16];
1858c2ecf20Sopenharmony_ci	__u8	pin_len;
1868c2ecf20Sopenharmony_ci} __packed;
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci#define MGMT_OP_LOAD_LINK_KEYS		0x0012
1898c2ecf20Sopenharmony_cistruct mgmt_cp_load_link_keys {
1908c2ecf20Sopenharmony_ci	__u8	debug_keys;
1918c2ecf20Sopenharmony_ci	__le16	key_count;
1928c2ecf20Sopenharmony_ci	struct	mgmt_link_key_info keys[];
1938c2ecf20Sopenharmony_ci} __packed;
1948c2ecf20Sopenharmony_ci#define MGMT_LOAD_LINK_KEYS_SIZE	3
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci#define MGMT_LTK_UNAUTHENTICATED	0x00
1978c2ecf20Sopenharmony_ci#define MGMT_LTK_AUTHENTICATED		0x01
1988c2ecf20Sopenharmony_ci#define MGMT_LTK_P256_UNAUTH		0x02
1998c2ecf20Sopenharmony_ci#define MGMT_LTK_P256_AUTH		0x03
2008c2ecf20Sopenharmony_ci#define MGMT_LTK_P256_DEBUG		0x04
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_cistruct mgmt_ltk_info {
2038c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2048c2ecf20Sopenharmony_ci	__u8	type;
2058c2ecf20Sopenharmony_ci	__u8	initiator;
2068c2ecf20Sopenharmony_ci	__u8	enc_size;
2078c2ecf20Sopenharmony_ci	__le16	ediv;
2088c2ecf20Sopenharmony_ci	__le64	rand;
2098c2ecf20Sopenharmony_ci	__u8	val[16];
2108c2ecf20Sopenharmony_ci} __packed;
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci#define MGMT_OP_LOAD_LONG_TERM_KEYS	0x0013
2138c2ecf20Sopenharmony_cistruct mgmt_cp_load_long_term_keys {
2148c2ecf20Sopenharmony_ci	__le16	key_count;
2158c2ecf20Sopenharmony_ci	struct	mgmt_ltk_info keys[];
2168c2ecf20Sopenharmony_ci} __packed;
2178c2ecf20Sopenharmony_ci#define MGMT_LOAD_LONG_TERM_KEYS_SIZE	2
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define MGMT_OP_DISCONNECT		0x0014
2208c2ecf20Sopenharmony_cistruct mgmt_cp_disconnect {
2218c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2228c2ecf20Sopenharmony_ci} __packed;
2238c2ecf20Sopenharmony_ci#define MGMT_DISCONNECT_SIZE		MGMT_ADDR_INFO_SIZE
2248c2ecf20Sopenharmony_cistruct mgmt_rp_disconnect {
2258c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2268c2ecf20Sopenharmony_ci} __packed;
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci#define MGMT_OP_GET_CONNECTIONS		0x0015
2298c2ecf20Sopenharmony_ci#define MGMT_GET_CONNECTIONS_SIZE	0
2308c2ecf20Sopenharmony_cistruct mgmt_rp_get_connections {
2318c2ecf20Sopenharmony_ci	__le16 conn_count;
2328c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr[];
2338c2ecf20Sopenharmony_ci} __packed;
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci#define MGMT_OP_PIN_CODE_REPLY		0x0016
2368c2ecf20Sopenharmony_cistruct mgmt_cp_pin_code_reply {
2378c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2388c2ecf20Sopenharmony_ci	__u8	pin_len;
2398c2ecf20Sopenharmony_ci	__u8	pin_code[16];
2408c2ecf20Sopenharmony_ci} __packed;
2418c2ecf20Sopenharmony_ci#define MGMT_PIN_CODE_REPLY_SIZE	(MGMT_ADDR_INFO_SIZE + 17)
2428c2ecf20Sopenharmony_cistruct mgmt_rp_pin_code_reply {
2438c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2448c2ecf20Sopenharmony_ci} __packed;
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci#define MGMT_OP_PIN_CODE_NEG_REPLY	0x0017
2478c2ecf20Sopenharmony_cistruct mgmt_cp_pin_code_neg_reply {
2488c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2498c2ecf20Sopenharmony_ci} __packed;
2508c2ecf20Sopenharmony_ci#define MGMT_PIN_CODE_NEG_REPLY_SIZE	MGMT_ADDR_INFO_SIZE
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci#define MGMT_OP_SET_IO_CAPABILITY	0x0018
2538c2ecf20Sopenharmony_cistruct mgmt_cp_set_io_capability {
2548c2ecf20Sopenharmony_ci	__u8	io_capability;
2558c2ecf20Sopenharmony_ci} __packed;
2568c2ecf20Sopenharmony_ci#define MGMT_SET_IO_CAPABILITY_SIZE	1
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci#define MGMT_OP_PAIR_DEVICE		0x0019
2598c2ecf20Sopenharmony_cistruct mgmt_cp_pair_device {
2608c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2618c2ecf20Sopenharmony_ci	__u8	io_cap;
2628c2ecf20Sopenharmony_ci} __packed;
2638c2ecf20Sopenharmony_ci#define MGMT_PAIR_DEVICE_SIZE		(MGMT_ADDR_INFO_SIZE + 1)
2648c2ecf20Sopenharmony_cistruct mgmt_rp_pair_device {
2658c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2668c2ecf20Sopenharmony_ci} __packed;
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci#define MGMT_OP_CANCEL_PAIR_DEVICE	0x001A
2698c2ecf20Sopenharmony_ci#define MGMT_CANCEL_PAIR_DEVICE_SIZE	MGMT_ADDR_INFO_SIZE
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci#define MGMT_OP_UNPAIR_DEVICE		0x001B
2728c2ecf20Sopenharmony_cistruct mgmt_cp_unpair_device {
2738c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2748c2ecf20Sopenharmony_ci	__u8 disconnect;
2758c2ecf20Sopenharmony_ci} __packed;
2768c2ecf20Sopenharmony_ci#define MGMT_UNPAIR_DEVICE_SIZE		(MGMT_ADDR_INFO_SIZE + 1)
2778c2ecf20Sopenharmony_cistruct mgmt_rp_unpair_device {
2788c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2798c2ecf20Sopenharmony_ci};
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci#define MGMT_OP_USER_CONFIRM_REPLY	0x001C
2828c2ecf20Sopenharmony_cistruct mgmt_cp_user_confirm_reply {
2838c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2848c2ecf20Sopenharmony_ci} __packed;
2858c2ecf20Sopenharmony_ci#define MGMT_USER_CONFIRM_REPLY_SIZE	MGMT_ADDR_INFO_SIZE
2868c2ecf20Sopenharmony_cistruct mgmt_rp_user_confirm_reply {
2878c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2888c2ecf20Sopenharmony_ci} __packed;
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci#define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x001D
2918c2ecf20Sopenharmony_cistruct mgmt_cp_user_confirm_neg_reply {
2928c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2938c2ecf20Sopenharmony_ci} __packed;
2948c2ecf20Sopenharmony_ci#define MGMT_USER_CONFIRM_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ci#define MGMT_OP_USER_PASSKEY_REPLY	0x001E
2978c2ecf20Sopenharmony_cistruct mgmt_cp_user_passkey_reply {
2988c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
2998c2ecf20Sopenharmony_ci	__le32	passkey;
3008c2ecf20Sopenharmony_ci} __packed;
3018c2ecf20Sopenharmony_ci#define MGMT_USER_PASSKEY_REPLY_SIZE	(MGMT_ADDR_INFO_SIZE + 4)
3028c2ecf20Sopenharmony_cistruct mgmt_rp_user_passkey_reply {
3038c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3048c2ecf20Sopenharmony_ci} __packed;
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define MGMT_OP_USER_PASSKEY_NEG_REPLY	0x001F
3078c2ecf20Sopenharmony_cistruct mgmt_cp_user_passkey_neg_reply {
3088c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3098c2ecf20Sopenharmony_ci} __packed;
3108c2ecf20Sopenharmony_ci#define MGMT_USER_PASSKEY_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci#define MGMT_OP_READ_LOCAL_OOB_DATA	0x0020
3138c2ecf20Sopenharmony_ci#define MGMT_READ_LOCAL_OOB_DATA_SIZE	0
3148c2ecf20Sopenharmony_cistruct mgmt_rp_read_local_oob_data {
3158c2ecf20Sopenharmony_ci	__u8	hash192[16];
3168c2ecf20Sopenharmony_ci	__u8	rand192[16];
3178c2ecf20Sopenharmony_ci	__u8	hash256[16];
3188c2ecf20Sopenharmony_ci	__u8	rand256[16];
3198c2ecf20Sopenharmony_ci} __packed;
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci#define MGMT_OP_ADD_REMOTE_OOB_DATA	0x0021
3228c2ecf20Sopenharmony_cistruct mgmt_cp_add_remote_oob_data {
3238c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3248c2ecf20Sopenharmony_ci	__u8	hash[16];
3258c2ecf20Sopenharmony_ci	__u8	rand[16];
3268c2ecf20Sopenharmony_ci} __packed;
3278c2ecf20Sopenharmony_ci#define MGMT_ADD_REMOTE_OOB_DATA_SIZE	(MGMT_ADDR_INFO_SIZE + 32)
3288c2ecf20Sopenharmony_cistruct mgmt_cp_add_remote_oob_ext_data {
3298c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3308c2ecf20Sopenharmony_ci	__u8	hash192[16];
3318c2ecf20Sopenharmony_ci	__u8	rand192[16];
3328c2ecf20Sopenharmony_ci	__u8	hash256[16];
3338c2ecf20Sopenharmony_ci	__u8	rand256[16];
3348c2ecf20Sopenharmony_ci} __packed;
3358c2ecf20Sopenharmony_ci#define MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 64)
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci#define MGMT_OP_REMOVE_REMOTE_OOB_DATA	0x0022
3388c2ecf20Sopenharmony_cistruct mgmt_cp_remove_remote_oob_data {
3398c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3408c2ecf20Sopenharmony_ci} __packed;
3418c2ecf20Sopenharmony_ci#define MGMT_REMOVE_REMOTE_OOB_DATA_SIZE MGMT_ADDR_INFO_SIZE
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci#define MGMT_OP_START_DISCOVERY		0x0023
3448c2ecf20Sopenharmony_cistruct mgmt_cp_start_discovery {
3458c2ecf20Sopenharmony_ci	__u8 type;
3468c2ecf20Sopenharmony_ci} __packed;
3478c2ecf20Sopenharmony_ci#define MGMT_START_DISCOVERY_SIZE	1
3488c2ecf20Sopenharmony_ci
3498c2ecf20Sopenharmony_ci#define MGMT_OP_STOP_DISCOVERY		0x0024
3508c2ecf20Sopenharmony_cistruct mgmt_cp_stop_discovery {
3518c2ecf20Sopenharmony_ci	__u8 type;
3528c2ecf20Sopenharmony_ci} __packed;
3538c2ecf20Sopenharmony_ci#define MGMT_STOP_DISCOVERY_SIZE	1
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci#define MGMT_OP_CONFIRM_NAME		0x0025
3568c2ecf20Sopenharmony_cistruct mgmt_cp_confirm_name {
3578c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3588c2ecf20Sopenharmony_ci	__u8	name_known;
3598c2ecf20Sopenharmony_ci} __packed;
3608c2ecf20Sopenharmony_ci#define MGMT_CONFIRM_NAME_SIZE		(MGMT_ADDR_INFO_SIZE + 1)
3618c2ecf20Sopenharmony_cistruct mgmt_rp_confirm_name {
3628c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3638c2ecf20Sopenharmony_ci} __packed;
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_ci#define MGMT_OP_BLOCK_DEVICE		0x0026
3668c2ecf20Sopenharmony_cistruct mgmt_cp_block_device {
3678c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3688c2ecf20Sopenharmony_ci} __packed;
3698c2ecf20Sopenharmony_ci#define MGMT_BLOCK_DEVICE_SIZE		MGMT_ADDR_INFO_SIZE
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci#define MGMT_OP_UNBLOCK_DEVICE		0x0027
3728c2ecf20Sopenharmony_cistruct mgmt_cp_unblock_device {
3738c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
3748c2ecf20Sopenharmony_ci} __packed;
3758c2ecf20Sopenharmony_ci#define MGMT_UNBLOCK_DEVICE_SIZE	MGMT_ADDR_INFO_SIZE
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEVICE_ID		0x0028
3788c2ecf20Sopenharmony_cistruct mgmt_cp_set_device_id {
3798c2ecf20Sopenharmony_ci	__le16	source;
3808c2ecf20Sopenharmony_ci	__le16	vendor;
3818c2ecf20Sopenharmony_ci	__le16	product;
3828c2ecf20Sopenharmony_ci	__le16	version;
3838c2ecf20Sopenharmony_ci} __packed;
3848c2ecf20Sopenharmony_ci#define MGMT_SET_DEVICE_ID_SIZE		8
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_ci#define MGMT_OP_SET_ADVERTISING		0x0029
3878c2ecf20Sopenharmony_ci
3888c2ecf20Sopenharmony_ci#define MGMT_OP_SET_BREDR		0x002A
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci#define MGMT_OP_SET_STATIC_ADDRESS	0x002B
3918c2ecf20Sopenharmony_cistruct mgmt_cp_set_static_address {
3928c2ecf20Sopenharmony_ci	bdaddr_t bdaddr;
3938c2ecf20Sopenharmony_ci} __packed;
3948c2ecf20Sopenharmony_ci#define MGMT_SET_STATIC_ADDRESS_SIZE	6
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_ci#define MGMT_OP_SET_SCAN_PARAMS		0x002C
3978c2ecf20Sopenharmony_cistruct mgmt_cp_set_scan_params {
3988c2ecf20Sopenharmony_ci	__le16	interval;
3998c2ecf20Sopenharmony_ci	__le16	window;
4008c2ecf20Sopenharmony_ci} __packed;
4018c2ecf20Sopenharmony_ci#define MGMT_SET_SCAN_PARAMS_SIZE	4
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci#define MGMT_OP_SET_SECURE_CONN		0x002D
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEBUG_KEYS		0x002E
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci#define MGMT_OP_SET_PRIVACY		0x002F
4088c2ecf20Sopenharmony_cistruct mgmt_cp_set_privacy {
4098c2ecf20Sopenharmony_ci	__u8 privacy;
4108c2ecf20Sopenharmony_ci	__u8 irk[16];
4118c2ecf20Sopenharmony_ci} __packed;
4128c2ecf20Sopenharmony_ci#define MGMT_SET_PRIVACY_SIZE		17
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_cistruct mgmt_irk_info {
4158c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4168c2ecf20Sopenharmony_ci	__u8 val[16];
4178c2ecf20Sopenharmony_ci} __packed;
4188c2ecf20Sopenharmony_ci
4198c2ecf20Sopenharmony_ci#define MGMT_OP_LOAD_IRKS		0x0030
4208c2ecf20Sopenharmony_cistruct mgmt_cp_load_irks {
4218c2ecf20Sopenharmony_ci	__le16 irk_count;
4228c2ecf20Sopenharmony_ci	struct mgmt_irk_info irks[];
4238c2ecf20Sopenharmony_ci} __packed;
4248c2ecf20Sopenharmony_ci#define MGMT_LOAD_IRKS_SIZE		2
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci#define MGMT_OP_GET_CONN_INFO		0x0031
4278c2ecf20Sopenharmony_cistruct mgmt_cp_get_conn_info {
4288c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4298c2ecf20Sopenharmony_ci} __packed;
4308c2ecf20Sopenharmony_ci#define MGMT_GET_CONN_INFO_SIZE		MGMT_ADDR_INFO_SIZE
4318c2ecf20Sopenharmony_cistruct mgmt_rp_get_conn_info {
4328c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4338c2ecf20Sopenharmony_ci	__s8	rssi;
4348c2ecf20Sopenharmony_ci	__s8	tx_power;
4358c2ecf20Sopenharmony_ci	__s8	max_tx_power;
4368c2ecf20Sopenharmony_ci} __packed;
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_ci#define MGMT_OP_GET_CLOCK_INFO		0x0032
4398c2ecf20Sopenharmony_cistruct mgmt_cp_get_clock_info {
4408c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4418c2ecf20Sopenharmony_ci} __packed;
4428c2ecf20Sopenharmony_ci#define MGMT_GET_CLOCK_INFO_SIZE	MGMT_ADDR_INFO_SIZE
4438c2ecf20Sopenharmony_cistruct mgmt_rp_get_clock_info {
4448c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4458c2ecf20Sopenharmony_ci	__le32  local_clock;
4468c2ecf20Sopenharmony_ci	__le32  piconet_clock;
4478c2ecf20Sopenharmony_ci	__le16  accuracy;
4488c2ecf20Sopenharmony_ci} __packed;
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_ci#define MGMT_OP_ADD_DEVICE		0x0033
4518c2ecf20Sopenharmony_cistruct mgmt_cp_add_device {
4528c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4538c2ecf20Sopenharmony_ci	__u8	action;
4548c2ecf20Sopenharmony_ci} __packed;
4558c2ecf20Sopenharmony_ci#define MGMT_ADD_DEVICE_SIZE		(MGMT_ADDR_INFO_SIZE + 1)
4568c2ecf20Sopenharmony_ci
4578c2ecf20Sopenharmony_ci#define MGMT_OP_REMOVE_DEVICE		0x0034
4588c2ecf20Sopenharmony_cistruct mgmt_cp_remove_device {
4598c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4608c2ecf20Sopenharmony_ci} __packed;
4618c2ecf20Sopenharmony_ci#define MGMT_REMOVE_DEVICE_SIZE		MGMT_ADDR_INFO_SIZE
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_cistruct mgmt_conn_param {
4648c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
4658c2ecf20Sopenharmony_ci	__le16 min_interval;
4668c2ecf20Sopenharmony_ci	__le16 max_interval;
4678c2ecf20Sopenharmony_ci	__le16 latency;
4688c2ecf20Sopenharmony_ci	__le16 timeout;
4698c2ecf20Sopenharmony_ci} __packed;
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci#define MGMT_OP_LOAD_CONN_PARAM		0x0035
4728c2ecf20Sopenharmony_cistruct mgmt_cp_load_conn_param {
4738c2ecf20Sopenharmony_ci	__le16 param_count;
4748c2ecf20Sopenharmony_ci	struct mgmt_conn_param params[];
4758c2ecf20Sopenharmony_ci} __packed;
4768c2ecf20Sopenharmony_ci#define MGMT_LOAD_CONN_PARAM_SIZE	2
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_ci#define MGMT_OP_READ_UNCONF_INDEX_LIST	0x0036
4798c2ecf20Sopenharmony_ci#define MGMT_READ_UNCONF_INDEX_LIST_SIZE 0
4808c2ecf20Sopenharmony_cistruct mgmt_rp_read_unconf_index_list {
4818c2ecf20Sopenharmony_ci	__le16	num_controllers;
4828c2ecf20Sopenharmony_ci	__le16	index[];
4838c2ecf20Sopenharmony_ci} __packed;
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_ci#define MGMT_OPTION_EXTERNAL_CONFIG	0x00000001
4868c2ecf20Sopenharmony_ci#define MGMT_OPTION_PUBLIC_ADDRESS	0x00000002
4878c2ecf20Sopenharmony_ci
4888c2ecf20Sopenharmony_ci#define MGMT_OP_READ_CONFIG_INFO	0x0037
4898c2ecf20Sopenharmony_ci#define MGMT_READ_CONFIG_INFO_SIZE	0
4908c2ecf20Sopenharmony_cistruct mgmt_rp_read_config_info {
4918c2ecf20Sopenharmony_ci	__le16	manufacturer;
4928c2ecf20Sopenharmony_ci	__le32	supported_options;
4938c2ecf20Sopenharmony_ci	__le32	missing_options;
4948c2ecf20Sopenharmony_ci} __packed;
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_ci#define MGMT_OP_SET_EXTERNAL_CONFIG	0x0038
4978c2ecf20Sopenharmony_cistruct mgmt_cp_set_external_config {
4988c2ecf20Sopenharmony_ci	__u8 config;
4998c2ecf20Sopenharmony_ci} __packed;
5008c2ecf20Sopenharmony_ci#define MGMT_SET_EXTERNAL_CONFIG_SIZE	1
5018c2ecf20Sopenharmony_ci
5028c2ecf20Sopenharmony_ci#define MGMT_OP_SET_PUBLIC_ADDRESS	0x0039
5038c2ecf20Sopenharmony_cistruct mgmt_cp_set_public_address {
5048c2ecf20Sopenharmony_ci	bdaddr_t bdaddr;
5058c2ecf20Sopenharmony_ci} __packed;
5068c2ecf20Sopenharmony_ci#define MGMT_SET_PUBLIC_ADDRESS_SIZE	6
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ci#define MGMT_OP_START_SERVICE_DISCOVERY	0x003A
5098c2ecf20Sopenharmony_cistruct mgmt_cp_start_service_discovery {
5108c2ecf20Sopenharmony_ci	__u8 type;
5118c2ecf20Sopenharmony_ci	__s8 rssi;
5128c2ecf20Sopenharmony_ci	__le16 uuid_count;
5138c2ecf20Sopenharmony_ci	__u8 uuids[][16];
5148c2ecf20Sopenharmony_ci} __packed;
5158c2ecf20Sopenharmony_ci#define MGMT_START_SERVICE_DISCOVERY_SIZE 4
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci#define MGMT_OP_READ_LOCAL_OOB_EXT_DATA	0x003B
5188c2ecf20Sopenharmony_cistruct mgmt_cp_read_local_oob_ext_data {
5198c2ecf20Sopenharmony_ci	__u8 type;
5208c2ecf20Sopenharmony_ci} __packed;
5218c2ecf20Sopenharmony_ci#define MGMT_READ_LOCAL_OOB_EXT_DATA_SIZE 1
5228c2ecf20Sopenharmony_cistruct mgmt_rp_read_local_oob_ext_data {
5238c2ecf20Sopenharmony_ci	__u8    type;
5248c2ecf20Sopenharmony_ci	__le16	eir_len;
5258c2ecf20Sopenharmony_ci	__u8	eir[];
5268c2ecf20Sopenharmony_ci} __packed;
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_ci#define MGMT_OP_READ_EXT_INDEX_LIST	0x003C
5298c2ecf20Sopenharmony_ci#define MGMT_READ_EXT_INDEX_LIST_SIZE	0
5308c2ecf20Sopenharmony_cistruct mgmt_rp_read_ext_index_list {
5318c2ecf20Sopenharmony_ci	__le16	num_controllers;
5328c2ecf20Sopenharmony_ci	struct {
5338c2ecf20Sopenharmony_ci		__le16 index;
5348c2ecf20Sopenharmony_ci		__u8   type;
5358c2ecf20Sopenharmony_ci		__u8   bus;
5368c2ecf20Sopenharmony_ci	} entry[];
5378c2ecf20Sopenharmony_ci} __packed;
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci#define MGMT_OP_READ_ADV_FEATURES	0x0003D
5408c2ecf20Sopenharmony_ci#define MGMT_READ_ADV_FEATURES_SIZE	0
5418c2ecf20Sopenharmony_cistruct mgmt_rp_read_adv_features {
5428c2ecf20Sopenharmony_ci	__le32 supported_flags;
5438c2ecf20Sopenharmony_ci	__u8   max_adv_data_len;
5448c2ecf20Sopenharmony_ci	__u8   max_scan_rsp_len;
5458c2ecf20Sopenharmony_ci	__u8   max_instances;
5468c2ecf20Sopenharmony_ci	__u8   num_instances;
5478c2ecf20Sopenharmony_ci	__u8   instance[];
5488c2ecf20Sopenharmony_ci} __packed;
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_ci#define MGMT_OP_ADD_ADVERTISING		0x003E
5518c2ecf20Sopenharmony_cistruct mgmt_cp_add_advertising {
5528c2ecf20Sopenharmony_ci	__u8	instance;
5538c2ecf20Sopenharmony_ci	__le32	flags;
5548c2ecf20Sopenharmony_ci	__le16	duration;
5558c2ecf20Sopenharmony_ci	__le16	timeout;
5568c2ecf20Sopenharmony_ci	__u8	adv_data_len;
5578c2ecf20Sopenharmony_ci	__u8	scan_rsp_len;
5588c2ecf20Sopenharmony_ci	__u8	data[];
5598c2ecf20Sopenharmony_ci} __packed;
5608c2ecf20Sopenharmony_ci#define MGMT_ADD_ADVERTISING_SIZE	11
5618c2ecf20Sopenharmony_cistruct mgmt_rp_add_advertising {
5628c2ecf20Sopenharmony_ci	__u8	instance;
5638c2ecf20Sopenharmony_ci} __packed;
5648c2ecf20Sopenharmony_ci
5658c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_CONNECTABLE	BIT(0)
5668c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_DISCOV		BIT(1)
5678c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_LIMITED_DISCOV	BIT(2)
5688c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_MANAGED_FLAGS	BIT(3)
5698c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_TX_POWER		BIT(4)
5708c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_APPEARANCE	BIT(5)
5718c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_LOCAL_NAME	BIT(6)
5728c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_SEC_1M 		BIT(7)
5738c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_SEC_2M 		BIT(8)
5748c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_SEC_CODED 	BIT(9)
5758c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_CAN_SET_TX_POWER	BIT(10)
5768c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_HW_OFFLOAD	BIT(11)
5778c2ecf20Sopenharmony_ci
5788c2ecf20Sopenharmony_ci#define MGMT_ADV_FLAG_SEC_MASK	(MGMT_ADV_FLAG_SEC_1M | MGMT_ADV_FLAG_SEC_2M | \
5798c2ecf20Sopenharmony_ci				 MGMT_ADV_FLAG_SEC_CODED)
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci#define MGMT_OP_REMOVE_ADVERTISING	0x003F
5828c2ecf20Sopenharmony_cistruct mgmt_cp_remove_advertising {
5838c2ecf20Sopenharmony_ci	__u8	instance;
5848c2ecf20Sopenharmony_ci} __packed;
5858c2ecf20Sopenharmony_ci#define MGMT_REMOVE_ADVERTISING_SIZE	1
5868c2ecf20Sopenharmony_cistruct mgmt_rp_remove_advertising {
5878c2ecf20Sopenharmony_ci	__u8	instance;
5888c2ecf20Sopenharmony_ci} __packed;
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci#define MGMT_OP_GET_ADV_SIZE_INFO	0x0040
5918c2ecf20Sopenharmony_cistruct mgmt_cp_get_adv_size_info {
5928c2ecf20Sopenharmony_ci	__u8	instance;
5938c2ecf20Sopenharmony_ci	__le32	flags;
5948c2ecf20Sopenharmony_ci} __packed;
5958c2ecf20Sopenharmony_ci#define MGMT_GET_ADV_SIZE_INFO_SIZE	5
5968c2ecf20Sopenharmony_cistruct mgmt_rp_get_adv_size_info {
5978c2ecf20Sopenharmony_ci	__u8	instance;
5988c2ecf20Sopenharmony_ci	__le32	flags;
5998c2ecf20Sopenharmony_ci	__u8	max_adv_data_len;
6008c2ecf20Sopenharmony_ci	__u8	max_scan_rsp_len;
6018c2ecf20Sopenharmony_ci} __packed;
6028c2ecf20Sopenharmony_ci
6038c2ecf20Sopenharmony_ci#define MGMT_OP_START_LIMITED_DISCOVERY	0x0041
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci#define MGMT_OP_READ_EXT_INFO		0x0042
6068c2ecf20Sopenharmony_ci#define MGMT_READ_EXT_INFO_SIZE		0
6078c2ecf20Sopenharmony_cistruct mgmt_rp_read_ext_info {
6088c2ecf20Sopenharmony_ci	bdaddr_t bdaddr;
6098c2ecf20Sopenharmony_ci	__u8     version;
6108c2ecf20Sopenharmony_ci	__le16   manufacturer;
6118c2ecf20Sopenharmony_ci	__le32   supported_settings;
6128c2ecf20Sopenharmony_ci	__le32   current_settings;
6138c2ecf20Sopenharmony_ci	__le16   eir_len;
6148c2ecf20Sopenharmony_ci	__u8     eir[];
6158c2ecf20Sopenharmony_ci} __packed;
6168c2ecf20Sopenharmony_ci
6178c2ecf20Sopenharmony_ci#define MGMT_OP_SET_APPEARANCE		0x0043
6188c2ecf20Sopenharmony_cistruct mgmt_cp_set_appearance {
6198c2ecf20Sopenharmony_ci	__le16	appearance;
6208c2ecf20Sopenharmony_ci} __packed;
6218c2ecf20Sopenharmony_ci#define MGMT_SET_APPEARANCE_SIZE	2
6228c2ecf20Sopenharmony_ci
6238c2ecf20Sopenharmony_ci#define MGMT_OP_GET_PHY_CONFIGURATION	0x0044
6248c2ecf20Sopenharmony_cistruct mgmt_rp_get_phy_confguration {
6258c2ecf20Sopenharmony_ci	__le32	supported_phys;
6268c2ecf20Sopenharmony_ci	__le32	configurable_phys;
6278c2ecf20Sopenharmony_ci	__le32	selected_phys;
6288c2ecf20Sopenharmony_ci} __packed;
6298c2ecf20Sopenharmony_ci#define MGMT_GET_PHY_CONFIGURATION_SIZE	0
6308c2ecf20Sopenharmony_ci
6318c2ecf20Sopenharmony_ci#define MGMT_PHY_BR_1M_1SLOT	0x00000001
6328c2ecf20Sopenharmony_ci#define MGMT_PHY_BR_1M_3SLOT	0x00000002
6338c2ecf20Sopenharmony_ci#define MGMT_PHY_BR_1M_5SLOT	0x00000004
6348c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_2M_1SLOT	0x00000008
6358c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_2M_3SLOT	0x00000010
6368c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_2M_5SLOT	0x00000020
6378c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_3M_1SLOT	0x00000040
6388c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_3M_3SLOT	0x00000080
6398c2ecf20Sopenharmony_ci#define MGMT_PHY_EDR_3M_5SLOT	0x00000100
6408c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_1M_TX		0x00000200
6418c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_1M_RX		0x00000400
6428c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_2M_TX		0x00000800
6438c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_2M_RX		0x00001000
6448c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_CODED_TX	0x00002000
6458c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_CODED_RX	0x00004000
6468c2ecf20Sopenharmony_ci
6478c2ecf20Sopenharmony_ci#define MGMT_PHY_BREDR_MASK (MGMT_PHY_BR_1M_1SLOT | MGMT_PHY_BR_1M_3SLOT | \
6488c2ecf20Sopenharmony_ci			     MGMT_PHY_BR_1M_5SLOT | MGMT_PHY_EDR_2M_1SLOT | \
6498c2ecf20Sopenharmony_ci			     MGMT_PHY_EDR_2M_3SLOT | MGMT_PHY_EDR_2M_5SLOT | \
6508c2ecf20Sopenharmony_ci			     MGMT_PHY_EDR_3M_1SLOT | MGMT_PHY_EDR_3M_3SLOT | \
6518c2ecf20Sopenharmony_ci			     MGMT_PHY_EDR_3M_5SLOT)
6528c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_MASK (MGMT_PHY_LE_1M_TX | MGMT_PHY_LE_1M_RX | \
6538c2ecf20Sopenharmony_ci			  MGMT_PHY_LE_2M_TX | MGMT_PHY_LE_2M_RX | \
6548c2ecf20Sopenharmony_ci			  MGMT_PHY_LE_CODED_TX | MGMT_PHY_LE_CODED_RX)
6558c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_TX_MASK (MGMT_PHY_LE_1M_TX | MGMT_PHY_LE_2M_TX | \
6568c2ecf20Sopenharmony_ci			     MGMT_PHY_LE_CODED_TX)
6578c2ecf20Sopenharmony_ci#define MGMT_PHY_LE_RX_MASK (MGMT_PHY_LE_1M_RX | MGMT_PHY_LE_2M_RX | \
6588c2ecf20Sopenharmony_ci			     MGMT_PHY_LE_CODED_RX)
6598c2ecf20Sopenharmony_ci
6608c2ecf20Sopenharmony_ci#define MGMT_OP_SET_PHY_CONFIGURATION	0x0045
6618c2ecf20Sopenharmony_cistruct mgmt_cp_set_phy_confguration {
6628c2ecf20Sopenharmony_ci	__le32	selected_phys;
6638c2ecf20Sopenharmony_ci} __packed;
6648c2ecf20Sopenharmony_ci#define MGMT_SET_PHY_CONFIGURATION_SIZE	4
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci#define MGMT_OP_SET_BLOCKED_KEYS	0x0046
6678c2ecf20Sopenharmony_ci
6688c2ecf20Sopenharmony_ci#define HCI_BLOCKED_KEY_TYPE_LINKKEY	0x00
6698c2ecf20Sopenharmony_ci#define HCI_BLOCKED_KEY_TYPE_LTK	0x01
6708c2ecf20Sopenharmony_ci#define HCI_BLOCKED_KEY_TYPE_IRK	0x02
6718c2ecf20Sopenharmony_ci
6728c2ecf20Sopenharmony_cistruct mgmt_blocked_key_info {
6738c2ecf20Sopenharmony_ci	__u8 type;
6748c2ecf20Sopenharmony_ci	__u8 val[16];
6758c2ecf20Sopenharmony_ci} __packed;
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_cistruct mgmt_cp_set_blocked_keys {
6788c2ecf20Sopenharmony_ci	__le16 key_count;
6798c2ecf20Sopenharmony_ci	struct mgmt_blocked_key_info keys[];
6808c2ecf20Sopenharmony_ci} __packed;
6818c2ecf20Sopenharmony_ci#define MGMT_OP_SET_BLOCKED_KEYS_SIZE 2
6828c2ecf20Sopenharmony_ci
6838c2ecf20Sopenharmony_ci#define MGMT_OP_SET_WIDEBAND_SPEECH	0x0047
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_ci#define MGMT_OP_READ_SECURITY_INFO	0x0048
6868c2ecf20Sopenharmony_ci#define MGMT_READ_SECURITY_INFO_SIZE	0
6878c2ecf20Sopenharmony_cistruct mgmt_rp_read_security_info {
6888c2ecf20Sopenharmony_ci	__le16   sec_len;
6898c2ecf20Sopenharmony_ci	__u8     sec[];
6908c2ecf20Sopenharmony_ci} __packed;
6918c2ecf20Sopenharmony_ci
6928c2ecf20Sopenharmony_ci#define MGMT_OP_READ_EXP_FEATURES_INFO	0x0049
6938c2ecf20Sopenharmony_ci#define MGMT_READ_EXP_FEATURES_INFO_SIZE 0
6948c2ecf20Sopenharmony_cistruct mgmt_rp_read_exp_features_info {
6958c2ecf20Sopenharmony_ci	__le16 feature_count;
6968c2ecf20Sopenharmony_ci	struct {
6978c2ecf20Sopenharmony_ci		__u8   uuid[16];
6988c2ecf20Sopenharmony_ci		__le32 flags;
6998c2ecf20Sopenharmony_ci	} features[];
7008c2ecf20Sopenharmony_ci} __packed;
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_ci#define MGMT_OP_SET_EXP_FEATURE		0x004a
7038c2ecf20Sopenharmony_cistruct mgmt_cp_set_exp_feature {
7048c2ecf20Sopenharmony_ci	__u8   uuid[16];
7058c2ecf20Sopenharmony_ci	__u8   param[];
7068c2ecf20Sopenharmony_ci} __packed;
7078c2ecf20Sopenharmony_ci#define MGMT_SET_EXP_FEATURE_SIZE	16
7088c2ecf20Sopenharmony_cistruct mgmt_rp_set_exp_feature {
7098c2ecf20Sopenharmony_ci	__u8   uuid[16];
7108c2ecf20Sopenharmony_ci	__le32 flags;
7118c2ecf20Sopenharmony_ci} __packed;
7128c2ecf20Sopenharmony_ci
7138c2ecf20Sopenharmony_ci#define MGMT_OP_READ_DEF_SYSTEM_CONFIG	0x004b
7148c2ecf20Sopenharmony_ci#define MGMT_READ_DEF_SYSTEM_CONFIG_SIZE	0
7158c2ecf20Sopenharmony_ci
7168c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEF_SYSTEM_CONFIG	0x004c
7178c2ecf20Sopenharmony_ci#define MGMT_SET_DEF_SYSTEM_CONFIG_SIZE		0
7188c2ecf20Sopenharmony_ci
7198c2ecf20Sopenharmony_ci#define MGMT_OP_READ_DEF_RUNTIME_CONFIG	0x004d
7208c2ecf20Sopenharmony_ci#define MGMT_READ_DEF_RUNTIME_CONFIG_SIZE	0
7218c2ecf20Sopenharmony_ci
7228c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEF_RUNTIME_CONFIG	0x004e
7238c2ecf20Sopenharmony_ci#define MGMT_SET_DEF_RUNTIME_CONFIG_SIZE	0
7248c2ecf20Sopenharmony_ci
7258c2ecf20Sopenharmony_ci#define MGMT_OP_GET_DEVICE_FLAGS	0x004F
7268c2ecf20Sopenharmony_ci#define MGMT_GET_DEVICE_FLAGS_SIZE	7
7278c2ecf20Sopenharmony_cistruct mgmt_cp_get_device_flags {
7288c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
7298c2ecf20Sopenharmony_ci} __packed;
7308c2ecf20Sopenharmony_cistruct mgmt_rp_get_device_flags {
7318c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
7328c2ecf20Sopenharmony_ci	__le32 supported_flags;
7338c2ecf20Sopenharmony_ci	__le32 current_flags;
7348c2ecf20Sopenharmony_ci} __packed;
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_ci#define MGMT_OP_SET_DEVICE_FLAGS	0x0050
7378c2ecf20Sopenharmony_ci#define MGMT_SET_DEVICE_FLAGS_SIZE	11
7388c2ecf20Sopenharmony_cistruct mgmt_cp_set_device_flags {
7398c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
7408c2ecf20Sopenharmony_ci	__le32 current_flags;
7418c2ecf20Sopenharmony_ci} __packed;
7428c2ecf20Sopenharmony_cistruct mgmt_rp_set_device_flags {
7438c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
7448c2ecf20Sopenharmony_ci} __packed;
7458c2ecf20Sopenharmony_ci
7468c2ecf20Sopenharmony_ci#define MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS    BIT(0)
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci#define MGMT_OP_READ_ADV_MONITOR_FEATURES	0x0051
7498c2ecf20Sopenharmony_ci#define MGMT_READ_ADV_MONITOR_FEATURES_SIZE	0
7508c2ecf20Sopenharmony_cistruct mgmt_rp_read_adv_monitor_features {
7518c2ecf20Sopenharmony_ci	__le32 supported_features;
7528c2ecf20Sopenharmony_ci	__le32 enabled_features;
7538c2ecf20Sopenharmony_ci	__le16 max_num_handles;
7548c2ecf20Sopenharmony_ci	__u8 max_num_patterns;
7558c2ecf20Sopenharmony_ci	__le16 num_handles;
7568c2ecf20Sopenharmony_ci	__le16 handles[];
7578c2ecf20Sopenharmony_ci}  __packed;
7588c2ecf20Sopenharmony_ci
7598c2ecf20Sopenharmony_cistruct mgmt_adv_pattern {
7608c2ecf20Sopenharmony_ci	__u8 ad_type;
7618c2ecf20Sopenharmony_ci	__u8 offset;
7628c2ecf20Sopenharmony_ci	__u8 length;
7638c2ecf20Sopenharmony_ci	__u8 value[31];
7648c2ecf20Sopenharmony_ci} __packed;
7658c2ecf20Sopenharmony_ci
7668c2ecf20Sopenharmony_ci#define MGMT_OP_ADD_ADV_PATTERNS_MONITOR	0x0052
7678c2ecf20Sopenharmony_cistruct mgmt_cp_add_adv_patterns_monitor {
7688c2ecf20Sopenharmony_ci	__u8 pattern_count;
7698c2ecf20Sopenharmony_ci	struct mgmt_adv_pattern patterns[];
7708c2ecf20Sopenharmony_ci} __packed;
7718c2ecf20Sopenharmony_ci#define MGMT_ADD_ADV_PATTERNS_MONITOR_SIZE	1
7728c2ecf20Sopenharmony_cistruct mgmt_rp_add_adv_patterns_monitor {
7738c2ecf20Sopenharmony_ci	__le16 monitor_handle;
7748c2ecf20Sopenharmony_ci} __packed;
7758c2ecf20Sopenharmony_ci
7768c2ecf20Sopenharmony_ci#define MGMT_OP_REMOVE_ADV_MONITOR		0x0053
7778c2ecf20Sopenharmony_cistruct mgmt_cp_remove_adv_monitor {
7788c2ecf20Sopenharmony_ci	__le16 monitor_handle;
7798c2ecf20Sopenharmony_ci} __packed;
7808c2ecf20Sopenharmony_ci#define MGMT_REMOVE_ADV_MONITOR_SIZE		2
7818c2ecf20Sopenharmony_cistruct mgmt_rp_remove_adv_monitor {
7828c2ecf20Sopenharmony_ci	__le16 monitor_handle;
7838c2ecf20Sopenharmony_ci} __packed;
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_ci#define MGMT_EV_CMD_COMPLETE		0x0001
7868c2ecf20Sopenharmony_cistruct mgmt_ev_cmd_complete {
7878c2ecf20Sopenharmony_ci	__le16	opcode;
7888c2ecf20Sopenharmony_ci	__u8	status;
7898c2ecf20Sopenharmony_ci	__u8	data[];
7908c2ecf20Sopenharmony_ci} __packed;
7918c2ecf20Sopenharmony_ci
7928c2ecf20Sopenharmony_ci#define MGMT_EV_CMD_STATUS		0x0002
7938c2ecf20Sopenharmony_cistruct mgmt_ev_cmd_status {
7948c2ecf20Sopenharmony_ci	__le16	opcode;
7958c2ecf20Sopenharmony_ci	__u8	status;
7968c2ecf20Sopenharmony_ci} __packed;
7978c2ecf20Sopenharmony_ci
7988c2ecf20Sopenharmony_ci#define MGMT_EV_CONTROLLER_ERROR	0x0003
7998c2ecf20Sopenharmony_cistruct mgmt_ev_controller_error {
8008c2ecf20Sopenharmony_ci	__u8	error_code;
8018c2ecf20Sopenharmony_ci} __packed;
8028c2ecf20Sopenharmony_ci
8038c2ecf20Sopenharmony_ci#define MGMT_EV_INDEX_ADDED		0x0004
8048c2ecf20Sopenharmony_ci
8058c2ecf20Sopenharmony_ci#define MGMT_EV_INDEX_REMOVED		0x0005
8068c2ecf20Sopenharmony_ci
8078c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_SETTINGS		0x0006
8088c2ecf20Sopenharmony_ci
8098c2ecf20Sopenharmony_ci#define MGMT_EV_CLASS_OF_DEV_CHANGED	0x0007
8108c2ecf20Sopenharmony_cistruct mgmt_ev_class_of_dev_changed {
8118c2ecf20Sopenharmony_ci	__u8	dev_class[3];
8128c2ecf20Sopenharmony_ci};
8138c2ecf20Sopenharmony_ci
8148c2ecf20Sopenharmony_ci#define MGMT_EV_LOCAL_NAME_CHANGED	0x0008
8158c2ecf20Sopenharmony_cistruct mgmt_ev_local_name_changed {
8168c2ecf20Sopenharmony_ci	__u8	name[MGMT_MAX_NAME_LENGTH];
8178c2ecf20Sopenharmony_ci	__u8	short_name[MGMT_MAX_SHORT_NAME_LENGTH];
8188c2ecf20Sopenharmony_ci} __packed;
8198c2ecf20Sopenharmony_ci
8208c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_LINK_KEY		0x0009
8218c2ecf20Sopenharmony_cistruct mgmt_ev_new_link_key {
8228c2ecf20Sopenharmony_ci	__u8	store_hint;
8238c2ecf20Sopenharmony_ci	struct mgmt_link_key_info key;
8248c2ecf20Sopenharmony_ci} __packed;
8258c2ecf20Sopenharmony_ci
8268c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_LONG_TERM_KEY	0x000A
8278c2ecf20Sopenharmony_cistruct mgmt_ev_new_long_term_key {
8288c2ecf20Sopenharmony_ci	__u8	store_hint;
8298c2ecf20Sopenharmony_ci	struct mgmt_ltk_info key;
8308c2ecf20Sopenharmony_ci} __packed;
8318c2ecf20Sopenharmony_ci
8328c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_CONNECTED	0x000B
8338c2ecf20Sopenharmony_cistruct mgmt_ev_device_connected {
8348c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8358c2ecf20Sopenharmony_ci	__le32	flags;
8368c2ecf20Sopenharmony_ci	__le16	eir_len;
8378c2ecf20Sopenharmony_ci	__u8	eir[];
8388c2ecf20Sopenharmony_ci} __packed;
8398c2ecf20Sopenharmony_ci
8408c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_UNKNOWN	0x00
8418c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_TIMEOUT	0x01
8428c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_LOCAL_HOST	0x02
8438c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_REMOTE		0x03
8448c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_AUTH_FAILURE	0x04
8458c2ecf20Sopenharmony_ci#define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND	0x05
8468c2ecf20Sopenharmony_ci
8478c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_DISCONNECTED	0x000C
8488c2ecf20Sopenharmony_cistruct mgmt_ev_device_disconnected {
8498c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8508c2ecf20Sopenharmony_ci	__u8	reason;
8518c2ecf20Sopenharmony_ci} __packed;
8528c2ecf20Sopenharmony_ci
8538c2ecf20Sopenharmony_ci#define MGMT_EV_CONNECT_FAILED		0x000D
8548c2ecf20Sopenharmony_cistruct mgmt_ev_connect_failed {
8558c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8568c2ecf20Sopenharmony_ci	__u8	status;
8578c2ecf20Sopenharmony_ci} __packed;
8588c2ecf20Sopenharmony_ci
8598c2ecf20Sopenharmony_ci#define MGMT_EV_PIN_CODE_REQUEST	0x000E
8608c2ecf20Sopenharmony_cistruct mgmt_ev_pin_code_request {
8618c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8628c2ecf20Sopenharmony_ci	__u8	secure;
8638c2ecf20Sopenharmony_ci} __packed;
8648c2ecf20Sopenharmony_ci
8658c2ecf20Sopenharmony_ci#define MGMT_EV_USER_CONFIRM_REQUEST	0x000F
8668c2ecf20Sopenharmony_cistruct mgmt_ev_user_confirm_request {
8678c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8688c2ecf20Sopenharmony_ci	__u8	confirm_hint;
8698c2ecf20Sopenharmony_ci	__le32	value;
8708c2ecf20Sopenharmony_ci} __packed;
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci#define MGMT_EV_USER_PASSKEY_REQUEST	0x0010
8738c2ecf20Sopenharmony_cistruct mgmt_ev_user_passkey_request {
8748c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8758c2ecf20Sopenharmony_ci} __packed;
8768c2ecf20Sopenharmony_ci
8778c2ecf20Sopenharmony_ci#define MGMT_EV_AUTH_FAILED		0x0011
8788c2ecf20Sopenharmony_cistruct mgmt_ev_auth_failed {
8798c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8808c2ecf20Sopenharmony_ci	__u8	status;
8818c2ecf20Sopenharmony_ci} __packed;
8828c2ecf20Sopenharmony_ci
8838c2ecf20Sopenharmony_ci#define MGMT_DEV_FOUND_CONFIRM_NAME    0x01
8848c2ecf20Sopenharmony_ci#define MGMT_DEV_FOUND_LEGACY_PAIRING  0x02
8858c2ecf20Sopenharmony_ci#define MGMT_DEV_FOUND_NOT_CONNECTABLE 0x04
8868c2ecf20Sopenharmony_ci
8878c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_FOUND		0x0012
8888c2ecf20Sopenharmony_cistruct mgmt_ev_device_found {
8898c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
8908c2ecf20Sopenharmony_ci	__s8	rssi;
8918c2ecf20Sopenharmony_ci	__le32	flags;
8928c2ecf20Sopenharmony_ci	__le16	eir_len;
8938c2ecf20Sopenharmony_ci	__u8	eir[];
8948c2ecf20Sopenharmony_ci} __packed;
8958c2ecf20Sopenharmony_ci
8968c2ecf20Sopenharmony_ci#define MGMT_EV_DISCOVERING		0x0013
8978c2ecf20Sopenharmony_cistruct mgmt_ev_discovering {
8988c2ecf20Sopenharmony_ci	__u8	type;
8998c2ecf20Sopenharmony_ci	__u8	discovering;
9008c2ecf20Sopenharmony_ci} __packed;
9018c2ecf20Sopenharmony_ci
9028c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_BLOCKED		0x0014
9038c2ecf20Sopenharmony_cistruct mgmt_ev_device_blocked {
9048c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9058c2ecf20Sopenharmony_ci} __packed;
9068c2ecf20Sopenharmony_ci
9078c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_UNBLOCKED	0x0015
9088c2ecf20Sopenharmony_cistruct mgmt_ev_device_unblocked {
9098c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9108c2ecf20Sopenharmony_ci} __packed;
9118c2ecf20Sopenharmony_ci
9128c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_UNPAIRED		0x0016
9138c2ecf20Sopenharmony_cistruct mgmt_ev_device_unpaired {
9148c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9158c2ecf20Sopenharmony_ci} __packed;
9168c2ecf20Sopenharmony_ci
9178c2ecf20Sopenharmony_ci#define MGMT_EV_PASSKEY_NOTIFY		0x0017
9188c2ecf20Sopenharmony_cistruct mgmt_ev_passkey_notify {
9198c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9208c2ecf20Sopenharmony_ci	__le32	passkey;
9218c2ecf20Sopenharmony_ci	__u8	entered;
9228c2ecf20Sopenharmony_ci} __packed;
9238c2ecf20Sopenharmony_ci
9248c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_IRK			0x0018
9258c2ecf20Sopenharmony_cistruct mgmt_ev_new_irk {
9268c2ecf20Sopenharmony_ci	__u8     store_hint;
9278c2ecf20Sopenharmony_ci	bdaddr_t rpa;
9288c2ecf20Sopenharmony_ci	struct mgmt_irk_info irk;
9298c2ecf20Sopenharmony_ci} __packed;
9308c2ecf20Sopenharmony_ci
9318c2ecf20Sopenharmony_ci#define MGMT_CSRK_LOCAL_UNAUTHENTICATED		0x00
9328c2ecf20Sopenharmony_ci#define MGMT_CSRK_REMOTE_UNAUTHENTICATED	0x01
9338c2ecf20Sopenharmony_ci#define MGMT_CSRK_LOCAL_AUTHENTICATED		0x02
9348c2ecf20Sopenharmony_ci#define MGMT_CSRK_REMOTE_AUTHENTICATED		0x03
9358c2ecf20Sopenharmony_ci
9368c2ecf20Sopenharmony_cistruct mgmt_csrk_info {
9378c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9388c2ecf20Sopenharmony_ci	__u8 type;
9398c2ecf20Sopenharmony_ci	__u8 val[16];
9408c2ecf20Sopenharmony_ci} __packed;
9418c2ecf20Sopenharmony_ci
9428c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_CSRK		0x0019
9438c2ecf20Sopenharmony_cistruct mgmt_ev_new_csrk {
9448c2ecf20Sopenharmony_ci	__u8 store_hint;
9458c2ecf20Sopenharmony_ci	struct mgmt_csrk_info key;
9468c2ecf20Sopenharmony_ci} __packed;
9478c2ecf20Sopenharmony_ci
9488c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_ADDED		0x001a
9498c2ecf20Sopenharmony_cistruct mgmt_ev_device_added {
9508c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9518c2ecf20Sopenharmony_ci	__u8 action;
9528c2ecf20Sopenharmony_ci} __packed;
9538c2ecf20Sopenharmony_ci
9548c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_REMOVED		0x001b
9558c2ecf20Sopenharmony_cistruct mgmt_ev_device_removed {
9568c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9578c2ecf20Sopenharmony_ci} __packed;
9588c2ecf20Sopenharmony_ci
9598c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_CONN_PARAM		0x001c
9608c2ecf20Sopenharmony_cistruct mgmt_ev_new_conn_param {
9618c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
9628c2ecf20Sopenharmony_ci	__u8 store_hint;
9638c2ecf20Sopenharmony_ci	__le16 min_interval;
9648c2ecf20Sopenharmony_ci	__le16 max_interval;
9658c2ecf20Sopenharmony_ci	__le16 latency;
9668c2ecf20Sopenharmony_ci	__le16 timeout;
9678c2ecf20Sopenharmony_ci} __packed;
9688c2ecf20Sopenharmony_ci
9698c2ecf20Sopenharmony_ci#define MGMT_EV_UNCONF_INDEX_ADDED	0x001d
9708c2ecf20Sopenharmony_ci
9718c2ecf20Sopenharmony_ci#define MGMT_EV_UNCONF_INDEX_REMOVED	0x001e
9728c2ecf20Sopenharmony_ci
9738c2ecf20Sopenharmony_ci#define MGMT_EV_NEW_CONFIG_OPTIONS	0x001f
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_cistruct mgmt_ev_ext_index {
9768c2ecf20Sopenharmony_ci	__u8 type;
9778c2ecf20Sopenharmony_ci	__u8 bus;
9788c2ecf20Sopenharmony_ci} __packed;
9798c2ecf20Sopenharmony_ci
9808c2ecf20Sopenharmony_ci#define MGMT_EV_EXT_INDEX_ADDED		0x0020
9818c2ecf20Sopenharmony_ci
9828c2ecf20Sopenharmony_ci#define MGMT_EV_EXT_INDEX_REMOVED	0x0021
9838c2ecf20Sopenharmony_ci
9848c2ecf20Sopenharmony_ci#define MGMT_EV_LOCAL_OOB_DATA_UPDATED	0x0022
9858c2ecf20Sopenharmony_cistruct mgmt_ev_local_oob_data_updated {
9868c2ecf20Sopenharmony_ci	__u8    type;
9878c2ecf20Sopenharmony_ci	__le16	eir_len;
9888c2ecf20Sopenharmony_ci	__u8	eir[];
9898c2ecf20Sopenharmony_ci} __packed;
9908c2ecf20Sopenharmony_ci
9918c2ecf20Sopenharmony_ci#define MGMT_EV_ADVERTISING_ADDED	0x0023
9928c2ecf20Sopenharmony_cistruct mgmt_ev_advertising_added {
9938c2ecf20Sopenharmony_ci	__u8    instance;
9948c2ecf20Sopenharmony_ci} __packed;
9958c2ecf20Sopenharmony_ci
9968c2ecf20Sopenharmony_ci#define MGMT_EV_ADVERTISING_REMOVED	0x0024
9978c2ecf20Sopenharmony_cistruct mgmt_ev_advertising_removed {
9988c2ecf20Sopenharmony_ci	__u8    instance;
9998c2ecf20Sopenharmony_ci} __packed;
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_ci#define MGMT_EV_EXT_INFO_CHANGED	0x0025
10028c2ecf20Sopenharmony_cistruct mgmt_ev_ext_info_changed {
10038c2ecf20Sopenharmony_ci	__le16	eir_len;
10048c2ecf20Sopenharmony_ci	__u8	eir[];
10058c2ecf20Sopenharmony_ci} __packed;
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci#define MGMT_EV_PHY_CONFIGURATION_CHANGED	0x0026
10088c2ecf20Sopenharmony_cistruct mgmt_ev_phy_configuration_changed {
10098c2ecf20Sopenharmony_ci	__le32	selected_phys;
10108c2ecf20Sopenharmony_ci} __packed;
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_ci#define MGMT_EV_EXP_FEATURE_CHANGED	0x0027
10138c2ecf20Sopenharmony_cistruct mgmt_ev_exp_feature_changed {
10148c2ecf20Sopenharmony_ci	__u8	uuid[16];
10158c2ecf20Sopenharmony_ci	__le32	flags;
10168c2ecf20Sopenharmony_ci} __packed;
10178c2ecf20Sopenharmony_ci
10188c2ecf20Sopenharmony_ci#define MGMT_EV_DEVICE_FLAGS_CHANGED		0x002a
10198c2ecf20Sopenharmony_cistruct mgmt_ev_device_flags_changed {
10208c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
10218c2ecf20Sopenharmony_ci	__le32 supported_flags;
10228c2ecf20Sopenharmony_ci	__le32 current_flags;
10238c2ecf20Sopenharmony_ci} __packed;
10248c2ecf20Sopenharmony_ci
10258c2ecf20Sopenharmony_ci#define MGMT_EV_ADV_MONITOR_ADDED	0x002b
10268c2ecf20Sopenharmony_cistruct mgmt_ev_adv_monitor_added {
10278c2ecf20Sopenharmony_ci	__le16 monitor_handle;
10288c2ecf20Sopenharmony_ci}  __packed;
10298c2ecf20Sopenharmony_ci
10308c2ecf20Sopenharmony_ci#define MGMT_EV_ADV_MONITOR_REMOVED	0x002c
10318c2ecf20Sopenharmony_cistruct mgmt_ev_adv_monitor_removed {
10328c2ecf20Sopenharmony_ci	__le16 monitor_handle;
10338c2ecf20Sopenharmony_ci}  __packed;
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci#define MGMT_EV_CONTROLLER_SUSPEND		0x002d
10368c2ecf20Sopenharmony_cistruct mgmt_ev_controller_suspend {
10378c2ecf20Sopenharmony_ci	__u8	suspend_state;
10388c2ecf20Sopenharmony_ci} __packed;
10398c2ecf20Sopenharmony_ci
10408c2ecf20Sopenharmony_ci#define MGMT_EV_CONTROLLER_RESUME		0x002e
10418c2ecf20Sopenharmony_cistruct mgmt_ev_controller_resume {
10428c2ecf20Sopenharmony_ci	__u8	wake_reason;
10438c2ecf20Sopenharmony_ci	struct mgmt_addr_info addr;
10448c2ecf20Sopenharmony_ci} __packed;
10458c2ecf20Sopenharmony_ci
10468c2ecf20Sopenharmony_ci#define MGMT_WAKE_REASON_NON_BT_WAKE		0x0
10478c2ecf20Sopenharmony_ci#define MGMT_WAKE_REASON_UNEXPECTED		0x1
10488c2ecf20Sopenharmony_ci#define MGMT_WAKE_REASON_REMOTE_WAKE		0x2
1049