xref: /openbmc/linux/include/net/bluetooth/hci.h (revision b4cb9fb25e9eae749f456e9e94446650389e736b)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds    BlueZ - Bluetooth protocol stack for Linux
31da177e4SLinus Torvalds    Copyright (C) 2000-2001 Qualcomm Incorporated
41da177e4SLinus Torvalds 
51da177e4SLinus Torvalds    Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
61da177e4SLinus Torvalds 
71da177e4SLinus Torvalds    This program is free software; you can redistribute it and/or modify
81da177e4SLinus Torvalds    it under the terms of the GNU General Public License version 2 as
91da177e4SLinus Torvalds    published by the Free Software Foundation;
101da177e4SLinus Torvalds 
111da177e4SLinus Torvalds    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
121da177e4SLinus Torvalds    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131da177e4SLinus Torvalds    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
141da177e4SLinus Torvalds    IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
151da177e4SLinus Torvalds    CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
161da177e4SLinus Torvalds    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
171da177e4SLinus Torvalds    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
181da177e4SLinus Torvalds    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
191da177e4SLinus Torvalds 
201da177e4SLinus Torvalds    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
211da177e4SLinus Torvalds    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
221da177e4SLinus Torvalds    SOFTWARE IS DISCLAIMED.
231da177e4SLinus Torvalds */
241da177e4SLinus Torvalds 
251da177e4SLinus Torvalds #ifndef __HCI_H
261da177e4SLinus Torvalds #define __HCI_H
271da177e4SLinus Torvalds 
281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE	1024
291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE	255
301da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE	260
311da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE	(HCI_MAX_ACL_SIZE + 4)
321da177e4SLinus Torvalds 
339b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE	16
34523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE	(2 * HCI_LINK_KEY_SIZE)
359b3b4460SAndrei Emeltchenko 
36903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE	672
37903e4541SAndrei Emeltchenko 
387d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE	252
397d1dab49SDoHyun Pyun 
401da177e4SLinus Torvalds /* HCI dev events */
411da177e4SLinus Torvalds #define HCI_DEV_REG			1
421da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
431da177e4SLinus Torvalds #define HCI_DEV_UP			3
441da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
451da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
461da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
471da177e4SLinus Torvalds 
481da177e4SLinus Torvalds /* HCI notify events */
491da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
501da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
511da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
521da177e4SLinus Torvalds 
53c13854ceSMarcel Holtmann /* HCI bus types */
540ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
551da177e4SLinus Torvalds #define HCI_USB		1
561da177e4SLinus Torvalds #define HCI_PCCARD	2
571da177e4SLinus Torvalds #define HCI_UART	3
581da177e4SLinus Torvalds #define HCI_RS232	4
591da177e4SLinus Torvalds #define HCI_PCI		5
600ac53939SMarcel Holtmann #define HCI_SDIO	6
611da177e4SLinus Torvalds 
62943da25dSMarcel Holtmann /* HCI controller types */
63943da25dSMarcel Holtmann #define HCI_BREDR	0x00
648f1e1742SDavid Vrabel #define HCI_AMP		0x01
65943da25dSMarcel Holtmann 
668598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
676ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
688598d064SAndrei Emeltchenko 
697c13823dSMarcel Holtmann /* AMP controller types */
707c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
717c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
727c13823dSMarcel Holtmann 
73ab846ec4SAndrei Emeltchenko /* AMP controller status */
74536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
75536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
76536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
77536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
78536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
79536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
80536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
81ab846ec4SAndrei Emeltchenko 
821da177e4SLinus Torvalds /* HCI device quirks */
831da177e4SLinus Torvalds enum {
84a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
85da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
86da1f5198SMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE
871da177e4SLinus Torvalds };
881da177e4SLinus Torvalds 
891da177e4SLinus Torvalds /* HCI device flags */
901da177e4SLinus Torvalds enum {
911da177e4SLinus Torvalds 	HCI_UP,
921da177e4SLinus Torvalds 	HCI_INIT,
931da177e4SLinus Torvalds 	HCI_RUNNING,
941da177e4SLinus Torvalds 
951da177e4SLinus Torvalds 	HCI_PSCAN,
961da177e4SLinus Torvalds 	HCI_ISCAN,
971da177e4SLinus Torvalds 	HCI_AUTH,
981da177e4SLinus Torvalds 	HCI_ENCRYPT,
991da177e4SLinus Torvalds 	HCI_INQUIRY,
1001da177e4SLinus Torvalds 
1011da177e4SLinus Torvalds 	HCI_RAW,
102ab81cbf9SJohan Hedberg 
10310572132SGustavo F. Padovan 	HCI_RESET,
1041da177e4SLinus Torvalds };
1051da177e4SLinus Torvalds 
106d23264a8SAndre Guedes /*
107d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
108d23264a8SAndre Guedes  * states from the controller.
109d23264a8SAndre Guedes  */
110d23264a8SAndre Guedes enum {
111a8b2d5c2SJohan Hedberg 	HCI_SETUP,
112a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
1135e130367SJohan Hedberg 	HCI_RFKILLED,
114a8b2d5c2SJohan Hedberg 	HCI_MGMT,
115a8b2d5c2SJohan Hedberg 	HCI_PAIRABLE,
116a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
117a8b2d5c2SJohan Hedberg 	HCI_DEBUG_KEYS,
11894324962SJohan Hovold 	HCI_UNREGISTER,
1190736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
120a8b2d5c2SJohan Hedberg 
121d23264a8SAndre Guedes 	HCI_LE_SCAN,
12284bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
1236d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
12406199cf8SJohan Hedberg 	HCI_LE_ENABLED,
125f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
1265e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
1275e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
12847990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
12921693c15SAndre Guedes 	HCI_PERIODIC_INQ,
1301a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
13156f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
132d23264a8SAndre Guedes };
133d23264a8SAndre Guedes 
1342cc6fb00SJohan Hedberg /* A mask for the flags that are supposed to remain when a reset happens
1352cc6fb00SJohan Hedberg  * or the HCI device is closed.
1362cc6fb00SJohan Hedberg  */
1371a4d3c4bSJohan Hedberg #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \
1381a4d3c4bSJohan Hedberg 			      BIT(HCI_FAST_CONNECTABLE))
1392cc6fb00SJohan Hedberg 
1401da177e4SLinus Torvalds /* HCI ioctl defines */
1411da177e4SLinus Torvalds #define HCIDEVUP	_IOW('H', 201, int)
1421da177e4SLinus Torvalds #define HCIDEVDOWN	_IOW('H', 202, int)
1431da177e4SLinus Torvalds #define HCIDEVRESET	_IOW('H', 203, int)
1441da177e4SLinus Torvalds #define HCIDEVRESTAT	_IOW('H', 204, int)
1451da177e4SLinus Torvalds 
1461da177e4SLinus Torvalds #define HCIGETDEVLIST	_IOR('H', 210, int)
1471da177e4SLinus Torvalds #define HCIGETDEVINFO	_IOR('H', 211, int)
1481da177e4SLinus Torvalds #define HCIGETCONNLIST	_IOR('H', 212, int)
1491da177e4SLinus Torvalds #define HCIGETCONNINFO	_IOR('H', 213, int)
15040be492fSMarcel Holtmann #define HCIGETAUTHINFO	_IOR('H', 215, int)
1511da177e4SLinus Torvalds 
1521da177e4SLinus Torvalds #define HCISETRAW	_IOW('H', 220, int)
1531da177e4SLinus Torvalds #define HCISETSCAN	_IOW('H', 221, int)
1541da177e4SLinus Torvalds #define HCISETAUTH	_IOW('H', 222, int)
1551da177e4SLinus Torvalds #define HCISETENCRYPT	_IOW('H', 223, int)
1561da177e4SLinus Torvalds #define HCISETPTYPE	_IOW('H', 224, int)
1571da177e4SLinus Torvalds #define HCISETLINKPOL	_IOW('H', 225, int)
1581da177e4SLinus Torvalds #define HCISETLINKMODE	_IOW('H', 226, int)
1591da177e4SLinus Torvalds #define HCISETACLMTU	_IOW('H', 227, int)
1601da177e4SLinus Torvalds #define HCISETSCOMTU	_IOW('H', 228, int)
1611da177e4SLinus Torvalds 
162f0358568SJohan Hedberg #define HCIBLOCKADDR	_IOW('H', 230, int)
163f0358568SJohan Hedberg #define HCIUNBLOCKADDR	_IOW('H', 231, int)
164f0358568SJohan Hedberg 
1651da177e4SLinus Torvalds #define HCIINQUIRY	_IOR('H', 240, int)
1661da177e4SLinus Torvalds 
1671da177e4SLinus Torvalds /* HCI timeouts */
1685f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
1695f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
1705f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
171d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
1725f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
1739345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
1741da177e4SLinus Torvalds 
1755b7f9909SMarcel Holtmann /* HCI data types */
1761da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
1771da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
1781da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
1791da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
1801da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
1811da177e4SLinus Torvalds 
1825b7f9909SMarcel Holtmann /* HCI packet types */
1831da177e4SLinus Torvalds #define HCI_DM1		0x0008
1841da177e4SLinus Torvalds #define HCI_DM3		0x0400
1851da177e4SLinus Torvalds #define HCI_DM5		0x4000
1861da177e4SLinus Torvalds #define HCI_DH1		0x0010
1871da177e4SLinus Torvalds #define HCI_DH3		0x0800
1881da177e4SLinus Torvalds #define HCI_DH5		0x8000
1891da177e4SLinus Torvalds 
1901da177e4SLinus Torvalds #define HCI_HV1		0x0020
1911da177e4SLinus Torvalds #define HCI_HV2		0x0040
1921da177e4SLinus Torvalds #define HCI_HV3		0x0080
1931da177e4SLinus Torvalds 
1941da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
1951da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
1961da177e4SLinus Torvalds 
1975b7f9909SMarcel Holtmann /* eSCO packet types */
1985b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
1995b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
2005b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
2015b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
2025b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
2035b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
204efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
205efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
206efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
207efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
2085b7f9909SMarcel Holtmann 
209a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
210efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
211a8746417SMarcel Holtmann 
2121da177e4SLinus Torvalds /* ACL flags */
213e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
2141da177e4SLinus Torvalds #define ACL_CONT		0x01
2151da177e4SLinus Torvalds #define ACL_START		0x02
216d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
2171da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
2181da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
2191da177e4SLinus Torvalds 
2201da177e4SLinus Torvalds /* Baseband links */
2211da177e4SLinus Torvalds #define SCO_LINK	0x00
2221da177e4SLinus Torvalds #define ACL_LINK	0x01
2235b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
224fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
225fcd89c09SVille Tervo #define LE_LINK		0x80
2263161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
2271da177e4SLinus Torvalds 
2281da177e4SLinus Torvalds /* LMP features */
2291da177e4SLinus Torvalds #define LMP_3SLOT	0x01
2301da177e4SLinus Torvalds #define LMP_5SLOT	0x02
2311da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
2321da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
2331da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
2341da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
2351da177e4SLinus Torvalds #define LMP_HOLD	0x40
23604837f64SMarcel Holtmann #define LMP_SNIFF	0x80
2371da177e4SLinus Torvalds 
2381da177e4SLinus Torvalds #define LMP_PARK	0x01
2391da177e4SLinus Torvalds #define LMP_RSSI	0x02
2401da177e4SLinus Torvalds #define LMP_QUALITY	0x04
2411da177e4SLinus Torvalds #define LMP_SCO		0x08
2421da177e4SLinus Torvalds #define LMP_HV2		0x10
2431da177e4SLinus Torvalds #define LMP_HV3		0x20
2441da177e4SLinus Torvalds #define LMP_ULAW	0x40
2451da177e4SLinus Torvalds #define LMP_ALAW	0x80
2461da177e4SLinus Torvalds 
2471da177e4SLinus Torvalds #define LMP_CVSD	0x01
2481da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
2491da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
25007a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
2511da177e4SLinus Torvalds 
252d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
2535b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
2545b7f9909SMarcel Holtmann 
2555b7f9909SMarcel Holtmann #define LMP_EV4		0x01
2565b7f9909SMarcel Holtmann #define LMP_EV5		0x02
25769ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
258d5859e22SJohan Hedberg #define LMP_LE		0x40
2595b7f9909SMarcel Holtmann 
26004837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
261d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
262efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
263efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
264efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
26504837f64SMarcel Holtmann 
266d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
267e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
268769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
269e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
270769be974SMarcel Holtmann 
271d5859e22SJohan Hedberg #define LMP_LSTO	0x01
272d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
273971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
274d5859e22SJohan Hedberg 
275eead27daSAndre Guedes /* Extended LMP features */
276cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
277eead27daSAndre Guedes #define LMP_HOST_LE		0x02
278cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
279eead27daSAndre Guedes 
28004837f64SMarcel Holtmann /* Connection modes */
28104837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
28204837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
28304837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
28404837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
28504837f64SMarcel Holtmann 
2861da177e4SLinus Torvalds /* Link policies */
2871da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
2881da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
2891da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
2901da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
2911da177e4SLinus Torvalds 
29204837f64SMarcel Holtmann /* Link modes */
2931da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
2941da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
2951da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
2961da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
2971da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
2981da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
2991da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
3001da177e4SLinus Torvalds 
30140be492fSMarcel Holtmann /* Authentication types */
30240be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
30340be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
30440be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
30540be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
30640be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
30740be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
30840be492fSMarcel Holtmann 
309a77b15a6SMikel Astiz /* I/O capabilities */
310a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
311a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
312a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
313a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
314a77b15a6SMikel Astiz 
315b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
316b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
317b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
318b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
319b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
320b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_UNAUTH_COMBINATION	0x04
321b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_AUTH_COMBINATION		0x05
322b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
323b899efafSVinicius Costa Gomes /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
324b899efafSVinicius Costa Gomes #define HCI_SMP_STK			0x80
325b899efafSVinicius Costa Gomes #define HCI_SMP_STK_SLAVE		0x81
326b899efafSVinicius Costa Gomes #define HCI_SMP_LTK			0x82
327b899efafSVinicius Costa Gomes #define HCI_SMP_LTK_SLAVE		0x83
328b6020ba0SWaldemar Rymarkiewicz 
3299f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
3309f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
331cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
3329f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
3339f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
334cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
335cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
3369f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
3379f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
3389f5a0d7bSAndrei Emeltchenko 
3392455a3eaSAndrei Emeltchenko /* Flow control modes */
3402455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
3412455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
3422455a3eaSAndrei Emeltchenko 
343bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
344bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
345bbaf444aSJohan Hedberg 
34632748db0SJohan Hedberg /* Extended Inquiry Response field types */
34732748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
34832748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
34932748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
35032748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
35132748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
35232748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
35332748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
35432748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
35532748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
35632748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
3579ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
3589ec9fc8aSJohan Hedberg #define EIR_SSP_HASH_C		0x0E /* Simple Pairing Hash C */
3599ec9fc8aSJohan Hedberg #define EIR_SSP_RAND_R		0x0F /* Simple Pairing Randomizer R */
36032748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
36132748db0SJohan Hedberg 
3623f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
3633f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
3643f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
3653f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
3663f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
3673f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
3683f0f524bSJohan Hedberg 
3691da177e4SLinus Torvalds /* -----  HCI Commands ---- */
3706bd32326SVille Tervo #define HCI_OP_NOP			0x0000
3716bd32326SVille Tervo 
372a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
373a9de9248SMarcel Holtmann struct hci_cp_inquiry {
374a9de9248SMarcel Holtmann 	__u8     lap[3];
375a9de9248SMarcel Holtmann 	__u8     length;
376a9de9248SMarcel Holtmann 	__u8     num_rsp;
37766c853ccSGustavo F. Padovan } __packed;
3781da177e4SLinus Torvalds 
379a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
380a9de9248SMarcel Holtmann 
38179d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
38279d6e068SAndre Guedes 
383a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
384a9de9248SMarcel Holtmann 
385a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
386a9de9248SMarcel Holtmann struct hci_cp_create_conn {
387a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
388a9de9248SMarcel Holtmann 	__le16   pkt_type;
389a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
390a9de9248SMarcel Holtmann 	__u8     pscan_mode;
391a9de9248SMarcel Holtmann 	__le16   clock_offset;
392a9de9248SMarcel Holtmann 	__u8     role_switch;
39366c853ccSGustavo F. Padovan } __packed;
3941da177e4SLinus Torvalds 
395a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
396a9de9248SMarcel Holtmann struct hci_cp_disconnect {
397a9de9248SMarcel Holtmann 	__le16   handle;
398a9de9248SMarcel Holtmann 	__u8     reason;
39966c853ccSGustavo F. Padovan } __packed;
4001da177e4SLinus Torvalds 
401a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
402a9de9248SMarcel Holtmann struct hci_cp_add_sco {
403a9de9248SMarcel Holtmann 	__le16   handle;
404a9de9248SMarcel Holtmann 	__le16   pkt_type;
40566c853ccSGustavo F. Padovan } __packed;
406a9de9248SMarcel Holtmann 
407a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
408a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
4091da177e4SLinus Torvalds 	bdaddr_t bdaddr;
41066c853ccSGustavo F. Padovan } __packed;
4111da177e4SLinus Torvalds 
412a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
413a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
414a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
415a9de9248SMarcel Holtmann 	__u8     role;
41666c853ccSGustavo F. Padovan } __packed;
4171da177e4SLinus Torvalds 
418a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
419a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
420a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
421a9de9248SMarcel Holtmann 	__u8     reason;
42266c853ccSGustavo F. Padovan } __packed;
4231da177e4SLinus Torvalds 
424a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
425a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
426a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
4279b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
42866c853ccSGustavo F. Padovan } __packed;
4291da177e4SLinus Torvalds 
430a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
431a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
432a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
43366c853ccSGustavo F. Padovan } __packed;
4341da177e4SLinus Torvalds 
435a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
436a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
437a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
438a9de9248SMarcel Holtmann 	__u8     pin_len;
439a9de9248SMarcel Holtmann 	__u8     pin_code[16];
44066c853ccSGustavo F. Padovan } __packed;
441980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
442980e1a53SJohan Hedberg 	__u8     status;
443980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
444980e1a53SJohan Hedberg } __packed;
445a9de9248SMarcel Holtmann 
446a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
447a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
448a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
44966c853ccSGustavo F. Padovan } __packed;
450980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
451980e1a53SJohan Hedberg 	__u8     status;
452980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
453980e1a53SJohan Hedberg } __packed;
454a9de9248SMarcel Holtmann 
455a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
456a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
457a9de9248SMarcel Holtmann 	__le16   handle;
458a9de9248SMarcel Holtmann 	__le16   pkt_type;
45966c853ccSGustavo F. Padovan } __packed;
460a9de9248SMarcel Holtmann 
461a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
462a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
463a9de9248SMarcel Holtmann 	__le16   handle;
46466c853ccSGustavo F. Padovan } __packed;
465a9de9248SMarcel Holtmann 
466a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
467a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
468a9de9248SMarcel Holtmann 	__le16   handle;
469a9de9248SMarcel Holtmann 	__u8     encrypt;
47066c853ccSGustavo F. Padovan } __packed;
471a9de9248SMarcel Holtmann 
472a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
473a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
474a9de9248SMarcel Holtmann 	__le16   handle;
47566c853ccSGustavo F. Padovan } __packed;
476a9de9248SMarcel Holtmann 
477a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
478a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
479a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
480a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
481a9de9248SMarcel Holtmann 	__u8     pscan_mode;
482a9de9248SMarcel Holtmann 	__le16   clock_offset;
48366c853ccSGustavo F. Padovan } __packed;
484a9de9248SMarcel Holtmann 
485a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
486a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
487a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
48866c853ccSGustavo F. Padovan } __packed;
489a9de9248SMarcel Holtmann 
490a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
491a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
492a9de9248SMarcel Holtmann 	__le16   handle;
49366c853ccSGustavo F. Padovan } __packed;
494a9de9248SMarcel Holtmann 
495a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
496a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
497a9de9248SMarcel Holtmann 	__le16   handle;
498a9de9248SMarcel Holtmann 	__u8     page;
49966c853ccSGustavo F. Padovan } __packed;
500a9de9248SMarcel Holtmann 
501a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
502a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
503a9de9248SMarcel Holtmann 	__le16   handle;
50466c853ccSGustavo F. Padovan } __packed;
505a9de9248SMarcel Holtmann 
506a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
507a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
508a9de9248SMarcel Holtmann 	__le16   handle;
509a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
510a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
511a9de9248SMarcel Holtmann 	__le16   max_latency;
512a9de9248SMarcel Holtmann 	__le16   voice_setting;
513a9de9248SMarcel Holtmann 	__u8     retrans_effort;
514a9de9248SMarcel Holtmann 	__le16   pkt_type;
51566c853ccSGustavo F. Padovan } __packed;
516a9de9248SMarcel Holtmann 
517a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
518a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
519a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
520a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
521a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
522a9de9248SMarcel Holtmann 	__le16   max_latency;
523a9de9248SMarcel Holtmann 	__le16   content_format;
524a9de9248SMarcel Holtmann 	__u8     retrans_effort;
525a9de9248SMarcel Holtmann 	__le16   pkt_type;
52666c853ccSGustavo F. Padovan } __packed;
527a9de9248SMarcel Holtmann 
528a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
529a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
530a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
531a9de9248SMarcel Holtmann 	__u8     reason;
53266c853ccSGustavo F. Padovan } __packed;
533a9de9248SMarcel Holtmann 
53417fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
53517fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
53617fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
53717fa4b9dSJohan Hedberg 	__u8     capability;
53817fa4b9dSJohan Hedberg 	__u8     oob_data;
53917fa4b9dSJohan Hedberg 	__u8     authentication;
54017fa4b9dSJohan Hedberg } __packed;
54117fa4b9dSJohan Hedberg 
542a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
543a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
544a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
545a5c29683SJohan Hedberg } __packed;
546a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
547a5c29683SJohan Hedberg 	__u8     status;
548a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
549a5c29683SJohan Hedberg } __packed;
550a5c29683SJohan Hedberg 
551a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
552a5c29683SJohan Hedberg 
5539ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
5549ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
5559ad4019aSBrian Gix 	bdaddr_t bdaddr;
5569ad4019aSBrian Gix 	__le32	passkey;
5579ad4019aSBrian Gix } __packed;
5589ad4019aSBrian Gix 
5599ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
5609ad4019aSBrian Gix 
5612763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
5622763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
5632763eda6SSzymon Janc 	bdaddr_t bdaddr;
5642763eda6SSzymon Janc 	__u8     hash[16];
5652763eda6SSzymon Janc 	__u8     randomizer[16];
5662763eda6SSzymon Janc } __packed;
5672763eda6SSzymon Janc 
5682763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
5692763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
5702763eda6SSzymon Janc 	bdaddr_t bdaddr;
5712763eda6SSzymon Janc } __packed;
5722763eda6SSzymon Janc 
57303b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
57403b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
57503b555e1SJohan Hedberg 	bdaddr_t bdaddr;
57603b555e1SJohan Hedberg 	__u8     reason;
57703b555e1SJohan Hedberg } __packed;
57803b555e1SJohan Hedberg 
579523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
580523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
581523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
582523e93cdSAndrei Emeltchenko 	__u8     key_len;
583523e93cdSAndrei Emeltchenko 	__u8     key_type;
584523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
585523e93cdSAndrei Emeltchenko } __packed;
586523e93cdSAndrei Emeltchenko 
587523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
588523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
589523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
590523e93cdSAndrei Emeltchenko 	__u8     key_len;
591523e93cdSAndrei Emeltchenko 	__u8     key_type;
592523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
593523e93cdSAndrei Emeltchenko } __packed;
594523e93cdSAndrei Emeltchenko 
595523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
596523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
597523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
598523e93cdSAndrei Emeltchenko 	__u8     reason;
599b078b564SAndrei Emeltchenko } __packed;
600b078b564SAndrei Emeltchenko 
601b078b564SAndrei Emeltchenko struct ext_flow_spec {
602b078b564SAndrei Emeltchenko 	__u8       id;
603b078b564SAndrei Emeltchenko 	__u8       stype;
604b078b564SAndrei Emeltchenko 	__le16     msdu;
605b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
606b078b564SAndrei Emeltchenko 	__le32     acc_lat;
607b078b564SAndrei Emeltchenko 	__le32     flush_to;
608b078b564SAndrei Emeltchenko } __packed;
609b078b564SAndrei Emeltchenko 
610b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
611b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
612b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
613b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
614b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
615b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
616b078b564SAndrei Emeltchenko } __packed;
617b078b564SAndrei Emeltchenko 
618b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
619b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
620b078b564SAndrei Emeltchenko 	__le16   log_handle;
621b078b564SAndrei Emeltchenko } __packed;
622b078b564SAndrei Emeltchenko 
623b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
624b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
625b078b564SAndrei Emeltchenko 	__u8     phy_handle;
626b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
627b078b564SAndrei Emeltchenko } __packed;
628b078b564SAndrei Emeltchenko 
629b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
630b078b564SAndrei Emeltchenko 	__u8     status;
631b078b564SAndrei Emeltchenko 	__u8     phy_handle;
632b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
633523e93cdSAndrei Emeltchenko } __packed;
634523e93cdSAndrei Emeltchenko 
6358c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB			0x0441
6368c9a041bSDoHyun Pyun struct hci_cp_set_csb {
6378c9a041bSDoHyun Pyun 	__u8	enable;
6388c9a041bSDoHyun Pyun 	__u8	lt_addr;
6398c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
6408c9a041bSDoHyun Pyun 	__le16	packet_type;
6418c9a041bSDoHyun Pyun 	__le16	interval_min;
6428c9a041bSDoHyun Pyun 	__le16	interval_max;
6438c9a041bSDoHyun Pyun 	__le16	csb_sv_tout;
6448c9a041bSDoHyun Pyun } __packed;
6458c9a041bSDoHyun Pyun struct hci_rp_set_csb {
6468c9a041bSDoHyun Pyun 	__u8	status;
6478c9a041bSDoHyun Pyun 	__u8	lt_addr;
6488c9a041bSDoHyun Pyun 	__le16	interval;
6498c9a041bSDoHyun Pyun } __packed;
6508c9a041bSDoHyun Pyun 
651cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
652cefded98SDoHyun Pyun 
653a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
654a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
655a9de9248SMarcel Holtmann 	__le16   handle;
656a9de9248SMarcel Holtmann 	__le16   max_interval;
657a9de9248SMarcel Holtmann 	__le16   min_interval;
658a9de9248SMarcel Holtmann 	__le16   attempt;
659a9de9248SMarcel Holtmann 	__le16   timeout;
66066c853ccSGustavo F. Padovan } __packed;
661a9de9248SMarcel Holtmann 
662a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
663a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
664a9de9248SMarcel Holtmann 	__le16   handle;
66566c853ccSGustavo F. Padovan } __packed;
666a9de9248SMarcel Holtmann 
667a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
668a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
669a9de9248SMarcel Holtmann 	__le16   handle;
67066c853ccSGustavo F. Padovan } __packed;
671a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
672a9de9248SMarcel Holtmann 	__u8     status;
673a9de9248SMarcel Holtmann 	__le16   handle;
674a9de9248SMarcel Holtmann 	__u8     role;
67566c853ccSGustavo F. Padovan } __packed;
676a9de9248SMarcel Holtmann 
677a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
678a9de9248SMarcel Holtmann struct hci_cp_switch_role {
679a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
680a9de9248SMarcel Holtmann 	__u8     role;
68166c853ccSGustavo F. Padovan } __packed;
682a9de9248SMarcel Holtmann 
683a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
684a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
685a9de9248SMarcel Holtmann 	__le16   handle;
68666c853ccSGustavo F. Padovan } __packed;
687a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
688a9de9248SMarcel Holtmann 	__u8     status;
689a9de9248SMarcel Holtmann 	__le16   handle;
690a9de9248SMarcel Holtmann 	__le16   policy;
69166c853ccSGustavo F. Padovan } __packed;
692a9de9248SMarcel Holtmann 
693a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
694a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
695a9de9248SMarcel Holtmann 	__le16   handle;
696a9de9248SMarcel Holtmann 	__le16   policy;
69766c853ccSGustavo F. Padovan } __packed;
698a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
699a9de9248SMarcel Holtmann 	__u8     status;
700a9de9248SMarcel Holtmann 	__le16   handle;
70166c853ccSGustavo F. Padovan } __packed;
702a9de9248SMarcel Holtmann 
703e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
704e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
705e4e8e37cSMarcel Holtmann 	__u8     status;
706e4e8e37cSMarcel Holtmann 	__le16   policy;
70766c853ccSGustavo F. Padovan } __packed;
708e4e8e37cSMarcel Holtmann 
709e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
710e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
711e4e8e37cSMarcel Holtmann 	__le16   policy;
71266c853ccSGustavo F. Padovan } __packed;
713e4e8e37cSMarcel Holtmann 
714a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
715a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
716a9de9248SMarcel Holtmann 	__le16   handle;
717a9de9248SMarcel Holtmann 	__le16   max_latency;
718a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
719a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
72066c853ccSGustavo F. Padovan } __packed;
721a9de9248SMarcel Holtmann 
722a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
723a9de9248SMarcel Holtmann 
724a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
725a9de9248SMarcel Holtmann 
726a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
7271da177e4SLinus Torvalds struct hci_cp_set_event_flt {
7281da177e4SLinus Torvalds 	__u8     flt_type;
7291da177e4SLinus Torvalds 	__u8     cond_type;
7301da177e4SLinus Torvalds 	__u8     condition[0];
73166c853ccSGustavo F. Padovan } __packed;
7321da177e4SLinus Torvalds 
7331da177e4SLinus Torvalds /* Filter types */
7341da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
7351da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
7361da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
7371da177e4SLinus Torvalds 
7381da177e4SLinus Torvalds /* CONN_SETUP Condition types */
7391da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
7401da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
7411da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
7421da177e4SLinus Torvalds 
7431da177e4SLinus Torvalds /* CONN_SETUP Conditions */
7441da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
7451da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
7461da177e4SLinus Torvalds 
747b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
748b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
749b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
750b0916ea0SJohan Hedberg 	__u8     delete_all;
751b0916ea0SJohan Hedberg } __packed;
752b0916ea0SJohan Hedberg 
7531f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
7541f6c6378SJohan Hedberg 
755a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
756a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
7571f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
75866c853ccSGustavo F. Padovan } __packed;
759a9de9248SMarcel Holtmann 
760a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
761a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
762a9de9248SMarcel Holtmann 	__u8     status;
7631f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
76466c853ccSGustavo F. Padovan } __packed;
765a9de9248SMarcel Holtmann 
766a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
767a9de9248SMarcel Holtmann 
768a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
769a9de9248SMarcel Holtmann 
770a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
771a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
772a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
773a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
774a9de9248SMarcel Holtmann 
775a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
776a9de9248SMarcel Holtmann 
777a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
778a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
779a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
780a9de9248SMarcel Holtmann 
781a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
782a9de9248SMarcel Holtmann 
783a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
784a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
785a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
786a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
787a9de9248SMarcel Holtmann 
788a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
789a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
7901da177e4SLinus Torvalds 	__u8     status;
7911da177e4SLinus Torvalds 	__u8     dev_class[3];
79266c853ccSGustavo F. Padovan } __packed;
7931da177e4SLinus Torvalds 
794a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
795a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
7961da177e4SLinus Torvalds 	__u8     dev_class[3];
79766c853ccSGustavo F. Padovan } __packed;
7981da177e4SLinus Torvalds 
799a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
8001da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
8011da177e4SLinus Torvalds 	__u8     status;
8021ebb9252SMarcel Holtmann 	__le16   voice_setting;
80366c853ccSGustavo F. Padovan } __packed;
8041da177e4SLinus Torvalds 
805a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
8061da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
8071ebb9252SMarcel Holtmann 	__le16   voice_setting;
80866c853ccSGustavo F. Padovan } __packed;
8091da177e4SLinus Torvalds 
810a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
8111da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
8121ebb9252SMarcel Holtmann 	__le16   acl_mtu;
8131da177e4SLinus Torvalds 	__u8     sco_mtu;
8141ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
8151ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
81666c853ccSGustavo F. Padovan } __packed;
8171da177e4SLinus Torvalds 
818*b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
819*b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
820*b4cb9fb2SMarcel Holtmann 	__u8	status;
821*b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
822*b4cb9fb2SMarcel Holtmann } __packed;
823*b4cb9fb2SMarcel Holtmann 
824d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
825d5859e22SJohan Hedberg 
82680a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
82780a1e1dbSJohan Hedberg 
82880a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
82980a1e1dbSJohan Hedberg struct hci_cp_write_eir {
830816a11d5SJohan Hedberg 	__u8	fec;
831816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
83280a1e1dbSJohan Hedberg } __packed;
83380a1e1dbSJohan Hedberg 
834333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
835333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
836333140b5SMarcel Holtmann 	__u8     status;
837333140b5SMarcel Holtmann 	__u8     mode;
83866c853ccSGustavo F. Padovan } __packed;
839333140b5SMarcel Holtmann 
840333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
841333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
842333140b5SMarcel Holtmann 	__u8     mode;
84366c853ccSGustavo F. Padovan } __packed;
844333140b5SMarcel Holtmann 
845c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
846c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
847c35938b2SSzymon Janc 	__u8     status;
848c35938b2SSzymon Janc 	__u8     hash[16];
849c35938b2SSzymon Janc 	__u8     randomizer[16];
850c35938b2SSzymon Janc } __packed;
851c35938b2SSzymon Janc 
852d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
85391c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
85491c4e9b1SMarcel Holtmann 	__u8     status;
85591c4e9b1SMarcel Holtmann 	__s8     tx_power;
85691c4e9b1SMarcel Holtmann } __packed;
857d5859e22SJohan Hedberg 
858d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
859d62e6d67SJohan Hedberg 
8607528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
8617528ca1cSMarcel Holtmann 
8621e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
8631e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
8641e89cffbSAndrei Emeltchenko 	__u8     status;
8651e89cffbSAndrei Emeltchenko 	__u8     mode;
8661e89cffbSAndrei Emeltchenko } __packed;
8671e89cffbSAndrei Emeltchenko 
868f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
869f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
870f9b49306SAndre Guedes 	__u8	le;
871f9b49306SAndre Guedes 	__u8	simul;
872f9b49306SAndre Guedes } __packed;
873f9b49306SAndre Guedes 
874d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
875d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
876d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
877d0bf75a5SDoHyun Pyun } __packed;
878d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
879d0bf75a5SDoHyun Pyun 	__u8	status;
880d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
881d0bf75a5SDoHyun Pyun } __packed;
882d0bf75a5SDoHyun Pyun 
8836a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
8846a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
8856a20eaf4SDoHyun Pyun 	__u8	lt_addr;
8866a20eaf4SDoHyun Pyun } __packed;
8876a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
8886a20eaf4SDoHyun Pyun 	__u8	status;
8896a20eaf4SDoHyun Pyun 	__u8	lt_addr;
8906a20eaf4SDoHyun Pyun } __packed;
8916a20eaf4SDoHyun Pyun 
8927d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
8937d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
8947d1dab49SDoHyun Pyun 	__u8	lt_addr;
8957d1dab49SDoHyun Pyun 	__u8	fragment;
8967d1dab49SDoHyun Pyun 	__u8	data_length;
8977d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
8987d1dab49SDoHyun Pyun } __packed;
8997d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
9007d1dab49SDoHyun Pyun 	__u8	status;
9017d1dab49SDoHyun Pyun 	__u8	lt_addr;
9027d1dab49SDoHyun Pyun } __packed;
9037d1dab49SDoHyun Pyun 
9045d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
9055d4e7e8dSJohan Hedberg 
906a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
907a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
908a9b07a64SDoHyun Pyun 	__le16	interval_min;
909a9b07a64SDoHyun Pyun 	__le16	interval_max;
910a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
911a9b07a64SDoHyun Pyun 	__u8	service_data;
912a9b07a64SDoHyun Pyun } __packed;
913a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
914a9b07a64SDoHyun Pyun 	__u8	status;
915a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
916a9b07a64SDoHyun Pyun } __packed;
917a9b07a64SDoHyun Pyun 
918a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
919a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
9201da177e4SLinus Torvalds 	__u8     status;
921a9de9248SMarcel Holtmann 	__u8     hci_ver;
922a9de9248SMarcel Holtmann 	__le16   hci_rev;
923a9de9248SMarcel Holtmann 	__u8     lmp_ver;
924a9de9248SMarcel Holtmann 	__le16   manufacturer;
925a9de9248SMarcel Holtmann 	__le16   lmp_subver;
92666c853ccSGustavo F. Padovan } __packed;
9271da177e4SLinus Torvalds 
928a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
929a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
9301da177e4SLinus Torvalds 	__u8     status;
931a9de9248SMarcel Holtmann 	__u8     commands[64];
93266c853ccSGustavo F. Padovan } __packed;
9331da177e4SLinus Torvalds 
934a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
935a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
936a9de9248SMarcel Holtmann 	__u8     status;
937a9de9248SMarcel Holtmann 	__u8     features[8];
93866c853ccSGustavo F. Padovan } __packed;
939a9de9248SMarcel Holtmann 
940a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
941971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
942971e3a4bSAndre Guedes 	__u8     page;
943971e3a4bSAndre Guedes } __packed;
944a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
945a9de9248SMarcel Holtmann 	__u8     status;
946a9de9248SMarcel Holtmann 	__u8     page;
947a9de9248SMarcel Holtmann 	__u8     max_page;
948a9de9248SMarcel Holtmann 	__u8     features[8];
94966c853ccSGustavo F. Padovan } __packed;
950a9de9248SMarcel Holtmann 
951a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
952a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
953a9de9248SMarcel Holtmann 	__u8     status;
954a9de9248SMarcel Holtmann 	__le16   acl_mtu;
955a9de9248SMarcel Holtmann 	__u8     sco_mtu;
956a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
957a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
95866c853ccSGustavo F. Padovan } __packed;
959a9de9248SMarcel Holtmann 
960a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
961a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
962a9de9248SMarcel Holtmann 	__u8     status;
9631da177e4SLinus Torvalds 	bdaddr_t bdaddr;
96466c853ccSGustavo F. Padovan } __packed;
9651da177e4SLinus Torvalds 
966350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
967350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
968350ee4cfSAndrei Emeltchenko 	__u8     status;
969350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
970350ee4cfSAndrei Emeltchenko 	__le16   block_len;
971350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
972350ee4cfSAndrei Emeltchenko } __packed;
973350ee4cfSAndrei Emeltchenko 
974f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
975f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
976f332ec66SJohan Hedberg 	__u8     status;
977f332ec66SJohan Hedberg 	__le16   interval;
978f332ec66SJohan Hedberg 	__le16   window;
979f332ec66SJohan Hedberg } __packed;
980f332ec66SJohan Hedberg 
981f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
982f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
983f6422ec6SAntti Julku 	__le16   interval;
984f6422ec6SAntti Julku 	__le16   window;
985f6422ec6SAntti Julku } __packed;
986f6422ec6SAntti Julku 
987f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
988f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
989f332ec66SJohan Hedberg 	__u8     status;
990f332ec66SJohan Hedberg 	__u8     type;
991f332ec66SJohan Hedberg } __packed;
992f332ec66SJohan Hedberg 
993f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
994f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
995f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
996f6422ec6SAntti Julku 
997928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
998928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
999928abaa7SAndrei Emeltchenko 	__u8     status;
1000928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1001928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1002928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1003928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1004928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1005928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1006928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1007928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1008928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1009928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1010928abaa7SAndrei Emeltchenko } __packed;
1011928abaa7SAndrei Emeltchenko 
1012523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1013523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1014523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1015523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1016523e93cdSAndrei Emeltchenko 	__le16   max_len;
1017523e93cdSAndrei Emeltchenko } __packed;
1018523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1019523e93cdSAndrei Emeltchenko 	__u8     status;
1020523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1021523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1022523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1023523e93cdSAndrei Emeltchenko } __packed;
1024523e93cdSAndrei Emeltchenko 
1025523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1026523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1027523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1028523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1029523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1030523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1031523e93cdSAndrei Emeltchenko } __packed;
1032523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1033523e93cdSAndrei Emeltchenko 	__u8     status;
1034523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1035523e93cdSAndrei Emeltchenko } __packed;
1036523e93cdSAndrei Emeltchenko 
103763185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
103863185f64SVille Tervo struct hci_cp_le_set_event_mask {
103963185f64SVille Tervo 	__u8     mask[8];
104063185f64SVille Tervo } __packed;
104163185f64SVille Tervo 
104263185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
104363185f64SVille Tervo struct hci_rp_le_read_buffer_size {
104463185f64SVille Tervo 	__u8     status;
104563185f64SVille Tervo 	__le16   le_mtu;
104663185f64SVille Tervo 	__u8     le_max_pkt;
104763185f64SVille Tervo } __packed;
104863185f64SVille Tervo 
104960e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
105060e77321SJohan Hedberg struct hci_rp_le_read_local_features {
105160e77321SJohan Hedberg 	__u8     status;
105260e77321SJohan Hedberg 	__u8     features[8];
105360e77321SJohan Hedberg } __packed;
105460e77321SJohan Hedberg 
1055d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1056d13eafceSMarcel Holtmann 
1057c2f5ebd2SMarcel Holtmann #define LE_ADV_IND			0x00
1058c2f5ebd2SMarcel Holtmann #define LE_ADV_DIRECT_IND		0x01
1059c2f5ebd2SMarcel Holtmann #define LE_ADV_SCAN_IND			0x02
1060c2f5ebd2SMarcel Holtmann #define LE_ADV_NONCONN_IND		0x03
1061c2f5ebd2SMarcel Holtmann 
10621e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
10631e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
10641e191893SMarcel Holtmann 	__le16   min_interval;
10651e191893SMarcel Holtmann 	__le16   max_interval;
10661e191893SMarcel Holtmann 	__u8     type;
10671e191893SMarcel Holtmann 	__u8     own_address_type;
10681e191893SMarcel Holtmann 	__u8     direct_addr_type;
10691e191893SMarcel Holtmann 	bdaddr_t direct_addr;
10701e191893SMarcel Holtmann 	__u8     channel_map;
10711e191893SMarcel Holtmann 	__u8     filter_policy;
10721e191893SMarcel Holtmann } __packed;
10731e191893SMarcel Holtmann 
10748fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
10758fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
10768fa19098SJohan Hedberg 	__u8	status;
10778fa19098SJohan Hedberg 	__s8	tx_power;
10788fa19098SJohan Hedberg } __packed;
10798fa19098SJohan Hedberg 
10803f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
10813f0f524bSJohan Hedberg 
10823f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
10833f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
10843f0f524bSJohan Hedberg 	__u8	length;
10853f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
10863f0f524bSJohan Hedberg } __packed;
10873f0f524bSJohan Hedberg 
1088c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1089c1d5dc4aSJohan Hedberg 
10905df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
10915df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
10925df480b5SAndre Guedes 
109307f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
109407f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
109507f7fa5dSAndre Guedes 	__u8    type;
109607f7fa5dSAndre Guedes 	__le16  interval;
109707f7fa5dSAndre Guedes 	__le16  window;
109807f7fa5dSAndre Guedes 	__u8    own_address_type;
109907f7fa5dSAndre Guedes 	__u8    filter_policy;
110007f7fa5dSAndre Guedes } __packed;
110107f7fa5dSAndre Guedes 
110276a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
110376a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1104525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1105525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
110668a8aea4SAndrei Emeltchenko 
1107eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1108eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1109eb9d91f5SAndre Guedes 	__u8     enable;
1110eb9d91f5SAndre Guedes 	__u8     filter_dup;
1111eb9d91f5SAndre Guedes } __packed;
1112eb9d91f5SAndre Guedes 
111363185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
111463185f64SVille Tervo struct hci_cp_le_create_conn {
111563185f64SVille Tervo 	__le16   scan_interval;
111663185f64SVille Tervo 	__le16   scan_window;
111763185f64SVille Tervo 	__u8     filter_policy;
111863185f64SVille Tervo 	__u8     peer_addr_type;
111963185f64SVille Tervo 	bdaddr_t peer_addr;
112063185f64SVille Tervo 	__u8     own_address_type;
112163185f64SVille Tervo 	__le16   conn_interval_min;
112263185f64SVille Tervo 	__le16   conn_interval_max;
112363185f64SVille Tervo 	__le16   conn_latency;
112463185f64SVille Tervo 	__le16   supervision_timeout;
112563185f64SVille Tervo 	__le16   min_ce_len;
112663185f64SVille Tervo 	__le16   max_ce_len;
112763185f64SVille Tervo } __packed;
112863185f64SVille Tervo 
112963185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
113063185f64SVille Tervo 
1131cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1132cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1133cf1d081fSJohan Hedberg 	__u8	status;
1134cf1d081fSJohan Hedberg 	__u8	size;
1135cf1d081fSJohan Hedberg } __packed;
1136cf1d081fSJohan Hedberg 
11372ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
11382ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
11392ce603ebSClaudio Takahasi 	__le16   handle;
11402ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
11412ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
11422ce603ebSClaudio Takahasi 	__le16   conn_latency;
11432ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
11442ce603ebSClaudio Takahasi 	__le16   min_ce_len;
11452ce603ebSClaudio Takahasi 	__le16   max_ce_len;
11462ce603ebSClaudio Takahasi } __packed;
11472ce603ebSClaudio Takahasi 
1148a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1149a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1150a7a595f6SVinicius Costa Gomes 	__le16	handle;
1151a7a595f6SVinicius Costa Gomes 	__u8	rand[8];
1152a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1153a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1154a7a595f6SVinicius Costa Gomes } __packed;
1155a7a595f6SVinicius Costa Gomes 
1156a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1157a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1158a7a595f6SVinicius Costa Gomes 	__le16	handle;
1159a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1160a7a595f6SVinicius Costa Gomes } __packed;
1161a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1162a7a595f6SVinicius Costa Gomes 	__u8	status;
1163a7a595f6SVinicius Costa Gomes 	__le16	handle;
1164a7a595f6SVinicius Costa Gomes } __packed;
1165a7a595f6SVinicius Costa Gomes 
1166a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1167a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1168a7a595f6SVinicius Costa Gomes 	__le16	handle;
1169a7a595f6SVinicius Costa Gomes } __packed;
1170a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1171a7a595f6SVinicius Costa Gomes 	__u8	status;
1172a7a595f6SVinicius Costa Gomes 	__le16	handle;
1173a7a595f6SVinicius Costa Gomes } __packed;
1174a7a595f6SVinicius Costa Gomes 
11759b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
11769b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
11779b008c04SJohan Hedberg 	__u8	status;
11789b008c04SJohan Hedberg 	__u8	le_states[8];
11799b008c04SJohan Hedberg } __packed;
11809b008c04SJohan Hedberg 
11811da177e4SLinus Torvalds /* ---- HCI Events ---- */
11821da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
11831da177e4SLinus Torvalds 
11841da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
11851da177e4SLinus Torvalds struct inquiry_info {
11861da177e4SLinus Torvalds 	bdaddr_t bdaddr;
11871da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
11881da177e4SLinus Torvalds 	__u8     pscan_period_mode;
11891da177e4SLinus Torvalds 	__u8     pscan_mode;
11901da177e4SLinus Torvalds 	__u8     dev_class[3];
11911ebb9252SMarcel Holtmann 	__le16   clock_offset;
119266c853ccSGustavo F. Padovan } __packed;
11931da177e4SLinus Torvalds 
11941da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
11951da177e4SLinus Torvalds struct hci_ev_conn_complete {
11961da177e4SLinus Torvalds 	__u8     status;
11971ebb9252SMarcel Holtmann 	__le16   handle;
11981da177e4SLinus Torvalds 	bdaddr_t bdaddr;
11991da177e4SLinus Torvalds 	__u8     link_type;
12001da177e4SLinus Torvalds 	__u8     encr_mode;
120166c853ccSGustavo F. Padovan } __packed;
12021da177e4SLinus Torvalds 
12031da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
12041da177e4SLinus Torvalds struct hci_ev_conn_request {
12051da177e4SLinus Torvalds 	bdaddr_t bdaddr;
12061da177e4SLinus Torvalds 	__u8     dev_class[3];
12071da177e4SLinus Torvalds 	__u8     link_type;
120866c853ccSGustavo F. Padovan } __packed;
12091da177e4SLinus Torvalds 
12101da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
12111da177e4SLinus Torvalds struct hci_ev_disconn_complete {
12121da177e4SLinus Torvalds 	__u8     status;
12131ebb9252SMarcel Holtmann 	__le16   handle;
12141da177e4SLinus Torvalds 	__u8     reason;
121566c853ccSGustavo F. Padovan } __packed;
12161da177e4SLinus Torvalds 
12171da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
12181da177e4SLinus Torvalds struct hci_ev_auth_complete {
12191da177e4SLinus Torvalds 	__u8     status;
12201ebb9252SMarcel Holtmann 	__le16   handle;
122166c853ccSGustavo F. Padovan } __packed;
12221da177e4SLinus Torvalds 
1223a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1224a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1225a9de9248SMarcel Holtmann 	__u8     status;
1226a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
12271f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
122866c853ccSGustavo F. Padovan } __packed;
1229a9de9248SMarcel Holtmann 
12301da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
12311da177e4SLinus Torvalds struct hci_ev_encrypt_change {
12321da177e4SLinus Torvalds 	__u8     status;
12331ebb9252SMarcel Holtmann 	__le16   handle;
12341da177e4SLinus Torvalds 	__u8     encrypt;
123566c853ccSGustavo F. Padovan } __packed;
12361da177e4SLinus Torvalds 
1237a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1238a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
12391da177e4SLinus Torvalds 	__u8     status;
12401ebb9252SMarcel Holtmann 	__le16   handle;
124166c853ccSGustavo F. Padovan } __packed;
12421da177e4SLinus Torvalds 
1243a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1244a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1245a9de9248SMarcel Holtmann 	__u8     status;
1246a9de9248SMarcel Holtmann 	__le16   handle;
1247a9de9248SMarcel Holtmann 	__u8     features[8];
124866c853ccSGustavo F. Padovan } __packed;
1249a9de9248SMarcel Holtmann 
1250a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1251a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1252a9de9248SMarcel Holtmann 	__u8     status;
1253a9de9248SMarcel Holtmann 	__le16   handle;
1254a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1255a9de9248SMarcel Holtmann 	__le16   manufacturer;
1256a9de9248SMarcel Holtmann 	__le16   lmp_subver;
125766c853ccSGustavo F. Padovan } __packed;
1258a9de9248SMarcel Holtmann 
1259a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
12601da177e4SLinus Torvalds struct hci_qos {
12611da177e4SLinus Torvalds 	__u8     service_type;
12621da177e4SLinus Torvalds 	__u32    token_rate;
12631da177e4SLinus Torvalds 	__u32    peak_bandwidth;
12641da177e4SLinus Torvalds 	__u32    latency;
12651da177e4SLinus Torvalds 	__u32    delay_variation;
126666c853ccSGustavo F. Padovan } __packed;
12671da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
12681da177e4SLinus Torvalds 	__u8     status;
12691ebb9252SMarcel Holtmann 	__le16   handle;
12701da177e4SLinus Torvalds 	struct   hci_qos qos;
127166c853ccSGustavo F. Padovan } __packed;
12721da177e4SLinus Torvalds 
1273a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
12741da177e4SLinus Torvalds struct hci_ev_cmd_complete {
12751da177e4SLinus Torvalds 	__u8     ncmd;
12761ebb9252SMarcel Holtmann 	__le16   opcode;
127766c853ccSGustavo F. Padovan } __packed;
12781da177e4SLinus Torvalds 
1279a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
12801da177e4SLinus Torvalds struct hci_ev_cmd_status {
12811da177e4SLinus Torvalds 	__u8     status;
12821da177e4SLinus Torvalds 	__u8     ncmd;
12831ebb9252SMarcel Holtmann 	__le16   opcode;
128466c853ccSGustavo F. Padovan } __packed;
12851da177e4SLinus Torvalds 
12861da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
12871da177e4SLinus Torvalds struct hci_ev_role_change {
12881da177e4SLinus Torvalds 	__u8     status;
12891da177e4SLinus Torvalds 	bdaddr_t bdaddr;
12901da177e4SLinus Torvalds 	__u8     role;
129166c853ccSGustavo F. Padovan } __packed;
12921da177e4SLinus Torvalds 
1293a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1294613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1295613a1c0cSAndrei Emeltchenko 	__le16   handle;
1296613a1c0cSAndrei Emeltchenko 	__le16   count;
1297613a1c0cSAndrei Emeltchenko } __packed;
1298613a1c0cSAndrei Emeltchenko 
1299a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1300a9de9248SMarcel Holtmann 	__u8     num_hndl;
1301613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
130266c853ccSGustavo F. Padovan } __packed;
1303a9de9248SMarcel Holtmann 
13041da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
13051da177e4SLinus Torvalds struct hci_ev_mode_change {
13061da177e4SLinus Torvalds 	__u8     status;
13071ebb9252SMarcel Holtmann 	__le16   handle;
13081da177e4SLinus Torvalds 	__u8     mode;
13091ebb9252SMarcel Holtmann 	__le16   interval;
131066c853ccSGustavo F. Padovan } __packed;
13111da177e4SLinus Torvalds 
13121da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
13131da177e4SLinus Torvalds struct hci_ev_pin_code_req {
13141da177e4SLinus Torvalds 	bdaddr_t bdaddr;
131566c853ccSGustavo F. Padovan } __packed;
13161da177e4SLinus Torvalds 
13171da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
13181da177e4SLinus Torvalds struct hci_ev_link_key_req {
13191da177e4SLinus Torvalds 	bdaddr_t bdaddr;
132066c853ccSGustavo F. Padovan } __packed;
13211da177e4SLinus Torvalds 
13221da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
13231da177e4SLinus Torvalds struct hci_ev_link_key_notify {
13241da177e4SLinus Torvalds 	bdaddr_t bdaddr;
13259b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
13261da177e4SLinus Torvalds 	__u8     key_type;
132766c853ccSGustavo F. Padovan } __packed;
13281da177e4SLinus Torvalds 
1329a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
13301da177e4SLinus Torvalds struct hci_ev_clock_offset {
13311da177e4SLinus Torvalds 	__u8     status;
13321ebb9252SMarcel Holtmann 	__le16   handle;
13331ebb9252SMarcel Holtmann 	__le16   clock_offset;
133466c853ccSGustavo F. Padovan } __packed;
13351da177e4SLinus Torvalds 
1336a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1337a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1338a8746417SMarcel Holtmann 	__u8     status;
1339a8746417SMarcel Holtmann 	__le16   handle;
1340a8746417SMarcel Holtmann 	__le16   pkt_type;
134166c853ccSGustavo F. Padovan } __packed;
1342a8746417SMarcel Holtmann 
134385a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
134485a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
134585a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
134685a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
134766c853ccSGustavo F. Padovan } __packed;
134885a1e930SMarcel Holtmann 
1349a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1350a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1351a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1352a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1353a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1354a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1355a9de9248SMarcel Holtmann 	__le16   clock_offset;
1356a9de9248SMarcel Holtmann 	__s8     rssi;
135766c853ccSGustavo F. Padovan } __packed;
1358a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1359a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1360a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1361a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1362a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1363a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1364a9de9248SMarcel Holtmann 	__le16   clock_offset;
1365a9de9248SMarcel Holtmann 	__s8     rssi;
136666c853ccSGustavo F. Padovan } __packed;
1367a9de9248SMarcel Holtmann 
1368a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1369a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1370a9de9248SMarcel Holtmann 	__u8     status;
1371a9de9248SMarcel Holtmann 	__le16   handle;
1372a9de9248SMarcel Holtmann 	__u8     page;
1373a9de9248SMarcel Holtmann 	__u8     max_page;
1374a9de9248SMarcel Holtmann 	__u8     features[8];
137566c853ccSGustavo F. Padovan } __packed;
1376a9de9248SMarcel Holtmann 
1377a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1378a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1379a9de9248SMarcel Holtmann 	__u8     status;
1380a9de9248SMarcel Holtmann 	__le16   handle;
1381a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1382a9de9248SMarcel Holtmann 	__u8     link_type;
1383a9de9248SMarcel Holtmann 	__u8     tx_interval;
1384a9de9248SMarcel Holtmann 	__u8     retrans_window;
1385a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1386a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1387a9de9248SMarcel Holtmann 	__u8     air_mode;
138866c853ccSGustavo F. Padovan } __packed;
1389a9de9248SMarcel Holtmann 
1390a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1391a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1392a9de9248SMarcel Holtmann 	__u8     status;
1393a9de9248SMarcel Holtmann 	__le16   handle;
1394a9de9248SMarcel Holtmann 	__u8     tx_interval;
1395a9de9248SMarcel Holtmann 	__u8     retrans_window;
1396a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1397a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
139866c853ccSGustavo F. Padovan } __packed;
1399a9de9248SMarcel Holtmann 
1400a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
140104837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
140204837f64SMarcel Holtmann 	__u8     status;
140304837f64SMarcel Holtmann 	__le16   handle;
140404837f64SMarcel Holtmann 	__le16   max_tx_latency;
140504837f64SMarcel Holtmann 	__le16   max_rx_latency;
140604837f64SMarcel Holtmann 	__le16   max_remote_timeout;
140704837f64SMarcel Holtmann 	__le16   max_local_timeout;
140866c853ccSGustavo F. Padovan } __packed;
140904837f64SMarcel Holtmann 
1410a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1411a9de9248SMarcel Holtmann struct extended_inquiry_info {
1412a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1413a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1414a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1415a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1416a9de9248SMarcel Holtmann 	__le16   clock_offset;
1417a9de9248SMarcel Holtmann 	__s8     rssi;
1418a9de9248SMarcel Holtmann 	__u8     data[240];
141966c853ccSGustavo F. Padovan } __packed;
1420a9de9248SMarcel Holtmann 
14211c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
14221c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
14231c2e0041SJohan Hedberg 	__u8	status;
14241c2e0041SJohan Hedberg 	__le16	handle;
14251c2e0041SJohan Hedberg } __packed;
14261c2e0041SJohan Hedberg 
14270493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
14280493684eSMarcel Holtmann struct hci_ev_io_capa_request {
14290493684eSMarcel Holtmann 	bdaddr_t bdaddr;
143066c853ccSGustavo F. Padovan } __packed;
14310493684eSMarcel Holtmann 
143203b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
143303b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
143403b555e1SJohan Hedberg 	bdaddr_t bdaddr;
143503b555e1SJohan Hedberg 	__u8     capability;
143603b555e1SJohan Hedberg 	__u8     oob_data;
143703b555e1SJohan Hedberg 	__u8     authentication;
143803b555e1SJohan Hedberg } __packed;
143903b555e1SJohan Hedberg 
1440a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1441a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1442a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1443a5c29683SJohan Hedberg 	__le32		passkey;
1444a5c29683SJohan Hedberg } __packed;
1445a5c29683SJohan Hedberg 
14469ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
14479ad4019aSBrian Gix struct hci_ev_user_passkey_req {
14489ad4019aSBrian Gix 	bdaddr_t	bdaddr;
14499ad4019aSBrian Gix } __packed;
14509ad4019aSBrian Gix 
14512763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
14522763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
14532763eda6SSzymon Janc 	bdaddr_t bdaddr;
14542763eda6SSzymon Janc } __packed;
14552763eda6SSzymon Janc 
14560493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
14570493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
14580493684eSMarcel Holtmann 	__u8     status;
14590493684eSMarcel Holtmann 	bdaddr_t bdaddr;
146066c853ccSGustavo F. Padovan } __packed;
14610493684eSMarcel Holtmann 
146292a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
146392a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
146492a25256SJohan Hedberg 	bdaddr_t	bdaddr;
146592a25256SJohan Hedberg 	__le32		passkey;
146692a25256SJohan Hedberg } __packed;
146792a25256SJohan Hedberg 
146892a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
146992a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
147092a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
147192a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
147292a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
147392a25256SJohan Hedberg 
147492a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
147592a25256SJohan Hedberg struct hci_ev_keypress_notify {
147692a25256SJohan Hedberg 	bdaddr_t	bdaddr;
147792a25256SJohan Hedberg 	__u8		type;
147892a25256SJohan Hedberg } __packed;
147992a25256SJohan Hedberg 
148041a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
148141a96212SMarcel Holtmann struct hci_ev_remote_host_features {
148241a96212SMarcel Holtmann 	bdaddr_t bdaddr;
148341a96212SMarcel Holtmann 	__u8     features[8];
148466c853ccSGustavo F. Padovan } __packed;
148541a96212SMarcel Holtmann 
148663185f64SVille Tervo #define HCI_EV_LE_META			0x3e
148763185f64SVille Tervo struct hci_ev_le_meta {
148863185f64SVille Tervo 	__u8     subevent;
148963185f64SVille Tervo } __packed;
149063185f64SVille Tervo 
1491523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
1492523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
1493523e93cdSAndrei Emeltchenko 	__u8     status;
1494523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1495523e93cdSAndrei Emeltchenko } __packed;
1496523e93cdSAndrei Emeltchenko 
1497523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
1498523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
1499523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1500523e93cdSAndrei Emeltchenko } __packed;
1501523e93cdSAndrei Emeltchenko 
1502523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
1503523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
1504523e93cdSAndrei Emeltchenko 	__u8     status;
1505523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1506523e93cdSAndrei Emeltchenko 	__u8     reason;
1507523e93cdSAndrei Emeltchenko } __packed;
1508523e93cdSAndrei Emeltchenko 
1509523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
1510523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
1511523e93cdSAndrei Emeltchenko 	__u8     status;
1512523e93cdSAndrei Emeltchenko 	__le16   handle;
1513523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1514523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
1515523e93cdSAndrei Emeltchenko } __packed;
1516523e93cdSAndrei Emeltchenko 
1517523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
1518523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
1519523e93cdSAndrei Emeltchenko 	__u8     status;
1520523e93cdSAndrei Emeltchenko 	__le16   handle;
1521523e93cdSAndrei Emeltchenko 	__u8     reason;
1522523e93cdSAndrei Emeltchenko } __packed;
1523523e93cdSAndrei Emeltchenko 
152425e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
152525e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
152625e89e99SAndrei Emeltchenko 	__le16   handle;
152725e89e99SAndrei Emeltchenko 	__le16   pkts;
152825e89e99SAndrei Emeltchenko 	__le16   blocks;
152925e89e99SAndrei Emeltchenko } __packed;
153025e89e99SAndrei Emeltchenko 
153125e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
153225e89e99SAndrei Emeltchenko 	__le16   num_blocks;
153325e89e99SAndrei Emeltchenko 	__u8     num_hndl;
153425e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
153525e89e99SAndrei Emeltchenko } __packed;
153625e89e99SAndrei Emeltchenko 
15372b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
15382b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
15392b359445SDoHyun Pyun 	__u8	status;
15402b359445SDoHyun Pyun } __packed;
15412b359445SDoHyun Pyun 
15422ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
15432ed01805SDoHyun Pyun 
154463185f64SVille Tervo /* Low energy meta events */
1545b9b343d2SAndre Guedes #define LE_CONN_ROLE_MASTER	0x00
1546b9b343d2SAndre Guedes 
154763185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
154863185f64SVille Tervo struct hci_ev_le_conn_complete {
154963185f64SVille Tervo 	__u8     status;
155063185f64SVille Tervo 	__le16   handle;
155163185f64SVille Tervo 	__u8     role;
155263185f64SVille Tervo 	__u8     bdaddr_type;
155363185f64SVille Tervo 	bdaddr_t bdaddr;
155463185f64SVille Tervo 	__le16   interval;
155563185f64SVille Tervo 	__le16   latency;
155663185f64SVille Tervo 	__le16   supervision_timeout;
155763185f64SVille Tervo 	__u8     clk_accurancy;
155863185f64SVille Tervo } __packed;
155963185f64SVille Tervo 
1560a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1561a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1562a7a595f6SVinicius Costa Gomes 	__le16	handle;
1563a7a595f6SVinicius Costa Gomes 	__u8	random[8];
1564a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1565a7a595f6SVinicius Costa Gomes } __packed;
1566a7a595f6SVinicius Costa Gomes 
156757a56fd4SAnderson Briglia /* Advertising report event types */
156857a56fd4SAnderson Briglia #define ADV_IND		0x00
156957a56fd4SAnderson Briglia #define ADV_DIRECT_IND	0x01
157057a56fd4SAnderson Briglia #define ADV_SCAN_IND	0x02
157157a56fd4SAnderson Briglia #define ADV_NONCONN_IND	0x03
157257a56fd4SAnderson Briglia #define ADV_SCAN_RSP	0x04
157357a56fd4SAnderson Briglia 
157457a56fd4SAnderson Briglia #define ADDR_LE_DEV_PUBLIC	0x00
157557a56fd4SAnderson Briglia #define ADDR_LE_DEV_RANDOM	0x01
157657a56fd4SAnderson Briglia 
157757a56fd4SAnderson Briglia #define HCI_EV_LE_ADVERTISING_REPORT	0x02
157857a56fd4SAnderson Briglia struct hci_ev_le_advertising_info {
157957a56fd4SAnderson Briglia 	__u8	 evt_type;
158057a56fd4SAnderson Briglia 	__u8	 bdaddr_type;
158157a56fd4SAnderson Briglia 	bdaddr_t bdaddr;
158257a56fd4SAnderson Briglia 	__u8	 length;
158357a56fd4SAnderson Briglia 	__u8	 data[0];
158457a56fd4SAnderson Briglia } __packed;
158557a56fd4SAnderson Briglia 
15861da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1587a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
15881da177e4SLinus Torvalds struct hci_ev_stack_internal {
15891da177e4SLinus Torvalds 	__u16    type;
15901da177e4SLinus Torvalds 	__u8     data[0];
159166c853ccSGustavo F. Padovan } __packed;
15921da177e4SLinus Torvalds 
15931da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
15941da177e4SLinus Torvalds struct hci_ev_si_device {
15951da177e4SLinus Torvalds 	__u16    event;
15961da177e4SLinus Torvalds 	__u16    dev_id;
159766c853ccSGustavo F. Padovan } __packed;
15981da177e4SLinus Torvalds 
15991da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
16001da177e4SLinus Torvalds struct hci_ev_si_security {
16011da177e4SLinus Torvalds 	__u16    event;
16021da177e4SLinus Torvalds 	__u16    proto;
16031da177e4SLinus Torvalds 	__u16    subproto;
16041da177e4SLinus Torvalds 	__u8     incoming;
160566c853ccSGustavo F. Padovan } __packed;
16061da177e4SLinus Torvalds 
16071da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
16081da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
16091da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
16101da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
16111da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
16121da177e4SLinus Torvalds 
16131da177e4SLinus Torvalds struct hci_command_hdr {
16141ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
16151da177e4SLinus Torvalds 	__u8	plen;
161666c853ccSGustavo F. Padovan } __packed;
16171da177e4SLinus Torvalds 
16181da177e4SLinus Torvalds struct hci_event_hdr {
16191da177e4SLinus Torvalds 	__u8	evt;
16201da177e4SLinus Torvalds 	__u8	plen;
162166c853ccSGustavo F. Padovan } __packed;
16221da177e4SLinus Torvalds 
16231da177e4SLinus Torvalds struct hci_acl_hdr {
16241ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
16251ebb9252SMarcel Holtmann 	__le16	dlen;
162666c853ccSGustavo F. Padovan } __packed;
16271da177e4SLinus Torvalds 
16281da177e4SLinus Torvalds struct hci_sco_hdr {
16291ebb9252SMarcel Holtmann 	__le16	handle;
16301da177e4SLinus Torvalds 	__u8	dlen;
163166c853ccSGustavo F. Padovan } __packed;
16321da177e4SLinus Torvalds 
16332a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
16342a123b86SArnaldo Carvalho de Melo {
16352a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
16362a123b86SArnaldo Carvalho de Melo }
16372a123b86SArnaldo Carvalho de Melo 
16382a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
16392a123b86SArnaldo Carvalho de Melo {
16402a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
16412a123b86SArnaldo Carvalho de Melo }
16422a123b86SArnaldo Carvalho de Melo 
16432a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
16442a123b86SArnaldo Carvalho de Melo {
16452a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
16462a123b86SArnaldo Carvalho de Melo }
16472a123b86SArnaldo Carvalho de Melo 
16481da177e4SLinus Torvalds /* Command opcode pack/unpack */
1649c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
16501da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
16511da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
16521da177e4SLinus Torvalds 
16531da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
1654c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
16551da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
16561da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
16571da177e4SLinus Torvalds 
16581da177e4SLinus Torvalds /* ---- HCI Sockets ---- */
16591da177e4SLinus Torvalds 
16601da177e4SLinus Torvalds /* Socket options */
16611da177e4SLinus Torvalds #define HCI_DATA_DIR	1
16621da177e4SLinus Torvalds #define HCI_FILTER	2
16631da177e4SLinus Torvalds #define HCI_TIME_STAMP	3
16641da177e4SLinus Torvalds 
16651da177e4SLinus Torvalds /* CMSG flags */
16661da177e4SLinus Torvalds #define HCI_CMSG_DIR	0x0001
16671da177e4SLinus Torvalds #define HCI_CMSG_TSTAMP	0x0002
16681da177e4SLinus Torvalds 
16691da177e4SLinus Torvalds struct sockaddr_hci {
16701da177e4SLinus Torvalds 	sa_family_t    hci_family;
16711da177e4SLinus Torvalds 	unsigned short hci_dev;
1672c02178d2SJohan Hedberg 	unsigned short hci_channel;
16731da177e4SLinus Torvalds };
16741da177e4SLinus Torvalds #define HCI_DEV_NONE	0xffff
16751da177e4SLinus Torvalds 
1676c02178d2SJohan Hedberg #define HCI_CHANNEL_RAW		0
167723500189SMarcel Holtmann #define HCI_CHANNEL_USER	1
1678cd82e61cSMarcel Holtmann #define HCI_CHANNEL_MONITOR	2
167966f3b913SGustavo Padovan #define HCI_CHANNEL_CONTROL	3
1680c02178d2SJohan Hedberg 
16811da177e4SLinus Torvalds struct hci_filter {
16821da177e4SLinus Torvalds 	unsigned long type_mask;
16831da177e4SLinus Torvalds 	unsigned long event_mask[2];
1684905f3ed6SAl Viro 	__le16 opcode;
16851da177e4SLinus Torvalds };
16861da177e4SLinus Torvalds 
16871da177e4SLinus Torvalds struct hci_ufilter {
16881da177e4SLinus Torvalds 	__u32  type_mask;
16891da177e4SLinus Torvalds 	__u32  event_mask[2];
1690905f3ed6SAl Viro 	__le16 opcode;
16911da177e4SLinus Torvalds };
16921da177e4SLinus Torvalds 
16931da177e4SLinus Torvalds #define HCI_FLT_TYPE_BITS	31
16941da177e4SLinus Torvalds #define HCI_FLT_EVENT_BITS	63
16951da177e4SLinus Torvalds #define HCI_FLT_OGF_BITS	63
16961da177e4SLinus Torvalds #define HCI_FLT_OCF_BITS	127
16971da177e4SLinus Torvalds 
16981da177e4SLinus Torvalds /* ---- HCI Ioctl requests structures ---- */
16991da177e4SLinus Torvalds struct hci_dev_stats {
17001da177e4SLinus Torvalds 	__u32 err_rx;
17011da177e4SLinus Torvalds 	__u32 err_tx;
17021da177e4SLinus Torvalds 	__u32 cmd_tx;
17031da177e4SLinus Torvalds 	__u32 evt_rx;
17041da177e4SLinus Torvalds 	__u32 acl_tx;
17051da177e4SLinus Torvalds 	__u32 acl_rx;
17061da177e4SLinus Torvalds 	__u32 sco_tx;
17071da177e4SLinus Torvalds 	__u32 sco_rx;
17081da177e4SLinus Torvalds 	__u32 byte_rx;
17091da177e4SLinus Torvalds 	__u32 byte_tx;
17101da177e4SLinus Torvalds };
17111da177e4SLinus Torvalds 
17121da177e4SLinus Torvalds struct hci_dev_info {
17131da177e4SLinus Torvalds 	__u16 dev_id;
17141da177e4SLinus Torvalds 	char  name[8];
17151da177e4SLinus Torvalds 
17161da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17171da177e4SLinus Torvalds 
17181da177e4SLinus Torvalds 	__u32 flags;
17191da177e4SLinus Torvalds 	__u8  type;
17201da177e4SLinus Torvalds 
17211da177e4SLinus Torvalds 	__u8  features[8];
17221da177e4SLinus Torvalds 
17231da177e4SLinus Torvalds 	__u32 pkt_type;
17241da177e4SLinus Torvalds 	__u32 link_policy;
17251da177e4SLinus Torvalds 	__u32 link_mode;
17261da177e4SLinus Torvalds 
17271da177e4SLinus Torvalds 	__u16 acl_mtu;
17281da177e4SLinus Torvalds 	__u16 acl_pkts;
17291da177e4SLinus Torvalds 	__u16 sco_mtu;
17301da177e4SLinus Torvalds 	__u16 sco_pkts;
17311da177e4SLinus Torvalds 
17321da177e4SLinus Torvalds 	struct hci_dev_stats stat;
17331da177e4SLinus Torvalds };
17341da177e4SLinus Torvalds 
17351da177e4SLinus Torvalds struct hci_conn_info {
17361da177e4SLinus Torvalds 	__u16    handle;
17371da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17381da177e4SLinus Torvalds 	__u8     type;
17391da177e4SLinus Torvalds 	__u8     out;
17401da177e4SLinus Torvalds 	__u16    state;
17411da177e4SLinus Torvalds 	__u32    link_mode;
17421da177e4SLinus Torvalds };
17431da177e4SLinus Torvalds 
17441da177e4SLinus Torvalds struct hci_dev_req {
17451da177e4SLinus Torvalds 	__u16  dev_id;
17461da177e4SLinus Torvalds 	__u32  dev_opt;
17471da177e4SLinus Torvalds };
17481da177e4SLinus Torvalds 
17491da177e4SLinus Torvalds struct hci_dev_list_req {
17501da177e4SLinus Torvalds 	__u16  dev_num;
17511da177e4SLinus Torvalds 	struct hci_dev_req dev_req[0];	/* hci_dev_req structures */
17521da177e4SLinus Torvalds };
17531da177e4SLinus Torvalds 
17541da177e4SLinus Torvalds struct hci_conn_list_req {
17551da177e4SLinus Torvalds 	__u16  dev_id;
17561da177e4SLinus Torvalds 	__u16  conn_num;
17571da177e4SLinus Torvalds 	struct hci_conn_info conn_info[0];
17581da177e4SLinus Torvalds };
17591da177e4SLinus Torvalds 
17601da177e4SLinus Torvalds struct hci_conn_info_req {
17611da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17621da177e4SLinus Torvalds 	__u8     type;
17631da177e4SLinus Torvalds 	struct   hci_conn_info conn_info[0];
17641da177e4SLinus Torvalds };
17651da177e4SLinus Torvalds 
176640be492fSMarcel Holtmann struct hci_auth_info_req {
176740be492fSMarcel Holtmann 	bdaddr_t bdaddr;
176840be492fSMarcel Holtmann 	__u8     type;
176940be492fSMarcel Holtmann };
177040be492fSMarcel Holtmann 
17711da177e4SLinus Torvalds struct hci_inquiry_req {
17721da177e4SLinus Torvalds 	__u16 dev_id;
17731da177e4SLinus Torvalds 	__u16 flags;
17741da177e4SLinus Torvalds 	__u8  lap[3];
17751da177e4SLinus Torvalds 	__u8  length;
17761da177e4SLinus Torvalds 	__u8  num_rsp;
17771da177e4SLinus Torvalds };
17781da177e4SLinus Torvalds #define IREQ_CACHE_FLUSH 0x0001
17791da177e4SLinus Torvalds 
17808b281b9cSFabio Estevam extern bool enable_hs;
17818830f514SAndrei Emeltchenko 
17821da177e4SLinus Torvalds #endif /* __HCI_H */
1783