xref: /openbmc/linux/include/net/bluetooth/hci.h (revision ff3b8df2bd758d97aa3dd7c021864be05fec9bd5)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds    BlueZ - Bluetooth protocol stack for Linux
31da177e4SLinus Torvalds    Copyright (C) 2000-2001 Qualcomm Incorporated
41da177e4SLinus Torvalds 
51da177e4SLinus Torvalds    Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
61da177e4SLinus Torvalds 
71da177e4SLinus Torvalds    This program is free software; you can redistribute it and/or modify
81da177e4SLinus Torvalds    it under the terms of the GNU General Public License version 2 as
91da177e4SLinus Torvalds    published by the Free Software Foundation;
101da177e4SLinus Torvalds 
111da177e4SLinus Torvalds    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
121da177e4SLinus Torvalds    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131da177e4SLinus Torvalds    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
141da177e4SLinus Torvalds    IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
151da177e4SLinus Torvalds    CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
161da177e4SLinus Torvalds    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
171da177e4SLinus Torvalds    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
181da177e4SLinus Torvalds    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
191da177e4SLinus Torvalds 
201da177e4SLinus Torvalds    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
211da177e4SLinus Torvalds    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
221da177e4SLinus Torvalds    SOFTWARE IS DISCLAIMED.
231da177e4SLinus Torvalds */
241da177e4SLinus Torvalds 
251da177e4SLinus Torvalds #ifndef __HCI_H
261da177e4SLinus Torvalds #define __HCI_H
271da177e4SLinus Torvalds 
281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE	1024
291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE	255
304de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE	251
311da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE	260
321da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE	(HCI_MAX_ACL_SIZE + 4)
331da177e4SLinus Torvalds 
349b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE	16
35523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE	(2 * HCI_LINK_KEY_SIZE)
369b3b4460SAndrei Emeltchenko 
37903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE	672
38903e4541SAndrei Emeltchenko 
397d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE	252
407d1dab49SDoHyun Pyun 
411da177e4SLinus Torvalds /* HCI dev events */
421da177e4SLinus Torvalds #define HCI_DEV_REG			1
431da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
441da177e4SLinus Torvalds #define HCI_DEV_UP			3
451da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
471da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN			7
494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE			8
50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP			9
511da177e4SLinus Torvalds 
521da177e4SLinus Torvalds /* HCI notify events */
531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
561f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_CVSD	4
571f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_TRANSP	5
581f8330eaSSathish Narsimman #define HCI_NOTIFY_DISABLE_SCO		6
591da177e4SLinus Torvalds 
60c13854ceSMarcel Holtmann /* HCI bus types */
610ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
621da177e4SLinus Torvalds #define HCI_USB		1
631da177e4SLinus Torvalds #define HCI_PCCARD	2
641da177e4SLinus Torvalds #define HCI_UART	3
651da177e4SLinus Torvalds #define HCI_RS232	4
661da177e4SLinus Torvalds #define HCI_PCI		5
670ac53939SMarcel Holtmann #define HCI_SDIO	6
685c0e03cdSJohan Hedberg #define HCI_SPI		7
695c0e03cdSJohan Hedberg #define HCI_I2C		8
7065010e68SBjorn Andersson #define HCI_SMD		9
71d2a3f5f4SMarcel Holtmann #define HCI_VIRTIO	10
721da177e4SLinus Torvalds 
73943da25dSMarcel Holtmann /* HCI controller types */
74ca8bee5dSMarcel Holtmann #define HCI_PRIMARY	0x00
758f1e1742SDavid Vrabel #define HCI_AMP		0x01
76943da25dSMarcel Holtmann 
778598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
786ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
798598d064SAndrei Emeltchenko 
807c13823dSMarcel Holtmann /* AMP controller types */
817c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
827c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
837c13823dSMarcel Holtmann 
84ab846ec4SAndrei Emeltchenko /* AMP controller status */
85536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
86536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
87536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
88536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
89536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
90536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
91536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
92ab846ec4SAndrei Emeltchenko 
931da177e4SLinus Torvalds /* HCI device quirks */
941da177e4SLinus Torvalds enum {
95118305b5SMarcel Holtmann 	/* When this quirk is set, the HCI Reset command is send when
96118305b5SMarcel Holtmann 	 * closing the transport instead of when opening it.
97118305b5SMarcel Holtmann 	 *
98118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
99118305b5SMarcel Holtmann 	 */
100a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
101118305b5SMarcel Holtmann 
102118305b5SMarcel Holtmann 	/* When this quirk is set, the device is turned into a raw-only
103118305b5SMarcel Holtmann 	 * device and it will stay in unconfigured state.
104118305b5SMarcel Holtmann 	 *
105118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
106118305b5SMarcel Holtmann 	 */
107da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
108118305b5SMarcel Holtmann 
109118305b5SMarcel Holtmann 	/* When this quirk is set, the buffer sizes reported by
110118305b5SMarcel Holtmann 	 * HCI Read Buffer Size command are corrected if invalid.
111118305b5SMarcel Holtmann 	 *
112118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
113118305b5SMarcel Holtmann 	 */
114f9f462faSMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE,
115118305b5SMarcel Holtmann 
116043ec9bfSMarcel Holtmann 	/* When this quirk is set, then a controller that does not
117043ec9bfSMarcel Holtmann 	 * indicate support for Inquiry Result with RSSI is assumed to
118043ec9bfSMarcel Holtmann 	 * support it anyway. Some early Bluetooth 1.2 controllers had
119043ec9bfSMarcel Holtmann 	 * wrongly configured local features that will require forcing
120043ec9bfSMarcel Holtmann 	 * them to enable this mode. Getting RSSI information with the
121043ec9bfSMarcel Holtmann 	 * inquiry responses is preferred since it allows for a better
122e37c57a8SAlain Michaud 	 * user experience.
123043ec9bfSMarcel Holtmann 	 *
124043ec9bfSMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
125043ec9bfSMarcel Holtmann 	 */
126043ec9bfSMarcel Holtmann 	HCI_QUIRK_FIXUP_INQUIRY_MODE,
127043ec9bfSMarcel Holtmann 
128711ffa78SMarcel Holtmann 	/* When this quirk is set, then the HCI Read Local Supported
129711ffa78SMarcel Holtmann 	 * Commands command is not supported. In general Bluetooth 1.2
130711ffa78SMarcel Holtmann 	 * and later controllers should support this command. However
131711ffa78SMarcel Holtmann 	 * some controllers indicate Bluetooth 1.2 support, but do
132711ffa78SMarcel Holtmann 	 * not support this command.
133711ffa78SMarcel Holtmann 	 *
134711ffa78SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
135711ffa78SMarcel Holtmann 	 */
136711ffa78SMarcel Holtmann 	HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
137711ffa78SMarcel Holtmann 
138118305b5SMarcel Holtmann 	/* When this quirk is set, then no stored link key handling
139118305b5SMarcel Holtmann 	 * is performed. This is mainly due to the fact that the
140118305b5SMarcel Holtmann 	 * HCI Delete Stored Link Key command is advertised, but
141118305b5SMarcel Holtmann 	 * not supported.
142118305b5SMarcel Holtmann 	 *
143118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
144118305b5SMarcel Holtmann 	 */
145f9f462faSMarcel Holtmann 	HCI_QUIRK_BROKEN_STORED_LINK_KEY,
14689bc22d2SMarcel Holtmann 
147eb1904f4SMarcel Holtmann 	/* When this quirk is set, an external configuration step
148eb1904f4SMarcel Holtmann 	 * is required and will be indicated with the controller
149e37c57a8SAlain Michaud 	 * configuration.
150eb1904f4SMarcel Holtmann 	 *
151eb1904f4SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
152eb1904f4SMarcel Holtmann 	 * during the hdev->setup vendor callback.
153eb1904f4SMarcel Holtmann 	 */
154eb1904f4SMarcel Holtmann 	HCI_QUIRK_EXTERNAL_CONFIG,
155eb1904f4SMarcel Holtmann 
15689bc22d2SMarcel Holtmann 	/* When this quirk is set, the public Bluetooth address
15789bc22d2SMarcel Holtmann 	 * initially reported by HCI Read BD Address command
15889bc22d2SMarcel Holtmann 	 * is considered invalid. Controller configuration is
15989bc22d2SMarcel Holtmann 	 * required before this device can be used.
16089bc22d2SMarcel Holtmann 	 *
16189bc22d2SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
16289bc22d2SMarcel Holtmann 	 * during the hdev->setup vendor callback.
16389bc22d2SMarcel Holtmann 	 */
16489bc22d2SMarcel Holtmann 	HCI_QUIRK_INVALID_BDADDR,
16543d6bc46SMarcel Holtmann 
1667a0e5b15SMatthias Kaehlcke 	/* When this quirk is set, the public Bluetooth address
1677a0e5b15SMatthias Kaehlcke 	 * initially reported by HCI Read BD Address command
1687a0e5b15SMatthias Kaehlcke 	 * is considered invalid. The public BD Address can be
1697a0e5b15SMatthias Kaehlcke 	 * specified in the fwnode property 'local-bd-address'.
1707a0e5b15SMatthias Kaehlcke 	 * If this property does not exist or is invalid controller
1717a0e5b15SMatthias Kaehlcke 	 * configuration is required before this device can be used.
1727a0e5b15SMatthias Kaehlcke 	 *
1737a0e5b15SMatthias Kaehlcke 	 * This quirk can be set before hci_register_dev is called or
1747a0e5b15SMatthias Kaehlcke 	 * during the hdev->setup vendor callback.
1757a0e5b15SMatthias Kaehlcke 	 */
1767a0e5b15SMatthias Kaehlcke 	HCI_QUIRK_USE_BDADDR_PROPERTY,
1777a0e5b15SMatthias Kaehlcke 
17843d6bc46SMarcel Holtmann 	/* When this quirk is set, the duplicate filtering during
17943d6bc46SMarcel Holtmann 	 * scanning is based on Bluetooth devices addresses. To allow
18043d6bc46SMarcel Holtmann 	 * RSSI based updates, restart scanning if needed.
18143d6bc46SMarcel Holtmann 	 *
18243d6bc46SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
18343d6bc46SMarcel Holtmann 	 * during the hdev->setup vendor callback.
18443d6bc46SMarcel Holtmann 	 */
18543d6bc46SMarcel Holtmann 	HCI_QUIRK_STRICT_DUPLICATE_FILTER,
186695c4cb6SJakub Pawlowski 
187695c4cb6SJakub Pawlowski 	/* When this quirk is set, LE scan and BR/EDR inquiry is done
188695c4cb6SJakub Pawlowski 	 * simultaneously, otherwise it's interleaved.
189695c4cb6SJakub Pawlowski 	 *
190695c4cb6SJakub Pawlowski 	 * This quirk can be set before hci_register_dev is called or
191695c4cb6SJakub Pawlowski 	 * during the hdev->setup vendor callback.
192695c4cb6SJakub Pawlowski 	 */
193695c4cb6SJakub Pawlowski 	HCI_QUIRK_SIMULTANEOUS_DISCOVERY,
1947e995b9eSMarcel Holtmann 
1957e995b9eSMarcel Holtmann 	/* When this quirk is set, the enabling of diagnostic mode is
1967e995b9eSMarcel Holtmann 	 * not persistent over HCI Reset. Every time the controller
1977e995b9eSMarcel Holtmann 	 * is brought up it needs to be reprogrammed.
1987e995b9eSMarcel Holtmann 	 *
1997e995b9eSMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
2007e995b9eSMarcel Holtmann 	 * during the hdev->setup vendor callback.
2017e995b9eSMarcel Holtmann 	 */
2027e995b9eSMarcel Holtmann 	HCI_QUIRK_NON_PERSISTENT_DIAG,
203740011cfSSean Wang 
204740011cfSSean Wang 	/* When this quirk is set, setup() would be run after every
205740011cfSSean Wang 	 * open() and not just after the first open().
206740011cfSSean Wang 	 *
207740011cfSSean Wang 	 * This quirk can be set before hci_register_dev is called or
208740011cfSSean Wang 	 * during the hdev->setup vendor callback.
209740011cfSSean Wang 	 *
210740011cfSSean Wang 	 */
211740011cfSSean Wang 	HCI_QUIRK_NON_PERSISTENT_SETUP,
2124b127bd5SAlain Michaud 
2134b127bd5SAlain Michaud 	/* When this quirk is set, wide band speech is supported by
2144b127bd5SAlain Michaud 	 * the driver since no reliable mechanism exist to report
2154b127bd5SAlain Michaud 	 * this from the hardware, a driver flag is use to convey
2164b127bd5SAlain Michaud 	 * this support
2174b127bd5SAlain Michaud 	 *
2184b127bd5SAlain Michaud 	 * This quirk must be set before hci_register_dev is called.
2194b127bd5SAlain Michaud 	 */
22000bce3fbSAlain Michaud 	HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
2211da177e4SLinus Torvalds };
2221da177e4SLinus Torvalds 
2231da177e4SLinus Torvalds /* HCI device flags */
2241da177e4SLinus Torvalds enum {
2251da177e4SLinus Torvalds 	HCI_UP,
2261da177e4SLinus Torvalds 	HCI_INIT,
2271da177e4SLinus Torvalds 	HCI_RUNNING,
2281da177e4SLinus Torvalds 
2291da177e4SLinus Torvalds 	HCI_PSCAN,
2301da177e4SLinus Torvalds 	HCI_ISCAN,
2311da177e4SLinus Torvalds 	HCI_AUTH,
2321da177e4SLinus Torvalds 	HCI_ENCRYPT,
2331da177e4SLinus Torvalds 	HCI_INQUIRY,
2341da177e4SLinus Torvalds 
2351da177e4SLinus Torvalds 	HCI_RAW,
236ab81cbf9SJohan Hedberg 
23710572132SGustavo F. Padovan 	HCI_RESET,
2381da177e4SLinus Torvalds };
2391da177e4SLinus Torvalds 
240f9207338SMarcel Holtmann /* HCI socket flags */
241f9207338SMarcel Holtmann enum {
24250ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
243f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
244f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
245ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
246321c6feeSMarcel Holtmann 	HCI_MGMT_EXT_INFO_EVENTS,
2475504c3a3SMarcel Holtmann 	HCI_MGMT_OPTION_EVENTS,
2485504c3a3SMarcel Holtmann 	HCI_MGMT_SETTING_EVENTS,
2495504c3a3SMarcel Holtmann 	HCI_MGMT_DEV_CLASS_EVENTS,
2505504c3a3SMarcel Holtmann 	HCI_MGMT_LOCAL_NAME_EVENTS,
25172000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
252f9207338SMarcel Holtmann };
253f9207338SMarcel Holtmann 
254d23264a8SAndre Guedes /*
255d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
256d23264a8SAndre Guedes  * states from the controller.
257d23264a8SAndre Guedes  */
258d23264a8SAndre Guedes enum {
259a8b2d5c2SJohan Hedberg 	HCI_SETUP,
260d603b76bSMarcel Holtmann 	HCI_CONFIG,
261a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
2625e130367SJohan Hedberg 	HCI_RFKILLED,
263a8b2d5c2SJohan Hedberg 	HCI_MGMT,
264b6ae8457SJohan Hedberg 	HCI_BONDABLE,
265a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
2660663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
2673769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
26894324962SJohan Hovold 	HCI_UNREGISTER,
2694a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
2700736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
271dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
27266c417c1SJohan Hedberg 	HCI_LE_ADV,
273d23264a8SAndre Guedes 	HCI_LE_SCAN,
27484bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
275e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
276134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
277863efaf2SJohan Hedberg 	HCI_PRIVACY,
27882a37adeSJohan Hedberg 	HCI_LIMITED_PRIVACY,
279d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
28041edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
2816d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
28206199cf8SJohan Hedberg 	HCI_LE_ENABLED,
283f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
284cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
2855e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
2865e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
2876acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
28847990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
28921693c15SAndre Guedes 	HCI_PERIODIC_INQ,
2901a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
29156f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
29281ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
29300bce3fbSAlain Michaud 	HCI_WIDEBAND_SPEECH_ENABLED,
294b7cb93e5SMarcel Holtmann 
295b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
2964b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
297b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
298b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
299aa12af77SAnkit Navik 	HCI_LL_RPA_RESOLUTION,
300f80c5dadSJoão Paulo Rechi Vita 	HCI_CMD_PENDING,
301c2aa30dbSArchie Pusaka 	HCI_FORCE_NO_MITM,
302b7cb93e5SMarcel Holtmann 
303eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
304d23264a8SAndre Guedes };
305d23264a8SAndre Guedes 
3061da177e4SLinus Torvalds /* HCI timeouts */
3075f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
3085f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
3095f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
310d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
3115f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
3129345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
313a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
3149489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
3151f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
3161da177e4SLinus Torvalds 
3175b7f9909SMarcel Holtmann /* HCI data types */
3181da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
3191da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
3201da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
3211da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
3224de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT		0x05
323e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
3241da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
3251da177e4SLinus Torvalds 
3265b7f9909SMarcel Holtmann /* HCI packet types */
3271da177e4SLinus Torvalds #define HCI_DM1		0x0008
3281da177e4SLinus Torvalds #define HCI_DM3		0x0400
3291da177e4SLinus Torvalds #define HCI_DM5		0x4000
3301da177e4SLinus Torvalds #define HCI_DH1		0x0010
3311da177e4SLinus Torvalds #define HCI_DH3		0x0800
3321da177e4SLinus Torvalds #define HCI_DH5		0x8000
3331da177e4SLinus Torvalds 
3345075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
3355075b972SJaganath Kanakkassery #define HCI_2DH1	0x0002
3365075b972SJaganath Kanakkassery #define HCI_3DH1	0x0004
3375075b972SJaganath Kanakkassery #define HCI_2DH3	0x0100
3385075b972SJaganath Kanakkassery #define HCI_3DH3	0x0200
3395075b972SJaganath Kanakkassery #define HCI_2DH5	0x1000
3405075b972SJaganath Kanakkassery #define HCI_3DH5	0x2000
3415075b972SJaganath Kanakkassery 
3421da177e4SLinus Torvalds #define HCI_HV1		0x0020
3431da177e4SLinus Torvalds #define HCI_HV2		0x0040
3441da177e4SLinus Torvalds #define HCI_HV3		0x0080
3451da177e4SLinus Torvalds 
3461da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
3471da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
3481da177e4SLinus Torvalds 
3495b7f9909SMarcel Holtmann /* eSCO packet types */
3505b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
3515b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
3525b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
3535b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
3545b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
3555b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
356efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
357efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
358efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
359efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
3605b7f9909SMarcel Holtmann 
361a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
362efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
363a8746417SMarcel Holtmann 
3641da177e4SLinus Torvalds /* ACL flags */
365e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
3661da177e4SLinus Torvalds #define ACL_CONT		0x01
3671da177e4SLinus Torvalds #define ACL_START		0x02
368d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
3691da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
3701da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
3711da177e4SLinus Torvalds 
3724de0fc59SLuiz Augusto von Dentz /* ISO PB flags */
3734de0fc59SLuiz Augusto von Dentz #define ISO_START		0x00
3744de0fc59SLuiz Augusto von Dentz #define ISO_CONT		0x01
3754de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE		0x02
3764de0fc59SLuiz Augusto von Dentz #define ISO_END			0x03
3774de0fc59SLuiz Augusto von Dentz 
3784de0fc59SLuiz Augusto von Dentz /* ISO TS flags */
3794de0fc59SLuiz Augusto von Dentz #define ISO_TS			0x01
3804de0fc59SLuiz Augusto von Dentz 
3811da177e4SLinus Torvalds /* Baseband links */
3821da177e4SLinus Torvalds #define SCO_LINK	0x00
3831da177e4SLinus Torvalds #define ACL_LINK	0x01
3845b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
385fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
386fcd89c09SVille Tervo #define LE_LINK		0x80
3873161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
3884de0fc59SLuiz Augusto von Dentz #define ISO_LINK	0x82
389845472e8SMarcel Holtmann #define INVALID_LINK	0xff
3901da177e4SLinus Torvalds 
3911da177e4SLinus Torvalds /* LMP features */
3921da177e4SLinus Torvalds #define LMP_3SLOT	0x01
3931da177e4SLinus Torvalds #define LMP_5SLOT	0x02
3941da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
3951da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
3961da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
3971da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
3981da177e4SLinus Torvalds #define LMP_HOLD	0x40
39904837f64SMarcel Holtmann #define LMP_SNIFF	0x80
4001da177e4SLinus Torvalds 
4011da177e4SLinus Torvalds #define LMP_PARK	0x01
4021da177e4SLinus Torvalds #define LMP_RSSI	0x02
4031da177e4SLinus Torvalds #define LMP_QUALITY	0x04
4041da177e4SLinus Torvalds #define LMP_SCO		0x08
4051da177e4SLinus Torvalds #define LMP_HV2		0x10
4061da177e4SLinus Torvalds #define LMP_HV3		0x20
4071da177e4SLinus Torvalds #define LMP_ULAW	0x40
4081da177e4SLinus Torvalds #define LMP_ALAW	0x80
4091da177e4SLinus Torvalds 
4101da177e4SLinus Torvalds #define LMP_CVSD	0x01
4111da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
4121da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
41307a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
4141da177e4SLinus Torvalds 
4155075b972SJaganath Kanakkassery #define LMP_EDR_2M		0x02
4165075b972SJaganath Kanakkassery #define LMP_EDR_3M		0x04
417d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
4185b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
4195b7f9909SMarcel Holtmann 
4205b7f9909SMarcel Holtmann #define LMP_EV4		0x01
4215b7f9909SMarcel Holtmann #define LMP_EV5		0x02
42269ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
423d5859e22SJohan Hedberg #define LMP_LE		0x40
4245075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT	0x80
4255b7f9909SMarcel Holtmann 
4265075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT	0x01
42704837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
428d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
429efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
430efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
431efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
43204837f64SMarcel Holtmann 
433d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
434e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
435769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
436e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
437769be974SMarcel Holtmann 
438d5859e22SJohan Hedberg #define LMP_LSTO	0x01
439d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
440971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
441d5859e22SJohan Hedberg 
442eead27daSAndre Guedes /* Extended LMP features */
44353b834d2SMarcel Holtmann #define LMP_CSB_MASTER	0x01
44453b834d2SMarcel Holtmann #define LMP_CSB_SLAVE	0x02
44553b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN	0x04
44653b834d2SMarcel Holtmann #define LMP_SYNC_SCAN	0x08
44753b834d2SMarcel Holtmann 
448d5991585SMarcel Holtmann #define LMP_SC		0x01
449d5991585SMarcel Holtmann #define LMP_PING	0x02
450d5991585SMarcel Holtmann 
45153b834d2SMarcel Holtmann /* Host features */
452cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
453eead27daSAndre Guedes #define LMP_HOST_LE		0x02
454cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
455d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
456eead27daSAndre Guedes 
457662bc2e6SAndre Guedes /* LE features */
4580da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
459662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
4600fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES		0x08
461cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
46294a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
463*ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY		0x40
4644b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
4655075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
4665075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
46755beec10SMarcel Holtmann #define HCI_LE_EXT_ADV			0x10
4689756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2		0x40
4694de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_MASTER		0x10
4704de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_SLAVE		0x20
471662bc2e6SAndre Guedes 
47204837f64SMarcel Holtmann /* Connection modes */
47304837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
47404837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
47504837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
47604837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
47704837f64SMarcel Holtmann 
4781da177e4SLinus Torvalds /* Link policies */
4791da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
4801da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
4811da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
4821da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
4831da177e4SLinus Torvalds 
48404837f64SMarcel Holtmann /* Link modes */
4851da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
4861da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
4871da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
4881da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
4891da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
4901da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
4911da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
4927b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
4931da177e4SLinus Torvalds 
49440be492fSMarcel Holtmann /* Authentication types */
49540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
49640be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
49740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
49840be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
49940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
50040be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
50140be492fSMarcel Holtmann 
502a77b15a6SMikel Astiz /* I/O capabilities */
503a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
504a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
505a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
506a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
507a77b15a6SMikel Astiz 
508b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
509b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
510b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
511b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
512b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
51311015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
51411015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
515b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
51611015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
51711015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
518b6020ba0SWaldemar Rymarkiewicz 
5199f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
5208e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
5219f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
522160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING	0x06
5232acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
524cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
525d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
5269f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
5279f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
528cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
529cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
5309f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
5319f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
5324ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS	0x1e
5334ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED		0x1f
5343c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
5359f5a0d7bSAndrei Emeltchenko 
5362455a3eaSAndrei Emeltchenko /* Flow control modes */
5372455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
5382455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
5392455a3eaSAndrei Emeltchenko 
540bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
541bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
542a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
543bbaf444aSJohan Hedberg 
544ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
545ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
546ba165a90SJohan Hedberg 
54732748db0SJohan Hedberg /* Extended Inquiry Response field types */
54832748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
54932748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
55032748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
55132748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
55232748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
55332748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
55432748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
55532748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
55632748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
55732748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
5589ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
559d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
560d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
56132748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
5624453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
5631471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
5641471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
565d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
566d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
567f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
568f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
56932748db0SJohan Hedberg 
5703f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
5713f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
5723f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
5733f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
5743f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
5753f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
5763f0f524bSJohan Hedberg 
5771da177e4SLinus Torvalds /* -----  HCI Commands ---- */
5786bd32326SVille Tervo #define HCI_OP_NOP			0x0000
5796bd32326SVille Tervo 
580a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
581a9de9248SMarcel Holtmann struct hci_cp_inquiry {
582a9de9248SMarcel Holtmann 	__u8     lap[3];
583a9de9248SMarcel Holtmann 	__u8     length;
584a9de9248SMarcel Holtmann 	__u8     num_rsp;
58566c853ccSGustavo F. Padovan } __packed;
5861da177e4SLinus Torvalds 
587a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
588a9de9248SMarcel Holtmann 
58979d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
59079d6e068SAndre Guedes 
591a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
592a9de9248SMarcel Holtmann 
593a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
594a9de9248SMarcel Holtmann struct hci_cp_create_conn {
595a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
596a9de9248SMarcel Holtmann 	__le16   pkt_type;
597a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
598a9de9248SMarcel Holtmann 	__u8     pscan_mode;
599a9de9248SMarcel Holtmann 	__le16   clock_offset;
600a9de9248SMarcel Holtmann 	__u8     role_switch;
60166c853ccSGustavo F. Padovan } __packed;
6021da177e4SLinus Torvalds 
603a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
604a9de9248SMarcel Holtmann struct hci_cp_disconnect {
605a9de9248SMarcel Holtmann 	__le16   handle;
606a9de9248SMarcel Holtmann 	__u8     reason;
60766c853ccSGustavo F. Padovan } __packed;
6081da177e4SLinus Torvalds 
609a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
610a9de9248SMarcel Holtmann struct hci_cp_add_sco {
611a9de9248SMarcel Holtmann 	__le16   handle;
612a9de9248SMarcel Holtmann 	__le16   pkt_type;
61366c853ccSGustavo F. Padovan } __packed;
614a9de9248SMarcel Holtmann 
615a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
616a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
6171da177e4SLinus Torvalds 	bdaddr_t bdaddr;
61866c853ccSGustavo F. Padovan } __packed;
6191da177e4SLinus Torvalds 
620a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
621a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
622a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
623a9de9248SMarcel Holtmann 	__u8     role;
62466c853ccSGustavo F. Padovan } __packed;
6251da177e4SLinus Torvalds 
626a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
627a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
628a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
629a9de9248SMarcel Holtmann 	__u8     reason;
63066c853ccSGustavo F. Padovan } __packed;
6311da177e4SLinus Torvalds 
632a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
633a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
634a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
6359b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
63666c853ccSGustavo F. Padovan } __packed;
6371da177e4SLinus Torvalds 
638a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
639a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
640a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
64166c853ccSGustavo F. Padovan } __packed;
6421da177e4SLinus Torvalds 
643a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
644a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
645a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
646a9de9248SMarcel Holtmann 	__u8     pin_len;
647a9de9248SMarcel Holtmann 	__u8     pin_code[16];
64866c853ccSGustavo F. Padovan } __packed;
649980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
650980e1a53SJohan Hedberg 	__u8     status;
651980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
652980e1a53SJohan Hedberg } __packed;
653a9de9248SMarcel Holtmann 
654a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
655a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
656a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
65766c853ccSGustavo F. Padovan } __packed;
658980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
659980e1a53SJohan Hedberg 	__u8     status;
660980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
661980e1a53SJohan Hedberg } __packed;
662a9de9248SMarcel Holtmann 
663a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
664a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
665a9de9248SMarcel Holtmann 	__le16   handle;
666a9de9248SMarcel Holtmann 	__le16   pkt_type;
66766c853ccSGustavo F. Padovan } __packed;
668a9de9248SMarcel Holtmann 
669a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
670a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
671a9de9248SMarcel Holtmann 	__le16   handle;
67266c853ccSGustavo F. Padovan } __packed;
673a9de9248SMarcel Holtmann 
674a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
675a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
676a9de9248SMarcel Holtmann 	__le16   handle;
677a9de9248SMarcel Holtmann 	__u8     encrypt;
67866c853ccSGustavo F. Padovan } __packed;
679a9de9248SMarcel Holtmann 
680a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
681a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
682a9de9248SMarcel Holtmann 	__le16   handle;
68366c853ccSGustavo F. Padovan } __packed;
684a9de9248SMarcel Holtmann 
685a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
686a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
687a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
688a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
689a9de9248SMarcel Holtmann 	__u8     pscan_mode;
690a9de9248SMarcel Holtmann 	__le16   clock_offset;
69166c853ccSGustavo F. Padovan } __packed;
692a9de9248SMarcel Holtmann 
693a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
694a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
695a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
69666c853ccSGustavo F. Padovan } __packed;
697a9de9248SMarcel Holtmann 
698a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
699a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
700a9de9248SMarcel Holtmann 	__le16   handle;
70166c853ccSGustavo F. Padovan } __packed;
702a9de9248SMarcel Holtmann 
703a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
704a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
705a9de9248SMarcel Holtmann 	__le16   handle;
706a9de9248SMarcel Holtmann 	__u8     page;
70766c853ccSGustavo F. Padovan } __packed;
708a9de9248SMarcel Holtmann 
709a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
710a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
711a9de9248SMarcel Holtmann 	__le16   handle;
71266c853ccSGustavo F. Padovan } __packed;
713a9de9248SMarcel Holtmann 
714df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
715df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
716df935429SMarcel Holtmann 	__le16   handle;
717df935429SMarcel Holtmann } __packed;
718df935429SMarcel Holtmann 
719a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
720a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
721a9de9248SMarcel Holtmann 	__le16   handle;
722a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
723a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
724a9de9248SMarcel Holtmann 	__le16   max_latency;
725a9de9248SMarcel Holtmann 	__le16   voice_setting;
726a9de9248SMarcel Holtmann 	__u8     retrans_effort;
727a9de9248SMarcel Holtmann 	__le16   pkt_type;
72866c853ccSGustavo F. Padovan } __packed;
729a9de9248SMarcel Holtmann 
730a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
731a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
732a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
733a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
734a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
735a9de9248SMarcel Holtmann 	__le16   max_latency;
736a9de9248SMarcel Holtmann 	__le16   content_format;
737a9de9248SMarcel Holtmann 	__u8     retrans_effort;
738a9de9248SMarcel Holtmann 	__le16   pkt_type;
73966c853ccSGustavo F. Padovan } __packed;
740a9de9248SMarcel Holtmann 
741a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
742a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
743a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
744a9de9248SMarcel Holtmann 	__u8     reason;
74566c853ccSGustavo F. Padovan } __packed;
746a9de9248SMarcel Holtmann 
74717fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
74817fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
74917fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
75017fa4b9dSJohan Hedberg 	__u8     capability;
75117fa4b9dSJohan Hedberg 	__u8     oob_data;
75217fa4b9dSJohan Hedberg 	__u8     authentication;
75317fa4b9dSJohan Hedberg } __packed;
75417fa4b9dSJohan Hedberg 
755a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
756a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
757a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
758a5c29683SJohan Hedberg } __packed;
759a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
760a5c29683SJohan Hedberg 	__u8     status;
761a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
762a5c29683SJohan Hedberg } __packed;
763a5c29683SJohan Hedberg 
764a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
765a5c29683SJohan Hedberg 
7669ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
7679ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
7689ad4019aSBrian Gix 	bdaddr_t bdaddr;
7699ad4019aSBrian Gix 	__le32	passkey;
7709ad4019aSBrian Gix } __packed;
7719ad4019aSBrian Gix 
7729ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
7739ad4019aSBrian Gix 
7742763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
7752763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
7762763eda6SSzymon Janc 	bdaddr_t bdaddr;
7772763eda6SSzymon Janc 	__u8     hash[16];
77838da1703SJohan Hedberg 	__u8     rand[16];
7792763eda6SSzymon Janc } __packed;
7802763eda6SSzymon Janc 
7812763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
7822763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
7832763eda6SSzymon Janc 	bdaddr_t bdaddr;
7842763eda6SSzymon Janc } __packed;
7852763eda6SSzymon Janc 
78603b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
78703b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
78803b555e1SJohan Hedberg 	bdaddr_t bdaddr;
78903b555e1SJohan Hedberg 	__u8     reason;
79003b555e1SJohan Hedberg } __packed;
79103b555e1SJohan Hedberg 
792523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
793523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
794523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
795523e93cdSAndrei Emeltchenko 	__u8     key_len;
796523e93cdSAndrei Emeltchenko 	__u8     key_type;
797523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
798523e93cdSAndrei Emeltchenko } __packed;
799523e93cdSAndrei Emeltchenko 
800523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
801523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
802523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
803523e93cdSAndrei Emeltchenko 	__u8     key_len;
804523e93cdSAndrei Emeltchenko 	__u8     key_type;
805523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
806523e93cdSAndrei Emeltchenko } __packed;
807523e93cdSAndrei Emeltchenko 
808523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
809523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
810523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
811523e93cdSAndrei Emeltchenko 	__u8     reason;
812b078b564SAndrei Emeltchenko } __packed;
813b078b564SAndrei Emeltchenko 
814b078b564SAndrei Emeltchenko struct ext_flow_spec {
815b078b564SAndrei Emeltchenko 	__u8       id;
816b078b564SAndrei Emeltchenko 	__u8       stype;
817b078b564SAndrei Emeltchenko 	__le16     msdu;
818b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
819b078b564SAndrei Emeltchenko 	__le32     acc_lat;
820b078b564SAndrei Emeltchenko 	__le32     flush_to;
821b078b564SAndrei Emeltchenko } __packed;
822b078b564SAndrei Emeltchenko 
823b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
824b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
825b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
826b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
827b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
828b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
829b078b564SAndrei Emeltchenko } __packed;
830b078b564SAndrei Emeltchenko 
831b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
832b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
833b078b564SAndrei Emeltchenko 	__le16   log_handle;
834b078b564SAndrei Emeltchenko } __packed;
835b078b564SAndrei Emeltchenko 
836b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
837b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
838b078b564SAndrei Emeltchenko 	__u8     phy_handle;
839b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
840b078b564SAndrei Emeltchenko } __packed;
841b078b564SAndrei Emeltchenko 
842b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
843b078b564SAndrei Emeltchenko 	__u8     status;
844b078b564SAndrei Emeltchenko 	__u8     phy_handle;
845b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
846523e93cdSAndrei Emeltchenko } __packed;
847523e93cdSAndrei Emeltchenko 
8488c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB			0x0441
8498c9a041bSDoHyun Pyun struct hci_cp_set_csb {
8508c9a041bSDoHyun Pyun 	__u8	enable;
8518c9a041bSDoHyun Pyun 	__u8	lt_addr;
8528c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
8538c9a041bSDoHyun Pyun 	__le16	packet_type;
8548c9a041bSDoHyun Pyun 	__le16	interval_min;
8558c9a041bSDoHyun Pyun 	__le16	interval_max;
8568c9a041bSDoHyun Pyun 	__le16	csb_sv_tout;
8578c9a041bSDoHyun Pyun } __packed;
8588c9a041bSDoHyun Pyun struct hci_rp_set_csb {
8598c9a041bSDoHyun Pyun 	__u8	status;
8608c9a041bSDoHyun Pyun 	__u8	lt_addr;
8618c9a041bSDoHyun Pyun 	__le16	interval;
8628c9a041bSDoHyun Pyun } __packed;
8638c9a041bSDoHyun Pyun 
864cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
865cefded98SDoHyun Pyun 
866e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
867e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
868e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
869e2f99131SMarcel Holtmann 	__u8     hash192[16];
87038da1703SJohan Hedberg 	__u8     rand192[16];
871e2f99131SMarcel Holtmann 	__u8     hash256[16];
87238da1703SJohan Hedberg 	__u8     rand256[16];
873e2f99131SMarcel Holtmann } __packed;
874e2f99131SMarcel Holtmann 
875a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
876a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
877a9de9248SMarcel Holtmann 	__le16   handle;
878a9de9248SMarcel Holtmann 	__le16   max_interval;
879a9de9248SMarcel Holtmann 	__le16   min_interval;
880a9de9248SMarcel Holtmann 	__le16   attempt;
881a9de9248SMarcel Holtmann 	__le16   timeout;
88266c853ccSGustavo F. Padovan } __packed;
883a9de9248SMarcel Holtmann 
884a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
885a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
886a9de9248SMarcel Holtmann 	__le16   handle;
88766c853ccSGustavo F. Padovan } __packed;
888a9de9248SMarcel Holtmann 
889a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
890a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
891a9de9248SMarcel Holtmann 	__le16   handle;
89266c853ccSGustavo F. Padovan } __packed;
893a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
894a9de9248SMarcel Holtmann 	__u8     status;
895a9de9248SMarcel Holtmann 	__le16   handle;
896a9de9248SMarcel Holtmann 	__u8     role;
89766c853ccSGustavo F. Padovan } __packed;
898a9de9248SMarcel Holtmann 
899a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
900a9de9248SMarcel Holtmann struct hci_cp_switch_role {
901a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
902a9de9248SMarcel Holtmann 	__u8     role;
90366c853ccSGustavo F. Padovan } __packed;
904a9de9248SMarcel Holtmann 
905a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
906a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
907a9de9248SMarcel Holtmann 	__le16   handle;
90866c853ccSGustavo F. Padovan } __packed;
909a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
910a9de9248SMarcel Holtmann 	__u8     status;
911a9de9248SMarcel Holtmann 	__le16   handle;
912a9de9248SMarcel Holtmann 	__le16   policy;
91366c853ccSGustavo F. Padovan } __packed;
914a9de9248SMarcel Holtmann 
915a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
916a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
917a9de9248SMarcel Holtmann 	__le16   handle;
918a9de9248SMarcel Holtmann 	__le16   policy;
91966c853ccSGustavo F. Padovan } __packed;
920a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
921a9de9248SMarcel Holtmann 	__u8     status;
922a9de9248SMarcel Holtmann 	__le16   handle;
92366c853ccSGustavo F. Padovan } __packed;
924a9de9248SMarcel Holtmann 
925e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
926e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
927e4e8e37cSMarcel Holtmann 	__u8     status;
928e4e8e37cSMarcel Holtmann 	__le16   policy;
92966c853ccSGustavo F. Padovan } __packed;
930e4e8e37cSMarcel Holtmann 
931e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
932e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
933e4e8e37cSMarcel Holtmann 	__le16   policy;
93466c853ccSGustavo F. Padovan } __packed;
935e4e8e37cSMarcel Holtmann 
936a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
937a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
938a9de9248SMarcel Holtmann 	__le16   handle;
939a9de9248SMarcel Holtmann 	__le16   max_latency;
940a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
941a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
94266c853ccSGustavo F. Padovan } __packed;
943a9de9248SMarcel Holtmann 
944a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
945a9de9248SMarcel Holtmann 
946a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
947a9de9248SMarcel Holtmann 
948a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
9494f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE		9
9504f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter {
9511da177e4SLinus Torvalds 	__u8		flt_type;
9521da177e4SLinus Torvalds 	__u8		cond_type;
9534f40afc6SAbhishek Pandit-Subedi 	struct {
9544f40afc6SAbhishek Pandit-Subedi 		bdaddr_t bdaddr;
9554f40afc6SAbhishek Pandit-Subedi 		__u8 auto_accept;
9564f40afc6SAbhishek Pandit-Subedi 	} __packed	addr_conn_flt;
95766c853ccSGustavo F. Padovan } __packed;
9581da177e4SLinus Torvalds 
9591da177e4SLinus Torvalds /* Filter types */
9601da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
9611da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
9621da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
9631da177e4SLinus Torvalds 
9641da177e4SLinus Torvalds /* CONN_SETUP Condition types */
9651da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
9661da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
9671da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
9681da177e4SLinus Torvalds 
9691da177e4SLinus Torvalds /* CONN_SETUP Conditions */
9701da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF		0x01
9711da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON		0x02
9724f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS	0x03
9731da177e4SLinus Torvalds 
974cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
975cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
976cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
977cb962780SMarcel Holtmann 	__u8     read_all;
978cb962780SMarcel Holtmann } __packed;
979cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
980cb962780SMarcel Holtmann 	__u8     status;
981cb962780SMarcel Holtmann 	__u8     max_keys;
982cb962780SMarcel Holtmann 	__u8     num_keys;
983cb962780SMarcel Holtmann } __packed;
984cb962780SMarcel Holtmann 
985b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
986b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
987b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
988b0916ea0SJohan Hedberg 	__u8     delete_all;
989b0916ea0SJohan Hedberg } __packed;
990039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
991039d4e41SMarcel Holtmann 	__u8     status;
992039d4e41SMarcel Holtmann 	__u8     num_keys;
993039d4e41SMarcel Holtmann } __packed;
994b0916ea0SJohan Hedberg 
9951f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
9961f6c6378SJohan Hedberg 
997a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
998a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
9991f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
100066c853ccSGustavo F. Padovan } __packed;
1001a9de9248SMarcel Holtmann 
1002a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
1003a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
1004a9de9248SMarcel Holtmann 	__u8     status;
10051f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
100666c853ccSGustavo F. Padovan } __packed;
1007a9de9248SMarcel Holtmann 
1008a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
1009a9de9248SMarcel Holtmann 
1010a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
1011a9de9248SMarcel Holtmann 
1012a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
1013a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
1014a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
1015a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
1016a9de9248SMarcel Holtmann 
1017a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
1018a9de9248SMarcel Holtmann 
1019a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
1020a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
1021a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
1022a9de9248SMarcel Holtmann 
1023a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
1024a9de9248SMarcel Holtmann 
1025a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
1026a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
1027a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
1028a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
1029a9de9248SMarcel Holtmann 
1030a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
1031a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
10321da177e4SLinus Torvalds 	__u8     status;
10331da177e4SLinus Torvalds 	__u8     dev_class[3];
103466c853ccSGustavo F. Padovan } __packed;
10351da177e4SLinus Torvalds 
1036a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
1037a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
10381da177e4SLinus Torvalds 	__u8     dev_class[3];
103966c853ccSGustavo F. Padovan } __packed;
10401da177e4SLinus Torvalds 
1041a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
10421da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
10431da177e4SLinus Torvalds 	__u8     status;
10441ebb9252SMarcel Holtmann 	__le16   voice_setting;
104566c853ccSGustavo F. Padovan } __packed;
10461da177e4SLinus Torvalds 
1047a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
10481da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
10491ebb9252SMarcel Holtmann 	__le16   voice_setting;
105066c853ccSGustavo F. Padovan } __packed;
10511da177e4SLinus Torvalds 
1052a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
10531da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
10541ebb9252SMarcel Holtmann 	__le16   acl_mtu;
10551da177e4SLinus Torvalds 	__u8     sco_mtu;
10561ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
10571ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
105866c853ccSGustavo F. Padovan } __packed;
10591da177e4SLinus Torvalds 
1060b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
1061b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1062b4cb9fb2SMarcel Holtmann 	__u8	status;
1063b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
1064b4cb9fb2SMarcel Holtmann } __packed;
1065b4cb9fb2SMarcel Holtmann 
10664b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
10674b836f39SMarcel Holtmann 
10683d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
10693d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
10703d505312SMarcel Holtmann 	__u8	num_iac;
10713d505312SMarcel Holtmann 	__u8	iac_lap[6];
10723d505312SMarcel Holtmann } __packed;
10733d505312SMarcel Holtmann 
1074d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
1075d5859e22SJohan Hedberg 
107680a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
107780a1e1dbSJohan Hedberg 
107880a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
107980a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1080816a11d5SJohan Hedberg 	__u8	fec;
1081816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
108280a1e1dbSJohan Hedberg } __packed;
108380a1e1dbSJohan Hedberg 
1084333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
1085333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1086333140b5SMarcel Holtmann 	__u8     status;
1087333140b5SMarcel Holtmann 	__u8     mode;
108866c853ccSGustavo F. Padovan } __packed;
1089333140b5SMarcel Holtmann 
1090333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
1091333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1092333140b5SMarcel Holtmann 	__u8     mode;
109366c853ccSGustavo F. Padovan } __packed;
1094333140b5SMarcel Holtmann 
1095c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1096c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1097c35938b2SSzymon Janc 	__u8     status;
1098c35938b2SSzymon Janc 	__u8     hash[16];
109938da1703SJohan Hedberg 	__u8     rand[16];
1100c35938b2SSzymon Janc } __packed;
1101c35938b2SSzymon Janc 
1102d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
110391c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
110491c4e9b1SMarcel Holtmann 	__u8     status;
110591c4e9b1SMarcel Holtmann 	__s8     tx_power;
110691c4e9b1SMarcel Holtmann } __packed;
1107d5859e22SJohan Hedberg 
110800bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING	0x0c5a
110900bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_DISABLED	0x00
111000bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_ENABLED	0x01
111100bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting {
111200bce3fbSAlain Michaud 	__u8     status;
111300bce3fbSAlain Michaud 	__u8     err_data_reporting;
111400bce3fbSAlain Michaud } __packed;
111500bce3fbSAlain Michaud 
111600bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING	0x0c5b
111700bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting {
111800bce3fbSAlain Michaud 	__u8     err_data_reporting;
111900bce3fbSAlain Michaud } __packed;
112000bce3fbSAlain Michaud 
1121d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1122d62e6d67SJohan Hedberg 
11237528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
11247528ca1cSMarcel Holtmann 
11251e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
11261e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
11271e89cffbSAndrei Emeltchenko 	__u8     status;
11281e89cffbSAndrei Emeltchenko 	__u8     mode;
11291e89cffbSAndrei Emeltchenko } __packed;
11301e89cffbSAndrei Emeltchenko 
1131f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1132f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1133f9b49306SAndre Guedes 	__u8	le;
1134f9b49306SAndre Guedes 	__u8	simul;
1135f9b49306SAndre Guedes } __packed;
1136f9b49306SAndre Guedes 
1137d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1138d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1139d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1140d0bf75a5SDoHyun Pyun } __packed;
1141d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1142d0bf75a5SDoHyun Pyun 	__u8	status;
1143d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1144d0bf75a5SDoHyun Pyun } __packed;
1145d0bf75a5SDoHyun Pyun 
11466a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
11476a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
11486a20eaf4SDoHyun Pyun 	__u8	lt_addr;
11496a20eaf4SDoHyun Pyun } __packed;
11506a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
11516a20eaf4SDoHyun Pyun 	__u8	status;
11526a20eaf4SDoHyun Pyun 	__u8	lt_addr;
11536a20eaf4SDoHyun Pyun } __packed;
11546a20eaf4SDoHyun Pyun 
11557d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
11567d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
11577d1dab49SDoHyun Pyun 	__u8	lt_addr;
11587d1dab49SDoHyun Pyun 	__u8	fragment;
11597d1dab49SDoHyun Pyun 	__u8	data_length;
11607d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
11617d1dab49SDoHyun Pyun } __packed;
11627d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
11637d1dab49SDoHyun Pyun 	__u8	status;
11647d1dab49SDoHyun Pyun 	__u8	lt_addr;
11657d1dab49SDoHyun Pyun } __packed;
11667d1dab49SDoHyun Pyun 
11675d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
11685d4e7e8dSJohan Hedberg 
1169a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1170a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1171a9b07a64SDoHyun Pyun 	__le16	interval_min;
1172a9b07a64SDoHyun Pyun 	__le16	interval_max;
1173a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1174a9b07a64SDoHyun Pyun 	__u8	service_data;
1175a9b07a64SDoHyun Pyun } __packed;
1176a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1177a9b07a64SDoHyun Pyun 	__u8	status;
1178a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1179a9b07a64SDoHyun Pyun } __packed;
1180a9b07a64SDoHyun Pyun 
1181eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1182eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1183eb4b95c6SMarcel Holtmann 	__u8	status;
1184eb4b95c6SMarcel Holtmann 	__u8	support;
1185eb4b95c6SMarcel Holtmann } __packed;
1186eb4b95c6SMarcel Holtmann 
1187eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1188eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1189eb4b95c6SMarcel Holtmann 	__u8	support;
1190eb4b95c6SMarcel Holtmann } __packed;
1191eb4b95c6SMarcel Holtmann 
1192302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO    0x0c7b
1193302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to {
1194302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1195302975cbSSpoorthi Ravishankar Koppad } __packed;
1196302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to {
1197302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1198302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1199302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1200302975cbSSpoorthi Ravishankar Koppad } __packed;
1201302975cbSSpoorthi Ravishankar Koppad 
1202302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO    0x0c7c
1203302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to {
1204302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1205302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1206302975cbSSpoorthi Ravishankar Koppad } __packed;
1207302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to {
1208302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1209302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1210302975cbSSpoorthi Ravishankar Koppad } __packed;
1211302975cbSSpoorthi Ravishankar Koppad 
1212e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1213e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1214e2f99131SMarcel Holtmann 	__u8     status;
1215e2f99131SMarcel Holtmann 	__u8     hash192[16];
121638da1703SJohan Hedberg 	__u8     rand192[16];
1217e2f99131SMarcel Holtmann 	__u8     hash256[16];
121838da1703SJohan Hedberg 	__u8     rand256[16];
1219e2f99131SMarcel Holtmann } __packed;
1220e2f99131SMarcel Holtmann 
1221a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1222a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
12231da177e4SLinus Torvalds 	__u8     status;
1224a9de9248SMarcel Holtmann 	__u8     hci_ver;
1225a9de9248SMarcel Holtmann 	__le16   hci_rev;
1226a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1227a9de9248SMarcel Holtmann 	__le16   manufacturer;
1228a9de9248SMarcel Holtmann 	__le16   lmp_subver;
122966c853ccSGustavo F. Padovan } __packed;
12301da177e4SLinus Torvalds 
1231a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1232a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
12331da177e4SLinus Torvalds 	__u8     status;
1234a9de9248SMarcel Holtmann 	__u8     commands[64];
123566c853ccSGustavo F. Padovan } __packed;
12361da177e4SLinus Torvalds 
1237a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1238a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1239a9de9248SMarcel Holtmann 	__u8     status;
1240a9de9248SMarcel Holtmann 	__u8     features[8];
124166c853ccSGustavo F. Padovan } __packed;
1242a9de9248SMarcel Holtmann 
1243a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1244971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1245971e3a4bSAndre Guedes 	__u8     page;
1246971e3a4bSAndre Guedes } __packed;
1247a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1248a9de9248SMarcel Holtmann 	__u8     status;
1249a9de9248SMarcel Holtmann 	__u8     page;
1250a9de9248SMarcel Holtmann 	__u8     max_page;
1251a9de9248SMarcel Holtmann 	__u8     features[8];
125266c853ccSGustavo F. Padovan } __packed;
1253a9de9248SMarcel Holtmann 
1254a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1255a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1256a9de9248SMarcel Holtmann 	__u8     status;
1257a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1258a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1259a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1260a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
126166c853ccSGustavo F. Padovan } __packed;
1262a9de9248SMarcel Holtmann 
1263a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1264a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1265a9de9248SMarcel Holtmann 	__u8     status;
12661da177e4SLinus Torvalds 	bdaddr_t bdaddr;
126766c853ccSGustavo F. Padovan } __packed;
12681da177e4SLinus Torvalds 
1269350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1270350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1271350ee4cfSAndrei Emeltchenko 	__u8     status;
1272350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1273350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1274350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1275350ee4cfSAndrei Emeltchenko } __packed;
1276350ee4cfSAndrei Emeltchenko 
1277109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
1278109e3191SMarcel Holtmann 
1279a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS	0x100c
1280a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts {
1281a4790360SMarcel Holtmann 	__u8     status;
1282a4790360SMarcel Holtmann 	__u8     pairing_opts;
1283a4790360SMarcel Holtmann 	__u8     max_key_size;
1284a4790360SMarcel Holtmann } __packed;
1285a4790360SMarcel Holtmann 
1286f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1287f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1288f332ec66SJohan Hedberg 	__u8     status;
1289f332ec66SJohan Hedberg 	__le16   interval;
1290f332ec66SJohan Hedberg 	__le16   window;
1291f332ec66SJohan Hedberg } __packed;
1292f332ec66SJohan Hedberg 
1293f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1294f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1295f6422ec6SAntti Julku 	__le16   interval;
1296f6422ec6SAntti Julku 	__le16   window;
1297f6422ec6SAntti Julku } __packed;
1298f6422ec6SAntti Julku 
12995a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
13005a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
13015a134faeSAndrzej Kaczmarek 	__le16   handle;
13025a134faeSAndrzej Kaczmarek 	__u8     type;
13035a134faeSAndrzej Kaczmarek } __packed;
13045a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
13055a134faeSAndrzej Kaczmarek 	__u8     status;
13065a134faeSAndrzej Kaczmarek 	__le16   handle;
13075a134faeSAndrzej Kaczmarek 	__s8     tx_power;
13085a134faeSAndrzej Kaczmarek } __packed;
13095a134faeSAndrzej Kaczmarek 
1310f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1311f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1312f332ec66SJohan Hedberg 	__u8     status;
1313f332ec66SJohan Hedberg 	__u8     type;
1314f332ec66SJohan Hedberg } __packed;
1315f332ec66SJohan Hedberg 
1316f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1317f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1318f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1319f6422ec6SAntti Julku 
13205ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
13215ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
13225ae76a94SAndrzej Kaczmarek 	__le16   handle;
13235ae76a94SAndrzej Kaczmarek } __packed;
13245ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
13255ae76a94SAndrzej Kaczmarek 	__u8     status;
13265ae76a94SAndrzej Kaczmarek 	__le16   handle;
13275ae76a94SAndrzej Kaczmarek 	__s8     rssi;
13285ae76a94SAndrzej Kaczmarek } __packed;
13295ae76a94SAndrzej Kaczmarek 
133033f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
133133f35721SJohan Hedberg struct hci_cp_read_clock {
133233f35721SJohan Hedberg 	__le16   handle;
133333f35721SJohan Hedberg 	__u8     which;
133433f35721SJohan Hedberg } __packed;
133533f35721SJohan Hedberg struct hci_rp_read_clock {
133633f35721SJohan Hedberg 	__u8     status;
133733f35721SJohan Hedberg 	__le16   handle;
133833f35721SJohan Hedberg 	__le32   clock;
133933f35721SJohan Hedberg 	__le16   accuracy;
134033f35721SJohan Hedberg } __packed;
134133f35721SJohan Hedberg 
1342821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1343821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1344821f3766SJohan Hedberg 	__le16   handle;
1345821f3766SJohan Hedberg } __packed;
1346821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1347821f3766SJohan Hedberg 	__u8     status;
1348821f3766SJohan Hedberg 	__le16   handle;
1349821f3766SJohan Hedberg 	__u8     key_size;
1350821f3766SJohan Hedberg } __packed;
1351821f3766SJohan Hedberg 
1352928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1353928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1354928abaa7SAndrei Emeltchenko 	__u8     status;
1355928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1356928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1357928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1358928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1359928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1360928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1361928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1362928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1363928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1364928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1365928abaa7SAndrei Emeltchenko } __packed;
1366928abaa7SAndrei Emeltchenko 
1367523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1368523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1369523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1370523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1371523e93cdSAndrei Emeltchenko 	__le16   max_len;
1372523e93cdSAndrei Emeltchenko } __packed;
1373523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1374523e93cdSAndrei Emeltchenko 	__u8     status;
1375523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1376523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1377a7e45454SGustavo A. R. Silva 	__u8     frag[];
1378523e93cdSAndrei Emeltchenko } __packed;
1379523e93cdSAndrei Emeltchenko 
1380523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1381523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1382523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1383523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1384523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1385a7e45454SGustavo A. R. Silva 	__u8     frag[];
1386523e93cdSAndrei Emeltchenko } __packed;
1387523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1388523e93cdSAndrei Emeltchenko 	__u8     status;
1389523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1390523e93cdSAndrei Emeltchenko } __packed;
1391523e93cdSAndrei Emeltchenko 
1392f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1393f4fe73edSMarcel Holtmann 
13944b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
13954b4148e9SMarcel Holtmann 
139606f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
139706f5b778SMarcel Holtmann 
139863185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
139963185f64SVille Tervo struct hci_cp_le_set_event_mask {
140063185f64SVille Tervo 	__u8     mask[8];
140163185f64SVille Tervo } __packed;
140263185f64SVille Tervo 
140363185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
140463185f64SVille Tervo struct hci_rp_le_read_buffer_size {
140563185f64SVille Tervo 	__u8     status;
140663185f64SVille Tervo 	__le16   le_mtu;
140763185f64SVille Tervo 	__u8     le_max_pkt;
140863185f64SVille Tervo } __packed;
140963185f64SVille Tervo 
141060e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
141160e77321SJohan Hedberg struct hci_rp_le_read_local_features {
141260e77321SJohan Hedberg 	__u8     status;
141360e77321SJohan Hedberg 	__u8     features[8];
141460e77321SJohan Hedberg } __packed;
141560e77321SJohan Hedberg 
1416d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1417d13eafceSMarcel Holtmann 
14181e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
14191e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
14201e191893SMarcel Holtmann 	__le16   min_interval;
14211e191893SMarcel Holtmann 	__le16   max_interval;
14221e191893SMarcel Holtmann 	__u8     type;
14231e191893SMarcel Holtmann 	__u8     own_address_type;
14241e191893SMarcel Holtmann 	__u8     direct_addr_type;
14251e191893SMarcel Holtmann 	bdaddr_t direct_addr;
14261e191893SMarcel Holtmann 	__u8     channel_map;
14271e191893SMarcel Holtmann 	__u8     filter_policy;
14281e191893SMarcel Holtmann } __packed;
14291e191893SMarcel Holtmann 
14308fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
14318fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
14328fa19098SJohan Hedberg 	__u8	status;
14338fa19098SJohan Hedberg 	__s8	tx_power;
14348fa19098SJohan Hedberg } __packed;
14358fa19098SJohan Hedberg 
14363f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
14373f0f524bSJohan Hedberg 
14383f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
14393f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
14403f0f524bSJohan Hedberg 	__u8	length;
14413f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
14423f0f524bSJohan Hedberg } __packed;
14433f0f524bSJohan Hedberg 
1444f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1445f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1446f14d8f64SMarcel Holtmann 	__u8	length;
1447f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1448f14d8f64SMarcel Holtmann } __packed;
1449f14d8f64SMarcel Holtmann 
1450c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1451c1d5dc4aSJohan Hedberg 
14525df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
14535df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
14545df480b5SAndre Guedes 
145507f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
145607f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
145707f7fa5dSAndre Guedes 	__u8    type;
145807f7fa5dSAndre Guedes 	__le16  interval;
145907f7fa5dSAndre Guedes 	__le16  window;
146007f7fa5dSAndre Guedes 	__u8    own_address_type;
146107f7fa5dSAndre Guedes 	__u8    filter_policy;
146207f7fa5dSAndre Guedes } __packed;
146307f7fa5dSAndre Guedes 
146476a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
146576a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1466525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1467525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
146868a8aea4SAndrei Emeltchenko 
1469eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1470eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1471eb9d91f5SAndre Guedes 	__u8     enable;
1472eb9d91f5SAndre Guedes 	__u8     filter_dup;
1473eb9d91f5SAndre Guedes } __packed;
1474eb9d91f5SAndre Guedes 
1475a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
1476a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST		0x01
1477a7139eddSJohan Hedberg 
147863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
147963185f64SVille Tervo struct hci_cp_le_create_conn {
148063185f64SVille Tervo 	__le16   scan_interval;
148163185f64SVille Tervo 	__le16   scan_window;
148263185f64SVille Tervo 	__u8     filter_policy;
148363185f64SVille Tervo 	__u8     peer_addr_type;
148463185f64SVille Tervo 	bdaddr_t peer_addr;
148563185f64SVille Tervo 	__u8     own_address_type;
148663185f64SVille Tervo 	__le16   conn_interval_min;
148763185f64SVille Tervo 	__le16   conn_interval_max;
148863185f64SVille Tervo 	__le16   conn_latency;
148963185f64SVille Tervo 	__le16   supervision_timeout;
149063185f64SVille Tervo 	__le16   min_ce_len;
149163185f64SVille Tervo 	__le16   max_ce_len;
149263185f64SVille Tervo } __packed;
149363185f64SVille Tervo 
149463185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
149563185f64SVille Tervo 
1496cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1497cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1498cf1d081fSJohan Hedberg 	__u8	status;
1499cf1d081fSJohan Hedberg 	__u8	size;
1500cf1d081fSJohan Hedberg } __packed;
1501cf1d081fSJohan Hedberg 
1502d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST	0x2010
1503d9a7b0a5SMarcel Holtmann 
1504d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST	0x2011
1505d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list {
1506d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1507d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1508d9a7b0a5SMarcel Holtmann } __packed;
1509d9a7b0a5SMarcel Holtmann 
1510d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST	0x2012
1511d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list {
1512d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1513d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1514d9a7b0a5SMarcel Holtmann } __packed;
1515d9a7b0a5SMarcel Holtmann 
15162ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
15172ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
15182ce603ebSClaudio Takahasi 	__le16   handle;
15192ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
15202ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
15212ce603ebSClaudio Takahasi 	__le16   conn_latency;
15222ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
15232ce603ebSClaudio Takahasi 	__le16   min_ce_len;
15242ce603ebSClaudio Takahasi 	__le16   max_ce_len;
15252ce603ebSClaudio Takahasi } __packed;
15262ce603ebSClaudio Takahasi 
15270fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
15280fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
15290fe29fd1SMarcel Holtmann 	__le16	 handle;
15300fe29fd1SMarcel Holtmann } __packed;
15310fe29fd1SMarcel Holtmann 
1532a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1533a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1534a7a595f6SVinicius Costa Gomes 	__le16	handle;
1535fe39c7b2SMarcel Holtmann 	__le64	rand;
1536a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1537a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1538a7a595f6SVinicius Costa Gomes } __packed;
1539a7a595f6SVinicius Costa Gomes 
1540a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1541a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1542a7a595f6SVinicius Costa Gomes 	__le16	handle;
1543a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1544a7a595f6SVinicius Costa Gomes } __packed;
1545a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1546a7a595f6SVinicius Costa Gomes 	__u8	status;
1547a7a595f6SVinicius Costa Gomes 	__le16	handle;
1548a7a595f6SVinicius Costa Gomes } __packed;
1549a7a595f6SVinicius Costa Gomes 
1550a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1551a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1552a7a595f6SVinicius Costa Gomes 	__le16	handle;
1553a7a595f6SVinicius Costa Gomes } __packed;
1554a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1555a7a595f6SVinicius Costa Gomes 	__u8	status;
1556a7a595f6SVinicius Costa Gomes 	__le16	handle;
1557a7a595f6SVinicius Costa Gomes } __packed;
1558a7a595f6SVinicius Costa Gomes 
15599b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
15609b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
15619b008c04SJohan Hedberg 	__u8	status;
15629b008c04SJohan Hedberg 	__u8	le_states[8];
15639b008c04SJohan Hedberg } __packed;
15649b008c04SJohan Hedberg 
15658e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
15668e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
15678e75b46aSAndre Guedes 	__le16	handle;
15688e75b46aSAndre Guedes 	__le16	interval_min;
15698e75b46aSAndre Guedes 	__le16	interval_max;
15708e75b46aSAndre Guedes 	__le16	latency;
15718e75b46aSAndre Guedes 	__le16	timeout;
15728e75b46aSAndre Guedes 	__le16	min_ce_len;
15738e75b46aSAndre Guedes 	__le16	max_ce_len;
15748e75b46aSAndre Guedes } __packed;
15758e75b46aSAndre Guedes 
15768e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
15778e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
15788e75b46aSAndre Guedes 	__le16	handle;
15798e75b46aSAndre Guedes 	__u8	reason;
15808e75b46aSAndre Guedes } __packed;
15818e75b46aSAndre Guedes 
158294a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
158394a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
158494a3bd02SMarcel Holtmann 	__le16	handle;
158594a3bd02SMarcel Holtmann 	__le16	tx_len;
158694a3bd02SMarcel Holtmann 	__le16	tx_time;
158794a3bd02SMarcel Holtmann } __packed;
158894a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
158994a3bd02SMarcel Holtmann 	__u8	status;
159094a3bd02SMarcel Holtmann 	__le16	handle;
159194a3bd02SMarcel Holtmann } __packed;
159294a3bd02SMarcel Holtmann 
159394a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
159494a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
159594a3bd02SMarcel Holtmann 	__u8	status;
159694a3bd02SMarcel Holtmann 	__le16	tx_len;
159794a3bd02SMarcel Holtmann 	__le16	tx_time;
159894a3bd02SMarcel Holtmann } __packed;
159994a3bd02SMarcel Holtmann 
160094a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
160194a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
160294a3bd02SMarcel Holtmann 	__le16	tx_len;
160394a3bd02SMarcel Holtmann 	__le16	tx_time;
160494a3bd02SMarcel Holtmann } __packed;
160594a3bd02SMarcel Holtmann 
1606b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST	0x2027
1607b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list {
1608b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1609b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1610b950aa88SAnkit Navik 	__u8	 peer_irk[16];
1611b950aa88SAnkit Navik 	__u8	 local_irk[16];
1612b950aa88SAnkit Navik } __packed;
1613b950aa88SAnkit Navik 
1614b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST	0x2028
1615b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list {
1616b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1617b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1618b950aa88SAnkit Navik } __packed;
1619b950aa88SAnkit Navik 
1620545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST	0x2029
1621545f2596SAnkit Navik 
1622cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE	0x202a
1623cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1624cfdb0c2dSAnkit Navik 	__u8	status;
1625cfdb0c2dSAnkit Navik 	__u8	size;
1626cfdb0c2dSAnkit Navik } __packed;
1627cfdb0c2dSAnkit Navik 
1628aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1629aa12af77SAnkit Navik 
163094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
163194a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
163294a3bd02SMarcel Holtmann 	__u8	status;
163394a3bd02SMarcel Holtmann 	__le16	tx_len;
163494a3bd02SMarcel Holtmann 	__le16	tx_time;
163594a3bd02SMarcel Holtmann 	__le16	rx_len;
163694a3bd02SMarcel Holtmann 	__le16	rx_time;
163794a3bd02SMarcel Holtmann } __packed;
163894a3bd02SMarcel Holtmann 
1639de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY	0x2031
1640de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1641de2ba303SMarcel Holtmann 	__u8    all_phys;
1642de2ba303SMarcel Holtmann 	__u8    tx_phys;
1643de2ba303SMarcel Holtmann 	__u8    rx_phys;
1644de2ba303SMarcel Holtmann } __packed;
1645de2ba303SMarcel Holtmann 
16466decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M		0x01
16476decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M		0x02
16486decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED		0x04
16496decb5b4SJaganath Kanakkassery 
1650a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS   0x2041
1651a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1652a2344b9eSJaganath Kanakkassery 	__u8    own_addr_type;
1653a2344b9eSJaganath Kanakkassery 	__u8    filter_policy;
1654a2344b9eSJaganath Kanakkassery 	__u8    scanning_phys;
1655a7e45454SGustavo A. R. Silva 	__u8    data[];
1656a2344b9eSJaganath Kanakkassery } __packed;
1657a2344b9eSJaganath Kanakkassery 
1658a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M		0x01
165945bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M		0x02
166045bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED	0x04
1661a2344b9eSJaganath Kanakkassery 
1662a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1663a2344b9eSJaganath Kanakkassery 	__u8    type;
1664a2344b9eSJaganath Kanakkassery 	__le16  interval;
1665a2344b9eSJaganath Kanakkassery 	__le16  window;
1666a2344b9eSJaganath Kanakkassery } __packed;
1667a2344b9eSJaganath Kanakkassery 
1668a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE   0x2042
1669a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1670a2344b9eSJaganath Kanakkassery 	__u8    enable;
1671a2344b9eSJaganath Kanakkassery 	__u8    filter_dup;
1672a2344b9eSJaganath Kanakkassery 	__le16  duration;
1673a2344b9eSJaganath Kanakkassery 	__le16  period;
1674a2344b9eSJaganath Kanakkassery } __packed;
1675a2344b9eSJaganath Kanakkassery 
16764d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN    0x2043
16774d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
16784d94f95dSJaganath Kanakkassery 	__u8      filter_policy;
16794d94f95dSJaganath Kanakkassery 	__u8      own_addr_type;
16804d94f95dSJaganath Kanakkassery 	__u8      peer_addr_type;
16814d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_addr;
16824d94f95dSJaganath Kanakkassery 	__u8      phys;
1683a7e45454SGustavo A. R. Silva 	__u8      data[];
16844d94f95dSJaganath Kanakkassery } __packed;
16854d94f95dSJaganath Kanakkassery 
16864d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
16874d94f95dSJaganath Kanakkassery 	__le16 scan_interval;
16884d94f95dSJaganath Kanakkassery 	__le16 scan_window;
16894d94f95dSJaganath Kanakkassery 	__le16 conn_interval_min;
16904d94f95dSJaganath Kanakkassery 	__le16 conn_interval_max;
16914d94f95dSJaganath Kanakkassery 	__le16 conn_latency;
16924d94f95dSJaganath Kanakkassery 	__le16 supervision_timeout;
16934d94f95dSJaganath Kanakkassery 	__le16 min_ce_len;
16944d94f95dSJaganath Kanakkassery 	__le16 max_ce_len;
16954d94f95dSJaganath Kanakkassery } __packed;
16964d94f95dSJaganath Kanakkassery 
16976b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS	0x203b
16986b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
16996b49bcb4SJaganath Kanakkassery 	__u8  status;
17006b49bcb4SJaganath Kanakkassery 	__u8  num_of_sets;
17016b49bcb4SJaganath Kanakkassery } __packed;
17026b49bcb4SJaganath Kanakkassery 
1703de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS		0x2036
1704de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1705de181e88SJaganath Kanakkassery 	__u8      handle;
1706de181e88SJaganath Kanakkassery 	__le16    evt_properties;
1707de181e88SJaganath Kanakkassery 	__u8      min_interval[3];
1708de181e88SJaganath Kanakkassery 	__u8      max_interval[3];
1709de181e88SJaganath Kanakkassery 	__u8      channel_map;
1710de181e88SJaganath Kanakkassery 	__u8      own_addr_type;
1711de181e88SJaganath Kanakkassery 	__u8      peer_addr_type;
1712de181e88SJaganath Kanakkassery 	bdaddr_t  peer_addr;
1713de181e88SJaganath Kanakkassery 	__u8      filter_policy;
1714de181e88SJaganath Kanakkassery 	__u8      tx_power;
1715de181e88SJaganath Kanakkassery 	__u8      primary_phy;
1716de181e88SJaganath Kanakkassery 	__u8      secondary_max_skip;
1717de181e88SJaganath Kanakkassery 	__u8      secondary_phy;
1718de181e88SJaganath Kanakkassery 	__u8      sid;
1719de181e88SJaganath Kanakkassery 	__u8      notif_enable;
1720de181e88SJaganath Kanakkassery } __packed;
1721de181e88SJaganath Kanakkassery 
1722de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M		0X01
172385a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M		0x02
172485a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED	0x03
1725de181e88SJaganath Kanakkassery 
1726de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1727de181e88SJaganath Kanakkassery 	__u8  status;
1728de181e88SJaganath Kanakkassery 	__u8  tx_power;
1729de181e88SJaganath Kanakkassery } __packed;
1730de181e88SJaganath Kanakkassery 
1731de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE		0x2039
1732de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable {
1733de181e88SJaganath Kanakkassery 	__u8  enable;
1734de181e88SJaganath Kanakkassery 	__u8  num_of_sets;
1735a7e45454SGustavo A. R. Silva 	__u8  data[];
1736de181e88SJaganath Kanakkassery } __packed;
1737de181e88SJaganath Kanakkassery 
1738de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1739de181e88SJaganath Kanakkassery 	__u8  handle;
1740de181e88SJaganath Kanakkassery 	__le16 duration;
1741de181e88SJaganath Kanakkassery 	__u8  max_events;
1742de181e88SJaganath Kanakkassery } __packed;
1743de181e88SJaganath Kanakkassery 
1744a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA		0x2037
1745a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1746a0fb3726SJaganath Kanakkassery 	__u8  handle;
1747a0fb3726SJaganath Kanakkassery 	__u8  operation;
1748a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1749a0fb3726SJaganath Kanakkassery 	__u8  length;
1750a0fb3726SJaganath Kanakkassery 	__u8  data[HCI_MAX_AD_LENGTH];
1751a0fb3726SJaganath Kanakkassery } __packed;
1752a0fb3726SJaganath Kanakkassery 
1753a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA		0x2038
1754a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
1755a0fb3726SJaganath Kanakkassery 	__u8  handle;
1756a0fb3726SJaganath Kanakkassery 	__u8  operation;
1757a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1758a0fb3726SJaganath Kanakkassery 	__u8  length;
1759a0fb3726SJaganath Kanakkassery 	__u8  data[HCI_MAX_AD_LENGTH];
1760a0fb3726SJaganath Kanakkassery } __packed;
1761a0fb3726SJaganath Kanakkassery 
1762a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE	0x03
1763a0fb3726SJaganath Kanakkassery 
1764a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG		0x01
1765a0fb3726SJaganath Kanakkassery 
1766a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET	0x203c
1767a9e45698SSathish Narsimman 
176845b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS	0x203d
176945b7749fSJaganath Kanakkassery 
1770a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR	0x2035
1771a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
1772a73c046aSJaganath Kanakkassery 	__u8  handle;
1773a73c046aSJaganath Kanakkassery 	bdaddr_t  bdaddr;
1774a73c046aSJaganath Kanakkassery } __packed;
1775a73c046aSJaganath Kanakkassery 
17764de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2	0x2060
17774de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 {
17784de0fc59SLuiz Augusto von Dentz 	__u8    status;
17794de0fc59SLuiz Augusto von Dentz 	__le16  acl_mtu;
17804de0fc59SLuiz Augusto von Dentz 	__u8    acl_max_pkt;
17814de0fc59SLuiz Augusto von Dentz 	__le16  iso_mtu;
17824de0fc59SLuiz Augusto von Dentz 	__u8    iso_max_pkt;
17834de0fc59SLuiz Augusto von Dentz } __packed;
17844de0fc59SLuiz Augusto von Dentz 
17854de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC		0x2061
17864de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync {
17874de0fc59SLuiz Augusto von Dentz 	__le16  handle;
17884de0fc59SLuiz Augusto von Dentz } __packed;
17894de0fc59SLuiz Augusto von Dentz 
17904de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync {
17914de0fc59SLuiz Augusto von Dentz 	__u8    status;
17924de0fc59SLuiz Augusto von Dentz 	__le16  handle;
17934de0fc59SLuiz Augusto von Dentz 	__le16  seq;
17944de0fc59SLuiz Augusto von Dentz 	__le32  imestamp;
17954de0fc59SLuiz Augusto von Dentz 	__u8    offset[3];
17964de0fc59SLuiz Augusto von Dentz } __packed;
17974de0fc59SLuiz Augusto von Dentz 
17984de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS		0x2062
17994de0fc59SLuiz Augusto von Dentz struct hci_cis_params {
18004de0fc59SLuiz Augusto von Dentz 	__u8    cis_id;
18014de0fc59SLuiz Augusto von Dentz 	__le16  m_sdu;
18024de0fc59SLuiz Augusto von Dentz 	__le16  s_sdu;
18034de0fc59SLuiz Augusto von Dentz 	__u8    m_phy;
18044de0fc59SLuiz Augusto von Dentz 	__u8    s_phy;
18054de0fc59SLuiz Augusto von Dentz 	__u8    m_rtn;
18064de0fc59SLuiz Augusto von Dentz 	__u8    s_rtn;
18074de0fc59SLuiz Augusto von Dentz } __packed;
18084de0fc59SLuiz Augusto von Dentz 
18094de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params {
18104de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
18114de0fc59SLuiz Augusto von Dentz 	__u8    m_interval[3];
18124de0fc59SLuiz Augusto von Dentz 	__u8    s_interval[3];
18134de0fc59SLuiz Augusto von Dentz 	__u8    sca;
18144de0fc59SLuiz Augusto von Dentz 	__u8    packing;
18154de0fc59SLuiz Augusto von Dentz 	__u8    framing;
18164de0fc59SLuiz Augusto von Dentz 	__le16  m_latency;
18174de0fc59SLuiz Augusto von Dentz 	__le16  s_latency;
18184de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
1819a7e45454SGustavo A. R. Silva 	struct hci_cis_params cis[];
18204de0fc59SLuiz Augusto von Dentz } __packed;
18214de0fc59SLuiz Augusto von Dentz 
18224de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params {
18234de0fc59SLuiz Augusto von Dentz 	__u8    status;
18244de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
18254de0fc59SLuiz Augusto von Dentz 	__u8    num_handles;
1826a7e45454SGustavo A. R. Silva 	__le16  handle[];
18274de0fc59SLuiz Augusto von Dentz } __packed;
18284de0fc59SLuiz Augusto von Dentz 
18294de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS			0x2064
18304de0fc59SLuiz Augusto von Dentz struct hci_cis {
18314de0fc59SLuiz Augusto von Dentz 	__le16  cis_handle;
18324de0fc59SLuiz Augusto von Dentz 	__le16  acl_handle;
18334de0fc59SLuiz Augusto von Dentz } __packed;
18344de0fc59SLuiz Augusto von Dentz 
18354de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis {
18364de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
1837a7e45454SGustavo A. R. Silva 	struct hci_cis cis[];
18384de0fc59SLuiz Augusto von Dentz } __packed;
18394de0fc59SLuiz Augusto von Dentz 
18404de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG			0x2065
18414de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig {
18424de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
18434de0fc59SLuiz Augusto von Dentz } __packed;
18444de0fc59SLuiz Augusto von Dentz 
18454de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS			0x2066
18464de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis {
18474de0fc59SLuiz Augusto von Dentz 	__le16  handle;
18484de0fc59SLuiz Augusto von Dentz } __packed;
18494de0fc59SLuiz Augusto von Dentz 
18504de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS			0x2067
18514de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis {
18524de0fc59SLuiz Augusto von Dentz 	__le16  handle;
18534de0fc59SLuiz Augusto von Dentz 	__u8    reason;
18544de0fc59SLuiz Augusto von Dentz } __packed;
18554de0fc59SLuiz Augusto von Dentz 
18561da177e4SLinus Torvalds /* ---- HCI Events ---- */
18571da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
18581da177e4SLinus Torvalds 
18591da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
18601da177e4SLinus Torvalds struct inquiry_info {
18611da177e4SLinus Torvalds 	bdaddr_t bdaddr;
18621da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
18631da177e4SLinus Torvalds 	__u8     pscan_period_mode;
18641da177e4SLinus Torvalds 	__u8     pscan_mode;
18651da177e4SLinus Torvalds 	__u8     dev_class[3];
18661ebb9252SMarcel Holtmann 	__le16   clock_offset;
186766c853ccSGustavo F. Padovan } __packed;
18681da177e4SLinus Torvalds 
18691da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
18701da177e4SLinus Torvalds struct hci_ev_conn_complete {
18711da177e4SLinus Torvalds 	__u8     status;
18721ebb9252SMarcel Holtmann 	__le16   handle;
18731da177e4SLinus Torvalds 	bdaddr_t bdaddr;
18741da177e4SLinus Torvalds 	__u8     link_type;
18751da177e4SLinus Torvalds 	__u8     encr_mode;
187666c853ccSGustavo F. Padovan } __packed;
18771da177e4SLinus Torvalds 
18781da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
18791da177e4SLinus Torvalds struct hci_ev_conn_request {
18801da177e4SLinus Torvalds 	bdaddr_t bdaddr;
18811da177e4SLinus Torvalds 	__u8     dev_class[3];
18821da177e4SLinus Torvalds 	__u8     link_type;
188366c853ccSGustavo F. Padovan } __packed;
18841da177e4SLinus Torvalds 
18851da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
18861da177e4SLinus Torvalds struct hci_ev_disconn_complete {
18871da177e4SLinus Torvalds 	__u8     status;
18881ebb9252SMarcel Holtmann 	__le16   handle;
18891da177e4SLinus Torvalds 	__u8     reason;
189066c853ccSGustavo F. Padovan } __packed;
18911da177e4SLinus Torvalds 
18921da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
18931da177e4SLinus Torvalds struct hci_ev_auth_complete {
18941da177e4SLinus Torvalds 	__u8     status;
18951ebb9252SMarcel Holtmann 	__le16   handle;
189666c853ccSGustavo F. Padovan } __packed;
18971da177e4SLinus Torvalds 
1898a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1899a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1900a9de9248SMarcel Holtmann 	__u8     status;
1901a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
19021f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
190366c853ccSGustavo F. Padovan } __packed;
1904a9de9248SMarcel Holtmann 
19051da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
19061da177e4SLinus Torvalds struct hci_ev_encrypt_change {
19071da177e4SLinus Torvalds 	__u8     status;
19081ebb9252SMarcel Holtmann 	__le16   handle;
19091da177e4SLinus Torvalds 	__u8     encrypt;
191066c853ccSGustavo F. Padovan } __packed;
19111da177e4SLinus Torvalds 
1912a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1913a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
19141da177e4SLinus Torvalds 	__u8     status;
19151ebb9252SMarcel Holtmann 	__le16   handle;
191666c853ccSGustavo F. Padovan } __packed;
19171da177e4SLinus Torvalds 
1918a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1919a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1920a9de9248SMarcel Holtmann 	__u8     status;
1921a9de9248SMarcel Holtmann 	__le16   handle;
1922a9de9248SMarcel Holtmann 	__u8     features[8];
192366c853ccSGustavo F. Padovan } __packed;
1924a9de9248SMarcel Holtmann 
1925a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1926a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1927a9de9248SMarcel Holtmann 	__u8     status;
1928a9de9248SMarcel Holtmann 	__le16   handle;
1929a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1930a9de9248SMarcel Holtmann 	__le16   manufacturer;
1931a9de9248SMarcel Holtmann 	__le16   lmp_subver;
193266c853ccSGustavo F. Padovan } __packed;
1933a9de9248SMarcel Holtmann 
1934a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
19351da177e4SLinus Torvalds struct hci_qos {
19361da177e4SLinus Torvalds 	__u8     service_type;
19371da177e4SLinus Torvalds 	__u32    token_rate;
19381da177e4SLinus Torvalds 	__u32    peak_bandwidth;
19391da177e4SLinus Torvalds 	__u32    latency;
19401da177e4SLinus Torvalds 	__u32    delay_variation;
194166c853ccSGustavo F. Padovan } __packed;
19421da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
19431da177e4SLinus Torvalds 	__u8     status;
19441ebb9252SMarcel Holtmann 	__le16   handle;
19451da177e4SLinus Torvalds 	struct   hci_qos qos;
194666c853ccSGustavo F. Padovan } __packed;
19471da177e4SLinus Torvalds 
1948a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
19491da177e4SLinus Torvalds struct hci_ev_cmd_complete {
19501da177e4SLinus Torvalds 	__u8     ncmd;
19511ebb9252SMarcel Holtmann 	__le16   opcode;
195266c853ccSGustavo F. Padovan } __packed;
19531da177e4SLinus Torvalds 
1954a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
19551da177e4SLinus Torvalds struct hci_ev_cmd_status {
19561da177e4SLinus Torvalds 	__u8     status;
19571da177e4SLinus Torvalds 	__u8     ncmd;
19581ebb9252SMarcel Holtmann 	__le16   opcode;
195966c853ccSGustavo F. Padovan } __packed;
19601da177e4SLinus Torvalds 
196124dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
196224dfa343SMarcel Holtmann struct hci_ev_hardware_error {
196324dfa343SMarcel Holtmann 	__u8     code;
196424dfa343SMarcel Holtmann } __packed;
196524dfa343SMarcel Holtmann 
19661da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
19671da177e4SLinus Torvalds struct hci_ev_role_change {
19681da177e4SLinus Torvalds 	__u8     status;
19691da177e4SLinus Torvalds 	bdaddr_t bdaddr;
19701da177e4SLinus Torvalds 	__u8     role;
197166c853ccSGustavo F. Padovan } __packed;
19721da177e4SLinus Torvalds 
1973a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1974613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1975613a1c0cSAndrei Emeltchenko 	__le16   handle;
1976613a1c0cSAndrei Emeltchenko 	__le16   count;
1977613a1c0cSAndrei Emeltchenko } __packed;
1978613a1c0cSAndrei Emeltchenko 
1979a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1980a9de9248SMarcel Holtmann 	__u8     num_hndl;
1981a7e45454SGustavo A. R. Silva 	struct hci_comp_pkts_info handles[];
198266c853ccSGustavo F. Padovan } __packed;
1983a9de9248SMarcel Holtmann 
19841da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
19851da177e4SLinus Torvalds struct hci_ev_mode_change {
19861da177e4SLinus Torvalds 	__u8     status;
19871ebb9252SMarcel Holtmann 	__le16   handle;
19881da177e4SLinus Torvalds 	__u8     mode;
19891ebb9252SMarcel Holtmann 	__le16   interval;
199066c853ccSGustavo F. Padovan } __packed;
19911da177e4SLinus Torvalds 
19921da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
19931da177e4SLinus Torvalds struct hci_ev_pin_code_req {
19941da177e4SLinus Torvalds 	bdaddr_t bdaddr;
199566c853ccSGustavo F. Padovan } __packed;
19961da177e4SLinus Torvalds 
19971da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
19981da177e4SLinus Torvalds struct hci_ev_link_key_req {
19991da177e4SLinus Torvalds 	bdaddr_t bdaddr;
200066c853ccSGustavo F. Padovan } __packed;
20011da177e4SLinus Torvalds 
20021da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
20031da177e4SLinus Torvalds struct hci_ev_link_key_notify {
20041da177e4SLinus Torvalds 	bdaddr_t bdaddr;
20059b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
20061da177e4SLinus Torvalds 	__u8     key_type;
200766c853ccSGustavo F. Padovan } __packed;
20081da177e4SLinus Torvalds 
2009a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
20101da177e4SLinus Torvalds struct hci_ev_clock_offset {
20111da177e4SLinus Torvalds 	__u8     status;
20121ebb9252SMarcel Holtmann 	__le16   handle;
20131ebb9252SMarcel Holtmann 	__le16   clock_offset;
201466c853ccSGustavo F. Padovan } __packed;
20151da177e4SLinus Torvalds 
2016a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
2017a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
2018a8746417SMarcel Holtmann 	__u8     status;
2019a8746417SMarcel Holtmann 	__le16   handle;
2020a8746417SMarcel Holtmann 	__le16   pkt_type;
202166c853ccSGustavo F. Padovan } __packed;
2022a8746417SMarcel Holtmann 
202385a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
202485a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
202585a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
202685a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
202766c853ccSGustavo F. Padovan } __packed;
202885a1e930SMarcel Holtmann 
2029a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
2030a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
2031a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2032a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2033a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2034a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2035a9de9248SMarcel Holtmann 	__le16   clock_offset;
2036a9de9248SMarcel Holtmann 	__s8     rssi;
203766c853ccSGustavo F. Padovan } __packed;
2038a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
2039a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2040a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2041a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2042a9de9248SMarcel Holtmann 	__u8     pscan_mode;
2043a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2044a9de9248SMarcel Holtmann 	__le16   clock_offset;
2045a9de9248SMarcel Holtmann 	__s8     rssi;
204666c853ccSGustavo F. Padovan } __packed;
2047a9de9248SMarcel Holtmann 
2048a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
2049a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
2050a9de9248SMarcel Holtmann 	__u8     status;
2051a9de9248SMarcel Holtmann 	__le16   handle;
2052a9de9248SMarcel Holtmann 	__u8     page;
2053a9de9248SMarcel Holtmann 	__u8     max_page;
2054a9de9248SMarcel Holtmann 	__u8     features[8];
205566c853ccSGustavo F. Padovan } __packed;
2056a9de9248SMarcel Holtmann 
2057a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
2058a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
2059a9de9248SMarcel Holtmann 	__u8     status;
2060a9de9248SMarcel Holtmann 	__le16   handle;
2061a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2062a9de9248SMarcel Holtmann 	__u8     link_type;
2063a9de9248SMarcel Holtmann 	__u8     tx_interval;
2064a9de9248SMarcel Holtmann 	__u8     retrans_window;
2065a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2066a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
2067a9de9248SMarcel Holtmann 	__u8     air_mode;
206866c853ccSGustavo F. Padovan } __packed;
2069a9de9248SMarcel Holtmann 
2070a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
2071a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
2072a9de9248SMarcel Holtmann 	__u8     status;
2073a9de9248SMarcel Holtmann 	__le16   handle;
2074a9de9248SMarcel Holtmann 	__u8     tx_interval;
2075a9de9248SMarcel Holtmann 	__u8     retrans_window;
2076a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2077a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
207866c853ccSGustavo F. Padovan } __packed;
2079a9de9248SMarcel Holtmann 
2080a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
208104837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
208204837f64SMarcel Holtmann 	__u8     status;
208304837f64SMarcel Holtmann 	__le16   handle;
208404837f64SMarcel Holtmann 	__le16   max_tx_latency;
208504837f64SMarcel Holtmann 	__le16   max_rx_latency;
208604837f64SMarcel Holtmann 	__le16   max_remote_timeout;
208704837f64SMarcel Holtmann 	__le16   max_local_timeout;
208866c853ccSGustavo F. Padovan } __packed;
208904837f64SMarcel Holtmann 
2090a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
2091a9de9248SMarcel Holtmann struct extended_inquiry_info {
2092a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2093a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2094a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2095a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2096a9de9248SMarcel Holtmann 	__le16   clock_offset;
2097a9de9248SMarcel Holtmann 	__s8     rssi;
2098a9de9248SMarcel Holtmann 	__u8     data[240];
209966c853ccSGustavo F. Padovan } __packed;
2100a9de9248SMarcel Holtmann 
21011c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
21021c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
21031c2e0041SJohan Hedberg 	__u8	status;
21041c2e0041SJohan Hedberg 	__le16	handle;
21051c2e0041SJohan Hedberg } __packed;
21061c2e0041SJohan Hedberg 
21070493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
21080493684eSMarcel Holtmann struct hci_ev_io_capa_request {
21090493684eSMarcel Holtmann 	bdaddr_t bdaddr;
211066c853ccSGustavo F. Padovan } __packed;
21110493684eSMarcel Holtmann 
211203b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
211303b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
211403b555e1SJohan Hedberg 	bdaddr_t bdaddr;
211503b555e1SJohan Hedberg 	__u8     capability;
211603b555e1SJohan Hedberg 	__u8     oob_data;
211703b555e1SJohan Hedberg 	__u8     authentication;
211803b555e1SJohan Hedberg } __packed;
211903b555e1SJohan Hedberg 
2120a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
2121a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
2122a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
2123a5c29683SJohan Hedberg 	__le32		passkey;
2124a5c29683SJohan Hedberg } __packed;
2125a5c29683SJohan Hedberg 
21269ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
21279ad4019aSBrian Gix struct hci_ev_user_passkey_req {
21289ad4019aSBrian Gix 	bdaddr_t	bdaddr;
21299ad4019aSBrian Gix } __packed;
21309ad4019aSBrian Gix 
21312763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
21322763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
21332763eda6SSzymon Janc 	bdaddr_t bdaddr;
21342763eda6SSzymon Janc } __packed;
21352763eda6SSzymon Janc 
21360493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
21370493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
21380493684eSMarcel Holtmann 	__u8     status;
21390493684eSMarcel Holtmann 	bdaddr_t bdaddr;
214066c853ccSGustavo F. Padovan } __packed;
21410493684eSMarcel Holtmann 
214292a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
214392a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
214492a25256SJohan Hedberg 	bdaddr_t	bdaddr;
214592a25256SJohan Hedberg 	__le32		passkey;
214692a25256SJohan Hedberg } __packed;
214792a25256SJohan Hedberg 
214892a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
214992a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
215092a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
215192a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
215292a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
215392a25256SJohan Hedberg 
215492a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
215592a25256SJohan Hedberg struct hci_ev_keypress_notify {
215692a25256SJohan Hedberg 	bdaddr_t	bdaddr;
215792a25256SJohan Hedberg 	__u8		type;
215892a25256SJohan Hedberg } __packed;
215992a25256SJohan Hedberg 
216041a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
216141a96212SMarcel Holtmann struct hci_ev_remote_host_features {
216241a96212SMarcel Holtmann 	bdaddr_t bdaddr;
216341a96212SMarcel Holtmann 	__u8     features[8];
216466c853ccSGustavo F. Padovan } __packed;
216541a96212SMarcel Holtmann 
216663185f64SVille Tervo #define HCI_EV_LE_META			0x3e
216763185f64SVille Tervo struct hci_ev_le_meta {
216863185f64SVille Tervo 	__u8     subevent;
216963185f64SVille Tervo } __packed;
217063185f64SVille Tervo 
2171523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
2172523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
2173523e93cdSAndrei Emeltchenko 	__u8     status;
2174523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2175523e93cdSAndrei Emeltchenko } __packed;
2176523e93cdSAndrei Emeltchenko 
2177523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
2178523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
2179523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2180523e93cdSAndrei Emeltchenko } __packed;
2181523e93cdSAndrei Emeltchenko 
2182523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
2183523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2184523e93cdSAndrei Emeltchenko 	__u8     status;
2185523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2186523e93cdSAndrei Emeltchenko 	__u8     reason;
2187523e93cdSAndrei Emeltchenko } __packed;
2188523e93cdSAndrei Emeltchenko 
2189523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
2190523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2191523e93cdSAndrei Emeltchenko 	__u8     status;
2192523e93cdSAndrei Emeltchenko 	__le16   handle;
2193523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2194523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
2195523e93cdSAndrei Emeltchenko } __packed;
2196523e93cdSAndrei Emeltchenko 
2197523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
2198523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2199523e93cdSAndrei Emeltchenko 	__u8     status;
2200523e93cdSAndrei Emeltchenko 	__le16   handle;
2201523e93cdSAndrei Emeltchenko 	__u8     reason;
2202523e93cdSAndrei Emeltchenko } __packed;
2203523e93cdSAndrei Emeltchenko 
220425e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
220525e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
220625e89e99SAndrei Emeltchenko 	__le16   handle;
220725e89e99SAndrei Emeltchenko 	__le16   pkts;
220825e89e99SAndrei Emeltchenko 	__le16   blocks;
220925e89e99SAndrei Emeltchenko } __packed;
221025e89e99SAndrei Emeltchenko 
221125e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
221225e89e99SAndrei Emeltchenko 	__le16   num_blocks;
221325e89e99SAndrei Emeltchenko 	__u8     num_hndl;
2214a7e45454SGustavo A. R. Silva 	struct hci_comp_blocks_info handles[];
221525e89e99SAndrei Emeltchenko } __packed;
221625e89e99SAndrei Emeltchenko 
22172b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
22182b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
22192b359445SDoHyun Pyun 	__u8	status;
22202b359445SDoHyun Pyun } __packed;
22212b359445SDoHyun Pyun 
22222ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
22232ed01805SDoHyun Pyun 
222463185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
222563185f64SVille Tervo struct hci_ev_le_conn_complete {
222663185f64SVille Tervo 	__u8     status;
222763185f64SVille Tervo 	__le16   handle;
222863185f64SVille Tervo 	__u8     role;
222963185f64SVille Tervo 	__u8     bdaddr_type;
223063185f64SVille Tervo 	bdaddr_t bdaddr;
223163185f64SVille Tervo 	__le16   interval;
223263185f64SVille Tervo 	__le16   latency;
223363185f64SVille Tervo 	__le16   supervision_timeout;
223463185f64SVille Tervo 	__u8     clk_accurancy;
223563185f64SVille Tervo } __packed;
223663185f64SVille Tervo 
22372331fd46SMarcel Holtmann /* Advertising report event types */
22382331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
22392331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
22402331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
22412331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
22422331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
2243c215e939SJaganath Kanakkassery #define LE_ADV_INVALID		0x05
2244c215e939SJaganath Kanakkassery 
2245c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2246c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND		0x0013
2247c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 	0x0015
2248c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND		0x0012
2249c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND		0x0010
2250c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV		0x001b
2251c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN	0x001a
22522331fd46SMarcel Holtmann 
2253b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2254b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND		0x0000
2255b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND		0x0001
2256b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND		0x0002
2257b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND		0x0004
2258b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP		0x0008
2259b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU		0x0010
2260b2cc9761SJaganath Kanakkassery 
22612331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC	0x00
22622331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM	0x01
22632331fd46SMarcel Holtmann 
22642331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
22652331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
22662331fd46SMarcel Holtmann 	__u8	 evt_type;
22672331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
22682331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
22692331fd46SMarcel Holtmann 	__u8	 length;
2270a7e45454SGustavo A. R. Silva 	__u8	 data[];
22712331fd46SMarcel Holtmann } __packed;
22722331fd46SMarcel Holtmann 
22731855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
22741855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
22751855d92dSMarcel Holtmann 	__u8     status;
22761855d92dSMarcel Holtmann 	__le16   handle;
22771855d92dSMarcel Holtmann 	__le16   interval;
22781855d92dSMarcel Holtmann 	__le16   latency;
22791855d92dSMarcel Holtmann 	__le16   supervision_timeout;
22801855d92dSMarcel Holtmann } __packed;
22811855d92dSMarcel Holtmann 
22820fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
22830fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
22840fe29fd1SMarcel Holtmann 	__u8     status;
22850fe29fd1SMarcel Holtmann 	__le16   handle;
22860fe29fd1SMarcel Holtmann 	__u8     features[8];
22870fe29fd1SMarcel Holtmann } __packed;
22880fe29fd1SMarcel Holtmann 
2289a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
2290a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2291a7a595f6SVinicius Costa Gomes 	__le16	handle;
2292fe39c7b2SMarcel Holtmann 	__le64	rand;
2293a7a595f6SVinicius Costa Gomes 	__le16	ediv;
2294a7a595f6SVinicius Costa Gomes } __packed;
2295a7a595f6SVinicius Costa Gomes 
22968e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
22978e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
22988e75b46aSAndre Guedes 	__le16 handle;
22998e75b46aSAndre Guedes 	__le16 interval_min;
23008e75b46aSAndre Guedes 	__le16 interval_max;
23018e75b46aSAndre Guedes 	__le16 latency;
23028e75b46aSAndre Guedes 	__le16 timeout;
23038e75b46aSAndre Guedes } __packed;
23048e75b46aSAndre Guedes 
230594a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
230694a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
230794a3bd02SMarcel Holtmann 	__le16	handle;
230894a3bd02SMarcel Holtmann 	__le16	tx_len;
230994a3bd02SMarcel Holtmann 	__le16	tx_time;
231094a3bd02SMarcel Holtmann 	__le16	rx_len;
231194a3bd02SMarcel Holtmann 	__le16	rx_time;
231294a3bd02SMarcel Holtmann } __packed;
231394a3bd02SMarcel Holtmann 
231432c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
231532c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
231632c9d43fSMarcel Holtmann 	__u8	 evt_type;
231732c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
231832c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
231932c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
232032c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
232132c9d43fSMarcel Holtmann 	__s8	 rssi;
232232c9d43fSMarcel Holtmann } __packed;
232332c9d43fSMarcel Holtmann 
23241efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE	0x0c
23251efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete {
23261efd927dSLuiz Augusto von Dentz 	__u8  status;
23274de0fc59SLuiz Augusto von Dentz 	__le16 handle;
23281efd927dSLuiz Augusto von Dentz 	__u8  tx_phy;
23291efd927dSLuiz Augusto von Dentz 	__u8  rx_phy;
23301efd927dSLuiz Augusto von Dentz } __packed;
23311efd927dSLuiz Augusto von Dentz 
2332c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT    0x0d
2333c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report {
2334c215e939SJaganath Kanakkassery 	__le16 	 evt_type;
2335c215e939SJaganath Kanakkassery 	__u8	 bdaddr_type;
2336c215e939SJaganath Kanakkassery 	bdaddr_t bdaddr;
2337c215e939SJaganath Kanakkassery 	__u8	 primary_phy;
2338c215e939SJaganath Kanakkassery 	__u8	 secondary_phy;
2339c215e939SJaganath Kanakkassery 	__u8	 sid;
2340c215e939SJaganath Kanakkassery 	__u8	 tx_power;
2341c215e939SJaganath Kanakkassery 	__s8	 rssi;
2342c215e939SJaganath Kanakkassery 	__le16 	 interval;
2343c215e939SJaganath Kanakkassery 	__u8  	 direct_addr_type;
2344c215e939SJaganath Kanakkassery 	bdaddr_t direct_addr;
2345c215e939SJaganath Kanakkassery 	__u8  	 length;
2346a7e45454SGustavo A. R. Silva 	__u8	 data[];
2347c215e939SJaganath Kanakkassery } __packed;
2348c215e939SJaganath Kanakkassery 
23494d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE    0x0a
23504d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
23514d94f95dSJaganath Kanakkassery 	__u8      status;
23524d94f95dSJaganath Kanakkassery 	__le16    handle;
23534d94f95dSJaganath Kanakkassery 	__u8      role;
23544d94f95dSJaganath Kanakkassery 	__u8      bdaddr_type;
23554d94f95dSJaganath Kanakkassery 	bdaddr_t  bdaddr;
23564d94f95dSJaganath Kanakkassery 	bdaddr_t  local_rpa;
23574d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_rpa;
23584d94f95dSJaganath Kanakkassery 	__le16    interval;
23594d94f95dSJaganath Kanakkassery 	__le16    latency;
23604d94f95dSJaganath Kanakkassery 	__le16    supervision_timeout;
23614d94f95dSJaganath Kanakkassery 	__u8      clk_accurancy;
23624d94f95dSJaganath Kanakkassery } __packed;
23634d94f95dSJaganath Kanakkassery 
2364acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM	0x12
2365acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2366acf0aeaeSJaganath Kanakkassery 	__u8	status;
2367acf0aeaeSJaganath Kanakkassery 	__u8	handle;
2368acf0aeaeSJaganath Kanakkassery 	__le16	conn_handle;
2369acf0aeaeSJaganath Kanakkassery 	__u8	num_evts;
2370acf0aeaeSJaganath Kanakkassery } __packed;
2371acf0aeaeSJaganath Kanakkassery 
23724de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED	0x19
23734de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established {
23744de0fc59SLuiz Augusto von Dentz 	__u8  status;
23754de0fc59SLuiz Augusto von Dentz 	__le16 handle;
23764de0fc59SLuiz Augusto von Dentz 	__u8  cig_sync_delay[3];
23774de0fc59SLuiz Augusto von Dentz 	__u8  cis_sync_delay[3];
23784de0fc59SLuiz Augusto von Dentz 	__u8  m_latency[3];
23794de0fc59SLuiz Augusto von Dentz 	__u8  s_latency[3];
23804de0fc59SLuiz Augusto von Dentz 	__u8  m_phy;
23814de0fc59SLuiz Augusto von Dentz 	__u8  s_phy;
23824de0fc59SLuiz Augusto von Dentz 	__u8  nse;
23834de0fc59SLuiz Augusto von Dentz 	__u8  m_bn;
23844de0fc59SLuiz Augusto von Dentz 	__u8  s_bn;
23854de0fc59SLuiz Augusto von Dentz 	__u8  m_ft;
23864de0fc59SLuiz Augusto von Dentz 	__u8  s_ft;
23874de0fc59SLuiz Augusto von Dentz 	__le16 m_mtu;
23884de0fc59SLuiz Augusto von Dentz 	__le16 s_mtu;
23894de0fc59SLuiz Augusto von Dentz 	__le16 interval;
23904de0fc59SLuiz Augusto von Dentz } __packed;
23914de0fc59SLuiz Augusto von Dentz 
23924de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ		0x1a
23934de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req {
23944de0fc59SLuiz Augusto von Dentz 	__le16 acl_handle;
23954de0fc59SLuiz Augusto von Dentz 	__le16 cis_handle;
23964de0fc59SLuiz Augusto von Dentz 	__u8  cig_id;
23974de0fc59SLuiz Augusto von Dentz 	__u8  cis_id;
23984de0fc59SLuiz Augusto von Dentz } __packed;
23994de0fc59SLuiz Augusto von Dentz 
2400e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR			0xff
2401e4cc5a18SMarcel Holtmann 
24021da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2403a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
24041da177e4SLinus Torvalds struct hci_ev_stack_internal {
24051da177e4SLinus Torvalds 	__u16    type;
2406a7e45454SGustavo A. R. Silva 	__u8     data[];
240766c853ccSGustavo F. Padovan } __packed;
24081da177e4SLinus Torvalds 
24091da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
24101da177e4SLinus Torvalds struct hci_ev_si_device {
24111da177e4SLinus Torvalds 	__u16    event;
24121da177e4SLinus Torvalds 	__u16    dev_id;
241366c853ccSGustavo F. Padovan } __packed;
24141da177e4SLinus Torvalds 
24151da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
24161da177e4SLinus Torvalds struct hci_ev_si_security {
24171da177e4SLinus Torvalds 	__u16    event;
24181da177e4SLinus Torvalds 	__u16    proto;
24191da177e4SLinus Torvalds 	__u16    subproto;
24201da177e4SLinus Torvalds 	__u8     incoming;
242166c853ccSGustavo F. Padovan } __packed;
24221da177e4SLinus Torvalds 
24231da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
24241da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
24251da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
24261da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
24271da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
24284de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE     4
24291da177e4SLinus Torvalds 
24301da177e4SLinus Torvalds struct hci_command_hdr {
24311ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
24321da177e4SLinus Torvalds 	__u8	plen;
243366c853ccSGustavo F. Padovan } __packed;
24341da177e4SLinus Torvalds 
24351da177e4SLinus Torvalds struct hci_event_hdr {
24361da177e4SLinus Torvalds 	__u8	evt;
24371da177e4SLinus Torvalds 	__u8	plen;
243866c853ccSGustavo F. Padovan } __packed;
24391da177e4SLinus Torvalds 
24401da177e4SLinus Torvalds struct hci_acl_hdr {
24411ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
24421ebb9252SMarcel Holtmann 	__le16	dlen;
244366c853ccSGustavo F. Padovan } __packed;
24441da177e4SLinus Torvalds 
24451da177e4SLinus Torvalds struct hci_sco_hdr {
24461ebb9252SMarcel Holtmann 	__le16	handle;
24471da177e4SLinus Torvalds 	__u8	dlen;
244866c853ccSGustavo F. Padovan } __packed;
24491da177e4SLinus Torvalds 
24504de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr {
24514de0fc59SLuiz Augusto von Dentz 	__le16	handle;
24524de0fc59SLuiz Augusto von Dentz 	__le16	dlen;
2453a7e45454SGustavo A. R. Silva 	__u8	data[];
24544de0fc59SLuiz Augusto von Dentz } __packed;
24554de0fc59SLuiz Augusto von Dentz 
24564de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */
24574de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID	0x00
24584de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID	0x01
24594de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP	0x02
24604de0fc59SLuiz Augusto von Dentz 
24614de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE	4
24624de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr {
24634de0fc59SLuiz Augusto von Dentz 	__le16	sn;
24644de0fc59SLuiz Augusto von Dentz 	__le16	slen;
24654de0fc59SLuiz Augusto von Dentz };
24664de0fc59SLuiz Augusto von Dentz 
24674de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8
24684de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr {
24694de0fc59SLuiz Augusto von Dentz 	__le32	ts;
24704de0fc59SLuiz Augusto von Dentz 	__le16	sn;
24714de0fc59SLuiz Augusto von Dentz 	__le16	slen;
24724de0fc59SLuiz Augusto von Dentz };
24734de0fc59SLuiz Augusto von Dentz 
24742a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
24752a123b86SArnaldo Carvalho de Melo {
24762a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
24772a123b86SArnaldo Carvalho de Melo }
24782a123b86SArnaldo Carvalho de Melo 
24792a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
24802a123b86SArnaldo Carvalho de Melo {
24812a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
24822a123b86SArnaldo Carvalho de Melo }
24832a123b86SArnaldo Carvalho de Melo 
24842a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
24852a123b86SArnaldo Carvalho de Melo {
24862a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
24872a123b86SArnaldo Carvalho de Melo }
24882a123b86SArnaldo Carvalho de Melo 
24891da177e4SLinus Torvalds /* Command opcode pack/unpack */
2490c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
24911da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
24921da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
24931da177e4SLinus Torvalds 
24941da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2495c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
24961da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
24971da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
24981da177e4SLinus Torvalds 
24994de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */
25004de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f)		(f & 0x0003)
25014de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f)		((f >> 2) & 0x0001)
25024de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts)	((pb & 0x03) | ((ts & 0x01) << 2))
25034de0fc59SLuiz Augusto von Dentz 
25044de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */
25054de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f)	((__u16) ((h) | ((f) << 14)))
25064de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h)		((h) & 0x3fff)
25074de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h)		((h) >> 14)
25084de0fc59SLuiz Augusto von Dentz 
25091da177e4SLinus Torvalds #endif /* __HCI_H */
2510