xref: /openbmc/linux/include/net/bluetooth/hci.h (revision 94a3bd02a6b79b98236d9805a1f95a2857e7696a)
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
471da177e4SLinus Torvalds 
481da177e4SLinus Torvalds /* HCI notify events */
491da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
501da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
511da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
521da177e4SLinus Torvalds 
53c13854ceSMarcel Holtmann /* HCI bus types */
540ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
551da177e4SLinus Torvalds #define HCI_USB		1
561da177e4SLinus Torvalds #define HCI_PCCARD	2
571da177e4SLinus Torvalds #define HCI_UART	3
581da177e4SLinus Torvalds #define HCI_RS232	4
591da177e4SLinus Torvalds #define HCI_PCI		5
600ac53939SMarcel Holtmann #define HCI_SDIO	6
611da177e4SLinus Torvalds 
62943da25dSMarcel Holtmann /* HCI controller types */
63943da25dSMarcel Holtmann #define HCI_BREDR	0x00
648f1e1742SDavid Vrabel #define HCI_AMP		0x01
65943da25dSMarcel Holtmann 
668598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
676ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
688598d064SAndrei Emeltchenko 
697c13823dSMarcel Holtmann /* AMP controller types */
707c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
717c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
727c13823dSMarcel Holtmann 
73ab846ec4SAndrei Emeltchenko /* AMP controller status */
74536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
75536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
76536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
77536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
78536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
79536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
80536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
81ab846ec4SAndrei Emeltchenko 
821da177e4SLinus Torvalds /* HCI device quirks */
831da177e4SLinus Torvalds enum {
84118305b5SMarcel Holtmann 	/* When this quirk is set, the HCI Reset command is send when
85118305b5SMarcel Holtmann 	 * closing the transport instead of when opening it.
86118305b5SMarcel Holtmann 	 *
87118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
88118305b5SMarcel Holtmann 	 */
89a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
90118305b5SMarcel Holtmann 
91118305b5SMarcel Holtmann 	/* When this quirk is set, the device is turned into a raw-only
92118305b5SMarcel Holtmann 	 * device and it will stay in unconfigured state.
93118305b5SMarcel Holtmann 	 *
94118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
95118305b5SMarcel Holtmann 	 */
96da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
97118305b5SMarcel Holtmann 
98118305b5SMarcel Holtmann 	/* When this quirk is set, the buffer sizes reported by
99118305b5SMarcel Holtmann 	 * HCI Read Buffer Size command are corrected if invalid.
100118305b5SMarcel Holtmann 	 *
101118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
102118305b5SMarcel Holtmann 	 */
103f9f462faSMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE,
104118305b5SMarcel Holtmann 
105118305b5SMarcel Holtmann 	/* When this quirk is set, then no stored link key handling
106118305b5SMarcel Holtmann 	 * is performed. This is mainly due to the fact that the
107118305b5SMarcel Holtmann 	 * HCI Delete Stored Link Key command is advertised, but
108118305b5SMarcel Holtmann 	 * not supported.
109118305b5SMarcel Holtmann 	 *
110118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
111118305b5SMarcel Holtmann 	 */
112f9f462faSMarcel Holtmann 	HCI_QUIRK_BROKEN_STORED_LINK_KEY,
11389bc22d2SMarcel Holtmann 
114eb1904f4SMarcel Holtmann 	/* When this quirk is set, an external configuration step
115eb1904f4SMarcel Holtmann 	 * is required and will be indicated with the controller
116eb1904f4SMarcel Holtmann 	 * configuation.
117eb1904f4SMarcel Holtmann 	 *
118eb1904f4SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
119eb1904f4SMarcel Holtmann 	 * during the hdev->setup vendor callback.
120eb1904f4SMarcel Holtmann 	 */
121eb1904f4SMarcel Holtmann 	HCI_QUIRK_EXTERNAL_CONFIG,
122eb1904f4SMarcel Holtmann 
12389bc22d2SMarcel Holtmann 	/* When this quirk is set, the public Bluetooth address
12489bc22d2SMarcel Holtmann 	 * initially reported by HCI Read BD Address command
12589bc22d2SMarcel Holtmann 	 * is considered invalid. Controller configuration is
12689bc22d2SMarcel Holtmann 	 * required before this device can be used.
12789bc22d2SMarcel Holtmann 	 *
12889bc22d2SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
12989bc22d2SMarcel Holtmann 	 * during the hdev->setup vendor callback.
13089bc22d2SMarcel Holtmann 	 */
13189bc22d2SMarcel Holtmann 	HCI_QUIRK_INVALID_BDADDR,
13243d6bc46SMarcel Holtmann 
13343d6bc46SMarcel Holtmann 	/* When this quirk is set, the duplicate filtering during
13443d6bc46SMarcel Holtmann 	 * scanning is based on Bluetooth devices addresses. To allow
13543d6bc46SMarcel Holtmann 	 * RSSI based updates, restart scanning if needed.
13643d6bc46SMarcel Holtmann 	 *
13743d6bc46SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
13843d6bc46SMarcel Holtmann 	 * during the hdev->setup vendor callback.
13943d6bc46SMarcel Holtmann 	 */
14043d6bc46SMarcel Holtmann 	HCI_QUIRK_STRICT_DUPLICATE_FILTER,
1411da177e4SLinus Torvalds };
1421da177e4SLinus Torvalds 
1431da177e4SLinus Torvalds /* HCI device flags */
1441da177e4SLinus Torvalds enum {
1451da177e4SLinus Torvalds 	HCI_UP,
1461da177e4SLinus Torvalds 	HCI_INIT,
1471da177e4SLinus Torvalds 	HCI_RUNNING,
1481da177e4SLinus Torvalds 
1491da177e4SLinus Torvalds 	HCI_PSCAN,
1501da177e4SLinus Torvalds 	HCI_ISCAN,
1511da177e4SLinus Torvalds 	HCI_AUTH,
1521da177e4SLinus Torvalds 	HCI_ENCRYPT,
1531da177e4SLinus Torvalds 	HCI_INQUIRY,
1541da177e4SLinus Torvalds 
1551da177e4SLinus Torvalds 	HCI_RAW,
156ab81cbf9SJohan Hedberg 
15710572132SGustavo F. Padovan 	HCI_RESET,
1581da177e4SLinus Torvalds };
1591da177e4SLinus Torvalds 
160111902f7SMarcel Holtmann /* BR/EDR and/or LE controller flags: the flags defined here should represent
161111902f7SMarcel Holtmann  * states configured via debugfs for debugging and testing purposes only.
162111902f7SMarcel Holtmann  */
163111902f7SMarcel Holtmann enum {
164111902f7SMarcel Holtmann 	HCI_DUT_MODE,
165111902f7SMarcel Holtmann 	HCI_FORCE_SC,
166858cdc78SJohan Hedberg 	HCI_FORCE_LESC,
167111902f7SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
168111902f7SMarcel Holtmann };
169111902f7SMarcel Holtmann 
170d23264a8SAndre Guedes /*
171d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
172d23264a8SAndre Guedes  * states from the controller.
173d23264a8SAndre Guedes  */
174d23264a8SAndre Guedes enum {
175a8b2d5c2SJohan Hedberg 	HCI_SETUP,
176d603b76bSMarcel Holtmann 	HCI_CONFIG,
177a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
1785e130367SJohan Hedberg 	HCI_RFKILLED,
179a8b2d5c2SJohan Hedberg 	HCI_MGMT,
180b6ae8457SJohan Hedberg 	HCI_BONDABLE,
181a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
1820663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
1833769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
18494324962SJohan Hovold 	HCI_UNREGISTER,
1854a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
1860736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
187dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
18866c417c1SJohan Hedberg 	HCI_LE_ADV,
189d23264a8SAndre Guedes 	HCI_LE_SCAN,
19084bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
191e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
192134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
193863efaf2SJohan Hedberg 	HCI_PRIVACY,
194d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
19541edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
1966d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
19706199cf8SJohan Hedberg 	HCI_LE_ENABLED,
198f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
1995e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
2005e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
2016acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
20247990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
20321693c15SAndre Guedes 	HCI_PERIODIC_INQ,
2041a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
20556f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
20681ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
207d23264a8SAndre Guedes };
208d23264a8SAndre Guedes 
2092cc6fb00SJohan Hedberg /* A mask for the flags that are supposed to remain when a reset happens
2102cc6fb00SJohan Hedberg  * or the HCI device is closed.
2112cc6fb00SJohan Hedberg  */
2121a4d3c4bSJohan Hedberg #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \
21366c417c1SJohan Hedberg 			      BIT(HCI_FAST_CONNECTABLE) | BIT(HCI_LE_ADV))
2142cc6fb00SJohan Hedberg 
2151da177e4SLinus Torvalds /* HCI timeouts */
2165f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
2175f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
2185f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
219d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
2205f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
2219345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
222a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
2239489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
22409ae260bSJohan Hedberg #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
2251da177e4SLinus Torvalds 
2265b7f9909SMarcel Holtmann /* HCI data types */
2271da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
2281da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
2291da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
2301da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
2311da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
2321da177e4SLinus Torvalds 
2335b7f9909SMarcel Holtmann /* HCI packet types */
2341da177e4SLinus Torvalds #define HCI_DM1		0x0008
2351da177e4SLinus Torvalds #define HCI_DM3		0x0400
2361da177e4SLinus Torvalds #define HCI_DM5		0x4000
2371da177e4SLinus Torvalds #define HCI_DH1		0x0010
2381da177e4SLinus Torvalds #define HCI_DH3		0x0800
2391da177e4SLinus Torvalds #define HCI_DH5		0x8000
2401da177e4SLinus Torvalds 
2411da177e4SLinus Torvalds #define HCI_HV1		0x0020
2421da177e4SLinus Torvalds #define HCI_HV2		0x0040
2431da177e4SLinus Torvalds #define HCI_HV3		0x0080
2441da177e4SLinus Torvalds 
2451da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
2461da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
2471da177e4SLinus Torvalds 
2485b7f9909SMarcel Holtmann /* eSCO packet types */
2495b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
2505b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
2515b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
2525b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
2535b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
2545b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
255efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
256efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
257efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
258efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
2595b7f9909SMarcel Holtmann 
260a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
261efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
262a8746417SMarcel Holtmann 
2631da177e4SLinus Torvalds /* ACL flags */
264e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
2651da177e4SLinus Torvalds #define ACL_CONT		0x01
2661da177e4SLinus Torvalds #define ACL_START		0x02
267d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
2681da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
2691da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
2701da177e4SLinus Torvalds 
2711da177e4SLinus Torvalds /* Baseband links */
2721da177e4SLinus Torvalds #define SCO_LINK	0x00
2731da177e4SLinus Torvalds #define ACL_LINK	0x01
2745b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
275fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
276fcd89c09SVille Tervo #define LE_LINK		0x80
2773161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
278845472e8SMarcel Holtmann #define INVALID_LINK	0xff
2791da177e4SLinus Torvalds 
2801da177e4SLinus Torvalds /* LMP features */
2811da177e4SLinus Torvalds #define LMP_3SLOT	0x01
2821da177e4SLinus Torvalds #define LMP_5SLOT	0x02
2831da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
2841da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
2851da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
2861da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
2871da177e4SLinus Torvalds #define LMP_HOLD	0x40
28804837f64SMarcel Holtmann #define LMP_SNIFF	0x80
2891da177e4SLinus Torvalds 
2901da177e4SLinus Torvalds #define LMP_PARK	0x01
2911da177e4SLinus Torvalds #define LMP_RSSI	0x02
2921da177e4SLinus Torvalds #define LMP_QUALITY	0x04
2931da177e4SLinus Torvalds #define LMP_SCO		0x08
2941da177e4SLinus Torvalds #define LMP_HV2		0x10
2951da177e4SLinus Torvalds #define LMP_HV3		0x20
2961da177e4SLinus Torvalds #define LMP_ULAW	0x40
2971da177e4SLinus Torvalds #define LMP_ALAW	0x80
2981da177e4SLinus Torvalds 
2991da177e4SLinus Torvalds #define LMP_CVSD	0x01
3001da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
3011da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
30207a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
3031da177e4SLinus Torvalds 
304d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
3055b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
3065b7f9909SMarcel Holtmann 
3075b7f9909SMarcel Holtmann #define LMP_EV4		0x01
3085b7f9909SMarcel Holtmann #define LMP_EV5		0x02
30969ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
310d5859e22SJohan Hedberg #define LMP_LE		0x40
3115b7f9909SMarcel Holtmann 
31204837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
313d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
314efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
315efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
316efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
31704837f64SMarcel Holtmann 
318d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
319e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
320769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
321e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
322769be974SMarcel Holtmann 
323d5859e22SJohan Hedberg #define LMP_LSTO	0x01
324d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
325971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
326d5859e22SJohan Hedberg 
327eead27daSAndre Guedes /* Extended LMP features */
32853b834d2SMarcel Holtmann #define LMP_CSB_MASTER	0x01
32953b834d2SMarcel Holtmann #define LMP_CSB_SLAVE	0x02
33053b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN	0x04
33153b834d2SMarcel Holtmann #define LMP_SYNC_SCAN	0x08
33253b834d2SMarcel Holtmann 
333d5991585SMarcel Holtmann #define LMP_SC		0x01
334d5991585SMarcel Holtmann #define LMP_PING	0x02
335d5991585SMarcel Holtmann 
33653b834d2SMarcel Holtmann /* Host features */
337cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
338eead27daSAndre Guedes #define LMP_HOST_LE		0x02
339cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
340d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
341eead27daSAndre Guedes 
342662bc2e6SAndre Guedes /* LE features */
3430da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
344662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
345cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
346*94a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
3474b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
348662bc2e6SAndre Guedes 
34904837f64SMarcel Holtmann /* Connection modes */
35004837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
35104837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
35204837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
35304837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
35404837f64SMarcel Holtmann 
3551da177e4SLinus Torvalds /* Link policies */
3561da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
3571da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
3581da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
3591da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
3601da177e4SLinus Torvalds 
36104837f64SMarcel Holtmann /* Link modes */
3621da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
3631da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
3641da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
3651da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
3661da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
3671da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
3681da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
3697b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
3701da177e4SLinus Torvalds 
37140be492fSMarcel Holtmann /* Authentication types */
37240be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
37340be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
37440be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
37540be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
37640be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
37740be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
37840be492fSMarcel Holtmann 
379a77b15a6SMikel Astiz /* I/O capabilities */
380a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
381a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
382a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
383a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
384a77b15a6SMikel Astiz 
385b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
386b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
387b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
388b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
389b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
39011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
39111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
392b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
39311015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
39411015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
395b6020ba0SWaldemar Rymarkiewicz 
3969f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
3978e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
3989f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
3992acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
400cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
401d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
4029f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
4039f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
404cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
405cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
4069f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
4079f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
4088e75b46aSAndre Guedes #define HCI_ERROR_INVALID_LL_PARAMS	0x1E
4093c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
4109f5a0d7bSAndrei Emeltchenko 
4112455a3eaSAndrei Emeltchenko /* Flow control modes */
4122455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
4132455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
4142455a3eaSAndrei Emeltchenko 
415bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
416bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
417a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
418bbaf444aSJohan Hedberg 
419ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
420ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
421ba165a90SJohan Hedberg 
42232748db0SJohan Hedberg /* Extended Inquiry Response field types */
42332748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
42432748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
42532748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
42632748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
42732748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
42832748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
42932748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
43032748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
43132748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
43232748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
4339ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
4349ec9fc8aSJohan Hedberg #define EIR_SSP_HASH_C		0x0E /* Simple Pairing Hash C */
4359ec9fc8aSJohan Hedberg #define EIR_SSP_RAND_R		0x0F /* Simple Pairing Randomizer R */
43632748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
43732748db0SJohan Hedberg 
4383f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
4393f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
4403f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
4413f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
4423f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
4433f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
4443f0f524bSJohan Hedberg 
4451da177e4SLinus Torvalds /* -----  HCI Commands ---- */
4466bd32326SVille Tervo #define HCI_OP_NOP			0x0000
4476bd32326SVille Tervo 
448a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
449a9de9248SMarcel Holtmann struct hci_cp_inquiry {
450a9de9248SMarcel Holtmann 	__u8     lap[3];
451a9de9248SMarcel Holtmann 	__u8     length;
452a9de9248SMarcel Holtmann 	__u8     num_rsp;
45366c853ccSGustavo F. Padovan } __packed;
4541da177e4SLinus Torvalds 
455a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
456a9de9248SMarcel Holtmann 
45779d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
45879d6e068SAndre Guedes 
459a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
460a9de9248SMarcel Holtmann 
461a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
462a9de9248SMarcel Holtmann struct hci_cp_create_conn {
463a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
464a9de9248SMarcel Holtmann 	__le16   pkt_type;
465a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
466a9de9248SMarcel Holtmann 	__u8     pscan_mode;
467a9de9248SMarcel Holtmann 	__le16   clock_offset;
468a9de9248SMarcel Holtmann 	__u8     role_switch;
46966c853ccSGustavo F. Padovan } __packed;
4701da177e4SLinus Torvalds 
471a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
472a9de9248SMarcel Holtmann struct hci_cp_disconnect {
473a9de9248SMarcel Holtmann 	__le16   handle;
474a9de9248SMarcel Holtmann 	__u8     reason;
47566c853ccSGustavo F. Padovan } __packed;
4761da177e4SLinus Torvalds 
477a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
478a9de9248SMarcel Holtmann struct hci_cp_add_sco {
479a9de9248SMarcel Holtmann 	__le16   handle;
480a9de9248SMarcel Holtmann 	__le16   pkt_type;
48166c853ccSGustavo F. Padovan } __packed;
482a9de9248SMarcel Holtmann 
483a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
484a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
4851da177e4SLinus Torvalds 	bdaddr_t bdaddr;
48666c853ccSGustavo F. Padovan } __packed;
4871da177e4SLinus Torvalds 
488a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
489a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
490a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
491a9de9248SMarcel Holtmann 	__u8     role;
49266c853ccSGustavo F. Padovan } __packed;
4931da177e4SLinus Torvalds 
494a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
495a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
496a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
497a9de9248SMarcel Holtmann 	__u8     reason;
49866c853ccSGustavo F. Padovan } __packed;
4991da177e4SLinus Torvalds 
500a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
501a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
502a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
5039b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
50466c853ccSGustavo F. Padovan } __packed;
5051da177e4SLinus Torvalds 
506a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
507a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
508a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
50966c853ccSGustavo F. Padovan } __packed;
5101da177e4SLinus Torvalds 
511a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
512a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
513a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
514a9de9248SMarcel Holtmann 	__u8     pin_len;
515a9de9248SMarcel Holtmann 	__u8     pin_code[16];
51666c853ccSGustavo F. Padovan } __packed;
517980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
518980e1a53SJohan Hedberg 	__u8     status;
519980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
520980e1a53SJohan Hedberg } __packed;
521a9de9248SMarcel Holtmann 
522a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
523a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
524a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
52566c853ccSGustavo F. Padovan } __packed;
526980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
527980e1a53SJohan Hedberg 	__u8     status;
528980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
529980e1a53SJohan Hedberg } __packed;
530a9de9248SMarcel Holtmann 
531a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
532a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
533a9de9248SMarcel Holtmann 	__le16   handle;
534a9de9248SMarcel Holtmann 	__le16   pkt_type;
53566c853ccSGustavo F. Padovan } __packed;
536a9de9248SMarcel Holtmann 
537a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
538a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
539a9de9248SMarcel Holtmann 	__le16   handle;
54066c853ccSGustavo F. Padovan } __packed;
541a9de9248SMarcel Holtmann 
542a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
543a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
544a9de9248SMarcel Holtmann 	__le16   handle;
545a9de9248SMarcel Holtmann 	__u8     encrypt;
54666c853ccSGustavo F. Padovan } __packed;
547a9de9248SMarcel Holtmann 
548a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
549a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
550a9de9248SMarcel Holtmann 	__le16   handle;
55166c853ccSGustavo F. Padovan } __packed;
552a9de9248SMarcel Holtmann 
553a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
554a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
555a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
556a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
557a9de9248SMarcel Holtmann 	__u8     pscan_mode;
558a9de9248SMarcel Holtmann 	__le16   clock_offset;
55966c853ccSGustavo F. Padovan } __packed;
560a9de9248SMarcel Holtmann 
561a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
562a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
563a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
56466c853ccSGustavo F. Padovan } __packed;
565a9de9248SMarcel Holtmann 
566a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
567a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
568a9de9248SMarcel Holtmann 	__le16   handle;
56966c853ccSGustavo F. Padovan } __packed;
570a9de9248SMarcel Holtmann 
571a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
572a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
573a9de9248SMarcel Holtmann 	__le16   handle;
574a9de9248SMarcel Holtmann 	__u8     page;
57566c853ccSGustavo F. Padovan } __packed;
576a9de9248SMarcel Holtmann 
577a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
578a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
579a9de9248SMarcel Holtmann 	__le16   handle;
58066c853ccSGustavo F. Padovan } __packed;
581a9de9248SMarcel Holtmann 
582df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
583df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
584df935429SMarcel Holtmann 	__le16   handle;
585df935429SMarcel Holtmann } __packed;
586df935429SMarcel Holtmann 
587a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
588a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
589a9de9248SMarcel Holtmann 	__le16   handle;
590a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
591a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
592a9de9248SMarcel Holtmann 	__le16   max_latency;
593a9de9248SMarcel Holtmann 	__le16   voice_setting;
594a9de9248SMarcel Holtmann 	__u8     retrans_effort;
595a9de9248SMarcel Holtmann 	__le16   pkt_type;
59666c853ccSGustavo F. Padovan } __packed;
597a9de9248SMarcel Holtmann 
598a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
599a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
600a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
601a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
602a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
603a9de9248SMarcel Holtmann 	__le16   max_latency;
604a9de9248SMarcel Holtmann 	__le16   content_format;
605a9de9248SMarcel Holtmann 	__u8     retrans_effort;
606a9de9248SMarcel Holtmann 	__le16   pkt_type;
60766c853ccSGustavo F. Padovan } __packed;
608a9de9248SMarcel Holtmann 
609a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
610a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
611a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
612a9de9248SMarcel Holtmann 	__u8     reason;
61366c853ccSGustavo F. Padovan } __packed;
614a9de9248SMarcel Holtmann 
61517fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
61617fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
61717fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
61817fa4b9dSJohan Hedberg 	__u8     capability;
61917fa4b9dSJohan Hedberg 	__u8     oob_data;
62017fa4b9dSJohan Hedberg 	__u8     authentication;
62117fa4b9dSJohan Hedberg } __packed;
62217fa4b9dSJohan Hedberg 
623a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
624a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
625a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
626a5c29683SJohan Hedberg } __packed;
627a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
628a5c29683SJohan Hedberg 	__u8     status;
629a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
630a5c29683SJohan Hedberg } __packed;
631a5c29683SJohan Hedberg 
632a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
633a5c29683SJohan Hedberg 
6349ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
6359ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
6369ad4019aSBrian Gix 	bdaddr_t bdaddr;
6379ad4019aSBrian Gix 	__le32	passkey;
6389ad4019aSBrian Gix } __packed;
6399ad4019aSBrian Gix 
6409ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
6419ad4019aSBrian Gix 
6422763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
6432763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
6442763eda6SSzymon Janc 	bdaddr_t bdaddr;
6452763eda6SSzymon Janc 	__u8     hash[16];
64638da1703SJohan Hedberg 	__u8     rand[16];
6472763eda6SSzymon Janc } __packed;
6482763eda6SSzymon Janc 
6492763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
6502763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
6512763eda6SSzymon Janc 	bdaddr_t bdaddr;
6522763eda6SSzymon Janc } __packed;
6532763eda6SSzymon Janc 
65403b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
65503b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
65603b555e1SJohan Hedberg 	bdaddr_t bdaddr;
65703b555e1SJohan Hedberg 	__u8     reason;
65803b555e1SJohan Hedberg } __packed;
65903b555e1SJohan Hedberg 
660523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
661523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
662523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
663523e93cdSAndrei Emeltchenko 	__u8     key_len;
664523e93cdSAndrei Emeltchenko 	__u8     key_type;
665523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
666523e93cdSAndrei Emeltchenko } __packed;
667523e93cdSAndrei Emeltchenko 
668523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
669523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
670523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
671523e93cdSAndrei Emeltchenko 	__u8     key_len;
672523e93cdSAndrei Emeltchenko 	__u8     key_type;
673523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
674523e93cdSAndrei Emeltchenko } __packed;
675523e93cdSAndrei Emeltchenko 
676523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
677523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
678523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
679523e93cdSAndrei Emeltchenko 	__u8     reason;
680b078b564SAndrei Emeltchenko } __packed;
681b078b564SAndrei Emeltchenko 
682b078b564SAndrei Emeltchenko struct ext_flow_spec {
683b078b564SAndrei Emeltchenko 	__u8       id;
684b078b564SAndrei Emeltchenko 	__u8       stype;
685b078b564SAndrei Emeltchenko 	__le16     msdu;
686b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
687b078b564SAndrei Emeltchenko 	__le32     acc_lat;
688b078b564SAndrei Emeltchenko 	__le32     flush_to;
689b078b564SAndrei Emeltchenko } __packed;
690b078b564SAndrei Emeltchenko 
691b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
692b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
693b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
694b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
695b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
696b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
697b078b564SAndrei Emeltchenko } __packed;
698b078b564SAndrei Emeltchenko 
699b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
700b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
701b078b564SAndrei Emeltchenko 	__le16   log_handle;
702b078b564SAndrei Emeltchenko } __packed;
703b078b564SAndrei Emeltchenko 
704b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
705b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
706b078b564SAndrei Emeltchenko 	__u8     phy_handle;
707b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
708b078b564SAndrei Emeltchenko } __packed;
709b078b564SAndrei Emeltchenko 
710b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
711b078b564SAndrei Emeltchenko 	__u8     status;
712b078b564SAndrei Emeltchenko 	__u8     phy_handle;
713b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
714523e93cdSAndrei Emeltchenko } __packed;
715523e93cdSAndrei Emeltchenko 
7168c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB			0x0441
7178c9a041bSDoHyun Pyun struct hci_cp_set_csb {
7188c9a041bSDoHyun Pyun 	__u8	enable;
7198c9a041bSDoHyun Pyun 	__u8	lt_addr;
7208c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
7218c9a041bSDoHyun Pyun 	__le16	packet_type;
7228c9a041bSDoHyun Pyun 	__le16	interval_min;
7238c9a041bSDoHyun Pyun 	__le16	interval_max;
7248c9a041bSDoHyun Pyun 	__le16	csb_sv_tout;
7258c9a041bSDoHyun Pyun } __packed;
7268c9a041bSDoHyun Pyun struct hci_rp_set_csb {
7278c9a041bSDoHyun Pyun 	__u8	status;
7288c9a041bSDoHyun Pyun 	__u8	lt_addr;
7298c9a041bSDoHyun Pyun 	__le16	interval;
7308c9a041bSDoHyun Pyun } __packed;
7318c9a041bSDoHyun Pyun 
732cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
733cefded98SDoHyun Pyun 
734e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
735e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
736e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
737e2f99131SMarcel Holtmann 	__u8     hash192[16];
73838da1703SJohan Hedberg 	__u8     rand192[16];
739e2f99131SMarcel Holtmann 	__u8     hash256[16];
74038da1703SJohan Hedberg 	__u8     rand256[16];
741e2f99131SMarcel Holtmann } __packed;
742e2f99131SMarcel Holtmann 
743a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
744a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
745a9de9248SMarcel Holtmann 	__le16   handle;
746a9de9248SMarcel Holtmann 	__le16   max_interval;
747a9de9248SMarcel Holtmann 	__le16   min_interval;
748a9de9248SMarcel Holtmann 	__le16   attempt;
749a9de9248SMarcel Holtmann 	__le16   timeout;
75066c853ccSGustavo F. Padovan } __packed;
751a9de9248SMarcel Holtmann 
752a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
753a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
754a9de9248SMarcel Holtmann 	__le16   handle;
75566c853ccSGustavo F. Padovan } __packed;
756a9de9248SMarcel Holtmann 
757a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
758a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
759a9de9248SMarcel Holtmann 	__le16   handle;
76066c853ccSGustavo F. Padovan } __packed;
761a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
762a9de9248SMarcel Holtmann 	__u8     status;
763a9de9248SMarcel Holtmann 	__le16   handle;
764a9de9248SMarcel Holtmann 	__u8     role;
76566c853ccSGustavo F. Padovan } __packed;
766a9de9248SMarcel Holtmann 
767a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
768a9de9248SMarcel Holtmann struct hci_cp_switch_role {
769a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
770a9de9248SMarcel Holtmann 	__u8     role;
77166c853ccSGustavo F. Padovan } __packed;
772a9de9248SMarcel Holtmann 
773a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
774a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
775a9de9248SMarcel Holtmann 	__le16   handle;
77666c853ccSGustavo F. Padovan } __packed;
777a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
778a9de9248SMarcel Holtmann 	__u8     status;
779a9de9248SMarcel Holtmann 	__le16   handle;
780a9de9248SMarcel Holtmann 	__le16   policy;
78166c853ccSGustavo F. Padovan } __packed;
782a9de9248SMarcel Holtmann 
783a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
784a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
785a9de9248SMarcel Holtmann 	__le16   handle;
786a9de9248SMarcel Holtmann 	__le16   policy;
78766c853ccSGustavo F. Padovan } __packed;
788a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
789a9de9248SMarcel Holtmann 	__u8     status;
790a9de9248SMarcel Holtmann 	__le16   handle;
79166c853ccSGustavo F. Padovan } __packed;
792a9de9248SMarcel Holtmann 
793e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
794e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
795e4e8e37cSMarcel Holtmann 	__u8     status;
796e4e8e37cSMarcel Holtmann 	__le16   policy;
79766c853ccSGustavo F. Padovan } __packed;
798e4e8e37cSMarcel Holtmann 
799e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
800e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
801e4e8e37cSMarcel Holtmann 	__le16   policy;
80266c853ccSGustavo F. Padovan } __packed;
803e4e8e37cSMarcel Holtmann 
804a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
805a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
806a9de9248SMarcel Holtmann 	__le16   handle;
807a9de9248SMarcel Holtmann 	__le16   max_latency;
808a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
809a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
81066c853ccSGustavo F. Padovan } __packed;
811a9de9248SMarcel Holtmann 
812a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
813a9de9248SMarcel Holtmann 
814a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
815a9de9248SMarcel Holtmann 
816a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
8171da177e4SLinus Torvalds struct hci_cp_set_event_flt {
8181da177e4SLinus Torvalds 	__u8     flt_type;
8191da177e4SLinus Torvalds 	__u8     cond_type;
8201da177e4SLinus Torvalds 	__u8     condition[0];
82166c853ccSGustavo F. Padovan } __packed;
8221da177e4SLinus Torvalds 
8231da177e4SLinus Torvalds /* Filter types */
8241da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
8251da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
8261da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
8271da177e4SLinus Torvalds 
8281da177e4SLinus Torvalds /* CONN_SETUP Condition types */
8291da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
8301da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
8311da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
8321da177e4SLinus Torvalds 
8331da177e4SLinus Torvalds /* CONN_SETUP Conditions */
8341da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
8351da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
8361da177e4SLinus Torvalds 
837b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
838b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
839b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
840b0916ea0SJohan Hedberg 	__u8     delete_all;
841b0916ea0SJohan Hedberg } __packed;
842b0916ea0SJohan Hedberg 
8431f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
8441f6c6378SJohan Hedberg 
845a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
846a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
8471f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
84866c853ccSGustavo F. Padovan } __packed;
849a9de9248SMarcel Holtmann 
850a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
851a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
852a9de9248SMarcel Holtmann 	__u8     status;
8531f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
85466c853ccSGustavo F. Padovan } __packed;
855a9de9248SMarcel Holtmann 
856a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
857a9de9248SMarcel Holtmann 
858a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
859a9de9248SMarcel Holtmann 
860a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
861a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
862a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
863a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
864a9de9248SMarcel Holtmann 
865a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
866a9de9248SMarcel Holtmann 
867a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
868a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
869a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
870a9de9248SMarcel Holtmann 
871a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
872a9de9248SMarcel Holtmann 
873a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
874a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
875a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
876a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
877a9de9248SMarcel Holtmann 
878a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
879a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
8801da177e4SLinus Torvalds 	__u8     status;
8811da177e4SLinus Torvalds 	__u8     dev_class[3];
88266c853ccSGustavo F. Padovan } __packed;
8831da177e4SLinus Torvalds 
884a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
885a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
8861da177e4SLinus Torvalds 	__u8     dev_class[3];
88766c853ccSGustavo F. Padovan } __packed;
8881da177e4SLinus Torvalds 
889a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
8901da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
8911da177e4SLinus Torvalds 	__u8     status;
8921ebb9252SMarcel Holtmann 	__le16   voice_setting;
89366c853ccSGustavo F. Padovan } __packed;
8941da177e4SLinus Torvalds 
895a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
8961da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
8971ebb9252SMarcel Holtmann 	__le16   voice_setting;
89866c853ccSGustavo F. Padovan } __packed;
8991da177e4SLinus Torvalds 
900a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
9011da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
9021ebb9252SMarcel Holtmann 	__le16   acl_mtu;
9031da177e4SLinus Torvalds 	__u8     sco_mtu;
9041ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
9051ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
90666c853ccSGustavo F. Padovan } __packed;
9071da177e4SLinus Torvalds 
908b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
909b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
910b4cb9fb2SMarcel Holtmann 	__u8	status;
911b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
912b4cb9fb2SMarcel Holtmann } __packed;
913b4cb9fb2SMarcel Holtmann 
9144b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
9154b836f39SMarcel Holtmann 
9163d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
9173d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
9183d505312SMarcel Holtmann 	__u8	num_iac;
9193d505312SMarcel Holtmann 	__u8	iac_lap[6];
9203d505312SMarcel Holtmann } __packed;
9213d505312SMarcel Holtmann 
922d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
923d5859e22SJohan Hedberg 
92480a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
92580a1e1dbSJohan Hedberg 
92680a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
92780a1e1dbSJohan Hedberg struct hci_cp_write_eir {
928816a11d5SJohan Hedberg 	__u8	fec;
929816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
93080a1e1dbSJohan Hedberg } __packed;
93180a1e1dbSJohan Hedberg 
932333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
933333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
934333140b5SMarcel Holtmann 	__u8     status;
935333140b5SMarcel Holtmann 	__u8     mode;
93666c853ccSGustavo F. Padovan } __packed;
937333140b5SMarcel Holtmann 
938333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
939333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
940333140b5SMarcel Holtmann 	__u8     mode;
94166c853ccSGustavo F. Padovan } __packed;
942333140b5SMarcel Holtmann 
943c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
944c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
945c35938b2SSzymon Janc 	__u8     status;
946c35938b2SSzymon Janc 	__u8     hash[16];
94738da1703SJohan Hedberg 	__u8     rand[16];
948c35938b2SSzymon Janc } __packed;
949c35938b2SSzymon Janc 
950d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
95191c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
95291c4e9b1SMarcel Holtmann 	__u8     status;
95391c4e9b1SMarcel Holtmann 	__s8     tx_power;
95491c4e9b1SMarcel Holtmann } __packed;
955d5859e22SJohan Hedberg 
956d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
957d62e6d67SJohan Hedberg 
9587528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
9597528ca1cSMarcel Holtmann 
9601e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
9611e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
9621e89cffbSAndrei Emeltchenko 	__u8     status;
9631e89cffbSAndrei Emeltchenko 	__u8     mode;
9641e89cffbSAndrei Emeltchenko } __packed;
9651e89cffbSAndrei Emeltchenko 
966f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
967f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
968f9b49306SAndre Guedes 	__u8	le;
969f9b49306SAndre Guedes 	__u8	simul;
970f9b49306SAndre Guedes } __packed;
971f9b49306SAndre Guedes 
972d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
973d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
974d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
975d0bf75a5SDoHyun Pyun } __packed;
976d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
977d0bf75a5SDoHyun Pyun 	__u8	status;
978d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
979d0bf75a5SDoHyun Pyun } __packed;
980d0bf75a5SDoHyun Pyun 
9816a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
9826a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
9836a20eaf4SDoHyun Pyun 	__u8	lt_addr;
9846a20eaf4SDoHyun Pyun } __packed;
9856a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
9866a20eaf4SDoHyun Pyun 	__u8	status;
9876a20eaf4SDoHyun Pyun 	__u8	lt_addr;
9886a20eaf4SDoHyun Pyun } __packed;
9896a20eaf4SDoHyun Pyun 
9907d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
9917d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
9927d1dab49SDoHyun Pyun 	__u8	lt_addr;
9937d1dab49SDoHyun Pyun 	__u8	fragment;
9947d1dab49SDoHyun Pyun 	__u8	data_length;
9957d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
9967d1dab49SDoHyun Pyun } __packed;
9977d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
9987d1dab49SDoHyun Pyun 	__u8	status;
9997d1dab49SDoHyun Pyun 	__u8	lt_addr;
10007d1dab49SDoHyun Pyun } __packed;
10017d1dab49SDoHyun Pyun 
10025d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
10035d4e7e8dSJohan Hedberg 
1004a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1005a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1006a9b07a64SDoHyun Pyun 	__le16	interval_min;
1007a9b07a64SDoHyun Pyun 	__le16	interval_max;
1008a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1009a9b07a64SDoHyun Pyun 	__u8	service_data;
1010a9b07a64SDoHyun Pyun } __packed;
1011a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1012a9b07a64SDoHyun Pyun 	__u8	status;
1013a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1014a9b07a64SDoHyun Pyun } __packed;
1015a9b07a64SDoHyun Pyun 
1016eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1017eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1018eb4b95c6SMarcel Holtmann 	__u8	status;
1019eb4b95c6SMarcel Holtmann 	__u8	support;
1020eb4b95c6SMarcel Holtmann } __packed;
1021eb4b95c6SMarcel Holtmann 
1022eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1023eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1024eb4b95c6SMarcel Holtmann 	__u8	support;
1025eb4b95c6SMarcel Holtmann } __packed;
1026eb4b95c6SMarcel Holtmann 
1027e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1028e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1029e2f99131SMarcel Holtmann 	__u8     status;
1030e2f99131SMarcel Holtmann 	__u8     hash192[16];
103138da1703SJohan Hedberg 	__u8     rand192[16];
1032e2f99131SMarcel Holtmann 	__u8     hash256[16];
103338da1703SJohan Hedberg 	__u8     rand256[16];
1034e2f99131SMarcel Holtmann } __packed;
1035e2f99131SMarcel Holtmann 
1036a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1037a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
10381da177e4SLinus Torvalds 	__u8     status;
1039a9de9248SMarcel Holtmann 	__u8     hci_ver;
1040a9de9248SMarcel Holtmann 	__le16   hci_rev;
1041a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1042a9de9248SMarcel Holtmann 	__le16   manufacturer;
1043a9de9248SMarcel Holtmann 	__le16   lmp_subver;
104466c853ccSGustavo F. Padovan } __packed;
10451da177e4SLinus Torvalds 
1046a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1047a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
10481da177e4SLinus Torvalds 	__u8     status;
1049a9de9248SMarcel Holtmann 	__u8     commands[64];
105066c853ccSGustavo F. Padovan } __packed;
10511da177e4SLinus Torvalds 
1052a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1053a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1054a9de9248SMarcel Holtmann 	__u8     status;
1055a9de9248SMarcel Holtmann 	__u8     features[8];
105666c853ccSGustavo F. Padovan } __packed;
1057a9de9248SMarcel Holtmann 
1058a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1059971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1060971e3a4bSAndre Guedes 	__u8     page;
1061971e3a4bSAndre Guedes } __packed;
1062a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1063a9de9248SMarcel Holtmann 	__u8     status;
1064a9de9248SMarcel Holtmann 	__u8     page;
1065a9de9248SMarcel Holtmann 	__u8     max_page;
1066a9de9248SMarcel Holtmann 	__u8     features[8];
106766c853ccSGustavo F. Padovan } __packed;
1068a9de9248SMarcel Holtmann 
1069a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1070a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1071a9de9248SMarcel Holtmann 	__u8     status;
1072a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1073a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1074a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1075a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
107666c853ccSGustavo F. Padovan } __packed;
1077a9de9248SMarcel Holtmann 
1078a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1079a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1080a9de9248SMarcel Holtmann 	__u8     status;
10811da177e4SLinus Torvalds 	bdaddr_t bdaddr;
108266c853ccSGustavo F. Padovan } __packed;
10831da177e4SLinus Torvalds 
1084350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1085350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1086350ee4cfSAndrei Emeltchenko 	__u8     status;
1087350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1088350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1089350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1090350ee4cfSAndrei Emeltchenko } __packed;
1091350ee4cfSAndrei Emeltchenko 
1092109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
1093109e3191SMarcel Holtmann 
1094f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1095f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1096f332ec66SJohan Hedberg 	__u8     status;
1097f332ec66SJohan Hedberg 	__le16   interval;
1098f332ec66SJohan Hedberg 	__le16   window;
1099f332ec66SJohan Hedberg } __packed;
1100f332ec66SJohan Hedberg 
1101f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1102f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1103f6422ec6SAntti Julku 	__le16   interval;
1104f6422ec6SAntti Julku 	__le16   window;
1105f6422ec6SAntti Julku } __packed;
1106f6422ec6SAntti Julku 
11075a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
11085a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
11095a134faeSAndrzej Kaczmarek 	__le16   handle;
11105a134faeSAndrzej Kaczmarek 	__u8     type;
11115a134faeSAndrzej Kaczmarek } __packed;
11125a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
11135a134faeSAndrzej Kaczmarek 	__u8     status;
11145a134faeSAndrzej Kaczmarek 	__le16   handle;
11155a134faeSAndrzej Kaczmarek 	__s8     tx_power;
11165a134faeSAndrzej Kaczmarek } __packed;
11175a134faeSAndrzej Kaczmarek 
1118f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1119f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1120f332ec66SJohan Hedberg 	__u8     status;
1121f332ec66SJohan Hedberg 	__u8     type;
1122f332ec66SJohan Hedberg } __packed;
1123f332ec66SJohan Hedberg 
1124f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1125f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1126f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1127f6422ec6SAntti Julku 
11285ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
11295ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
11305ae76a94SAndrzej Kaczmarek 	__le16   handle;
11315ae76a94SAndrzej Kaczmarek } __packed;
11325ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
11335ae76a94SAndrzej Kaczmarek 	__u8     status;
11345ae76a94SAndrzej Kaczmarek 	__le16   handle;
11355ae76a94SAndrzej Kaczmarek 	__s8     rssi;
11365ae76a94SAndrzej Kaczmarek } __packed;
11375ae76a94SAndrzej Kaczmarek 
113833f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
113933f35721SJohan Hedberg struct hci_cp_read_clock {
114033f35721SJohan Hedberg 	__le16   handle;
114133f35721SJohan Hedberg 	__u8     which;
114233f35721SJohan Hedberg } __packed;
114333f35721SJohan Hedberg struct hci_rp_read_clock {
114433f35721SJohan Hedberg 	__u8     status;
114533f35721SJohan Hedberg 	__le16   handle;
114633f35721SJohan Hedberg 	__le32   clock;
114733f35721SJohan Hedberg 	__le16   accuracy;
114833f35721SJohan Hedberg } __packed;
114933f35721SJohan Hedberg 
1150928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1151928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1152928abaa7SAndrei Emeltchenko 	__u8     status;
1153928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1154928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1155928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1156928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1157928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1158928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1159928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1160928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1161928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1162928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1163928abaa7SAndrei Emeltchenko } __packed;
1164928abaa7SAndrei Emeltchenko 
1165523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1166523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1167523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1168523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1169523e93cdSAndrei Emeltchenko 	__le16   max_len;
1170523e93cdSAndrei Emeltchenko } __packed;
1171523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1172523e93cdSAndrei Emeltchenko 	__u8     status;
1173523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1174523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1175523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1176523e93cdSAndrei Emeltchenko } __packed;
1177523e93cdSAndrei Emeltchenko 
1178523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1179523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1180523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1181523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1182523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1183523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1184523e93cdSAndrei Emeltchenko } __packed;
1185523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1186523e93cdSAndrei Emeltchenko 	__u8     status;
1187523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1188523e93cdSAndrei Emeltchenko } __packed;
1189523e93cdSAndrei Emeltchenko 
1190f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1191f4fe73edSMarcel Holtmann 
11924b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
11934b4148e9SMarcel Holtmann 
119406f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
119506f5b778SMarcel Holtmann 
119663185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
119763185f64SVille Tervo struct hci_cp_le_set_event_mask {
119863185f64SVille Tervo 	__u8     mask[8];
119963185f64SVille Tervo } __packed;
120063185f64SVille Tervo 
120163185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
120263185f64SVille Tervo struct hci_rp_le_read_buffer_size {
120363185f64SVille Tervo 	__u8     status;
120463185f64SVille Tervo 	__le16   le_mtu;
120563185f64SVille Tervo 	__u8     le_max_pkt;
120663185f64SVille Tervo } __packed;
120763185f64SVille Tervo 
120860e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
120960e77321SJohan Hedberg struct hci_rp_le_read_local_features {
121060e77321SJohan Hedberg 	__u8     status;
121160e77321SJohan Hedberg 	__u8     features[8];
121260e77321SJohan Hedberg } __packed;
121360e77321SJohan Hedberg 
1214d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1215d13eafceSMarcel Holtmann 
12161e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
12171e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
12181e191893SMarcel Holtmann 	__le16   min_interval;
12191e191893SMarcel Holtmann 	__le16   max_interval;
12201e191893SMarcel Holtmann 	__u8     type;
12211e191893SMarcel Holtmann 	__u8     own_address_type;
12221e191893SMarcel Holtmann 	__u8     direct_addr_type;
12231e191893SMarcel Holtmann 	bdaddr_t direct_addr;
12241e191893SMarcel Holtmann 	__u8     channel_map;
12251e191893SMarcel Holtmann 	__u8     filter_policy;
12261e191893SMarcel Holtmann } __packed;
12271e191893SMarcel Holtmann 
12288fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
12298fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
12308fa19098SJohan Hedberg 	__u8	status;
12318fa19098SJohan Hedberg 	__s8	tx_power;
12328fa19098SJohan Hedberg } __packed;
12338fa19098SJohan Hedberg 
12343f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
12353f0f524bSJohan Hedberg 
12363f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
12373f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
12383f0f524bSJohan Hedberg 	__u8	length;
12393f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
12403f0f524bSJohan Hedberg } __packed;
12413f0f524bSJohan Hedberg 
1242f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1243f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1244f14d8f64SMarcel Holtmann 	__u8	length;
1245f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1246f14d8f64SMarcel Holtmann } __packed;
1247f14d8f64SMarcel Holtmann 
1248c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1249c1d5dc4aSJohan Hedberg 
12505df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
12515df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
12525df480b5SAndre Guedes 
125307f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
125407f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
125507f7fa5dSAndre Guedes 	__u8    type;
125607f7fa5dSAndre Guedes 	__le16  interval;
125707f7fa5dSAndre Guedes 	__le16  window;
125807f7fa5dSAndre Guedes 	__u8    own_address_type;
125907f7fa5dSAndre Guedes 	__u8    filter_policy;
126007f7fa5dSAndre Guedes } __packed;
126107f7fa5dSAndre Guedes 
126276a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
126376a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1264525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1265525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
126668a8aea4SAndrei Emeltchenko 
1267eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1268eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1269eb9d91f5SAndre Guedes 	__u8     enable;
1270eb9d91f5SAndre Guedes 	__u8     filter_dup;
1271eb9d91f5SAndre Guedes } __packed;
1272eb9d91f5SAndre Guedes 
1273a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
1274a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST		0x01
1275a7139eddSJohan Hedberg 
127663185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
127763185f64SVille Tervo struct hci_cp_le_create_conn {
127863185f64SVille Tervo 	__le16   scan_interval;
127963185f64SVille Tervo 	__le16   scan_window;
128063185f64SVille Tervo 	__u8     filter_policy;
128163185f64SVille Tervo 	__u8     peer_addr_type;
128263185f64SVille Tervo 	bdaddr_t peer_addr;
128363185f64SVille Tervo 	__u8     own_address_type;
128463185f64SVille Tervo 	__le16   conn_interval_min;
128563185f64SVille Tervo 	__le16   conn_interval_max;
128663185f64SVille Tervo 	__le16   conn_latency;
128763185f64SVille Tervo 	__le16   supervision_timeout;
128863185f64SVille Tervo 	__le16   min_ce_len;
128963185f64SVille Tervo 	__le16   max_ce_len;
129063185f64SVille Tervo } __packed;
129163185f64SVille Tervo 
129263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
129363185f64SVille Tervo 
1294cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1295cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1296cf1d081fSJohan Hedberg 	__u8	status;
1297cf1d081fSJohan Hedberg 	__u8	size;
1298cf1d081fSJohan Hedberg } __packed;
1299cf1d081fSJohan Hedberg 
1300d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST	0x2010
1301d9a7b0a5SMarcel Holtmann 
1302d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST	0x2011
1303d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list {
1304d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1305d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1306d9a7b0a5SMarcel Holtmann } __packed;
1307d9a7b0a5SMarcel Holtmann 
1308d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST	0x2012
1309d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list {
1310d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1311d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1312d9a7b0a5SMarcel Holtmann } __packed;
1313d9a7b0a5SMarcel Holtmann 
13142ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
13152ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
13162ce603ebSClaudio Takahasi 	__le16   handle;
13172ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
13182ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
13192ce603ebSClaudio Takahasi 	__le16   conn_latency;
13202ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
13212ce603ebSClaudio Takahasi 	__le16   min_ce_len;
13222ce603ebSClaudio Takahasi 	__le16   max_ce_len;
13232ce603ebSClaudio Takahasi } __packed;
13242ce603ebSClaudio Takahasi 
1325a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1326a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1327a7a595f6SVinicius Costa Gomes 	__le16	handle;
1328fe39c7b2SMarcel Holtmann 	__le64	rand;
1329a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1330a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1331a7a595f6SVinicius Costa Gomes } __packed;
1332a7a595f6SVinicius Costa Gomes 
1333a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1334a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1335a7a595f6SVinicius Costa Gomes 	__le16	handle;
1336a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1337a7a595f6SVinicius Costa Gomes } __packed;
1338a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1339a7a595f6SVinicius Costa Gomes 	__u8	status;
1340a7a595f6SVinicius Costa Gomes 	__le16	handle;
1341a7a595f6SVinicius Costa Gomes } __packed;
1342a7a595f6SVinicius Costa Gomes 
1343a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1344a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1345a7a595f6SVinicius Costa Gomes 	__le16	handle;
1346a7a595f6SVinicius Costa Gomes } __packed;
1347a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1348a7a595f6SVinicius Costa Gomes 	__u8	status;
1349a7a595f6SVinicius Costa Gomes 	__le16	handle;
1350a7a595f6SVinicius Costa Gomes } __packed;
1351a7a595f6SVinicius Costa Gomes 
13529b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
13539b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
13549b008c04SJohan Hedberg 	__u8	status;
13559b008c04SJohan Hedberg 	__u8	le_states[8];
13569b008c04SJohan Hedberg } __packed;
13579b008c04SJohan Hedberg 
13588e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
13598e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
13608e75b46aSAndre Guedes 	__le16	handle;
13618e75b46aSAndre Guedes 	__le16	interval_min;
13628e75b46aSAndre Guedes 	__le16	interval_max;
13638e75b46aSAndre Guedes 	__le16	latency;
13648e75b46aSAndre Guedes 	__le16	timeout;
13658e75b46aSAndre Guedes 	__le16	min_ce_len;
13668e75b46aSAndre Guedes 	__le16	max_ce_len;
13678e75b46aSAndre Guedes } __packed;
13688e75b46aSAndre Guedes 
13698e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
13708e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
13718e75b46aSAndre Guedes 	__le16	handle;
13728e75b46aSAndre Guedes 	__u8	reason;
13738e75b46aSAndre Guedes } __packed;
13748e75b46aSAndre Guedes 
1375*94a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
1376*94a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
1377*94a3bd02SMarcel Holtmann 	__le16	handle;
1378*94a3bd02SMarcel Holtmann 	__le16	tx_len;
1379*94a3bd02SMarcel Holtmann 	__le16	tx_time;
1380*94a3bd02SMarcel Holtmann } __packed;
1381*94a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
1382*94a3bd02SMarcel Holtmann 	__u8	status;
1383*94a3bd02SMarcel Holtmann 	__le16	handle;
1384*94a3bd02SMarcel Holtmann } __packed;
1385*94a3bd02SMarcel Holtmann 
1386*94a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
1387*94a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
1388*94a3bd02SMarcel Holtmann 	__u8	status;
1389*94a3bd02SMarcel Holtmann 	__le16	tx_len;
1390*94a3bd02SMarcel Holtmann 	__le16	tx_time;
1391*94a3bd02SMarcel Holtmann } __packed;
1392*94a3bd02SMarcel Holtmann 
1393*94a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
1394*94a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
1395*94a3bd02SMarcel Holtmann 	__le16	tx_len;
1396*94a3bd02SMarcel Holtmann 	__le16	tx_time;
1397*94a3bd02SMarcel Holtmann } __packed;
1398*94a3bd02SMarcel Holtmann 
1399*94a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
1400*94a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
1401*94a3bd02SMarcel Holtmann 	__u8	status;
1402*94a3bd02SMarcel Holtmann 	__le16	tx_len;
1403*94a3bd02SMarcel Holtmann 	__le16	tx_time;
1404*94a3bd02SMarcel Holtmann 	__le16	rx_len;
1405*94a3bd02SMarcel Holtmann 	__le16	rx_time;
1406*94a3bd02SMarcel Holtmann } __packed;
1407*94a3bd02SMarcel Holtmann 
14081da177e4SLinus Torvalds /* ---- HCI Events ---- */
14091da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
14101da177e4SLinus Torvalds 
14111da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
14121da177e4SLinus Torvalds struct inquiry_info {
14131da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14141da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
14151da177e4SLinus Torvalds 	__u8     pscan_period_mode;
14161da177e4SLinus Torvalds 	__u8     pscan_mode;
14171da177e4SLinus Torvalds 	__u8     dev_class[3];
14181ebb9252SMarcel Holtmann 	__le16   clock_offset;
141966c853ccSGustavo F. Padovan } __packed;
14201da177e4SLinus Torvalds 
14211da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
14221da177e4SLinus Torvalds struct hci_ev_conn_complete {
14231da177e4SLinus Torvalds 	__u8     status;
14241ebb9252SMarcel Holtmann 	__le16   handle;
14251da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14261da177e4SLinus Torvalds 	__u8     link_type;
14271da177e4SLinus Torvalds 	__u8     encr_mode;
142866c853ccSGustavo F. Padovan } __packed;
14291da177e4SLinus Torvalds 
14301da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
14311da177e4SLinus Torvalds struct hci_ev_conn_request {
14321da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14331da177e4SLinus Torvalds 	__u8     dev_class[3];
14341da177e4SLinus Torvalds 	__u8     link_type;
143566c853ccSGustavo F. Padovan } __packed;
14361da177e4SLinus Torvalds 
14371da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
14381da177e4SLinus Torvalds struct hci_ev_disconn_complete {
14391da177e4SLinus Torvalds 	__u8     status;
14401ebb9252SMarcel Holtmann 	__le16   handle;
14411da177e4SLinus Torvalds 	__u8     reason;
144266c853ccSGustavo F. Padovan } __packed;
14431da177e4SLinus Torvalds 
14441da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
14451da177e4SLinus Torvalds struct hci_ev_auth_complete {
14461da177e4SLinus Torvalds 	__u8     status;
14471ebb9252SMarcel Holtmann 	__le16   handle;
144866c853ccSGustavo F. Padovan } __packed;
14491da177e4SLinus Torvalds 
1450a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1451a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1452a9de9248SMarcel Holtmann 	__u8     status;
1453a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
14541f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
145566c853ccSGustavo F. Padovan } __packed;
1456a9de9248SMarcel Holtmann 
14571da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
14581da177e4SLinus Torvalds struct hci_ev_encrypt_change {
14591da177e4SLinus Torvalds 	__u8     status;
14601ebb9252SMarcel Holtmann 	__le16   handle;
14611da177e4SLinus Torvalds 	__u8     encrypt;
146266c853ccSGustavo F. Padovan } __packed;
14631da177e4SLinus Torvalds 
1464a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1465a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
14661da177e4SLinus Torvalds 	__u8     status;
14671ebb9252SMarcel Holtmann 	__le16   handle;
146866c853ccSGustavo F. Padovan } __packed;
14691da177e4SLinus Torvalds 
1470a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1471a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1472a9de9248SMarcel Holtmann 	__u8     status;
1473a9de9248SMarcel Holtmann 	__le16   handle;
1474a9de9248SMarcel Holtmann 	__u8     features[8];
147566c853ccSGustavo F. Padovan } __packed;
1476a9de9248SMarcel Holtmann 
1477a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1478a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1479a9de9248SMarcel Holtmann 	__u8     status;
1480a9de9248SMarcel Holtmann 	__le16   handle;
1481a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1482a9de9248SMarcel Holtmann 	__le16   manufacturer;
1483a9de9248SMarcel Holtmann 	__le16   lmp_subver;
148466c853ccSGustavo F. Padovan } __packed;
1485a9de9248SMarcel Holtmann 
1486a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
14871da177e4SLinus Torvalds struct hci_qos {
14881da177e4SLinus Torvalds 	__u8     service_type;
14891da177e4SLinus Torvalds 	__u32    token_rate;
14901da177e4SLinus Torvalds 	__u32    peak_bandwidth;
14911da177e4SLinus Torvalds 	__u32    latency;
14921da177e4SLinus Torvalds 	__u32    delay_variation;
149366c853ccSGustavo F. Padovan } __packed;
14941da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
14951da177e4SLinus Torvalds 	__u8     status;
14961ebb9252SMarcel Holtmann 	__le16   handle;
14971da177e4SLinus Torvalds 	struct   hci_qos qos;
149866c853ccSGustavo F. Padovan } __packed;
14991da177e4SLinus Torvalds 
1500a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
15011da177e4SLinus Torvalds struct hci_ev_cmd_complete {
15021da177e4SLinus Torvalds 	__u8     ncmd;
15031ebb9252SMarcel Holtmann 	__le16   opcode;
150466c853ccSGustavo F. Padovan } __packed;
15051da177e4SLinus Torvalds 
1506a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
15071da177e4SLinus Torvalds struct hci_ev_cmd_status {
15081da177e4SLinus Torvalds 	__u8     status;
15091da177e4SLinus Torvalds 	__u8     ncmd;
15101ebb9252SMarcel Holtmann 	__le16   opcode;
151166c853ccSGustavo F. Padovan } __packed;
15121da177e4SLinus Torvalds 
151324dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
151424dfa343SMarcel Holtmann struct hci_ev_hardware_error {
151524dfa343SMarcel Holtmann 	__u8     code;
151624dfa343SMarcel Holtmann } __packed;
151724dfa343SMarcel Holtmann 
15181da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
15191da177e4SLinus Torvalds struct hci_ev_role_change {
15201da177e4SLinus Torvalds 	__u8     status;
15211da177e4SLinus Torvalds 	bdaddr_t bdaddr;
15221da177e4SLinus Torvalds 	__u8     role;
152366c853ccSGustavo F. Padovan } __packed;
15241da177e4SLinus Torvalds 
1525a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1526613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1527613a1c0cSAndrei Emeltchenko 	__le16   handle;
1528613a1c0cSAndrei Emeltchenko 	__le16   count;
1529613a1c0cSAndrei Emeltchenko } __packed;
1530613a1c0cSAndrei Emeltchenko 
1531a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1532a9de9248SMarcel Holtmann 	__u8     num_hndl;
1533613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
153466c853ccSGustavo F. Padovan } __packed;
1535a9de9248SMarcel Holtmann 
15361da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
15371da177e4SLinus Torvalds struct hci_ev_mode_change {
15381da177e4SLinus Torvalds 	__u8     status;
15391ebb9252SMarcel Holtmann 	__le16   handle;
15401da177e4SLinus Torvalds 	__u8     mode;
15411ebb9252SMarcel Holtmann 	__le16   interval;
154266c853ccSGustavo F. Padovan } __packed;
15431da177e4SLinus Torvalds 
15441da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
15451da177e4SLinus Torvalds struct hci_ev_pin_code_req {
15461da177e4SLinus Torvalds 	bdaddr_t bdaddr;
154766c853ccSGustavo F. Padovan } __packed;
15481da177e4SLinus Torvalds 
15491da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
15501da177e4SLinus Torvalds struct hci_ev_link_key_req {
15511da177e4SLinus Torvalds 	bdaddr_t bdaddr;
155266c853ccSGustavo F. Padovan } __packed;
15531da177e4SLinus Torvalds 
15541da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
15551da177e4SLinus Torvalds struct hci_ev_link_key_notify {
15561da177e4SLinus Torvalds 	bdaddr_t bdaddr;
15579b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
15581da177e4SLinus Torvalds 	__u8     key_type;
155966c853ccSGustavo F. Padovan } __packed;
15601da177e4SLinus Torvalds 
1561a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
15621da177e4SLinus Torvalds struct hci_ev_clock_offset {
15631da177e4SLinus Torvalds 	__u8     status;
15641ebb9252SMarcel Holtmann 	__le16   handle;
15651ebb9252SMarcel Holtmann 	__le16   clock_offset;
156666c853ccSGustavo F. Padovan } __packed;
15671da177e4SLinus Torvalds 
1568a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1569a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1570a8746417SMarcel Holtmann 	__u8     status;
1571a8746417SMarcel Holtmann 	__le16   handle;
1572a8746417SMarcel Holtmann 	__le16   pkt_type;
157366c853ccSGustavo F. Padovan } __packed;
1574a8746417SMarcel Holtmann 
157585a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
157685a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
157785a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
157885a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
157966c853ccSGustavo F. Padovan } __packed;
158085a1e930SMarcel Holtmann 
1581a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1582a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1583a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1584a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1585a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1586a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1587a9de9248SMarcel Holtmann 	__le16   clock_offset;
1588a9de9248SMarcel Holtmann 	__s8     rssi;
158966c853ccSGustavo F. Padovan } __packed;
1590a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1591a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1592a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1593a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1594a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1595a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1596a9de9248SMarcel Holtmann 	__le16   clock_offset;
1597a9de9248SMarcel Holtmann 	__s8     rssi;
159866c853ccSGustavo F. Padovan } __packed;
1599a9de9248SMarcel Holtmann 
1600a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1601a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1602a9de9248SMarcel Holtmann 	__u8     status;
1603a9de9248SMarcel Holtmann 	__le16   handle;
1604a9de9248SMarcel Holtmann 	__u8     page;
1605a9de9248SMarcel Holtmann 	__u8     max_page;
1606a9de9248SMarcel Holtmann 	__u8     features[8];
160766c853ccSGustavo F. Padovan } __packed;
1608a9de9248SMarcel Holtmann 
1609a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1610a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1611a9de9248SMarcel Holtmann 	__u8     status;
1612a9de9248SMarcel Holtmann 	__le16   handle;
1613a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1614a9de9248SMarcel Holtmann 	__u8     link_type;
1615a9de9248SMarcel Holtmann 	__u8     tx_interval;
1616a9de9248SMarcel Holtmann 	__u8     retrans_window;
1617a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1618a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1619a9de9248SMarcel Holtmann 	__u8     air_mode;
162066c853ccSGustavo F. Padovan } __packed;
1621a9de9248SMarcel Holtmann 
1622a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1623a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1624a9de9248SMarcel Holtmann 	__u8     status;
1625a9de9248SMarcel Holtmann 	__le16   handle;
1626a9de9248SMarcel Holtmann 	__u8     tx_interval;
1627a9de9248SMarcel Holtmann 	__u8     retrans_window;
1628a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1629a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
163066c853ccSGustavo F. Padovan } __packed;
1631a9de9248SMarcel Holtmann 
1632a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
163304837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
163404837f64SMarcel Holtmann 	__u8     status;
163504837f64SMarcel Holtmann 	__le16   handle;
163604837f64SMarcel Holtmann 	__le16   max_tx_latency;
163704837f64SMarcel Holtmann 	__le16   max_rx_latency;
163804837f64SMarcel Holtmann 	__le16   max_remote_timeout;
163904837f64SMarcel Holtmann 	__le16   max_local_timeout;
164066c853ccSGustavo F. Padovan } __packed;
164104837f64SMarcel Holtmann 
1642a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1643a9de9248SMarcel Holtmann struct extended_inquiry_info {
1644a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1645a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1646a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1647a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1648a9de9248SMarcel Holtmann 	__le16   clock_offset;
1649a9de9248SMarcel Holtmann 	__s8     rssi;
1650a9de9248SMarcel Holtmann 	__u8     data[240];
165166c853ccSGustavo F. Padovan } __packed;
1652a9de9248SMarcel Holtmann 
16531c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
16541c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
16551c2e0041SJohan Hedberg 	__u8	status;
16561c2e0041SJohan Hedberg 	__le16	handle;
16571c2e0041SJohan Hedberg } __packed;
16581c2e0041SJohan Hedberg 
16590493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
16600493684eSMarcel Holtmann struct hci_ev_io_capa_request {
16610493684eSMarcel Holtmann 	bdaddr_t bdaddr;
166266c853ccSGustavo F. Padovan } __packed;
16630493684eSMarcel Holtmann 
166403b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
166503b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
166603b555e1SJohan Hedberg 	bdaddr_t bdaddr;
166703b555e1SJohan Hedberg 	__u8     capability;
166803b555e1SJohan Hedberg 	__u8     oob_data;
166903b555e1SJohan Hedberg 	__u8     authentication;
167003b555e1SJohan Hedberg } __packed;
167103b555e1SJohan Hedberg 
1672a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1673a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1674a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1675a5c29683SJohan Hedberg 	__le32		passkey;
1676a5c29683SJohan Hedberg } __packed;
1677a5c29683SJohan Hedberg 
16789ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
16799ad4019aSBrian Gix struct hci_ev_user_passkey_req {
16809ad4019aSBrian Gix 	bdaddr_t	bdaddr;
16819ad4019aSBrian Gix } __packed;
16829ad4019aSBrian Gix 
16832763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
16842763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
16852763eda6SSzymon Janc 	bdaddr_t bdaddr;
16862763eda6SSzymon Janc } __packed;
16872763eda6SSzymon Janc 
16880493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
16890493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
16900493684eSMarcel Holtmann 	__u8     status;
16910493684eSMarcel Holtmann 	bdaddr_t bdaddr;
169266c853ccSGustavo F. Padovan } __packed;
16930493684eSMarcel Holtmann 
169492a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
169592a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
169692a25256SJohan Hedberg 	bdaddr_t	bdaddr;
169792a25256SJohan Hedberg 	__le32		passkey;
169892a25256SJohan Hedberg } __packed;
169992a25256SJohan Hedberg 
170092a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
170192a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
170292a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
170392a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
170492a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
170592a25256SJohan Hedberg 
170692a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
170792a25256SJohan Hedberg struct hci_ev_keypress_notify {
170892a25256SJohan Hedberg 	bdaddr_t	bdaddr;
170992a25256SJohan Hedberg 	__u8		type;
171092a25256SJohan Hedberg } __packed;
171192a25256SJohan Hedberg 
171241a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
171341a96212SMarcel Holtmann struct hci_ev_remote_host_features {
171441a96212SMarcel Holtmann 	bdaddr_t bdaddr;
171541a96212SMarcel Holtmann 	__u8     features[8];
171666c853ccSGustavo F. Padovan } __packed;
171741a96212SMarcel Holtmann 
171863185f64SVille Tervo #define HCI_EV_LE_META			0x3e
171963185f64SVille Tervo struct hci_ev_le_meta {
172063185f64SVille Tervo 	__u8     subevent;
172163185f64SVille Tervo } __packed;
172263185f64SVille Tervo 
1723523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
1724523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
1725523e93cdSAndrei Emeltchenko 	__u8     status;
1726523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1727523e93cdSAndrei Emeltchenko } __packed;
1728523e93cdSAndrei Emeltchenko 
1729523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
1730523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
1731523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1732523e93cdSAndrei Emeltchenko } __packed;
1733523e93cdSAndrei Emeltchenko 
1734523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
1735523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
1736523e93cdSAndrei Emeltchenko 	__u8     status;
1737523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1738523e93cdSAndrei Emeltchenko 	__u8     reason;
1739523e93cdSAndrei Emeltchenko } __packed;
1740523e93cdSAndrei Emeltchenko 
1741523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
1742523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
1743523e93cdSAndrei Emeltchenko 	__u8     status;
1744523e93cdSAndrei Emeltchenko 	__le16   handle;
1745523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1746523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
1747523e93cdSAndrei Emeltchenko } __packed;
1748523e93cdSAndrei Emeltchenko 
1749523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
1750523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
1751523e93cdSAndrei Emeltchenko 	__u8     status;
1752523e93cdSAndrei Emeltchenko 	__le16   handle;
1753523e93cdSAndrei Emeltchenko 	__u8     reason;
1754523e93cdSAndrei Emeltchenko } __packed;
1755523e93cdSAndrei Emeltchenko 
175625e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
175725e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
175825e89e99SAndrei Emeltchenko 	__le16   handle;
175925e89e99SAndrei Emeltchenko 	__le16   pkts;
176025e89e99SAndrei Emeltchenko 	__le16   blocks;
176125e89e99SAndrei Emeltchenko } __packed;
176225e89e99SAndrei Emeltchenko 
176325e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
176425e89e99SAndrei Emeltchenko 	__le16   num_blocks;
176525e89e99SAndrei Emeltchenko 	__u8     num_hndl;
176625e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
176725e89e99SAndrei Emeltchenko } __packed;
176825e89e99SAndrei Emeltchenko 
17692b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
17702b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
17712b359445SDoHyun Pyun 	__u8	status;
17722b359445SDoHyun Pyun } __packed;
17732b359445SDoHyun Pyun 
17742ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
17752ed01805SDoHyun Pyun 
177663185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
177763185f64SVille Tervo struct hci_ev_le_conn_complete {
177863185f64SVille Tervo 	__u8     status;
177963185f64SVille Tervo 	__le16   handle;
178063185f64SVille Tervo 	__u8     role;
178163185f64SVille Tervo 	__u8     bdaddr_type;
178263185f64SVille Tervo 	bdaddr_t bdaddr;
178363185f64SVille Tervo 	__le16   interval;
178463185f64SVille Tervo 	__le16   latency;
178563185f64SVille Tervo 	__le16   supervision_timeout;
178663185f64SVille Tervo 	__u8     clk_accurancy;
178763185f64SVille Tervo } __packed;
178863185f64SVille Tervo 
17892331fd46SMarcel Holtmann /* Advertising report event types */
17902331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
17912331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
17922331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
17932331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
17942331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
17952331fd46SMarcel Holtmann 
17962331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC	0x00
17972331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM	0x01
17982331fd46SMarcel Holtmann 
17992331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
18002331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
18012331fd46SMarcel Holtmann 	__u8	 evt_type;
18022331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
18032331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
18042331fd46SMarcel Holtmann 	__u8	 length;
18052331fd46SMarcel Holtmann 	__u8	 data[0];
18062331fd46SMarcel Holtmann } __packed;
18072331fd46SMarcel Holtmann 
18081855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
18091855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
18101855d92dSMarcel Holtmann 	__u8     status;
18111855d92dSMarcel Holtmann 	__le16   handle;
18121855d92dSMarcel Holtmann 	__le16   interval;
18131855d92dSMarcel Holtmann 	__le16   latency;
18141855d92dSMarcel Holtmann 	__le16   supervision_timeout;
18151855d92dSMarcel Holtmann } __packed;
18161855d92dSMarcel Holtmann 
1817a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1818a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1819a7a595f6SVinicius Costa Gomes 	__le16	handle;
1820fe39c7b2SMarcel Holtmann 	__le64	rand;
1821a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1822a7a595f6SVinicius Costa Gomes } __packed;
1823a7a595f6SVinicius Costa Gomes 
18248e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
18258e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
18268e75b46aSAndre Guedes 	__le16 handle;
18278e75b46aSAndre Guedes 	__le16 interval_min;
18288e75b46aSAndre Guedes 	__le16 interval_max;
18298e75b46aSAndre Guedes 	__le16 latency;
18308e75b46aSAndre Guedes 	__le16 timeout;
18318e75b46aSAndre Guedes } __packed;
18328e75b46aSAndre Guedes 
1833*94a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
1834*94a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
1835*94a3bd02SMarcel Holtmann 	__le16	handle;
1836*94a3bd02SMarcel Holtmann 	__le16	tx_len;
1837*94a3bd02SMarcel Holtmann 	__le16	tx_time;
1838*94a3bd02SMarcel Holtmann 	__le16	rx_len;
1839*94a3bd02SMarcel Holtmann 	__le16	rx_time;
1840*94a3bd02SMarcel Holtmann } __packed;
1841*94a3bd02SMarcel Holtmann 
184232c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
184332c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
184432c9d43fSMarcel Holtmann 	__u8	 evt_type;
184532c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
184632c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
184732c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
184832c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
184932c9d43fSMarcel Holtmann 	__s8	 rssi;
185032c9d43fSMarcel Holtmann } __packed;
185132c9d43fSMarcel Holtmann 
18521da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1853a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
18541da177e4SLinus Torvalds struct hci_ev_stack_internal {
18551da177e4SLinus Torvalds 	__u16    type;
18561da177e4SLinus Torvalds 	__u8     data[0];
185766c853ccSGustavo F. Padovan } __packed;
18581da177e4SLinus Torvalds 
18591da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
18601da177e4SLinus Torvalds struct hci_ev_si_device {
18611da177e4SLinus Torvalds 	__u16    event;
18621da177e4SLinus Torvalds 	__u16    dev_id;
186366c853ccSGustavo F. Padovan } __packed;
18641da177e4SLinus Torvalds 
18651da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
18661da177e4SLinus Torvalds struct hci_ev_si_security {
18671da177e4SLinus Torvalds 	__u16    event;
18681da177e4SLinus Torvalds 	__u16    proto;
18691da177e4SLinus Torvalds 	__u16    subproto;
18701da177e4SLinus Torvalds 	__u8     incoming;
187166c853ccSGustavo F. Padovan } __packed;
18721da177e4SLinus Torvalds 
18731da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
18741da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
18751da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
18761da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
18771da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
18781da177e4SLinus Torvalds 
18791da177e4SLinus Torvalds struct hci_command_hdr {
18801ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
18811da177e4SLinus Torvalds 	__u8	plen;
188266c853ccSGustavo F. Padovan } __packed;
18831da177e4SLinus Torvalds 
18841da177e4SLinus Torvalds struct hci_event_hdr {
18851da177e4SLinus Torvalds 	__u8	evt;
18861da177e4SLinus Torvalds 	__u8	plen;
188766c853ccSGustavo F. Padovan } __packed;
18881da177e4SLinus Torvalds 
18891da177e4SLinus Torvalds struct hci_acl_hdr {
18901ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
18911ebb9252SMarcel Holtmann 	__le16	dlen;
189266c853ccSGustavo F. Padovan } __packed;
18931da177e4SLinus Torvalds 
18941da177e4SLinus Torvalds struct hci_sco_hdr {
18951ebb9252SMarcel Holtmann 	__le16	handle;
18961da177e4SLinus Torvalds 	__u8	dlen;
189766c853ccSGustavo F. Padovan } __packed;
18981da177e4SLinus Torvalds 
18992a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
19002a123b86SArnaldo Carvalho de Melo {
19012a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
19022a123b86SArnaldo Carvalho de Melo }
19032a123b86SArnaldo Carvalho de Melo 
19042a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
19052a123b86SArnaldo Carvalho de Melo {
19062a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
19072a123b86SArnaldo Carvalho de Melo }
19082a123b86SArnaldo Carvalho de Melo 
19092a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
19102a123b86SArnaldo Carvalho de Melo {
19112a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
19122a123b86SArnaldo Carvalho de Melo }
19132a123b86SArnaldo Carvalho de Melo 
19141da177e4SLinus Torvalds /* Command opcode pack/unpack */
1915c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
19161da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
19171da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
19181da177e4SLinus Torvalds 
19191da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
1920c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
19211da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
19221da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
19231da177e4SLinus Torvalds 
19241da177e4SLinus Torvalds #endif /* __HCI_H */
1925