xref: /openbmc/linux/include/net/bluetooth/hci.h (revision aa12af77aae05008b3e637b85944dcd512f75eba)
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
301da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE	260
311da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE	(HCI_MAX_ACL_SIZE + 4)
321da177e4SLinus Torvalds 
339b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE	16
34523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE	(2 * HCI_LINK_KEY_SIZE)
359b3b4460SAndrei Emeltchenko 
36903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE	672
37903e4541SAndrei Emeltchenko 
387d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE	252
397d1dab49SDoHyun Pyun 
401da177e4SLinus Torvalds /* HCI dev events */
411da177e4SLinus Torvalds #define HCI_DEV_REG			1
421da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
431da177e4SLinus Torvalds #define HCI_DEV_UP			3
441da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
451da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
461da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
474a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN			7
484a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE			8
49e131d74aSMarcel Holtmann #define HCI_DEV_SETUP			9
501da177e4SLinus Torvalds 
511da177e4SLinus Torvalds /* HCI notify events */
521da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
541da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
551da177e4SLinus Torvalds 
56c13854ceSMarcel Holtmann /* HCI bus types */
570ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
581da177e4SLinus Torvalds #define HCI_USB		1
591da177e4SLinus Torvalds #define HCI_PCCARD	2
601da177e4SLinus Torvalds #define HCI_UART	3
611da177e4SLinus Torvalds #define HCI_RS232	4
621da177e4SLinus Torvalds #define HCI_PCI		5
630ac53939SMarcel Holtmann #define HCI_SDIO	6
645c0e03cdSJohan Hedberg #define HCI_SPI		7
655c0e03cdSJohan Hedberg #define HCI_I2C		8
6665010e68SBjorn Andersson #define HCI_SMD		9
671da177e4SLinus Torvalds 
68943da25dSMarcel Holtmann /* HCI controller types */
69ca8bee5dSMarcel Holtmann #define HCI_PRIMARY	0x00
708f1e1742SDavid Vrabel #define HCI_AMP		0x01
71943da25dSMarcel Holtmann 
728598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
736ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
748598d064SAndrei Emeltchenko 
757c13823dSMarcel Holtmann /* AMP controller types */
767c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
777c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
787c13823dSMarcel Holtmann 
79ab846ec4SAndrei Emeltchenko /* AMP controller status */
80536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
81536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
82536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
83536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
84536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
85536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
86536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
87ab846ec4SAndrei Emeltchenko 
881da177e4SLinus Torvalds /* HCI device quirks */
891da177e4SLinus Torvalds enum {
90118305b5SMarcel Holtmann 	/* When this quirk is set, the HCI Reset command is send when
91118305b5SMarcel Holtmann 	 * closing the transport instead of when opening it.
92118305b5SMarcel Holtmann 	 *
93118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
94118305b5SMarcel Holtmann 	 */
95a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
96118305b5SMarcel Holtmann 
97118305b5SMarcel Holtmann 	/* When this quirk is set, the device is turned into a raw-only
98118305b5SMarcel Holtmann 	 * device and it will stay in unconfigured state.
99118305b5SMarcel Holtmann 	 *
100118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
101118305b5SMarcel Holtmann 	 */
102da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
103118305b5SMarcel Holtmann 
104118305b5SMarcel Holtmann 	/* When this quirk is set, the buffer sizes reported by
105118305b5SMarcel Holtmann 	 * HCI Read Buffer Size command are corrected if invalid.
106118305b5SMarcel Holtmann 	 *
107118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
108118305b5SMarcel Holtmann 	 */
109f9f462faSMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE,
110118305b5SMarcel Holtmann 
111043ec9bfSMarcel Holtmann 	/* When this quirk is set, then a controller that does not
112043ec9bfSMarcel Holtmann 	 * indicate support for Inquiry Result with RSSI is assumed to
113043ec9bfSMarcel Holtmann 	 * support it anyway. Some early Bluetooth 1.2 controllers had
114043ec9bfSMarcel Holtmann 	 * wrongly configured local features that will require forcing
115043ec9bfSMarcel Holtmann 	 * them to enable this mode. Getting RSSI information with the
116043ec9bfSMarcel Holtmann 	 * inquiry responses is preferred since it allows for a better
117043ec9bfSMarcel Holtmann 	 * user expierence.
118043ec9bfSMarcel Holtmann 	 *
119043ec9bfSMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
120043ec9bfSMarcel Holtmann 	 */
121043ec9bfSMarcel Holtmann 	HCI_QUIRK_FIXUP_INQUIRY_MODE,
122043ec9bfSMarcel Holtmann 
123711ffa78SMarcel Holtmann 	/* When this quirk is set, then the HCI Read Local Supported
124711ffa78SMarcel Holtmann 	 * Commands command is not supported. In general Bluetooth 1.2
125711ffa78SMarcel Holtmann 	 * and later controllers should support this command. However
126711ffa78SMarcel Holtmann 	 * some controllers indicate Bluetooth 1.2 support, but do
127711ffa78SMarcel Holtmann 	 * not support this command.
128711ffa78SMarcel Holtmann 	 *
129711ffa78SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
130711ffa78SMarcel Holtmann 	 */
131711ffa78SMarcel Holtmann 	HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
132711ffa78SMarcel Holtmann 
133118305b5SMarcel Holtmann 	/* When this quirk is set, then no stored link key handling
134118305b5SMarcel Holtmann 	 * is performed. This is mainly due to the fact that the
135118305b5SMarcel Holtmann 	 * HCI Delete Stored Link Key command is advertised, but
136118305b5SMarcel Holtmann 	 * not supported.
137118305b5SMarcel Holtmann 	 *
138118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
139118305b5SMarcel Holtmann 	 */
140f9f462faSMarcel Holtmann 	HCI_QUIRK_BROKEN_STORED_LINK_KEY,
14189bc22d2SMarcel Holtmann 
142eb1904f4SMarcel Holtmann 	/* When this quirk is set, an external configuration step
143eb1904f4SMarcel Holtmann 	 * is required and will be indicated with the controller
144eb1904f4SMarcel Holtmann 	 * configuation.
145eb1904f4SMarcel Holtmann 	 *
146eb1904f4SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
147eb1904f4SMarcel Holtmann 	 * during the hdev->setup vendor callback.
148eb1904f4SMarcel Holtmann 	 */
149eb1904f4SMarcel Holtmann 	HCI_QUIRK_EXTERNAL_CONFIG,
150eb1904f4SMarcel Holtmann 
15189bc22d2SMarcel Holtmann 	/* When this quirk is set, the public Bluetooth address
15289bc22d2SMarcel Holtmann 	 * initially reported by HCI Read BD Address command
15389bc22d2SMarcel Holtmann 	 * is considered invalid. Controller configuration is
15489bc22d2SMarcel Holtmann 	 * required before this device can be used.
15589bc22d2SMarcel Holtmann 	 *
15689bc22d2SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
15789bc22d2SMarcel Holtmann 	 * during the hdev->setup vendor callback.
15889bc22d2SMarcel Holtmann 	 */
15989bc22d2SMarcel Holtmann 	HCI_QUIRK_INVALID_BDADDR,
16043d6bc46SMarcel Holtmann 
16143d6bc46SMarcel Holtmann 	/* When this quirk is set, the duplicate filtering during
16243d6bc46SMarcel Holtmann 	 * scanning is based on Bluetooth devices addresses. To allow
16343d6bc46SMarcel Holtmann 	 * RSSI based updates, restart scanning if needed.
16443d6bc46SMarcel Holtmann 	 *
16543d6bc46SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
16643d6bc46SMarcel Holtmann 	 * during the hdev->setup vendor callback.
16743d6bc46SMarcel Holtmann 	 */
16843d6bc46SMarcel Holtmann 	HCI_QUIRK_STRICT_DUPLICATE_FILTER,
169695c4cb6SJakub Pawlowski 
170695c4cb6SJakub Pawlowski 	/* When this quirk is set, LE scan and BR/EDR inquiry is done
171695c4cb6SJakub Pawlowski 	 * simultaneously, otherwise it's interleaved.
172695c4cb6SJakub Pawlowski 	 *
173695c4cb6SJakub Pawlowski 	 * This quirk can be set before hci_register_dev is called or
174695c4cb6SJakub Pawlowski 	 * during the hdev->setup vendor callback.
175695c4cb6SJakub Pawlowski 	 */
176695c4cb6SJakub Pawlowski 	HCI_QUIRK_SIMULTANEOUS_DISCOVERY,
1777e995b9eSMarcel Holtmann 
1787e995b9eSMarcel Holtmann 	/* When this quirk is set, the enabling of diagnostic mode is
1797e995b9eSMarcel Holtmann 	 * not persistent over HCI Reset. Every time the controller
1807e995b9eSMarcel Holtmann 	 * is brought up it needs to be reprogrammed.
1817e995b9eSMarcel Holtmann 	 *
1827e995b9eSMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
1837e995b9eSMarcel Holtmann 	 * during the hdev->setup vendor callback.
1847e995b9eSMarcel Holtmann 	 */
1857e995b9eSMarcel Holtmann 	HCI_QUIRK_NON_PERSISTENT_DIAG,
186740011cfSSean Wang 
187740011cfSSean Wang 	/* When this quirk is set, setup() would be run after every
188740011cfSSean Wang 	 * open() and not just after the first open().
189740011cfSSean Wang 	 *
190740011cfSSean Wang 	 * This quirk can be set before hci_register_dev is called or
191740011cfSSean Wang 	 * during the hdev->setup vendor callback.
192740011cfSSean Wang 	 *
193740011cfSSean Wang 	 */
194740011cfSSean Wang 	HCI_QUIRK_NON_PERSISTENT_SETUP,
1951da177e4SLinus Torvalds };
1961da177e4SLinus Torvalds 
1971da177e4SLinus Torvalds /* HCI device flags */
1981da177e4SLinus Torvalds enum {
1991da177e4SLinus Torvalds 	HCI_UP,
2001da177e4SLinus Torvalds 	HCI_INIT,
2011da177e4SLinus Torvalds 	HCI_RUNNING,
2021da177e4SLinus Torvalds 
2031da177e4SLinus Torvalds 	HCI_PSCAN,
2041da177e4SLinus Torvalds 	HCI_ISCAN,
2051da177e4SLinus Torvalds 	HCI_AUTH,
2061da177e4SLinus Torvalds 	HCI_ENCRYPT,
2071da177e4SLinus Torvalds 	HCI_INQUIRY,
2081da177e4SLinus Torvalds 
2091da177e4SLinus Torvalds 	HCI_RAW,
210ab81cbf9SJohan Hedberg 
21110572132SGustavo F. Padovan 	HCI_RESET,
2121da177e4SLinus Torvalds };
2131da177e4SLinus Torvalds 
214f9207338SMarcel Holtmann /* HCI socket flags */
215f9207338SMarcel Holtmann enum {
21650ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
217f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
218f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
219ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
220321c6feeSMarcel Holtmann 	HCI_MGMT_EXT_INFO_EVENTS,
2215504c3a3SMarcel Holtmann 	HCI_MGMT_OPTION_EVENTS,
2225504c3a3SMarcel Holtmann 	HCI_MGMT_SETTING_EVENTS,
2235504c3a3SMarcel Holtmann 	HCI_MGMT_DEV_CLASS_EVENTS,
2245504c3a3SMarcel Holtmann 	HCI_MGMT_LOCAL_NAME_EVENTS,
22572000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
226f9207338SMarcel Holtmann };
227f9207338SMarcel Holtmann 
228d23264a8SAndre Guedes /*
229d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
230d23264a8SAndre Guedes  * states from the controller.
231d23264a8SAndre Guedes  */
232d23264a8SAndre Guedes enum {
233a8b2d5c2SJohan Hedberg 	HCI_SETUP,
234d603b76bSMarcel Holtmann 	HCI_CONFIG,
235a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
2365e130367SJohan Hedberg 	HCI_RFKILLED,
237a8b2d5c2SJohan Hedberg 	HCI_MGMT,
238b6ae8457SJohan Hedberg 	HCI_BONDABLE,
239a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
2400663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
2413769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
24294324962SJohan Hovold 	HCI_UNREGISTER,
2434a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
2440736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
245dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
24666c417c1SJohan Hedberg 	HCI_LE_ADV,
247d23264a8SAndre Guedes 	HCI_LE_SCAN,
24884bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
249e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
250134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
251863efaf2SJohan Hedberg 	HCI_PRIVACY,
25282a37adeSJohan Hedberg 	HCI_LIMITED_PRIVACY,
253d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
25441edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
2556d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
25606199cf8SJohan Hedberg 	HCI_LE_ENABLED,
257f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
258cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
2595e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
2605e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
2616acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
26247990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
26321693c15SAndre Guedes 	HCI_PERIODIC_INQ,
2641a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
26556f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
26681ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
267b7cb93e5SMarcel Holtmann 
268b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
2694b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
270b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
271b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
272*aa12af77SAnkit Navik 	HCI_LL_RPA_RESOLUTION,
273b7cb93e5SMarcel Holtmann 
274eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
275d23264a8SAndre Guedes };
276d23264a8SAndre Guedes 
2771da177e4SLinus Torvalds /* HCI timeouts */
2785f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
2795f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
2805f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
281d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
2825f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
2839345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
284a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
2859489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
2861f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
2871da177e4SLinus Torvalds 
2885b7f9909SMarcel Holtmann /* HCI data types */
2891da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
2901da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
2911da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
2921da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
293e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
2941da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
2951da177e4SLinus Torvalds 
2965b7f9909SMarcel Holtmann /* HCI packet types */
2971da177e4SLinus Torvalds #define HCI_DM1		0x0008
2981da177e4SLinus Torvalds #define HCI_DM3		0x0400
2991da177e4SLinus Torvalds #define HCI_DM5		0x4000
3001da177e4SLinus Torvalds #define HCI_DH1		0x0010
3011da177e4SLinus Torvalds #define HCI_DH3		0x0800
3021da177e4SLinus Torvalds #define HCI_DH5		0x8000
3031da177e4SLinus Torvalds 
3045075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
3055075b972SJaganath Kanakkassery #define HCI_2DH1	0x0002
3065075b972SJaganath Kanakkassery #define HCI_3DH1	0x0004
3075075b972SJaganath Kanakkassery #define HCI_2DH3	0x0100
3085075b972SJaganath Kanakkassery #define HCI_3DH3	0x0200
3095075b972SJaganath Kanakkassery #define HCI_2DH5	0x1000
3105075b972SJaganath Kanakkassery #define HCI_3DH5	0x2000
3115075b972SJaganath Kanakkassery 
3121da177e4SLinus Torvalds #define HCI_HV1		0x0020
3131da177e4SLinus Torvalds #define HCI_HV2		0x0040
3141da177e4SLinus Torvalds #define HCI_HV3		0x0080
3151da177e4SLinus Torvalds 
3161da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
3171da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
3181da177e4SLinus Torvalds 
3195b7f9909SMarcel Holtmann /* eSCO packet types */
3205b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
3215b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
3225b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
3235b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
3245b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
3255b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
326efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
327efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
328efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
329efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
3305b7f9909SMarcel Holtmann 
331a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
332efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
333a8746417SMarcel Holtmann 
3341da177e4SLinus Torvalds /* ACL flags */
335e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
3361da177e4SLinus Torvalds #define ACL_CONT		0x01
3371da177e4SLinus Torvalds #define ACL_START		0x02
338d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
3391da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
3401da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
3411da177e4SLinus Torvalds 
3421da177e4SLinus Torvalds /* Baseband links */
3431da177e4SLinus Torvalds #define SCO_LINK	0x00
3441da177e4SLinus Torvalds #define ACL_LINK	0x01
3455b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
346fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
347fcd89c09SVille Tervo #define LE_LINK		0x80
3483161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
349845472e8SMarcel Holtmann #define INVALID_LINK	0xff
3501da177e4SLinus Torvalds 
3511da177e4SLinus Torvalds /* LMP features */
3521da177e4SLinus Torvalds #define LMP_3SLOT	0x01
3531da177e4SLinus Torvalds #define LMP_5SLOT	0x02
3541da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
3551da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
3561da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
3571da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
3581da177e4SLinus Torvalds #define LMP_HOLD	0x40
35904837f64SMarcel Holtmann #define LMP_SNIFF	0x80
3601da177e4SLinus Torvalds 
3611da177e4SLinus Torvalds #define LMP_PARK	0x01
3621da177e4SLinus Torvalds #define LMP_RSSI	0x02
3631da177e4SLinus Torvalds #define LMP_QUALITY	0x04
3641da177e4SLinus Torvalds #define LMP_SCO		0x08
3651da177e4SLinus Torvalds #define LMP_HV2		0x10
3661da177e4SLinus Torvalds #define LMP_HV3		0x20
3671da177e4SLinus Torvalds #define LMP_ULAW	0x40
3681da177e4SLinus Torvalds #define LMP_ALAW	0x80
3691da177e4SLinus Torvalds 
3701da177e4SLinus Torvalds #define LMP_CVSD	0x01
3711da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
3721da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
37307a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
3741da177e4SLinus Torvalds 
3755075b972SJaganath Kanakkassery #define LMP_EDR_2M		0x02
3765075b972SJaganath Kanakkassery #define LMP_EDR_3M		0x04
377d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
3785b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
3795b7f9909SMarcel Holtmann 
3805b7f9909SMarcel Holtmann #define LMP_EV4		0x01
3815b7f9909SMarcel Holtmann #define LMP_EV5		0x02
38269ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
383d5859e22SJohan Hedberg #define LMP_LE		0x40
3845075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT	0x80
3855b7f9909SMarcel Holtmann 
3865075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT	0x01
38704837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
388d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
389efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
390efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
391efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
39204837f64SMarcel Holtmann 
393d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
394e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
395769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
396e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
397769be974SMarcel Holtmann 
398d5859e22SJohan Hedberg #define LMP_LSTO	0x01
399d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
400971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
401d5859e22SJohan Hedberg 
402eead27daSAndre Guedes /* Extended LMP features */
40353b834d2SMarcel Holtmann #define LMP_CSB_MASTER	0x01
40453b834d2SMarcel Holtmann #define LMP_CSB_SLAVE	0x02
40553b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN	0x04
40653b834d2SMarcel Holtmann #define LMP_SYNC_SCAN	0x08
40753b834d2SMarcel Holtmann 
408d5991585SMarcel Holtmann #define LMP_SC		0x01
409d5991585SMarcel Holtmann #define LMP_PING	0x02
410d5991585SMarcel Holtmann 
41153b834d2SMarcel Holtmann /* Host features */
412cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
413eead27daSAndre Guedes #define LMP_HOST_LE		0x02
414cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
415d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
416eead27daSAndre Guedes 
417662bc2e6SAndre Guedes /* LE features */
4180da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
419662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
4200fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES		0x08
421cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
42294a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
42385a721a8SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
42485a721a8SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
4256b49bcb4SJaganath Kanakkassery #define HCI_LE_EXT_ADV			0x10
4264b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
4275075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
4285075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
4299756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2		0x40
430662bc2e6SAndre Guedes 
43104837f64SMarcel Holtmann /* Connection modes */
43204837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
43304837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
43404837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
43504837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
43604837f64SMarcel Holtmann 
4371da177e4SLinus Torvalds /* Link policies */
4381da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
4391da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
4401da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
4411da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
4421da177e4SLinus Torvalds 
44304837f64SMarcel Holtmann /* Link modes */
4441da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
4451da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
4461da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
4471da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
4481da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
4491da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
4501da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
4517b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
4521da177e4SLinus Torvalds 
45340be492fSMarcel Holtmann /* Authentication types */
45440be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
45540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
45640be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
45740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
45840be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
45940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
46040be492fSMarcel Holtmann 
461a77b15a6SMikel Astiz /* I/O capabilities */
462a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
463a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
464a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
465a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
466a77b15a6SMikel Astiz 
467b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
468b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
469b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
470b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
471b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
47211015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
47311015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
474b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
47511015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
47611015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
477b6020ba0SWaldemar Rymarkiewicz 
4789f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
4798e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
4809f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
481160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING	0x06
4822acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
483cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
484d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
4859f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
4869f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
487cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
488cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
4899f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
4909f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
4914ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS	0x1e
4924ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED		0x1f
4933c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
4949f5a0d7bSAndrei Emeltchenko 
4952455a3eaSAndrei Emeltchenko /* Flow control modes */
4962455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
4972455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
4982455a3eaSAndrei Emeltchenko 
499bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
500bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
501a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
502bbaf444aSJohan Hedberg 
503ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
504ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
505ba165a90SJohan Hedberg 
50632748db0SJohan Hedberg /* Extended Inquiry Response field types */
50732748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
50832748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
50932748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
51032748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
51132748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
51232748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
51332748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
51432748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
51532748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
51632748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
5179ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
518d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
519d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
52032748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
5214453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
5221471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
5231471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
524d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
525d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
526f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
527f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
52832748db0SJohan Hedberg 
5293f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
5303f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
5313f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
5323f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
5333f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
5343f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
5353f0f524bSJohan Hedberg 
5361da177e4SLinus Torvalds /* -----  HCI Commands ---- */
5376bd32326SVille Tervo #define HCI_OP_NOP			0x0000
5386bd32326SVille Tervo 
539a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
540a9de9248SMarcel Holtmann struct hci_cp_inquiry {
541a9de9248SMarcel Holtmann 	__u8     lap[3];
542a9de9248SMarcel Holtmann 	__u8     length;
543a9de9248SMarcel Holtmann 	__u8     num_rsp;
54466c853ccSGustavo F. Padovan } __packed;
5451da177e4SLinus Torvalds 
546a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
547a9de9248SMarcel Holtmann 
54879d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
54979d6e068SAndre Guedes 
550a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
551a9de9248SMarcel Holtmann 
552a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
553a9de9248SMarcel Holtmann struct hci_cp_create_conn {
554a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
555a9de9248SMarcel Holtmann 	__le16   pkt_type;
556a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
557a9de9248SMarcel Holtmann 	__u8     pscan_mode;
558a9de9248SMarcel Holtmann 	__le16   clock_offset;
559a9de9248SMarcel Holtmann 	__u8     role_switch;
56066c853ccSGustavo F. Padovan } __packed;
5611da177e4SLinus Torvalds 
562a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
563a9de9248SMarcel Holtmann struct hci_cp_disconnect {
564a9de9248SMarcel Holtmann 	__le16   handle;
565a9de9248SMarcel Holtmann 	__u8     reason;
56666c853ccSGustavo F. Padovan } __packed;
5671da177e4SLinus Torvalds 
568a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
569a9de9248SMarcel Holtmann struct hci_cp_add_sco {
570a9de9248SMarcel Holtmann 	__le16   handle;
571a9de9248SMarcel Holtmann 	__le16   pkt_type;
57266c853ccSGustavo F. Padovan } __packed;
573a9de9248SMarcel Holtmann 
574a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
575a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
5761da177e4SLinus Torvalds 	bdaddr_t bdaddr;
57766c853ccSGustavo F. Padovan } __packed;
5781da177e4SLinus Torvalds 
579a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
580a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
581a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
582a9de9248SMarcel Holtmann 	__u8     role;
58366c853ccSGustavo F. Padovan } __packed;
5841da177e4SLinus Torvalds 
585a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
586a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
587a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
588a9de9248SMarcel Holtmann 	__u8     reason;
58966c853ccSGustavo F. Padovan } __packed;
5901da177e4SLinus Torvalds 
591a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
592a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
593a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
5949b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
59566c853ccSGustavo F. Padovan } __packed;
5961da177e4SLinus Torvalds 
597a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
598a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
599a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
60066c853ccSGustavo F. Padovan } __packed;
6011da177e4SLinus Torvalds 
602a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
603a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
604a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
605a9de9248SMarcel Holtmann 	__u8     pin_len;
606a9de9248SMarcel Holtmann 	__u8     pin_code[16];
60766c853ccSGustavo F. Padovan } __packed;
608980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
609980e1a53SJohan Hedberg 	__u8     status;
610980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
611980e1a53SJohan Hedberg } __packed;
612a9de9248SMarcel Holtmann 
613a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
614a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
615a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
61666c853ccSGustavo F. Padovan } __packed;
617980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
618980e1a53SJohan Hedberg 	__u8     status;
619980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
620980e1a53SJohan Hedberg } __packed;
621a9de9248SMarcel Holtmann 
622a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
623a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
624a9de9248SMarcel Holtmann 	__le16   handle;
625a9de9248SMarcel Holtmann 	__le16   pkt_type;
62666c853ccSGustavo F. Padovan } __packed;
627a9de9248SMarcel Holtmann 
628a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
629a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
630a9de9248SMarcel Holtmann 	__le16   handle;
63166c853ccSGustavo F. Padovan } __packed;
632a9de9248SMarcel Holtmann 
633a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
634a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
635a9de9248SMarcel Holtmann 	__le16   handle;
636a9de9248SMarcel Holtmann 	__u8     encrypt;
63766c853ccSGustavo F. Padovan } __packed;
638a9de9248SMarcel Holtmann 
639a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
640a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
641a9de9248SMarcel Holtmann 	__le16   handle;
64266c853ccSGustavo F. Padovan } __packed;
643a9de9248SMarcel Holtmann 
644a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
645a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
646a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
647a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
648a9de9248SMarcel Holtmann 	__u8     pscan_mode;
649a9de9248SMarcel Holtmann 	__le16   clock_offset;
65066c853ccSGustavo F. Padovan } __packed;
651a9de9248SMarcel Holtmann 
652a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
653a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
654a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
65566c853ccSGustavo F. Padovan } __packed;
656a9de9248SMarcel Holtmann 
657a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
658a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
659a9de9248SMarcel Holtmann 	__le16   handle;
66066c853ccSGustavo F. Padovan } __packed;
661a9de9248SMarcel Holtmann 
662a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
663a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
664a9de9248SMarcel Holtmann 	__le16   handle;
665a9de9248SMarcel Holtmann 	__u8     page;
66666c853ccSGustavo F. Padovan } __packed;
667a9de9248SMarcel Holtmann 
668a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
669a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
670a9de9248SMarcel Holtmann 	__le16   handle;
67166c853ccSGustavo F. Padovan } __packed;
672a9de9248SMarcel Holtmann 
673df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
674df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
675df935429SMarcel Holtmann 	__le16   handle;
676df935429SMarcel Holtmann } __packed;
677df935429SMarcel Holtmann 
678a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
679a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
680a9de9248SMarcel Holtmann 	__le16   handle;
681a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
682a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
683a9de9248SMarcel Holtmann 	__le16   max_latency;
684a9de9248SMarcel Holtmann 	__le16   voice_setting;
685a9de9248SMarcel Holtmann 	__u8     retrans_effort;
686a9de9248SMarcel Holtmann 	__le16   pkt_type;
68766c853ccSGustavo F. Padovan } __packed;
688a9de9248SMarcel Holtmann 
689a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
690a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
691a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
692a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
693a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
694a9de9248SMarcel Holtmann 	__le16   max_latency;
695a9de9248SMarcel Holtmann 	__le16   content_format;
696a9de9248SMarcel Holtmann 	__u8     retrans_effort;
697a9de9248SMarcel Holtmann 	__le16   pkt_type;
69866c853ccSGustavo F. Padovan } __packed;
699a9de9248SMarcel Holtmann 
700a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
701a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
702a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
703a9de9248SMarcel Holtmann 	__u8     reason;
70466c853ccSGustavo F. Padovan } __packed;
705a9de9248SMarcel Holtmann 
70617fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
70717fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
70817fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
70917fa4b9dSJohan Hedberg 	__u8     capability;
71017fa4b9dSJohan Hedberg 	__u8     oob_data;
71117fa4b9dSJohan Hedberg 	__u8     authentication;
71217fa4b9dSJohan Hedberg } __packed;
71317fa4b9dSJohan Hedberg 
714a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
715a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
716a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
717a5c29683SJohan Hedberg } __packed;
718a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
719a5c29683SJohan Hedberg 	__u8     status;
720a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
721a5c29683SJohan Hedberg } __packed;
722a5c29683SJohan Hedberg 
723a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
724a5c29683SJohan Hedberg 
7259ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
7269ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
7279ad4019aSBrian Gix 	bdaddr_t bdaddr;
7289ad4019aSBrian Gix 	__le32	passkey;
7299ad4019aSBrian Gix } __packed;
7309ad4019aSBrian Gix 
7319ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
7329ad4019aSBrian Gix 
7332763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
7342763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
7352763eda6SSzymon Janc 	bdaddr_t bdaddr;
7362763eda6SSzymon Janc 	__u8     hash[16];
73738da1703SJohan Hedberg 	__u8     rand[16];
7382763eda6SSzymon Janc } __packed;
7392763eda6SSzymon Janc 
7402763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
7412763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
7422763eda6SSzymon Janc 	bdaddr_t bdaddr;
7432763eda6SSzymon Janc } __packed;
7442763eda6SSzymon Janc 
74503b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
74603b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
74703b555e1SJohan Hedberg 	bdaddr_t bdaddr;
74803b555e1SJohan Hedberg 	__u8     reason;
74903b555e1SJohan Hedberg } __packed;
75003b555e1SJohan Hedberg 
751523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
752523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
753523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
754523e93cdSAndrei Emeltchenko 	__u8     key_len;
755523e93cdSAndrei Emeltchenko 	__u8     key_type;
756523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
757523e93cdSAndrei Emeltchenko } __packed;
758523e93cdSAndrei Emeltchenko 
759523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
760523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
761523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
762523e93cdSAndrei Emeltchenko 	__u8     key_len;
763523e93cdSAndrei Emeltchenko 	__u8     key_type;
764523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
765523e93cdSAndrei Emeltchenko } __packed;
766523e93cdSAndrei Emeltchenko 
767523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
768523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
769523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
770523e93cdSAndrei Emeltchenko 	__u8     reason;
771b078b564SAndrei Emeltchenko } __packed;
772b078b564SAndrei Emeltchenko 
773b078b564SAndrei Emeltchenko struct ext_flow_spec {
774b078b564SAndrei Emeltchenko 	__u8       id;
775b078b564SAndrei Emeltchenko 	__u8       stype;
776b078b564SAndrei Emeltchenko 	__le16     msdu;
777b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
778b078b564SAndrei Emeltchenko 	__le32     acc_lat;
779b078b564SAndrei Emeltchenko 	__le32     flush_to;
780b078b564SAndrei Emeltchenko } __packed;
781b078b564SAndrei Emeltchenko 
782b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
783b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
784b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
785b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
786b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
787b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
788b078b564SAndrei Emeltchenko } __packed;
789b078b564SAndrei Emeltchenko 
790b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
791b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
792b078b564SAndrei Emeltchenko 	__le16   log_handle;
793b078b564SAndrei Emeltchenko } __packed;
794b078b564SAndrei Emeltchenko 
795b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
796b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
797b078b564SAndrei Emeltchenko 	__u8     phy_handle;
798b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
799b078b564SAndrei Emeltchenko } __packed;
800b078b564SAndrei Emeltchenko 
801b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
802b078b564SAndrei Emeltchenko 	__u8     status;
803b078b564SAndrei Emeltchenko 	__u8     phy_handle;
804b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
805523e93cdSAndrei Emeltchenko } __packed;
806523e93cdSAndrei Emeltchenko 
8078c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB			0x0441
8088c9a041bSDoHyun Pyun struct hci_cp_set_csb {
8098c9a041bSDoHyun Pyun 	__u8	enable;
8108c9a041bSDoHyun Pyun 	__u8	lt_addr;
8118c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
8128c9a041bSDoHyun Pyun 	__le16	packet_type;
8138c9a041bSDoHyun Pyun 	__le16	interval_min;
8148c9a041bSDoHyun Pyun 	__le16	interval_max;
8158c9a041bSDoHyun Pyun 	__le16	csb_sv_tout;
8168c9a041bSDoHyun Pyun } __packed;
8178c9a041bSDoHyun Pyun struct hci_rp_set_csb {
8188c9a041bSDoHyun Pyun 	__u8	status;
8198c9a041bSDoHyun Pyun 	__u8	lt_addr;
8208c9a041bSDoHyun Pyun 	__le16	interval;
8218c9a041bSDoHyun Pyun } __packed;
8228c9a041bSDoHyun Pyun 
823cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
824cefded98SDoHyun Pyun 
825e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
826e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
827e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
828e2f99131SMarcel Holtmann 	__u8     hash192[16];
82938da1703SJohan Hedberg 	__u8     rand192[16];
830e2f99131SMarcel Holtmann 	__u8     hash256[16];
83138da1703SJohan Hedberg 	__u8     rand256[16];
832e2f99131SMarcel Holtmann } __packed;
833e2f99131SMarcel Holtmann 
834a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
835a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
836a9de9248SMarcel Holtmann 	__le16   handle;
837a9de9248SMarcel Holtmann 	__le16   max_interval;
838a9de9248SMarcel Holtmann 	__le16   min_interval;
839a9de9248SMarcel Holtmann 	__le16   attempt;
840a9de9248SMarcel Holtmann 	__le16   timeout;
84166c853ccSGustavo F. Padovan } __packed;
842a9de9248SMarcel Holtmann 
843a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
844a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
845a9de9248SMarcel Holtmann 	__le16   handle;
84666c853ccSGustavo F. Padovan } __packed;
847a9de9248SMarcel Holtmann 
848a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
849a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
850a9de9248SMarcel Holtmann 	__le16   handle;
85166c853ccSGustavo F. Padovan } __packed;
852a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
853a9de9248SMarcel Holtmann 	__u8     status;
854a9de9248SMarcel Holtmann 	__le16   handle;
855a9de9248SMarcel Holtmann 	__u8     role;
85666c853ccSGustavo F. Padovan } __packed;
857a9de9248SMarcel Holtmann 
858a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
859a9de9248SMarcel Holtmann struct hci_cp_switch_role {
860a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
861a9de9248SMarcel Holtmann 	__u8     role;
86266c853ccSGustavo F. Padovan } __packed;
863a9de9248SMarcel Holtmann 
864a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
865a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
866a9de9248SMarcel Holtmann 	__le16   handle;
86766c853ccSGustavo F. Padovan } __packed;
868a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
869a9de9248SMarcel Holtmann 	__u8     status;
870a9de9248SMarcel Holtmann 	__le16   handle;
871a9de9248SMarcel Holtmann 	__le16   policy;
87266c853ccSGustavo F. Padovan } __packed;
873a9de9248SMarcel Holtmann 
874a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
875a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
876a9de9248SMarcel Holtmann 	__le16   handle;
877a9de9248SMarcel Holtmann 	__le16   policy;
87866c853ccSGustavo F. Padovan } __packed;
879a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
880a9de9248SMarcel Holtmann 	__u8     status;
881a9de9248SMarcel Holtmann 	__le16   handle;
88266c853ccSGustavo F. Padovan } __packed;
883a9de9248SMarcel Holtmann 
884e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
885e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
886e4e8e37cSMarcel Holtmann 	__u8     status;
887e4e8e37cSMarcel Holtmann 	__le16   policy;
88866c853ccSGustavo F. Padovan } __packed;
889e4e8e37cSMarcel Holtmann 
890e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
891e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
892e4e8e37cSMarcel Holtmann 	__le16   policy;
89366c853ccSGustavo F. Padovan } __packed;
894e4e8e37cSMarcel Holtmann 
895a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
896a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
897a9de9248SMarcel Holtmann 	__le16   handle;
898a9de9248SMarcel Holtmann 	__le16   max_latency;
899a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
900a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
90166c853ccSGustavo F. Padovan } __packed;
902a9de9248SMarcel Holtmann 
903a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
904a9de9248SMarcel Holtmann 
905a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
906a9de9248SMarcel Holtmann 
907a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
9081da177e4SLinus Torvalds struct hci_cp_set_event_flt {
9091da177e4SLinus Torvalds 	__u8     flt_type;
9101da177e4SLinus Torvalds 	__u8     cond_type;
9111da177e4SLinus Torvalds 	__u8     condition[0];
91266c853ccSGustavo F. Padovan } __packed;
9131da177e4SLinus Torvalds 
9141da177e4SLinus Torvalds /* Filter types */
9151da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
9161da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
9171da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
9181da177e4SLinus Torvalds 
9191da177e4SLinus Torvalds /* CONN_SETUP Condition types */
9201da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
9211da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
9221da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
9231da177e4SLinus Torvalds 
9241da177e4SLinus Torvalds /* CONN_SETUP Conditions */
9251da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
9261da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
9271da177e4SLinus Torvalds 
928cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
929cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
930cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
931cb962780SMarcel Holtmann 	__u8     read_all;
932cb962780SMarcel Holtmann } __packed;
933cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
934cb962780SMarcel Holtmann 	__u8     status;
935cb962780SMarcel Holtmann 	__u8     max_keys;
936cb962780SMarcel Holtmann 	__u8     num_keys;
937cb962780SMarcel Holtmann } __packed;
938cb962780SMarcel Holtmann 
939b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
940b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
941b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
942b0916ea0SJohan Hedberg 	__u8     delete_all;
943b0916ea0SJohan Hedberg } __packed;
944039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
945039d4e41SMarcel Holtmann 	__u8     status;
946039d4e41SMarcel Holtmann 	__u8     num_keys;
947039d4e41SMarcel Holtmann } __packed;
948b0916ea0SJohan Hedberg 
9491f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
9501f6c6378SJohan Hedberg 
951a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
952a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
9531f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
95466c853ccSGustavo F. Padovan } __packed;
955a9de9248SMarcel Holtmann 
956a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
957a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
958a9de9248SMarcel Holtmann 	__u8     status;
9591f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
96066c853ccSGustavo F. Padovan } __packed;
961a9de9248SMarcel Holtmann 
962a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
963a9de9248SMarcel Holtmann 
964a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
965a9de9248SMarcel Holtmann 
966a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
967a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
968a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
969a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
970a9de9248SMarcel Holtmann 
971a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
972a9de9248SMarcel Holtmann 
973a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
974a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
975a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
976a9de9248SMarcel Holtmann 
977a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
978a9de9248SMarcel Holtmann 
979a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
980a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
981a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
982a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
983a9de9248SMarcel Holtmann 
984a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
985a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
9861da177e4SLinus Torvalds 	__u8     status;
9871da177e4SLinus Torvalds 	__u8     dev_class[3];
98866c853ccSGustavo F. Padovan } __packed;
9891da177e4SLinus Torvalds 
990a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
991a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
9921da177e4SLinus Torvalds 	__u8     dev_class[3];
99366c853ccSGustavo F. Padovan } __packed;
9941da177e4SLinus Torvalds 
995a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
9961da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
9971da177e4SLinus Torvalds 	__u8     status;
9981ebb9252SMarcel Holtmann 	__le16   voice_setting;
99966c853ccSGustavo F. Padovan } __packed;
10001da177e4SLinus Torvalds 
1001a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
10021da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
10031ebb9252SMarcel Holtmann 	__le16   voice_setting;
100466c853ccSGustavo F. Padovan } __packed;
10051da177e4SLinus Torvalds 
1006a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
10071da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
10081ebb9252SMarcel Holtmann 	__le16   acl_mtu;
10091da177e4SLinus Torvalds 	__u8     sco_mtu;
10101ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
10111ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
101266c853ccSGustavo F. Padovan } __packed;
10131da177e4SLinus Torvalds 
1014b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
1015b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1016b4cb9fb2SMarcel Holtmann 	__u8	status;
1017b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
1018b4cb9fb2SMarcel Holtmann } __packed;
1019b4cb9fb2SMarcel Holtmann 
10204b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
10214b836f39SMarcel Holtmann 
10223d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
10233d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
10243d505312SMarcel Holtmann 	__u8	num_iac;
10253d505312SMarcel Holtmann 	__u8	iac_lap[6];
10263d505312SMarcel Holtmann } __packed;
10273d505312SMarcel Holtmann 
1028d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
1029d5859e22SJohan Hedberg 
103080a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
103180a1e1dbSJohan Hedberg 
103280a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
103380a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1034816a11d5SJohan Hedberg 	__u8	fec;
1035816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
103680a1e1dbSJohan Hedberg } __packed;
103780a1e1dbSJohan Hedberg 
1038333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
1039333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1040333140b5SMarcel Holtmann 	__u8     status;
1041333140b5SMarcel Holtmann 	__u8     mode;
104266c853ccSGustavo F. Padovan } __packed;
1043333140b5SMarcel Holtmann 
1044333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
1045333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1046333140b5SMarcel Holtmann 	__u8     mode;
104766c853ccSGustavo F. Padovan } __packed;
1048333140b5SMarcel Holtmann 
1049c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1050c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1051c35938b2SSzymon Janc 	__u8     status;
1052c35938b2SSzymon Janc 	__u8     hash[16];
105338da1703SJohan Hedberg 	__u8     rand[16];
1054c35938b2SSzymon Janc } __packed;
1055c35938b2SSzymon Janc 
1056d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
105791c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
105891c4e9b1SMarcel Holtmann 	__u8     status;
105991c4e9b1SMarcel Holtmann 	__s8     tx_power;
106091c4e9b1SMarcel Holtmann } __packed;
1061d5859e22SJohan Hedberg 
1062d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1063d62e6d67SJohan Hedberg 
10647528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
10657528ca1cSMarcel Holtmann 
10661e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
10671e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
10681e89cffbSAndrei Emeltchenko 	__u8     status;
10691e89cffbSAndrei Emeltchenko 	__u8     mode;
10701e89cffbSAndrei Emeltchenko } __packed;
10711e89cffbSAndrei Emeltchenko 
1072f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1073f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1074f9b49306SAndre Guedes 	__u8	le;
1075f9b49306SAndre Guedes 	__u8	simul;
1076f9b49306SAndre Guedes } __packed;
1077f9b49306SAndre Guedes 
1078d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1079d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1080d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1081d0bf75a5SDoHyun Pyun } __packed;
1082d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1083d0bf75a5SDoHyun Pyun 	__u8	status;
1084d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1085d0bf75a5SDoHyun Pyun } __packed;
1086d0bf75a5SDoHyun Pyun 
10876a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
10886a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
10896a20eaf4SDoHyun Pyun 	__u8	lt_addr;
10906a20eaf4SDoHyun Pyun } __packed;
10916a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
10926a20eaf4SDoHyun Pyun 	__u8	status;
10936a20eaf4SDoHyun Pyun 	__u8	lt_addr;
10946a20eaf4SDoHyun Pyun } __packed;
10956a20eaf4SDoHyun Pyun 
10967d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
10977d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
10987d1dab49SDoHyun Pyun 	__u8	lt_addr;
10997d1dab49SDoHyun Pyun 	__u8	fragment;
11007d1dab49SDoHyun Pyun 	__u8	data_length;
11017d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
11027d1dab49SDoHyun Pyun } __packed;
11037d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
11047d1dab49SDoHyun Pyun 	__u8	status;
11057d1dab49SDoHyun Pyun 	__u8	lt_addr;
11067d1dab49SDoHyun Pyun } __packed;
11077d1dab49SDoHyun Pyun 
11085d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
11095d4e7e8dSJohan Hedberg 
1110a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1111a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1112a9b07a64SDoHyun Pyun 	__le16	interval_min;
1113a9b07a64SDoHyun Pyun 	__le16	interval_max;
1114a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1115a9b07a64SDoHyun Pyun 	__u8	service_data;
1116a9b07a64SDoHyun Pyun } __packed;
1117a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1118a9b07a64SDoHyun Pyun 	__u8	status;
1119a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1120a9b07a64SDoHyun Pyun } __packed;
1121a9b07a64SDoHyun Pyun 
1122eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1123eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1124eb4b95c6SMarcel Holtmann 	__u8	status;
1125eb4b95c6SMarcel Holtmann 	__u8	support;
1126eb4b95c6SMarcel Holtmann } __packed;
1127eb4b95c6SMarcel Holtmann 
1128eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1129eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1130eb4b95c6SMarcel Holtmann 	__u8	support;
1131eb4b95c6SMarcel Holtmann } __packed;
1132eb4b95c6SMarcel Holtmann 
1133e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1134e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1135e2f99131SMarcel Holtmann 	__u8     status;
1136e2f99131SMarcel Holtmann 	__u8     hash192[16];
113738da1703SJohan Hedberg 	__u8     rand192[16];
1138e2f99131SMarcel Holtmann 	__u8     hash256[16];
113938da1703SJohan Hedberg 	__u8     rand256[16];
1140e2f99131SMarcel Holtmann } __packed;
1141e2f99131SMarcel Holtmann 
1142a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1143a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
11441da177e4SLinus Torvalds 	__u8     status;
1145a9de9248SMarcel Holtmann 	__u8     hci_ver;
1146a9de9248SMarcel Holtmann 	__le16   hci_rev;
1147a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1148a9de9248SMarcel Holtmann 	__le16   manufacturer;
1149a9de9248SMarcel Holtmann 	__le16   lmp_subver;
115066c853ccSGustavo F. Padovan } __packed;
11511da177e4SLinus Torvalds 
1152a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1153a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
11541da177e4SLinus Torvalds 	__u8     status;
1155a9de9248SMarcel Holtmann 	__u8     commands[64];
115666c853ccSGustavo F. Padovan } __packed;
11571da177e4SLinus Torvalds 
1158a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1159a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1160a9de9248SMarcel Holtmann 	__u8     status;
1161a9de9248SMarcel Holtmann 	__u8     features[8];
116266c853ccSGustavo F. Padovan } __packed;
1163a9de9248SMarcel Holtmann 
1164a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1165971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1166971e3a4bSAndre Guedes 	__u8     page;
1167971e3a4bSAndre Guedes } __packed;
1168a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1169a9de9248SMarcel Holtmann 	__u8     status;
1170a9de9248SMarcel Holtmann 	__u8     page;
1171a9de9248SMarcel Holtmann 	__u8     max_page;
1172a9de9248SMarcel Holtmann 	__u8     features[8];
117366c853ccSGustavo F. Padovan } __packed;
1174a9de9248SMarcel Holtmann 
1175a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1176a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1177a9de9248SMarcel Holtmann 	__u8     status;
1178a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1179a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1180a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1181a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
118266c853ccSGustavo F. Padovan } __packed;
1183a9de9248SMarcel Holtmann 
1184a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1185a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1186a9de9248SMarcel Holtmann 	__u8     status;
11871da177e4SLinus Torvalds 	bdaddr_t bdaddr;
118866c853ccSGustavo F. Padovan } __packed;
11891da177e4SLinus Torvalds 
1190350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1191350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1192350ee4cfSAndrei Emeltchenko 	__u8     status;
1193350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1194350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1195350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1196350ee4cfSAndrei Emeltchenko } __packed;
1197350ee4cfSAndrei Emeltchenko 
1198109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
1199109e3191SMarcel Holtmann 
1200f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1201f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1202f332ec66SJohan Hedberg 	__u8     status;
1203f332ec66SJohan Hedberg 	__le16   interval;
1204f332ec66SJohan Hedberg 	__le16   window;
1205f332ec66SJohan Hedberg } __packed;
1206f332ec66SJohan Hedberg 
1207f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1208f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1209f6422ec6SAntti Julku 	__le16   interval;
1210f6422ec6SAntti Julku 	__le16   window;
1211f6422ec6SAntti Julku } __packed;
1212f6422ec6SAntti Julku 
12135a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
12145a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
12155a134faeSAndrzej Kaczmarek 	__le16   handle;
12165a134faeSAndrzej Kaczmarek 	__u8     type;
12175a134faeSAndrzej Kaczmarek } __packed;
12185a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
12195a134faeSAndrzej Kaczmarek 	__u8     status;
12205a134faeSAndrzej Kaczmarek 	__le16   handle;
12215a134faeSAndrzej Kaczmarek 	__s8     tx_power;
12225a134faeSAndrzej Kaczmarek } __packed;
12235a134faeSAndrzej Kaczmarek 
1224f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1225f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1226f332ec66SJohan Hedberg 	__u8     status;
1227f332ec66SJohan Hedberg 	__u8     type;
1228f332ec66SJohan Hedberg } __packed;
1229f332ec66SJohan Hedberg 
1230f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1231f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1232f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1233f6422ec6SAntti Julku 
12345ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
12355ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
12365ae76a94SAndrzej Kaczmarek 	__le16   handle;
12375ae76a94SAndrzej Kaczmarek } __packed;
12385ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
12395ae76a94SAndrzej Kaczmarek 	__u8     status;
12405ae76a94SAndrzej Kaczmarek 	__le16   handle;
12415ae76a94SAndrzej Kaczmarek 	__s8     rssi;
12425ae76a94SAndrzej Kaczmarek } __packed;
12435ae76a94SAndrzej Kaczmarek 
124433f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
124533f35721SJohan Hedberg struct hci_cp_read_clock {
124633f35721SJohan Hedberg 	__le16   handle;
124733f35721SJohan Hedberg 	__u8     which;
124833f35721SJohan Hedberg } __packed;
124933f35721SJohan Hedberg struct hci_rp_read_clock {
125033f35721SJohan Hedberg 	__u8     status;
125133f35721SJohan Hedberg 	__le16   handle;
125233f35721SJohan Hedberg 	__le32   clock;
125333f35721SJohan Hedberg 	__le16   accuracy;
125433f35721SJohan Hedberg } __packed;
125533f35721SJohan Hedberg 
1256821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1257821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1258821f3766SJohan Hedberg 	__le16   handle;
1259821f3766SJohan Hedberg } __packed;
1260821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1261821f3766SJohan Hedberg 	__u8     status;
1262821f3766SJohan Hedberg 	__le16   handle;
1263821f3766SJohan Hedberg 	__u8     key_size;
1264821f3766SJohan Hedberg } __packed;
1265821f3766SJohan Hedberg 
1266928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1267928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1268928abaa7SAndrei Emeltchenko 	__u8     status;
1269928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1270928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1271928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1272928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1273928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1274928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1275928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1276928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1277928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1278928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1279928abaa7SAndrei Emeltchenko } __packed;
1280928abaa7SAndrei Emeltchenko 
1281523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1282523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1283523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1284523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1285523e93cdSAndrei Emeltchenko 	__le16   max_len;
1286523e93cdSAndrei Emeltchenko } __packed;
1287523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1288523e93cdSAndrei Emeltchenko 	__u8     status;
1289523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1290523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1291523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1292523e93cdSAndrei Emeltchenko } __packed;
1293523e93cdSAndrei Emeltchenko 
1294523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1295523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1296523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1297523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1298523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1299523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1300523e93cdSAndrei Emeltchenko } __packed;
1301523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1302523e93cdSAndrei Emeltchenko 	__u8     status;
1303523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1304523e93cdSAndrei Emeltchenko } __packed;
1305523e93cdSAndrei Emeltchenko 
1306f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1307f4fe73edSMarcel Holtmann 
13084b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
13094b4148e9SMarcel Holtmann 
131006f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
131106f5b778SMarcel Holtmann 
131263185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
131363185f64SVille Tervo struct hci_cp_le_set_event_mask {
131463185f64SVille Tervo 	__u8     mask[8];
131563185f64SVille Tervo } __packed;
131663185f64SVille Tervo 
131763185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
131863185f64SVille Tervo struct hci_rp_le_read_buffer_size {
131963185f64SVille Tervo 	__u8     status;
132063185f64SVille Tervo 	__le16   le_mtu;
132163185f64SVille Tervo 	__u8     le_max_pkt;
132263185f64SVille Tervo } __packed;
132363185f64SVille Tervo 
132460e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
132560e77321SJohan Hedberg struct hci_rp_le_read_local_features {
132660e77321SJohan Hedberg 	__u8     status;
132760e77321SJohan Hedberg 	__u8     features[8];
132860e77321SJohan Hedberg } __packed;
132960e77321SJohan Hedberg 
1330d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1331d13eafceSMarcel Holtmann 
13321e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
13331e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
13341e191893SMarcel Holtmann 	__le16   min_interval;
13351e191893SMarcel Holtmann 	__le16   max_interval;
13361e191893SMarcel Holtmann 	__u8     type;
13371e191893SMarcel Holtmann 	__u8     own_address_type;
13381e191893SMarcel Holtmann 	__u8     direct_addr_type;
13391e191893SMarcel Holtmann 	bdaddr_t direct_addr;
13401e191893SMarcel Holtmann 	__u8     channel_map;
13411e191893SMarcel Holtmann 	__u8     filter_policy;
13421e191893SMarcel Holtmann } __packed;
13431e191893SMarcel Holtmann 
13448fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
13458fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
13468fa19098SJohan Hedberg 	__u8	status;
13478fa19098SJohan Hedberg 	__s8	tx_power;
13488fa19098SJohan Hedberg } __packed;
13498fa19098SJohan Hedberg 
13503f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
13513f0f524bSJohan Hedberg 
13523f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
13533f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
13543f0f524bSJohan Hedberg 	__u8	length;
13553f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
13563f0f524bSJohan Hedberg } __packed;
13573f0f524bSJohan Hedberg 
1358f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1359f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1360f14d8f64SMarcel Holtmann 	__u8	length;
1361f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1362f14d8f64SMarcel Holtmann } __packed;
1363f14d8f64SMarcel Holtmann 
1364c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1365c1d5dc4aSJohan Hedberg 
13665df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
13675df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
13685df480b5SAndre Guedes 
136907f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
137007f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
137107f7fa5dSAndre Guedes 	__u8    type;
137207f7fa5dSAndre Guedes 	__le16  interval;
137307f7fa5dSAndre Guedes 	__le16  window;
137407f7fa5dSAndre Guedes 	__u8    own_address_type;
137507f7fa5dSAndre Guedes 	__u8    filter_policy;
137607f7fa5dSAndre Guedes } __packed;
137707f7fa5dSAndre Guedes 
137876a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
137976a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1380525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1381525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
138268a8aea4SAndrei Emeltchenko 
1383eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1384eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1385eb9d91f5SAndre Guedes 	__u8     enable;
1386eb9d91f5SAndre Guedes 	__u8     filter_dup;
1387eb9d91f5SAndre Guedes } __packed;
1388eb9d91f5SAndre Guedes 
1389a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
1390a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST		0x01
1391a7139eddSJohan Hedberg 
139263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
139363185f64SVille Tervo struct hci_cp_le_create_conn {
139463185f64SVille Tervo 	__le16   scan_interval;
139563185f64SVille Tervo 	__le16   scan_window;
139663185f64SVille Tervo 	__u8     filter_policy;
139763185f64SVille Tervo 	__u8     peer_addr_type;
139863185f64SVille Tervo 	bdaddr_t peer_addr;
139963185f64SVille Tervo 	__u8     own_address_type;
140063185f64SVille Tervo 	__le16   conn_interval_min;
140163185f64SVille Tervo 	__le16   conn_interval_max;
140263185f64SVille Tervo 	__le16   conn_latency;
140363185f64SVille Tervo 	__le16   supervision_timeout;
140463185f64SVille Tervo 	__le16   min_ce_len;
140563185f64SVille Tervo 	__le16   max_ce_len;
140663185f64SVille Tervo } __packed;
140763185f64SVille Tervo 
140863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
140963185f64SVille Tervo 
1410cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1411cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1412cf1d081fSJohan Hedberg 	__u8	status;
1413cf1d081fSJohan Hedberg 	__u8	size;
1414cf1d081fSJohan Hedberg } __packed;
1415cf1d081fSJohan Hedberg 
1416d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST	0x2010
1417d9a7b0a5SMarcel Holtmann 
1418d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST	0x2011
1419d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list {
1420d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1421d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1422d9a7b0a5SMarcel Holtmann } __packed;
1423d9a7b0a5SMarcel Holtmann 
1424d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST	0x2012
1425d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list {
1426d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1427d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1428d9a7b0a5SMarcel Holtmann } __packed;
1429d9a7b0a5SMarcel Holtmann 
14302ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
14312ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
14322ce603ebSClaudio Takahasi 	__le16   handle;
14332ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
14342ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
14352ce603ebSClaudio Takahasi 	__le16   conn_latency;
14362ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
14372ce603ebSClaudio Takahasi 	__le16   min_ce_len;
14382ce603ebSClaudio Takahasi 	__le16   max_ce_len;
14392ce603ebSClaudio Takahasi } __packed;
14402ce603ebSClaudio Takahasi 
14410fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
14420fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
14430fe29fd1SMarcel Holtmann 	__le16	 handle;
14440fe29fd1SMarcel Holtmann } __packed;
14450fe29fd1SMarcel Holtmann 
1446a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1447a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1448a7a595f6SVinicius Costa Gomes 	__le16	handle;
1449fe39c7b2SMarcel Holtmann 	__le64	rand;
1450a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1451a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1452a7a595f6SVinicius Costa Gomes } __packed;
1453a7a595f6SVinicius Costa Gomes 
1454a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1455a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1456a7a595f6SVinicius Costa Gomes 	__le16	handle;
1457a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1458a7a595f6SVinicius Costa Gomes } __packed;
1459a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1460a7a595f6SVinicius Costa Gomes 	__u8	status;
1461a7a595f6SVinicius Costa Gomes 	__le16	handle;
1462a7a595f6SVinicius Costa Gomes } __packed;
1463a7a595f6SVinicius Costa Gomes 
1464a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1465a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1466a7a595f6SVinicius Costa Gomes 	__le16	handle;
1467a7a595f6SVinicius Costa Gomes } __packed;
1468a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1469a7a595f6SVinicius Costa Gomes 	__u8	status;
1470a7a595f6SVinicius Costa Gomes 	__le16	handle;
1471a7a595f6SVinicius Costa Gomes } __packed;
1472a7a595f6SVinicius Costa Gomes 
14739b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
14749b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
14759b008c04SJohan Hedberg 	__u8	status;
14769b008c04SJohan Hedberg 	__u8	le_states[8];
14779b008c04SJohan Hedberg } __packed;
14789b008c04SJohan Hedberg 
14798e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
14808e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
14818e75b46aSAndre Guedes 	__le16	handle;
14828e75b46aSAndre Guedes 	__le16	interval_min;
14838e75b46aSAndre Guedes 	__le16	interval_max;
14848e75b46aSAndre Guedes 	__le16	latency;
14858e75b46aSAndre Guedes 	__le16	timeout;
14868e75b46aSAndre Guedes 	__le16	min_ce_len;
14878e75b46aSAndre Guedes 	__le16	max_ce_len;
14888e75b46aSAndre Guedes } __packed;
14898e75b46aSAndre Guedes 
14908e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
14918e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
14928e75b46aSAndre Guedes 	__le16	handle;
14938e75b46aSAndre Guedes 	__u8	reason;
14948e75b46aSAndre Guedes } __packed;
14958e75b46aSAndre Guedes 
149694a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
149794a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
149894a3bd02SMarcel Holtmann 	__le16	handle;
149994a3bd02SMarcel Holtmann 	__le16	tx_len;
150094a3bd02SMarcel Holtmann 	__le16	tx_time;
150194a3bd02SMarcel Holtmann } __packed;
150294a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
150394a3bd02SMarcel Holtmann 	__u8	status;
150494a3bd02SMarcel Holtmann 	__le16	handle;
150594a3bd02SMarcel Holtmann } __packed;
150694a3bd02SMarcel Holtmann 
150794a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
150894a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
150994a3bd02SMarcel Holtmann 	__u8	status;
151094a3bd02SMarcel Holtmann 	__le16	tx_len;
151194a3bd02SMarcel Holtmann 	__le16	tx_time;
151294a3bd02SMarcel Holtmann } __packed;
151394a3bd02SMarcel Holtmann 
151494a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
151594a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
151694a3bd02SMarcel Holtmann 	__le16	tx_len;
151794a3bd02SMarcel Holtmann 	__le16	tx_time;
151894a3bd02SMarcel Holtmann } __packed;
151994a3bd02SMarcel Holtmann 
1520545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST	0x2029
1521545f2596SAnkit Navik 
1522cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE	0x202a
1523cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1524cfdb0c2dSAnkit Navik 	__u8	status;
1525cfdb0c2dSAnkit Navik 	__u8	size;
1526cfdb0c2dSAnkit Navik } __packed;
1527cfdb0c2dSAnkit Navik 
1528*aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1529*aa12af77SAnkit Navik 
153094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
153194a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
153294a3bd02SMarcel Holtmann 	__u8	status;
153394a3bd02SMarcel Holtmann 	__le16	tx_len;
153494a3bd02SMarcel Holtmann 	__le16	tx_time;
153594a3bd02SMarcel Holtmann 	__le16	rx_len;
153694a3bd02SMarcel Holtmann 	__le16	rx_time;
153794a3bd02SMarcel Holtmann } __packed;
153894a3bd02SMarcel Holtmann 
1539de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY	0x2031
1540de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1541de2ba303SMarcel Holtmann 	__u8    all_phys;
1542de2ba303SMarcel Holtmann 	__u8    tx_phys;
1543de2ba303SMarcel Holtmann 	__u8    rx_phys;
1544de2ba303SMarcel Holtmann } __packed;
1545de2ba303SMarcel Holtmann 
15466decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M		0x01
15476decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M		0x02
15486decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED		0x04
15496decb5b4SJaganath Kanakkassery 
1550a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS   0x2041
1551a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1552a2344b9eSJaganath Kanakkassery 	__u8    own_addr_type;
1553a2344b9eSJaganath Kanakkassery 	__u8    filter_policy;
1554a2344b9eSJaganath Kanakkassery 	__u8    scanning_phys;
1555a2344b9eSJaganath Kanakkassery 	__u8    data[0];
1556a2344b9eSJaganath Kanakkassery } __packed;
1557a2344b9eSJaganath Kanakkassery 
1558a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M		0x01
155945bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M		0x02
156045bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED	0x04
1561a2344b9eSJaganath Kanakkassery 
1562a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1563a2344b9eSJaganath Kanakkassery 	__u8    type;
1564a2344b9eSJaganath Kanakkassery 	__le16  interval;
1565a2344b9eSJaganath Kanakkassery 	__le16  window;
1566a2344b9eSJaganath Kanakkassery } __packed;
1567a2344b9eSJaganath Kanakkassery 
1568a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE   0x2042
1569a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1570a2344b9eSJaganath Kanakkassery 	__u8    enable;
1571a2344b9eSJaganath Kanakkassery 	__u8    filter_dup;
1572a2344b9eSJaganath Kanakkassery 	__le16  duration;
1573a2344b9eSJaganath Kanakkassery 	__le16  period;
1574a2344b9eSJaganath Kanakkassery } __packed;
1575a2344b9eSJaganath Kanakkassery 
15764d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN    0x2043
15774d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
15784d94f95dSJaganath Kanakkassery 	__u8      filter_policy;
15794d94f95dSJaganath Kanakkassery 	__u8      own_addr_type;
15804d94f95dSJaganath Kanakkassery 	__u8      peer_addr_type;
15814d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_addr;
15824d94f95dSJaganath Kanakkassery 	__u8      phys;
15834d94f95dSJaganath Kanakkassery 	__u8      data[0];
15844d94f95dSJaganath Kanakkassery } __packed;
15854d94f95dSJaganath Kanakkassery 
15864d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
15874d94f95dSJaganath Kanakkassery 	__le16 scan_interval;
15884d94f95dSJaganath Kanakkassery 	__le16 scan_window;
15894d94f95dSJaganath Kanakkassery 	__le16 conn_interval_min;
15904d94f95dSJaganath Kanakkassery 	__le16 conn_interval_max;
15914d94f95dSJaganath Kanakkassery 	__le16 conn_latency;
15924d94f95dSJaganath Kanakkassery 	__le16 supervision_timeout;
15934d94f95dSJaganath Kanakkassery 	__le16 min_ce_len;
15944d94f95dSJaganath Kanakkassery 	__le16 max_ce_len;
15954d94f95dSJaganath Kanakkassery } __packed;
15964d94f95dSJaganath Kanakkassery 
15976b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS	0x203b
15986b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
15996b49bcb4SJaganath Kanakkassery 	__u8  status;
16006b49bcb4SJaganath Kanakkassery 	__u8  num_of_sets;
16016b49bcb4SJaganath Kanakkassery } __packed;
16026b49bcb4SJaganath Kanakkassery 
1603de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS		0x2036
1604de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1605de181e88SJaganath Kanakkassery 	__u8      handle;
1606de181e88SJaganath Kanakkassery 	__le16    evt_properties;
1607de181e88SJaganath Kanakkassery 	__u8      min_interval[3];
1608de181e88SJaganath Kanakkassery 	__u8      max_interval[3];
1609de181e88SJaganath Kanakkassery 	__u8      channel_map;
1610de181e88SJaganath Kanakkassery 	__u8      own_addr_type;
1611de181e88SJaganath Kanakkassery 	__u8      peer_addr_type;
1612de181e88SJaganath Kanakkassery 	bdaddr_t  peer_addr;
1613de181e88SJaganath Kanakkassery 	__u8      filter_policy;
1614de181e88SJaganath Kanakkassery 	__u8      tx_power;
1615de181e88SJaganath Kanakkassery 	__u8      primary_phy;
1616de181e88SJaganath Kanakkassery 	__u8      secondary_max_skip;
1617de181e88SJaganath Kanakkassery 	__u8      secondary_phy;
1618de181e88SJaganath Kanakkassery 	__u8      sid;
1619de181e88SJaganath Kanakkassery 	__u8      notif_enable;
1620de181e88SJaganath Kanakkassery } __packed;
1621de181e88SJaganath Kanakkassery 
1622de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M		0X01
162385a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M		0x02
162485a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED	0x03
1625de181e88SJaganath Kanakkassery 
1626de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1627de181e88SJaganath Kanakkassery 	__u8  status;
1628de181e88SJaganath Kanakkassery 	__u8  tx_power;
1629de181e88SJaganath Kanakkassery } __packed;
1630de181e88SJaganath Kanakkassery 
1631de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE		0x2039
1632de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable {
1633de181e88SJaganath Kanakkassery 	__u8  enable;
1634de181e88SJaganath Kanakkassery 	__u8  num_of_sets;
1635de181e88SJaganath Kanakkassery 	__u8  data[0];
1636de181e88SJaganath Kanakkassery } __packed;
1637de181e88SJaganath Kanakkassery 
1638de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1639de181e88SJaganath Kanakkassery 	__u8  handle;
1640de181e88SJaganath Kanakkassery 	__le16 duration;
1641de181e88SJaganath Kanakkassery 	__u8  max_events;
1642de181e88SJaganath Kanakkassery } __packed;
1643de181e88SJaganath Kanakkassery 
1644a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA		0x2037
1645a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1646a0fb3726SJaganath Kanakkassery 	__u8  handle;
1647a0fb3726SJaganath Kanakkassery 	__u8  operation;
1648a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1649a0fb3726SJaganath Kanakkassery 	__u8  length;
1650a0fb3726SJaganath Kanakkassery 	__u8  data[HCI_MAX_AD_LENGTH];
1651a0fb3726SJaganath Kanakkassery } __packed;
1652a0fb3726SJaganath Kanakkassery 
1653a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA		0x2038
1654a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
1655a0fb3726SJaganath Kanakkassery 	__u8  handle;
1656a0fb3726SJaganath Kanakkassery 	__u8  operation;
1657a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1658a0fb3726SJaganath Kanakkassery 	__u8  length;
1659a0fb3726SJaganath Kanakkassery 	__u8  data[HCI_MAX_AD_LENGTH];
1660a0fb3726SJaganath Kanakkassery } __packed;
1661a0fb3726SJaganath Kanakkassery 
1662a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE	0x03
1663a0fb3726SJaganath Kanakkassery 
1664a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG		0x01
1665a0fb3726SJaganath Kanakkassery 
166645b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS	0x203d
166745b7749fSJaganath Kanakkassery 
1668a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR	0x2035
1669a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
1670a73c046aSJaganath Kanakkassery 	__u8  handle;
1671a73c046aSJaganath Kanakkassery 	bdaddr_t  bdaddr;
1672a73c046aSJaganath Kanakkassery } __packed;
1673a73c046aSJaganath Kanakkassery 
16741da177e4SLinus Torvalds /* ---- HCI Events ---- */
16751da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
16761da177e4SLinus Torvalds 
16771da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
16781da177e4SLinus Torvalds struct inquiry_info {
16791da177e4SLinus Torvalds 	bdaddr_t bdaddr;
16801da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
16811da177e4SLinus Torvalds 	__u8     pscan_period_mode;
16821da177e4SLinus Torvalds 	__u8     pscan_mode;
16831da177e4SLinus Torvalds 	__u8     dev_class[3];
16841ebb9252SMarcel Holtmann 	__le16   clock_offset;
168566c853ccSGustavo F. Padovan } __packed;
16861da177e4SLinus Torvalds 
16871da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
16881da177e4SLinus Torvalds struct hci_ev_conn_complete {
16891da177e4SLinus Torvalds 	__u8     status;
16901ebb9252SMarcel Holtmann 	__le16   handle;
16911da177e4SLinus Torvalds 	bdaddr_t bdaddr;
16921da177e4SLinus Torvalds 	__u8     link_type;
16931da177e4SLinus Torvalds 	__u8     encr_mode;
169466c853ccSGustavo F. Padovan } __packed;
16951da177e4SLinus Torvalds 
16961da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
16971da177e4SLinus Torvalds struct hci_ev_conn_request {
16981da177e4SLinus Torvalds 	bdaddr_t bdaddr;
16991da177e4SLinus Torvalds 	__u8     dev_class[3];
17001da177e4SLinus Torvalds 	__u8     link_type;
170166c853ccSGustavo F. Padovan } __packed;
17021da177e4SLinus Torvalds 
17031da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
17041da177e4SLinus Torvalds struct hci_ev_disconn_complete {
17051da177e4SLinus Torvalds 	__u8     status;
17061ebb9252SMarcel Holtmann 	__le16   handle;
17071da177e4SLinus Torvalds 	__u8     reason;
170866c853ccSGustavo F. Padovan } __packed;
17091da177e4SLinus Torvalds 
17101da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
17111da177e4SLinus Torvalds struct hci_ev_auth_complete {
17121da177e4SLinus Torvalds 	__u8     status;
17131ebb9252SMarcel Holtmann 	__le16   handle;
171466c853ccSGustavo F. Padovan } __packed;
17151da177e4SLinus Torvalds 
1716a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1717a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1718a9de9248SMarcel Holtmann 	__u8     status;
1719a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
17201f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
172166c853ccSGustavo F. Padovan } __packed;
1722a9de9248SMarcel Holtmann 
17231da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
17241da177e4SLinus Torvalds struct hci_ev_encrypt_change {
17251da177e4SLinus Torvalds 	__u8     status;
17261ebb9252SMarcel Holtmann 	__le16   handle;
17271da177e4SLinus Torvalds 	__u8     encrypt;
172866c853ccSGustavo F. Padovan } __packed;
17291da177e4SLinus Torvalds 
1730a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1731a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
17321da177e4SLinus Torvalds 	__u8     status;
17331ebb9252SMarcel Holtmann 	__le16   handle;
173466c853ccSGustavo F. Padovan } __packed;
17351da177e4SLinus Torvalds 
1736a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1737a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1738a9de9248SMarcel Holtmann 	__u8     status;
1739a9de9248SMarcel Holtmann 	__le16   handle;
1740a9de9248SMarcel Holtmann 	__u8     features[8];
174166c853ccSGustavo F. Padovan } __packed;
1742a9de9248SMarcel Holtmann 
1743a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1744a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1745a9de9248SMarcel Holtmann 	__u8     status;
1746a9de9248SMarcel Holtmann 	__le16   handle;
1747a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1748a9de9248SMarcel Holtmann 	__le16   manufacturer;
1749a9de9248SMarcel Holtmann 	__le16   lmp_subver;
175066c853ccSGustavo F. Padovan } __packed;
1751a9de9248SMarcel Holtmann 
1752a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
17531da177e4SLinus Torvalds struct hci_qos {
17541da177e4SLinus Torvalds 	__u8     service_type;
17551da177e4SLinus Torvalds 	__u32    token_rate;
17561da177e4SLinus Torvalds 	__u32    peak_bandwidth;
17571da177e4SLinus Torvalds 	__u32    latency;
17581da177e4SLinus Torvalds 	__u32    delay_variation;
175966c853ccSGustavo F. Padovan } __packed;
17601da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
17611da177e4SLinus Torvalds 	__u8     status;
17621ebb9252SMarcel Holtmann 	__le16   handle;
17631da177e4SLinus Torvalds 	struct   hci_qos qos;
176466c853ccSGustavo F. Padovan } __packed;
17651da177e4SLinus Torvalds 
1766a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
17671da177e4SLinus Torvalds struct hci_ev_cmd_complete {
17681da177e4SLinus Torvalds 	__u8     ncmd;
17691ebb9252SMarcel Holtmann 	__le16   opcode;
177066c853ccSGustavo F. Padovan } __packed;
17711da177e4SLinus Torvalds 
1772a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
17731da177e4SLinus Torvalds struct hci_ev_cmd_status {
17741da177e4SLinus Torvalds 	__u8     status;
17751da177e4SLinus Torvalds 	__u8     ncmd;
17761ebb9252SMarcel Holtmann 	__le16   opcode;
177766c853ccSGustavo F. Padovan } __packed;
17781da177e4SLinus Torvalds 
177924dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
178024dfa343SMarcel Holtmann struct hci_ev_hardware_error {
178124dfa343SMarcel Holtmann 	__u8     code;
178224dfa343SMarcel Holtmann } __packed;
178324dfa343SMarcel Holtmann 
17841da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
17851da177e4SLinus Torvalds struct hci_ev_role_change {
17861da177e4SLinus Torvalds 	__u8     status;
17871da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17881da177e4SLinus Torvalds 	__u8     role;
178966c853ccSGustavo F. Padovan } __packed;
17901da177e4SLinus Torvalds 
1791a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1792613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1793613a1c0cSAndrei Emeltchenko 	__le16   handle;
1794613a1c0cSAndrei Emeltchenko 	__le16   count;
1795613a1c0cSAndrei Emeltchenko } __packed;
1796613a1c0cSAndrei Emeltchenko 
1797a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1798a9de9248SMarcel Holtmann 	__u8     num_hndl;
1799613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
180066c853ccSGustavo F. Padovan } __packed;
1801a9de9248SMarcel Holtmann 
18021da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
18031da177e4SLinus Torvalds struct hci_ev_mode_change {
18041da177e4SLinus Torvalds 	__u8     status;
18051ebb9252SMarcel Holtmann 	__le16   handle;
18061da177e4SLinus Torvalds 	__u8     mode;
18071ebb9252SMarcel Holtmann 	__le16   interval;
180866c853ccSGustavo F. Padovan } __packed;
18091da177e4SLinus Torvalds 
18101da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
18111da177e4SLinus Torvalds struct hci_ev_pin_code_req {
18121da177e4SLinus Torvalds 	bdaddr_t bdaddr;
181366c853ccSGustavo F. Padovan } __packed;
18141da177e4SLinus Torvalds 
18151da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
18161da177e4SLinus Torvalds struct hci_ev_link_key_req {
18171da177e4SLinus Torvalds 	bdaddr_t bdaddr;
181866c853ccSGustavo F. Padovan } __packed;
18191da177e4SLinus Torvalds 
18201da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
18211da177e4SLinus Torvalds struct hci_ev_link_key_notify {
18221da177e4SLinus Torvalds 	bdaddr_t bdaddr;
18239b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
18241da177e4SLinus Torvalds 	__u8     key_type;
182566c853ccSGustavo F. Padovan } __packed;
18261da177e4SLinus Torvalds 
1827a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
18281da177e4SLinus Torvalds struct hci_ev_clock_offset {
18291da177e4SLinus Torvalds 	__u8     status;
18301ebb9252SMarcel Holtmann 	__le16   handle;
18311ebb9252SMarcel Holtmann 	__le16   clock_offset;
183266c853ccSGustavo F. Padovan } __packed;
18331da177e4SLinus Torvalds 
1834a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1835a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1836a8746417SMarcel Holtmann 	__u8     status;
1837a8746417SMarcel Holtmann 	__le16   handle;
1838a8746417SMarcel Holtmann 	__le16   pkt_type;
183966c853ccSGustavo F. Padovan } __packed;
1840a8746417SMarcel Holtmann 
184185a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
184285a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
184385a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
184485a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
184566c853ccSGustavo F. Padovan } __packed;
184685a1e930SMarcel Holtmann 
1847a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1848a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1849a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1850a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1851a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1852a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1853a9de9248SMarcel Holtmann 	__le16   clock_offset;
1854a9de9248SMarcel Holtmann 	__s8     rssi;
185566c853ccSGustavo F. Padovan } __packed;
1856a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1857a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1858a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1859a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1860a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1861a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1862a9de9248SMarcel Holtmann 	__le16   clock_offset;
1863a9de9248SMarcel Holtmann 	__s8     rssi;
186466c853ccSGustavo F. Padovan } __packed;
1865a9de9248SMarcel Holtmann 
1866a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1867a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1868a9de9248SMarcel Holtmann 	__u8     status;
1869a9de9248SMarcel Holtmann 	__le16   handle;
1870a9de9248SMarcel Holtmann 	__u8     page;
1871a9de9248SMarcel Holtmann 	__u8     max_page;
1872a9de9248SMarcel Holtmann 	__u8     features[8];
187366c853ccSGustavo F. Padovan } __packed;
1874a9de9248SMarcel Holtmann 
1875a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1876a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1877a9de9248SMarcel Holtmann 	__u8     status;
1878a9de9248SMarcel Holtmann 	__le16   handle;
1879a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1880a9de9248SMarcel Holtmann 	__u8     link_type;
1881a9de9248SMarcel Holtmann 	__u8     tx_interval;
1882a9de9248SMarcel Holtmann 	__u8     retrans_window;
1883a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1884a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1885a9de9248SMarcel Holtmann 	__u8     air_mode;
188666c853ccSGustavo F. Padovan } __packed;
1887a9de9248SMarcel Holtmann 
1888a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1889a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1890a9de9248SMarcel Holtmann 	__u8     status;
1891a9de9248SMarcel Holtmann 	__le16   handle;
1892a9de9248SMarcel Holtmann 	__u8     tx_interval;
1893a9de9248SMarcel Holtmann 	__u8     retrans_window;
1894a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1895a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
189666c853ccSGustavo F. Padovan } __packed;
1897a9de9248SMarcel Holtmann 
1898a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
189904837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
190004837f64SMarcel Holtmann 	__u8     status;
190104837f64SMarcel Holtmann 	__le16   handle;
190204837f64SMarcel Holtmann 	__le16   max_tx_latency;
190304837f64SMarcel Holtmann 	__le16   max_rx_latency;
190404837f64SMarcel Holtmann 	__le16   max_remote_timeout;
190504837f64SMarcel Holtmann 	__le16   max_local_timeout;
190666c853ccSGustavo F. Padovan } __packed;
190704837f64SMarcel Holtmann 
1908a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1909a9de9248SMarcel Holtmann struct extended_inquiry_info {
1910a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1911a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1912a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1913a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1914a9de9248SMarcel Holtmann 	__le16   clock_offset;
1915a9de9248SMarcel Holtmann 	__s8     rssi;
1916a9de9248SMarcel Holtmann 	__u8     data[240];
191766c853ccSGustavo F. Padovan } __packed;
1918a9de9248SMarcel Holtmann 
19191c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
19201c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
19211c2e0041SJohan Hedberg 	__u8	status;
19221c2e0041SJohan Hedberg 	__le16	handle;
19231c2e0041SJohan Hedberg } __packed;
19241c2e0041SJohan Hedberg 
19250493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
19260493684eSMarcel Holtmann struct hci_ev_io_capa_request {
19270493684eSMarcel Holtmann 	bdaddr_t bdaddr;
192866c853ccSGustavo F. Padovan } __packed;
19290493684eSMarcel Holtmann 
193003b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
193103b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
193203b555e1SJohan Hedberg 	bdaddr_t bdaddr;
193303b555e1SJohan Hedberg 	__u8     capability;
193403b555e1SJohan Hedberg 	__u8     oob_data;
193503b555e1SJohan Hedberg 	__u8     authentication;
193603b555e1SJohan Hedberg } __packed;
193703b555e1SJohan Hedberg 
1938a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1939a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1940a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1941a5c29683SJohan Hedberg 	__le32		passkey;
1942a5c29683SJohan Hedberg } __packed;
1943a5c29683SJohan Hedberg 
19449ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
19459ad4019aSBrian Gix struct hci_ev_user_passkey_req {
19469ad4019aSBrian Gix 	bdaddr_t	bdaddr;
19479ad4019aSBrian Gix } __packed;
19489ad4019aSBrian Gix 
19492763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
19502763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
19512763eda6SSzymon Janc 	bdaddr_t bdaddr;
19522763eda6SSzymon Janc } __packed;
19532763eda6SSzymon Janc 
19540493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
19550493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
19560493684eSMarcel Holtmann 	__u8     status;
19570493684eSMarcel Holtmann 	bdaddr_t bdaddr;
195866c853ccSGustavo F. Padovan } __packed;
19590493684eSMarcel Holtmann 
196092a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
196192a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
196292a25256SJohan Hedberg 	bdaddr_t	bdaddr;
196392a25256SJohan Hedberg 	__le32		passkey;
196492a25256SJohan Hedberg } __packed;
196592a25256SJohan Hedberg 
196692a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
196792a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
196892a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
196992a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
197092a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
197192a25256SJohan Hedberg 
197292a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
197392a25256SJohan Hedberg struct hci_ev_keypress_notify {
197492a25256SJohan Hedberg 	bdaddr_t	bdaddr;
197592a25256SJohan Hedberg 	__u8		type;
197692a25256SJohan Hedberg } __packed;
197792a25256SJohan Hedberg 
197841a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
197941a96212SMarcel Holtmann struct hci_ev_remote_host_features {
198041a96212SMarcel Holtmann 	bdaddr_t bdaddr;
198141a96212SMarcel Holtmann 	__u8     features[8];
198266c853ccSGustavo F. Padovan } __packed;
198341a96212SMarcel Holtmann 
198463185f64SVille Tervo #define HCI_EV_LE_META			0x3e
198563185f64SVille Tervo struct hci_ev_le_meta {
198663185f64SVille Tervo 	__u8     subevent;
198763185f64SVille Tervo } __packed;
198863185f64SVille Tervo 
1989523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
1990523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
1991523e93cdSAndrei Emeltchenko 	__u8     status;
1992523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1993523e93cdSAndrei Emeltchenko } __packed;
1994523e93cdSAndrei Emeltchenko 
1995523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
1996523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
1997523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1998523e93cdSAndrei Emeltchenko } __packed;
1999523e93cdSAndrei Emeltchenko 
2000523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
2001523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2002523e93cdSAndrei Emeltchenko 	__u8     status;
2003523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2004523e93cdSAndrei Emeltchenko 	__u8     reason;
2005523e93cdSAndrei Emeltchenko } __packed;
2006523e93cdSAndrei Emeltchenko 
2007523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
2008523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2009523e93cdSAndrei Emeltchenko 	__u8     status;
2010523e93cdSAndrei Emeltchenko 	__le16   handle;
2011523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2012523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
2013523e93cdSAndrei Emeltchenko } __packed;
2014523e93cdSAndrei Emeltchenko 
2015523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
2016523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2017523e93cdSAndrei Emeltchenko 	__u8     status;
2018523e93cdSAndrei Emeltchenko 	__le16   handle;
2019523e93cdSAndrei Emeltchenko 	__u8     reason;
2020523e93cdSAndrei Emeltchenko } __packed;
2021523e93cdSAndrei Emeltchenko 
202225e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
202325e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
202425e89e99SAndrei Emeltchenko 	__le16   handle;
202525e89e99SAndrei Emeltchenko 	__le16   pkts;
202625e89e99SAndrei Emeltchenko 	__le16   blocks;
202725e89e99SAndrei Emeltchenko } __packed;
202825e89e99SAndrei Emeltchenko 
202925e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
203025e89e99SAndrei Emeltchenko 	__le16   num_blocks;
203125e89e99SAndrei Emeltchenko 	__u8     num_hndl;
203225e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
203325e89e99SAndrei Emeltchenko } __packed;
203425e89e99SAndrei Emeltchenko 
20352b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
20362b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
20372b359445SDoHyun Pyun 	__u8	status;
20382b359445SDoHyun Pyun } __packed;
20392b359445SDoHyun Pyun 
20402ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
20412ed01805SDoHyun Pyun 
204263185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
204363185f64SVille Tervo struct hci_ev_le_conn_complete {
204463185f64SVille Tervo 	__u8     status;
204563185f64SVille Tervo 	__le16   handle;
204663185f64SVille Tervo 	__u8     role;
204763185f64SVille Tervo 	__u8     bdaddr_type;
204863185f64SVille Tervo 	bdaddr_t bdaddr;
204963185f64SVille Tervo 	__le16   interval;
205063185f64SVille Tervo 	__le16   latency;
205163185f64SVille Tervo 	__le16   supervision_timeout;
205263185f64SVille Tervo 	__u8     clk_accurancy;
205363185f64SVille Tervo } __packed;
205463185f64SVille Tervo 
20552331fd46SMarcel Holtmann /* Advertising report event types */
20562331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
20572331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
20582331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
20592331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
20602331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
2061c215e939SJaganath Kanakkassery #define LE_ADV_INVALID		0x05
2062c215e939SJaganath Kanakkassery 
2063c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2064c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND		0x0013
2065c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 	0x0015
2066c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND		0x0012
2067c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND		0x0010
2068c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV		0x001b
2069c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN	0x001a
20702331fd46SMarcel Holtmann 
2071b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2072b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND		0x0000
2073b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND		0x0001
2074b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND		0x0002
2075b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND		0x0004
2076b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP		0x0008
2077b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU		0x0010
2078b2cc9761SJaganath Kanakkassery 
20792331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC	0x00
20802331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM	0x01
20812331fd46SMarcel Holtmann 
20822331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
20832331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
20842331fd46SMarcel Holtmann 	__u8	 evt_type;
20852331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
20862331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
20872331fd46SMarcel Holtmann 	__u8	 length;
20882331fd46SMarcel Holtmann 	__u8	 data[0];
20892331fd46SMarcel Holtmann } __packed;
20902331fd46SMarcel Holtmann 
20911855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
20921855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
20931855d92dSMarcel Holtmann 	__u8     status;
20941855d92dSMarcel Holtmann 	__le16   handle;
20951855d92dSMarcel Holtmann 	__le16   interval;
20961855d92dSMarcel Holtmann 	__le16   latency;
20971855d92dSMarcel Holtmann 	__le16   supervision_timeout;
20981855d92dSMarcel Holtmann } __packed;
20991855d92dSMarcel Holtmann 
21000fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
21010fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
21020fe29fd1SMarcel Holtmann 	__u8     status;
21030fe29fd1SMarcel Holtmann 	__le16   handle;
21040fe29fd1SMarcel Holtmann 	__u8     features[8];
21050fe29fd1SMarcel Holtmann } __packed;
21060fe29fd1SMarcel Holtmann 
2107a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
2108a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2109a7a595f6SVinicius Costa Gomes 	__le16	handle;
2110fe39c7b2SMarcel Holtmann 	__le64	rand;
2111a7a595f6SVinicius Costa Gomes 	__le16	ediv;
2112a7a595f6SVinicius Costa Gomes } __packed;
2113a7a595f6SVinicius Costa Gomes 
21148e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
21158e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
21168e75b46aSAndre Guedes 	__le16 handle;
21178e75b46aSAndre Guedes 	__le16 interval_min;
21188e75b46aSAndre Guedes 	__le16 interval_max;
21198e75b46aSAndre Guedes 	__le16 latency;
21208e75b46aSAndre Guedes 	__le16 timeout;
21218e75b46aSAndre Guedes } __packed;
21228e75b46aSAndre Guedes 
212394a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
212494a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
212594a3bd02SMarcel Holtmann 	__le16	handle;
212694a3bd02SMarcel Holtmann 	__le16	tx_len;
212794a3bd02SMarcel Holtmann 	__le16	tx_time;
212894a3bd02SMarcel Holtmann 	__le16	rx_len;
212994a3bd02SMarcel Holtmann 	__le16	rx_time;
213094a3bd02SMarcel Holtmann } __packed;
213194a3bd02SMarcel Holtmann 
213232c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
213332c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
213432c9d43fSMarcel Holtmann 	__u8	 evt_type;
213532c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
213632c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
213732c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
213832c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
213932c9d43fSMarcel Holtmann 	__s8	 rssi;
214032c9d43fSMarcel Holtmann } __packed;
214132c9d43fSMarcel Holtmann 
2142c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT    0x0d
2143c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report {
2144c215e939SJaganath Kanakkassery 	__le16 	 evt_type;
2145c215e939SJaganath Kanakkassery 	__u8	 bdaddr_type;
2146c215e939SJaganath Kanakkassery 	bdaddr_t bdaddr;
2147c215e939SJaganath Kanakkassery 	__u8	 primary_phy;
2148c215e939SJaganath Kanakkassery 	__u8	 secondary_phy;
2149c215e939SJaganath Kanakkassery 	__u8	 sid;
2150c215e939SJaganath Kanakkassery 	__u8	 tx_power;
2151c215e939SJaganath Kanakkassery 	__s8	 rssi;
2152c215e939SJaganath Kanakkassery 	__le16 	 interval;
2153c215e939SJaganath Kanakkassery 	__u8  	 direct_addr_type;
2154c215e939SJaganath Kanakkassery 	bdaddr_t direct_addr;
2155c215e939SJaganath Kanakkassery 	__u8  	 length;
2156c215e939SJaganath Kanakkassery 	__u8	 data[0];
2157c215e939SJaganath Kanakkassery } __packed;
2158c215e939SJaganath Kanakkassery 
21594d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE    0x0a
21604d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
21614d94f95dSJaganath Kanakkassery 	__u8      status;
21624d94f95dSJaganath Kanakkassery 	__le16    handle;
21634d94f95dSJaganath Kanakkassery 	__u8      role;
21644d94f95dSJaganath Kanakkassery 	__u8      bdaddr_type;
21654d94f95dSJaganath Kanakkassery 	bdaddr_t  bdaddr;
21664d94f95dSJaganath Kanakkassery 	bdaddr_t  local_rpa;
21674d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_rpa;
21684d94f95dSJaganath Kanakkassery 	__le16    interval;
21694d94f95dSJaganath Kanakkassery 	__le16    latency;
21704d94f95dSJaganath Kanakkassery 	__le16    supervision_timeout;
21714d94f95dSJaganath Kanakkassery 	__u8      clk_accurancy;
21724d94f95dSJaganath Kanakkassery } __packed;
21734d94f95dSJaganath Kanakkassery 
2174acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM	0x12
2175acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2176acf0aeaeSJaganath Kanakkassery 	__u8	status;
2177acf0aeaeSJaganath Kanakkassery 	__u8	handle;
2178acf0aeaeSJaganath Kanakkassery 	__le16	conn_handle;
2179acf0aeaeSJaganath Kanakkassery 	__u8	num_evts;
2180acf0aeaeSJaganath Kanakkassery } __packed;
2181acf0aeaeSJaganath Kanakkassery 
2182e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR			0xff
2183e4cc5a18SMarcel Holtmann 
21841da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2185a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
21861da177e4SLinus Torvalds struct hci_ev_stack_internal {
21871da177e4SLinus Torvalds 	__u16    type;
21881da177e4SLinus Torvalds 	__u8     data[0];
218966c853ccSGustavo F. Padovan } __packed;
21901da177e4SLinus Torvalds 
21911da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
21921da177e4SLinus Torvalds struct hci_ev_si_device {
21931da177e4SLinus Torvalds 	__u16    event;
21941da177e4SLinus Torvalds 	__u16    dev_id;
219566c853ccSGustavo F. Padovan } __packed;
21961da177e4SLinus Torvalds 
21971da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
21981da177e4SLinus Torvalds struct hci_ev_si_security {
21991da177e4SLinus Torvalds 	__u16    event;
22001da177e4SLinus Torvalds 	__u16    proto;
22011da177e4SLinus Torvalds 	__u16    subproto;
22021da177e4SLinus Torvalds 	__u8     incoming;
220366c853ccSGustavo F. Padovan } __packed;
22041da177e4SLinus Torvalds 
22051da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
22061da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
22071da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
22081da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
22091da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
22101da177e4SLinus Torvalds 
22111da177e4SLinus Torvalds struct hci_command_hdr {
22121ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
22131da177e4SLinus Torvalds 	__u8	plen;
221466c853ccSGustavo F. Padovan } __packed;
22151da177e4SLinus Torvalds 
22161da177e4SLinus Torvalds struct hci_event_hdr {
22171da177e4SLinus Torvalds 	__u8	evt;
22181da177e4SLinus Torvalds 	__u8	plen;
221966c853ccSGustavo F. Padovan } __packed;
22201da177e4SLinus Torvalds 
22211da177e4SLinus Torvalds struct hci_acl_hdr {
22221ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
22231ebb9252SMarcel Holtmann 	__le16	dlen;
222466c853ccSGustavo F. Padovan } __packed;
22251da177e4SLinus Torvalds 
22261da177e4SLinus Torvalds struct hci_sco_hdr {
22271ebb9252SMarcel Holtmann 	__le16	handle;
22281da177e4SLinus Torvalds 	__u8	dlen;
222966c853ccSGustavo F. Padovan } __packed;
22301da177e4SLinus Torvalds 
22312a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
22322a123b86SArnaldo Carvalho de Melo {
22332a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
22342a123b86SArnaldo Carvalho de Melo }
22352a123b86SArnaldo Carvalho de Melo 
22362a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
22372a123b86SArnaldo Carvalho de Melo {
22382a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
22392a123b86SArnaldo Carvalho de Melo }
22402a123b86SArnaldo Carvalho de Melo 
22412a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
22422a123b86SArnaldo Carvalho de Melo {
22432a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
22442a123b86SArnaldo Carvalho de Melo }
22452a123b86SArnaldo Carvalho de Melo 
22461da177e4SLinus Torvalds /* Command opcode pack/unpack */
2247c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
22481da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
22491da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
22501da177e4SLinus Torvalds 
22511da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2252c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
22531da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
22541da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
22551da177e4SLinus Torvalds 
22561da177e4SLinus Torvalds #endif /* __HCI_H */
2257