xref: /openbmc/linux/include/net/bluetooth/hci.h (revision c3c7ea65941a0b7a4f1b9655e7aaaab6ce1874d2)
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
349b3b4460SAndrei Emeltchenko 
351da177e4SLinus Torvalds /* HCI dev events */
361da177e4SLinus Torvalds #define HCI_DEV_REG			1
371da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
381da177e4SLinus Torvalds #define HCI_DEV_UP			3
391da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
401da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
411da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
421da177e4SLinus Torvalds 
431da177e4SLinus Torvalds /* HCI notify events */
441da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
451da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
461da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
471da177e4SLinus Torvalds 
48c13854ceSMarcel Holtmann /* HCI bus types */
490ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
501da177e4SLinus Torvalds #define HCI_USB		1
511da177e4SLinus Torvalds #define HCI_PCCARD	2
521da177e4SLinus Torvalds #define HCI_UART	3
531da177e4SLinus Torvalds #define HCI_RS232	4
541da177e4SLinus Torvalds #define HCI_PCI		5
550ac53939SMarcel Holtmann #define HCI_SDIO	6
561da177e4SLinus Torvalds 
57943da25dSMarcel Holtmann /* HCI controller types */
58943da25dSMarcel Holtmann #define HCI_BREDR	0x00
598f1e1742SDavid Vrabel #define HCI_AMP		0x01
60943da25dSMarcel Holtmann 
611da177e4SLinus Torvalds /* HCI device quirks */
621da177e4SLinus Torvalds enum {
63a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
64da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
65da1f5198SMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE
661da177e4SLinus Torvalds };
671da177e4SLinus Torvalds 
681da177e4SLinus Torvalds /* HCI device flags */
691da177e4SLinus Torvalds enum {
701da177e4SLinus Torvalds 	HCI_UP,
711da177e4SLinus Torvalds 	HCI_INIT,
721da177e4SLinus Torvalds 	HCI_RUNNING,
731da177e4SLinus Torvalds 
741da177e4SLinus Torvalds 	HCI_PSCAN,
751da177e4SLinus Torvalds 	HCI_ISCAN,
761da177e4SLinus Torvalds 	HCI_AUTH,
771da177e4SLinus Torvalds 	HCI_ENCRYPT,
781da177e4SLinus Torvalds 	HCI_INQUIRY,
791da177e4SLinus Torvalds 
801da177e4SLinus Torvalds 	HCI_RAW,
81ab81cbf9SJohan Hedberg 
8210572132SGustavo F. Padovan 	HCI_RESET,
831da177e4SLinus Torvalds };
841da177e4SLinus Torvalds 
85d23264a8SAndre Guedes /*
86d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
87d23264a8SAndre Guedes  * states from the controller.
88d23264a8SAndre Guedes  */
89d23264a8SAndre Guedes enum {
90a8b2d5c2SJohan Hedberg 	HCI_SETUP,
91a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
92a8b2d5c2SJohan Hedberg 	HCI_MGMT,
93a8b2d5c2SJohan Hedberg 	HCI_PAIRABLE,
94a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
95a8b2d5c2SJohan Hedberg 	HCI_LINK_KEYS,
96a8b2d5c2SJohan Hedberg 	HCI_DEBUG_KEYS,
9794324962SJohan Hovold 	HCI_UNREGISTER,
98a8b2d5c2SJohan Hedberg 
99d23264a8SAndre Guedes 	HCI_LE_SCAN,
10084bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
1016d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
10206199cf8SJohan Hedberg 	HCI_LE_ENABLED,
1035e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
1045e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
10547990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
106c95f0ba7SJohan Hedberg 	HCI_PENDING_CLASS,
10721693c15SAndre Guedes 	HCI_PERIODIC_INQ,
108d23264a8SAndre Guedes };
109d23264a8SAndre Guedes 
1101da177e4SLinus Torvalds /* HCI ioctl defines */
1111da177e4SLinus Torvalds #define HCIDEVUP	_IOW('H', 201, int)
1121da177e4SLinus Torvalds #define HCIDEVDOWN	_IOW('H', 202, int)
1131da177e4SLinus Torvalds #define HCIDEVRESET	_IOW('H', 203, int)
1141da177e4SLinus Torvalds #define HCIDEVRESTAT	_IOW('H', 204, int)
1151da177e4SLinus Torvalds 
1161da177e4SLinus Torvalds #define HCIGETDEVLIST	_IOR('H', 210, int)
1171da177e4SLinus Torvalds #define HCIGETDEVINFO	_IOR('H', 211, int)
1181da177e4SLinus Torvalds #define HCIGETCONNLIST	_IOR('H', 212, int)
1191da177e4SLinus Torvalds #define HCIGETCONNINFO	_IOR('H', 213, int)
12040be492fSMarcel Holtmann #define HCIGETAUTHINFO	_IOR('H', 215, int)
1211da177e4SLinus Torvalds 
1221da177e4SLinus Torvalds #define HCISETRAW	_IOW('H', 220, int)
1231da177e4SLinus Torvalds #define HCISETSCAN	_IOW('H', 221, int)
1241da177e4SLinus Torvalds #define HCISETAUTH	_IOW('H', 222, int)
1251da177e4SLinus Torvalds #define HCISETENCRYPT	_IOW('H', 223, int)
1261da177e4SLinus Torvalds #define HCISETPTYPE	_IOW('H', 224, int)
1271da177e4SLinus Torvalds #define HCISETLINKPOL	_IOW('H', 225, int)
1281da177e4SLinus Torvalds #define HCISETLINKMODE	_IOW('H', 226, int)
1291da177e4SLinus Torvalds #define HCISETACLMTU	_IOW('H', 227, int)
1301da177e4SLinus Torvalds #define HCISETSCOMTU	_IOW('H', 228, int)
1311da177e4SLinus Torvalds 
132f0358568SJohan Hedberg #define HCIBLOCKADDR	_IOW('H', 230, int)
133f0358568SJohan Hedberg #define HCIUNBLOCKADDR	_IOW('H', 231, int)
134f0358568SJohan Hedberg 
1351da177e4SLinus Torvalds #define HCIINQUIRY	_IOR('H', 240, int)
1361da177e4SLinus Torvalds 
1371da177e4SLinus Torvalds /* HCI timeouts */
13804837f64SMarcel Holtmann #define HCI_CONNECT_TIMEOUT	(40000)	/* 40 seconds */
13904837f64SMarcel Holtmann #define HCI_DISCONN_TIMEOUT	(2000)	/* 2 seconds */
140052b30b0SMarcel Holtmann #define HCI_PAIRING_TIMEOUT	(60000)	/* 60 seconds */
14104837f64SMarcel Holtmann #define HCI_IDLE_TIMEOUT	(6000)	/* 6 seconds */
14204837f64SMarcel Holtmann #define HCI_INIT_TIMEOUT	(10000)	/* 10 seconds */
1436bd32326SVille Tervo #define HCI_CMD_TIMEOUT		(1000)	/* 1 seconds */
144cc48dc0aSAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	(45000)	/* 45 seconds */
1451da177e4SLinus Torvalds 
1465b7f9909SMarcel Holtmann /* HCI data types */
1471da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
1481da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
1491da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
1501da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
1511da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
1521da177e4SLinus Torvalds 
1535b7f9909SMarcel Holtmann /* HCI packet types */
1541da177e4SLinus Torvalds #define HCI_DM1		0x0008
1551da177e4SLinus Torvalds #define HCI_DM3		0x0400
1561da177e4SLinus Torvalds #define HCI_DM5		0x4000
1571da177e4SLinus Torvalds #define HCI_DH1		0x0010
1581da177e4SLinus Torvalds #define HCI_DH3		0x0800
1591da177e4SLinus Torvalds #define HCI_DH5		0x8000
1601da177e4SLinus Torvalds 
1611da177e4SLinus Torvalds #define HCI_HV1		0x0020
1621da177e4SLinus Torvalds #define HCI_HV2		0x0040
1631da177e4SLinus Torvalds #define HCI_HV3		0x0080
1641da177e4SLinus Torvalds 
1651da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
1661da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
1671da177e4SLinus Torvalds 
1685b7f9909SMarcel Holtmann /* eSCO packet types */
1695b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
1705b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
1715b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
1725b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
1735b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
1745b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
175efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
176efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
177efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
178efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
1795b7f9909SMarcel Holtmann 
180a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
181efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
182a8746417SMarcel Holtmann 
1831da177e4SLinus Torvalds /* ACL flags */
184e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
1851da177e4SLinus Torvalds #define ACL_CONT		0x01
1861da177e4SLinus Torvalds #define ACL_START		0x02
1871da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
1881da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
1891da177e4SLinus Torvalds 
1901da177e4SLinus Torvalds /* Baseband links */
1911da177e4SLinus Torvalds #define SCO_LINK	0x00
1921da177e4SLinus Torvalds #define ACL_LINK	0x01
1935b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
194fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
195fcd89c09SVille Tervo #define LE_LINK		0x80
1961da177e4SLinus Torvalds 
1971da177e4SLinus Torvalds /* LMP features */
1981da177e4SLinus Torvalds #define LMP_3SLOT	0x01
1991da177e4SLinus Torvalds #define LMP_5SLOT	0x02
2001da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
2011da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
2021da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
2031da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
2041da177e4SLinus Torvalds #define LMP_HOLD	0x40
20504837f64SMarcel Holtmann #define LMP_SNIFF	0x80
2061da177e4SLinus Torvalds 
2071da177e4SLinus Torvalds #define LMP_PARK	0x01
2081da177e4SLinus Torvalds #define LMP_RSSI	0x02
2091da177e4SLinus Torvalds #define LMP_QUALITY	0x04
2101da177e4SLinus Torvalds #define LMP_SCO		0x08
2111da177e4SLinus Torvalds #define LMP_HV2		0x10
2121da177e4SLinus Torvalds #define LMP_HV3		0x20
2131da177e4SLinus Torvalds #define LMP_ULAW	0x40
2141da177e4SLinus Torvalds #define LMP_ALAW	0x80
2151da177e4SLinus Torvalds 
2161da177e4SLinus Torvalds #define LMP_CVSD	0x01
2171da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
2181da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
2191da177e4SLinus Torvalds 
220d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
2215b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
2225b7f9909SMarcel Holtmann 
2235b7f9909SMarcel Holtmann #define LMP_EV4		0x01
2245b7f9909SMarcel Holtmann #define LMP_EV5		0x02
22569ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
226d5859e22SJohan Hedberg #define LMP_LE		0x40
2275b7f9909SMarcel Holtmann 
22804837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
229d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
230efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
231efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
232efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
23304837f64SMarcel Holtmann 
234d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
235e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
236769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
237e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
238769be974SMarcel Holtmann 
239d5859e22SJohan Hedberg #define LMP_LSTO	0x01
240d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
241971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
242d5859e22SJohan Hedberg 
243eead27daSAndre Guedes /* Extended LMP features */
244cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
245eead27daSAndre Guedes #define LMP_HOST_LE		0x02
246cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
247eead27daSAndre Guedes 
24804837f64SMarcel Holtmann /* Connection modes */
24904837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
25004837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
25104837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
25204837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
25304837f64SMarcel Holtmann 
2541da177e4SLinus Torvalds /* Link policies */
2551da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
2561da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
2571da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
2581da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
2591da177e4SLinus Torvalds 
26004837f64SMarcel Holtmann /* Link modes */
2611da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
2621da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
2631da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
2641da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
2651da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
2661da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
2671da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
2681da177e4SLinus Torvalds 
26940be492fSMarcel Holtmann /* Authentication types */
27040be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
27140be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
27240be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
27340be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
27440be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
27540be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
27640be492fSMarcel Holtmann 
277b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
278b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
279b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
280b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
281b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
282b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_UNAUTH_COMBINATION	0x04
283b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_AUTH_COMBINATION		0x05
284b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
285b899efafSVinicius Costa Gomes /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
286b899efafSVinicius Costa Gomes #define HCI_SMP_STK			0x80
287b899efafSVinicius Costa Gomes #define HCI_SMP_STK_SLAVE		0x81
288b899efafSVinicius Costa Gomes #define HCI_SMP_LTK			0x82
289b899efafSVinicius Costa Gomes #define HCI_SMP_LTK_SLAVE		0x83
290b6020ba0SWaldemar Rymarkiewicz 
2919f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
2929f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
2939f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
2949f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
2959f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
2969f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
2979f5a0d7bSAndrei Emeltchenko 
2982455a3eaSAndrei Emeltchenko /* Flow control modes */
2992455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
3002455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
3012455a3eaSAndrei Emeltchenko 
30232748db0SJohan Hedberg /* Extended Inquiry Response field types */
30332748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
30432748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
30532748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
30632748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
30732748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
30832748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
30932748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
31032748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
31132748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
31232748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
3139ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
3149ec9fc8aSJohan Hedberg #define EIR_SSP_HASH_C		0x0E /* Simple Pairing Hash C */
3159ec9fc8aSJohan Hedberg #define EIR_SSP_RAND_R		0x0F /* Simple Pairing Randomizer R */
31632748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
31732748db0SJohan Hedberg 
3181da177e4SLinus Torvalds /* -----  HCI Commands ---- */
3196bd32326SVille Tervo #define HCI_OP_NOP			0x0000
3206bd32326SVille Tervo 
321a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
322a9de9248SMarcel Holtmann struct hci_cp_inquiry {
323a9de9248SMarcel Holtmann 	__u8     lap[3];
324a9de9248SMarcel Holtmann 	__u8     length;
325a9de9248SMarcel Holtmann 	__u8     num_rsp;
32666c853ccSGustavo F. Padovan } __packed;
3271da177e4SLinus Torvalds 
328a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
329a9de9248SMarcel Holtmann 
33079d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
33179d6e068SAndre Guedes 
332a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
333a9de9248SMarcel Holtmann 
334a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
335a9de9248SMarcel Holtmann struct hci_cp_create_conn {
336a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
337a9de9248SMarcel Holtmann 	__le16   pkt_type;
338a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
339a9de9248SMarcel Holtmann 	__u8     pscan_mode;
340a9de9248SMarcel Holtmann 	__le16   clock_offset;
341a9de9248SMarcel Holtmann 	__u8     role_switch;
34266c853ccSGustavo F. Padovan } __packed;
3431da177e4SLinus Torvalds 
344a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
345a9de9248SMarcel Holtmann struct hci_cp_disconnect {
346a9de9248SMarcel Holtmann 	__le16   handle;
347a9de9248SMarcel Holtmann 	__u8     reason;
34866c853ccSGustavo F. Padovan } __packed;
3491da177e4SLinus Torvalds 
350a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
351a9de9248SMarcel Holtmann struct hci_cp_add_sco {
352a9de9248SMarcel Holtmann 	__le16   handle;
353a9de9248SMarcel Holtmann 	__le16   pkt_type;
35466c853ccSGustavo F. Padovan } __packed;
355a9de9248SMarcel Holtmann 
356a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
357a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
3581da177e4SLinus Torvalds 	bdaddr_t bdaddr;
35966c853ccSGustavo F. Padovan } __packed;
3601da177e4SLinus Torvalds 
361a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
362a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
363a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
364a9de9248SMarcel Holtmann 	__u8     role;
36566c853ccSGustavo F. Padovan } __packed;
3661da177e4SLinus Torvalds 
367a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
368a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
369a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
370a9de9248SMarcel Holtmann 	__u8     reason;
37166c853ccSGustavo F. Padovan } __packed;
3721da177e4SLinus Torvalds 
373a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
374a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
375a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
3769b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
37766c853ccSGustavo F. Padovan } __packed;
3781da177e4SLinus Torvalds 
379a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
380a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
381a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
38266c853ccSGustavo F. Padovan } __packed;
3831da177e4SLinus Torvalds 
384a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
385a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
386a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
387a9de9248SMarcel Holtmann 	__u8     pin_len;
388a9de9248SMarcel Holtmann 	__u8     pin_code[16];
38966c853ccSGustavo F. Padovan } __packed;
390980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
391980e1a53SJohan Hedberg 	__u8     status;
392980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
393980e1a53SJohan Hedberg } __packed;
394a9de9248SMarcel Holtmann 
395a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
396a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
397a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
39866c853ccSGustavo F. Padovan } __packed;
399980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
400980e1a53SJohan Hedberg 	__u8     status;
401980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
402980e1a53SJohan Hedberg } __packed;
403a9de9248SMarcel Holtmann 
404a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
405a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
406a9de9248SMarcel Holtmann 	__le16   handle;
407a9de9248SMarcel Holtmann 	__le16   pkt_type;
40866c853ccSGustavo F. Padovan } __packed;
409a9de9248SMarcel Holtmann 
410a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
411a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
412a9de9248SMarcel Holtmann 	__le16   handle;
41366c853ccSGustavo F. Padovan } __packed;
414a9de9248SMarcel Holtmann 
415a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
416a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
417a9de9248SMarcel Holtmann 	__le16   handle;
418a9de9248SMarcel Holtmann 	__u8     encrypt;
41966c853ccSGustavo F. Padovan } __packed;
420a9de9248SMarcel Holtmann 
421a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
422a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
423a9de9248SMarcel Holtmann 	__le16   handle;
42466c853ccSGustavo F. Padovan } __packed;
425a9de9248SMarcel Holtmann 
426a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
427a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
428a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
429a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
430a9de9248SMarcel Holtmann 	__u8     pscan_mode;
431a9de9248SMarcel Holtmann 	__le16   clock_offset;
43266c853ccSGustavo F. Padovan } __packed;
433a9de9248SMarcel Holtmann 
434a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
435a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
436a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
43766c853ccSGustavo F. Padovan } __packed;
438a9de9248SMarcel Holtmann 
439a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
440a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
441a9de9248SMarcel Holtmann 	__le16   handle;
44266c853ccSGustavo F. Padovan } __packed;
443a9de9248SMarcel Holtmann 
444a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
445a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
446a9de9248SMarcel Holtmann 	__le16   handle;
447a9de9248SMarcel Holtmann 	__u8     page;
44866c853ccSGustavo F. Padovan } __packed;
449a9de9248SMarcel Holtmann 
450a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
451a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
452a9de9248SMarcel Holtmann 	__le16   handle;
45366c853ccSGustavo F. Padovan } __packed;
454a9de9248SMarcel Holtmann 
455a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
456a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
457a9de9248SMarcel Holtmann 	__le16   handle;
458a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
459a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
460a9de9248SMarcel Holtmann 	__le16   max_latency;
461a9de9248SMarcel Holtmann 	__le16   voice_setting;
462a9de9248SMarcel Holtmann 	__u8     retrans_effort;
463a9de9248SMarcel Holtmann 	__le16   pkt_type;
46466c853ccSGustavo F. Padovan } __packed;
465a9de9248SMarcel Holtmann 
466a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
467a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
468a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
469a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
470a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
471a9de9248SMarcel Holtmann 	__le16   max_latency;
472a9de9248SMarcel Holtmann 	__le16   content_format;
473a9de9248SMarcel Holtmann 	__u8     retrans_effort;
474a9de9248SMarcel Holtmann 	__le16   pkt_type;
47566c853ccSGustavo F. Padovan } __packed;
476a9de9248SMarcel Holtmann 
477a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
478a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
479a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
480a9de9248SMarcel Holtmann 	__u8     reason;
48166c853ccSGustavo F. Padovan } __packed;
482a9de9248SMarcel Holtmann 
48317fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
48417fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
48517fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
48617fa4b9dSJohan Hedberg 	__u8     capability;
48717fa4b9dSJohan Hedberg 	__u8     oob_data;
48817fa4b9dSJohan Hedberg 	__u8     authentication;
48917fa4b9dSJohan Hedberg } __packed;
49017fa4b9dSJohan Hedberg 
491a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
492a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
493a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
494a5c29683SJohan Hedberg } __packed;
495a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
496a5c29683SJohan Hedberg 	__u8     status;
497a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
498a5c29683SJohan Hedberg } __packed;
499a5c29683SJohan Hedberg 
500a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
501a5c29683SJohan Hedberg 
5029ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
5039ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
5049ad4019aSBrian Gix 	bdaddr_t bdaddr;
5059ad4019aSBrian Gix 	__le32	passkey;
5069ad4019aSBrian Gix } __packed;
5079ad4019aSBrian Gix 
5089ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
5099ad4019aSBrian Gix 
5102763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
5112763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
5122763eda6SSzymon Janc 	bdaddr_t bdaddr;
5132763eda6SSzymon Janc 	__u8     hash[16];
5142763eda6SSzymon Janc 	__u8     randomizer[16];
5152763eda6SSzymon Janc } __packed;
5162763eda6SSzymon Janc 
5172763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
5182763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
5192763eda6SSzymon Janc 	bdaddr_t bdaddr;
5202763eda6SSzymon Janc } __packed;
5212763eda6SSzymon Janc 
52203b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
52303b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
52403b555e1SJohan Hedberg 	bdaddr_t bdaddr;
52503b555e1SJohan Hedberg 	__u8     reason;
52603b555e1SJohan Hedberg } __packed;
52703b555e1SJohan Hedberg 
528a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
529a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
530a9de9248SMarcel Holtmann 	__le16   handle;
531a9de9248SMarcel Holtmann 	__le16   max_interval;
532a9de9248SMarcel Holtmann 	__le16   min_interval;
533a9de9248SMarcel Holtmann 	__le16   attempt;
534a9de9248SMarcel Holtmann 	__le16   timeout;
53566c853ccSGustavo F. Padovan } __packed;
536a9de9248SMarcel Holtmann 
537a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
538a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
539a9de9248SMarcel Holtmann 	__le16   handle;
54066c853ccSGustavo F. Padovan } __packed;
541a9de9248SMarcel Holtmann 
542a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
543a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
544a9de9248SMarcel Holtmann 	__le16   handle;
54566c853ccSGustavo F. Padovan } __packed;
546a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
547a9de9248SMarcel Holtmann 	__u8     status;
548a9de9248SMarcel Holtmann 	__le16   handle;
549a9de9248SMarcel Holtmann 	__u8     role;
55066c853ccSGustavo F. Padovan } __packed;
551a9de9248SMarcel Holtmann 
552a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
553a9de9248SMarcel Holtmann struct hci_cp_switch_role {
554a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
555a9de9248SMarcel Holtmann 	__u8     role;
55666c853ccSGustavo F. Padovan } __packed;
557a9de9248SMarcel Holtmann 
558a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
559a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
560a9de9248SMarcel Holtmann 	__le16   handle;
56166c853ccSGustavo F. Padovan } __packed;
562a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
563a9de9248SMarcel Holtmann 	__u8     status;
564a9de9248SMarcel Holtmann 	__le16   handle;
565a9de9248SMarcel Holtmann 	__le16   policy;
56666c853ccSGustavo F. Padovan } __packed;
567a9de9248SMarcel Holtmann 
568a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
569a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
570a9de9248SMarcel Holtmann 	__le16   handle;
571a9de9248SMarcel Holtmann 	__le16   policy;
57266c853ccSGustavo F. Padovan } __packed;
573a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
574a9de9248SMarcel Holtmann 	__u8     status;
575a9de9248SMarcel Holtmann 	__le16   handle;
57666c853ccSGustavo F. Padovan } __packed;
577a9de9248SMarcel Holtmann 
578e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
579e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
580e4e8e37cSMarcel Holtmann 	__u8     status;
581e4e8e37cSMarcel Holtmann 	__le16   policy;
58266c853ccSGustavo F. Padovan } __packed;
583e4e8e37cSMarcel Holtmann 
584e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
585e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
586e4e8e37cSMarcel Holtmann 	__le16   policy;
58766c853ccSGustavo F. Padovan } __packed;
588e4e8e37cSMarcel Holtmann 
589a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
590a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
591a9de9248SMarcel Holtmann 	__le16   handle;
592a9de9248SMarcel Holtmann 	__le16   max_latency;
593a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
594a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
59566c853ccSGustavo F. Padovan } __packed;
596a9de9248SMarcel Holtmann 
597a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
598a9de9248SMarcel Holtmann struct hci_cp_set_event_mask {
599a9de9248SMarcel Holtmann 	__u8     mask[8];
60066c853ccSGustavo F. Padovan } __packed;
601a9de9248SMarcel Holtmann 
602a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
603a9de9248SMarcel Holtmann 
604a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
6051da177e4SLinus Torvalds struct hci_cp_set_event_flt {
6061da177e4SLinus Torvalds 	__u8     flt_type;
6071da177e4SLinus Torvalds 	__u8     cond_type;
6081da177e4SLinus Torvalds 	__u8     condition[0];
60966c853ccSGustavo F. Padovan } __packed;
6101da177e4SLinus Torvalds 
6111da177e4SLinus Torvalds /* Filter types */
6121da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
6131da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
6141da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
6151da177e4SLinus Torvalds 
6161da177e4SLinus Torvalds /* CONN_SETUP Condition types */
6171da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
6181da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
6191da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
6201da177e4SLinus Torvalds 
6211da177e4SLinus Torvalds /* CONN_SETUP Conditions */
6221da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
6231da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
6241da177e4SLinus Torvalds 
625b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
626b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
627b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
628b0916ea0SJohan Hedberg 	__u8     delete_all;
629b0916ea0SJohan Hedberg } __packed;
630b0916ea0SJohan Hedberg 
6311f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
6321f6c6378SJohan Hedberg 
633a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
634a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
6351f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
63666c853ccSGustavo F. Padovan } __packed;
637a9de9248SMarcel Holtmann 
638a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
639a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
640a9de9248SMarcel Holtmann 	__u8     status;
6411f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
64266c853ccSGustavo F. Padovan } __packed;
643a9de9248SMarcel Holtmann 
644a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
645a9de9248SMarcel Holtmann 
646a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
647a9de9248SMarcel Holtmann 
648a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
649a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
650a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
651a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
652a9de9248SMarcel Holtmann 
653a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
654a9de9248SMarcel Holtmann 
655a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
656a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
657a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
658a9de9248SMarcel Holtmann 
659a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
660a9de9248SMarcel Holtmann 
661a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
662a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
663a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
664a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
665a9de9248SMarcel Holtmann 
666a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
667a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
6681da177e4SLinus Torvalds 	__u8     status;
6691da177e4SLinus Torvalds 	__u8     dev_class[3];
67066c853ccSGustavo F. Padovan } __packed;
6711da177e4SLinus Torvalds 
672a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
673a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
6741da177e4SLinus Torvalds 	__u8     dev_class[3];
67566c853ccSGustavo F. Padovan } __packed;
6761da177e4SLinus Torvalds 
677a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
6781da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
6791da177e4SLinus Torvalds 	__u8     status;
6801ebb9252SMarcel Holtmann 	__le16   voice_setting;
68166c853ccSGustavo F. Padovan } __packed;
6821da177e4SLinus Torvalds 
683a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
6841da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
6851ebb9252SMarcel Holtmann 	__le16   voice_setting;
68666c853ccSGustavo F. Padovan } __packed;
6871da177e4SLinus Torvalds 
688a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
6891da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
6901ebb9252SMarcel Holtmann 	__le16   acl_mtu;
6911da177e4SLinus Torvalds 	__u8     sco_mtu;
6921ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
6931ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
69466c853ccSGustavo F. Padovan } __packed;
6951da177e4SLinus Torvalds 
696d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
697d5859e22SJohan Hedberg 
69880a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
69980a1e1dbSJohan Hedberg 
70080a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
70180a1e1dbSJohan Hedberg struct hci_cp_write_eir {
702816a11d5SJohan Hedberg 	__u8	fec;
703816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
70480a1e1dbSJohan Hedberg } __packed;
70580a1e1dbSJohan Hedberg 
706333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
707333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
708333140b5SMarcel Holtmann 	__u8     status;
709333140b5SMarcel Holtmann 	__u8     mode;
71066c853ccSGustavo F. Padovan } __packed;
711333140b5SMarcel Holtmann 
712333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
713333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
714333140b5SMarcel Holtmann 	__u8     mode;
71566c853ccSGustavo F. Padovan } __packed;
716333140b5SMarcel Holtmann 
717c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
718c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
719c35938b2SSzymon Janc 	__u8     status;
720c35938b2SSzymon Janc 	__u8     hash[16];
721c35938b2SSzymon Janc 	__u8     randomizer[16];
722c35938b2SSzymon Janc } __packed;
723c35938b2SSzymon Janc 
724d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
72591c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
72691c4e9b1SMarcel Holtmann 	__u8     status;
72791c4e9b1SMarcel Holtmann 	__s8     tx_power;
72891c4e9b1SMarcel Holtmann } __packed;
729d5859e22SJohan Hedberg 
7301e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
7311e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
7321e89cffbSAndrei Emeltchenko 	__u8     status;
7331e89cffbSAndrei Emeltchenko 	__u8     mode;
7341e89cffbSAndrei Emeltchenko } __packed;
7351e89cffbSAndrei Emeltchenko 
736f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
737f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
738f9b49306SAndre Guedes 	__u8	le;
739f9b49306SAndre Guedes 	__u8	simul;
740f9b49306SAndre Guedes } __packed;
741f9b49306SAndre Guedes 
742a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
743a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
7441da177e4SLinus Torvalds 	__u8     status;
745a9de9248SMarcel Holtmann 	__u8     hci_ver;
746a9de9248SMarcel Holtmann 	__le16   hci_rev;
747a9de9248SMarcel Holtmann 	__u8     lmp_ver;
748a9de9248SMarcel Holtmann 	__le16   manufacturer;
749a9de9248SMarcel Holtmann 	__le16   lmp_subver;
75066c853ccSGustavo F. Padovan } __packed;
7511da177e4SLinus Torvalds 
752a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
753a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
7541da177e4SLinus Torvalds 	__u8     status;
755a9de9248SMarcel Holtmann 	__u8     commands[64];
75666c853ccSGustavo F. Padovan } __packed;
7571da177e4SLinus Torvalds 
758a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
759a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
760a9de9248SMarcel Holtmann 	__u8     status;
761a9de9248SMarcel Holtmann 	__u8     features[8];
76266c853ccSGustavo F. Padovan } __packed;
763a9de9248SMarcel Holtmann 
764a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
765971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
766971e3a4bSAndre Guedes 	__u8     page;
767971e3a4bSAndre Guedes } __packed;
768a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
769a9de9248SMarcel Holtmann 	__u8     status;
770a9de9248SMarcel Holtmann 	__u8     page;
771a9de9248SMarcel Holtmann 	__u8     max_page;
772a9de9248SMarcel Holtmann 	__u8     features[8];
77366c853ccSGustavo F. Padovan } __packed;
774a9de9248SMarcel Holtmann 
775a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
776a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
777a9de9248SMarcel Holtmann 	__u8     status;
778a9de9248SMarcel Holtmann 	__le16   acl_mtu;
779a9de9248SMarcel Holtmann 	__u8     sco_mtu;
780a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
781a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
78266c853ccSGustavo F. Padovan } __packed;
783a9de9248SMarcel Holtmann 
784a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
785a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
786a9de9248SMarcel Holtmann 	__u8     status;
7871da177e4SLinus Torvalds 	bdaddr_t bdaddr;
78866c853ccSGustavo F. Padovan } __packed;
7891da177e4SLinus Torvalds 
790350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
791350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
792350ee4cfSAndrei Emeltchenko 	__u8     status;
793350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
794350ee4cfSAndrei Emeltchenko 	__le16   block_len;
795350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
796350ee4cfSAndrei Emeltchenko } __packed;
797350ee4cfSAndrei Emeltchenko 
798f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
799f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
800f6422ec6SAntti Julku 	__le16   interval;
801f6422ec6SAntti Julku 	__le16   window;
802f6422ec6SAntti Julku } __packed;
803f6422ec6SAntti Julku 
804f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
805f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
806f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
807f6422ec6SAntti Julku 
808928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
809928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
810928abaa7SAndrei Emeltchenko 	__u8     status;
811928abaa7SAndrei Emeltchenko 	__u8     amp_status;
812928abaa7SAndrei Emeltchenko 	__le32   total_bw;
813928abaa7SAndrei Emeltchenko 	__le32   max_bw;
814928abaa7SAndrei Emeltchenko 	__le32   min_latency;
815928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
816928abaa7SAndrei Emeltchenko 	__u8     amp_type;
817928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
818928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
819928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
820928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
821928abaa7SAndrei Emeltchenko } __packed;
822928abaa7SAndrei Emeltchenko 
82363185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
82463185f64SVille Tervo struct hci_cp_le_set_event_mask {
82563185f64SVille Tervo 	__u8     mask[8];
82663185f64SVille Tervo } __packed;
82763185f64SVille Tervo 
82863185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
82963185f64SVille Tervo struct hci_rp_le_read_buffer_size {
83063185f64SVille Tervo 	__u8     status;
83163185f64SVille Tervo 	__le16   le_mtu;
83263185f64SVille Tervo 	__u8     le_max_pkt;
83363185f64SVille Tervo } __packed;
83463185f64SVille Tervo 
83507f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
83607f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
83707f7fa5dSAndre Guedes 	__u8    type;
83807f7fa5dSAndre Guedes 	__le16  interval;
83907f7fa5dSAndre Guedes 	__le16  window;
84007f7fa5dSAndre Guedes 	__u8    own_address_type;
84107f7fa5dSAndre Guedes 	__u8    filter_policy;
84207f7fa5dSAndre Guedes } __packed;
84307f7fa5dSAndre Guedes 
84468a8aea4SAndrei Emeltchenko #define LE_SCANNING_DISABLED		0x00
84568a8aea4SAndrei Emeltchenko #define LE_SCANNING_ENABLED		0x01
84668a8aea4SAndrei Emeltchenko 
847eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
848eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
849eb9d91f5SAndre Guedes 	__u8     enable;
850eb9d91f5SAndre Guedes 	__u8     filter_dup;
851eb9d91f5SAndre Guedes } __packed;
852eb9d91f5SAndre Guedes 
85363185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
85463185f64SVille Tervo struct hci_cp_le_create_conn {
85563185f64SVille Tervo 	__le16   scan_interval;
85663185f64SVille Tervo 	__le16   scan_window;
85763185f64SVille Tervo 	__u8     filter_policy;
85863185f64SVille Tervo 	__u8     peer_addr_type;
85963185f64SVille Tervo 	bdaddr_t peer_addr;
86063185f64SVille Tervo 	__u8     own_address_type;
86163185f64SVille Tervo 	__le16   conn_interval_min;
86263185f64SVille Tervo 	__le16   conn_interval_max;
86363185f64SVille Tervo 	__le16   conn_latency;
86463185f64SVille Tervo 	__le16   supervision_timeout;
86563185f64SVille Tervo 	__le16   min_ce_len;
86663185f64SVille Tervo 	__le16   max_ce_len;
86763185f64SVille Tervo } __packed;
86863185f64SVille Tervo 
86963185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
87063185f64SVille Tervo 
8712ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
8722ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
8732ce603ebSClaudio Takahasi 	__le16   handle;
8742ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
8752ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
8762ce603ebSClaudio Takahasi 	__le16   conn_latency;
8772ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
8782ce603ebSClaudio Takahasi 	__le16   min_ce_len;
8792ce603ebSClaudio Takahasi 	__le16   max_ce_len;
8802ce603ebSClaudio Takahasi } __packed;
8812ce603ebSClaudio Takahasi 
882a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
883a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
884a7a595f6SVinicius Costa Gomes 	__le16	handle;
885a7a595f6SVinicius Costa Gomes 	__u8	rand[8];
886a7a595f6SVinicius Costa Gomes 	__le16	ediv;
887a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
888a7a595f6SVinicius Costa Gomes } __packed;
889a7a595f6SVinicius Costa Gomes 
890a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
891a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
892a7a595f6SVinicius Costa Gomes 	__le16	handle;
893a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
894a7a595f6SVinicius Costa Gomes } __packed;
895a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
896a7a595f6SVinicius Costa Gomes 	__u8	status;
897a7a595f6SVinicius Costa Gomes 	__le16	handle;
898a7a595f6SVinicius Costa Gomes } __packed;
899a7a595f6SVinicius Costa Gomes 
900a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
901a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
902a7a595f6SVinicius Costa Gomes 	__le16	handle;
903a7a595f6SVinicius Costa Gomes } __packed;
904a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
905a7a595f6SVinicius Costa Gomes 	__u8	status;
906a7a595f6SVinicius Costa Gomes 	__le16	handle;
907a7a595f6SVinicius Costa Gomes } __packed;
908a7a595f6SVinicius Costa Gomes 
9091da177e4SLinus Torvalds /* ---- HCI Events ---- */
9101da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
9111da177e4SLinus Torvalds 
9121da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
9131da177e4SLinus Torvalds struct inquiry_info {
9141da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9151da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
9161da177e4SLinus Torvalds 	__u8     pscan_period_mode;
9171da177e4SLinus Torvalds 	__u8     pscan_mode;
9181da177e4SLinus Torvalds 	__u8     dev_class[3];
9191ebb9252SMarcel Holtmann 	__le16   clock_offset;
92066c853ccSGustavo F. Padovan } __packed;
9211da177e4SLinus Torvalds 
9221da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
9231da177e4SLinus Torvalds struct hci_ev_conn_complete {
9241da177e4SLinus Torvalds 	__u8     status;
9251ebb9252SMarcel Holtmann 	__le16   handle;
9261da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9271da177e4SLinus Torvalds 	__u8     link_type;
9281da177e4SLinus Torvalds 	__u8     encr_mode;
92966c853ccSGustavo F. Padovan } __packed;
9301da177e4SLinus Torvalds 
9311da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
9321da177e4SLinus Torvalds struct hci_ev_conn_request {
9331da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9341da177e4SLinus Torvalds 	__u8     dev_class[3];
9351da177e4SLinus Torvalds 	__u8     link_type;
93666c853ccSGustavo F. Padovan } __packed;
9371da177e4SLinus Torvalds 
9381da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
9391da177e4SLinus Torvalds struct hci_ev_disconn_complete {
9401da177e4SLinus Torvalds 	__u8     status;
9411ebb9252SMarcel Holtmann 	__le16   handle;
9421da177e4SLinus Torvalds 	__u8     reason;
94366c853ccSGustavo F. Padovan } __packed;
9441da177e4SLinus Torvalds 
9451da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
9461da177e4SLinus Torvalds struct hci_ev_auth_complete {
9471da177e4SLinus Torvalds 	__u8     status;
9481ebb9252SMarcel Holtmann 	__le16   handle;
94966c853ccSGustavo F. Padovan } __packed;
9501da177e4SLinus Torvalds 
951a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
952a9de9248SMarcel Holtmann struct hci_ev_remote_name {
953a9de9248SMarcel Holtmann 	__u8     status;
954a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
9551f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
95666c853ccSGustavo F. Padovan } __packed;
957a9de9248SMarcel Holtmann 
9581da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
9591da177e4SLinus Torvalds struct hci_ev_encrypt_change {
9601da177e4SLinus Torvalds 	__u8     status;
9611ebb9252SMarcel Holtmann 	__le16   handle;
9621da177e4SLinus Torvalds 	__u8     encrypt;
96366c853ccSGustavo F. Padovan } __packed;
9641da177e4SLinus Torvalds 
965a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
966a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
9671da177e4SLinus Torvalds 	__u8     status;
9681ebb9252SMarcel Holtmann 	__le16   handle;
96966c853ccSGustavo F. Padovan } __packed;
9701da177e4SLinus Torvalds 
971a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
972a9de9248SMarcel Holtmann struct hci_ev_remote_features {
973a9de9248SMarcel Holtmann 	__u8     status;
974a9de9248SMarcel Holtmann 	__le16   handle;
975a9de9248SMarcel Holtmann 	__u8     features[8];
97666c853ccSGustavo F. Padovan } __packed;
977a9de9248SMarcel Holtmann 
978a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
979a9de9248SMarcel Holtmann struct hci_ev_remote_version {
980a9de9248SMarcel Holtmann 	__u8     status;
981a9de9248SMarcel Holtmann 	__le16   handle;
982a9de9248SMarcel Holtmann 	__u8     lmp_ver;
983a9de9248SMarcel Holtmann 	__le16   manufacturer;
984a9de9248SMarcel Holtmann 	__le16   lmp_subver;
98566c853ccSGustavo F. Padovan } __packed;
986a9de9248SMarcel Holtmann 
987a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
9881da177e4SLinus Torvalds struct hci_qos {
9891da177e4SLinus Torvalds 	__u8     service_type;
9901da177e4SLinus Torvalds 	__u32    token_rate;
9911da177e4SLinus Torvalds 	__u32    peak_bandwidth;
9921da177e4SLinus Torvalds 	__u32    latency;
9931da177e4SLinus Torvalds 	__u32    delay_variation;
99466c853ccSGustavo F. Padovan } __packed;
9951da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
9961da177e4SLinus Torvalds 	__u8     status;
9971ebb9252SMarcel Holtmann 	__le16   handle;
9981da177e4SLinus Torvalds 	struct   hci_qos qos;
99966c853ccSGustavo F. Padovan } __packed;
10001da177e4SLinus Torvalds 
1001a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
10021da177e4SLinus Torvalds struct hci_ev_cmd_complete {
10031da177e4SLinus Torvalds 	__u8     ncmd;
10041ebb9252SMarcel Holtmann 	__le16   opcode;
100566c853ccSGustavo F. Padovan } __packed;
10061da177e4SLinus Torvalds 
1007a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
10081da177e4SLinus Torvalds struct hci_ev_cmd_status {
10091da177e4SLinus Torvalds 	__u8     status;
10101da177e4SLinus Torvalds 	__u8     ncmd;
10111ebb9252SMarcel Holtmann 	__le16   opcode;
101266c853ccSGustavo F. Padovan } __packed;
10131da177e4SLinus Torvalds 
10141da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
10151da177e4SLinus Torvalds struct hci_ev_role_change {
10161da177e4SLinus Torvalds 	__u8     status;
10171da177e4SLinus Torvalds 	bdaddr_t bdaddr;
10181da177e4SLinus Torvalds 	__u8     role;
101966c853ccSGustavo F. Padovan } __packed;
10201da177e4SLinus Torvalds 
1021a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1022613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1023613a1c0cSAndrei Emeltchenko 	__le16   handle;
1024613a1c0cSAndrei Emeltchenko 	__le16   count;
1025613a1c0cSAndrei Emeltchenko } __packed;
1026613a1c0cSAndrei Emeltchenko 
1027a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1028a9de9248SMarcel Holtmann 	__u8     num_hndl;
1029613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
103066c853ccSGustavo F. Padovan } __packed;
1031a9de9248SMarcel Holtmann 
10321da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
10331da177e4SLinus Torvalds struct hci_ev_mode_change {
10341da177e4SLinus Torvalds 	__u8     status;
10351ebb9252SMarcel Holtmann 	__le16   handle;
10361da177e4SLinus Torvalds 	__u8     mode;
10371ebb9252SMarcel Holtmann 	__le16   interval;
103866c853ccSGustavo F. Padovan } __packed;
10391da177e4SLinus Torvalds 
10401da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
10411da177e4SLinus Torvalds struct hci_ev_pin_code_req {
10421da177e4SLinus Torvalds 	bdaddr_t bdaddr;
104366c853ccSGustavo F. Padovan } __packed;
10441da177e4SLinus Torvalds 
10451da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
10461da177e4SLinus Torvalds struct hci_ev_link_key_req {
10471da177e4SLinus Torvalds 	bdaddr_t bdaddr;
104866c853ccSGustavo F. Padovan } __packed;
10491da177e4SLinus Torvalds 
10501da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
10511da177e4SLinus Torvalds struct hci_ev_link_key_notify {
10521da177e4SLinus Torvalds 	bdaddr_t bdaddr;
10539b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
10541da177e4SLinus Torvalds 	__u8     key_type;
105566c853ccSGustavo F. Padovan } __packed;
10561da177e4SLinus Torvalds 
1057a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
10581da177e4SLinus Torvalds struct hci_ev_clock_offset {
10591da177e4SLinus Torvalds 	__u8     status;
10601ebb9252SMarcel Holtmann 	__le16   handle;
10611ebb9252SMarcel Holtmann 	__le16   clock_offset;
106266c853ccSGustavo F. Padovan } __packed;
10631da177e4SLinus Torvalds 
1064a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1065a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1066a8746417SMarcel Holtmann 	__u8     status;
1067a8746417SMarcel Holtmann 	__le16   handle;
1068a8746417SMarcel Holtmann 	__le16   pkt_type;
106966c853ccSGustavo F. Padovan } __packed;
1070a8746417SMarcel Holtmann 
107185a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
107285a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
107385a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
107485a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
107566c853ccSGustavo F. Padovan } __packed;
107685a1e930SMarcel Holtmann 
1077a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1078a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1079a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1080a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1081a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1082a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1083a9de9248SMarcel Holtmann 	__le16   clock_offset;
1084a9de9248SMarcel Holtmann 	__s8     rssi;
108566c853ccSGustavo F. Padovan } __packed;
1086a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1087a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1088a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1089a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1090a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1091a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1092a9de9248SMarcel Holtmann 	__le16   clock_offset;
1093a9de9248SMarcel Holtmann 	__s8     rssi;
109466c853ccSGustavo F. Padovan } __packed;
1095a9de9248SMarcel Holtmann 
1096a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1097a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1098a9de9248SMarcel Holtmann 	__u8     status;
1099a9de9248SMarcel Holtmann 	__le16   handle;
1100a9de9248SMarcel Holtmann 	__u8     page;
1101a9de9248SMarcel Holtmann 	__u8     max_page;
1102a9de9248SMarcel Holtmann 	__u8     features[8];
110366c853ccSGustavo F. Padovan } __packed;
1104a9de9248SMarcel Holtmann 
1105a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1106a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1107a9de9248SMarcel Holtmann 	__u8     status;
1108a9de9248SMarcel Holtmann 	__le16   handle;
1109a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1110a9de9248SMarcel Holtmann 	__u8     link_type;
1111a9de9248SMarcel Holtmann 	__u8     tx_interval;
1112a9de9248SMarcel Holtmann 	__u8     retrans_window;
1113a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1114a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1115a9de9248SMarcel Holtmann 	__u8     air_mode;
111666c853ccSGustavo F. Padovan } __packed;
1117a9de9248SMarcel Holtmann 
1118a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1119a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1120a9de9248SMarcel Holtmann 	__u8     status;
1121a9de9248SMarcel Holtmann 	__le16   handle;
1122a9de9248SMarcel Holtmann 	__u8     tx_interval;
1123a9de9248SMarcel Holtmann 	__u8     retrans_window;
1124a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1125a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
112666c853ccSGustavo F. Padovan } __packed;
1127a9de9248SMarcel Holtmann 
1128a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
112904837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
113004837f64SMarcel Holtmann 	__u8     status;
113104837f64SMarcel Holtmann 	__le16   handle;
113204837f64SMarcel Holtmann 	__le16   max_tx_latency;
113304837f64SMarcel Holtmann 	__le16   max_rx_latency;
113404837f64SMarcel Holtmann 	__le16   max_remote_timeout;
113504837f64SMarcel Holtmann 	__le16   max_local_timeout;
113666c853ccSGustavo F. Padovan } __packed;
113704837f64SMarcel Holtmann 
1138a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1139a9de9248SMarcel Holtmann struct extended_inquiry_info {
1140a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1141a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1142a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1143a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1144a9de9248SMarcel Holtmann 	__le16   clock_offset;
1145a9de9248SMarcel Holtmann 	__s8     rssi;
1146a9de9248SMarcel Holtmann 	__u8     data[240];
114766c853ccSGustavo F. Padovan } __packed;
1148a9de9248SMarcel Holtmann 
11490493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
11500493684eSMarcel Holtmann struct hci_ev_io_capa_request {
11510493684eSMarcel Holtmann 	bdaddr_t bdaddr;
115266c853ccSGustavo F. Padovan } __packed;
11530493684eSMarcel Holtmann 
115403b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
115503b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
115603b555e1SJohan Hedberg 	bdaddr_t bdaddr;
115703b555e1SJohan Hedberg 	__u8     capability;
115803b555e1SJohan Hedberg 	__u8     oob_data;
115903b555e1SJohan Hedberg 	__u8     authentication;
116003b555e1SJohan Hedberg } __packed;
116103b555e1SJohan Hedberg 
1162a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1163a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1164a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1165a5c29683SJohan Hedberg 	__le32		passkey;
1166a5c29683SJohan Hedberg } __packed;
1167a5c29683SJohan Hedberg 
11689ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
11699ad4019aSBrian Gix struct hci_ev_user_passkey_req {
11709ad4019aSBrian Gix 	bdaddr_t	bdaddr;
11719ad4019aSBrian Gix } __packed;
11729ad4019aSBrian Gix 
11732763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
11742763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
11752763eda6SSzymon Janc 	bdaddr_t bdaddr;
11762763eda6SSzymon Janc } __packed;
11772763eda6SSzymon Janc 
11780493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
11790493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
11800493684eSMarcel Holtmann 	__u8     status;
11810493684eSMarcel Holtmann 	bdaddr_t bdaddr;
118266c853ccSGustavo F. Padovan } __packed;
11830493684eSMarcel Holtmann 
118441a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
118541a96212SMarcel Holtmann struct hci_ev_remote_host_features {
118641a96212SMarcel Holtmann 	bdaddr_t bdaddr;
118741a96212SMarcel Holtmann 	__u8     features[8];
118866c853ccSGustavo F. Padovan } __packed;
118941a96212SMarcel Holtmann 
119063185f64SVille Tervo #define HCI_EV_LE_META			0x3e
119163185f64SVille Tervo struct hci_ev_le_meta {
119263185f64SVille Tervo 	__u8     subevent;
119363185f64SVille Tervo } __packed;
119463185f64SVille Tervo 
119525e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
119625e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
119725e89e99SAndrei Emeltchenko 	__le16   handle;
119825e89e99SAndrei Emeltchenko 	__le16   pkts;
119925e89e99SAndrei Emeltchenko 	__le16   blocks;
120025e89e99SAndrei Emeltchenko } __packed;
120125e89e99SAndrei Emeltchenko 
120225e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
120325e89e99SAndrei Emeltchenko 	__le16   num_blocks;
120425e89e99SAndrei Emeltchenko 	__u8     num_hndl;
120525e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
120625e89e99SAndrei Emeltchenko } __packed;
120725e89e99SAndrei Emeltchenko 
120863185f64SVille Tervo /* Low energy meta events */
120963185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
121063185f64SVille Tervo struct hci_ev_le_conn_complete {
121163185f64SVille Tervo 	__u8     status;
121263185f64SVille Tervo 	__le16   handle;
121363185f64SVille Tervo 	__u8     role;
121463185f64SVille Tervo 	__u8     bdaddr_type;
121563185f64SVille Tervo 	bdaddr_t bdaddr;
121663185f64SVille Tervo 	__le16   interval;
121763185f64SVille Tervo 	__le16   latency;
121863185f64SVille Tervo 	__le16   supervision_timeout;
121963185f64SVille Tervo 	__u8     clk_accurancy;
122063185f64SVille Tervo } __packed;
122163185f64SVille Tervo 
1222a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1223a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1224a7a595f6SVinicius Costa Gomes 	__le16	handle;
1225a7a595f6SVinicius Costa Gomes 	__u8	random[8];
1226a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1227a7a595f6SVinicius Costa Gomes } __packed;
1228a7a595f6SVinicius Costa Gomes 
122957a56fd4SAnderson Briglia /* Advertising report event types */
123057a56fd4SAnderson Briglia #define ADV_IND		0x00
123157a56fd4SAnderson Briglia #define ADV_DIRECT_IND	0x01
123257a56fd4SAnderson Briglia #define ADV_SCAN_IND	0x02
123357a56fd4SAnderson Briglia #define ADV_NONCONN_IND	0x03
123457a56fd4SAnderson Briglia #define ADV_SCAN_RSP	0x04
123557a56fd4SAnderson Briglia 
123657a56fd4SAnderson Briglia #define ADDR_LE_DEV_PUBLIC	0x00
123757a56fd4SAnderson Briglia #define ADDR_LE_DEV_RANDOM	0x01
123857a56fd4SAnderson Briglia 
123957a56fd4SAnderson Briglia #define HCI_EV_LE_ADVERTISING_REPORT	0x02
124057a56fd4SAnderson Briglia struct hci_ev_le_advertising_info {
124157a56fd4SAnderson Briglia 	__u8	 evt_type;
124257a56fd4SAnderson Briglia 	__u8	 bdaddr_type;
124357a56fd4SAnderson Briglia 	bdaddr_t bdaddr;
124457a56fd4SAnderson Briglia 	__u8	 length;
124557a56fd4SAnderson Briglia 	__u8	 data[0];
124657a56fd4SAnderson Briglia } __packed;
124757a56fd4SAnderson Briglia 
12481da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1249a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
12501da177e4SLinus Torvalds struct hci_ev_stack_internal {
12511da177e4SLinus Torvalds 	__u16    type;
12521da177e4SLinus Torvalds 	__u8     data[0];
125366c853ccSGustavo F. Padovan } __packed;
12541da177e4SLinus Torvalds 
12551da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
12561da177e4SLinus Torvalds struct hci_ev_si_device {
12571da177e4SLinus Torvalds 	__u16    event;
12581da177e4SLinus Torvalds 	__u16    dev_id;
125966c853ccSGustavo F. Padovan } __packed;
12601da177e4SLinus Torvalds 
12611da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
12621da177e4SLinus Torvalds struct hci_ev_si_security {
12631da177e4SLinus Torvalds 	__u16    event;
12641da177e4SLinus Torvalds 	__u16    proto;
12651da177e4SLinus Torvalds 	__u16    subproto;
12661da177e4SLinus Torvalds 	__u8     incoming;
126766c853ccSGustavo F. Padovan } __packed;
12681da177e4SLinus Torvalds 
12691da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
12701da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
12711da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
12721da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
12731da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
12741da177e4SLinus Torvalds 
12751da177e4SLinus Torvalds struct hci_command_hdr {
12761ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
12771da177e4SLinus Torvalds 	__u8	plen;
127866c853ccSGustavo F. Padovan } __packed;
12791da177e4SLinus Torvalds 
12801da177e4SLinus Torvalds struct hci_event_hdr {
12811da177e4SLinus Torvalds 	__u8	evt;
12821da177e4SLinus Torvalds 	__u8	plen;
128366c853ccSGustavo F. Padovan } __packed;
12841da177e4SLinus Torvalds 
12851da177e4SLinus Torvalds struct hci_acl_hdr {
12861ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
12871ebb9252SMarcel Holtmann 	__le16	dlen;
128866c853ccSGustavo F. Padovan } __packed;
12891da177e4SLinus Torvalds 
12901da177e4SLinus Torvalds struct hci_sco_hdr {
12911ebb9252SMarcel Holtmann 	__le16	handle;
12921da177e4SLinus Torvalds 	__u8	dlen;
129366c853ccSGustavo F. Padovan } __packed;
12941da177e4SLinus Torvalds 
12952a123b86SArnaldo Carvalho de Melo #include <linux/skbuff.h>
12962a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
12972a123b86SArnaldo Carvalho de Melo {
12982a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
12992a123b86SArnaldo Carvalho de Melo }
13002a123b86SArnaldo Carvalho de Melo 
13012a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
13022a123b86SArnaldo Carvalho de Melo {
13032a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
13042a123b86SArnaldo Carvalho de Melo }
13052a123b86SArnaldo Carvalho de Melo 
13062a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
13072a123b86SArnaldo Carvalho de Melo {
13082a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
13092a123b86SArnaldo Carvalho de Melo }
13102a123b86SArnaldo Carvalho de Melo 
13111da177e4SLinus Torvalds /* Command opcode pack/unpack */
1312*c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
13131da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
13141da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
13151da177e4SLinus Torvalds 
13161da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
1317*c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
13181da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
13191da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
13201da177e4SLinus Torvalds 
13211da177e4SLinus Torvalds /* ---- HCI Sockets ---- */
13221da177e4SLinus Torvalds 
13231da177e4SLinus Torvalds /* Socket options */
13241da177e4SLinus Torvalds #define HCI_DATA_DIR	1
13251da177e4SLinus Torvalds #define HCI_FILTER	2
13261da177e4SLinus Torvalds #define HCI_TIME_STAMP	3
13271da177e4SLinus Torvalds 
13281da177e4SLinus Torvalds /* CMSG flags */
13291da177e4SLinus Torvalds #define HCI_CMSG_DIR	0x0001
13301da177e4SLinus Torvalds #define HCI_CMSG_TSTAMP	0x0002
13311da177e4SLinus Torvalds 
13321da177e4SLinus Torvalds struct sockaddr_hci {
13331da177e4SLinus Torvalds 	sa_family_t    hci_family;
13341da177e4SLinus Torvalds 	unsigned short hci_dev;
1335c02178d2SJohan Hedberg 	unsigned short hci_channel;
13361da177e4SLinus Torvalds };
13371da177e4SLinus Torvalds #define HCI_DEV_NONE	0xffff
13381da177e4SLinus Torvalds 
1339c02178d2SJohan Hedberg #define HCI_CHANNEL_RAW		0
1340cd82e61cSMarcel Holtmann #define HCI_CHANNEL_MONITOR	2
134166f3b913SGustavo Padovan #define HCI_CHANNEL_CONTROL	3
1342c02178d2SJohan Hedberg 
13431da177e4SLinus Torvalds struct hci_filter {
13441da177e4SLinus Torvalds 	unsigned long type_mask;
13451da177e4SLinus Torvalds 	unsigned long event_mask[2];
1346905f3ed6SAl Viro 	__le16 opcode;
13471da177e4SLinus Torvalds };
13481da177e4SLinus Torvalds 
13491da177e4SLinus Torvalds struct hci_ufilter {
13501da177e4SLinus Torvalds 	__u32  type_mask;
13511da177e4SLinus Torvalds 	__u32  event_mask[2];
1352905f3ed6SAl Viro 	__le16 opcode;
13531da177e4SLinus Torvalds };
13541da177e4SLinus Torvalds 
13551da177e4SLinus Torvalds #define HCI_FLT_TYPE_BITS	31
13561da177e4SLinus Torvalds #define HCI_FLT_EVENT_BITS	63
13571da177e4SLinus Torvalds #define HCI_FLT_OGF_BITS	63
13581da177e4SLinus Torvalds #define HCI_FLT_OCF_BITS	127
13591da177e4SLinus Torvalds 
13601da177e4SLinus Torvalds /* ---- HCI Ioctl requests structures ---- */
13611da177e4SLinus Torvalds struct hci_dev_stats {
13621da177e4SLinus Torvalds 	__u32 err_rx;
13631da177e4SLinus Torvalds 	__u32 err_tx;
13641da177e4SLinus Torvalds 	__u32 cmd_tx;
13651da177e4SLinus Torvalds 	__u32 evt_rx;
13661da177e4SLinus Torvalds 	__u32 acl_tx;
13671da177e4SLinus Torvalds 	__u32 acl_rx;
13681da177e4SLinus Torvalds 	__u32 sco_tx;
13691da177e4SLinus Torvalds 	__u32 sco_rx;
13701da177e4SLinus Torvalds 	__u32 byte_rx;
13711da177e4SLinus Torvalds 	__u32 byte_tx;
13721da177e4SLinus Torvalds };
13731da177e4SLinus Torvalds 
13741da177e4SLinus Torvalds struct hci_dev_info {
13751da177e4SLinus Torvalds 	__u16 dev_id;
13761da177e4SLinus Torvalds 	char  name[8];
13771da177e4SLinus Torvalds 
13781da177e4SLinus Torvalds 	bdaddr_t bdaddr;
13791da177e4SLinus Torvalds 
13801da177e4SLinus Torvalds 	__u32 flags;
13811da177e4SLinus Torvalds 	__u8  type;
13821da177e4SLinus Torvalds 
13831da177e4SLinus Torvalds 	__u8  features[8];
13841da177e4SLinus Torvalds 
13851da177e4SLinus Torvalds 	__u32 pkt_type;
13861da177e4SLinus Torvalds 	__u32 link_policy;
13871da177e4SLinus Torvalds 	__u32 link_mode;
13881da177e4SLinus Torvalds 
13891da177e4SLinus Torvalds 	__u16 acl_mtu;
13901da177e4SLinus Torvalds 	__u16 acl_pkts;
13911da177e4SLinus Torvalds 	__u16 sco_mtu;
13921da177e4SLinus Torvalds 	__u16 sco_pkts;
13931da177e4SLinus Torvalds 
13941da177e4SLinus Torvalds 	struct hci_dev_stats stat;
13951da177e4SLinus Torvalds };
13961da177e4SLinus Torvalds 
13971da177e4SLinus Torvalds struct hci_conn_info {
13981da177e4SLinus Torvalds 	__u16    handle;
13991da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14001da177e4SLinus Torvalds 	__u8     type;
14011da177e4SLinus Torvalds 	__u8     out;
14021da177e4SLinus Torvalds 	__u16    state;
14031da177e4SLinus Torvalds 	__u32    link_mode;
14041da177e4SLinus Torvalds };
14051da177e4SLinus Torvalds 
14061da177e4SLinus Torvalds struct hci_dev_req {
14071da177e4SLinus Torvalds 	__u16  dev_id;
14081da177e4SLinus Torvalds 	__u32  dev_opt;
14091da177e4SLinus Torvalds };
14101da177e4SLinus Torvalds 
14111da177e4SLinus Torvalds struct hci_dev_list_req {
14121da177e4SLinus Torvalds 	__u16  dev_num;
14131da177e4SLinus Torvalds 	struct hci_dev_req dev_req[0];	/* hci_dev_req structures */
14141da177e4SLinus Torvalds };
14151da177e4SLinus Torvalds 
14161da177e4SLinus Torvalds struct hci_conn_list_req {
14171da177e4SLinus Torvalds 	__u16  dev_id;
14181da177e4SLinus Torvalds 	__u16  conn_num;
14191da177e4SLinus Torvalds 	struct hci_conn_info conn_info[0];
14201da177e4SLinus Torvalds };
14211da177e4SLinus Torvalds 
14221da177e4SLinus Torvalds struct hci_conn_info_req {
14231da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14241da177e4SLinus Torvalds 	__u8     type;
14251da177e4SLinus Torvalds 	struct   hci_conn_info conn_info[0];
14261da177e4SLinus Torvalds };
14271da177e4SLinus Torvalds 
142840be492fSMarcel Holtmann struct hci_auth_info_req {
142940be492fSMarcel Holtmann 	bdaddr_t bdaddr;
143040be492fSMarcel Holtmann 	__u8     type;
143140be492fSMarcel Holtmann };
143240be492fSMarcel Holtmann 
14331da177e4SLinus Torvalds struct hci_inquiry_req {
14341da177e4SLinus Torvalds 	__u16 dev_id;
14351da177e4SLinus Torvalds 	__u16 flags;
14361da177e4SLinus Torvalds 	__u8  lap[3];
14371da177e4SLinus Torvalds 	__u8  length;
14381da177e4SLinus Torvalds 	__u8  num_rsp;
14391da177e4SLinus Torvalds };
14401da177e4SLinus Torvalds #define IREQ_CACHE_FLUSH 0x0001
14411da177e4SLinus Torvalds 
14428b281b9cSFabio Estevam extern bool enable_hs;
14438830f514SAndrei Emeltchenko 
14441da177e4SLinus Torvalds #endif /* __HCI_H */
1445