xref: /openbmc/linux/include/net/bluetooth/hci.h (revision 7528ca1c5a3821951695e0e55daf192097a9925a)
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 
818d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
819d5859e22SJohan Hedberg 
82080a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
82180a1e1dbSJohan Hedberg 
82280a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
82380a1e1dbSJohan Hedberg struct hci_cp_write_eir {
824816a11d5SJohan Hedberg 	__u8	fec;
825816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
82680a1e1dbSJohan Hedberg } __packed;
82780a1e1dbSJohan Hedberg 
828333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
829333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
830333140b5SMarcel Holtmann 	__u8     status;
831333140b5SMarcel Holtmann 	__u8     mode;
83266c853ccSGustavo F. Padovan } __packed;
833333140b5SMarcel Holtmann 
834333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
835333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
836333140b5SMarcel Holtmann 	__u8     mode;
83766c853ccSGustavo F. Padovan } __packed;
838333140b5SMarcel Holtmann 
839c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
840c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
841c35938b2SSzymon Janc 	__u8     status;
842c35938b2SSzymon Janc 	__u8     hash[16];
843c35938b2SSzymon Janc 	__u8     randomizer[16];
844c35938b2SSzymon Janc } __packed;
845c35938b2SSzymon Janc 
846d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
84791c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
84891c4e9b1SMarcel Holtmann 	__u8     status;
84991c4e9b1SMarcel Holtmann 	__s8     tx_power;
85091c4e9b1SMarcel Holtmann } __packed;
851d5859e22SJohan Hedberg 
852d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
853d62e6d67SJohan Hedberg 
854*7528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
855*7528ca1cSMarcel Holtmann 
8561e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
8571e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
8581e89cffbSAndrei Emeltchenko 	__u8     status;
8591e89cffbSAndrei Emeltchenko 	__u8     mode;
8601e89cffbSAndrei Emeltchenko } __packed;
8611e89cffbSAndrei Emeltchenko 
862f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
863f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
864f9b49306SAndre Guedes 	__u8	le;
865f9b49306SAndre Guedes 	__u8	simul;
866f9b49306SAndre Guedes } __packed;
867f9b49306SAndre Guedes 
868d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
869d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
870d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
871d0bf75a5SDoHyun Pyun } __packed;
872d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
873d0bf75a5SDoHyun Pyun 	__u8	status;
874d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
875d0bf75a5SDoHyun Pyun } __packed;
876d0bf75a5SDoHyun Pyun 
8776a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
8786a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
8796a20eaf4SDoHyun Pyun 	__u8	lt_addr;
8806a20eaf4SDoHyun Pyun } __packed;
8816a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
8826a20eaf4SDoHyun Pyun 	__u8	status;
8836a20eaf4SDoHyun Pyun 	__u8	lt_addr;
8846a20eaf4SDoHyun Pyun } __packed;
8856a20eaf4SDoHyun Pyun 
8867d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA		0x0c76
8877d1dab49SDoHyun Pyun struct hci_cp_set_csb_data {
8887d1dab49SDoHyun Pyun 	__u8	lt_addr;
8897d1dab49SDoHyun Pyun 	__u8	fragment;
8907d1dab49SDoHyun Pyun 	__u8	data_length;
8917d1dab49SDoHyun Pyun 	__u8	data[HCI_MAX_CSB_DATA_SIZE];
8927d1dab49SDoHyun Pyun } __packed;
8937d1dab49SDoHyun Pyun struct hci_rp_set_csb_data {
8947d1dab49SDoHyun Pyun 	__u8	status;
8957d1dab49SDoHyun Pyun 	__u8	lt_addr;
8967d1dab49SDoHyun Pyun } __packed;
8977d1dab49SDoHyun Pyun 
8985d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
8995d4e7e8dSJohan Hedberg 
900a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
901a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
902a9b07a64SDoHyun Pyun 	__le16	interval_min;
903a9b07a64SDoHyun Pyun 	__le16	interval_max;
904a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
905a9b07a64SDoHyun Pyun 	__u8	service_data;
906a9b07a64SDoHyun Pyun } __packed;
907a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
908a9b07a64SDoHyun Pyun 	__u8	status;
909a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
910a9b07a64SDoHyun Pyun } __packed;
911a9b07a64SDoHyun Pyun 
912a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
913a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
9141da177e4SLinus Torvalds 	__u8     status;
915a9de9248SMarcel Holtmann 	__u8     hci_ver;
916a9de9248SMarcel Holtmann 	__le16   hci_rev;
917a9de9248SMarcel Holtmann 	__u8     lmp_ver;
918a9de9248SMarcel Holtmann 	__le16   manufacturer;
919a9de9248SMarcel Holtmann 	__le16   lmp_subver;
92066c853ccSGustavo F. Padovan } __packed;
9211da177e4SLinus Torvalds 
922a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
923a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
9241da177e4SLinus Torvalds 	__u8     status;
925a9de9248SMarcel Holtmann 	__u8     commands[64];
92666c853ccSGustavo F. Padovan } __packed;
9271da177e4SLinus Torvalds 
928a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
929a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
930a9de9248SMarcel Holtmann 	__u8     status;
931a9de9248SMarcel Holtmann 	__u8     features[8];
93266c853ccSGustavo F. Padovan } __packed;
933a9de9248SMarcel Holtmann 
934a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
935971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
936971e3a4bSAndre Guedes 	__u8     page;
937971e3a4bSAndre Guedes } __packed;
938a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
939a9de9248SMarcel Holtmann 	__u8     status;
940a9de9248SMarcel Holtmann 	__u8     page;
941a9de9248SMarcel Holtmann 	__u8     max_page;
942a9de9248SMarcel Holtmann 	__u8     features[8];
94366c853ccSGustavo F. Padovan } __packed;
944a9de9248SMarcel Holtmann 
945a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
946a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
947a9de9248SMarcel Holtmann 	__u8     status;
948a9de9248SMarcel Holtmann 	__le16   acl_mtu;
949a9de9248SMarcel Holtmann 	__u8     sco_mtu;
950a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
951a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
95266c853ccSGustavo F. Padovan } __packed;
953a9de9248SMarcel Holtmann 
954a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
955a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
956a9de9248SMarcel Holtmann 	__u8     status;
9571da177e4SLinus Torvalds 	bdaddr_t bdaddr;
95866c853ccSGustavo F. Padovan } __packed;
9591da177e4SLinus Torvalds 
960350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
961350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
962350ee4cfSAndrei Emeltchenko 	__u8     status;
963350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
964350ee4cfSAndrei Emeltchenko 	__le16   block_len;
965350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
966350ee4cfSAndrei Emeltchenko } __packed;
967350ee4cfSAndrei Emeltchenko 
968f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
969f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
970f332ec66SJohan Hedberg 	__u8     status;
971f332ec66SJohan Hedberg 	__le16   interval;
972f332ec66SJohan Hedberg 	__le16   window;
973f332ec66SJohan Hedberg } __packed;
974f332ec66SJohan Hedberg 
975f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
976f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
977f6422ec6SAntti Julku 	__le16   interval;
978f6422ec6SAntti Julku 	__le16   window;
979f6422ec6SAntti Julku } __packed;
980f6422ec6SAntti Julku 
981f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
982f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
983f332ec66SJohan Hedberg 	__u8     status;
984f332ec66SJohan Hedberg 	__u8     type;
985f332ec66SJohan Hedberg } __packed;
986f332ec66SJohan Hedberg 
987f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
988f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
989f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
990f6422ec6SAntti Julku 
991928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
992928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
993928abaa7SAndrei Emeltchenko 	__u8     status;
994928abaa7SAndrei Emeltchenko 	__u8     amp_status;
995928abaa7SAndrei Emeltchenko 	__le32   total_bw;
996928abaa7SAndrei Emeltchenko 	__le32   max_bw;
997928abaa7SAndrei Emeltchenko 	__le32   min_latency;
998928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
999928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1000928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1001928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1002928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1003928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1004928abaa7SAndrei Emeltchenko } __packed;
1005928abaa7SAndrei Emeltchenko 
1006523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1007523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1008523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1009523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1010523e93cdSAndrei Emeltchenko 	__le16   max_len;
1011523e93cdSAndrei Emeltchenko } __packed;
1012523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1013523e93cdSAndrei Emeltchenko 	__u8     status;
1014523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1015523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1016523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1017523e93cdSAndrei Emeltchenko } __packed;
1018523e93cdSAndrei Emeltchenko 
1019523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1020523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1021523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1022523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1023523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1024523e93cdSAndrei Emeltchenko 	__u8     frag[0];
1025523e93cdSAndrei Emeltchenko } __packed;
1026523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1027523e93cdSAndrei Emeltchenko 	__u8     status;
1028523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1029523e93cdSAndrei Emeltchenko } __packed;
1030523e93cdSAndrei Emeltchenko 
103163185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
103263185f64SVille Tervo struct hci_cp_le_set_event_mask {
103363185f64SVille Tervo 	__u8     mask[8];
103463185f64SVille Tervo } __packed;
103563185f64SVille Tervo 
103663185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
103763185f64SVille Tervo struct hci_rp_le_read_buffer_size {
103863185f64SVille Tervo 	__u8     status;
103963185f64SVille Tervo 	__le16   le_mtu;
104063185f64SVille Tervo 	__u8     le_max_pkt;
104163185f64SVille Tervo } __packed;
104263185f64SVille Tervo 
104360e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
104460e77321SJohan Hedberg struct hci_rp_le_read_local_features {
104560e77321SJohan Hedberg 	__u8     status;
104660e77321SJohan Hedberg 	__u8     features[8];
104760e77321SJohan Hedberg } __packed;
104860e77321SJohan Hedberg 
1049d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1050d13eafceSMarcel Holtmann 
1051c2f5ebd2SMarcel Holtmann #define LE_ADV_IND			0x00
1052c2f5ebd2SMarcel Holtmann #define LE_ADV_DIRECT_IND		0x01
1053c2f5ebd2SMarcel Holtmann #define LE_ADV_SCAN_IND			0x02
1054c2f5ebd2SMarcel Holtmann #define LE_ADV_NONCONN_IND		0x03
1055c2f5ebd2SMarcel Holtmann 
10561e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
10571e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
10581e191893SMarcel Holtmann 	__le16   min_interval;
10591e191893SMarcel Holtmann 	__le16   max_interval;
10601e191893SMarcel Holtmann 	__u8     type;
10611e191893SMarcel Holtmann 	__u8     own_address_type;
10621e191893SMarcel Holtmann 	__u8     direct_addr_type;
10631e191893SMarcel Holtmann 	bdaddr_t direct_addr;
10641e191893SMarcel Holtmann 	__u8     channel_map;
10651e191893SMarcel Holtmann 	__u8     filter_policy;
10661e191893SMarcel Holtmann } __packed;
10671e191893SMarcel Holtmann 
10688fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
10698fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
10708fa19098SJohan Hedberg 	__u8	status;
10718fa19098SJohan Hedberg 	__s8	tx_power;
10728fa19098SJohan Hedberg } __packed;
10738fa19098SJohan Hedberg 
10743f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
10753f0f524bSJohan Hedberg 
10763f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
10773f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
10783f0f524bSJohan Hedberg 	__u8	length;
10793f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
10803f0f524bSJohan Hedberg } __packed;
10813f0f524bSJohan Hedberg 
1082c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1083c1d5dc4aSJohan Hedberg 
10845df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
10855df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
10865df480b5SAndre Guedes 
108707f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
108807f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
108907f7fa5dSAndre Guedes 	__u8    type;
109007f7fa5dSAndre Guedes 	__le16  interval;
109107f7fa5dSAndre Guedes 	__le16  window;
109207f7fa5dSAndre Guedes 	__u8    own_address_type;
109307f7fa5dSAndre Guedes 	__u8    filter_policy;
109407f7fa5dSAndre Guedes } __packed;
109507f7fa5dSAndre Guedes 
109676a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
109776a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1098525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1099525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
110068a8aea4SAndrei Emeltchenko 
1101eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1102eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1103eb9d91f5SAndre Guedes 	__u8     enable;
1104eb9d91f5SAndre Guedes 	__u8     filter_dup;
1105eb9d91f5SAndre Guedes } __packed;
1106eb9d91f5SAndre Guedes 
110763185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
110863185f64SVille Tervo struct hci_cp_le_create_conn {
110963185f64SVille Tervo 	__le16   scan_interval;
111063185f64SVille Tervo 	__le16   scan_window;
111163185f64SVille Tervo 	__u8     filter_policy;
111263185f64SVille Tervo 	__u8     peer_addr_type;
111363185f64SVille Tervo 	bdaddr_t peer_addr;
111463185f64SVille Tervo 	__u8     own_address_type;
111563185f64SVille Tervo 	__le16   conn_interval_min;
111663185f64SVille Tervo 	__le16   conn_interval_max;
111763185f64SVille Tervo 	__le16   conn_latency;
111863185f64SVille Tervo 	__le16   supervision_timeout;
111963185f64SVille Tervo 	__le16   min_ce_len;
112063185f64SVille Tervo 	__le16   max_ce_len;
112163185f64SVille Tervo } __packed;
112263185f64SVille Tervo 
112363185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
112463185f64SVille Tervo 
1125cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE	0x200f
1126cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size {
1127cf1d081fSJohan Hedberg 	__u8	status;
1128cf1d081fSJohan Hedberg 	__u8	size;
1129cf1d081fSJohan Hedberg } __packed;
1130cf1d081fSJohan Hedberg 
11312ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
11322ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
11332ce603ebSClaudio Takahasi 	__le16   handle;
11342ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
11352ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
11362ce603ebSClaudio Takahasi 	__le16   conn_latency;
11372ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
11382ce603ebSClaudio Takahasi 	__le16   min_ce_len;
11392ce603ebSClaudio Takahasi 	__le16   max_ce_len;
11402ce603ebSClaudio Takahasi } __packed;
11412ce603ebSClaudio Takahasi 
1142a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1143a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1144a7a595f6SVinicius Costa Gomes 	__le16	handle;
1145a7a595f6SVinicius Costa Gomes 	__u8	rand[8];
1146a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1147a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1148a7a595f6SVinicius Costa Gomes } __packed;
1149a7a595f6SVinicius Costa Gomes 
1150a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1151a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1152a7a595f6SVinicius Costa Gomes 	__le16	handle;
1153a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1154a7a595f6SVinicius Costa Gomes } __packed;
1155a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1156a7a595f6SVinicius Costa Gomes 	__u8	status;
1157a7a595f6SVinicius Costa Gomes 	__le16	handle;
1158a7a595f6SVinicius Costa Gomes } __packed;
1159a7a595f6SVinicius Costa Gomes 
1160a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1161a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1162a7a595f6SVinicius Costa Gomes 	__le16	handle;
1163a7a595f6SVinicius Costa Gomes } __packed;
1164a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1165a7a595f6SVinicius Costa Gomes 	__u8	status;
1166a7a595f6SVinicius Costa Gomes 	__le16	handle;
1167a7a595f6SVinicius Costa Gomes } __packed;
1168a7a595f6SVinicius Costa Gomes 
11699b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
11709b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
11719b008c04SJohan Hedberg 	__u8	status;
11729b008c04SJohan Hedberg 	__u8	le_states[8];
11739b008c04SJohan Hedberg } __packed;
11749b008c04SJohan Hedberg 
11751da177e4SLinus Torvalds /* ---- HCI Events ---- */
11761da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
11771da177e4SLinus Torvalds 
11781da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
11791da177e4SLinus Torvalds struct inquiry_info {
11801da177e4SLinus Torvalds 	bdaddr_t bdaddr;
11811da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
11821da177e4SLinus Torvalds 	__u8     pscan_period_mode;
11831da177e4SLinus Torvalds 	__u8     pscan_mode;
11841da177e4SLinus Torvalds 	__u8     dev_class[3];
11851ebb9252SMarcel Holtmann 	__le16   clock_offset;
118666c853ccSGustavo F. Padovan } __packed;
11871da177e4SLinus Torvalds 
11881da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
11891da177e4SLinus Torvalds struct hci_ev_conn_complete {
11901da177e4SLinus Torvalds 	__u8     status;
11911ebb9252SMarcel Holtmann 	__le16   handle;
11921da177e4SLinus Torvalds 	bdaddr_t bdaddr;
11931da177e4SLinus Torvalds 	__u8     link_type;
11941da177e4SLinus Torvalds 	__u8     encr_mode;
119566c853ccSGustavo F. Padovan } __packed;
11961da177e4SLinus Torvalds 
11971da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
11981da177e4SLinus Torvalds struct hci_ev_conn_request {
11991da177e4SLinus Torvalds 	bdaddr_t bdaddr;
12001da177e4SLinus Torvalds 	__u8     dev_class[3];
12011da177e4SLinus Torvalds 	__u8     link_type;
120266c853ccSGustavo F. Padovan } __packed;
12031da177e4SLinus Torvalds 
12041da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
12051da177e4SLinus Torvalds struct hci_ev_disconn_complete {
12061da177e4SLinus Torvalds 	__u8     status;
12071ebb9252SMarcel Holtmann 	__le16   handle;
12081da177e4SLinus Torvalds 	__u8     reason;
120966c853ccSGustavo F. Padovan } __packed;
12101da177e4SLinus Torvalds 
12111da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
12121da177e4SLinus Torvalds struct hci_ev_auth_complete {
12131da177e4SLinus Torvalds 	__u8     status;
12141ebb9252SMarcel Holtmann 	__le16   handle;
121566c853ccSGustavo F. Padovan } __packed;
12161da177e4SLinus Torvalds 
1217a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
1218a9de9248SMarcel Holtmann struct hci_ev_remote_name {
1219a9de9248SMarcel Holtmann 	__u8     status;
1220a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
12211f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
122266c853ccSGustavo F. Padovan } __packed;
1223a9de9248SMarcel Holtmann 
12241da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
12251da177e4SLinus Torvalds struct hci_ev_encrypt_change {
12261da177e4SLinus Torvalds 	__u8     status;
12271ebb9252SMarcel Holtmann 	__le16   handle;
12281da177e4SLinus Torvalds 	__u8     encrypt;
122966c853ccSGustavo F. Padovan } __packed;
12301da177e4SLinus Torvalds 
1231a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
1232a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
12331da177e4SLinus Torvalds 	__u8     status;
12341ebb9252SMarcel Holtmann 	__le16   handle;
123566c853ccSGustavo F. Padovan } __packed;
12361da177e4SLinus Torvalds 
1237a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
1238a9de9248SMarcel Holtmann struct hci_ev_remote_features {
1239a9de9248SMarcel Holtmann 	__u8     status;
1240a9de9248SMarcel Holtmann 	__le16   handle;
1241a9de9248SMarcel Holtmann 	__u8     features[8];
124266c853ccSGustavo F. Padovan } __packed;
1243a9de9248SMarcel Holtmann 
1244a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
1245a9de9248SMarcel Holtmann struct hci_ev_remote_version {
1246a9de9248SMarcel Holtmann 	__u8     status;
1247a9de9248SMarcel Holtmann 	__le16   handle;
1248a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1249a9de9248SMarcel Holtmann 	__le16   manufacturer;
1250a9de9248SMarcel Holtmann 	__le16   lmp_subver;
125166c853ccSGustavo F. Padovan } __packed;
1252a9de9248SMarcel Holtmann 
1253a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
12541da177e4SLinus Torvalds struct hci_qos {
12551da177e4SLinus Torvalds 	__u8     service_type;
12561da177e4SLinus Torvalds 	__u32    token_rate;
12571da177e4SLinus Torvalds 	__u32    peak_bandwidth;
12581da177e4SLinus Torvalds 	__u32    latency;
12591da177e4SLinus Torvalds 	__u32    delay_variation;
126066c853ccSGustavo F. Padovan } __packed;
12611da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
12621da177e4SLinus Torvalds 	__u8     status;
12631ebb9252SMarcel Holtmann 	__le16   handle;
12641da177e4SLinus Torvalds 	struct   hci_qos qos;
126566c853ccSGustavo F. Padovan } __packed;
12661da177e4SLinus Torvalds 
1267a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
12681da177e4SLinus Torvalds struct hci_ev_cmd_complete {
12691da177e4SLinus Torvalds 	__u8     ncmd;
12701ebb9252SMarcel Holtmann 	__le16   opcode;
127166c853ccSGustavo F. Padovan } __packed;
12721da177e4SLinus Torvalds 
1273a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
12741da177e4SLinus Torvalds struct hci_ev_cmd_status {
12751da177e4SLinus Torvalds 	__u8     status;
12761da177e4SLinus Torvalds 	__u8     ncmd;
12771ebb9252SMarcel Holtmann 	__le16   opcode;
127866c853ccSGustavo F. Padovan } __packed;
12791da177e4SLinus Torvalds 
12801da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
12811da177e4SLinus Torvalds struct hci_ev_role_change {
12821da177e4SLinus Torvalds 	__u8     status;
12831da177e4SLinus Torvalds 	bdaddr_t bdaddr;
12841da177e4SLinus Torvalds 	__u8     role;
128566c853ccSGustavo F. Padovan } __packed;
12861da177e4SLinus Torvalds 
1287a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1288613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1289613a1c0cSAndrei Emeltchenko 	__le16   handle;
1290613a1c0cSAndrei Emeltchenko 	__le16   count;
1291613a1c0cSAndrei Emeltchenko } __packed;
1292613a1c0cSAndrei Emeltchenko 
1293a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1294a9de9248SMarcel Holtmann 	__u8     num_hndl;
1295613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
129666c853ccSGustavo F. Padovan } __packed;
1297a9de9248SMarcel Holtmann 
12981da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
12991da177e4SLinus Torvalds struct hci_ev_mode_change {
13001da177e4SLinus Torvalds 	__u8     status;
13011ebb9252SMarcel Holtmann 	__le16   handle;
13021da177e4SLinus Torvalds 	__u8     mode;
13031ebb9252SMarcel Holtmann 	__le16   interval;
130466c853ccSGustavo F. Padovan } __packed;
13051da177e4SLinus Torvalds 
13061da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
13071da177e4SLinus Torvalds struct hci_ev_pin_code_req {
13081da177e4SLinus Torvalds 	bdaddr_t bdaddr;
130966c853ccSGustavo F. Padovan } __packed;
13101da177e4SLinus Torvalds 
13111da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
13121da177e4SLinus Torvalds struct hci_ev_link_key_req {
13131da177e4SLinus Torvalds 	bdaddr_t bdaddr;
131466c853ccSGustavo F. Padovan } __packed;
13151da177e4SLinus Torvalds 
13161da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
13171da177e4SLinus Torvalds struct hci_ev_link_key_notify {
13181da177e4SLinus Torvalds 	bdaddr_t bdaddr;
13199b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
13201da177e4SLinus Torvalds 	__u8     key_type;
132166c853ccSGustavo F. Padovan } __packed;
13221da177e4SLinus Torvalds 
1323a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
13241da177e4SLinus Torvalds struct hci_ev_clock_offset {
13251da177e4SLinus Torvalds 	__u8     status;
13261ebb9252SMarcel Holtmann 	__le16   handle;
13271ebb9252SMarcel Holtmann 	__le16   clock_offset;
132866c853ccSGustavo F. Padovan } __packed;
13291da177e4SLinus Torvalds 
1330a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1331a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1332a8746417SMarcel Holtmann 	__u8     status;
1333a8746417SMarcel Holtmann 	__le16   handle;
1334a8746417SMarcel Holtmann 	__le16   pkt_type;
133566c853ccSGustavo F. Padovan } __packed;
1336a8746417SMarcel Holtmann 
133785a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
133885a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
133985a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
134085a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
134166c853ccSGustavo F. Padovan } __packed;
134285a1e930SMarcel Holtmann 
1343a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1344a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1345a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1346a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1347a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1348a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1349a9de9248SMarcel Holtmann 	__le16   clock_offset;
1350a9de9248SMarcel Holtmann 	__s8     rssi;
135166c853ccSGustavo F. Padovan } __packed;
1352a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1353a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1354a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1355a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1356a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1357a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1358a9de9248SMarcel Holtmann 	__le16   clock_offset;
1359a9de9248SMarcel Holtmann 	__s8     rssi;
136066c853ccSGustavo F. Padovan } __packed;
1361a9de9248SMarcel Holtmann 
1362a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1363a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1364a9de9248SMarcel Holtmann 	__u8     status;
1365a9de9248SMarcel Holtmann 	__le16   handle;
1366a9de9248SMarcel Holtmann 	__u8     page;
1367a9de9248SMarcel Holtmann 	__u8     max_page;
1368a9de9248SMarcel Holtmann 	__u8     features[8];
136966c853ccSGustavo F. Padovan } __packed;
1370a9de9248SMarcel Holtmann 
1371a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1372a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1373a9de9248SMarcel Holtmann 	__u8     status;
1374a9de9248SMarcel Holtmann 	__le16   handle;
1375a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1376a9de9248SMarcel Holtmann 	__u8     link_type;
1377a9de9248SMarcel Holtmann 	__u8     tx_interval;
1378a9de9248SMarcel Holtmann 	__u8     retrans_window;
1379a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1380a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1381a9de9248SMarcel Holtmann 	__u8     air_mode;
138266c853ccSGustavo F. Padovan } __packed;
1383a9de9248SMarcel Holtmann 
1384a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1385a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1386a9de9248SMarcel Holtmann 	__u8     status;
1387a9de9248SMarcel Holtmann 	__le16   handle;
1388a9de9248SMarcel Holtmann 	__u8     tx_interval;
1389a9de9248SMarcel Holtmann 	__u8     retrans_window;
1390a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1391a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
139266c853ccSGustavo F. Padovan } __packed;
1393a9de9248SMarcel Holtmann 
1394a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
139504837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
139604837f64SMarcel Holtmann 	__u8     status;
139704837f64SMarcel Holtmann 	__le16   handle;
139804837f64SMarcel Holtmann 	__le16   max_tx_latency;
139904837f64SMarcel Holtmann 	__le16   max_rx_latency;
140004837f64SMarcel Holtmann 	__le16   max_remote_timeout;
140104837f64SMarcel Holtmann 	__le16   max_local_timeout;
140266c853ccSGustavo F. Padovan } __packed;
140304837f64SMarcel Holtmann 
1404a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1405a9de9248SMarcel Holtmann struct extended_inquiry_info {
1406a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1407a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1408a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1409a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1410a9de9248SMarcel Holtmann 	__le16   clock_offset;
1411a9de9248SMarcel Holtmann 	__s8     rssi;
1412a9de9248SMarcel Holtmann 	__u8     data[240];
141366c853ccSGustavo F. Padovan } __packed;
1414a9de9248SMarcel Holtmann 
14151c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
14161c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
14171c2e0041SJohan Hedberg 	__u8	status;
14181c2e0041SJohan Hedberg 	__le16	handle;
14191c2e0041SJohan Hedberg } __packed;
14201c2e0041SJohan Hedberg 
14210493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
14220493684eSMarcel Holtmann struct hci_ev_io_capa_request {
14230493684eSMarcel Holtmann 	bdaddr_t bdaddr;
142466c853ccSGustavo F. Padovan } __packed;
14250493684eSMarcel Holtmann 
142603b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
142703b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
142803b555e1SJohan Hedberg 	bdaddr_t bdaddr;
142903b555e1SJohan Hedberg 	__u8     capability;
143003b555e1SJohan Hedberg 	__u8     oob_data;
143103b555e1SJohan Hedberg 	__u8     authentication;
143203b555e1SJohan Hedberg } __packed;
143303b555e1SJohan Hedberg 
1434a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1435a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1436a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1437a5c29683SJohan Hedberg 	__le32		passkey;
1438a5c29683SJohan Hedberg } __packed;
1439a5c29683SJohan Hedberg 
14409ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
14419ad4019aSBrian Gix struct hci_ev_user_passkey_req {
14429ad4019aSBrian Gix 	bdaddr_t	bdaddr;
14439ad4019aSBrian Gix } __packed;
14449ad4019aSBrian Gix 
14452763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
14462763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
14472763eda6SSzymon Janc 	bdaddr_t bdaddr;
14482763eda6SSzymon Janc } __packed;
14492763eda6SSzymon Janc 
14500493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
14510493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
14520493684eSMarcel Holtmann 	__u8     status;
14530493684eSMarcel Holtmann 	bdaddr_t bdaddr;
145466c853ccSGustavo F. Padovan } __packed;
14550493684eSMarcel Holtmann 
145692a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
145792a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
145892a25256SJohan Hedberg 	bdaddr_t	bdaddr;
145992a25256SJohan Hedberg 	__le32		passkey;
146092a25256SJohan Hedberg } __packed;
146192a25256SJohan Hedberg 
146292a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
146392a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
146492a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
146592a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
146692a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
146792a25256SJohan Hedberg 
146892a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
146992a25256SJohan Hedberg struct hci_ev_keypress_notify {
147092a25256SJohan Hedberg 	bdaddr_t	bdaddr;
147192a25256SJohan Hedberg 	__u8		type;
147292a25256SJohan Hedberg } __packed;
147392a25256SJohan Hedberg 
147441a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
147541a96212SMarcel Holtmann struct hci_ev_remote_host_features {
147641a96212SMarcel Holtmann 	bdaddr_t bdaddr;
147741a96212SMarcel Holtmann 	__u8     features[8];
147866c853ccSGustavo F. Padovan } __packed;
147941a96212SMarcel Holtmann 
148063185f64SVille Tervo #define HCI_EV_LE_META			0x3e
148163185f64SVille Tervo struct hci_ev_le_meta {
148263185f64SVille Tervo 	__u8     subevent;
148363185f64SVille Tervo } __packed;
148463185f64SVille Tervo 
1485523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
1486523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
1487523e93cdSAndrei Emeltchenko 	__u8     status;
1488523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1489523e93cdSAndrei Emeltchenko } __packed;
1490523e93cdSAndrei Emeltchenko 
1491523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
1492523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
1493523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1494523e93cdSAndrei Emeltchenko } __packed;
1495523e93cdSAndrei Emeltchenko 
1496523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
1497523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
1498523e93cdSAndrei Emeltchenko 	__u8     status;
1499523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1500523e93cdSAndrei Emeltchenko 	__u8     reason;
1501523e93cdSAndrei Emeltchenko } __packed;
1502523e93cdSAndrei Emeltchenko 
1503523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
1504523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
1505523e93cdSAndrei Emeltchenko 	__u8     status;
1506523e93cdSAndrei Emeltchenko 	__le16   handle;
1507523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1508523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
1509523e93cdSAndrei Emeltchenko } __packed;
1510523e93cdSAndrei Emeltchenko 
1511523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
1512523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
1513523e93cdSAndrei Emeltchenko 	__u8     status;
1514523e93cdSAndrei Emeltchenko 	__le16   handle;
1515523e93cdSAndrei Emeltchenko 	__u8     reason;
1516523e93cdSAndrei Emeltchenko } __packed;
1517523e93cdSAndrei Emeltchenko 
151825e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
151925e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
152025e89e99SAndrei Emeltchenko 	__le16   handle;
152125e89e99SAndrei Emeltchenko 	__le16   pkts;
152225e89e99SAndrei Emeltchenko 	__le16   blocks;
152325e89e99SAndrei Emeltchenko } __packed;
152425e89e99SAndrei Emeltchenko 
152525e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
152625e89e99SAndrei Emeltchenko 	__le16   num_blocks;
152725e89e99SAndrei Emeltchenko 	__u8     num_hndl;
152825e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
152925e89e99SAndrei Emeltchenko } __packed;
153025e89e99SAndrei Emeltchenko 
15312b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
15322b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
15332b359445SDoHyun Pyun 	__u8	status;
15342b359445SDoHyun Pyun } __packed;
15352b359445SDoHyun Pyun 
15362ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT	0x54
15372ed01805SDoHyun Pyun 
153863185f64SVille Tervo /* Low energy meta events */
1539b9b343d2SAndre Guedes #define LE_CONN_ROLE_MASTER	0x00
1540b9b343d2SAndre Guedes 
154163185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
154263185f64SVille Tervo struct hci_ev_le_conn_complete {
154363185f64SVille Tervo 	__u8     status;
154463185f64SVille Tervo 	__le16   handle;
154563185f64SVille Tervo 	__u8     role;
154663185f64SVille Tervo 	__u8     bdaddr_type;
154763185f64SVille Tervo 	bdaddr_t bdaddr;
154863185f64SVille Tervo 	__le16   interval;
154963185f64SVille Tervo 	__le16   latency;
155063185f64SVille Tervo 	__le16   supervision_timeout;
155163185f64SVille Tervo 	__u8     clk_accurancy;
155263185f64SVille Tervo } __packed;
155363185f64SVille Tervo 
1554a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1555a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1556a7a595f6SVinicius Costa Gomes 	__le16	handle;
1557a7a595f6SVinicius Costa Gomes 	__u8	random[8];
1558a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1559a7a595f6SVinicius Costa Gomes } __packed;
1560a7a595f6SVinicius Costa Gomes 
156157a56fd4SAnderson Briglia /* Advertising report event types */
156257a56fd4SAnderson Briglia #define ADV_IND		0x00
156357a56fd4SAnderson Briglia #define ADV_DIRECT_IND	0x01
156457a56fd4SAnderson Briglia #define ADV_SCAN_IND	0x02
156557a56fd4SAnderson Briglia #define ADV_NONCONN_IND	0x03
156657a56fd4SAnderson Briglia #define ADV_SCAN_RSP	0x04
156757a56fd4SAnderson Briglia 
156857a56fd4SAnderson Briglia #define ADDR_LE_DEV_PUBLIC	0x00
156957a56fd4SAnderson Briglia #define ADDR_LE_DEV_RANDOM	0x01
157057a56fd4SAnderson Briglia 
157157a56fd4SAnderson Briglia #define HCI_EV_LE_ADVERTISING_REPORT	0x02
157257a56fd4SAnderson Briglia struct hci_ev_le_advertising_info {
157357a56fd4SAnderson Briglia 	__u8	 evt_type;
157457a56fd4SAnderson Briglia 	__u8	 bdaddr_type;
157557a56fd4SAnderson Briglia 	bdaddr_t bdaddr;
157657a56fd4SAnderson Briglia 	__u8	 length;
157757a56fd4SAnderson Briglia 	__u8	 data[0];
157857a56fd4SAnderson Briglia } __packed;
157957a56fd4SAnderson Briglia 
15801da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1581a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
15821da177e4SLinus Torvalds struct hci_ev_stack_internal {
15831da177e4SLinus Torvalds 	__u16    type;
15841da177e4SLinus Torvalds 	__u8     data[0];
158566c853ccSGustavo F. Padovan } __packed;
15861da177e4SLinus Torvalds 
15871da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
15881da177e4SLinus Torvalds struct hci_ev_si_device {
15891da177e4SLinus Torvalds 	__u16    event;
15901da177e4SLinus Torvalds 	__u16    dev_id;
159166c853ccSGustavo F. Padovan } __packed;
15921da177e4SLinus Torvalds 
15931da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
15941da177e4SLinus Torvalds struct hci_ev_si_security {
15951da177e4SLinus Torvalds 	__u16    event;
15961da177e4SLinus Torvalds 	__u16    proto;
15971da177e4SLinus Torvalds 	__u16    subproto;
15981da177e4SLinus Torvalds 	__u8     incoming;
159966c853ccSGustavo F. Padovan } __packed;
16001da177e4SLinus Torvalds 
16011da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
16021da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
16031da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
16041da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
16051da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
16061da177e4SLinus Torvalds 
16071da177e4SLinus Torvalds struct hci_command_hdr {
16081ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
16091da177e4SLinus Torvalds 	__u8	plen;
161066c853ccSGustavo F. Padovan } __packed;
16111da177e4SLinus Torvalds 
16121da177e4SLinus Torvalds struct hci_event_hdr {
16131da177e4SLinus Torvalds 	__u8	evt;
16141da177e4SLinus Torvalds 	__u8	plen;
161566c853ccSGustavo F. Padovan } __packed;
16161da177e4SLinus Torvalds 
16171da177e4SLinus Torvalds struct hci_acl_hdr {
16181ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
16191ebb9252SMarcel Holtmann 	__le16	dlen;
162066c853ccSGustavo F. Padovan } __packed;
16211da177e4SLinus Torvalds 
16221da177e4SLinus Torvalds struct hci_sco_hdr {
16231ebb9252SMarcel Holtmann 	__le16	handle;
16241da177e4SLinus Torvalds 	__u8	dlen;
162566c853ccSGustavo F. Padovan } __packed;
16261da177e4SLinus Torvalds 
16272a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
16282a123b86SArnaldo Carvalho de Melo {
16292a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
16302a123b86SArnaldo Carvalho de Melo }
16312a123b86SArnaldo Carvalho de Melo 
16322a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
16332a123b86SArnaldo Carvalho de Melo {
16342a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
16352a123b86SArnaldo Carvalho de Melo }
16362a123b86SArnaldo Carvalho de Melo 
16372a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
16382a123b86SArnaldo Carvalho de Melo {
16392a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
16402a123b86SArnaldo Carvalho de Melo }
16412a123b86SArnaldo Carvalho de Melo 
16421da177e4SLinus Torvalds /* Command opcode pack/unpack */
1643c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
16441da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
16451da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
16461da177e4SLinus Torvalds 
16471da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
1648c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
16491da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
16501da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
16511da177e4SLinus Torvalds 
16521da177e4SLinus Torvalds /* ---- HCI Sockets ---- */
16531da177e4SLinus Torvalds 
16541da177e4SLinus Torvalds /* Socket options */
16551da177e4SLinus Torvalds #define HCI_DATA_DIR	1
16561da177e4SLinus Torvalds #define HCI_FILTER	2
16571da177e4SLinus Torvalds #define HCI_TIME_STAMP	3
16581da177e4SLinus Torvalds 
16591da177e4SLinus Torvalds /* CMSG flags */
16601da177e4SLinus Torvalds #define HCI_CMSG_DIR	0x0001
16611da177e4SLinus Torvalds #define HCI_CMSG_TSTAMP	0x0002
16621da177e4SLinus Torvalds 
16631da177e4SLinus Torvalds struct sockaddr_hci {
16641da177e4SLinus Torvalds 	sa_family_t    hci_family;
16651da177e4SLinus Torvalds 	unsigned short hci_dev;
1666c02178d2SJohan Hedberg 	unsigned short hci_channel;
16671da177e4SLinus Torvalds };
16681da177e4SLinus Torvalds #define HCI_DEV_NONE	0xffff
16691da177e4SLinus Torvalds 
1670c02178d2SJohan Hedberg #define HCI_CHANNEL_RAW		0
167123500189SMarcel Holtmann #define HCI_CHANNEL_USER	1
1672cd82e61cSMarcel Holtmann #define HCI_CHANNEL_MONITOR	2
167366f3b913SGustavo Padovan #define HCI_CHANNEL_CONTROL	3
1674c02178d2SJohan Hedberg 
16751da177e4SLinus Torvalds struct hci_filter {
16761da177e4SLinus Torvalds 	unsigned long type_mask;
16771da177e4SLinus Torvalds 	unsigned long event_mask[2];
1678905f3ed6SAl Viro 	__le16 opcode;
16791da177e4SLinus Torvalds };
16801da177e4SLinus Torvalds 
16811da177e4SLinus Torvalds struct hci_ufilter {
16821da177e4SLinus Torvalds 	__u32  type_mask;
16831da177e4SLinus Torvalds 	__u32  event_mask[2];
1684905f3ed6SAl Viro 	__le16 opcode;
16851da177e4SLinus Torvalds };
16861da177e4SLinus Torvalds 
16871da177e4SLinus Torvalds #define HCI_FLT_TYPE_BITS	31
16881da177e4SLinus Torvalds #define HCI_FLT_EVENT_BITS	63
16891da177e4SLinus Torvalds #define HCI_FLT_OGF_BITS	63
16901da177e4SLinus Torvalds #define HCI_FLT_OCF_BITS	127
16911da177e4SLinus Torvalds 
16921da177e4SLinus Torvalds /* ---- HCI Ioctl requests structures ---- */
16931da177e4SLinus Torvalds struct hci_dev_stats {
16941da177e4SLinus Torvalds 	__u32 err_rx;
16951da177e4SLinus Torvalds 	__u32 err_tx;
16961da177e4SLinus Torvalds 	__u32 cmd_tx;
16971da177e4SLinus Torvalds 	__u32 evt_rx;
16981da177e4SLinus Torvalds 	__u32 acl_tx;
16991da177e4SLinus Torvalds 	__u32 acl_rx;
17001da177e4SLinus Torvalds 	__u32 sco_tx;
17011da177e4SLinus Torvalds 	__u32 sco_rx;
17021da177e4SLinus Torvalds 	__u32 byte_rx;
17031da177e4SLinus Torvalds 	__u32 byte_tx;
17041da177e4SLinus Torvalds };
17051da177e4SLinus Torvalds 
17061da177e4SLinus Torvalds struct hci_dev_info {
17071da177e4SLinus Torvalds 	__u16 dev_id;
17081da177e4SLinus Torvalds 	char  name[8];
17091da177e4SLinus Torvalds 
17101da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17111da177e4SLinus Torvalds 
17121da177e4SLinus Torvalds 	__u32 flags;
17131da177e4SLinus Torvalds 	__u8  type;
17141da177e4SLinus Torvalds 
17151da177e4SLinus Torvalds 	__u8  features[8];
17161da177e4SLinus Torvalds 
17171da177e4SLinus Torvalds 	__u32 pkt_type;
17181da177e4SLinus Torvalds 	__u32 link_policy;
17191da177e4SLinus Torvalds 	__u32 link_mode;
17201da177e4SLinus Torvalds 
17211da177e4SLinus Torvalds 	__u16 acl_mtu;
17221da177e4SLinus Torvalds 	__u16 acl_pkts;
17231da177e4SLinus Torvalds 	__u16 sco_mtu;
17241da177e4SLinus Torvalds 	__u16 sco_pkts;
17251da177e4SLinus Torvalds 
17261da177e4SLinus Torvalds 	struct hci_dev_stats stat;
17271da177e4SLinus Torvalds };
17281da177e4SLinus Torvalds 
17291da177e4SLinus Torvalds struct hci_conn_info {
17301da177e4SLinus Torvalds 	__u16    handle;
17311da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17321da177e4SLinus Torvalds 	__u8     type;
17331da177e4SLinus Torvalds 	__u8     out;
17341da177e4SLinus Torvalds 	__u16    state;
17351da177e4SLinus Torvalds 	__u32    link_mode;
17361da177e4SLinus Torvalds };
17371da177e4SLinus Torvalds 
17381da177e4SLinus Torvalds struct hci_dev_req {
17391da177e4SLinus Torvalds 	__u16  dev_id;
17401da177e4SLinus Torvalds 	__u32  dev_opt;
17411da177e4SLinus Torvalds };
17421da177e4SLinus Torvalds 
17431da177e4SLinus Torvalds struct hci_dev_list_req {
17441da177e4SLinus Torvalds 	__u16  dev_num;
17451da177e4SLinus Torvalds 	struct hci_dev_req dev_req[0];	/* hci_dev_req structures */
17461da177e4SLinus Torvalds };
17471da177e4SLinus Torvalds 
17481da177e4SLinus Torvalds struct hci_conn_list_req {
17491da177e4SLinus Torvalds 	__u16  dev_id;
17501da177e4SLinus Torvalds 	__u16  conn_num;
17511da177e4SLinus Torvalds 	struct hci_conn_info conn_info[0];
17521da177e4SLinus Torvalds };
17531da177e4SLinus Torvalds 
17541da177e4SLinus Torvalds struct hci_conn_info_req {
17551da177e4SLinus Torvalds 	bdaddr_t bdaddr;
17561da177e4SLinus Torvalds 	__u8     type;
17571da177e4SLinus Torvalds 	struct   hci_conn_info conn_info[0];
17581da177e4SLinus Torvalds };
17591da177e4SLinus Torvalds 
176040be492fSMarcel Holtmann struct hci_auth_info_req {
176140be492fSMarcel Holtmann 	bdaddr_t bdaddr;
176240be492fSMarcel Holtmann 	__u8     type;
176340be492fSMarcel Holtmann };
176440be492fSMarcel Holtmann 
17651da177e4SLinus Torvalds struct hci_inquiry_req {
17661da177e4SLinus Torvalds 	__u16 dev_id;
17671da177e4SLinus Torvalds 	__u16 flags;
17681da177e4SLinus Torvalds 	__u8  lap[3];
17691da177e4SLinus Torvalds 	__u8  length;
17701da177e4SLinus Torvalds 	__u8  num_rsp;
17711da177e4SLinus Torvalds };
17721da177e4SLinus Torvalds #define IREQ_CACHE_FLUSH 0x0001
17731da177e4SLinus Torvalds 
17748b281b9cSFabio Estevam extern bool enable_hs;
17758830f514SAndrei Emeltchenko 
17761da177e4SLinus Torvalds #endif /* __HCI_H */
1777