xref: /openbmc/linux/include/net/bluetooth/hci.h (revision 4b4113d6dbdbdac095743c05f694af9b7cdc9a44)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds    BlueZ - Bluetooth protocol stack for Linux
31da177e4SLinus Torvalds    Copyright (C) 2000-2001 Qualcomm Incorporated
41da177e4SLinus Torvalds 
51da177e4SLinus Torvalds    Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
61da177e4SLinus Torvalds 
71da177e4SLinus Torvalds    This program is free software; you can redistribute it and/or modify
81da177e4SLinus Torvalds    it under the terms of the GNU General Public License version 2 as
91da177e4SLinus Torvalds    published by the Free Software Foundation;
101da177e4SLinus Torvalds 
111da177e4SLinus Torvalds    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
121da177e4SLinus Torvalds    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131da177e4SLinus Torvalds    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
141da177e4SLinus Torvalds    IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
151da177e4SLinus Torvalds    CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
161da177e4SLinus Torvalds    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
171da177e4SLinus Torvalds    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
181da177e4SLinus Torvalds    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
191da177e4SLinus Torvalds 
201da177e4SLinus Torvalds    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
211da177e4SLinus Torvalds    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
221da177e4SLinus Torvalds    SOFTWARE IS DISCLAIMED.
231da177e4SLinus Torvalds */
241da177e4SLinus Torvalds 
251da177e4SLinus Torvalds #ifndef __HCI_H
261da177e4SLinus Torvalds #define __HCI_H
271da177e4SLinus Torvalds 
281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE	1024
291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE	255
301da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE	260
311da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE	(HCI_MAX_ACL_SIZE + 4)
321da177e4SLinus Torvalds 
339b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE	16
34523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE	(2 * HCI_LINK_KEY_SIZE)
359b3b4460SAndrei Emeltchenko 
36903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE	672
37903e4541SAndrei Emeltchenko 
387d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE	252
397d1dab49SDoHyun Pyun 
401da177e4SLinus Torvalds /* HCI dev events */
411da177e4SLinus Torvalds #define HCI_DEV_REG			1
421da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
431da177e4SLinus Torvalds #define HCI_DEV_UP			3
441da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
451da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
461da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
474a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN			7
484a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE			8
491da177e4SLinus Torvalds 
501da177e4SLinus Torvalds /* HCI notify events */
511da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
521da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
531da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
541da177e4SLinus Torvalds 
55c13854ceSMarcel Holtmann /* HCI bus types */
560ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
571da177e4SLinus Torvalds #define HCI_USB		1
581da177e4SLinus Torvalds #define HCI_PCCARD	2
591da177e4SLinus Torvalds #define HCI_UART	3
601da177e4SLinus Torvalds #define HCI_RS232	4
611da177e4SLinus Torvalds #define HCI_PCI		5
620ac53939SMarcel Holtmann #define HCI_SDIO	6
631da177e4SLinus Torvalds 
64943da25dSMarcel Holtmann /* HCI controller types */
65943da25dSMarcel Holtmann #define HCI_BREDR	0x00
668f1e1742SDavid Vrabel #define HCI_AMP		0x01
67943da25dSMarcel Holtmann 
688598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
696ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
708598d064SAndrei Emeltchenko 
717c13823dSMarcel Holtmann /* AMP controller types */
727c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
737c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
747c13823dSMarcel Holtmann 
75ab846ec4SAndrei Emeltchenko /* AMP controller status */
76536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
77536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
78536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
79536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
80536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
81536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
82536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
83ab846ec4SAndrei Emeltchenko 
841da177e4SLinus Torvalds /* HCI device quirks */
851da177e4SLinus Torvalds enum {
86118305b5SMarcel Holtmann 	/* When this quirk is set, the HCI Reset command is send when
87118305b5SMarcel Holtmann 	 * closing the transport instead of when opening it.
88118305b5SMarcel Holtmann 	 *
89118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
90118305b5SMarcel Holtmann 	 */
91a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
92118305b5SMarcel Holtmann 
93118305b5SMarcel Holtmann 	/* When this quirk is set, the device is turned into a raw-only
94118305b5SMarcel Holtmann 	 * device and it will stay in unconfigured state.
95118305b5SMarcel Holtmann 	 *
96118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
97118305b5SMarcel Holtmann 	 */
98da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
99118305b5SMarcel Holtmann 
100118305b5SMarcel Holtmann 	/* When this quirk is set, the buffer sizes reported by
101118305b5SMarcel Holtmann 	 * HCI Read Buffer Size command are corrected if invalid.
102118305b5SMarcel Holtmann 	 *
103118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
104118305b5SMarcel Holtmann 	 */
105f9f462faSMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE,
106118305b5SMarcel Holtmann 
107043ec9bfSMarcel Holtmann 	/* When this quirk is set, then a controller that does not
108043ec9bfSMarcel Holtmann 	 * indicate support for Inquiry Result with RSSI is assumed to
109043ec9bfSMarcel Holtmann 	 * support it anyway. Some early Bluetooth 1.2 controllers had
110043ec9bfSMarcel Holtmann 	 * wrongly configured local features that will require forcing
111043ec9bfSMarcel Holtmann 	 * them to enable this mode. Getting RSSI information with the
112043ec9bfSMarcel Holtmann 	 * inquiry responses is preferred since it allows for a better
113043ec9bfSMarcel Holtmann 	 * user expierence.
114043ec9bfSMarcel Holtmann 	 *
115043ec9bfSMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
116043ec9bfSMarcel Holtmann 	 */
117043ec9bfSMarcel Holtmann 	HCI_QUIRK_FIXUP_INQUIRY_MODE,
118043ec9bfSMarcel Holtmann 
119711ffa78SMarcel Holtmann 	/* When this quirk is set, then the HCI Read Local Supported
120711ffa78SMarcel Holtmann 	 * Commands command is not supported. In general Bluetooth 1.2
121711ffa78SMarcel Holtmann 	 * and later controllers should support this command. However
122711ffa78SMarcel Holtmann 	 * some controllers indicate Bluetooth 1.2 support, but do
123711ffa78SMarcel Holtmann 	 * not support this command.
124711ffa78SMarcel Holtmann 	 *
125711ffa78SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
126711ffa78SMarcel Holtmann 	 */
127711ffa78SMarcel Holtmann 	HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
128711ffa78SMarcel Holtmann 
129118305b5SMarcel Holtmann 	/* When this quirk is set, then no stored link key handling
130118305b5SMarcel Holtmann 	 * is performed. This is mainly due to the fact that the
131118305b5SMarcel Holtmann 	 * HCI Delete Stored Link Key command is advertised, but
132118305b5SMarcel Holtmann 	 * not supported.
133118305b5SMarcel Holtmann 	 *
134118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
135118305b5SMarcel Holtmann 	 */
136f9f462faSMarcel Holtmann 	HCI_QUIRK_BROKEN_STORED_LINK_KEY,
13789bc22d2SMarcel Holtmann 
138eb1904f4SMarcel Holtmann 	/* When this quirk is set, an external configuration step
139eb1904f4SMarcel Holtmann 	 * is required and will be indicated with the controller
140eb1904f4SMarcel Holtmann 	 * configuation.
141eb1904f4SMarcel Holtmann 	 *
142eb1904f4SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
143eb1904f4SMarcel Holtmann 	 * during the hdev->setup vendor callback.
144eb1904f4SMarcel Holtmann 	 */
145eb1904f4SMarcel Holtmann 	HCI_QUIRK_EXTERNAL_CONFIG,
146eb1904f4SMarcel Holtmann 
14789bc22d2SMarcel Holtmann 	/* When this quirk is set, the public Bluetooth address
14889bc22d2SMarcel Holtmann 	 * initially reported by HCI Read BD Address command
14989bc22d2SMarcel Holtmann 	 * is considered invalid. Controller configuration is
15089bc22d2SMarcel Holtmann 	 * required before this device can be used.
15189bc22d2SMarcel Holtmann 	 *
15289bc22d2SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
15389bc22d2SMarcel Holtmann 	 * during the hdev->setup vendor callback.
15489bc22d2SMarcel Holtmann 	 */
15589bc22d2SMarcel Holtmann 	HCI_QUIRK_INVALID_BDADDR,
15643d6bc46SMarcel Holtmann 
15743d6bc46SMarcel Holtmann 	/* When this quirk is set, the duplicate filtering during
15843d6bc46SMarcel Holtmann 	 * scanning is based on Bluetooth devices addresses. To allow
15943d6bc46SMarcel Holtmann 	 * RSSI based updates, restart scanning if needed.
16043d6bc46SMarcel Holtmann 	 *
16143d6bc46SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
16243d6bc46SMarcel Holtmann 	 * during the hdev->setup vendor callback.
16343d6bc46SMarcel Holtmann 	 */
16443d6bc46SMarcel Holtmann 	HCI_QUIRK_STRICT_DUPLICATE_FILTER,
165695c4cb6SJakub Pawlowski 
166695c4cb6SJakub Pawlowski 	/* When this quirk is set, LE scan and BR/EDR inquiry is done
167695c4cb6SJakub Pawlowski 	 * simultaneously, otherwise it's interleaved.
168695c4cb6SJakub Pawlowski 	 *
169695c4cb6SJakub Pawlowski 	 * This quirk can be set before hci_register_dev is called or
170695c4cb6SJakub Pawlowski 	 * during the hdev->setup vendor callback.
171695c4cb6SJakub Pawlowski 	 */
172695c4cb6SJakub Pawlowski 	HCI_QUIRK_SIMULTANEOUS_DISCOVERY,
1731da177e4SLinus Torvalds };
1741da177e4SLinus Torvalds 
1751da177e4SLinus Torvalds /* HCI device flags */
1761da177e4SLinus Torvalds enum {
1771da177e4SLinus Torvalds 	HCI_UP,
1781da177e4SLinus Torvalds 	HCI_INIT,
1791da177e4SLinus Torvalds 	HCI_RUNNING,
1801da177e4SLinus Torvalds 
1811da177e4SLinus Torvalds 	HCI_PSCAN,
1821da177e4SLinus Torvalds 	HCI_ISCAN,
1831da177e4SLinus Torvalds 	HCI_AUTH,
1841da177e4SLinus Torvalds 	HCI_ENCRYPT,
1851da177e4SLinus Torvalds 	HCI_INQUIRY,
1861da177e4SLinus Torvalds 
1871da177e4SLinus Torvalds 	HCI_RAW,
188ab81cbf9SJohan Hedberg 
18910572132SGustavo F. Padovan 	HCI_RESET,
1901da177e4SLinus Torvalds };
1911da177e4SLinus Torvalds 
192f9207338SMarcel Holtmann /* HCI socket flags */
193f9207338SMarcel Holtmann enum {
19450ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
195f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
196f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
197ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
198f6b7712eSMarcel Holtmann 	HCI_MGMT_GENERIC_EVENTS,
19972000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
200f9207338SMarcel Holtmann };
201f9207338SMarcel Holtmann 
202d23264a8SAndre Guedes /*
203d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
204d23264a8SAndre Guedes  * states from the controller.
205d23264a8SAndre Guedes  */
206d23264a8SAndre Guedes enum {
207a8b2d5c2SJohan Hedberg 	HCI_SETUP,
208d603b76bSMarcel Holtmann 	HCI_CONFIG,
209a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
2105e130367SJohan Hedberg 	HCI_RFKILLED,
211a8b2d5c2SJohan Hedberg 	HCI_MGMT,
212b6ae8457SJohan Hedberg 	HCI_BONDABLE,
213a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
2140663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
2153769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
21694324962SJohan Hovold 	HCI_UNREGISTER,
2174a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
2180736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
219dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
22066c417c1SJohan Hedberg 	HCI_LE_ADV,
221d23264a8SAndre Guedes 	HCI_LE_SCAN,
22284bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
223e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
224134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
225863efaf2SJohan Hedberg 	HCI_PRIVACY,
226d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
22741edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
2286d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
22906199cf8SJohan Hedberg 	HCI_LE_ENABLED,
230f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
231cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
2324453b006SArman Uguray 	HCI_ADVERTISING_INSTANCE,
2335e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
2345e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
2356acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
23647990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
23721693c15SAndre Guedes 	HCI_PERIODIC_INQ,
2381a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
23956f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
24081ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
241b7cb93e5SMarcel Holtmann 
242b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
243*4b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
244b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
245b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
246b7cb93e5SMarcel Holtmann 
247eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
248d23264a8SAndre Guedes };
249d23264a8SAndre Guedes 
2501da177e4SLinus Torvalds /* HCI timeouts */
2515f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
2525f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
2535f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
254d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
2555f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
2569345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
257a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
2589489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
25909ae260bSJohan Hedberg #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
2601da177e4SLinus Torvalds 
2615b7f9909SMarcel Holtmann /* HCI data types */
2621da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
2631da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
2641da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
2651da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
266e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
2671da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
2681da177e4SLinus Torvalds 
2695b7f9909SMarcel Holtmann /* HCI packet types */
2701da177e4SLinus Torvalds #define HCI_DM1		0x0008
2711da177e4SLinus Torvalds #define HCI_DM3		0x0400
2721da177e4SLinus Torvalds #define HCI_DM5		0x4000
2731da177e4SLinus Torvalds #define HCI_DH1		0x0010
2741da177e4SLinus Torvalds #define HCI_DH3		0x0800
2751da177e4SLinus Torvalds #define HCI_DH5		0x8000
2761da177e4SLinus Torvalds 
2771da177e4SLinus Torvalds #define HCI_HV1		0x0020
2781da177e4SLinus Torvalds #define HCI_HV2		0x0040
2791da177e4SLinus Torvalds #define HCI_HV3		0x0080
2801da177e4SLinus Torvalds 
2811da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
2821da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
2831da177e4SLinus Torvalds 
2845b7f9909SMarcel Holtmann /* eSCO packet types */
2855b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
2865b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
2875b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
2885b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
2895b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
2905b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
291efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
292efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
293efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
294efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
2955b7f9909SMarcel Holtmann 
296a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
297efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
298a8746417SMarcel Holtmann 
2991da177e4SLinus Torvalds /* ACL flags */
300e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
3011da177e4SLinus Torvalds #define ACL_CONT		0x01
3021da177e4SLinus Torvalds #define ACL_START		0x02
303d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
3041da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
3051da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
3061da177e4SLinus Torvalds 
3071da177e4SLinus Torvalds /* Baseband links */
3081da177e4SLinus Torvalds #define SCO_LINK	0x00
3091da177e4SLinus Torvalds #define ACL_LINK	0x01
3105b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
311fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
312fcd89c09SVille Tervo #define LE_LINK		0x80
3133161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
314845472e8SMarcel Holtmann #define INVALID_LINK	0xff
3151da177e4SLinus Torvalds 
3161da177e4SLinus Torvalds /* LMP features */
3171da177e4SLinus Torvalds #define LMP_3SLOT	0x01
3181da177e4SLinus Torvalds #define LMP_5SLOT	0x02
3191da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
3201da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
3211da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
3221da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
3231da177e4SLinus Torvalds #define LMP_HOLD	0x40
32404837f64SMarcel Holtmann #define LMP_SNIFF	0x80
3251da177e4SLinus Torvalds 
3261da177e4SLinus Torvalds #define LMP_PARK	0x01
3271da177e4SLinus Torvalds #define LMP_RSSI	0x02
3281da177e4SLinus Torvalds #define LMP_QUALITY	0x04
3291da177e4SLinus Torvalds #define LMP_SCO		0x08
3301da177e4SLinus Torvalds #define LMP_HV2		0x10
3311da177e4SLinus Torvalds #define LMP_HV3		0x20
3321da177e4SLinus Torvalds #define LMP_ULAW	0x40
3331da177e4SLinus Torvalds #define LMP_ALAW	0x80
3341da177e4SLinus Torvalds 
3351da177e4SLinus Torvalds #define LMP_CVSD	0x01
3361da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
3371da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
33807a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
3391da177e4SLinus Torvalds 
340d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
3415b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
3425b7f9909SMarcel Holtmann 
3435b7f9909SMarcel Holtmann #define LMP_EV4		0x01
3445b7f9909SMarcel Holtmann #define LMP_EV5		0x02
34569ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
346d5859e22SJohan Hedberg #define LMP_LE		0x40
3475b7f9909SMarcel Holtmann 
34804837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
349d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
350efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
351efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
352efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
35304837f64SMarcel Holtmann 
354d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
355e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
356769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
357e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
358769be974SMarcel Holtmann 
359d5859e22SJohan Hedberg #define LMP_LSTO	0x01
360d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
361971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
362d5859e22SJohan Hedberg 
363eead27daSAndre Guedes /* Extended LMP features */
36453b834d2SMarcel Holtmann #define LMP_CSB_MASTER	0x01
36553b834d2SMarcel Holtmann #define LMP_CSB_SLAVE	0x02
36653b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN	0x04
36753b834d2SMarcel Holtmann #define LMP_SYNC_SCAN	0x08
36853b834d2SMarcel Holtmann 
369d5991585SMarcel Holtmann #define LMP_SC		0x01
370d5991585SMarcel Holtmann #define LMP_PING	0x02
371d5991585SMarcel Holtmann 
37253b834d2SMarcel Holtmann /* Host features */
373cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
374eead27daSAndre Guedes #define LMP_HOST_LE		0x02
375cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
376d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
377eead27daSAndre Guedes 
378662bc2e6SAndre Guedes /* LE features */
3790da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
380662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
3810fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES		0x08
382cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
38394a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
3844b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
385662bc2e6SAndre Guedes 
38604837f64SMarcel Holtmann /* Connection modes */
38704837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
38804837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
38904837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
39004837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
39104837f64SMarcel Holtmann 
3921da177e4SLinus Torvalds /* Link policies */
3931da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
3941da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
3951da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
3961da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
3971da177e4SLinus Torvalds 
39804837f64SMarcel Holtmann /* Link modes */
3991da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
4001da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
4011da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
4021da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
4031da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
4041da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
4051da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
4067b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
4071da177e4SLinus Torvalds 
40840be492fSMarcel Holtmann /* Authentication types */
40940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
41040be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
41140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
41240be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
41340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
41440be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
41540be492fSMarcel Holtmann 
416a77b15a6SMikel Astiz /* I/O capabilities */
417a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
418a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
419a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
420a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
421a77b15a6SMikel Astiz 
422b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
423b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
424b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
425b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
426b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
42711015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
42811015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
429b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
43011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
43111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
432b6020ba0SWaldemar Rymarkiewicz 
4339f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
4348e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
4359f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
4362acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
437cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
438d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
4399f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
4409f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
441cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
442cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
4439f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
4449f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
4458e75b46aSAndre Guedes #define HCI_ERROR_INVALID_LL_PARAMS	0x1E
4463c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
4479f5a0d7bSAndrei Emeltchenko 
4482455a3eaSAndrei Emeltchenko /* Flow control modes */
4492455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
4502455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
4512455a3eaSAndrei Emeltchenko 
452bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
453bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
454a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
455bbaf444aSJohan Hedberg 
456ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
457ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
458ba165a90SJohan Hedberg 
45932748db0SJohan Hedberg /* Extended Inquiry Response field types */
46032748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
46132748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
46232748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
46332748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
46432748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
46532748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
46632748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
46732748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
46832748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
46932748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
4709ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
471d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
472d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
47332748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
4744453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
4751471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
4761471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
477d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
478d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
479f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
480f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
48132748db0SJohan Hedberg 
4823f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
4833f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
4843f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
4853f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
4863f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
4873f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
4883f0f524bSJohan Hedberg 
4891da177e4SLinus Torvalds /* -----  HCI Commands ---- */
4906bd32326SVille Tervo #define HCI_OP_NOP			0x0000
4916bd32326SVille Tervo 
492a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
493a9de9248SMarcel Holtmann struct hci_cp_inquiry {
494a9de9248SMarcel Holtmann 	__u8     lap[3];
495a9de9248SMarcel Holtmann 	__u8     length;
496a9de9248SMarcel Holtmann 	__u8     num_rsp;
49766c853ccSGustavo F. Padovan } __packed;
4981da177e4SLinus Torvalds 
499a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
500a9de9248SMarcel Holtmann 
50179d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
50279d6e068SAndre Guedes 
503a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
504a9de9248SMarcel Holtmann 
505a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
506a9de9248SMarcel Holtmann struct hci_cp_create_conn {
507a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
508a9de9248SMarcel Holtmann 	__le16   pkt_type;
509a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
510a9de9248SMarcel Holtmann 	__u8     pscan_mode;
511a9de9248SMarcel Holtmann 	__le16   clock_offset;
512a9de9248SMarcel Holtmann 	__u8     role_switch;
51366c853ccSGustavo F. Padovan } __packed;
5141da177e4SLinus Torvalds 
515a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
516a9de9248SMarcel Holtmann struct hci_cp_disconnect {
517a9de9248SMarcel Holtmann 	__le16   handle;
518a9de9248SMarcel Holtmann 	__u8     reason;
51966c853ccSGustavo F. Padovan } __packed;
5201da177e4SLinus Torvalds 
521a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
522a9de9248SMarcel Holtmann struct hci_cp_add_sco {
523a9de9248SMarcel Holtmann 	__le16   handle;
524a9de9248SMarcel Holtmann 	__le16   pkt_type;
52566c853ccSGustavo F. Padovan } __packed;
526a9de9248SMarcel Holtmann 
527a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
528a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
5291da177e4SLinus Torvalds 	bdaddr_t bdaddr;
53066c853ccSGustavo F. Padovan } __packed;
5311da177e4SLinus Torvalds 
532a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
533a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
534a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
535a9de9248SMarcel Holtmann 	__u8     role;
53666c853ccSGustavo F. Padovan } __packed;
5371da177e4SLinus Torvalds 
538a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
539a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
540a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
541a9de9248SMarcel Holtmann 	__u8     reason;
54266c853ccSGustavo F. Padovan } __packed;
5431da177e4SLinus Torvalds 
544a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
545a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
546a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
5479b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
54866c853ccSGustavo F. Padovan } __packed;
5491da177e4SLinus Torvalds 
550a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
551a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
552a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
55366c853ccSGustavo F. Padovan } __packed;
5541da177e4SLinus Torvalds 
555a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
556a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
557a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
558a9de9248SMarcel Holtmann 	__u8     pin_len;
559a9de9248SMarcel Holtmann 	__u8     pin_code[16];
56066c853ccSGustavo F. Padovan } __packed;
561980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
562980e1a53SJohan Hedberg 	__u8     status;
563980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
564980e1a53SJohan Hedberg } __packed;
565a9de9248SMarcel Holtmann 
566a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
567a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
568a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
56966c853ccSGustavo F. Padovan } __packed;
570980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
571980e1a53SJohan Hedberg 	__u8     status;
572980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
573980e1a53SJohan Hedberg } __packed;
574a9de9248SMarcel Holtmann 
575a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
576a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
577a9de9248SMarcel Holtmann 	__le16   handle;
578a9de9248SMarcel Holtmann 	__le16   pkt_type;
57966c853ccSGustavo F. Padovan } __packed;
580a9de9248SMarcel Holtmann 
581a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
582a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
583a9de9248SMarcel Holtmann 	__le16   handle;
58466c853ccSGustavo F. Padovan } __packed;
585a9de9248SMarcel Holtmann 
586a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
587a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
588a9de9248SMarcel Holtmann 	__le16   handle;
589a9de9248SMarcel Holtmann 	__u8     encrypt;
59066c853ccSGustavo F. Padovan } __packed;
591a9de9248SMarcel Holtmann 
592a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
593a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
594a9de9248SMarcel Holtmann 	__le16   handle;
59566c853ccSGustavo F. Padovan } __packed;
596a9de9248SMarcel Holtmann 
597a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
598a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
599a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
600a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
601a9de9248SMarcel Holtmann 	__u8     pscan_mode;
602a9de9248SMarcel Holtmann 	__le16   clock_offset;
60366c853ccSGustavo F. Padovan } __packed;
604a9de9248SMarcel Holtmann 
605a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
606a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
607a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
60866c853ccSGustavo F. Padovan } __packed;
609a9de9248SMarcel Holtmann 
610a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
611a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
612a9de9248SMarcel Holtmann 	__le16   handle;
61366c853ccSGustavo F. Padovan } __packed;
614a9de9248SMarcel Holtmann 
615a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
616a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
617a9de9248SMarcel Holtmann 	__le16   handle;
618a9de9248SMarcel Holtmann 	__u8     page;
61966c853ccSGustavo F. Padovan } __packed;
620a9de9248SMarcel Holtmann 
621a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
622a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
623a9de9248SMarcel Holtmann 	__le16   handle;
62466c853ccSGustavo F. Padovan } __packed;
625a9de9248SMarcel Holtmann 
626df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
627df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
628df935429SMarcel Holtmann 	__le16   handle;
629df935429SMarcel Holtmann } __packed;
630df935429SMarcel Holtmann 
631a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
632a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
633a9de9248SMarcel Holtmann 	__le16   handle;
634a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
635a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
636a9de9248SMarcel Holtmann 	__le16   max_latency;
637a9de9248SMarcel Holtmann 	__le16   voice_setting;
638a9de9248SMarcel Holtmann 	__u8     retrans_effort;
639a9de9248SMarcel Holtmann 	__le16   pkt_type;
64066c853ccSGustavo F. Padovan } __packed;
641a9de9248SMarcel Holtmann 
642a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
643a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
644a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
645a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
646a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
647a9de9248SMarcel Holtmann 	__le16   max_latency;
648a9de9248SMarcel Holtmann 	__le16   content_format;
649a9de9248SMarcel Holtmann 	__u8     retrans_effort;
650a9de9248SMarcel Holtmann 	__le16   pkt_type;
65166c853ccSGustavo F. Padovan } __packed;
652a9de9248SMarcel Holtmann 
653a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
654a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
655a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
656a9de9248SMarcel Holtmann 	__u8     reason;
65766c853ccSGustavo F. Padovan } __packed;
658a9de9248SMarcel Holtmann 
65917fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
66017fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
66117fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
66217fa4b9dSJohan Hedberg 	__u8     capability;
66317fa4b9dSJohan Hedberg 	__u8     oob_data;
66417fa4b9dSJohan Hedberg 	__u8     authentication;
66517fa4b9dSJohan Hedberg } __packed;
66617fa4b9dSJohan Hedberg 
667a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
668a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
669a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
670a5c29683SJohan Hedberg } __packed;
671a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
672a5c29683SJohan Hedberg 	__u8     status;
673a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
674a5c29683SJohan Hedberg } __packed;
675a5c29683SJohan Hedberg 
676a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
677a5c29683SJohan Hedberg 
6789ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
6799ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
6809ad4019aSBrian Gix 	bdaddr_t bdaddr;
6819ad4019aSBrian Gix 	__le32	passkey;
6829ad4019aSBrian Gix } __packed;
6839ad4019aSBrian Gix 
6849ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
6859ad4019aSBrian Gix 
6862763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
6872763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
6882763eda6SSzymon Janc 	bdaddr_t bdaddr;
6892763eda6SSzymon Janc 	__u8     hash[16];
69038da1703SJohan Hedberg 	__u8     rand[16];
6912763eda6SSzymon Janc } __packed;
6922763eda6SSzymon Janc 
6932763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
6942763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
6952763eda6SSzymon Janc 	bdaddr_t bdaddr;
6962763eda6SSzymon Janc } __packed;
6972763eda6SSzymon Janc 
69803b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
69903b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
70003b555e1SJohan Hedberg 	bdaddr_t bdaddr;
70103b555e1SJohan Hedberg 	__u8     reason;
70203b555e1SJohan Hedberg } __packed;
70303b555e1SJohan Hedberg 
704523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
705523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
706523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
707523e93cdSAndrei Emeltchenko 	__u8     key_len;
708523e93cdSAndrei Emeltchenko 	__u8     key_type;
709523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
710523e93cdSAndrei Emeltchenko } __packed;
711523e93cdSAndrei Emeltchenko 
712523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
713523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
714523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
715523e93cdSAndrei Emeltchenko 	__u8     key_len;
716523e93cdSAndrei Emeltchenko 	__u8     key_type;
717523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
718523e93cdSAndrei Emeltchenko } __packed;
719523e93cdSAndrei Emeltchenko 
720523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
721523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
722523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
723523e93cdSAndrei Emeltchenko 	__u8     reason;
724b078b564SAndrei Emeltchenko } __packed;
725b078b564SAndrei Emeltchenko 
726b078b564SAndrei Emeltchenko struct ext_flow_spec {
727b078b564SAndrei Emeltchenko 	__u8       id;
728b078b564SAndrei Emeltchenko 	__u8       stype;
729b078b564SAndrei Emeltchenko 	__le16     msdu;
730b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
731b078b564SAndrei Emeltchenko 	__le32     acc_lat;
732b078b564SAndrei Emeltchenko 	__le32     flush_to;
733b078b564SAndrei Emeltchenko } __packed;
734b078b564SAndrei Emeltchenko 
735b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
736b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
737b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
738b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
739b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
740b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
741b078b564SAndrei Emeltchenko } __packed;
742b078b564SAndrei Emeltchenko 
743b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
744b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
745b078b564SAndrei Emeltchenko 	__le16   log_handle;
746b078b564SAndrei Emeltchenko } __packed;
747b078b564SAndrei Emeltchenko 
748b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
749b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
750b078b564SAndrei Emeltchenko 	__u8     phy_handle;
751b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
752b078b564SAndrei Emeltchenko } __packed;
753b078b564SAndrei Emeltchenko 
754b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
755b078b564SAndrei Emeltchenko 	__u8     status;
756b078b564SAndrei Emeltchenko 	__u8     phy_handle;
757b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
758523e93cdSAndrei Emeltchenko } __packed;
759523e93cdSAndrei Emeltchenko 
7608c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB			0x0441
7618c9a041bSDoHyun Pyun struct hci_cp_set_csb {
7628c9a041bSDoHyun Pyun 	__u8	enable;
7638c9a041bSDoHyun Pyun 	__u8	lt_addr;
7648c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
7658c9a041bSDoHyun Pyun 	__le16	packet_type;
7668c9a041bSDoHyun Pyun 	__le16	interval_min;
7678c9a041bSDoHyun Pyun 	__le16	interval_max;
7688c9a041bSDoHyun Pyun 	__le16	csb_sv_tout;
7698c9a041bSDoHyun Pyun } __packed;
7708c9a041bSDoHyun Pyun struct hci_rp_set_csb {
7718c9a041bSDoHyun Pyun 	__u8	status;
7728c9a041bSDoHyun Pyun 	__u8	lt_addr;
7738c9a041bSDoHyun Pyun 	__le16	interval;
7748c9a041bSDoHyun Pyun } __packed;
7758c9a041bSDoHyun Pyun 
776cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
777cefded98SDoHyun Pyun 
778e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
779e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
780e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
781e2f99131SMarcel Holtmann 	__u8     hash192[16];
78238da1703SJohan Hedberg 	__u8     rand192[16];
783e2f99131SMarcel Holtmann 	__u8     hash256[16];
78438da1703SJohan Hedberg 	__u8     rand256[16];
785e2f99131SMarcel Holtmann } __packed;
786e2f99131SMarcel Holtmann 
787a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
788a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
789a9de9248SMarcel Holtmann 	__le16   handle;
790a9de9248SMarcel Holtmann 	__le16   max_interval;
791a9de9248SMarcel Holtmann 	__le16   min_interval;
792a9de9248SMarcel Holtmann 	__le16   attempt;
793a9de9248SMarcel Holtmann 	__le16   timeout;
79466c853ccSGustavo F. Padovan } __packed;
795a9de9248SMarcel Holtmann 
796a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
797a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
798a9de9248SMarcel Holtmann 	__le16   handle;
79966c853ccSGustavo F. Padovan } __packed;
800a9de9248SMarcel Holtmann 
801a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
802a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
803a9de9248SMarcel Holtmann 	__le16   handle;
80466c853ccSGustavo F. Padovan } __packed;
805a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
806a9de9248SMarcel Holtmann 	__u8     status;
807a9de9248SMarcel Holtmann 	__le16   handle;
808a9de9248SMarcel Holtmann 	__u8     role;
80966c853ccSGustavo F. Padovan } __packed;
810a9de9248SMarcel Holtmann 
811a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
812a9de9248SMarcel Holtmann struct hci_cp_switch_role {
813a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
814a9de9248SMarcel Holtmann 	__u8     role;
81566c853ccSGustavo F. Padovan } __packed;
816a9de9248SMarcel Holtmann 
817a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
818a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
819a9de9248SMarcel Holtmann 	__le16   handle;
82066c853ccSGustavo F. Padovan } __packed;
821a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
822a9de9248SMarcel Holtmann 	__u8     status;
823a9de9248SMarcel Holtmann 	__le16   handle;
824a9de9248SMarcel Holtmann 	__le16   policy;
82566c853ccSGustavo F. Padovan } __packed;
826a9de9248SMarcel Holtmann 
827a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
828a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
829a9de9248SMarcel Holtmann 	__le16   handle;
830a9de9248SMarcel Holtmann 	__le16   policy;
83166c853ccSGustavo F. Padovan } __packed;
832a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
833a9de9248SMarcel Holtmann 	__u8     status;
834a9de9248SMarcel Holtmann 	__le16   handle;
83566c853ccSGustavo F. Padovan } __packed;
836a9de9248SMarcel Holtmann 
837e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
838e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
839e4e8e37cSMarcel Holtmann 	__u8     status;
840e4e8e37cSMarcel Holtmann 	__le16   policy;
84166c853ccSGustavo F. Padovan } __packed;
842e4e8e37cSMarcel Holtmann 
843e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
844e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
845e4e8e37cSMarcel Holtmann 	__le16   policy;
84666c853ccSGustavo F. Padovan } __packed;
847e4e8e37cSMarcel Holtmann 
848a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
849a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
850a9de9248SMarcel Holtmann 	__le16   handle;
851a9de9248SMarcel Holtmann 	__le16   max_latency;
852a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
853a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
85466c853ccSGustavo F. Padovan } __packed;
855a9de9248SMarcel Holtmann 
856a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
857a9de9248SMarcel Holtmann 
858a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
859a9de9248SMarcel Holtmann 
860a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
8611da177e4SLinus Torvalds struct hci_cp_set_event_flt {
8621da177e4SLinus Torvalds 	__u8     flt_type;
8631da177e4SLinus Torvalds 	__u8     cond_type;
8641da177e4SLinus Torvalds 	__u8     condition[0];
86566c853ccSGustavo F. Padovan } __packed;
8661da177e4SLinus Torvalds 
8671da177e4SLinus Torvalds /* Filter types */
8681da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
8691da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
8701da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
8711da177e4SLinus Torvalds 
8721da177e4SLinus Torvalds /* CONN_SETUP Condition types */
8731da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
8741da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
8751da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
8761da177e4SLinus Torvalds 
8771da177e4SLinus Torvalds /* CONN_SETUP Conditions */
8781da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
8791da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
8801da177e4SLinus Torvalds 
881cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
882cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
883cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
884cb962780SMarcel Holtmann 	__u8     read_all;
885cb962780SMarcel Holtmann } __packed;
886cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
887cb962780SMarcel Holtmann 	__u8     status;
888cb962780SMarcel Holtmann 	__u8     max_keys;
889cb962780SMarcel Holtmann 	__u8     num_keys;
890cb962780SMarcel Holtmann } __packed;
891cb962780SMarcel Holtmann 
892b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
893b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
894b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
895b0916ea0SJohan Hedberg 	__u8     delete_all;
896b0916ea0SJohan Hedberg } __packed;
897039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
898039d4e41SMarcel Holtmann 	__u8     status;
899039d4e41SMarcel Holtmann 	__u8     num_keys;
900039d4e41SMarcel Holtmann } __packed;
901b0916ea0SJohan Hedberg 
9021f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
9031f6c6378SJohan Hedberg 
904a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
905a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
9061f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
90766c853ccSGustavo F. Padovan } __packed;
908a9de9248SMarcel Holtmann 
909a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
910a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
911a9de9248SMarcel Holtmann 	__u8     status;
9121f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
91366c853ccSGustavo F. Padovan } __packed;
914a9de9248SMarcel Holtmann 
915a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
916a9de9248SMarcel Holtmann 
917a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
918a9de9248SMarcel Holtmann 
919a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
920a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
921a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
922a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
923a9de9248SMarcel Holtmann 
924a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
925a9de9248SMarcel Holtmann 
926a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
927a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
928a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
929a9de9248SMarcel Holtmann 
930a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
931a9de9248SMarcel Holtmann 
932a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
933a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
934a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
935a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
936a9de9248SMarcel Holtmann 
937a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
938a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
9391da177e4SLinus Torvalds 	__u8     status;
9401da177e4SLinus Torvalds 	__u8     dev_class[3];
94166c853ccSGustavo F. Padovan } __packed;
9421da177e4SLinus Torvalds 
943a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
944a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
9451da177e4SLinus Torvalds 	__u8     dev_class[3];
94666c853ccSGustavo F. Padovan } __packed;
9471da177e4SLinus Torvalds 
948a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
9491da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
9501da177e4SLinus Torvalds 	__u8     status;
9511ebb9252SMarcel Holtmann 	__le16   voice_setting;
95266c853ccSGustavo F. Padovan } __packed;
9531da177e4SLinus Torvalds 
954a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
9551da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
9561ebb9252SMarcel Holtmann 	__le16   voice_setting;
95766c853ccSGustavo F. Padovan } __packed;
9581da177e4SLinus Torvalds 
959a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
9601da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
9611ebb9252SMarcel Holtmann 	__le16   acl_mtu;
9621da177e4SLinus Torvalds 	__u8     sco_mtu;
9631ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
9641ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
96566c853ccSGustavo F. Padovan } __packed;
9661da177e4SLinus Torvalds 
967b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
968b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
969b4cb9fb2SMarcel Holtmann 	__u8	status;
970b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
971b4cb9fb2SMarcel Holtmann } __packed;
972b4cb9fb2SMarcel Holtmann 
9734b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
9744b836f39SMarcel Holtmann 
9753d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
9763d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
9773d505312SMarcel Holtmann 	__u8	num_iac;
9783d505312SMarcel Holtmann 	__u8	iac_lap[6];
9793d505312SMarcel Holtmann } __packed;
9803d505312SMarcel Holtmann 
981d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
982d5859e22SJohan Hedberg 
98380a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
98480a1e1dbSJohan Hedberg 
98580a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
98680a1e1dbSJohan Hedberg struct hci_cp_write_eir {
987816a11d5SJohan Hedberg 	__u8	fec;
988816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
98980a1e1dbSJohan Hedberg } __packed;
99080a1e1dbSJohan Hedberg 
991333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
992333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
993333140b5SMarcel Holtmann 	__u8     status;
994333140b5SMarcel Holtmann 	__u8     mode;
99566c853ccSGustavo F. Padovan } __packed;
996333140b5SMarcel Holtmann 
997333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
998333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
999333140b5SMarcel Holtmann 	__u8     mode;
100066c853ccSGustavo F. Padovan } __packed;
1001333140b5SMarcel Holtmann 
1002c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1003c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1004c35938b2SSzymon Janc 	__u8     status;
1005c35938b2SSzymon Janc 	__u8     hash[16];
100638da1703SJohan Hedberg 	__u8     rand[16];
1007c35938b2SSzymon Janc } __packed;
1008c35938b2SSzymon Janc 
1009d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
101091c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
101191c4e9b1SMarcel Holtmann 	__u8     status;
101291c4e9b1SMarcel Holtmann 	__s8     tx_power;
101391c4e9b1SMarcel Holtmann } __packed;
1014d5859e22SJohan Hedberg 
1015d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1016d62e6d67SJohan Hedberg 
10177528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
10187528ca1cSMarcel Holtmann 
10191e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
10201e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
10211e89cffbSAndrei Emeltchenko 	__u8     status;
10221e89cffbSAndrei Emeltchenko 	__u8     mode;
10231e89cffbSAndrei Emeltchenko } __packed;
10241e89cffbSAndrei Emeltchenko 
1025f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1026f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1027f9b49306SAndre Guedes 	__u8	le;
1028f9b49306SAndre Guedes 	__u8	simul;
1029f9b49306SAndre Guedes } __packed;
1030f9b49306SAndre Guedes 
1031d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1032d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1033d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1034d0bf75a5SDoHyun Pyun } __packed;
1035d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1036d0bf75a5SDoHyun Pyun 	__u8	status;
1037d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1038d0bf75a5SDoHyun Pyun } __packed;
1039d0bf75a5SDoHyun Pyun 
10406a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
10416a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
10426a20eaf4SDoHyun Pyun 	__u8	lt_addr;
10436a20eaf4SDoHyun Pyun } __packed;
10446a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
10456a20eaf4SDoHyun Pyun 	__u8	status;
10466a20eaf4SDoHyun Pyun 	__u8	lt_addr;
10476a20eaf4SDoHyun Pyun } __packed;
10486a20eaf4SDoHyun Pyun 
10497d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
10507d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
10517d1dab49SDoHyun Pyun 	__u8	lt_addr;
10527d1dab49SDoHyun Pyun 	__u8	fragment;
10537d1dab49SDoHyun Pyun 	__u8	data_length;
10547d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
10557d1dab49SDoHyun Pyun } __packed;
10567d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
10577d1dab49SDoHyun Pyun 	__u8	status;
10587d1dab49SDoHyun Pyun 	__u8	lt_addr;
10597d1dab49SDoHyun Pyun } __packed;
10607d1dab49SDoHyun Pyun 
10615d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
10625d4e7e8dSJohan Hedberg 
1063a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1064a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1065a9b07a64SDoHyun Pyun 	__le16	interval_min;
1066a9b07a64SDoHyun Pyun 	__le16	interval_max;
1067a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1068a9b07a64SDoHyun Pyun 	__u8	service_data;
1069a9b07a64SDoHyun Pyun } __packed;
1070a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1071a9b07a64SDoHyun Pyun 	__u8	status;
1072a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1073a9b07a64SDoHyun Pyun } __packed;
1074a9b07a64SDoHyun Pyun 
1075eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1076eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1077eb4b95c6SMarcel Holtmann 	__u8	status;
1078eb4b95c6SMarcel Holtmann 	__u8	support;
1079eb4b95c6SMarcel Holtmann } __packed;
1080eb4b95c6SMarcel Holtmann 
1081eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1082eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1083eb4b95c6SMarcel Holtmann 	__u8	support;
1084eb4b95c6SMarcel Holtmann } __packed;
1085eb4b95c6SMarcel Holtmann 
1086e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1087e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1088e2f99131SMarcel Holtmann 	__u8     status;
1089e2f99131SMarcel Holtmann 	__u8     hash192[16];
109038da1703SJohan Hedberg 	__u8     rand192[16];
1091e2f99131SMarcel Holtmann 	__u8     hash256[16];
109238da1703SJohan Hedberg 	__u8     rand256[16];
1093e2f99131SMarcel Holtmann } __packed;
1094e2f99131SMarcel Holtmann 
1095a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1096a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
10971da177e4SLinus Torvalds 	__u8     status;
1098a9de9248SMarcel Holtmann 	__u8     hci_ver;
1099a9de9248SMarcel Holtmann 	__le16   hci_rev;
1100a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1101a9de9248SMarcel Holtmann 	__le16   manufacturer;
1102a9de9248SMarcel Holtmann 	__le16   lmp_subver;
110366c853ccSGustavo F. Padovan } __packed;
11041da177e4SLinus Torvalds 
1105a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1106a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
11071da177e4SLinus Torvalds 	__u8     status;
1108a9de9248SMarcel Holtmann 	__u8     commands[64];
110966c853ccSGustavo F. Padovan } __packed;
11101da177e4SLinus Torvalds 
1111a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1112a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1113a9de9248SMarcel Holtmann 	__u8     status;
1114a9de9248SMarcel Holtmann 	__u8     features[8];
111566c853ccSGustavo F. Padovan } __packed;
1116a9de9248SMarcel Holtmann 
1117a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1118971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1119971e3a4bSAndre Guedes 	__u8     page;
1120971e3a4bSAndre Guedes } __packed;
1121a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1122a9de9248SMarcel Holtmann 	__u8     status;
1123a9de9248SMarcel Holtmann 	__u8     page;
1124a9de9248SMarcel Holtmann 	__u8     max_page;
1125a9de9248SMarcel Holtmann 	__u8     features[8];
112666c853ccSGustavo F. Padovan } __packed;
1127a9de9248SMarcel Holtmann 
1128a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1129a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1130a9de9248SMarcel Holtmann 	__u8     status;
1131a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1132a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1133a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1134a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
113566c853ccSGustavo F. Padovan } __packed;
1136a9de9248SMarcel Holtmann 
1137a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1138a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1139a9de9248SMarcel Holtmann 	__u8     status;
11401da177e4SLinus Torvalds 	bdaddr_t bdaddr;
114166c853ccSGustavo F. Padovan } __packed;
11421da177e4SLinus Torvalds 
1143350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1144350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1145350ee4cfSAndrei Emeltchenko 	__u8     status;
1146350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1147350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1148350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1149350ee4cfSAndrei Emeltchenko } __packed;
1150350ee4cfSAndrei Emeltchenko 
1151109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
1152109e3191SMarcel Holtmann 
1153f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1154f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1155f332ec66SJohan Hedberg 	__u8     status;
1156f332ec66SJohan Hedberg 	__le16   interval;
1157f332ec66SJohan Hedberg 	__le16   window;
1158f332ec66SJohan Hedberg } __packed;
1159f332ec66SJohan Hedberg 
1160f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1161f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1162f6422ec6SAntti Julku 	__le16   interval;
1163f6422ec6SAntti Julku 	__le16   window;
1164f6422ec6SAntti Julku } __packed;
1165f6422ec6SAntti Julku 
11665a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
11675a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
11685a134faeSAndrzej Kaczmarek 	__le16   handle;
11695a134faeSAndrzej Kaczmarek 	__u8     type;
11705a134faeSAndrzej Kaczmarek } __packed;
11715a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
11725a134faeSAndrzej Kaczmarek 	__u8     status;
11735a134faeSAndrzej Kaczmarek 	__le16   handle;
11745a134faeSAndrzej Kaczmarek 	__s8     tx_power;
11755a134faeSAndrzej Kaczmarek } __packed;
11765a134faeSAndrzej Kaczmarek 
1177f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1178f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1179f332ec66SJohan Hedberg 	__u8     status;
1180f332ec66SJohan Hedberg 	__u8     type;
1181f332ec66SJohan Hedberg } __packed;
1182f332ec66SJohan Hedberg 
1183f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1184f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1185f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1186f6422ec6SAntti Julku 
11875ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
11885ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
11895ae76a94SAndrzej Kaczmarek 	__le16   handle;
11905ae76a94SAndrzej Kaczmarek } __packed;
11915ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
11925ae76a94SAndrzej Kaczmarek 	__u8     status;
11935ae76a94SAndrzej Kaczmarek 	__le16   handle;
11945ae76a94SAndrzej Kaczmarek 	__s8     rssi;
11955ae76a94SAndrzej Kaczmarek } __packed;
11965ae76a94SAndrzej Kaczmarek 
119733f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
119833f35721SJohan Hedberg struct hci_cp_read_clock {
119933f35721SJohan Hedberg 	__le16   handle;
120033f35721SJohan Hedberg 	__u8     which;
120133f35721SJohan Hedberg } __packed;
120233f35721SJohan Hedberg struct hci_rp_read_clock {
120333f35721SJohan Hedberg 	__u8     status;
120433f35721SJohan Hedberg 	__le16   handle;
120533f35721SJohan Hedberg 	__le32   clock;
120633f35721SJohan Hedberg 	__le16   accuracy;
120733f35721SJohan Hedberg } __packed;
120833f35721SJohan Hedberg 
1209821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1210821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1211821f3766SJohan Hedberg 	__le16   handle;
1212821f3766SJohan Hedberg } __packed;
1213821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1214821f3766SJohan Hedberg 	__u8     status;
1215821f3766SJohan Hedberg 	__le16   handle;
1216821f3766SJohan Hedberg 	__u8     key_size;
1217821f3766SJohan Hedberg } __packed;
1218821f3766SJohan Hedberg 
1219928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1220928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1221928abaa7SAndrei Emeltchenko 	__u8     status;
1222928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1223928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1224928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1225928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1226928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1227928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1228928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1229928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1230928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1231928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1232928abaa7SAndrei Emeltchenko } __packed;
1233928abaa7SAndrei Emeltchenko 
1234523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1235523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1236523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1237523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1238523e93cdSAndrei Emeltchenko 	__le16   max_len;
1239523e93cdSAndrei Emeltchenko } __packed;
1240523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1241523e93cdSAndrei Emeltchenko 	__u8     status;
1242523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1243523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1244523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1245523e93cdSAndrei Emeltchenko } __packed;
1246523e93cdSAndrei Emeltchenko 
1247523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1248523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1249523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1250523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1251523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1252523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1253523e93cdSAndrei Emeltchenko } __packed;
1254523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1255523e93cdSAndrei Emeltchenko 	__u8     status;
1256523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1257523e93cdSAndrei Emeltchenko } __packed;
1258523e93cdSAndrei Emeltchenko 
1259f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1260f4fe73edSMarcel Holtmann 
12614b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
12624b4148e9SMarcel Holtmann 
126306f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
126406f5b778SMarcel Holtmann 
126563185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
126663185f64SVille Tervo struct hci_cp_le_set_event_mask {
126763185f64SVille Tervo 	__u8     mask[8];
126863185f64SVille Tervo } __packed;
126963185f64SVille Tervo 
127063185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
127163185f64SVille Tervo struct hci_rp_le_read_buffer_size {
127263185f64SVille Tervo 	__u8     status;
127363185f64SVille Tervo 	__le16   le_mtu;
127463185f64SVille Tervo 	__u8     le_max_pkt;
127563185f64SVille Tervo } __packed;
127663185f64SVille Tervo 
127760e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
127860e77321SJohan Hedberg struct hci_rp_le_read_local_features {
127960e77321SJohan Hedberg 	__u8     status;
128060e77321SJohan Hedberg 	__u8     features[8];
128160e77321SJohan Hedberg } __packed;
128260e77321SJohan Hedberg 
1283d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1284d13eafceSMarcel Holtmann 
12851e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
12861e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
12871e191893SMarcel Holtmann 	__le16   min_interval;
12881e191893SMarcel Holtmann 	__le16   max_interval;
12891e191893SMarcel Holtmann 	__u8     type;
12901e191893SMarcel Holtmann 	__u8     own_address_type;
12911e191893SMarcel Holtmann 	__u8     direct_addr_type;
12921e191893SMarcel Holtmann 	bdaddr_t direct_addr;
12931e191893SMarcel Holtmann 	__u8     channel_map;
12941e191893SMarcel Holtmann 	__u8     filter_policy;
12951e191893SMarcel Holtmann } __packed;
12961e191893SMarcel Holtmann 
12978fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
12988fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
12998fa19098SJohan Hedberg 	__u8	status;
13008fa19098SJohan Hedberg 	__s8	tx_power;
13018fa19098SJohan Hedberg } __packed;
13028fa19098SJohan Hedberg 
13033f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
13043f0f524bSJohan Hedberg 
13053f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
13063f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
13073f0f524bSJohan Hedberg 	__u8	length;
13083f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
13093f0f524bSJohan Hedberg } __packed;
13103f0f524bSJohan Hedberg 
1311f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1312f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1313f14d8f64SMarcel Holtmann 	__u8	length;
1314f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1315f14d8f64SMarcel Holtmann } __packed;
1316f14d8f64SMarcel Holtmann 
1317c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1318c1d5dc4aSJohan Hedberg 
13195df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
13205df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
13215df480b5SAndre Guedes 
132207f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
132307f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
132407f7fa5dSAndre Guedes 	__u8    type;
132507f7fa5dSAndre Guedes 	__le16  interval;
132607f7fa5dSAndre Guedes 	__le16  window;
132707f7fa5dSAndre Guedes 	__u8    own_address_type;
132807f7fa5dSAndre Guedes 	__u8    filter_policy;
132907f7fa5dSAndre Guedes } __packed;
133007f7fa5dSAndre Guedes 
133176a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
133276a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1333525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1334525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
133568a8aea4SAndrei Emeltchenko 
1336eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1337eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1338eb9d91f5SAndre Guedes 	__u8     enable;
1339eb9d91f5SAndre Guedes 	__u8     filter_dup;
1340eb9d91f5SAndre Guedes } __packed;
1341eb9d91f5SAndre Guedes 
1342a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
1343a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST		0x01
1344a7139eddSJohan Hedberg 
134563185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
134663185f64SVille Tervo struct hci_cp_le_create_conn {
134763185f64SVille Tervo 	__le16   scan_interval;
134863185f64SVille Tervo 	__le16   scan_window;
134963185f64SVille Tervo 	__u8     filter_policy;
135063185f64SVille Tervo 	__u8     peer_addr_type;
135163185f64SVille Tervo 	bdaddr_t peer_addr;
135263185f64SVille Tervo 	__u8     own_address_type;
135363185f64SVille Tervo 	__le16   conn_interval_min;
135463185f64SVille Tervo 	__le16   conn_interval_max;
135563185f64SVille Tervo 	__le16   conn_latency;
135663185f64SVille Tervo 	__le16   supervision_timeout;
135763185f64SVille Tervo 	__le16   min_ce_len;
135863185f64SVille Tervo 	__le16   max_ce_len;
135963185f64SVille Tervo } __packed;
136063185f64SVille Tervo 
136163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
136263185f64SVille Tervo 
1363cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1364cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1365cf1d081fSJohan Hedberg 	__u8	status;
1366cf1d081fSJohan Hedberg 	__u8	size;
1367cf1d081fSJohan Hedberg } __packed;
1368cf1d081fSJohan Hedberg 
1369d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST	0x2010
1370d9a7b0a5SMarcel Holtmann 
1371d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST	0x2011
1372d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list {
1373d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1374d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1375d9a7b0a5SMarcel Holtmann } __packed;
1376d9a7b0a5SMarcel Holtmann 
1377d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST	0x2012
1378d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list {
1379d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1380d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1381d9a7b0a5SMarcel Holtmann } __packed;
1382d9a7b0a5SMarcel Holtmann 
13832ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
13842ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
13852ce603ebSClaudio Takahasi 	__le16   handle;
13862ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
13872ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
13882ce603ebSClaudio Takahasi 	__le16   conn_latency;
13892ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
13902ce603ebSClaudio Takahasi 	__le16   min_ce_len;
13912ce603ebSClaudio Takahasi 	__le16   max_ce_len;
13922ce603ebSClaudio Takahasi } __packed;
13932ce603ebSClaudio Takahasi 
13940fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
13950fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
13960fe29fd1SMarcel Holtmann 	__le16	 handle;
13970fe29fd1SMarcel Holtmann } __packed;
13980fe29fd1SMarcel Holtmann 
1399a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1400a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1401a7a595f6SVinicius Costa Gomes 	__le16	handle;
1402fe39c7b2SMarcel Holtmann 	__le64	rand;
1403a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1404a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1405a7a595f6SVinicius Costa Gomes } __packed;
1406a7a595f6SVinicius Costa Gomes 
1407a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1408a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1409a7a595f6SVinicius Costa Gomes 	__le16	handle;
1410a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1411a7a595f6SVinicius Costa Gomes } __packed;
1412a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1413a7a595f6SVinicius Costa Gomes 	__u8	status;
1414a7a595f6SVinicius Costa Gomes 	__le16	handle;
1415a7a595f6SVinicius Costa Gomes } __packed;
1416a7a595f6SVinicius Costa Gomes 
1417a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1418a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1419a7a595f6SVinicius Costa Gomes 	__le16	handle;
1420a7a595f6SVinicius Costa Gomes } __packed;
1421a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1422a7a595f6SVinicius Costa Gomes 	__u8	status;
1423a7a595f6SVinicius Costa Gomes 	__le16	handle;
1424a7a595f6SVinicius Costa Gomes } __packed;
1425a7a595f6SVinicius Costa Gomes 
14269b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
14279b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
14289b008c04SJohan Hedberg 	__u8	status;
14299b008c04SJohan Hedberg 	__u8	le_states[8];
14309b008c04SJohan Hedberg } __packed;
14319b008c04SJohan Hedberg 
14328e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
14338e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
14348e75b46aSAndre Guedes 	__le16	handle;
14358e75b46aSAndre Guedes 	__le16	interval_min;
14368e75b46aSAndre Guedes 	__le16	interval_max;
14378e75b46aSAndre Guedes 	__le16	latency;
14388e75b46aSAndre Guedes 	__le16	timeout;
14398e75b46aSAndre Guedes 	__le16	min_ce_len;
14408e75b46aSAndre Guedes 	__le16	max_ce_len;
14418e75b46aSAndre Guedes } __packed;
14428e75b46aSAndre Guedes 
14438e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
14448e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
14458e75b46aSAndre Guedes 	__le16	handle;
14468e75b46aSAndre Guedes 	__u8	reason;
14478e75b46aSAndre Guedes } __packed;
14488e75b46aSAndre Guedes 
144994a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
145094a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
145194a3bd02SMarcel Holtmann 	__le16	handle;
145294a3bd02SMarcel Holtmann 	__le16	tx_len;
145394a3bd02SMarcel Holtmann 	__le16	tx_time;
145494a3bd02SMarcel Holtmann } __packed;
145594a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
145694a3bd02SMarcel Holtmann 	__u8	status;
145794a3bd02SMarcel Holtmann 	__le16	handle;
145894a3bd02SMarcel Holtmann } __packed;
145994a3bd02SMarcel Holtmann 
146094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
146194a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
146294a3bd02SMarcel Holtmann 	__u8	status;
146394a3bd02SMarcel Holtmann 	__le16	tx_len;
146494a3bd02SMarcel Holtmann 	__le16	tx_time;
146594a3bd02SMarcel Holtmann } __packed;
146694a3bd02SMarcel Holtmann 
146794a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
146894a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
146994a3bd02SMarcel Holtmann 	__le16	tx_len;
147094a3bd02SMarcel Holtmann 	__le16	tx_time;
147194a3bd02SMarcel Holtmann } __packed;
147294a3bd02SMarcel Holtmann 
147394a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
147494a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
147594a3bd02SMarcel Holtmann 	__u8	status;
147694a3bd02SMarcel Holtmann 	__le16	tx_len;
147794a3bd02SMarcel Holtmann 	__le16	tx_time;
147894a3bd02SMarcel Holtmann 	__le16	rx_len;
147994a3bd02SMarcel Holtmann 	__le16	rx_time;
148094a3bd02SMarcel Holtmann } __packed;
148194a3bd02SMarcel Holtmann 
14821da177e4SLinus Torvalds /* ---- HCI Events ---- */
14831da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
14841da177e4SLinus Torvalds 
14851da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
14861da177e4SLinus Torvalds struct inquiry_info {
14871da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14881da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
14891da177e4SLinus Torvalds 	__u8     pscan_period_mode;
14901da177e4SLinus Torvalds 	__u8     pscan_mode;
14911da177e4SLinus Torvalds 	__u8     dev_class[3];
14921ebb9252SMarcel Holtmann 	__le16   clock_offset;
149366c853ccSGustavo F. Padovan } __packed;
14941da177e4SLinus Torvalds 
14951da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
14961da177e4SLinus Torvalds struct hci_ev_conn_complete {
14971da177e4SLinus Torvalds 	__u8     status;
14981ebb9252SMarcel Holtmann 	__le16   handle;
14991da177e4SLinus Torvalds 	bdaddr_t bdaddr;
15001da177e4SLinus Torvalds 	__u8     link_type;
15011da177e4SLinus Torvalds 	__u8     encr_mode;
150266c853ccSGustavo F. Padovan } __packed;
15031da177e4SLinus Torvalds 
15041da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
15051da177e4SLinus Torvalds struct hci_ev_conn_request {
15061da177e4SLinus Torvalds 	bdaddr_t bdaddr;
15071da177e4SLinus Torvalds 	__u8     dev_class[3];
15081da177e4SLinus Torvalds 	__u8     link_type;
150966c853ccSGustavo F. Padovan } __packed;
15101da177e4SLinus Torvalds 
15111da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
15121da177e4SLinus Torvalds struct hci_ev_disconn_complete {
15131da177e4SLinus Torvalds 	__u8     status;
15141ebb9252SMarcel Holtmann 	__le16   handle;
15151da177e4SLinus Torvalds 	__u8     reason;
151666c853ccSGustavo F. Padovan } __packed;
15171da177e4SLinus Torvalds 
15181da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
15191da177e4SLinus Torvalds struct hci_ev_auth_complete {
15201da177e4SLinus Torvalds 	__u8     status;
15211ebb9252SMarcel Holtmann 	__le16   handle;
152266c853ccSGustavo F. Padovan } __packed;
15231da177e4SLinus Torvalds 
1524a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1525a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1526a9de9248SMarcel Holtmann 	__u8     status;
1527a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
15281f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
152966c853ccSGustavo F. Padovan } __packed;
1530a9de9248SMarcel Holtmann 
15311da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
15321da177e4SLinus Torvalds struct hci_ev_encrypt_change {
15331da177e4SLinus Torvalds 	__u8     status;
15341ebb9252SMarcel Holtmann 	__le16   handle;
15351da177e4SLinus Torvalds 	__u8     encrypt;
153666c853ccSGustavo F. Padovan } __packed;
15371da177e4SLinus Torvalds 
1538a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1539a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
15401da177e4SLinus Torvalds 	__u8     status;
15411ebb9252SMarcel Holtmann 	__le16   handle;
154266c853ccSGustavo F. Padovan } __packed;
15431da177e4SLinus Torvalds 
1544a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1545a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1546a9de9248SMarcel Holtmann 	__u8     status;
1547a9de9248SMarcel Holtmann 	__le16   handle;
1548a9de9248SMarcel Holtmann 	__u8     features[8];
154966c853ccSGustavo F. Padovan } __packed;
1550a9de9248SMarcel Holtmann 
1551a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1552a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1553a9de9248SMarcel Holtmann 	__u8     status;
1554a9de9248SMarcel Holtmann 	__le16   handle;
1555a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1556a9de9248SMarcel Holtmann 	__le16   manufacturer;
1557a9de9248SMarcel Holtmann 	__le16   lmp_subver;
155866c853ccSGustavo F. Padovan } __packed;
1559a9de9248SMarcel Holtmann 
1560a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
15611da177e4SLinus Torvalds struct hci_qos {
15621da177e4SLinus Torvalds 	__u8     service_type;
15631da177e4SLinus Torvalds 	__u32    token_rate;
15641da177e4SLinus Torvalds 	__u32    peak_bandwidth;
15651da177e4SLinus Torvalds 	__u32    latency;
15661da177e4SLinus Torvalds 	__u32    delay_variation;
156766c853ccSGustavo F. Padovan } __packed;
15681da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
15691da177e4SLinus Torvalds 	__u8     status;
15701ebb9252SMarcel Holtmann 	__le16   handle;
15711da177e4SLinus Torvalds 	struct   hci_qos qos;
157266c853ccSGustavo F. Padovan } __packed;
15731da177e4SLinus Torvalds 
1574a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
15751da177e4SLinus Torvalds struct hci_ev_cmd_complete {
15761da177e4SLinus Torvalds 	__u8     ncmd;
15771ebb9252SMarcel Holtmann 	__le16   opcode;
157866c853ccSGustavo F. Padovan } __packed;
15791da177e4SLinus Torvalds 
1580a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
15811da177e4SLinus Torvalds struct hci_ev_cmd_status {
15821da177e4SLinus Torvalds 	__u8     status;
15831da177e4SLinus Torvalds 	__u8     ncmd;
15841ebb9252SMarcel Holtmann 	__le16   opcode;
158566c853ccSGustavo F. Padovan } __packed;
15861da177e4SLinus Torvalds 
158724dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
158824dfa343SMarcel Holtmann struct hci_ev_hardware_error {
158924dfa343SMarcel Holtmann 	__u8     code;
159024dfa343SMarcel Holtmann } __packed;
159124dfa343SMarcel Holtmann 
15921da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
15931da177e4SLinus Torvalds struct hci_ev_role_change {
15941da177e4SLinus Torvalds 	__u8     status;
15951da177e4SLinus Torvalds 	bdaddr_t bdaddr;
15961da177e4SLinus Torvalds 	__u8     role;
159766c853ccSGustavo F. Padovan } __packed;
15981da177e4SLinus Torvalds 
1599a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1600613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1601613a1c0cSAndrei Emeltchenko 	__le16   handle;
1602613a1c0cSAndrei Emeltchenko 	__le16   count;
1603613a1c0cSAndrei Emeltchenko } __packed;
1604613a1c0cSAndrei Emeltchenko 
1605a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1606a9de9248SMarcel Holtmann 	__u8     num_hndl;
1607613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
160866c853ccSGustavo F. Padovan } __packed;
1609a9de9248SMarcel Holtmann 
16101da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
16111da177e4SLinus Torvalds struct hci_ev_mode_change {
16121da177e4SLinus Torvalds 	__u8     status;
16131ebb9252SMarcel Holtmann 	__le16   handle;
16141da177e4SLinus Torvalds 	__u8     mode;
16151ebb9252SMarcel Holtmann 	__le16   interval;
161666c853ccSGustavo F. Padovan } __packed;
16171da177e4SLinus Torvalds 
16181da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
16191da177e4SLinus Torvalds struct hci_ev_pin_code_req {
16201da177e4SLinus Torvalds 	bdaddr_t bdaddr;
162166c853ccSGustavo F. Padovan } __packed;
16221da177e4SLinus Torvalds 
16231da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
16241da177e4SLinus Torvalds struct hci_ev_link_key_req {
16251da177e4SLinus Torvalds 	bdaddr_t bdaddr;
162666c853ccSGustavo F. Padovan } __packed;
16271da177e4SLinus Torvalds 
16281da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
16291da177e4SLinus Torvalds struct hci_ev_link_key_notify {
16301da177e4SLinus Torvalds 	bdaddr_t bdaddr;
16319b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
16321da177e4SLinus Torvalds 	__u8     key_type;
163366c853ccSGustavo F. Padovan } __packed;
16341da177e4SLinus Torvalds 
1635a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
16361da177e4SLinus Torvalds struct hci_ev_clock_offset {
16371da177e4SLinus Torvalds 	__u8     status;
16381ebb9252SMarcel Holtmann 	__le16   handle;
16391ebb9252SMarcel Holtmann 	__le16   clock_offset;
164066c853ccSGustavo F. Padovan } __packed;
16411da177e4SLinus Torvalds 
1642a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1643a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1644a8746417SMarcel Holtmann 	__u8     status;
1645a8746417SMarcel Holtmann 	__le16   handle;
1646a8746417SMarcel Holtmann 	__le16   pkt_type;
164766c853ccSGustavo F. Padovan } __packed;
1648a8746417SMarcel Holtmann 
164985a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
165085a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
165185a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
165285a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
165366c853ccSGustavo F. Padovan } __packed;
165485a1e930SMarcel Holtmann 
1655a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1656a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1657a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1658a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1659a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1660a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1661a9de9248SMarcel Holtmann 	__le16   clock_offset;
1662a9de9248SMarcel Holtmann 	__s8     rssi;
166366c853ccSGustavo F. Padovan } __packed;
1664a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1665a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1666a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1667a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1668a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1669a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1670a9de9248SMarcel Holtmann 	__le16   clock_offset;
1671a9de9248SMarcel Holtmann 	__s8     rssi;
167266c853ccSGustavo F. Padovan } __packed;
1673a9de9248SMarcel Holtmann 
1674a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1675a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1676a9de9248SMarcel Holtmann 	__u8     status;
1677a9de9248SMarcel Holtmann 	__le16   handle;
1678a9de9248SMarcel Holtmann 	__u8     page;
1679a9de9248SMarcel Holtmann 	__u8     max_page;
1680a9de9248SMarcel Holtmann 	__u8     features[8];
168166c853ccSGustavo F. Padovan } __packed;
1682a9de9248SMarcel Holtmann 
1683a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1684a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1685a9de9248SMarcel Holtmann 	__u8     status;
1686a9de9248SMarcel Holtmann 	__le16   handle;
1687a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1688a9de9248SMarcel Holtmann 	__u8     link_type;
1689a9de9248SMarcel Holtmann 	__u8     tx_interval;
1690a9de9248SMarcel Holtmann 	__u8     retrans_window;
1691a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1692a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1693a9de9248SMarcel Holtmann 	__u8     air_mode;
169466c853ccSGustavo F. Padovan } __packed;
1695a9de9248SMarcel Holtmann 
1696a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1697a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1698a9de9248SMarcel Holtmann 	__u8     status;
1699a9de9248SMarcel Holtmann 	__le16   handle;
1700a9de9248SMarcel Holtmann 	__u8     tx_interval;
1701a9de9248SMarcel Holtmann 	__u8     retrans_window;
1702a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1703a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
170466c853ccSGustavo F. Padovan } __packed;
1705a9de9248SMarcel Holtmann 
1706a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
170704837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
170804837f64SMarcel Holtmann 	__u8     status;
170904837f64SMarcel Holtmann 	__le16   handle;
171004837f64SMarcel Holtmann 	__le16   max_tx_latency;
171104837f64SMarcel Holtmann 	__le16   max_rx_latency;
171204837f64SMarcel Holtmann 	__le16   max_remote_timeout;
171304837f64SMarcel Holtmann 	__le16   max_local_timeout;
171466c853ccSGustavo F. Padovan } __packed;
171504837f64SMarcel Holtmann 
1716a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1717a9de9248SMarcel Holtmann struct extended_inquiry_info {
1718a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1719a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1720a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1721a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1722a9de9248SMarcel Holtmann 	__le16   clock_offset;
1723a9de9248SMarcel Holtmann 	__s8     rssi;
1724a9de9248SMarcel Holtmann 	__u8     data[240];
172566c853ccSGustavo F. Padovan } __packed;
1726a9de9248SMarcel Holtmann 
17271c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
17281c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
17291c2e0041SJohan Hedberg 	__u8	status;
17301c2e0041SJohan Hedberg 	__le16	handle;
17311c2e0041SJohan Hedberg } __packed;
17321c2e0041SJohan Hedberg 
17330493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
17340493684eSMarcel Holtmann struct hci_ev_io_capa_request {
17350493684eSMarcel Holtmann 	bdaddr_t bdaddr;
173666c853ccSGustavo F. Padovan } __packed;
17370493684eSMarcel Holtmann 
173803b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
173903b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
174003b555e1SJohan Hedberg 	bdaddr_t bdaddr;
174103b555e1SJohan Hedberg 	__u8     capability;
174203b555e1SJohan Hedberg 	__u8     oob_data;
174303b555e1SJohan Hedberg 	__u8     authentication;
174403b555e1SJohan Hedberg } __packed;
174503b555e1SJohan Hedberg 
1746a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1747a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1748a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1749a5c29683SJohan Hedberg 	__le32		passkey;
1750a5c29683SJohan Hedberg } __packed;
1751a5c29683SJohan Hedberg 
17529ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
17539ad4019aSBrian Gix struct hci_ev_user_passkey_req {
17549ad4019aSBrian Gix 	bdaddr_t	bdaddr;
17559ad4019aSBrian Gix } __packed;
17569ad4019aSBrian Gix 
17572763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
17582763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
17592763eda6SSzymon Janc 	bdaddr_t bdaddr;
17602763eda6SSzymon Janc } __packed;
17612763eda6SSzymon Janc 
17620493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
17630493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
17640493684eSMarcel Holtmann 	__u8     status;
17650493684eSMarcel Holtmann 	bdaddr_t bdaddr;
176666c853ccSGustavo F. Padovan } __packed;
17670493684eSMarcel Holtmann 
176892a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
176992a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
177092a25256SJohan Hedberg 	bdaddr_t	bdaddr;
177192a25256SJohan Hedberg 	__le32		passkey;
177292a25256SJohan Hedberg } __packed;
177392a25256SJohan Hedberg 
177492a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
177592a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
177692a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
177792a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
177892a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
177992a25256SJohan Hedberg 
178092a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
178192a25256SJohan Hedberg struct hci_ev_keypress_notify {
178292a25256SJohan Hedberg 	bdaddr_t	bdaddr;
178392a25256SJohan Hedberg 	__u8		type;
178492a25256SJohan Hedberg } __packed;
178592a25256SJohan Hedberg 
178641a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
178741a96212SMarcel Holtmann struct hci_ev_remote_host_features {
178841a96212SMarcel Holtmann 	bdaddr_t bdaddr;
178941a96212SMarcel Holtmann 	__u8     features[8];
179066c853ccSGustavo F. Padovan } __packed;
179141a96212SMarcel Holtmann 
179263185f64SVille Tervo #define HCI_EV_LE_META			0x3e
179363185f64SVille Tervo struct hci_ev_le_meta {
179463185f64SVille Tervo 	__u8     subevent;
179563185f64SVille Tervo } __packed;
179663185f64SVille Tervo 
1797523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
1798523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
1799523e93cdSAndrei Emeltchenko 	__u8     status;
1800523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1801523e93cdSAndrei Emeltchenko } __packed;
1802523e93cdSAndrei Emeltchenko 
1803523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
1804523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
1805523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1806523e93cdSAndrei Emeltchenko } __packed;
1807523e93cdSAndrei Emeltchenko 
1808523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
1809523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
1810523e93cdSAndrei Emeltchenko 	__u8     status;
1811523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1812523e93cdSAndrei Emeltchenko 	__u8     reason;
1813523e93cdSAndrei Emeltchenko } __packed;
1814523e93cdSAndrei Emeltchenko 
1815523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
1816523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
1817523e93cdSAndrei Emeltchenko 	__u8     status;
1818523e93cdSAndrei Emeltchenko 	__le16   handle;
1819523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1820523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
1821523e93cdSAndrei Emeltchenko } __packed;
1822523e93cdSAndrei Emeltchenko 
1823523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
1824523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
1825523e93cdSAndrei Emeltchenko 	__u8     status;
1826523e93cdSAndrei Emeltchenko 	__le16   handle;
1827523e93cdSAndrei Emeltchenko 	__u8     reason;
1828523e93cdSAndrei Emeltchenko } __packed;
1829523e93cdSAndrei Emeltchenko 
183025e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
183125e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
183225e89e99SAndrei Emeltchenko 	__le16   handle;
183325e89e99SAndrei Emeltchenko 	__le16   pkts;
183425e89e99SAndrei Emeltchenko 	__le16   blocks;
183525e89e99SAndrei Emeltchenko } __packed;
183625e89e99SAndrei Emeltchenko 
183725e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
183825e89e99SAndrei Emeltchenko 	__le16   num_blocks;
183925e89e99SAndrei Emeltchenko 	__u8     num_hndl;
184025e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
184125e89e99SAndrei Emeltchenko } __packed;
184225e89e99SAndrei Emeltchenko 
18432b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
18442b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
18452b359445SDoHyun Pyun 	__u8	status;
18462b359445SDoHyun Pyun } __packed;
18472b359445SDoHyun Pyun 
18482ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
18492ed01805SDoHyun Pyun 
185063185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
185163185f64SVille Tervo struct hci_ev_le_conn_complete {
185263185f64SVille Tervo 	__u8     status;
185363185f64SVille Tervo 	__le16   handle;
185463185f64SVille Tervo 	__u8     role;
185563185f64SVille Tervo 	__u8     bdaddr_type;
185663185f64SVille Tervo 	bdaddr_t bdaddr;
185763185f64SVille Tervo 	__le16   interval;
185863185f64SVille Tervo 	__le16   latency;
185963185f64SVille Tervo 	__le16   supervision_timeout;
186063185f64SVille Tervo 	__u8     clk_accurancy;
186163185f64SVille Tervo } __packed;
186263185f64SVille Tervo 
18632331fd46SMarcel Holtmann /* Advertising report event types */
18642331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
18652331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
18662331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
18672331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
18682331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
18692331fd46SMarcel Holtmann 
18702331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC	0x00
18712331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM	0x01
18722331fd46SMarcel Holtmann 
18732331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
18742331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
18752331fd46SMarcel Holtmann 	__u8	 evt_type;
18762331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
18772331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
18782331fd46SMarcel Holtmann 	__u8	 length;
18792331fd46SMarcel Holtmann 	__u8	 data[0];
18802331fd46SMarcel Holtmann } __packed;
18812331fd46SMarcel Holtmann 
18821855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
18831855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
18841855d92dSMarcel Holtmann 	__u8     status;
18851855d92dSMarcel Holtmann 	__le16   handle;
18861855d92dSMarcel Holtmann 	__le16   interval;
18871855d92dSMarcel Holtmann 	__le16   latency;
18881855d92dSMarcel Holtmann 	__le16   supervision_timeout;
18891855d92dSMarcel Holtmann } __packed;
18901855d92dSMarcel Holtmann 
18910fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
18920fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
18930fe29fd1SMarcel Holtmann 	__u8     status;
18940fe29fd1SMarcel Holtmann 	__le16   handle;
18950fe29fd1SMarcel Holtmann 	__u8     features[8];
18960fe29fd1SMarcel Holtmann } __packed;
18970fe29fd1SMarcel Holtmann 
1898a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1899a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1900a7a595f6SVinicius Costa Gomes 	__le16	handle;
1901fe39c7b2SMarcel Holtmann 	__le64	rand;
1902a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1903a7a595f6SVinicius Costa Gomes } __packed;
1904a7a595f6SVinicius Costa Gomes 
19058e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
19068e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
19078e75b46aSAndre Guedes 	__le16 handle;
19088e75b46aSAndre Guedes 	__le16 interval_min;
19098e75b46aSAndre Guedes 	__le16 interval_max;
19108e75b46aSAndre Guedes 	__le16 latency;
19118e75b46aSAndre Guedes 	__le16 timeout;
19128e75b46aSAndre Guedes } __packed;
19138e75b46aSAndre Guedes 
191494a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
191594a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
191694a3bd02SMarcel Holtmann 	__le16	handle;
191794a3bd02SMarcel Holtmann 	__le16	tx_len;
191894a3bd02SMarcel Holtmann 	__le16	tx_time;
191994a3bd02SMarcel Holtmann 	__le16	rx_len;
192094a3bd02SMarcel Holtmann 	__le16	rx_time;
192194a3bd02SMarcel Holtmann } __packed;
192294a3bd02SMarcel Holtmann 
192332c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
192432c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
192532c9d43fSMarcel Holtmann 	__u8	 evt_type;
192632c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
192732c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
192832c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
192932c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
193032c9d43fSMarcel Holtmann 	__s8	 rssi;
193132c9d43fSMarcel Holtmann } __packed;
193232c9d43fSMarcel Holtmann 
19331da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1934a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
19351da177e4SLinus Torvalds struct hci_ev_stack_internal {
19361da177e4SLinus Torvalds 	__u16    type;
19371da177e4SLinus Torvalds 	__u8     data[0];
193866c853ccSGustavo F. Padovan } __packed;
19391da177e4SLinus Torvalds 
19401da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
19411da177e4SLinus Torvalds struct hci_ev_si_device {
19421da177e4SLinus Torvalds 	__u16    event;
19431da177e4SLinus Torvalds 	__u16    dev_id;
194466c853ccSGustavo F. Padovan } __packed;
19451da177e4SLinus Torvalds 
19461da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
19471da177e4SLinus Torvalds struct hci_ev_si_security {
19481da177e4SLinus Torvalds 	__u16    event;
19491da177e4SLinus Torvalds 	__u16    proto;
19501da177e4SLinus Torvalds 	__u16    subproto;
19511da177e4SLinus Torvalds 	__u8     incoming;
195266c853ccSGustavo F. Padovan } __packed;
19531da177e4SLinus Torvalds 
19541da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
19551da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
19561da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
19571da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
19581da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
19591da177e4SLinus Torvalds 
19601da177e4SLinus Torvalds struct hci_command_hdr {
19611ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
19621da177e4SLinus Torvalds 	__u8	plen;
196366c853ccSGustavo F. Padovan } __packed;
19641da177e4SLinus Torvalds 
19651da177e4SLinus Torvalds struct hci_event_hdr {
19661da177e4SLinus Torvalds 	__u8	evt;
19671da177e4SLinus Torvalds 	__u8	plen;
196866c853ccSGustavo F. Padovan } __packed;
19691da177e4SLinus Torvalds 
19701da177e4SLinus Torvalds struct hci_acl_hdr {
19711ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
19721ebb9252SMarcel Holtmann 	__le16	dlen;
197366c853ccSGustavo F. Padovan } __packed;
19741da177e4SLinus Torvalds 
19751da177e4SLinus Torvalds struct hci_sco_hdr {
19761ebb9252SMarcel Holtmann 	__le16	handle;
19771da177e4SLinus Torvalds 	__u8	dlen;
197866c853ccSGustavo F. Padovan } __packed;
19791da177e4SLinus Torvalds 
19802a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
19812a123b86SArnaldo Carvalho de Melo {
19822a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
19832a123b86SArnaldo Carvalho de Melo }
19842a123b86SArnaldo Carvalho de Melo 
19852a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
19862a123b86SArnaldo Carvalho de Melo {
19872a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
19882a123b86SArnaldo Carvalho de Melo }
19892a123b86SArnaldo Carvalho de Melo 
19902a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
19912a123b86SArnaldo Carvalho de Melo {
19922a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
19932a123b86SArnaldo Carvalho de Melo }
19942a123b86SArnaldo Carvalho de Melo 
19951da177e4SLinus Torvalds /* Command opcode pack/unpack */
1996c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
19971da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
19981da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
19991da177e4SLinus Torvalds 
20001da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2001c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
20021da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
20031da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
20041da177e4SLinus Torvalds 
20051da177e4SLinus Torvalds #endif /* __HCI_H */
2006