xref: /openbmc/linux/include/net/bluetooth/hci.h (revision eca0ae4aea66914515e5e3098ea051b518ee5316)
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 
396397729bSArchie Pusaka #define HCI_MAX_CPB_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,
22122091585SAlain Michaud 
22222091585SAlain Michaud 	/* When this quirk is set, the controller has validated that
22322091585SAlain Michaud 	 * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are
22422091585SAlain Michaud 	 * valid.  This mechanism is necessary as many controllers have
22522091585SAlain Michaud 	 * been seen has having trouble initiating a connectable
22622091585SAlain Michaud 	 * advertisement despite the state combination being reported as
22722091585SAlain Michaud 	 * supported.
22822091585SAlain Michaud 	 */
22922091585SAlain Michaud 	HCI_QUIRK_VALID_LE_STATES,
230cde1a8a9SIsmael Ferreras Morezuelas 
231219991e6SHans de Goede 	/*
232219991e6SHans de Goede 	 * When this quirk is set, then the hci_suspend_notifier is not
233219991e6SHans de Goede 	 * registered. This is intended for devices which drop completely
234219991e6SHans de Goede 	 * from the bus on system-suspend and which will show up as a new
235219991e6SHans de Goede 	 * HCI after resume.
236219991e6SHans de Goede 	 */
237219991e6SHans de Goede 	HCI_QUIRK_NO_SUSPEND_NOTIFIER,
238d2f8114fSAditya Garg 
239d2f8114fSAditya Garg 	/*
240d2f8114fSAditya Garg 	 * When this quirk is set, LE tx power is not queried on startup
241d2f8114fSAditya Garg 	 * and the min/max tx power values default to HCI_TX_POWER_INVALID.
242d2f8114fSAditya Garg 	 *
243d2f8114fSAditya Garg 	 * This quirk can be set before hci_register_dev is called or
244d2f8114fSAditya Garg 	 * during the hdev->setup vendor callback.
245d2f8114fSAditya Garg 	 */
246d2f8114fSAditya Garg 	HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
2470eaecfb2SIsmael Ferreras Morezuelas 
2480eaecfb2SIsmael Ferreras Morezuelas 	/* When this quirk is set, HCI_OP_SET_EVENT_FLT requests with
2490eaecfb2SIsmael Ferreras Morezuelas 	 * HCI_FLT_CLEAR_ALL are ignored and event filtering is
2500eaecfb2SIsmael Ferreras Morezuelas 	 * completely avoided. A subset of the CSR controller
2510eaecfb2SIsmael Ferreras Morezuelas 	 * clones struggle with this and instantly lock up.
2520eaecfb2SIsmael Ferreras Morezuelas 	 *
2530eaecfb2SIsmael Ferreras Morezuelas 	 * Note that devices using this must (separately) disable
2540eaecfb2SIsmael Ferreras Morezuelas 	 * runtime suspend, because event filtering takes place there.
2550eaecfb2SIsmael Ferreras Morezuelas 	 */
2560eaecfb2SIsmael Ferreras Morezuelas 	HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL,
25705abad85SLuiz Augusto von Dentz 
25805abad85SLuiz Augusto von Dentz 	/*
25905abad85SLuiz Augusto von Dentz 	 * When this quirk is set, disables the use of
26005abad85SLuiz Augusto von Dentz 	 * HCI_OP_ENHANCED_SETUP_SYNC_CONN command to setup SCO connections.
26105abad85SLuiz Augusto von Dentz 	 *
26205abad85SLuiz Augusto von Dentz 	 * This quirk can be set before hci_register_dev is called or
26305abad85SLuiz Augusto von Dentz 	 * during the hdev->setup vendor callback.
26405abad85SLuiz Augusto von Dentz 	 */
26505abad85SLuiz Augusto von Dentz 	HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN,
2661da177e4SLinus Torvalds };
2671da177e4SLinus Torvalds 
2681da177e4SLinus Torvalds /* HCI device flags */
2691da177e4SLinus Torvalds enum {
2701da177e4SLinus Torvalds 	HCI_UP,
2711da177e4SLinus Torvalds 	HCI_INIT,
2721da177e4SLinus Torvalds 	HCI_RUNNING,
2731da177e4SLinus Torvalds 
2741da177e4SLinus Torvalds 	HCI_PSCAN,
2751da177e4SLinus Torvalds 	HCI_ISCAN,
2761da177e4SLinus Torvalds 	HCI_AUTH,
2771da177e4SLinus Torvalds 	HCI_ENCRYPT,
2781da177e4SLinus Torvalds 	HCI_INQUIRY,
2791da177e4SLinus Torvalds 
2801da177e4SLinus Torvalds 	HCI_RAW,
281ab81cbf9SJohan Hedberg 
28210572132SGustavo F. Padovan 	HCI_RESET,
2831da177e4SLinus Torvalds };
2841da177e4SLinus Torvalds 
285f9207338SMarcel Holtmann /* HCI socket flags */
286f9207338SMarcel Holtmann enum {
28750ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
288f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
289f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
290ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
291321c6feeSMarcel Holtmann 	HCI_MGMT_EXT_INFO_EVENTS,
2925504c3a3SMarcel Holtmann 	HCI_MGMT_OPTION_EVENTS,
2935504c3a3SMarcel Holtmann 	HCI_MGMT_SETTING_EVENTS,
2945504c3a3SMarcel Holtmann 	HCI_MGMT_DEV_CLASS_EVENTS,
2955504c3a3SMarcel Holtmann 	HCI_MGMT_LOCAL_NAME_EVENTS,
29672000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
297a10c907cSMarcel Holtmann 	HCI_MGMT_EXP_FEATURE_EVENTS,
298f9207338SMarcel Holtmann };
299f9207338SMarcel Holtmann 
300d23264a8SAndre Guedes /*
301d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
302d23264a8SAndre Guedes  * states from the controller.
303d23264a8SAndre Guedes  */
304d23264a8SAndre Guedes enum {
305a8b2d5c2SJohan Hedberg 	HCI_SETUP,
306d603b76bSMarcel Holtmann 	HCI_CONFIG,
307a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
3085e130367SJohan Hedberg 	HCI_RFKILLED,
309a8b2d5c2SJohan Hedberg 	HCI_MGMT,
310b6ae8457SJohan Hedberg 	HCI_BONDABLE,
311a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
3120663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
3133769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
31494324962SJohan Hovold 	HCI_UNREGISTER,
3154a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
3160736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
317dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
31866c417c1SJohan Hedberg 	HCI_LE_ADV,
319*eca0ae4aSLuiz Augusto von Dentz 	HCI_LE_PER_ADV,
320d23264a8SAndre Guedes 	HCI_LE_SCAN,
32184bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
322e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
323134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
324863efaf2SJohan Hedberg 	HCI_PRIVACY,
32582a37adeSJohan Hedberg 	HCI_LIMITED_PRIVACY,
326d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
32741edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
3286d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
32906199cf8SJohan Hedberg 	HCI_LE_ENABLED,
330f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
331cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
3325e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
3335e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
3346acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
33547990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
33621693c15SAndre Guedes 	HCI_PERIODIC_INQ,
3371a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
33856f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
33981ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
34000bce3fbSAlain Michaud 	HCI_WIDEBAND_SPEECH_ENABLED,
341e5b0ad69SAbhishek Pandit-Subedi 	HCI_EVENT_FILTER_CONFIGURED,
342*eca0ae4aSLuiz Augusto von Dentz 	HCI_PA_SYNC,
343b7cb93e5SMarcel Holtmann 
344b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
3454b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
346b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
347b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
348aa12af77SAnkit Navik 	HCI_LL_RPA_RESOLUTION,
349cbbdfa6fSSathish Narasimman 	HCI_ENABLE_LL_PRIVACY,
350f80c5dadSJoão Paulo Rechi Vita 	HCI_CMD_PENDING,
351c2aa30dbSArchie Pusaka 	HCI_FORCE_NO_MITM,
352ae7d925bSJoseph Hwang 	HCI_QUALITY_REPORT,
353248733e8SKiran K 	HCI_OFFLOAD_CODECS_ENABLED,
35476d0685bSLuiz Augusto von Dentz 	HCI_LE_SIMULTANEOUS_ROLES,
355877afadaSSchspa Shi 	HCI_CMD_DRAIN_WORKQUEUE,
356b7cb93e5SMarcel Holtmann 
357eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
358d23264a8SAndre Guedes };
359d23264a8SAndre Guedes 
3601da177e4SLinus Torvalds /* HCI timeouts */
3615f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
3625f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
3635f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
364d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
365de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
3665f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
3679345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
368a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
3699489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
3701f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
3711da177e4SLinus Torvalds 
3725b7f9909SMarcel Holtmann /* HCI data types */
3731da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
3741da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
3751da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
3761da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
3774de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT		0x05
378e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
3791da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
3801da177e4SLinus Torvalds 
3815b7f9909SMarcel Holtmann /* HCI packet types */
3821da177e4SLinus Torvalds #define HCI_DM1		0x0008
3831da177e4SLinus Torvalds #define HCI_DM3		0x0400
3841da177e4SLinus Torvalds #define HCI_DM5		0x4000
3851da177e4SLinus Torvalds #define HCI_DH1		0x0010
3861da177e4SLinus Torvalds #define HCI_DH3		0x0800
3871da177e4SLinus Torvalds #define HCI_DH5		0x8000
3881da177e4SLinus Torvalds 
3895075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
3905075b972SJaganath Kanakkassery #define HCI_2DH1	0x0002
3915075b972SJaganath Kanakkassery #define HCI_3DH1	0x0004
3925075b972SJaganath Kanakkassery #define HCI_2DH3	0x0100
3935075b972SJaganath Kanakkassery #define HCI_3DH3	0x0200
3945075b972SJaganath Kanakkassery #define HCI_2DH5	0x1000
3955075b972SJaganath Kanakkassery #define HCI_3DH5	0x2000
3965075b972SJaganath Kanakkassery 
3971da177e4SLinus Torvalds #define HCI_HV1		0x0020
3981da177e4SLinus Torvalds #define HCI_HV2		0x0040
3991da177e4SLinus Torvalds #define HCI_HV3		0x0080
4001da177e4SLinus Torvalds 
4011da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
4021da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
4031da177e4SLinus Torvalds 
4045b7f9909SMarcel Holtmann /* eSCO packet types */
4055b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
4065b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
4075b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
4085b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
4095b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
4105b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
411efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
412efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
413efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
414efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
4155b7f9909SMarcel Holtmann 
416a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
417efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
418a8746417SMarcel Holtmann 
4191da177e4SLinus Torvalds /* ACL flags */
420e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
4211da177e4SLinus Torvalds #define ACL_CONT		0x01
4221da177e4SLinus Torvalds #define ACL_START		0x02
423d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
4241da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
4251da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
4261da177e4SLinus Torvalds 
4274de0fc59SLuiz Augusto von Dentz /* ISO PB flags */
4284de0fc59SLuiz Augusto von Dentz #define ISO_START		0x00
4294de0fc59SLuiz Augusto von Dentz #define ISO_CONT		0x01
4304de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE		0x02
4314de0fc59SLuiz Augusto von Dentz #define ISO_END			0x03
4324de0fc59SLuiz Augusto von Dentz 
4334de0fc59SLuiz Augusto von Dentz /* ISO TS flags */
4344de0fc59SLuiz Augusto von Dentz #define ISO_TS			0x01
4354de0fc59SLuiz Augusto von Dentz 
4361da177e4SLinus Torvalds /* Baseband links */
4371da177e4SLinus Torvalds #define SCO_LINK	0x00
4381da177e4SLinus Torvalds #define ACL_LINK	0x01
4395b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
440fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
441fcd89c09SVille Tervo #define LE_LINK		0x80
4423161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
4434de0fc59SLuiz Augusto von Dentz #define ISO_LINK	0x82
444845472e8SMarcel Holtmann #define INVALID_LINK	0xff
4451da177e4SLinus Torvalds 
4461da177e4SLinus Torvalds /* LMP features */
4471da177e4SLinus Torvalds #define LMP_3SLOT	0x01
4481da177e4SLinus Torvalds #define LMP_5SLOT	0x02
4491da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
4501da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
4511da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
4521da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
4531da177e4SLinus Torvalds #define LMP_HOLD	0x40
45404837f64SMarcel Holtmann #define LMP_SNIFF	0x80
4551da177e4SLinus Torvalds 
4561da177e4SLinus Torvalds #define LMP_PARK	0x01
4571da177e4SLinus Torvalds #define LMP_RSSI	0x02
4581da177e4SLinus Torvalds #define LMP_QUALITY	0x04
4591da177e4SLinus Torvalds #define LMP_SCO		0x08
4601da177e4SLinus Torvalds #define LMP_HV2		0x10
4611da177e4SLinus Torvalds #define LMP_HV3		0x20
4621da177e4SLinus Torvalds #define LMP_ULAW	0x40
4631da177e4SLinus Torvalds #define LMP_ALAW	0x80
4641da177e4SLinus Torvalds 
4651da177e4SLinus Torvalds #define LMP_CVSD	0x01
4661da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
4671da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
46807a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
4691da177e4SLinus Torvalds 
4705075b972SJaganath Kanakkassery #define LMP_EDR_2M		0x02
4715075b972SJaganath Kanakkassery #define LMP_EDR_3M		0x04
472d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
4735b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
4745b7f9909SMarcel Holtmann 
4755b7f9909SMarcel Holtmann #define LMP_EV4		0x01
4765b7f9909SMarcel Holtmann #define LMP_EV5		0x02
47769ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
478d5859e22SJohan Hedberg #define LMP_LE		0x40
4795075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT	0x80
4805b7f9909SMarcel Holtmann 
4815075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT	0x01
48204837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
483d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
484efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
485efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
486efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
48704837f64SMarcel Holtmann 
488d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
489e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
490769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
491766ae242SZijun Hu #define LMP_ERR_DATA_REPORTING 0x20
492e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
493769be974SMarcel Holtmann 
494d5859e22SJohan Hedberg #define LMP_LSTO	0x01
495d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
496971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
497d5859e22SJohan Hedberg 
498eead27daSAndre Guedes /* Extended LMP features */
4996397729bSArchie Pusaka #define LMP_CPB_CENTRAL		0x01
5006397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL	0x02
50153b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN		0x04
50253b834d2SMarcel Holtmann #define LMP_SYNC_SCAN		0x08
50353b834d2SMarcel Holtmann 
504d5991585SMarcel Holtmann #define LMP_SC		0x01
505d5991585SMarcel Holtmann #define LMP_PING	0x02
506d5991585SMarcel Holtmann 
50753b834d2SMarcel Holtmann /* Host features */
508cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
509eead27daSAndre Guedes #define LMP_HOST_LE		0x02
510cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
511d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
512eead27daSAndre Guedes 
513662bc2e6SAndre Guedes /* LE features */
5140da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
515662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
516ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES	0x08
517cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
51894a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
519ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY		0x40
5204b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
5215075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
5225075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
52355beec10SMarcel Holtmann #define HCI_LE_EXT_ADV			0x10
524*eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_PERIODIC_ADV		0x20
5259756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2		0x40
526ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL		0x10
527ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL		0x20
528*eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_ISO_BROADCASTER		0x40
529662bc2e6SAndre Guedes 
53004837f64SMarcel Holtmann /* Connection modes */
53104837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
53204837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
53304837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
53404837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
53504837f64SMarcel Holtmann 
5361da177e4SLinus Torvalds /* Link policies */
5371da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
5381da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
5391da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
5401da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
5411da177e4SLinus Torvalds 
54204837f64SMarcel Holtmann /* Link modes */
5431da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
5441da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
5451da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
5461da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
5471da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
5481da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
5491da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
5507b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
5511da177e4SLinus Torvalds 
55240be492fSMarcel Holtmann /* Authentication types */
55340be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
55440be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
55540be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
55640be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
55740be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
55840be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
55940be492fSMarcel Holtmann 
560a77b15a6SMikel Astiz /* I/O capabilities */
561a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
562a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
563a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
564a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
565a77b15a6SMikel Astiz 
566b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
567b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
568b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
569b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
570b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
57111015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
57211015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
573b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
57411015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
57511015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
576b6020ba0SWaldemar Rymarkiewicz 
5779f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
5788e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
5799f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
580160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING	0x06
5812acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
582cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
583d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
5849f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
585c86cc5a3SLuiz Augusto von Dentz #define HCI_ERROR_INVALID_PARAMETERS	0x12
5869f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
587cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
588cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
5899f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
5909f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
5914ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS	0x1e
5924ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED		0x1f
5933c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
5940f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST	0x44
5959f5a0d7bSAndrei Emeltchenko 
5962455a3eaSAndrei Emeltchenko /* Flow control modes */
5972455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
5982455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
5992455a3eaSAndrei Emeltchenko 
600bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
601bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
602a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
603bbaf444aSJohan Hedberg 
604ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
605ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
606ba165a90SJohan Hedberg 
60732748db0SJohan Hedberg /* Extended Inquiry Response field types */
60832748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
60932748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
61032748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
61132748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
61232748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
61332748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
61432748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
61532748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
61632748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
61732748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
6189ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
619d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
620d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
62132748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
6224453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
6238f9ae5b3SLuiz Augusto von Dentz #define EIR_SERVICE_DATA	0x16 /* Service Data */
6241471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
6251471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
626d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
627d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
628f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
629f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
63032748db0SJohan Hedberg 
6313f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
6323f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
6333f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
6343f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
6353f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
6363f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
6373f0f524bSJohan Hedberg 
6381da177e4SLinus Torvalds /* -----  HCI Commands ---- */
6396bd32326SVille Tervo #define HCI_OP_NOP			0x0000
6406bd32326SVille Tervo 
641a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
642a9de9248SMarcel Holtmann struct hci_cp_inquiry {
643a9de9248SMarcel Holtmann 	__u8     lap[3];
644a9de9248SMarcel Holtmann 	__u8     length;
645a9de9248SMarcel Holtmann 	__u8     num_rsp;
64666c853ccSGustavo F. Padovan } __packed;
6471da177e4SLinus Torvalds 
648a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
649a9de9248SMarcel Holtmann 
65079d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
65179d6e068SAndre Guedes 
652a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
653a9de9248SMarcel Holtmann 
654a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
655a9de9248SMarcel Holtmann struct hci_cp_create_conn {
656a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
657a9de9248SMarcel Holtmann 	__le16   pkt_type;
658a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
659a9de9248SMarcel Holtmann 	__u8     pscan_mode;
660a9de9248SMarcel Holtmann 	__le16   clock_offset;
661a9de9248SMarcel Holtmann 	__u8     role_switch;
66266c853ccSGustavo F. Padovan } __packed;
6631da177e4SLinus Torvalds 
664a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
665a9de9248SMarcel Holtmann struct hci_cp_disconnect {
666a9de9248SMarcel Holtmann 	__le16   handle;
667a9de9248SMarcel Holtmann 	__u8     reason;
66866c853ccSGustavo F. Padovan } __packed;
6691da177e4SLinus Torvalds 
670a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
671a9de9248SMarcel Holtmann struct hci_cp_add_sco {
672a9de9248SMarcel Holtmann 	__le16   handle;
673a9de9248SMarcel Holtmann 	__le16   pkt_type;
67466c853ccSGustavo F. Padovan } __packed;
675a9de9248SMarcel Holtmann 
676a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
677a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
6781da177e4SLinus Torvalds 	bdaddr_t bdaddr;
67966c853ccSGustavo F. Padovan } __packed;
6801da177e4SLinus Torvalds 
681a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
682a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
683a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
684a9de9248SMarcel Holtmann 	__u8     role;
68566c853ccSGustavo F. Padovan } __packed;
6861da177e4SLinus Torvalds 
687a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
688a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
689a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
690a9de9248SMarcel Holtmann 	__u8     reason;
69166c853ccSGustavo F. Padovan } __packed;
6921da177e4SLinus Torvalds 
693a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
694a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
695a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
6969b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
69766c853ccSGustavo F. Padovan } __packed;
6981da177e4SLinus Torvalds 
699a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
700a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
701a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
70266c853ccSGustavo F. Padovan } __packed;
7031da177e4SLinus Torvalds 
704a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
705a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
706a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
707a9de9248SMarcel Holtmann 	__u8     pin_len;
708a9de9248SMarcel Holtmann 	__u8     pin_code[16];
70966c853ccSGustavo F. Padovan } __packed;
710980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
711980e1a53SJohan Hedberg 	__u8     status;
712980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
713980e1a53SJohan Hedberg } __packed;
714a9de9248SMarcel Holtmann 
715a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
716a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
717a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
71866c853ccSGustavo F. Padovan } __packed;
719980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
720980e1a53SJohan Hedberg 	__u8     status;
721980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
722980e1a53SJohan Hedberg } __packed;
723a9de9248SMarcel Holtmann 
724a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
725a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
726a9de9248SMarcel Holtmann 	__le16   handle;
727a9de9248SMarcel Holtmann 	__le16   pkt_type;
72866c853ccSGustavo F. Padovan } __packed;
729a9de9248SMarcel Holtmann 
730a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
731a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
732a9de9248SMarcel Holtmann 	__le16   handle;
73366c853ccSGustavo F. Padovan } __packed;
734a9de9248SMarcel Holtmann 
735a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
736a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
737a9de9248SMarcel Holtmann 	__le16   handle;
738a9de9248SMarcel Holtmann 	__u8     encrypt;
73966c853ccSGustavo F. Padovan } __packed;
740a9de9248SMarcel Holtmann 
741a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
742a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
743a9de9248SMarcel Holtmann 	__le16   handle;
74466c853ccSGustavo F. Padovan } __packed;
745a9de9248SMarcel Holtmann 
746a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
747a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
748a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
749a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
750a9de9248SMarcel Holtmann 	__u8     pscan_mode;
751a9de9248SMarcel Holtmann 	__le16   clock_offset;
75266c853ccSGustavo F. Padovan } __packed;
753a9de9248SMarcel Holtmann 
754a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
755a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
756a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
75766c853ccSGustavo F. Padovan } __packed;
758a9de9248SMarcel Holtmann 
759a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
760a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
761a9de9248SMarcel Holtmann 	__le16   handle;
76266c853ccSGustavo F. Padovan } __packed;
763a9de9248SMarcel Holtmann 
764a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
765a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
766a9de9248SMarcel Holtmann 	__le16   handle;
767a9de9248SMarcel Holtmann 	__u8     page;
76866c853ccSGustavo F. Padovan } __packed;
769a9de9248SMarcel Holtmann 
770a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
771a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
772a9de9248SMarcel Holtmann 	__le16   handle;
77366c853ccSGustavo F. Padovan } __packed;
774a9de9248SMarcel Holtmann 
775df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
776df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
777df935429SMarcel Holtmann 	__le16   handle;
778df935429SMarcel Holtmann } __packed;
779df935429SMarcel Holtmann 
780a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
781a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
782a9de9248SMarcel Holtmann 	__le16   handle;
783a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
784a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
785a9de9248SMarcel Holtmann 	__le16   max_latency;
786a9de9248SMarcel Holtmann 	__le16   voice_setting;
787a9de9248SMarcel Holtmann 	__u8     retrans_effort;
788a9de9248SMarcel Holtmann 	__le16   pkt_type;
78966c853ccSGustavo F. Padovan } __packed;
790a9de9248SMarcel Holtmann 
791a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
792a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
793a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
794a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
795a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
796a9de9248SMarcel Holtmann 	__le16   max_latency;
797a9de9248SMarcel Holtmann 	__le16   content_format;
798a9de9248SMarcel Holtmann 	__u8     retrans_effort;
799a9de9248SMarcel Holtmann 	__le16   pkt_type;
80066c853ccSGustavo F. Padovan } __packed;
801a9de9248SMarcel Holtmann 
802a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
803a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
804a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
805a9de9248SMarcel Holtmann 	__u8     reason;
80666c853ccSGustavo F. Padovan } __packed;
807a9de9248SMarcel Holtmann 
80817fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
80917fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
81017fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
81117fa4b9dSJohan Hedberg 	__u8     capability;
81217fa4b9dSJohan Hedberg 	__u8     oob_data;
81317fa4b9dSJohan Hedberg 	__u8     authentication;
81417fa4b9dSJohan Hedberg } __packed;
81517fa4b9dSJohan Hedberg 
816a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
817a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
818a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
819a5c29683SJohan Hedberg } __packed;
820a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
821a5c29683SJohan Hedberg 	__u8     status;
822a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
823a5c29683SJohan Hedberg } __packed;
824a5c29683SJohan Hedberg 
825a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
826a5c29683SJohan Hedberg 
8279ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
8289ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
8299ad4019aSBrian Gix 	bdaddr_t bdaddr;
8309ad4019aSBrian Gix 	__le32	passkey;
8319ad4019aSBrian Gix } __packed;
8329ad4019aSBrian Gix 
8339ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
8349ad4019aSBrian Gix 
8352763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
8362763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
8372763eda6SSzymon Janc 	bdaddr_t bdaddr;
8382763eda6SSzymon Janc 	__u8     hash[16];
83938da1703SJohan Hedberg 	__u8     rand[16];
8402763eda6SSzymon Janc } __packed;
8412763eda6SSzymon Janc 
8422763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
8432763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
8442763eda6SSzymon Janc 	bdaddr_t bdaddr;
8452763eda6SSzymon Janc } __packed;
8462763eda6SSzymon Janc 
84703b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
84803b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
84903b555e1SJohan Hedberg 	bdaddr_t bdaddr;
85003b555e1SJohan Hedberg 	__u8     reason;
85103b555e1SJohan Hedberg } __packed;
85203b555e1SJohan Hedberg 
853523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
854523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
855523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
856523e93cdSAndrei Emeltchenko 	__u8     key_len;
857523e93cdSAndrei Emeltchenko 	__u8     key_type;
858523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
859523e93cdSAndrei Emeltchenko } __packed;
860523e93cdSAndrei Emeltchenko 
861523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
862523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
863523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
864523e93cdSAndrei Emeltchenko 	__u8     key_len;
865523e93cdSAndrei Emeltchenko 	__u8     key_type;
866523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
867523e93cdSAndrei Emeltchenko } __packed;
868523e93cdSAndrei Emeltchenko 
869523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
870523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
871523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
872523e93cdSAndrei Emeltchenko 	__u8     reason;
873b078b564SAndrei Emeltchenko } __packed;
874b078b564SAndrei Emeltchenko 
875b078b564SAndrei Emeltchenko struct ext_flow_spec {
876b078b564SAndrei Emeltchenko 	__u8       id;
877b078b564SAndrei Emeltchenko 	__u8       stype;
878b078b564SAndrei Emeltchenko 	__le16     msdu;
879b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
880b078b564SAndrei Emeltchenko 	__le32     acc_lat;
881b078b564SAndrei Emeltchenko 	__le32     flush_to;
882b078b564SAndrei Emeltchenko } __packed;
883b078b564SAndrei Emeltchenko 
884b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
885b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
886b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
887b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
888b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
889b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
890b078b564SAndrei Emeltchenko } __packed;
891b078b564SAndrei Emeltchenko 
892b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
893b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
894b078b564SAndrei Emeltchenko 	__le16   log_handle;
895b078b564SAndrei Emeltchenko } __packed;
896b078b564SAndrei Emeltchenko 
897b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
898b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
899b078b564SAndrei Emeltchenko 	__u8     phy_handle;
900b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
901b078b564SAndrei Emeltchenko } __packed;
902b078b564SAndrei Emeltchenko 
903b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN		0x043d
904b2af264aSKiran K struct hci_coding_format {
905b2af264aSKiran K 	__u8	id;
906b2af264aSKiran K 	__le16	cid;
907b2af264aSKiran K 	__le16	vid;
908b2af264aSKiran K } __packed;
909b2af264aSKiran K 
910b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn {
911b2af264aSKiran K 	__le16   handle;
912b2af264aSKiran K 	__le32   tx_bandwidth;
913b2af264aSKiran K 	__le32   rx_bandwidth;
914b2af264aSKiran K 	struct	 hci_coding_format tx_coding_format;
915b2af264aSKiran K 	struct	 hci_coding_format rx_coding_format;
916b2af264aSKiran K 	__le16	 tx_codec_frame_size;
917b2af264aSKiran K 	__le16	 rx_codec_frame_size;
918b2af264aSKiran K 	__le32	 in_bandwidth;
919b2af264aSKiran K 	__le32	 out_bandwidth;
920b2af264aSKiran K 	struct	 hci_coding_format in_coding_format;
921b2af264aSKiran K 	struct	 hci_coding_format out_coding_format;
922b2af264aSKiran K 	__le16   in_coded_data_size;
923b2af264aSKiran K 	__le16	 out_coded_data_size;
924b2af264aSKiran K 	__u8	 in_pcm_data_format;
925b2af264aSKiran K 	__u8	 out_pcm_data_format;
926b2af264aSKiran K 	__u8	 in_pcm_sample_payload_msb_pos;
927b2af264aSKiran K 	__u8	 out_pcm_sample_payload_msb_pos;
928b2af264aSKiran K 	__u8	 in_data_path;
929b2af264aSKiran K 	__u8	 out_data_path;
930b2af264aSKiran K 	__u8	 in_transport_unit_size;
931b2af264aSKiran K 	__u8	 out_transport_unit_size;
932b2af264aSKiran K 	__le16   max_latency;
933b2af264aSKiran K 	__le16   pkt_type;
934b2af264aSKiran K 	__u8     retrans_effort;
935b2af264aSKiran K } __packed;
936b2af264aSKiran K 
937b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
938b078b564SAndrei Emeltchenko 	__u8     status;
939b078b564SAndrei Emeltchenko 	__u8     phy_handle;
940b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
941523e93cdSAndrei Emeltchenko } __packed;
942523e93cdSAndrei Emeltchenko 
9436397729bSArchie Pusaka #define HCI_OP_SET_CPB			0x0441
9446397729bSArchie Pusaka struct hci_cp_set_cpb {
9458c9a041bSDoHyun Pyun 	__u8	enable;
9468c9a041bSDoHyun Pyun 	__u8	lt_addr;
9478c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
9488c9a041bSDoHyun Pyun 	__le16	packet_type;
9498c9a041bSDoHyun Pyun 	__le16	interval_min;
9508c9a041bSDoHyun Pyun 	__le16	interval_max;
9516397729bSArchie Pusaka 	__le16	cpb_sv_tout;
9528c9a041bSDoHyun Pyun } __packed;
9536397729bSArchie Pusaka struct hci_rp_set_cpb {
9548c9a041bSDoHyun Pyun 	__u8	status;
9558c9a041bSDoHyun Pyun 	__u8	lt_addr;
9568c9a041bSDoHyun Pyun 	__le16	interval;
9578c9a041bSDoHyun Pyun } __packed;
9588c9a041bSDoHyun Pyun 
959cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
960cefded98SDoHyun Pyun 
961e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
962e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
963e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
964e2f99131SMarcel Holtmann 	__u8     hash192[16];
96538da1703SJohan Hedberg 	__u8     rand192[16];
966e2f99131SMarcel Holtmann 	__u8     hash256[16];
96738da1703SJohan Hedberg 	__u8     rand256[16];
968e2f99131SMarcel Holtmann } __packed;
969e2f99131SMarcel Holtmann 
970a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
971a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
972a9de9248SMarcel Holtmann 	__le16   handle;
973a9de9248SMarcel Holtmann 	__le16   max_interval;
974a9de9248SMarcel Holtmann 	__le16   min_interval;
975a9de9248SMarcel Holtmann 	__le16   attempt;
976a9de9248SMarcel Holtmann 	__le16   timeout;
97766c853ccSGustavo F. Padovan } __packed;
978a9de9248SMarcel Holtmann 
979a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
980a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
981a9de9248SMarcel Holtmann 	__le16   handle;
98266c853ccSGustavo F. Padovan } __packed;
983a9de9248SMarcel Holtmann 
984a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
985a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
986a9de9248SMarcel Holtmann 	__le16   handle;
98766c853ccSGustavo F. Padovan } __packed;
988a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
989a9de9248SMarcel Holtmann 	__u8     status;
990a9de9248SMarcel Holtmann 	__le16   handle;
991a9de9248SMarcel Holtmann 	__u8     role;
99266c853ccSGustavo F. Padovan } __packed;
993a9de9248SMarcel Holtmann 
994a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
995a9de9248SMarcel Holtmann struct hci_cp_switch_role {
996a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
997a9de9248SMarcel Holtmann 	__u8     role;
99866c853ccSGustavo F. Padovan } __packed;
999a9de9248SMarcel Holtmann 
1000a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
1001a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
1002a9de9248SMarcel Holtmann 	__le16   handle;
100366c853ccSGustavo F. Padovan } __packed;
1004a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
1005a9de9248SMarcel Holtmann 	__u8     status;
1006a9de9248SMarcel Holtmann 	__le16   handle;
1007a9de9248SMarcel Holtmann 	__le16   policy;
100866c853ccSGustavo F. Padovan } __packed;
1009a9de9248SMarcel Holtmann 
1010a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
1011a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
1012a9de9248SMarcel Holtmann 	__le16   handle;
1013a9de9248SMarcel Holtmann 	__le16   policy;
101466c853ccSGustavo F. Padovan } __packed;
1015a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
1016a9de9248SMarcel Holtmann 	__u8     status;
1017a9de9248SMarcel Holtmann 	__le16   handle;
101866c853ccSGustavo F. Padovan } __packed;
1019a9de9248SMarcel Holtmann 
1020e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
1021e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
1022e4e8e37cSMarcel Holtmann 	__u8     status;
1023e4e8e37cSMarcel Holtmann 	__le16   policy;
102466c853ccSGustavo F. Padovan } __packed;
1025e4e8e37cSMarcel Holtmann 
1026e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
1027e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
1028e4e8e37cSMarcel Holtmann 	__le16   policy;
102966c853ccSGustavo F. Padovan } __packed;
1030e4e8e37cSMarcel Holtmann 
1031a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
1032a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
1033a9de9248SMarcel Holtmann 	__le16   handle;
1034a9de9248SMarcel Holtmann 	__le16   max_latency;
1035a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
1036a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
103766c853ccSGustavo F. Padovan } __packed;
1038a9de9248SMarcel Holtmann 
1039a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
1040a9de9248SMarcel Holtmann 
1041a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
1042a9de9248SMarcel Holtmann 
1043a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
10444f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE		9
10454f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter {
10461da177e4SLinus Torvalds 	__u8		flt_type;
10471da177e4SLinus Torvalds 	__u8		cond_type;
10484f40afc6SAbhishek Pandit-Subedi 	struct {
10494f40afc6SAbhishek Pandit-Subedi 		bdaddr_t bdaddr;
10504f40afc6SAbhishek Pandit-Subedi 		__u8 auto_accept;
10514f40afc6SAbhishek Pandit-Subedi 	} __packed	addr_conn_flt;
105266c853ccSGustavo F. Padovan } __packed;
10531da177e4SLinus Torvalds 
10541da177e4SLinus Torvalds /* Filter types */
10551da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
10561da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
10571da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
10581da177e4SLinus Torvalds 
10591da177e4SLinus Torvalds /* CONN_SETUP Condition types */
10601da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
10611da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
10621da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
10631da177e4SLinus Torvalds 
10641da177e4SLinus Torvalds /* CONN_SETUP Conditions */
10651da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF		0x01
10661da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON		0x02
10674f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS	0x03
10681da177e4SLinus Torvalds 
1069cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
1070cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
1071cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
1072cb962780SMarcel Holtmann 	__u8     read_all;
1073cb962780SMarcel Holtmann } __packed;
1074cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
1075cb962780SMarcel Holtmann 	__u8     status;
1076e88422bcSLuiz Augusto von Dentz 	__le16   max_keys;
1077e88422bcSLuiz Augusto von Dentz 	__le16   num_keys;
1078cb962780SMarcel Holtmann } __packed;
1079cb962780SMarcel Holtmann 
1080b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
1081b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
1082b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
1083b0916ea0SJohan Hedberg 	__u8     delete_all;
1084b0916ea0SJohan Hedberg } __packed;
1085039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
1086039d4e41SMarcel Holtmann 	__u8     status;
10877978656cSLuiz Augusto von Dentz 	__le16   num_keys;
1088039d4e41SMarcel Holtmann } __packed;
1089b0916ea0SJohan Hedberg 
10901f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
10911f6c6378SJohan Hedberg 
1092a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
1093a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
10941f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
109566c853ccSGustavo F. Padovan } __packed;
1096a9de9248SMarcel Holtmann 
1097a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
1098a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
1099a9de9248SMarcel Holtmann 	__u8     status;
11001f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
110166c853ccSGustavo F. Padovan } __packed;
1102a9de9248SMarcel Holtmann 
1103a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
1104a9de9248SMarcel Holtmann 
1105a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
1106a9de9248SMarcel Holtmann 
1107a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
1108a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
1109a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
1110a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
1111a9de9248SMarcel Holtmann 
1112a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
1113a9de9248SMarcel Holtmann 
1114a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
1115a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
1116a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
1117a9de9248SMarcel Holtmann 
1118a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
1119a9de9248SMarcel Holtmann 
1120a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
1121a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
1122a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
1123a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
1124a9de9248SMarcel Holtmann 
1125a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
1126a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
11271da177e4SLinus Torvalds 	__u8     status;
11281da177e4SLinus Torvalds 	__u8     dev_class[3];
112966c853ccSGustavo F. Padovan } __packed;
11301da177e4SLinus Torvalds 
1131a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
1132a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
11331da177e4SLinus Torvalds 	__u8     dev_class[3];
113466c853ccSGustavo F. Padovan } __packed;
11351da177e4SLinus Torvalds 
1136a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
11371da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
11381da177e4SLinus Torvalds 	__u8     status;
11391ebb9252SMarcel Holtmann 	__le16   voice_setting;
114066c853ccSGustavo F. Padovan } __packed;
11411da177e4SLinus Torvalds 
1142a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
11431da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
11441ebb9252SMarcel Holtmann 	__le16   voice_setting;
114566c853ccSGustavo F. Padovan } __packed;
11461da177e4SLinus Torvalds 
1147a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
11481da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
11491ebb9252SMarcel Holtmann 	__le16   acl_mtu;
11501da177e4SLinus Torvalds 	__u8     sco_mtu;
11511ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
11521ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
115366c853ccSGustavo F. Padovan } __packed;
11541da177e4SLinus Torvalds 
1155b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
1156b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1157b4cb9fb2SMarcel Holtmann 	__u8	status;
1158b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
1159b4cb9fb2SMarcel Holtmann } __packed;
1160b4cb9fb2SMarcel Holtmann 
11614b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
11624b836f39SMarcel Holtmann 
11633d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
11643d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
11653d505312SMarcel Holtmann 	__u8	num_iac;
11663d505312SMarcel Holtmann 	__u8	iac_lap[6];
11673d505312SMarcel Holtmann } __packed;
11683d505312SMarcel Holtmann 
1169d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
1170d5859e22SJohan Hedberg 
117180a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
117280a1e1dbSJohan Hedberg 
117380a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
117480a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1175816a11d5SJohan Hedberg 	__u8	fec;
1176816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
117780a1e1dbSJohan Hedberg } __packed;
117880a1e1dbSJohan Hedberg 
1179333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
1180333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1181333140b5SMarcel Holtmann 	__u8     status;
1182333140b5SMarcel Holtmann 	__u8     mode;
118366c853ccSGustavo F. Padovan } __packed;
1184333140b5SMarcel Holtmann 
1185333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
1186333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1187333140b5SMarcel Holtmann 	__u8     mode;
118866c853ccSGustavo F. Padovan } __packed;
1189333140b5SMarcel Holtmann 
1190c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1191c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1192c35938b2SSzymon Janc 	__u8     status;
1193c35938b2SSzymon Janc 	__u8     hash[16];
119438da1703SJohan Hedberg 	__u8     rand[16];
1195c35938b2SSzymon Janc } __packed;
1196c35938b2SSzymon Janc 
1197d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
119891c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
119991c4e9b1SMarcel Holtmann 	__u8     status;
120091c4e9b1SMarcel Holtmann 	__s8     tx_power;
120191c4e9b1SMarcel Holtmann } __packed;
1202d5859e22SJohan Hedberg 
120300bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING	0x0c5a
120400bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_DISABLED	0x00
120500bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_ENABLED	0x01
120600bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting {
120700bce3fbSAlain Michaud 	__u8     status;
120800bce3fbSAlain Michaud 	__u8     err_data_reporting;
120900bce3fbSAlain Michaud } __packed;
121000bce3fbSAlain Michaud 
121100bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING	0x0c5b
121200bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting {
121300bce3fbSAlain Michaud 	__u8     err_data_reporting;
121400bce3fbSAlain Michaud } __packed;
121500bce3fbSAlain Michaud 
1216d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1217d62e6d67SJohan Hedberg 
12187528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
12197528ca1cSMarcel Holtmann 
12201e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
12211e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
12221e89cffbSAndrei Emeltchenko 	__u8     status;
12231e89cffbSAndrei Emeltchenko 	__u8     mode;
12241e89cffbSAndrei Emeltchenko } __packed;
12251e89cffbSAndrei Emeltchenko 
1226f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1227f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1228f9b49306SAndre Guedes 	__u8	le;
1229f9b49306SAndre Guedes 	__u8	simul;
1230f9b49306SAndre Guedes } __packed;
1231f9b49306SAndre Guedes 
1232d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1233d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1234d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1235d0bf75a5SDoHyun Pyun } __packed;
1236d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1237d0bf75a5SDoHyun Pyun 	__u8	status;
1238d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1239d0bf75a5SDoHyun Pyun } __packed;
1240d0bf75a5SDoHyun Pyun 
12416a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
12426a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
12436a20eaf4SDoHyun Pyun 	__u8	lt_addr;
12446a20eaf4SDoHyun Pyun } __packed;
12456a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
12466a20eaf4SDoHyun Pyun 	__u8	status;
12476a20eaf4SDoHyun Pyun 	__u8	lt_addr;
12486a20eaf4SDoHyun Pyun } __packed;
12496a20eaf4SDoHyun Pyun 
12506397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA		0x0c76
12516397729bSArchie Pusaka struct hci_cp_set_cpb_data {
12527d1dab49SDoHyun Pyun 	__u8	lt_addr;
12537d1dab49SDoHyun Pyun 	__u8	fragment;
12547d1dab49SDoHyun Pyun 	__u8	data_length;
12556397729bSArchie Pusaka 	__u8	data[HCI_MAX_CPB_DATA_SIZE];
12567d1dab49SDoHyun Pyun } __packed;
12576397729bSArchie Pusaka struct hci_rp_set_cpb_data {
12587d1dab49SDoHyun Pyun 	__u8	status;
12597d1dab49SDoHyun Pyun 	__u8	lt_addr;
12607d1dab49SDoHyun Pyun } __packed;
12617d1dab49SDoHyun Pyun 
12625d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
12635d4e7e8dSJohan Hedberg 
1264a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1265a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1266a9b07a64SDoHyun Pyun 	__le16	interval_min;
1267a9b07a64SDoHyun Pyun 	__le16	interval_max;
1268a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1269a9b07a64SDoHyun Pyun 	__u8	service_data;
1270a9b07a64SDoHyun Pyun } __packed;
1271a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1272a9b07a64SDoHyun Pyun 	__u8	status;
1273a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1274a9b07a64SDoHyun Pyun } __packed;
1275a9b07a64SDoHyun Pyun 
1276eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1277eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1278eb4b95c6SMarcel Holtmann 	__u8	status;
1279eb4b95c6SMarcel Holtmann 	__u8	support;
1280eb4b95c6SMarcel Holtmann } __packed;
1281eb4b95c6SMarcel Holtmann 
1282eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1283eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1284eb4b95c6SMarcel Holtmann 	__u8	support;
1285eb4b95c6SMarcel Holtmann } __packed;
1286eb4b95c6SMarcel Holtmann 
1287302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO    0x0c7b
1288302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to {
1289302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1290302975cbSSpoorthi Ravishankar Koppad } __packed;
1291302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to {
1292302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1293302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1294302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1295302975cbSSpoorthi Ravishankar Koppad } __packed;
1296302975cbSSpoorthi Ravishankar Koppad 
1297302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO    0x0c7c
1298302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to {
1299302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1300302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1301302975cbSSpoorthi Ravishankar Koppad } __packed;
1302302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to {
1303302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1304302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1305302975cbSSpoorthi Ravishankar Koppad } __packed;
1306302975cbSSpoorthi Ravishankar Koppad 
1307e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1308e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1309e2f99131SMarcel Holtmann 	__u8     status;
1310e2f99131SMarcel Holtmann 	__u8     hash192[16];
131138da1703SJohan Hedberg 	__u8     rand192[16];
1312e2f99131SMarcel Holtmann 	__u8     hash256[16];
131338da1703SJohan Hedberg 	__u8     rand256[16];
1314e2f99131SMarcel Holtmann } __packed;
1315e2f99131SMarcel Holtmann 
13169798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH	0x0c83
13179798fbdeSKiran K struct hci_op_configure_data_path {
13189798fbdeSKiran K 	__u8	direction;
13199798fbdeSKiran K 	__u8	data_path_id;
13209798fbdeSKiran K 	__u8	vnd_len;
13219798fbdeSKiran K 	__u8	vnd_data[];
13229798fbdeSKiran K } __packed;
13239798fbdeSKiran K 
1324a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1325a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
13261da177e4SLinus Torvalds 	__u8     status;
1327a9de9248SMarcel Holtmann 	__u8     hci_ver;
1328a9de9248SMarcel Holtmann 	__le16   hci_rev;
1329a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1330a9de9248SMarcel Holtmann 	__le16   manufacturer;
1331a9de9248SMarcel Holtmann 	__le16   lmp_subver;
133266c853ccSGustavo F. Padovan } __packed;
13331da177e4SLinus Torvalds 
1334a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1335a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
13361da177e4SLinus Torvalds 	__u8     status;
1337a9de9248SMarcel Holtmann 	__u8     commands[64];
133866c853ccSGustavo F. Padovan } __packed;
13391da177e4SLinus Torvalds 
1340a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1341a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1342a9de9248SMarcel Holtmann 	__u8     status;
1343a9de9248SMarcel Holtmann 	__u8     features[8];
134466c853ccSGustavo F. Padovan } __packed;
1345a9de9248SMarcel Holtmann 
1346a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1347971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1348971e3a4bSAndre Guedes 	__u8     page;
1349971e3a4bSAndre Guedes } __packed;
1350a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1351a9de9248SMarcel Holtmann 	__u8     status;
1352a9de9248SMarcel Holtmann 	__u8     page;
1353a9de9248SMarcel Holtmann 	__u8     max_page;
1354a9de9248SMarcel Holtmann 	__u8     features[8];
135566c853ccSGustavo F. Padovan } __packed;
1356a9de9248SMarcel Holtmann 
1357a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1358a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1359a9de9248SMarcel Holtmann 	__u8     status;
1360a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1361a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1362a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1363a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
136466c853ccSGustavo F. Padovan } __packed;
1365a9de9248SMarcel Holtmann 
1366a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1367a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1368a9de9248SMarcel Holtmann 	__u8     status;
13691da177e4SLinus Torvalds 	bdaddr_t bdaddr;
137066c853ccSGustavo F. Padovan } __packed;
13711da177e4SLinus Torvalds 
1372350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1373350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1374350ee4cfSAndrei Emeltchenko 	__u8     status;
1375350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1376350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1377350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1378350ee4cfSAndrei Emeltchenko } __packed;
1379350ee4cfSAndrei Emeltchenko 
1380109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
13818961987fSKiran K struct hci_std_codecs {
13828961987fSKiran K 	__u8	num;
13838961987fSKiran K 	__u8	codec[];
13848961987fSKiran K } __packed;
13858961987fSKiran K 
13868961987fSKiran K struct hci_vnd_codec {
13878961987fSKiran K 	/* company id */
13888961987fSKiran K 	__le16	cid;
13898961987fSKiran K 	/* vendor codec id */
13908961987fSKiran K 	__le16	vid;
13918961987fSKiran K } __packed;
13928961987fSKiran K 
13938961987fSKiran K struct hci_vnd_codecs {
13948961987fSKiran K 	__u8	num;
13958961987fSKiran K 	struct hci_vnd_codec codec[];
13968961987fSKiran K } __packed;
13978961987fSKiran K 
13988961987fSKiran K struct hci_rp_read_local_supported_codecs {
13998961987fSKiran K 	__u8	status;
14008961987fSKiran K 	struct hci_std_codecs std_codecs;
14018961987fSKiran K 	struct hci_vnd_codecs vnd_codecs;
14028961987fSKiran K } __packed;
1403109e3191SMarcel Holtmann 
1404a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS	0x100c
1405a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts {
1406a4790360SMarcel Holtmann 	__u8     status;
1407a4790360SMarcel Holtmann 	__u8     pairing_opts;
1408a4790360SMarcel Holtmann 	__u8     max_key_size;
1409a4790360SMarcel Holtmann } __packed;
1410a4790360SMarcel Holtmann 
14119ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2	0x100d
14129ae66402SKiran K struct hci_std_codec_v2 {
14139ae66402SKiran K 	__u8	id;
14149ae66402SKiran K 	__u8	transport;
14159ae66402SKiran K } __packed;
14169ae66402SKiran K 
14179ae66402SKiran K struct hci_std_codecs_v2 {
14189ae66402SKiran K 	__u8	num;
14199ae66402SKiran K 	struct hci_std_codec_v2 codec[];
14209ae66402SKiran K } __packed;
14219ae66402SKiran K 
14229ae66402SKiran K struct hci_vnd_codec_v2 {
14239ae66402SKiran K 	__u8	id;
14249ae66402SKiran K 	__le16	cid;
14259ae66402SKiran K 	__le16	vid;
14269ae66402SKiran K 	__u8	transport;
14279ae66402SKiran K } __packed;
14289ae66402SKiran K 
14299ae66402SKiran K struct hci_vnd_codecs_v2 {
14309ae66402SKiran K 	__u8	num;
14319ae66402SKiran K 	struct hci_vnd_codec_v2 codec[];
14329ae66402SKiran K } __packed;
14339ae66402SKiran K 
14349ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 {
14359ae66402SKiran K 	__u8	status;
14369ae66402SKiran K 	struct hci_std_codecs_v2 std_codecs;
14379ae66402SKiran K 	struct hci_vnd_codecs_v2 vendor_codecs;
14389ae66402SKiran K } __packed;
14399ae66402SKiran K 
14408961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS	0x100e
14418961987fSKiran K struct hci_op_read_local_codec_caps {
14428961987fSKiran K 	__u8	id;
14438961987fSKiran K 	__le16	cid;
14448961987fSKiran K 	__le16	vid;
14458961987fSKiran K 	__u8	transport;
14468961987fSKiran K 	__u8	direction;
14478961987fSKiran K } __packed;
14488961987fSKiran K 
14498961987fSKiran K struct hci_codec_caps {
14508961987fSKiran K 	__u8	len;
14518961987fSKiran K 	__u8	data[];
14528961987fSKiran K } __packed;
14538961987fSKiran K 
14548961987fSKiran K struct hci_rp_read_local_codec_caps {
14558961987fSKiran K 	__u8	status;
14568961987fSKiran K 	__u8	num_caps;
14578961987fSKiran K } __packed;
14588961987fSKiran K 
1459f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1460f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1461f332ec66SJohan Hedberg 	__u8     status;
1462f332ec66SJohan Hedberg 	__le16   interval;
1463f332ec66SJohan Hedberg 	__le16   window;
1464f332ec66SJohan Hedberg } __packed;
1465f332ec66SJohan Hedberg 
1466f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1467f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1468f6422ec6SAntti Julku 	__le16   interval;
1469f6422ec6SAntti Julku 	__le16   window;
1470f6422ec6SAntti Julku } __packed;
1471f6422ec6SAntti Julku 
14725a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
14735a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
14745a134faeSAndrzej Kaczmarek 	__le16   handle;
14755a134faeSAndrzej Kaczmarek 	__u8     type;
14765a134faeSAndrzej Kaczmarek } __packed;
14775a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
14785a134faeSAndrzej Kaczmarek 	__u8     status;
14795a134faeSAndrzej Kaczmarek 	__le16   handle;
14805a134faeSAndrzej Kaczmarek 	__s8     tx_power;
14815a134faeSAndrzej Kaczmarek } __packed;
14825a134faeSAndrzej Kaczmarek 
1483f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1484f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1485f332ec66SJohan Hedberg 	__u8     status;
1486f332ec66SJohan Hedberg 	__u8     type;
1487f332ec66SJohan Hedberg } __packed;
1488f332ec66SJohan Hedberg 
1489f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1490f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1491f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1492f6422ec6SAntti Julku 
14935ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
14945ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
14955ae76a94SAndrzej Kaczmarek 	__le16   handle;
14965ae76a94SAndrzej Kaczmarek } __packed;
14975ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
14985ae76a94SAndrzej Kaczmarek 	__u8     status;
14995ae76a94SAndrzej Kaczmarek 	__le16   handle;
15005ae76a94SAndrzej Kaczmarek 	__s8     rssi;
15015ae76a94SAndrzej Kaczmarek } __packed;
15025ae76a94SAndrzej Kaczmarek 
150333f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
150433f35721SJohan Hedberg struct hci_cp_read_clock {
150533f35721SJohan Hedberg 	__le16   handle;
150633f35721SJohan Hedberg 	__u8     which;
150733f35721SJohan Hedberg } __packed;
150833f35721SJohan Hedberg struct hci_rp_read_clock {
150933f35721SJohan Hedberg 	__u8     status;
151033f35721SJohan Hedberg 	__le16   handle;
151133f35721SJohan Hedberg 	__le32   clock;
151233f35721SJohan Hedberg 	__le16   accuracy;
151333f35721SJohan Hedberg } __packed;
151433f35721SJohan Hedberg 
1515821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1516821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1517821f3766SJohan Hedberg 	__le16   handle;
1518821f3766SJohan Hedberg } __packed;
1519821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1520821f3766SJohan Hedberg 	__u8     status;
1521821f3766SJohan Hedberg 	__le16   handle;
1522821f3766SJohan Hedberg 	__u8     key_size;
1523821f3766SJohan Hedberg } __packed;
1524821f3766SJohan Hedberg 
1525928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1526928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1527928abaa7SAndrei Emeltchenko 	__u8     status;
1528928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1529928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1530928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1531928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1532928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1533928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1534928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1535928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1536928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1537928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1538928abaa7SAndrei Emeltchenko } __packed;
1539928abaa7SAndrei Emeltchenko 
1540523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1541523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1542523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1543523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1544523e93cdSAndrei Emeltchenko 	__le16   max_len;
1545523e93cdSAndrei Emeltchenko } __packed;
1546523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1547523e93cdSAndrei Emeltchenko 	__u8     status;
1548523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1549523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1550a7e45454SGustavo A. R. Silva 	__u8     frag[];
1551523e93cdSAndrei Emeltchenko } __packed;
1552523e93cdSAndrei Emeltchenko 
1553523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1554523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1555523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1556523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1557523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1558a7e45454SGustavo A. R. Silva 	__u8     frag[];
1559523e93cdSAndrei Emeltchenko } __packed;
1560523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1561523e93cdSAndrei Emeltchenko 	__u8     status;
1562523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1563523e93cdSAndrei Emeltchenko } __packed;
1564523e93cdSAndrei Emeltchenko 
1565f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1566f4fe73edSMarcel Holtmann 
15674b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
15684b4148e9SMarcel Holtmann 
156906f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
157006f5b778SMarcel Holtmann 
157163185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
157263185f64SVille Tervo struct hci_cp_le_set_event_mask {
157363185f64SVille Tervo 	__u8     mask[8];
157463185f64SVille Tervo } __packed;
157563185f64SVille Tervo 
157663185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
157763185f64SVille Tervo struct hci_rp_le_read_buffer_size {
157863185f64SVille Tervo 	__u8     status;
157963185f64SVille Tervo 	__le16   le_mtu;
158063185f64SVille Tervo 	__u8     le_max_pkt;
158163185f64SVille Tervo } __packed;
158263185f64SVille Tervo 
158360e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
158460e77321SJohan Hedberg struct hci_rp_le_read_local_features {
158560e77321SJohan Hedberg 	__u8     status;
158660e77321SJohan Hedberg 	__u8     features[8];
158760e77321SJohan Hedberg } __packed;
158860e77321SJohan Hedberg 
1589d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1590d13eafceSMarcel Holtmann 
15911e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
15921e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
15931e191893SMarcel Holtmann 	__le16   min_interval;
15941e191893SMarcel Holtmann 	__le16   max_interval;
15951e191893SMarcel Holtmann 	__u8     type;
15961e191893SMarcel Holtmann 	__u8     own_address_type;
15971e191893SMarcel Holtmann 	__u8     direct_addr_type;
15981e191893SMarcel Holtmann 	bdaddr_t direct_addr;
15991e191893SMarcel Holtmann 	__u8     channel_map;
16001e191893SMarcel Holtmann 	__u8     filter_policy;
16011e191893SMarcel Holtmann } __packed;
16021e191893SMarcel Holtmann 
16038fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
16048fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
16058fa19098SJohan Hedberg 	__u8	status;
16068fa19098SJohan Hedberg 	__s8	tx_power;
16078fa19098SJohan Hedberg } __packed;
16088fa19098SJohan Hedberg 
16093f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
16103f0f524bSJohan Hedberg 
16113f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
16123f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
16133f0f524bSJohan Hedberg 	__u8	length;
16143f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
16153f0f524bSJohan Hedberg } __packed;
16163f0f524bSJohan Hedberg 
1617f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1618f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1619f14d8f64SMarcel Holtmann 	__u8	length;
1620f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1621f14d8f64SMarcel Holtmann } __packed;
1622f14d8f64SMarcel Holtmann 
1623c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1624c1d5dc4aSJohan Hedberg 
16255df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
16265df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
16275df480b5SAndre Guedes 
162807f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
162907f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
163007f7fa5dSAndre Guedes 	__u8    type;
163107f7fa5dSAndre Guedes 	__le16  interval;
163207f7fa5dSAndre Guedes 	__le16  window;
163307f7fa5dSAndre Guedes 	__u8    own_address_type;
163407f7fa5dSAndre Guedes 	__u8    filter_policy;
163507f7fa5dSAndre Guedes } __packed;
163607f7fa5dSAndre Guedes 
163776a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
163876a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1639525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1640525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
164168a8aea4SAndrei Emeltchenko 
1642eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1643eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1644eb9d91f5SAndre Guedes 	__u8     enable;
1645eb9d91f5SAndre Guedes 	__u8     filter_dup;
1646eb9d91f5SAndre Guedes } __packed;
1647eb9d91f5SAndre Guedes 
1648a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
16493d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST		0x01
1650a7139eddSJohan Hedberg 
165163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
165263185f64SVille Tervo struct hci_cp_le_create_conn {
165363185f64SVille Tervo 	__le16   scan_interval;
165463185f64SVille Tervo 	__le16   scan_window;
165563185f64SVille Tervo 	__u8     filter_policy;
165663185f64SVille Tervo 	__u8     peer_addr_type;
165763185f64SVille Tervo 	bdaddr_t peer_addr;
165863185f64SVille Tervo 	__u8     own_address_type;
165963185f64SVille Tervo 	__le16   conn_interval_min;
166063185f64SVille Tervo 	__le16   conn_interval_max;
166163185f64SVille Tervo 	__le16   conn_latency;
166263185f64SVille Tervo 	__le16   supervision_timeout;
166363185f64SVille Tervo 	__le16   min_ce_len;
166463185f64SVille Tervo 	__le16   max_ce_len;
166563185f64SVille Tervo } __packed;
166663185f64SVille Tervo 
166763185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
166863185f64SVille Tervo 
16693d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE	0x200f
16703d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size {
1671cf1d081fSJohan Hedberg 	__u8	status;
1672cf1d081fSJohan Hedberg 	__u8	size;
1673cf1d081fSJohan Hedberg } __packed;
1674cf1d081fSJohan Hedberg 
16753d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST	0x2010
1676d9a7b0a5SMarcel Holtmann 
16773d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST	0x2011
16783d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list {
1679d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1680d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1681d9a7b0a5SMarcel Holtmann } __packed;
1682d9a7b0a5SMarcel Holtmann 
16833d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST	0x2012
16843d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list {
1685d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1686d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1687d9a7b0a5SMarcel Holtmann } __packed;
1688d9a7b0a5SMarcel Holtmann 
16892ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
16902ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
16912ce603ebSClaudio Takahasi 	__le16   handle;
16922ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
16932ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
16942ce603ebSClaudio Takahasi 	__le16   conn_latency;
16952ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
16962ce603ebSClaudio Takahasi 	__le16   min_ce_len;
16972ce603ebSClaudio Takahasi 	__le16   max_ce_len;
16982ce603ebSClaudio Takahasi } __packed;
16992ce603ebSClaudio Takahasi 
17000fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
17010fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
17020fe29fd1SMarcel Holtmann 	__le16	 handle;
17030fe29fd1SMarcel Holtmann } __packed;
17040fe29fd1SMarcel Holtmann 
1705a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1706a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1707a7a595f6SVinicius Costa Gomes 	__le16	handle;
1708fe39c7b2SMarcel Holtmann 	__le64	rand;
1709a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1710a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1711a7a595f6SVinicius Costa Gomes } __packed;
1712a7a595f6SVinicius Costa Gomes 
1713a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1714a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1715a7a595f6SVinicius Costa Gomes 	__le16	handle;
1716a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1717a7a595f6SVinicius Costa Gomes } __packed;
1718a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1719a7a595f6SVinicius Costa Gomes 	__u8	status;
1720a7a595f6SVinicius Costa Gomes 	__le16	handle;
1721a7a595f6SVinicius Costa Gomes } __packed;
1722a7a595f6SVinicius Costa Gomes 
1723a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1724a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1725a7a595f6SVinicius Costa Gomes 	__le16	handle;
1726a7a595f6SVinicius Costa Gomes } __packed;
1727a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1728a7a595f6SVinicius Costa Gomes 	__u8	status;
1729a7a595f6SVinicius Costa Gomes 	__le16	handle;
1730a7a595f6SVinicius Costa Gomes } __packed;
1731a7a595f6SVinicius Costa Gomes 
17329b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
17339b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
17349b008c04SJohan Hedberg 	__u8	status;
17359b008c04SJohan Hedberg 	__u8	le_states[8];
17369b008c04SJohan Hedberg } __packed;
17379b008c04SJohan Hedberg 
17388e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
17398e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
17408e75b46aSAndre Guedes 	__le16	handle;
17418e75b46aSAndre Guedes 	__le16	interval_min;
17428e75b46aSAndre Guedes 	__le16	interval_max;
17438e75b46aSAndre Guedes 	__le16	latency;
17448e75b46aSAndre Guedes 	__le16	timeout;
17458e75b46aSAndre Guedes 	__le16	min_ce_len;
17468e75b46aSAndre Guedes 	__le16	max_ce_len;
17478e75b46aSAndre Guedes } __packed;
17488e75b46aSAndre Guedes 
17498e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
17508e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
17518e75b46aSAndre Guedes 	__le16	handle;
17528e75b46aSAndre Guedes 	__u8	reason;
17538e75b46aSAndre Guedes } __packed;
17548e75b46aSAndre Guedes 
175594a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
175694a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
175794a3bd02SMarcel Holtmann 	__le16	handle;
175894a3bd02SMarcel Holtmann 	__le16	tx_len;
175994a3bd02SMarcel Holtmann 	__le16	tx_time;
176094a3bd02SMarcel Holtmann } __packed;
176194a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
176294a3bd02SMarcel Holtmann 	__u8	status;
176394a3bd02SMarcel Holtmann 	__le16	handle;
176494a3bd02SMarcel Holtmann } __packed;
176594a3bd02SMarcel Holtmann 
176694a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
176794a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
176894a3bd02SMarcel Holtmann 	__u8	status;
176994a3bd02SMarcel Holtmann 	__le16	tx_len;
177094a3bd02SMarcel Holtmann 	__le16	tx_time;
177194a3bd02SMarcel Holtmann } __packed;
177294a3bd02SMarcel Holtmann 
177394a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
177494a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
177594a3bd02SMarcel Holtmann 	__le16	tx_len;
177694a3bd02SMarcel Holtmann 	__le16	tx_time;
177794a3bd02SMarcel Holtmann } __packed;
177894a3bd02SMarcel Holtmann 
1779b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST	0x2027
1780b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list {
1781b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1782b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1783b950aa88SAnkit Navik 	__u8	 peer_irk[16];
1784b950aa88SAnkit Navik 	__u8	 local_irk[16];
1785b950aa88SAnkit Navik } __packed;
1786b950aa88SAnkit Navik 
1787b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST	0x2028
1788b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list {
1789b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1790b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1791b950aa88SAnkit Navik } __packed;
1792b950aa88SAnkit Navik 
1793545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST	0x2029
1794545f2596SAnkit Navik 
1795cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE	0x202a
1796cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1797cfdb0c2dSAnkit Navik 	__u8	status;
1798cfdb0c2dSAnkit Navik 	__u8	size;
1799cfdb0c2dSAnkit Navik } __packed;
1800cfdb0c2dSAnkit Navik 
1801aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1802aa12af77SAnkit Navik 
1803b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT	0x202e
1804b2cc2339SSathish Narasimman 
180594a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
180694a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
180794a3bd02SMarcel Holtmann 	__u8	status;
180894a3bd02SMarcel Holtmann 	__le16	tx_len;
180994a3bd02SMarcel Holtmann 	__le16	tx_time;
181094a3bd02SMarcel Holtmann 	__le16	rx_len;
181194a3bd02SMarcel Holtmann 	__le16	rx_time;
181294a3bd02SMarcel Holtmann } __packed;
181394a3bd02SMarcel Holtmann 
1814de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY	0x2031
1815de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1816de2ba303SMarcel Holtmann 	__u8    all_phys;
1817de2ba303SMarcel Holtmann 	__u8    tx_phys;
1818de2ba303SMarcel Holtmann 	__u8    rx_phys;
1819de2ba303SMarcel Holtmann } __packed;
1820de2ba303SMarcel Holtmann 
18216decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M		0x01
18226decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M		0x02
18236decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED		0x04
18246decb5b4SJaganath Kanakkassery 
1825a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS   0x2041
1826a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1827a2344b9eSJaganath Kanakkassery 	__u8    own_addr_type;
1828a2344b9eSJaganath Kanakkassery 	__u8    filter_policy;
1829a2344b9eSJaganath Kanakkassery 	__u8    scanning_phys;
1830a7e45454SGustavo A. R. Silva 	__u8    data[];
1831a2344b9eSJaganath Kanakkassery } __packed;
1832a2344b9eSJaganath Kanakkassery 
1833a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M		0x01
183445bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M		0x02
183545bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED	0x04
1836a2344b9eSJaganath Kanakkassery 
1837a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1838a2344b9eSJaganath Kanakkassery 	__u8    type;
1839a2344b9eSJaganath Kanakkassery 	__le16  interval;
1840a2344b9eSJaganath Kanakkassery 	__le16  window;
1841a2344b9eSJaganath Kanakkassery } __packed;
1842a2344b9eSJaganath Kanakkassery 
1843a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE   0x2042
1844a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1845a2344b9eSJaganath Kanakkassery 	__u8    enable;
1846a2344b9eSJaganath Kanakkassery 	__u8    filter_dup;
1847a2344b9eSJaganath Kanakkassery 	__le16  duration;
1848a2344b9eSJaganath Kanakkassery 	__le16  period;
1849a2344b9eSJaganath Kanakkassery } __packed;
1850a2344b9eSJaganath Kanakkassery 
18514d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN    0x2043
18524d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
18534d94f95dSJaganath Kanakkassery 	__u8      filter_policy;
18544d94f95dSJaganath Kanakkassery 	__u8      own_addr_type;
18554d94f95dSJaganath Kanakkassery 	__u8      peer_addr_type;
18564d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_addr;
18574d94f95dSJaganath Kanakkassery 	__u8      phys;
1858a7e45454SGustavo A. R. Silva 	__u8      data[];
18594d94f95dSJaganath Kanakkassery } __packed;
18604d94f95dSJaganath Kanakkassery 
18614d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
18624d94f95dSJaganath Kanakkassery 	__le16 scan_interval;
18634d94f95dSJaganath Kanakkassery 	__le16 scan_window;
18644d94f95dSJaganath Kanakkassery 	__le16 conn_interval_min;
18654d94f95dSJaganath Kanakkassery 	__le16 conn_interval_max;
18664d94f95dSJaganath Kanakkassery 	__le16 conn_latency;
18674d94f95dSJaganath Kanakkassery 	__le16 supervision_timeout;
18684d94f95dSJaganath Kanakkassery 	__le16 min_ce_len;
18694d94f95dSJaganath Kanakkassery 	__le16 max_ce_len;
18704d94f95dSJaganath Kanakkassery } __packed;
18714d94f95dSJaganath Kanakkassery 
1872*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_CREATE_SYNC	0x2044
1873*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_create_sync {
1874*eca0ae4aSLuiz Augusto von Dentz 	__u8      options;
1875*eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
1876*eca0ae4aSLuiz Augusto von Dentz 	__u8      addr_type;
1877*eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  addr;
1878*eca0ae4aSLuiz Augusto von Dentz 	__le16    skip;
1879*eca0ae4aSLuiz Augusto von Dentz 	__le16    sync_timeout;
1880*eca0ae4aSLuiz Augusto von Dentz 	__u8      sync_cte_type;
1881*eca0ae4aSLuiz Augusto von Dentz } __packed;
1882*eca0ae4aSLuiz Augusto von Dentz 
1883*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_TERM_SYNC		0x2046
1884*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_term_sync {
1885*eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
1886*eca0ae4aSLuiz Augusto von Dentz } __packed;
1887*eca0ae4aSLuiz Augusto von Dentz 
18886b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS	0x203b
18896b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
18906b49bcb4SJaganath Kanakkassery 	__u8  status;
18916b49bcb4SJaganath Kanakkassery 	__u8  num_of_sets;
18926b49bcb4SJaganath Kanakkassery } __packed;
18936b49bcb4SJaganath Kanakkassery 
1894de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS		0x2036
1895de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1896de181e88SJaganath Kanakkassery 	__u8      handle;
1897de181e88SJaganath Kanakkassery 	__le16    evt_properties;
1898de181e88SJaganath Kanakkassery 	__u8      min_interval[3];
1899de181e88SJaganath Kanakkassery 	__u8      max_interval[3];
1900de181e88SJaganath Kanakkassery 	__u8      channel_map;
1901de181e88SJaganath Kanakkassery 	__u8      own_addr_type;
1902de181e88SJaganath Kanakkassery 	__u8      peer_addr_type;
1903de181e88SJaganath Kanakkassery 	bdaddr_t  peer_addr;
1904de181e88SJaganath Kanakkassery 	__u8      filter_policy;
1905de181e88SJaganath Kanakkassery 	__u8      tx_power;
1906de181e88SJaganath Kanakkassery 	__u8      primary_phy;
1907de181e88SJaganath Kanakkassery 	__u8      secondary_max_skip;
1908de181e88SJaganath Kanakkassery 	__u8      secondary_phy;
1909de181e88SJaganath Kanakkassery 	__u8      sid;
1910de181e88SJaganath Kanakkassery 	__u8      notif_enable;
1911de181e88SJaganath Kanakkassery } __packed;
1912de181e88SJaganath Kanakkassery 
1913de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M		0X01
191485a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M		0x02
191585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED	0x03
1916de181e88SJaganath Kanakkassery 
1917de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1918de181e88SJaganath Kanakkassery 	__u8  status;
1919de181e88SJaganath Kanakkassery 	__u8  tx_power;
1920de181e88SJaganath Kanakkassery } __packed;
1921de181e88SJaganath Kanakkassery 
1922de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1923de181e88SJaganath Kanakkassery 	__u8  handle;
1924de181e88SJaganath Kanakkassery 	__le16 duration;
1925de181e88SJaganath Kanakkassery 	__u8  max_events;
1926de181e88SJaganath Kanakkassery } __packed;
1927de181e88SJaganath Kanakkassery 
1928c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH	251
1929c9ed0a70SLuiz Augusto von Dentz 
1930a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA		0x2037
1931a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1932a0fb3726SJaganath Kanakkassery 	__u8  handle;
1933a0fb3726SJaganath Kanakkassery 	__u8  operation;
1934a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1935a0fb3726SJaganath Kanakkassery 	__u8  length;
1936c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
1937a0fb3726SJaganath Kanakkassery } __packed;
1938a0fb3726SJaganath Kanakkassery 
1939a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA		0x2038
1940a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
1941a0fb3726SJaganath Kanakkassery 	__u8  handle;
1942a0fb3726SJaganath Kanakkassery 	__u8  operation;
1943a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1944a0fb3726SJaganath Kanakkassery 	__u8  length;
1945c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
1946a0fb3726SJaganath Kanakkassery } __packed;
1947a0fb3726SJaganath Kanakkassery 
1948*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_EXT_ADV_ENABLE		0x2039
1949*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_ext_adv_enable {
1950*eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
1951*eca0ae4aSLuiz Augusto von Dentz 	__u8  num_of_sets;
1952*eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
1953*eca0ae4aSLuiz Augusto von Dentz } __packed;
1954*eca0ae4aSLuiz Augusto von Dentz 
1955*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_PARAMS		0x203e
1956*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_params {
1957*eca0ae4aSLuiz Augusto von Dentz 	__u8      handle;
1958*eca0ae4aSLuiz Augusto von Dentz 	__le16    min_interval;
1959*eca0ae4aSLuiz Augusto von Dentz 	__le16    max_interval;
1960*eca0ae4aSLuiz Augusto von Dentz 	__le16    periodic_properties;
1961*eca0ae4aSLuiz Augusto von Dentz } __packed;
1962*eca0ae4aSLuiz Augusto von Dentz 
1963*eca0ae4aSLuiz Augusto von Dentz #define HCI_MAX_PER_AD_LENGTH	252
1964*eca0ae4aSLuiz Augusto von Dentz 
1965*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_DATA		0x203f
1966*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_data {
1967*eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
1968*eca0ae4aSLuiz Augusto von Dentz 	__u8  operation;
1969*eca0ae4aSLuiz Augusto von Dentz 	__u8  length;
1970*eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
1971*eca0ae4aSLuiz Augusto von Dentz } __packed;
1972*eca0ae4aSLuiz Augusto von Dentz 
1973*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_ENABLE		0x2040
1974*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_enable {
1975*eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
1976*eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
1977*eca0ae4aSLuiz Augusto von Dentz } __packed;
1978*eca0ae4aSLuiz Augusto von Dentz 
1979a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE	0x03
1980a0fb3726SJaganath Kanakkassery 
1981a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG		0x01
1982a0fb3726SJaganath Kanakkassery 
1983a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET	0x203c
1984a9e45698SSathish Narsimman 
198545b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS	0x203d
198645b7749fSJaganath Kanakkassery 
1987a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR	0x2035
1988a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
1989a73c046aSJaganath Kanakkassery 	__u8  handle;
1990a73c046aSJaganath Kanakkassery 	bdaddr_t  bdaddr;
1991a73c046aSJaganath Kanakkassery } __packed;
1992a73c046aSJaganath Kanakkassery 
19937c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER	0x204b
19947c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power {
19957c395ea5SDaniel Winkler 	__u8  status;
19967c395ea5SDaniel Winkler 	__s8  min_le_tx_power;
19977c395ea5SDaniel Winkler 	__s8  max_le_tx_power;
19987c395ea5SDaniel Winkler } __packed;
19997c395ea5SDaniel Winkler 
2000853b70b5SLuiz Augusto von Dentz #define HCI_NETWORK_PRIVACY		0x00
2001853b70b5SLuiz Augusto von Dentz #define HCI_DEVICE_PRIVACY		0x01
2002853b70b5SLuiz Augusto von Dentz 
2003853b70b5SLuiz Augusto von Dentz #define HCI_OP_LE_SET_PRIVACY_MODE	0x204e
2004853b70b5SLuiz Augusto von Dentz struct hci_cp_le_set_privacy_mode {
2005853b70b5SLuiz Augusto von Dentz 	__u8  bdaddr_type;
2006853b70b5SLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2007853b70b5SLuiz Augusto von Dentz 	__u8  mode;
2008853b70b5SLuiz Augusto von Dentz } __packed;
2009853b70b5SLuiz Augusto von Dentz 
20104de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2	0x2060
20114de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 {
20124de0fc59SLuiz Augusto von Dentz 	__u8    status;
20134de0fc59SLuiz Augusto von Dentz 	__le16  acl_mtu;
20144de0fc59SLuiz Augusto von Dentz 	__u8    acl_max_pkt;
20154de0fc59SLuiz Augusto von Dentz 	__le16  iso_mtu;
20164de0fc59SLuiz Augusto von Dentz 	__u8    iso_max_pkt;
20174de0fc59SLuiz Augusto von Dentz } __packed;
20184de0fc59SLuiz Augusto von Dentz 
20194de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC		0x2061
20204de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync {
20214de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20224de0fc59SLuiz Augusto von Dentz } __packed;
20234de0fc59SLuiz Augusto von Dentz 
20244de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync {
20254de0fc59SLuiz Augusto von Dentz 	__u8    status;
20264de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20274de0fc59SLuiz Augusto von Dentz 	__le16  seq;
20284de0fc59SLuiz Augusto von Dentz 	__le32  imestamp;
20294de0fc59SLuiz Augusto von Dentz 	__u8    offset[3];
20304de0fc59SLuiz Augusto von Dentz } __packed;
20314de0fc59SLuiz Augusto von Dentz 
20324de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS		0x2062
20334de0fc59SLuiz Augusto von Dentz struct hci_cis_params {
20344de0fc59SLuiz Augusto von Dentz 	__u8    cis_id;
203576c185a5SArchie Pusaka 	__le16  c_sdu;
203626afbd82SLuiz Augusto von Dentz 	__le16  p_sdu;
203776c185a5SArchie Pusaka 	__u8    c_phy;
203876c185a5SArchie Pusaka 	__u8    p_phy;
203976c185a5SArchie Pusaka 	__u8    c_rtn;
204076c185a5SArchie Pusaka 	__u8    p_rtn;
20414de0fc59SLuiz Augusto von Dentz } __packed;
20424de0fc59SLuiz Augusto von Dentz 
20434de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params {
20444de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
204576c185a5SArchie Pusaka 	__u8    c_interval[3];
204676c185a5SArchie Pusaka 	__u8    p_interval[3];
204726afbd82SLuiz Augusto von Dentz 	__u8    sca;
20484de0fc59SLuiz Augusto von Dentz 	__u8    packing;
20494de0fc59SLuiz Augusto von Dentz 	__u8    framing;
205076c185a5SArchie Pusaka 	__le16  c_latency;
205176c185a5SArchie Pusaka 	__le16  p_latency;
20524de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2053a7e45454SGustavo A. R. Silva 	struct hci_cis_params cis[];
20544de0fc59SLuiz Augusto von Dentz } __packed;
20554de0fc59SLuiz Augusto von Dentz 
20564de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params {
20574de0fc59SLuiz Augusto von Dentz 	__u8    status;
20584de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
20594de0fc59SLuiz Augusto von Dentz 	__u8    num_handles;
2060a7e45454SGustavo A. R. Silva 	__le16  handle[];
20614de0fc59SLuiz Augusto von Dentz } __packed;
20624de0fc59SLuiz Augusto von Dentz 
20634de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS			0x2064
20644de0fc59SLuiz Augusto von Dentz struct hci_cis {
20654de0fc59SLuiz Augusto von Dentz 	__le16  cis_handle;
20664de0fc59SLuiz Augusto von Dentz 	__le16  acl_handle;
20674de0fc59SLuiz Augusto von Dentz } __packed;
20684de0fc59SLuiz Augusto von Dentz 
20694de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis {
20704de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2071a7e45454SGustavo A. R. Silva 	struct hci_cis cis[];
20724de0fc59SLuiz Augusto von Dentz } __packed;
20734de0fc59SLuiz Augusto von Dentz 
20744de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG			0x2065
20754de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig {
20764de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
20774de0fc59SLuiz Augusto von Dentz } __packed;
20784de0fc59SLuiz Augusto von Dentz 
20794de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS			0x2066
20804de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis {
20814de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20824de0fc59SLuiz Augusto von Dentz } __packed;
20834de0fc59SLuiz Augusto von Dentz 
20844de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS			0x2067
20854de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis {
20864de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20874de0fc59SLuiz Augusto von Dentz 	__u8    reason;
20884de0fc59SLuiz Augusto von Dentz } __packed;
20894de0fc59SLuiz Augusto von Dentz 
2090*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_BIG			0x2068
2091*eca0ae4aSLuiz Augusto von Dentz struct hci_bis {
2092*eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2093*eca0ae4aSLuiz Augusto von Dentz 	__le16  sdu;
2094*eca0ae4aSLuiz Augusto von Dentz 	__le16  latency;
2095*eca0ae4aSLuiz Augusto von Dentz 	__u8    rtn;
2096*eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2097*eca0ae4aSLuiz Augusto von Dentz 	__u8    packing;
2098*eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2099*eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2100*eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2101*eca0ae4aSLuiz Augusto von Dentz } __packed;
2102*eca0ae4aSLuiz Augusto von Dentz 
2103*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_create_big {
2104*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2105*eca0ae4aSLuiz Augusto von Dentz 	__u8    adv_handle;
2106*eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2107*eca0ae4aSLuiz Augusto von Dentz 	struct hci_bis bis;
2108*eca0ae4aSLuiz Augusto von Dentz } __packed;
2109*eca0ae4aSLuiz Augusto von Dentz 
2110*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_TERM_BIG			0x206a
2111*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_term_big {
2112*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2113*eca0ae4aSLuiz Augusto von Dentz 	__u8    reason;
2114*eca0ae4aSLuiz Augusto von Dentz } __packed;
2115*eca0ae4aSLuiz Augusto von Dentz 
2116*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_CREATE_SYNC		0x206b
2117*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_create_sync {
2118*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2119*eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2120*eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2121*eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2122*eca0ae4aSLuiz Augusto von Dentz 	__u8    mse;
2123*eca0ae4aSLuiz Augusto von Dentz 	__le16  timeout;
2124*eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2125*eca0ae4aSLuiz Augusto von Dentz 	__u8    bis[0];
2126*eca0ae4aSLuiz Augusto von Dentz } __packed;
2127*eca0ae4aSLuiz Augusto von Dentz 
2128*eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_TERM_SYNC			0x206c
2129*eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_term_sync {
2130*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2131*eca0ae4aSLuiz Augusto von Dentz } __packed;
2132*eca0ae4aSLuiz Augusto von Dentz 
213326afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SETUP_ISO_PATH		0x206e
213426afbd82SLuiz Augusto von Dentz struct hci_cp_le_setup_iso_path {
213526afbd82SLuiz Augusto von Dentz 	__le16  handle;
213626afbd82SLuiz Augusto von Dentz 	__u8    direction;
213726afbd82SLuiz Augusto von Dentz 	__u8    path;
213826afbd82SLuiz Augusto von Dentz 	__u8    codec;
213926afbd82SLuiz Augusto von Dentz 	__le16  codec_cid;
214026afbd82SLuiz Augusto von Dentz 	__le16  codec_vid;
214126afbd82SLuiz Augusto von Dentz 	__u8    delay[3];
214226afbd82SLuiz Augusto von Dentz 	__u8    codec_cfg_len;
214326afbd82SLuiz Augusto von Dentz 	__u8    codec_cfg[0];
214426afbd82SLuiz Augusto von Dentz } __packed;
214526afbd82SLuiz Augusto von Dentz 
214626afbd82SLuiz Augusto von Dentz struct hci_rp_le_setup_iso_path {
214726afbd82SLuiz Augusto von Dentz 	__u8    status;
214826afbd82SLuiz Augusto von Dentz 	__le16  handle;
214926afbd82SLuiz Augusto von Dentz } __packed;
215026afbd82SLuiz Augusto von Dentz 
215126afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SET_HOST_FEATURE		0x2074
215226afbd82SLuiz Augusto von Dentz struct hci_cp_le_set_host_feature {
215326afbd82SLuiz Augusto von Dentz 	__u8     bit_number;
215426afbd82SLuiz Augusto von Dentz 	__u8     bit_value;
215526afbd82SLuiz Augusto von Dentz } __packed;
215626afbd82SLuiz Augusto von Dentz 
21571da177e4SLinus Torvalds /* ---- HCI Events ---- */
2158ae61a10dSLuiz Augusto von Dentz struct hci_ev_status {
2159ae61a10dSLuiz Augusto von Dentz 	__u8    status;
2160ae61a10dSLuiz Augusto von Dentz } __packed;
2161ae61a10dSLuiz Augusto von Dentz 
21621da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
21631da177e4SLinus Torvalds 
21641da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
21651da177e4SLinus Torvalds struct inquiry_info {
21661da177e4SLinus Torvalds 	bdaddr_t bdaddr;
21671da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
21681da177e4SLinus Torvalds 	__u8     pscan_period_mode;
21691da177e4SLinus Torvalds 	__u8     pscan_mode;
21701da177e4SLinus Torvalds 	__u8     dev_class[3];
21711ebb9252SMarcel Holtmann 	__le16   clock_offset;
217266c853ccSGustavo F. Padovan } __packed;
21731da177e4SLinus Torvalds 
217427d9eb4bSLuiz Augusto von Dentz struct hci_ev_inquiry_result {
217527d9eb4bSLuiz Augusto von Dentz 	__u8    num;
217627d9eb4bSLuiz Augusto von Dentz 	struct inquiry_info info[];
217727d9eb4bSLuiz Augusto von Dentz };
217827d9eb4bSLuiz Augusto von Dentz 
21791da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
21801da177e4SLinus Torvalds struct hci_ev_conn_complete {
21811da177e4SLinus Torvalds 	__u8     status;
21821ebb9252SMarcel Holtmann 	__le16   handle;
21831da177e4SLinus Torvalds 	bdaddr_t bdaddr;
21841da177e4SLinus Torvalds 	__u8     link_type;
21851da177e4SLinus Torvalds 	__u8     encr_mode;
218666c853ccSGustavo F. Padovan } __packed;
21871da177e4SLinus Torvalds 
21881da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
21891da177e4SLinus Torvalds struct hci_ev_conn_request {
21901da177e4SLinus Torvalds 	bdaddr_t bdaddr;
21911da177e4SLinus Torvalds 	__u8     dev_class[3];
21921da177e4SLinus Torvalds 	__u8     link_type;
219366c853ccSGustavo F. Padovan } __packed;
21941da177e4SLinus Torvalds 
21951da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
21961da177e4SLinus Torvalds struct hci_ev_disconn_complete {
21971da177e4SLinus Torvalds 	__u8     status;
21981ebb9252SMarcel Holtmann 	__le16   handle;
21991da177e4SLinus Torvalds 	__u8     reason;
220066c853ccSGustavo F. Padovan } __packed;
22011da177e4SLinus Torvalds 
22021da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
22031da177e4SLinus Torvalds struct hci_ev_auth_complete {
22041da177e4SLinus Torvalds 	__u8     status;
22051ebb9252SMarcel Holtmann 	__le16   handle;
220666c853ccSGustavo F. Padovan } __packed;
22071da177e4SLinus Torvalds 
2208a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
2209a9de9248SMarcel Holtmann struct hci_ev_remote_name {
2210a9de9248SMarcel Holtmann 	__u8     status;
2211a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
22121f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
221366c853ccSGustavo F. Padovan } __packed;
2214a9de9248SMarcel Holtmann 
22151da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
22161da177e4SLinus Torvalds struct hci_ev_encrypt_change {
22171da177e4SLinus Torvalds 	__u8     status;
22181ebb9252SMarcel Holtmann 	__le16   handle;
22191da177e4SLinus Torvalds 	__u8     encrypt;
222066c853ccSGustavo F. Padovan } __packed;
22211da177e4SLinus Torvalds 
2222a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
2223a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
22241da177e4SLinus Torvalds 	__u8     status;
22251ebb9252SMarcel Holtmann 	__le16   handle;
222666c853ccSGustavo F. Padovan } __packed;
22271da177e4SLinus Torvalds 
2228a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
2229a9de9248SMarcel Holtmann struct hci_ev_remote_features {
2230a9de9248SMarcel Holtmann 	__u8     status;
2231a9de9248SMarcel Holtmann 	__le16   handle;
2232a9de9248SMarcel Holtmann 	__u8     features[8];
223366c853ccSGustavo F. Padovan } __packed;
2234a9de9248SMarcel Holtmann 
2235a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
2236a9de9248SMarcel Holtmann struct hci_ev_remote_version {
2237a9de9248SMarcel Holtmann 	__u8     status;
2238a9de9248SMarcel Holtmann 	__le16   handle;
2239a9de9248SMarcel Holtmann 	__u8     lmp_ver;
2240a9de9248SMarcel Holtmann 	__le16   manufacturer;
2241a9de9248SMarcel Holtmann 	__le16   lmp_subver;
224266c853ccSGustavo F. Padovan } __packed;
2243a9de9248SMarcel Holtmann 
2244a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
22451da177e4SLinus Torvalds struct hci_qos {
22461da177e4SLinus Torvalds 	__u8     service_type;
22471da177e4SLinus Torvalds 	__u32    token_rate;
22481da177e4SLinus Torvalds 	__u32    peak_bandwidth;
22491da177e4SLinus Torvalds 	__u32    latency;
22501da177e4SLinus Torvalds 	__u32    delay_variation;
225166c853ccSGustavo F. Padovan } __packed;
22521da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
22531da177e4SLinus Torvalds 	__u8     status;
22541ebb9252SMarcel Holtmann 	__le16   handle;
22551da177e4SLinus Torvalds 	struct   hci_qos qos;
225666c853ccSGustavo F. Padovan } __packed;
22571da177e4SLinus Torvalds 
2258a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
22591da177e4SLinus Torvalds struct hci_ev_cmd_complete {
22601da177e4SLinus Torvalds 	__u8     ncmd;
22611ebb9252SMarcel Holtmann 	__le16   opcode;
226266c853ccSGustavo F. Padovan } __packed;
22631da177e4SLinus Torvalds 
2264a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
22651da177e4SLinus Torvalds struct hci_ev_cmd_status {
22661da177e4SLinus Torvalds 	__u8     status;
22671da177e4SLinus Torvalds 	__u8     ncmd;
22681ebb9252SMarcel Holtmann 	__le16   opcode;
226966c853ccSGustavo F. Padovan } __packed;
22701da177e4SLinus Torvalds 
227124dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
227224dfa343SMarcel Holtmann struct hci_ev_hardware_error {
227324dfa343SMarcel Holtmann 	__u8     code;
227424dfa343SMarcel Holtmann } __packed;
227524dfa343SMarcel Holtmann 
22761da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
22771da177e4SLinus Torvalds struct hci_ev_role_change {
22781da177e4SLinus Torvalds 	__u8     status;
22791da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22801da177e4SLinus Torvalds 	__u8     role;
228166c853ccSGustavo F. Padovan } __packed;
22821da177e4SLinus Torvalds 
2283a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
2284613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
2285613a1c0cSAndrei Emeltchenko 	__le16   handle;
2286613a1c0cSAndrei Emeltchenko 	__le16   count;
2287613a1c0cSAndrei Emeltchenko } __packed;
2288613a1c0cSAndrei Emeltchenko 
2289a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
2290aadc3d2fSLuiz Augusto von Dentz 	__u8     num;
2291a7e45454SGustavo A. R. Silva 	struct hci_comp_pkts_info handles[];
229266c853ccSGustavo F. Padovan } __packed;
2293a9de9248SMarcel Holtmann 
22941da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
22951da177e4SLinus Torvalds struct hci_ev_mode_change {
22961da177e4SLinus Torvalds 	__u8     status;
22971ebb9252SMarcel Holtmann 	__le16   handle;
22981da177e4SLinus Torvalds 	__u8     mode;
22991ebb9252SMarcel Holtmann 	__le16   interval;
230066c853ccSGustavo F. Padovan } __packed;
23011da177e4SLinus Torvalds 
23021da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
23031da177e4SLinus Torvalds struct hci_ev_pin_code_req {
23041da177e4SLinus Torvalds 	bdaddr_t bdaddr;
230566c853ccSGustavo F. Padovan } __packed;
23061da177e4SLinus Torvalds 
23071da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
23081da177e4SLinus Torvalds struct hci_ev_link_key_req {
23091da177e4SLinus Torvalds 	bdaddr_t bdaddr;
231066c853ccSGustavo F. Padovan } __packed;
23111da177e4SLinus Torvalds 
23121da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
23131da177e4SLinus Torvalds struct hci_ev_link_key_notify {
23141da177e4SLinus Torvalds 	bdaddr_t bdaddr;
23159b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
23161da177e4SLinus Torvalds 	__u8     key_type;
231766c853ccSGustavo F. Padovan } __packed;
23181da177e4SLinus Torvalds 
2319a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
23201da177e4SLinus Torvalds struct hci_ev_clock_offset {
23211da177e4SLinus Torvalds 	__u8     status;
23221ebb9252SMarcel Holtmann 	__le16   handle;
23231ebb9252SMarcel Holtmann 	__le16   clock_offset;
232466c853ccSGustavo F. Padovan } __packed;
23251da177e4SLinus Torvalds 
2326a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
2327a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
2328a8746417SMarcel Holtmann 	__u8     status;
2329a8746417SMarcel Holtmann 	__le16   handle;
2330a8746417SMarcel Holtmann 	__le16   pkt_type;
233166c853ccSGustavo F. Padovan } __packed;
2332a8746417SMarcel Holtmann 
233385a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
233485a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
233585a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
233685a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
233766c853ccSGustavo F. Padovan } __packed;
233885a1e930SMarcel Holtmann 
2339a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
23408d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi {
2341a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2342a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2343a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2344a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2345a9de9248SMarcel Holtmann 	__le16   clock_offset;
2346a9de9248SMarcel Holtmann 	__s8     rssi;
234766c853ccSGustavo F. Padovan } __packed;
23488d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi_pscan {
2349a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2350a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2351a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2352a9de9248SMarcel Holtmann 	__u8     pscan_mode;
2353a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2354a9de9248SMarcel Holtmann 	__le16   clock_offset;
2355a9de9248SMarcel Holtmann 	__s8     rssi;
235666c853ccSGustavo F. Padovan } __packed;
23578d08d324SLuiz Augusto von Dentz struct hci_ev_inquiry_result_rssi {
23588d08d324SLuiz Augusto von Dentz 	__u8     num;
235972279d17SLuiz Augusto von Dentz 	__u8     data[];
23608d08d324SLuiz Augusto von Dentz } __packed;
2361a9de9248SMarcel Holtmann 
2362a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
2363a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
2364a9de9248SMarcel Holtmann 	__u8     status;
2365a9de9248SMarcel Holtmann 	__le16   handle;
2366a9de9248SMarcel Holtmann 	__u8     page;
2367a9de9248SMarcel Holtmann 	__u8     max_page;
2368a9de9248SMarcel Holtmann 	__u8     features[8];
236966c853ccSGustavo F. Padovan } __packed;
2370a9de9248SMarcel Holtmann 
2371a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
2372a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
2373a9de9248SMarcel Holtmann 	__u8     status;
2374a9de9248SMarcel Holtmann 	__le16   handle;
2375a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2376a9de9248SMarcel Holtmann 	__u8     link_type;
2377a9de9248SMarcel Holtmann 	__u8     tx_interval;
2378a9de9248SMarcel Holtmann 	__u8     retrans_window;
2379a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2380a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
2381a9de9248SMarcel Holtmann 	__u8     air_mode;
238266c853ccSGustavo F. Padovan } __packed;
2383a9de9248SMarcel Holtmann 
2384a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
2385a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
2386a9de9248SMarcel Holtmann 	__u8     status;
2387a9de9248SMarcel Holtmann 	__le16   handle;
2388a9de9248SMarcel Holtmann 	__u8     tx_interval;
2389a9de9248SMarcel Holtmann 	__u8     retrans_window;
2390a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2391a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
239266c853ccSGustavo F. Padovan } __packed;
2393a9de9248SMarcel Holtmann 
2394a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
239504837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
239604837f64SMarcel Holtmann 	__u8     status;
239704837f64SMarcel Holtmann 	__le16   handle;
239804837f64SMarcel Holtmann 	__le16   max_tx_latency;
239904837f64SMarcel Holtmann 	__le16   max_rx_latency;
240004837f64SMarcel Holtmann 	__le16   max_remote_timeout;
240104837f64SMarcel Holtmann 	__le16   max_local_timeout;
240266c853ccSGustavo F. Padovan } __packed;
240304837f64SMarcel Holtmann 
2404a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
2405a9de9248SMarcel Holtmann struct extended_inquiry_info {
2406a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2407a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2408a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2409a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2410a9de9248SMarcel Holtmann 	__le16   clock_offset;
2411a9de9248SMarcel Holtmann 	__s8     rssi;
2412a9de9248SMarcel Holtmann 	__u8     data[240];
241366c853ccSGustavo F. Padovan } __packed;
2414a9de9248SMarcel Holtmann 
241570a6b8deSLuiz Augusto von Dentz struct hci_ev_ext_inquiry_result {
241670a6b8deSLuiz Augusto von Dentz 	__u8     num;
241770a6b8deSLuiz Augusto von Dentz 	struct extended_inquiry_info info[];
241870a6b8deSLuiz Augusto von Dentz } __packed;
241970a6b8deSLuiz Augusto von Dentz 
24201c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
24211c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
24221c2e0041SJohan Hedberg 	__u8	status;
24231c2e0041SJohan Hedberg 	__le16	handle;
24241c2e0041SJohan Hedberg } __packed;
24251c2e0041SJohan Hedberg 
24260493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
24270493684eSMarcel Holtmann struct hci_ev_io_capa_request {
24280493684eSMarcel Holtmann 	bdaddr_t bdaddr;
242966c853ccSGustavo F. Padovan } __packed;
24300493684eSMarcel Holtmann 
243103b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
243203b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
243303b555e1SJohan Hedberg 	bdaddr_t bdaddr;
243403b555e1SJohan Hedberg 	__u8     capability;
243503b555e1SJohan Hedberg 	__u8     oob_data;
243603b555e1SJohan Hedberg 	__u8     authentication;
243703b555e1SJohan Hedberg } __packed;
243803b555e1SJohan Hedberg 
2439a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
2440a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
2441a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
2442a5c29683SJohan Hedberg 	__le32		passkey;
2443a5c29683SJohan Hedberg } __packed;
2444a5c29683SJohan Hedberg 
24459ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
24469ad4019aSBrian Gix struct hci_ev_user_passkey_req {
24479ad4019aSBrian Gix 	bdaddr_t	bdaddr;
24489ad4019aSBrian Gix } __packed;
24499ad4019aSBrian Gix 
24502763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
24512763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
24522763eda6SSzymon Janc 	bdaddr_t bdaddr;
24532763eda6SSzymon Janc } __packed;
24542763eda6SSzymon Janc 
24550493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
24560493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
24570493684eSMarcel Holtmann 	__u8     status;
24580493684eSMarcel Holtmann 	bdaddr_t bdaddr;
245966c853ccSGustavo F. Padovan } __packed;
24600493684eSMarcel Holtmann 
246192a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
246292a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
246392a25256SJohan Hedberg 	bdaddr_t	bdaddr;
246492a25256SJohan Hedberg 	__le32		passkey;
246592a25256SJohan Hedberg } __packed;
246692a25256SJohan Hedberg 
246792a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
246892a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
246992a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
247092a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
247192a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
247292a25256SJohan Hedberg 
247392a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
247492a25256SJohan Hedberg struct hci_ev_keypress_notify {
247592a25256SJohan Hedberg 	bdaddr_t	bdaddr;
247692a25256SJohan Hedberg 	__u8		type;
247792a25256SJohan Hedberg } __packed;
247892a25256SJohan Hedberg 
247941a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
248041a96212SMarcel Holtmann struct hci_ev_remote_host_features {
248141a96212SMarcel Holtmann 	bdaddr_t bdaddr;
248241a96212SMarcel Holtmann 	__u8     features[8];
248366c853ccSGustavo F. Padovan } __packed;
248441a96212SMarcel Holtmann 
248563185f64SVille Tervo #define HCI_EV_LE_META			0x3e
248663185f64SVille Tervo struct hci_ev_le_meta {
248763185f64SVille Tervo 	__u8     subevent;
248863185f64SVille Tervo } __packed;
248963185f64SVille Tervo 
2490523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
2491523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
2492523e93cdSAndrei Emeltchenko 	__u8     status;
2493523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2494523e93cdSAndrei Emeltchenko } __packed;
2495523e93cdSAndrei Emeltchenko 
2496523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
2497523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
2498523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2499523e93cdSAndrei Emeltchenko } __packed;
2500523e93cdSAndrei Emeltchenko 
2501523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
2502523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2503523e93cdSAndrei Emeltchenko 	__u8     status;
2504523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2505523e93cdSAndrei Emeltchenko 	__u8     reason;
2506523e93cdSAndrei Emeltchenko } __packed;
2507523e93cdSAndrei Emeltchenko 
2508523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
2509523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2510523e93cdSAndrei Emeltchenko 	__u8     status;
2511523e93cdSAndrei Emeltchenko 	__le16   handle;
2512523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2513523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
2514523e93cdSAndrei Emeltchenko } __packed;
2515523e93cdSAndrei Emeltchenko 
2516523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
2517523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2518523e93cdSAndrei Emeltchenko 	__u8     status;
2519523e93cdSAndrei Emeltchenko 	__le16   handle;
2520523e93cdSAndrei Emeltchenko 	__u8     reason;
2521523e93cdSAndrei Emeltchenko } __packed;
2522523e93cdSAndrei Emeltchenko 
252325e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
252425e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
252525e89e99SAndrei Emeltchenko 	__le16   handle;
252625e89e99SAndrei Emeltchenko 	__le16   pkts;
252725e89e99SAndrei Emeltchenko 	__le16   blocks;
252825e89e99SAndrei Emeltchenko } __packed;
252925e89e99SAndrei Emeltchenko 
253025e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
253125e89e99SAndrei Emeltchenko 	__le16   num_blocks;
253225e89e99SAndrei Emeltchenko 	__u8     num_hndl;
2533a7e45454SGustavo A. R. Silva 	struct hci_comp_blocks_info handles[];
253425e89e99SAndrei Emeltchenko } __packed;
253525e89e99SAndrei Emeltchenko 
25362b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
25372b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
25382b359445SDoHyun Pyun 	__u8	status;
25392b359445SDoHyun Pyun } __packed;
25402b359445SDoHyun Pyun 
254176c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT	0x54
25422ed01805SDoHyun Pyun 
254363185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
254463185f64SVille Tervo struct hci_ev_le_conn_complete {
254563185f64SVille Tervo 	__u8     status;
254663185f64SVille Tervo 	__le16   handle;
254763185f64SVille Tervo 	__u8     role;
254863185f64SVille Tervo 	__u8     bdaddr_type;
254963185f64SVille Tervo 	bdaddr_t bdaddr;
255063185f64SVille Tervo 	__le16   interval;
255163185f64SVille Tervo 	__le16   latency;
255263185f64SVille Tervo 	__le16   supervision_timeout;
255363185f64SVille Tervo 	__u8     clk_accurancy;
255463185f64SVille Tervo } __packed;
255563185f64SVille Tervo 
25562331fd46SMarcel Holtmann /* Advertising report event types */
25572331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
25582331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
25592331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
25602331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
25612331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
2562c215e939SJaganath Kanakkassery #define LE_ADV_INVALID		0x05
2563c215e939SJaganath Kanakkassery 
2564c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2565c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND		0x0013
2566c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 	0x0015
2567c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND		0x0012
2568c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND		0x0010
2569c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV		0x001b
2570c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN	0x001a
25712331fd46SMarcel Holtmann 
2572b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2573b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND		0x0000
2574b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND		0x0001
2575b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND		0x0002
2576b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND		0x0004
2577b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP		0x0008
2578b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU		0x0010
2579b2cc9761SJaganath Kanakkassery 
25802331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC		0x00
25812331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM		0x01
25826540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED	0x02
25836540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED	0x03
25842331fd46SMarcel Holtmann 
25852331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
25862331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
258747afe93cSLuiz Augusto von Dentz 	__u8	 type;
25882331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
25892331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
25902331fd46SMarcel Holtmann 	__u8	 length;
2591a7e45454SGustavo A. R. Silva 	__u8	 data[];
25922331fd46SMarcel Holtmann } __packed;
25932331fd46SMarcel Holtmann 
259447afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_report {
259547afe93cSLuiz Augusto von Dentz 	__u8    num;
259647afe93cSLuiz Augusto von Dentz 	struct hci_ev_le_advertising_info info[];
259747afe93cSLuiz Augusto von Dentz } __packed;
259847afe93cSLuiz Augusto von Dentz 
25991855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
26001855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
26011855d92dSMarcel Holtmann 	__u8     status;
26021855d92dSMarcel Holtmann 	__le16   handle;
26031855d92dSMarcel Holtmann 	__le16   interval;
26041855d92dSMarcel Holtmann 	__le16   latency;
26051855d92dSMarcel Holtmann 	__le16   supervision_timeout;
26061855d92dSMarcel Holtmann } __packed;
26071855d92dSMarcel Holtmann 
26080fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
26090fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
26100fe29fd1SMarcel Holtmann 	__u8     status;
26110fe29fd1SMarcel Holtmann 	__le16   handle;
26120fe29fd1SMarcel Holtmann 	__u8     features[8];
26130fe29fd1SMarcel Holtmann } __packed;
26140fe29fd1SMarcel Holtmann 
2615a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
2616a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2617a7a595f6SVinicius Costa Gomes 	__le16	handle;
2618fe39c7b2SMarcel Holtmann 	__le64	rand;
2619a7a595f6SVinicius Costa Gomes 	__le16	ediv;
2620a7a595f6SVinicius Costa Gomes } __packed;
2621a7a595f6SVinicius Costa Gomes 
26228e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
26238e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
26248e75b46aSAndre Guedes 	__le16 handle;
26258e75b46aSAndre Guedes 	__le16 interval_min;
26268e75b46aSAndre Guedes 	__le16 interval_max;
26278e75b46aSAndre Guedes 	__le16 latency;
26288e75b46aSAndre Guedes 	__le16 timeout;
26298e75b46aSAndre Guedes } __packed;
26308e75b46aSAndre Guedes 
263194a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
263294a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
263394a3bd02SMarcel Holtmann 	__le16	handle;
263494a3bd02SMarcel Holtmann 	__le16	tx_len;
263594a3bd02SMarcel Holtmann 	__le16	tx_time;
263694a3bd02SMarcel Holtmann 	__le16	rx_len;
263794a3bd02SMarcel Holtmann 	__le16	rx_time;
263894a3bd02SMarcel Holtmann } __packed;
263994a3bd02SMarcel Holtmann 
264032c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
264132c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
2642a3679649SLuiz Augusto von Dentz 	__u8	 type;
264332c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
264432c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
264532c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
264632c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
264732c9d43fSMarcel Holtmann 	__s8	 rssi;
264832c9d43fSMarcel Holtmann } __packed;
264932c9d43fSMarcel Holtmann 
2650a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_report {
2651a3679649SLuiz Augusto von Dentz 	__u8	 num;
2652a3679649SLuiz Augusto von Dentz 	struct hci_ev_le_direct_adv_info info[];
2653a3679649SLuiz Augusto von Dentz } __packed;
2654a3679649SLuiz Augusto von Dentz 
26551efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE	0x0c
26561efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete {
26571efd927dSLuiz Augusto von Dentz 	__u8  status;
26584de0fc59SLuiz Augusto von Dentz 	__le16 handle;
26591efd927dSLuiz Augusto von Dentz 	__u8  tx_phy;
26601efd927dSLuiz Augusto von Dentz 	__u8  rx_phy;
26611efd927dSLuiz Augusto von Dentz } __packed;
26621efd927dSLuiz Augusto von Dentz 
2663c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT    0x0d
2664b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info {
2665b48b833fSLuiz Augusto von Dentz 	__le16   type;
2666c215e939SJaganath Kanakkassery 	__u8	 bdaddr_type;
2667c215e939SJaganath Kanakkassery 	bdaddr_t bdaddr;
2668c215e939SJaganath Kanakkassery 	__u8	 primary_phy;
2669c215e939SJaganath Kanakkassery 	__u8	 secondary_phy;
2670c215e939SJaganath Kanakkassery 	__u8	 sid;
2671c215e939SJaganath Kanakkassery 	__u8	 tx_power;
2672c215e939SJaganath Kanakkassery 	__s8	 rssi;
2673c215e939SJaganath Kanakkassery 	__le16   interval;
2674c215e939SJaganath Kanakkassery 	__u8     direct_addr_type;
2675c215e939SJaganath Kanakkassery 	bdaddr_t direct_addr;
2676c215e939SJaganath Kanakkassery 	__u8     length;
2677a7e45454SGustavo A. R. Silva 	__u8     data[];
2678c215e939SJaganath Kanakkassery } __packed;
2679c215e939SJaganath Kanakkassery 
2680b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_report {
2681b48b833fSLuiz Augusto von Dentz 	__u8     num;
2682b48b833fSLuiz Augusto von Dentz 	struct hci_ev_le_ext_adv_info info[];
2683b48b833fSLuiz Augusto von Dentz } __packed;
2684b48b833fSLuiz Augusto von Dentz 
2685*eca0ae4aSLuiz Augusto von Dentz #define HCI_EV_LE_PA_SYNC_ESTABLISHED	0x0e
2686*eca0ae4aSLuiz Augusto von Dentz struct hci_ev_le_pa_sync_established {
2687*eca0ae4aSLuiz Augusto von Dentz 	__u8      status;
2688*eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
2689*eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
2690*eca0ae4aSLuiz Augusto von Dentz 	__u8      bdaddr_type;
2691*eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2692*eca0ae4aSLuiz Augusto von Dentz 	__u8      phy;
2693*eca0ae4aSLuiz Augusto von Dentz 	__le16    interval;
2694*eca0ae4aSLuiz Augusto von Dentz 	__u8      clock_accuracy;
2695*eca0ae4aSLuiz Augusto von Dentz } __packed;
2696*eca0ae4aSLuiz Augusto von Dentz 
26974d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE    0x0a
26984d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
26994d94f95dSJaganath Kanakkassery 	__u8      status;
27004d94f95dSJaganath Kanakkassery 	__le16    handle;
27014d94f95dSJaganath Kanakkassery 	__u8      role;
27024d94f95dSJaganath Kanakkassery 	__u8      bdaddr_type;
27034d94f95dSJaganath Kanakkassery 	bdaddr_t  bdaddr;
27044d94f95dSJaganath Kanakkassery 	bdaddr_t  local_rpa;
27054d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_rpa;
27064d94f95dSJaganath Kanakkassery 	__le16    interval;
27074d94f95dSJaganath Kanakkassery 	__le16    latency;
27084d94f95dSJaganath Kanakkassery 	__le16    supervision_timeout;
27094d94f95dSJaganath Kanakkassery 	__u8      clk_accurancy;
27104d94f95dSJaganath Kanakkassery } __packed;
27114d94f95dSJaganath Kanakkassery 
2712acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM	0x12
2713acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2714acf0aeaeSJaganath Kanakkassery 	__u8	status;
2715acf0aeaeSJaganath Kanakkassery 	__u8	handle;
2716acf0aeaeSJaganath Kanakkassery 	__le16	conn_handle;
2717acf0aeaeSJaganath Kanakkassery 	__u8	num_evts;
2718acf0aeaeSJaganath Kanakkassery } __packed;
2719acf0aeaeSJaganath Kanakkassery 
27204de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED	0x19
27214de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established {
27224de0fc59SLuiz Augusto von Dentz 	__u8  status;
27234de0fc59SLuiz Augusto von Dentz 	__le16 handle;
27244de0fc59SLuiz Augusto von Dentz 	__u8  cig_sync_delay[3];
27254de0fc59SLuiz Augusto von Dentz 	__u8  cis_sync_delay[3];
272676c185a5SArchie Pusaka 	__u8  c_latency[3];
272776c185a5SArchie Pusaka 	__u8  p_latency[3];
272876c185a5SArchie Pusaka 	__u8  c_phy;
272976c185a5SArchie Pusaka 	__u8  p_phy;
27304de0fc59SLuiz Augusto von Dentz 	__u8  nse;
273176c185a5SArchie Pusaka 	__u8  c_bn;
273276c185a5SArchie Pusaka 	__u8  p_bn;
273376c185a5SArchie Pusaka 	__u8  c_ft;
273476c185a5SArchie Pusaka 	__u8  p_ft;
273576c185a5SArchie Pusaka 	__le16 c_mtu;
273676c185a5SArchie Pusaka 	__le16 p_mtu;
27374de0fc59SLuiz Augusto von Dentz 	__le16 interval;
27384de0fc59SLuiz Augusto von Dentz } __packed;
27394de0fc59SLuiz Augusto von Dentz 
27404de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ		0x1a
27414de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req {
27424de0fc59SLuiz Augusto von Dentz 	__le16 acl_handle;
27434de0fc59SLuiz Augusto von Dentz 	__le16 cis_handle;
27444de0fc59SLuiz Augusto von Dentz 	__u8  cig_id;
27454de0fc59SLuiz Augusto von Dentz 	__u8  cis_id;
27464de0fc59SLuiz Augusto von Dentz } __packed;
27474de0fc59SLuiz Augusto von Dentz 
2748*eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_CREATE_BIG_COMPLETE	0x1b
2749*eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_create_big_complete {
2750*eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2751*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2752*eca0ae4aSLuiz Augusto von Dentz 	__u8    sync_delay[3];
2753*eca0ae4aSLuiz Augusto von Dentz 	__u8    transport_delay[3];
2754*eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2755*eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2756*eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2757*eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2758*eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2759*eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2760*eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2761*eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2762*eca0ae4aSLuiz Augusto von Dentz 	__le16  bis_handle[];
2763*eca0ae4aSLuiz Augusto von Dentz } __packed;
2764*eca0ae4aSLuiz Augusto von Dentz 
2765*eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_SYNC_ESTABILISHED 0x1d
2766*eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_sync_estabilished {
2767*eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2768*eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2769*eca0ae4aSLuiz Augusto von Dentz 	__u8    latency[3];
2770*eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2771*eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2772*eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2773*eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2774*eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2775*eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2776*eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2777*eca0ae4aSLuiz Augusto von Dentz 	__le16  bis[];
2778*eca0ae4aSLuiz Augusto von Dentz } __packed;
2779*eca0ae4aSLuiz Augusto von Dentz 
2780*eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_INFO_ADV_REPORT	0x22
2781*eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_info_adv_report {
2782*eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2783*eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2784*eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2785*eca0ae4aSLuiz Augusto von Dentz 	__le16  iso_interval;
2786*eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2787*eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2788*eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2789*eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2790*eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2791*eca0ae4aSLuiz Augusto von Dentz 	__le16  max_sdu;
2792*eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2793*eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2794*eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2795*eca0ae4aSLuiz Augusto von Dentz } __packed;
2796*eca0ae4aSLuiz Augusto von Dentz 
2797e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR			0xff
2798e4cc5a18SMarcel Holtmann 
27991da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2800a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
28011da177e4SLinus Torvalds struct hci_ev_stack_internal {
28021da177e4SLinus Torvalds 	__u16    type;
2803a7e45454SGustavo A. R. Silva 	__u8     data[];
280466c853ccSGustavo F. Padovan } __packed;
28051da177e4SLinus Torvalds 
28061da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
28071da177e4SLinus Torvalds struct hci_ev_si_device {
28081da177e4SLinus Torvalds 	__u16    event;
28091da177e4SLinus Torvalds 	__u16    dev_id;
281066c853ccSGustavo F. Padovan } __packed;
28111da177e4SLinus Torvalds 
28121da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
28131da177e4SLinus Torvalds struct hci_ev_si_security {
28141da177e4SLinus Torvalds 	__u16    event;
28151da177e4SLinus Torvalds 	__u16    proto;
28161da177e4SLinus Torvalds 	__u16    subproto;
28171da177e4SLinus Torvalds 	__u8     incoming;
281866c853ccSGustavo F. Padovan } __packed;
28191da177e4SLinus Torvalds 
28201da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
28211da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
28221da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
28231da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
28241da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
28254de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE     4
28261da177e4SLinus Torvalds 
28271da177e4SLinus Torvalds struct hci_command_hdr {
28281ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
28291da177e4SLinus Torvalds 	__u8	plen;
283066c853ccSGustavo F. Padovan } __packed;
28311da177e4SLinus Torvalds 
28321da177e4SLinus Torvalds struct hci_event_hdr {
28331da177e4SLinus Torvalds 	__u8	evt;
28341da177e4SLinus Torvalds 	__u8	plen;
283566c853ccSGustavo F. Padovan } __packed;
28361da177e4SLinus Torvalds 
28371da177e4SLinus Torvalds struct hci_acl_hdr {
28381ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
28391ebb9252SMarcel Holtmann 	__le16	dlen;
284066c853ccSGustavo F. Padovan } __packed;
28411da177e4SLinus Torvalds 
28421da177e4SLinus Torvalds struct hci_sco_hdr {
28431ebb9252SMarcel Holtmann 	__le16	handle;
28441da177e4SLinus Torvalds 	__u8	dlen;
284566c853ccSGustavo F. Padovan } __packed;
28461da177e4SLinus Torvalds 
28474de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr {
28484de0fc59SLuiz Augusto von Dentz 	__le16	handle;
28494de0fc59SLuiz Augusto von Dentz 	__le16	dlen;
2850a7e45454SGustavo A. R. Silva 	__u8	data[];
28514de0fc59SLuiz Augusto von Dentz } __packed;
28524de0fc59SLuiz Augusto von Dentz 
28534de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */
28544de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID	0x00
28554de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID	0x01
28564de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP	0x02
28574de0fc59SLuiz Augusto von Dentz 
28584de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE	4
28594de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr {
28604de0fc59SLuiz Augusto von Dentz 	__le16	sn;
28614de0fc59SLuiz Augusto von Dentz 	__le16	slen;
28624de0fc59SLuiz Augusto von Dentz };
28634de0fc59SLuiz Augusto von Dentz 
28644de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8
28654de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr {
28664de0fc59SLuiz Augusto von Dentz 	__le32	ts;
28674de0fc59SLuiz Augusto von Dentz 	__le16	sn;
28684de0fc59SLuiz Augusto von Dentz 	__le16	slen;
28694de0fc59SLuiz Augusto von Dentz };
28704de0fc59SLuiz Augusto von Dentz 
28712a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
28722a123b86SArnaldo Carvalho de Melo {
28732a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
28742a123b86SArnaldo Carvalho de Melo }
28752a123b86SArnaldo Carvalho de Melo 
28762a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
28772a123b86SArnaldo Carvalho de Melo {
28782a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
28792a123b86SArnaldo Carvalho de Melo }
28802a123b86SArnaldo Carvalho de Melo 
28812a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
28822a123b86SArnaldo Carvalho de Melo {
28832a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
28842a123b86SArnaldo Carvalho de Melo }
28852a123b86SArnaldo Carvalho de Melo 
28861da177e4SLinus Torvalds /* Command opcode pack/unpack */
2887c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
28881da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
28891da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
28901da177e4SLinus Torvalds 
28911da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2892c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
28931da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
28941da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
28951da177e4SLinus Torvalds 
28964de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */
28974de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f)		(f & 0x0003)
28984de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f)		((f >> 2) & 0x0001)
28994de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts)	((pb & 0x03) | ((ts & 0x01) << 2))
29004de0fc59SLuiz Augusto von Dentz 
29014de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */
29024de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f)	((__u16) ((h) | ((f) << 14)))
29034de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h)		((h) & 0x3fff)
29044de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h)		((h) >> 14)
29054de0fc59SLuiz Augusto von Dentz 
2906248733e8SKiran K /* codec transport types */
2907248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO	0x01
2908248733e8SKiran K 
29095cbd3ebdSAlain Michaud /* le24 support */
29105cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3])
29115cbd3ebdSAlain Michaud {
29125cbd3ebdSAlain Michaud 	dst[0] = val & 0xff;
29135cbd3ebdSAlain Michaud 	dst[1] = (val & 0xff00) >> 8;
29145cbd3ebdSAlain Michaud 	dst[2] = (val & 0xff0000) >> 16;
29155cbd3ebdSAlain Michaud }
29165cbd3ebdSAlain Michaud 
29171da177e4SLinus Torvalds #endif /* __HCI_H */
2918