xref: /openbmc/linux/include/net/bluetooth/hci.h (revision 84bde9d6c0e6830f4a8685a5d237965053118bf9)
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 
331da177e4SLinus Torvalds /* HCI dev events */
341da177e4SLinus Torvalds #define HCI_DEV_REG			1
351da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
361da177e4SLinus Torvalds #define HCI_DEV_UP			3
371da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
381da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
391da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
401da177e4SLinus Torvalds 
411da177e4SLinus Torvalds /* HCI notify events */
421da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
431da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
441da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
451da177e4SLinus Torvalds 
46c13854ceSMarcel Holtmann /* HCI bus types */
470ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
481da177e4SLinus Torvalds #define HCI_USB		1
491da177e4SLinus Torvalds #define HCI_PCCARD	2
501da177e4SLinus Torvalds #define HCI_UART	3
511da177e4SLinus Torvalds #define HCI_RS232	4
521da177e4SLinus Torvalds #define HCI_PCI		5
530ac53939SMarcel Holtmann #define HCI_SDIO	6
541da177e4SLinus Torvalds 
55943da25dSMarcel Holtmann /* HCI controller types */
56943da25dSMarcel Holtmann #define HCI_BREDR	0x00
578f1e1742SDavid Vrabel #define HCI_AMP		0x01
58943da25dSMarcel Holtmann 
591da177e4SLinus Torvalds /* HCI device quirks */
601da177e4SLinus Torvalds enum {
617a9d4020SMarcel Holtmann 	HCI_QUIRK_NO_RESET,
62da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
63da1f5198SMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE
641da177e4SLinus Torvalds };
651da177e4SLinus Torvalds 
661da177e4SLinus Torvalds /* HCI device flags */
671da177e4SLinus Torvalds enum {
681da177e4SLinus Torvalds 	HCI_UP,
691da177e4SLinus Torvalds 	HCI_INIT,
701da177e4SLinus Torvalds 	HCI_RUNNING,
711da177e4SLinus Torvalds 
721da177e4SLinus Torvalds 	HCI_PSCAN,
731da177e4SLinus Torvalds 	HCI_ISCAN,
741da177e4SLinus Torvalds 	HCI_AUTH,
751da177e4SLinus Torvalds 	HCI_ENCRYPT,
761da177e4SLinus Torvalds 	HCI_INQUIRY,
771da177e4SLinus Torvalds 
781da177e4SLinus Torvalds 	HCI_RAW,
79ab81cbf9SJohan Hedberg 
8010572132SGustavo F. Padovan 	HCI_RESET,
811da177e4SLinus Torvalds };
821da177e4SLinus Torvalds 
83d23264a8SAndre Guedes /*
84d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
85d23264a8SAndre Guedes  * states from the controller.
86d23264a8SAndre Guedes  */
87d23264a8SAndre Guedes enum {
88a8b2d5c2SJohan Hedberg 	HCI_SETUP,
89a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
90a8b2d5c2SJohan Hedberg 	HCI_MGMT,
91a8b2d5c2SJohan Hedberg 	HCI_PAIRABLE,
92a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
93a8b2d5c2SJohan Hedberg 	HCI_LINK_KEYS,
94a8b2d5c2SJohan Hedberg 	HCI_DEBUG_KEYS,
95a8b2d5c2SJohan Hedberg 
96d23264a8SAndre Guedes 	HCI_LE_SCAN,
97*84bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
98d23264a8SAndre Guedes };
99d23264a8SAndre Guedes 
1001da177e4SLinus Torvalds /* HCI ioctl defines */
1011da177e4SLinus Torvalds #define HCIDEVUP	_IOW('H', 201, int)
1021da177e4SLinus Torvalds #define HCIDEVDOWN	_IOW('H', 202, int)
1031da177e4SLinus Torvalds #define HCIDEVRESET	_IOW('H', 203, int)
1041da177e4SLinus Torvalds #define HCIDEVRESTAT	_IOW('H', 204, int)
1051da177e4SLinus Torvalds 
1061da177e4SLinus Torvalds #define HCIGETDEVLIST	_IOR('H', 210, int)
1071da177e4SLinus Torvalds #define HCIGETDEVINFO	_IOR('H', 211, int)
1081da177e4SLinus Torvalds #define HCIGETCONNLIST	_IOR('H', 212, int)
1091da177e4SLinus Torvalds #define HCIGETCONNINFO	_IOR('H', 213, int)
11040be492fSMarcel Holtmann #define HCIGETAUTHINFO	_IOR('H', 215, int)
1111da177e4SLinus Torvalds 
1121da177e4SLinus Torvalds #define HCISETRAW	_IOW('H', 220, int)
1131da177e4SLinus Torvalds #define HCISETSCAN	_IOW('H', 221, int)
1141da177e4SLinus Torvalds #define HCISETAUTH	_IOW('H', 222, int)
1151da177e4SLinus Torvalds #define HCISETENCRYPT	_IOW('H', 223, int)
1161da177e4SLinus Torvalds #define HCISETPTYPE	_IOW('H', 224, int)
1171da177e4SLinus Torvalds #define HCISETLINKPOL	_IOW('H', 225, int)
1181da177e4SLinus Torvalds #define HCISETLINKMODE	_IOW('H', 226, int)
1191da177e4SLinus Torvalds #define HCISETACLMTU	_IOW('H', 227, int)
1201da177e4SLinus Torvalds #define HCISETSCOMTU	_IOW('H', 228, int)
1211da177e4SLinus Torvalds 
122f0358568SJohan Hedberg #define HCIBLOCKADDR	_IOW('H', 230, int)
123f0358568SJohan Hedberg #define HCIUNBLOCKADDR	_IOW('H', 231, int)
124f0358568SJohan Hedberg 
1251da177e4SLinus Torvalds #define HCIINQUIRY	_IOR('H', 240, int)
1261da177e4SLinus Torvalds 
1271da177e4SLinus Torvalds /* HCI timeouts */
12804837f64SMarcel Holtmann #define HCI_CONNECT_TIMEOUT	(40000)	/* 40 seconds */
12904837f64SMarcel Holtmann #define HCI_DISCONN_TIMEOUT	(2000)	/* 2 seconds */
130052b30b0SMarcel Holtmann #define HCI_PAIRING_TIMEOUT	(60000)	/* 60 seconds */
13104837f64SMarcel Holtmann #define HCI_IDLE_TIMEOUT	(6000)	/* 6 seconds */
13204837f64SMarcel Holtmann #define HCI_INIT_TIMEOUT	(10000)	/* 10 seconds */
1336bd32326SVille Tervo #define HCI_CMD_TIMEOUT		(1000)	/* 1 seconds */
134cc48dc0aSAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	(45000)	/* 45 seconds */
1351da177e4SLinus Torvalds 
1365b7f9909SMarcel Holtmann /* HCI data types */
1371da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
1381da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
1391da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
1401da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
1411da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
1421da177e4SLinus Torvalds 
1435b7f9909SMarcel Holtmann /* HCI packet types */
1441da177e4SLinus Torvalds #define HCI_DM1		0x0008
1451da177e4SLinus Torvalds #define HCI_DM3		0x0400
1461da177e4SLinus Torvalds #define HCI_DM5		0x4000
1471da177e4SLinus Torvalds #define HCI_DH1		0x0010
1481da177e4SLinus Torvalds #define HCI_DH3		0x0800
1491da177e4SLinus Torvalds #define HCI_DH5		0x8000
1501da177e4SLinus Torvalds 
1511da177e4SLinus Torvalds #define HCI_HV1		0x0020
1521da177e4SLinus Torvalds #define HCI_HV2		0x0040
1531da177e4SLinus Torvalds #define HCI_HV3		0x0080
1541da177e4SLinus Torvalds 
1551da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
1561da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
1571da177e4SLinus Torvalds 
1585b7f9909SMarcel Holtmann /* eSCO packet types */
1595b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
1605b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
1615b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
1625b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
1635b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
1645b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
165efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
166efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
167efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
168efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
1695b7f9909SMarcel Holtmann 
170a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
171efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
172a8746417SMarcel Holtmann 
1731da177e4SLinus Torvalds /* ACL flags */
174e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
1751da177e4SLinus Torvalds #define ACL_CONT		0x01
1761da177e4SLinus Torvalds #define ACL_START		0x02
1771da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
1781da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
1791da177e4SLinus Torvalds 
1801da177e4SLinus Torvalds /* Baseband links */
1811da177e4SLinus Torvalds #define SCO_LINK	0x00
1821da177e4SLinus Torvalds #define ACL_LINK	0x01
1835b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
184fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
185fcd89c09SVille Tervo #define LE_LINK		0x80
1861da177e4SLinus Torvalds 
1871da177e4SLinus Torvalds /* LMP features */
1881da177e4SLinus Torvalds #define LMP_3SLOT	0x01
1891da177e4SLinus Torvalds #define LMP_5SLOT	0x02
1901da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
1911da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
1921da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
1931da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
1941da177e4SLinus Torvalds #define LMP_HOLD	0x40
19504837f64SMarcel Holtmann #define LMP_SNIFF	0x80
1961da177e4SLinus Torvalds 
1971da177e4SLinus Torvalds #define LMP_PARK	0x01
1981da177e4SLinus Torvalds #define LMP_RSSI	0x02
1991da177e4SLinus Torvalds #define LMP_QUALITY	0x04
2001da177e4SLinus Torvalds #define LMP_SCO		0x08
2011da177e4SLinus Torvalds #define LMP_HV2		0x10
2021da177e4SLinus Torvalds #define LMP_HV3		0x20
2031da177e4SLinus Torvalds #define LMP_ULAW	0x40
2041da177e4SLinus Torvalds #define LMP_ALAW	0x80
2051da177e4SLinus Torvalds 
2061da177e4SLinus Torvalds #define LMP_CVSD	0x01
2071da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
2081da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
2091da177e4SLinus Torvalds 
210d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
2115b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
2125b7f9909SMarcel Holtmann 
2135b7f9909SMarcel Holtmann #define LMP_EV4		0x01
2145b7f9909SMarcel Holtmann #define LMP_EV5		0x02
21569ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
216d5859e22SJohan Hedberg #define LMP_LE		0x40
2175b7f9909SMarcel Holtmann 
21804837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
219d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
220efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
221efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
222efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
22304837f64SMarcel Holtmann 
224d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
225e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
226769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
227e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
228769be974SMarcel Holtmann 
229d5859e22SJohan Hedberg #define LMP_LSTO	0x01
230d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
231971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
232d5859e22SJohan Hedberg 
233eead27daSAndre Guedes /* Extended LMP features */
234eead27daSAndre Guedes #define LMP_HOST_LE	0x02
235eead27daSAndre Guedes 
23604837f64SMarcel Holtmann /* Connection modes */
23704837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
23804837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
23904837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
24004837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
24104837f64SMarcel Holtmann 
2421da177e4SLinus Torvalds /* Link policies */
2431da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
2441da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
2451da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
2461da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
2471da177e4SLinus Torvalds 
24804837f64SMarcel Holtmann /* Link modes */
2491da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
2501da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
2511da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
2521da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
2531da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
2541da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
2551da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
2561da177e4SLinus Torvalds 
25740be492fSMarcel Holtmann /* Authentication types */
25840be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
25940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
26040be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
26140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
26240be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
26340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
26440be492fSMarcel Holtmann 
265b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
266b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
267b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
268b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
269b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
270b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_UNAUTH_COMBINATION	0x04
271b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_AUTH_COMBINATION		0x05
272b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
27334918cd7SVinicius Costa Gomes /* The spec doesn't define types for SMP keys */
27434918cd7SVinicius Costa Gomes #define HCI_LK_SMP_LTK			0x81
27534918cd7SVinicius Costa Gomes #define HCI_LK_SMP_IRK			0x82
27634918cd7SVinicius Costa Gomes #define HCI_LK_SMP_CSRK			0x83
277b6020ba0SWaldemar Rymarkiewicz 
2789f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
2799f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
2809f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
2819f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
2829f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
2839f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
2849f5a0d7bSAndrei Emeltchenko 
2852455a3eaSAndrei Emeltchenko /* Flow control modes */
2862455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
2872455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
2882455a3eaSAndrei Emeltchenko 
28932748db0SJohan Hedberg /* Extended Inquiry Response field types */
29032748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
29132748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
29232748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
29332748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
29432748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
29532748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
29632748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
29732748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
29832748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
29932748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
3009ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
3019ec9fc8aSJohan Hedberg #define EIR_SSP_HASH_C		0x0E /* Simple Pairing Hash C */
3029ec9fc8aSJohan Hedberg #define EIR_SSP_RAND_R		0x0F /* Simple Pairing Randomizer R */
30332748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
30432748db0SJohan Hedberg 
3051da177e4SLinus Torvalds /* -----  HCI Commands ---- */
3066bd32326SVille Tervo #define HCI_OP_NOP			0x0000
3076bd32326SVille Tervo 
308a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
309a9de9248SMarcel Holtmann struct hci_cp_inquiry {
310a9de9248SMarcel Holtmann 	__u8     lap[3];
311a9de9248SMarcel Holtmann 	__u8     length;
312a9de9248SMarcel Holtmann 	__u8     num_rsp;
31366c853ccSGustavo F. Padovan } __packed;
3141da177e4SLinus Torvalds 
315a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
316a9de9248SMarcel Holtmann 
317a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
318a9de9248SMarcel Holtmann 
319a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
320a9de9248SMarcel Holtmann struct hci_cp_create_conn {
321a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
322a9de9248SMarcel Holtmann 	__le16   pkt_type;
323a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
324a9de9248SMarcel Holtmann 	__u8     pscan_mode;
325a9de9248SMarcel Holtmann 	__le16   clock_offset;
326a9de9248SMarcel Holtmann 	__u8     role_switch;
32766c853ccSGustavo F. Padovan } __packed;
3281da177e4SLinus Torvalds 
329a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
330a9de9248SMarcel Holtmann struct hci_cp_disconnect {
331a9de9248SMarcel Holtmann 	__le16   handle;
332a9de9248SMarcel Holtmann 	__u8     reason;
33366c853ccSGustavo F. Padovan } __packed;
3341da177e4SLinus Torvalds 
335a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
336a9de9248SMarcel Holtmann struct hci_cp_add_sco {
337a9de9248SMarcel Holtmann 	__le16   handle;
338a9de9248SMarcel Holtmann 	__le16   pkt_type;
33966c853ccSGustavo F. Padovan } __packed;
340a9de9248SMarcel Holtmann 
341a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
342a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
3431da177e4SLinus Torvalds 	bdaddr_t bdaddr;
34466c853ccSGustavo F. Padovan } __packed;
3451da177e4SLinus Torvalds 
346a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
347a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
348a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
349a9de9248SMarcel Holtmann 	__u8     role;
35066c853ccSGustavo F. Padovan } __packed;
3511da177e4SLinus Torvalds 
352a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
353a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
354a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
355a9de9248SMarcel Holtmann 	__u8     reason;
35666c853ccSGustavo F. Padovan } __packed;
3571da177e4SLinus Torvalds 
358a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
359a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
360a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
361a9de9248SMarcel Holtmann 	__u8     link_key[16];
36266c853ccSGustavo F. Padovan } __packed;
3631da177e4SLinus Torvalds 
364a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
365a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
366a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
36766c853ccSGustavo F. Padovan } __packed;
3681da177e4SLinus Torvalds 
369a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
370a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
371a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
372a9de9248SMarcel Holtmann 	__u8     pin_len;
373a9de9248SMarcel Holtmann 	__u8     pin_code[16];
37466c853ccSGustavo F. Padovan } __packed;
375980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
376980e1a53SJohan Hedberg 	__u8     status;
377980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
378980e1a53SJohan Hedberg } __packed;
379a9de9248SMarcel Holtmann 
380a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
381a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
382a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
38366c853ccSGustavo F. Padovan } __packed;
384980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
385980e1a53SJohan Hedberg 	__u8     status;
386980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
387980e1a53SJohan Hedberg } __packed;
388a9de9248SMarcel Holtmann 
389a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
390a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
391a9de9248SMarcel Holtmann 	__le16   handle;
392a9de9248SMarcel Holtmann 	__le16   pkt_type;
39366c853ccSGustavo F. Padovan } __packed;
394a9de9248SMarcel Holtmann 
395a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
396a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
397a9de9248SMarcel Holtmann 	__le16   handle;
39866c853ccSGustavo F. Padovan } __packed;
399a9de9248SMarcel Holtmann 
400a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
401a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
402a9de9248SMarcel Holtmann 	__le16   handle;
403a9de9248SMarcel Holtmann 	__u8     encrypt;
40466c853ccSGustavo F. Padovan } __packed;
405a9de9248SMarcel Holtmann 
406a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
407a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
408a9de9248SMarcel Holtmann 	__le16   handle;
40966c853ccSGustavo F. Padovan } __packed;
410a9de9248SMarcel Holtmann 
411a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
412a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
413a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
414a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
415a9de9248SMarcel Holtmann 	__u8     pscan_mode;
416a9de9248SMarcel Holtmann 	__le16   clock_offset;
41766c853ccSGustavo F. Padovan } __packed;
418a9de9248SMarcel Holtmann 
419a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
420a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
421a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
42266c853ccSGustavo F. Padovan } __packed;
423a9de9248SMarcel Holtmann 
424a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
425a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
426a9de9248SMarcel Holtmann 	__le16   handle;
42766c853ccSGustavo F. Padovan } __packed;
428a9de9248SMarcel Holtmann 
429a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
430a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
431a9de9248SMarcel Holtmann 	__le16   handle;
432a9de9248SMarcel Holtmann 	__u8     page;
43366c853ccSGustavo F. Padovan } __packed;
434a9de9248SMarcel Holtmann 
435a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
436a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
437a9de9248SMarcel Holtmann 	__le16   handle;
43866c853ccSGustavo F. Padovan } __packed;
439a9de9248SMarcel Holtmann 
440a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
441a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
442a9de9248SMarcel Holtmann 	__le16   handle;
443a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
444a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
445a9de9248SMarcel Holtmann 	__le16   max_latency;
446a9de9248SMarcel Holtmann 	__le16   voice_setting;
447a9de9248SMarcel Holtmann 	__u8     retrans_effort;
448a9de9248SMarcel Holtmann 	__le16   pkt_type;
44966c853ccSGustavo F. Padovan } __packed;
450a9de9248SMarcel Holtmann 
451a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
452a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
453a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
454a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
455a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
456a9de9248SMarcel Holtmann 	__le16   max_latency;
457a9de9248SMarcel Holtmann 	__le16   content_format;
458a9de9248SMarcel Holtmann 	__u8     retrans_effort;
459a9de9248SMarcel Holtmann 	__le16   pkt_type;
46066c853ccSGustavo F. Padovan } __packed;
461a9de9248SMarcel Holtmann 
462a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
463a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
464a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
465a9de9248SMarcel Holtmann 	__u8     reason;
46666c853ccSGustavo F. Padovan } __packed;
467a9de9248SMarcel Holtmann 
46817fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
46917fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
47017fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
47117fa4b9dSJohan Hedberg 	__u8     capability;
47217fa4b9dSJohan Hedberg 	__u8     oob_data;
47317fa4b9dSJohan Hedberg 	__u8     authentication;
47417fa4b9dSJohan Hedberg } __packed;
47517fa4b9dSJohan Hedberg 
476a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
477a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
478a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
479a5c29683SJohan Hedberg } __packed;
480a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
481a5c29683SJohan Hedberg 	__u8     status;
482a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
483a5c29683SJohan Hedberg } __packed;
484a5c29683SJohan Hedberg 
485a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
486a5c29683SJohan Hedberg 
4879ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
4889ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
4899ad4019aSBrian Gix 	bdaddr_t bdaddr;
4909ad4019aSBrian Gix 	__le32	passkey;
4919ad4019aSBrian Gix } __packed;
4929ad4019aSBrian Gix 
4939ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
4949ad4019aSBrian Gix 
4952763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
4962763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
4972763eda6SSzymon Janc 	bdaddr_t bdaddr;
4982763eda6SSzymon Janc 	__u8     hash[16];
4992763eda6SSzymon Janc 	__u8     randomizer[16];
5002763eda6SSzymon Janc } __packed;
5012763eda6SSzymon Janc 
5022763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
5032763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
5042763eda6SSzymon Janc 	bdaddr_t bdaddr;
5052763eda6SSzymon Janc } __packed;
5062763eda6SSzymon Janc 
50703b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
50803b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
50903b555e1SJohan Hedberg 	bdaddr_t bdaddr;
51003b555e1SJohan Hedberg 	__u8     reason;
51103b555e1SJohan Hedberg } __packed;
51203b555e1SJohan Hedberg 
513a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
514a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
515a9de9248SMarcel Holtmann 	__le16   handle;
516a9de9248SMarcel Holtmann 	__le16   max_interval;
517a9de9248SMarcel Holtmann 	__le16   min_interval;
518a9de9248SMarcel Holtmann 	__le16   attempt;
519a9de9248SMarcel Holtmann 	__le16   timeout;
52066c853ccSGustavo F. Padovan } __packed;
521a9de9248SMarcel Holtmann 
522a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
523a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
524a9de9248SMarcel Holtmann 	__le16   handle;
52566c853ccSGustavo F. Padovan } __packed;
526a9de9248SMarcel Holtmann 
527a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
528a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
529a9de9248SMarcel Holtmann 	__le16   handle;
53066c853ccSGustavo F. Padovan } __packed;
531a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
532a9de9248SMarcel Holtmann 	__u8     status;
533a9de9248SMarcel Holtmann 	__le16   handle;
534a9de9248SMarcel Holtmann 	__u8     role;
53566c853ccSGustavo F. Padovan } __packed;
536a9de9248SMarcel Holtmann 
537a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
538a9de9248SMarcel Holtmann struct hci_cp_switch_role {
539a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
540a9de9248SMarcel Holtmann 	__u8     role;
54166c853ccSGustavo F. Padovan } __packed;
542a9de9248SMarcel Holtmann 
543a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
544a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
545a9de9248SMarcel Holtmann 	__le16   handle;
54666c853ccSGustavo F. Padovan } __packed;
547a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
548a9de9248SMarcel Holtmann 	__u8     status;
549a9de9248SMarcel Holtmann 	__le16   handle;
550a9de9248SMarcel Holtmann 	__le16   policy;
55166c853ccSGustavo F. Padovan } __packed;
552a9de9248SMarcel Holtmann 
553a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
554a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
555a9de9248SMarcel Holtmann 	__le16   handle;
556a9de9248SMarcel Holtmann 	__le16   policy;
55766c853ccSGustavo F. Padovan } __packed;
558a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
559a9de9248SMarcel Holtmann 	__u8     status;
560a9de9248SMarcel Holtmann 	__le16   handle;
56166c853ccSGustavo F. Padovan } __packed;
562a9de9248SMarcel Holtmann 
563e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
564e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
565e4e8e37cSMarcel Holtmann 	__u8     status;
566e4e8e37cSMarcel Holtmann 	__le16   policy;
56766c853ccSGustavo F. Padovan } __packed;
568e4e8e37cSMarcel Holtmann 
569e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
570e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
571e4e8e37cSMarcel Holtmann 	__le16   policy;
57266c853ccSGustavo F. Padovan } __packed;
573e4e8e37cSMarcel Holtmann 
574a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
575a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
576a9de9248SMarcel Holtmann 	__le16   handle;
577a9de9248SMarcel Holtmann 	__le16   max_latency;
578a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
579a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
58066c853ccSGustavo F. Padovan } __packed;
581a9de9248SMarcel Holtmann 
582a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
583a9de9248SMarcel Holtmann struct hci_cp_set_event_mask {
584a9de9248SMarcel Holtmann 	__u8     mask[8];
58566c853ccSGustavo F. Padovan } __packed;
586a9de9248SMarcel Holtmann 
587a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
588a9de9248SMarcel Holtmann 
589a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
5901da177e4SLinus Torvalds struct hci_cp_set_event_flt {
5911da177e4SLinus Torvalds 	__u8     flt_type;
5921da177e4SLinus Torvalds 	__u8     cond_type;
5931da177e4SLinus Torvalds 	__u8     condition[0];
59466c853ccSGustavo F. Padovan } __packed;
5951da177e4SLinus Torvalds 
5961da177e4SLinus Torvalds /* Filter types */
5971da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
5981da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
5991da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
6001da177e4SLinus Torvalds 
6011da177e4SLinus Torvalds /* CONN_SETUP Condition types */
6021da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
6031da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
6041da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
6051da177e4SLinus Torvalds 
6061da177e4SLinus Torvalds /* CONN_SETUP Conditions */
6071da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF	0x01
6081da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON	0x02
6091da177e4SLinus Torvalds 
610b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
611b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
612b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
613b0916ea0SJohan Hedberg 	__u8     delete_all;
614b0916ea0SJohan Hedberg } __packed;
615b0916ea0SJohan Hedberg 
6161f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
6171f6c6378SJohan Hedberg 
618a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
619a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
6201f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
62166c853ccSGustavo F. Padovan } __packed;
622a9de9248SMarcel Holtmann 
623a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
624a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
625a9de9248SMarcel Holtmann 	__u8     status;
6261f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
62766c853ccSGustavo F. Padovan } __packed;
628a9de9248SMarcel Holtmann 
629a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
630a9de9248SMarcel Holtmann 
631a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
632a9de9248SMarcel Holtmann 
633a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
634a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
635a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
636a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
637a9de9248SMarcel Holtmann 
638a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
639a9de9248SMarcel Holtmann 
640a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
641a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
642a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
643a9de9248SMarcel Holtmann 
644a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
645a9de9248SMarcel Holtmann 
646a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
647a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
648a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
649a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
650a9de9248SMarcel Holtmann 
651a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
652a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
6531da177e4SLinus Torvalds 	__u8     status;
6541da177e4SLinus Torvalds 	__u8     dev_class[3];
65566c853ccSGustavo F. Padovan } __packed;
6561da177e4SLinus Torvalds 
657a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
658a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
6591da177e4SLinus Torvalds 	__u8     dev_class[3];
66066c853ccSGustavo F. Padovan } __packed;
6611da177e4SLinus Torvalds 
662a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
6631da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
6641da177e4SLinus Torvalds 	__u8     status;
6651ebb9252SMarcel Holtmann 	__le16   voice_setting;
66666c853ccSGustavo F. Padovan } __packed;
6671da177e4SLinus Torvalds 
668a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
6691da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
6701ebb9252SMarcel Holtmann 	__le16   voice_setting;
67166c853ccSGustavo F. Padovan } __packed;
6721da177e4SLinus Torvalds 
673a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
6741da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
6751ebb9252SMarcel Holtmann 	__le16   acl_mtu;
6761da177e4SLinus Torvalds 	__u8     sco_mtu;
6771ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
6781ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
67966c853ccSGustavo F. Padovan } __packed;
6801da177e4SLinus Torvalds 
681d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
682d5859e22SJohan Hedberg 
68380a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
68480a1e1dbSJohan Hedberg 
68580a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
68680a1e1dbSJohan Hedberg struct hci_cp_write_eir {
68780a1e1dbSJohan Hedberg 	uint8_t		fec;
68880a1e1dbSJohan Hedberg 	uint8_t		data[HCI_MAX_EIR_LENGTH];
68980a1e1dbSJohan Hedberg } __packed;
69080a1e1dbSJohan Hedberg 
691333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
692333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
693333140b5SMarcel Holtmann 	__u8     status;
694333140b5SMarcel Holtmann 	__u8     mode;
69566c853ccSGustavo F. Padovan } __packed;
696333140b5SMarcel Holtmann 
697333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
698333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
699333140b5SMarcel Holtmann 	__u8     mode;
70066c853ccSGustavo F. Padovan } __packed;
701333140b5SMarcel Holtmann 
702c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
703c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
704c35938b2SSzymon Janc 	__u8     status;
705c35938b2SSzymon Janc 	__u8     hash[16];
706c35938b2SSzymon Janc 	__u8     randomizer[16];
707c35938b2SSzymon Janc } __packed;
708c35938b2SSzymon Janc 
709d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
710d5859e22SJohan Hedberg 
7111e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
7121e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
7131e89cffbSAndrei Emeltchenko 	__u8     status;
7141e89cffbSAndrei Emeltchenko 	__u8     mode;
7151e89cffbSAndrei Emeltchenko } __packed;
7161e89cffbSAndrei Emeltchenko 
717f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
718f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
719f9b49306SAndre Guedes 	__u8 le;
720f9b49306SAndre Guedes 	__u8 simul;
721f9b49306SAndre Guedes } __packed;
722f9b49306SAndre Guedes 
723a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
724a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
7251da177e4SLinus Torvalds 	__u8     status;
726a9de9248SMarcel Holtmann 	__u8     hci_ver;
727a9de9248SMarcel Holtmann 	__le16   hci_rev;
728a9de9248SMarcel Holtmann 	__u8     lmp_ver;
729a9de9248SMarcel Holtmann 	__le16   manufacturer;
730a9de9248SMarcel Holtmann 	__le16   lmp_subver;
73166c853ccSGustavo F. Padovan } __packed;
7321da177e4SLinus Torvalds 
733a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
734a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
7351da177e4SLinus Torvalds 	__u8     status;
736a9de9248SMarcel Holtmann 	__u8     commands[64];
73766c853ccSGustavo F. Padovan } __packed;
7381da177e4SLinus Torvalds 
739a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
740a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
741a9de9248SMarcel Holtmann 	__u8     status;
742a9de9248SMarcel Holtmann 	__u8     features[8];
74366c853ccSGustavo F. Padovan } __packed;
744a9de9248SMarcel Holtmann 
745a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
746971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
747971e3a4bSAndre Guedes 	__u8     page;
748971e3a4bSAndre Guedes } __packed;
749a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
750a9de9248SMarcel Holtmann 	__u8     status;
751a9de9248SMarcel Holtmann 	__u8     page;
752a9de9248SMarcel Holtmann 	__u8     max_page;
753a9de9248SMarcel Holtmann 	__u8     features[8];
75466c853ccSGustavo F. Padovan } __packed;
755a9de9248SMarcel Holtmann 
756a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
757a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
758a9de9248SMarcel Holtmann 	__u8     status;
759a9de9248SMarcel Holtmann 	__le16   acl_mtu;
760a9de9248SMarcel Holtmann 	__u8     sco_mtu;
761a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
762a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
76366c853ccSGustavo F. Padovan } __packed;
764a9de9248SMarcel Holtmann 
765a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
766a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
767a9de9248SMarcel Holtmann 	__u8     status;
7681da177e4SLinus Torvalds 	bdaddr_t bdaddr;
76966c853ccSGustavo F. Padovan } __packed;
7701da177e4SLinus Torvalds 
771350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
772350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
773350ee4cfSAndrei Emeltchenko 	__u8     status;
774350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
775350ee4cfSAndrei Emeltchenko 	__le16   block_len;
776350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
777350ee4cfSAndrei Emeltchenko } __packed;
778350ee4cfSAndrei Emeltchenko 
779f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
780f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
781f6422ec6SAntti Julku 	__le16   interval;
782f6422ec6SAntti Julku 	__le16   window;
783f6422ec6SAntti Julku } __packed;
784f6422ec6SAntti Julku 
785f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
786f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
787f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
788f6422ec6SAntti Julku 
789928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
790928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
791928abaa7SAndrei Emeltchenko 	__u8     status;
792928abaa7SAndrei Emeltchenko 	__u8     amp_status;
793928abaa7SAndrei Emeltchenko 	__le32   total_bw;
794928abaa7SAndrei Emeltchenko 	__le32   max_bw;
795928abaa7SAndrei Emeltchenko 	__le32   min_latency;
796928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
797928abaa7SAndrei Emeltchenko 	__u8     amp_type;
798928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
799928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
800928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
801928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
802928abaa7SAndrei Emeltchenko } __packed;
803928abaa7SAndrei Emeltchenko 
80463185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
80563185f64SVille Tervo struct hci_cp_le_set_event_mask {
80663185f64SVille Tervo 	__u8     mask[8];
80763185f64SVille Tervo } __packed;
80863185f64SVille Tervo 
80963185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
81063185f64SVille Tervo struct hci_rp_le_read_buffer_size {
81163185f64SVille Tervo 	__u8     status;
81263185f64SVille Tervo 	__le16   le_mtu;
81363185f64SVille Tervo 	__u8     le_max_pkt;
81463185f64SVille Tervo } __packed;
81563185f64SVille Tervo 
81607f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
81707f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
81807f7fa5dSAndre Guedes 	__u8    type;
81907f7fa5dSAndre Guedes 	__le16  interval;
82007f7fa5dSAndre Guedes 	__le16  window;
82107f7fa5dSAndre Guedes 	__u8    own_address_type;
82207f7fa5dSAndre Guedes 	__u8    filter_policy;
82307f7fa5dSAndre Guedes } __packed;
82407f7fa5dSAndre Guedes 
82568a8aea4SAndrei Emeltchenko #define LE_SCANNING_DISABLED		0x00
82668a8aea4SAndrei Emeltchenko #define LE_SCANNING_ENABLED		0x01
82768a8aea4SAndrei Emeltchenko 
828eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
829eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
830eb9d91f5SAndre Guedes 	__u8     enable;
831eb9d91f5SAndre Guedes 	__u8     filter_dup;
832eb9d91f5SAndre Guedes } __packed;
833eb9d91f5SAndre Guedes 
83463185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
83563185f64SVille Tervo struct hci_cp_le_create_conn {
83663185f64SVille Tervo 	__le16   scan_interval;
83763185f64SVille Tervo 	__le16   scan_window;
83863185f64SVille Tervo 	__u8     filter_policy;
83963185f64SVille Tervo 	__u8     peer_addr_type;
84063185f64SVille Tervo 	bdaddr_t peer_addr;
84163185f64SVille Tervo 	__u8     own_address_type;
84263185f64SVille Tervo 	__le16   conn_interval_min;
84363185f64SVille Tervo 	__le16   conn_interval_max;
84463185f64SVille Tervo 	__le16   conn_latency;
84563185f64SVille Tervo 	__le16   supervision_timeout;
84663185f64SVille Tervo 	__le16   min_ce_len;
84763185f64SVille Tervo 	__le16   max_ce_len;
84863185f64SVille Tervo } __packed;
84963185f64SVille Tervo 
85063185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
85163185f64SVille Tervo 
8522ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
8532ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
8542ce603ebSClaudio Takahasi 	__le16   handle;
8552ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
8562ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
8572ce603ebSClaudio Takahasi 	__le16   conn_latency;
8582ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
8592ce603ebSClaudio Takahasi 	__le16   min_ce_len;
8602ce603ebSClaudio Takahasi 	__le16   max_ce_len;
8612ce603ebSClaudio Takahasi } __packed;
8622ce603ebSClaudio Takahasi 
863a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
864a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
865a7a595f6SVinicius Costa Gomes 	__le16	handle;
866a7a595f6SVinicius Costa Gomes 	__u8	rand[8];
867a7a595f6SVinicius Costa Gomes 	__le16	ediv;
868a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
869a7a595f6SVinicius Costa Gomes } __packed;
870a7a595f6SVinicius Costa Gomes 
871a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
872a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
873a7a595f6SVinicius Costa Gomes 	__le16	handle;
874a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
875a7a595f6SVinicius Costa Gomes } __packed;
876a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
877a7a595f6SVinicius Costa Gomes 	__u8	status;
878a7a595f6SVinicius Costa Gomes 	__le16	handle;
879a7a595f6SVinicius Costa Gomes } __packed;
880a7a595f6SVinicius Costa Gomes 
881a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
882a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
883a7a595f6SVinicius Costa Gomes 	__le16	handle;
884a7a595f6SVinicius Costa Gomes } __packed;
885a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
886a7a595f6SVinicius Costa Gomes 	__u8	status;
887a7a595f6SVinicius Costa Gomes 	__le16	handle;
888a7a595f6SVinicius Costa Gomes } __packed;
889a7a595f6SVinicius Costa Gomes 
8901da177e4SLinus Torvalds /* ---- HCI Events ---- */
8911da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
8921da177e4SLinus Torvalds 
8931da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
8941da177e4SLinus Torvalds struct inquiry_info {
8951da177e4SLinus Torvalds 	bdaddr_t bdaddr;
8961da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
8971da177e4SLinus Torvalds 	__u8     pscan_period_mode;
8981da177e4SLinus Torvalds 	__u8     pscan_mode;
8991da177e4SLinus Torvalds 	__u8     dev_class[3];
9001ebb9252SMarcel Holtmann 	__le16   clock_offset;
90166c853ccSGustavo F. Padovan } __packed;
9021da177e4SLinus Torvalds 
9031da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
9041da177e4SLinus Torvalds struct hci_ev_conn_complete {
9051da177e4SLinus Torvalds 	__u8     status;
9061ebb9252SMarcel Holtmann 	__le16   handle;
9071da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9081da177e4SLinus Torvalds 	__u8     link_type;
9091da177e4SLinus Torvalds 	__u8     encr_mode;
91066c853ccSGustavo F. Padovan } __packed;
9111da177e4SLinus Torvalds 
9121da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
9131da177e4SLinus Torvalds struct hci_ev_conn_request {
9141da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9151da177e4SLinus Torvalds 	__u8     dev_class[3];
9161da177e4SLinus Torvalds 	__u8     link_type;
91766c853ccSGustavo F. Padovan } __packed;
9181da177e4SLinus Torvalds 
9191da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
9201da177e4SLinus Torvalds struct hci_ev_disconn_complete {
9211da177e4SLinus Torvalds 	__u8     status;
9221ebb9252SMarcel Holtmann 	__le16   handle;
9231da177e4SLinus Torvalds 	__u8     reason;
92466c853ccSGustavo F. Padovan } __packed;
9251da177e4SLinus Torvalds 
9261da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
9271da177e4SLinus Torvalds struct hci_ev_auth_complete {
9281da177e4SLinus Torvalds 	__u8     status;
9291ebb9252SMarcel Holtmann 	__le16   handle;
93066c853ccSGustavo F. Padovan } __packed;
9311da177e4SLinus Torvalds 
932a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
933a9de9248SMarcel Holtmann struct hci_ev_remote_name {
934a9de9248SMarcel Holtmann 	__u8     status;
935a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
9361f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
93766c853ccSGustavo F. Padovan } __packed;
938a9de9248SMarcel Holtmann 
9391da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
9401da177e4SLinus Torvalds struct hci_ev_encrypt_change {
9411da177e4SLinus Torvalds 	__u8     status;
9421ebb9252SMarcel Holtmann 	__le16   handle;
9431da177e4SLinus Torvalds 	__u8     encrypt;
94466c853ccSGustavo F. Padovan } __packed;
9451da177e4SLinus Torvalds 
946a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
947a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
9481da177e4SLinus Torvalds 	__u8     status;
9491ebb9252SMarcel Holtmann 	__le16   handle;
95066c853ccSGustavo F. Padovan } __packed;
9511da177e4SLinus Torvalds 
952a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
953a9de9248SMarcel Holtmann struct hci_ev_remote_features {
954a9de9248SMarcel Holtmann 	__u8     status;
955a9de9248SMarcel Holtmann 	__le16   handle;
956a9de9248SMarcel Holtmann 	__u8     features[8];
95766c853ccSGustavo F. Padovan } __packed;
958a9de9248SMarcel Holtmann 
959a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
960a9de9248SMarcel Holtmann struct hci_ev_remote_version {
961a9de9248SMarcel Holtmann 	__u8     status;
962a9de9248SMarcel Holtmann 	__le16   handle;
963a9de9248SMarcel Holtmann 	__u8     lmp_ver;
964a9de9248SMarcel Holtmann 	__le16   manufacturer;
965a9de9248SMarcel Holtmann 	__le16   lmp_subver;
96666c853ccSGustavo F. Padovan } __packed;
967a9de9248SMarcel Holtmann 
968a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
9691da177e4SLinus Torvalds struct hci_qos {
9701da177e4SLinus Torvalds 	__u8     service_type;
9711da177e4SLinus Torvalds 	__u32    token_rate;
9721da177e4SLinus Torvalds 	__u32    peak_bandwidth;
9731da177e4SLinus Torvalds 	__u32    latency;
9741da177e4SLinus Torvalds 	__u32    delay_variation;
97566c853ccSGustavo F. Padovan } __packed;
9761da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
9771da177e4SLinus Torvalds 	__u8     status;
9781ebb9252SMarcel Holtmann 	__le16   handle;
9791da177e4SLinus Torvalds 	struct   hci_qos qos;
98066c853ccSGustavo F. Padovan } __packed;
9811da177e4SLinus Torvalds 
982a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
9831da177e4SLinus Torvalds struct hci_ev_cmd_complete {
9841da177e4SLinus Torvalds 	__u8     ncmd;
9851ebb9252SMarcel Holtmann 	__le16   opcode;
98666c853ccSGustavo F. Padovan } __packed;
9871da177e4SLinus Torvalds 
988a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
9891da177e4SLinus Torvalds struct hci_ev_cmd_status {
9901da177e4SLinus Torvalds 	__u8     status;
9911da177e4SLinus Torvalds 	__u8     ncmd;
9921ebb9252SMarcel Holtmann 	__le16   opcode;
99366c853ccSGustavo F. Padovan } __packed;
9941da177e4SLinus Torvalds 
9951da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
9961da177e4SLinus Torvalds struct hci_ev_role_change {
9971da177e4SLinus Torvalds 	__u8     status;
9981da177e4SLinus Torvalds 	bdaddr_t bdaddr;
9991da177e4SLinus Torvalds 	__u8     role;
100066c853ccSGustavo F. Padovan } __packed;
10011da177e4SLinus Torvalds 
1002a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
1003613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
1004613a1c0cSAndrei Emeltchenko 	__le16   handle;
1005613a1c0cSAndrei Emeltchenko 	__le16   count;
1006613a1c0cSAndrei Emeltchenko } __packed;
1007613a1c0cSAndrei Emeltchenko 
1008a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
1009a9de9248SMarcel Holtmann 	__u8     num_hndl;
1010613a1c0cSAndrei Emeltchenko 	struct hci_comp_pkts_info handles[0];
101166c853ccSGustavo F. Padovan } __packed;
1012a9de9248SMarcel Holtmann 
10131da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
10141da177e4SLinus Torvalds struct hci_ev_mode_change {
10151da177e4SLinus Torvalds 	__u8     status;
10161ebb9252SMarcel Holtmann 	__le16   handle;
10171da177e4SLinus Torvalds 	__u8     mode;
10181ebb9252SMarcel Holtmann 	__le16   interval;
101966c853ccSGustavo F. Padovan } __packed;
10201da177e4SLinus Torvalds 
10211da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
10221da177e4SLinus Torvalds struct hci_ev_pin_code_req {
10231da177e4SLinus Torvalds 	bdaddr_t bdaddr;
102466c853ccSGustavo F. Padovan } __packed;
10251da177e4SLinus Torvalds 
10261da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
10271da177e4SLinus Torvalds struct hci_ev_link_key_req {
10281da177e4SLinus Torvalds 	bdaddr_t bdaddr;
102966c853ccSGustavo F. Padovan } __packed;
10301da177e4SLinus Torvalds 
10311da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
10321da177e4SLinus Torvalds struct hci_ev_link_key_notify {
10331da177e4SLinus Torvalds 	bdaddr_t bdaddr;
10341da177e4SLinus Torvalds 	__u8     link_key[16];
10351da177e4SLinus Torvalds 	__u8     key_type;
103666c853ccSGustavo F. Padovan } __packed;
10371da177e4SLinus Torvalds 
1038a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
10391da177e4SLinus Torvalds struct hci_ev_clock_offset {
10401da177e4SLinus Torvalds 	__u8     status;
10411ebb9252SMarcel Holtmann 	__le16   handle;
10421ebb9252SMarcel Holtmann 	__le16   clock_offset;
104366c853ccSGustavo F. Padovan } __packed;
10441da177e4SLinus Torvalds 
1045a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
1046a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
1047a8746417SMarcel Holtmann 	__u8     status;
1048a8746417SMarcel Holtmann 	__le16   handle;
1049a8746417SMarcel Holtmann 	__le16   pkt_type;
105066c853ccSGustavo F. Padovan } __packed;
1051a8746417SMarcel Holtmann 
105285a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
105385a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
105485a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
105585a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
105666c853ccSGustavo F. Padovan } __packed;
105785a1e930SMarcel Holtmann 
1058a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
1059a9de9248SMarcel Holtmann struct inquiry_info_with_rssi {
1060a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1061a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1062a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1063a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1064a9de9248SMarcel Holtmann 	__le16   clock_offset;
1065a9de9248SMarcel Holtmann 	__s8     rssi;
106666c853ccSGustavo F. Padovan } __packed;
1067a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode {
1068a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1069a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1070a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1071a9de9248SMarcel Holtmann 	__u8     pscan_mode;
1072a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1073a9de9248SMarcel Holtmann 	__le16   clock_offset;
1074a9de9248SMarcel Holtmann 	__s8     rssi;
107566c853ccSGustavo F. Padovan } __packed;
1076a9de9248SMarcel Holtmann 
1077a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
1078a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
1079a9de9248SMarcel Holtmann 	__u8     status;
1080a9de9248SMarcel Holtmann 	__le16   handle;
1081a9de9248SMarcel Holtmann 	__u8     page;
1082a9de9248SMarcel Holtmann 	__u8     max_page;
1083a9de9248SMarcel Holtmann 	__u8     features[8];
108466c853ccSGustavo F. Padovan } __packed;
1085a9de9248SMarcel Holtmann 
1086a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
1087a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
1088a9de9248SMarcel Holtmann 	__u8     status;
1089a9de9248SMarcel Holtmann 	__le16   handle;
1090a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1091a9de9248SMarcel Holtmann 	__u8     link_type;
1092a9de9248SMarcel Holtmann 	__u8     tx_interval;
1093a9de9248SMarcel Holtmann 	__u8     retrans_window;
1094a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1095a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
1096a9de9248SMarcel Holtmann 	__u8     air_mode;
109766c853ccSGustavo F. Padovan } __packed;
1098a9de9248SMarcel Holtmann 
1099a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
1100a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
1101a9de9248SMarcel Holtmann 	__u8     status;
1102a9de9248SMarcel Holtmann 	__le16   handle;
1103a9de9248SMarcel Holtmann 	__u8     tx_interval;
1104a9de9248SMarcel Holtmann 	__u8     retrans_window;
1105a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
1106a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
110766c853ccSGustavo F. Padovan } __packed;
1108a9de9248SMarcel Holtmann 
1109a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
111004837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
111104837f64SMarcel Holtmann 	__u8     status;
111204837f64SMarcel Holtmann 	__le16   handle;
111304837f64SMarcel Holtmann 	__le16   max_tx_latency;
111404837f64SMarcel Holtmann 	__le16   max_rx_latency;
111504837f64SMarcel Holtmann 	__le16   max_remote_timeout;
111604837f64SMarcel Holtmann 	__le16   max_local_timeout;
111766c853ccSGustavo F. Padovan } __packed;
111804837f64SMarcel Holtmann 
1119a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
1120a9de9248SMarcel Holtmann struct extended_inquiry_info {
1121a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1122a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
1123a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
1124a9de9248SMarcel Holtmann 	__u8     dev_class[3];
1125a9de9248SMarcel Holtmann 	__le16   clock_offset;
1126a9de9248SMarcel Holtmann 	__s8     rssi;
1127a9de9248SMarcel Holtmann 	__u8     data[240];
112866c853ccSGustavo F. Padovan } __packed;
1129a9de9248SMarcel Holtmann 
11300493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
11310493684eSMarcel Holtmann struct hci_ev_io_capa_request {
11320493684eSMarcel Holtmann 	bdaddr_t bdaddr;
113366c853ccSGustavo F. Padovan } __packed;
11340493684eSMarcel Holtmann 
113503b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
113603b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
113703b555e1SJohan Hedberg 	bdaddr_t bdaddr;
113803b555e1SJohan Hedberg 	__u8     capability;
113903b555e1SJohan Hedberg 	__u8     oob_data;
114003b555e1SJohan Hedberg 	__u8     authentication;
114103b555e1SJohan Hedberg } __packed;
114203b555e1SJohan Hedberg 
1143a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
1144a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
1145a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
1146a5c29683SJohan Hedberg 	__le32		passkey;
1147a5c29683SJohan Hedberg } __packed;
1148a5c29683SJohan Hedberg 
11499ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
11509ad4019aSBrian Gix struct hci_ev_user_passkey_req {
11519ad4019aSBrian Gix 	bdaddr_t	bdaddr;
11529ad4019aSBrian Gix } __packed;
11539ad4019aSBrian Gix 
11542763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
11552763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
11562763eda6SSzymon Janc 	bdaddr_t bdaddr;
11572763eda6SSzymon Janc } __packed;
11582763eda6SSzymon Janc 
11590493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
11600493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
11610493684eSMarcel Holtmann 	__u8     status;
11620493684eSMarcel Holtmann 	bdaddr_t bdaddr;
116366c853ccSGustavo F. Padovan } __packed;
11640493684eSMarcel Holtmann 
116541a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
116641a96212SMarcel Holtmann struct hci_ev_remote_host_features {
116741a96212SMarcel Holtmann 	bdaddr_t bdaddr;
116841a96212SMarcel Holtmann 	__u8     features[8];
116966c853ccSGustavo F. Padovan } __packed;
117041a96212SMarcel Holtmann 
117163185f64SVille Tervo #define HCI_EV_LE_META			0x3e
117263185f64SVille Tervo struct hci_ev_le_meta {
117363185f64SVille Tervo 	__u8     subevent;
117463185f64SVille Tervo } __packed;
117563185f64SVille Tervo 
117625e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
117725e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
117825e89e99SAndrei Emeltchenko 	__le16   handle;
117925e89e99SAndrei Emeltchenko 	__le16   pkts;
118025e89e99SAndrei Emeltchenko 	__le16   blocks;
118125e89e99SAndrei Emeltchenko } __packed;
118225e89e99SAndrei Emeltchenko 
118325e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
118425e89e99SAndrei Emeltchenko 	__le16   num_blocks;
118525e89e99SAndrei Emeltchenko 	__u8     num_hndl;
118625e89e99SAndrei Emeltchenko 	struct hci_comp_blocks_info handles[0];
118725e89e99SAndrei Emeltchenko } __packed;
118825e89e99SAndrei Emeltchenko 
118963185f64SVille Tervo /* Low energy meta events */
119063185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
119163185f64SVille Tervo struct hci_ev_le_conn_complete {
119263185f64SVille Tervo 	__u8     status;
119363185f64SVille Tervo 	__le16   handle;
119463185f64SVille Tervo 	__u8     role;
119563185f64SVille Tervo 	__u8     bdaddr_type;
119663185f64SVille Tervo 	bdaddr_t bdaddr;
119763185f64SVille Tervo 	__le16   interval;
119863185f64SVille Tervo 	__le16   latency;
119963185f64SVille Tervo 	__le16   supervision_timeout;
120063185f64SVille Tervo 	__u8     clk_accurancy;
120163185f64SVille Tervo } __packed;
120263185f64SVille Tervo 
1203a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
1204a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
1205a7a595f6SVinicius Costa Gomes 	__le16	handle;
1206a7a595f6SVinicius Costa Gomes 	__u8	random[8];
1207a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1208a7a595f6SVinicius Costa Gomes } __packed;
1209a7a595f6SVinicius Costa Gomes 
121057a56fd4SAnderson Briglia /* Advertising report event types */
121157a56fd4SAnderson Briglia #define ADV_IND		0x00
121257a56fd4SAnderson Briglia #define ADV_DIRECT_IND	0x01
121357a56fd4SAnderson Briglia #define ADV_SCAN_IND	0x02
121457a56fd4SAnderson Briglia #define ADV_NONCONN_IND	0x03
121557a56fd4SAnderson Briglia #define ADV_SCAN_RSP	0x04
121657a56fd4SAnderson Briglia 
121757a56fd4SAnderson Briglia #define ADDR_LE_DEV_PUBLIC	0x00
121857a56fd4SAnderson Briglia #define ADDR_LE_DEV_RANDOM	0x01
121957a56fd4SAnderson Briglia 
122057a56fd4SAnderson Briglia #define HCI_EV_LE_ADVERTISING_REPORT	0x02
122157a56fd4SAnderson Briglia struct hci_ev_le_advertising_info {
122257a56fd4SAnderson Briglia 	__u8	 evt_type;
122357a56fd4SAnderson Briglia 	__u8	 bdaddr_type;
122457a56fd4SAnderson Briglia 	bdaddr_t bdaddr;
122557a56fd4SAnderson Briglia 	__u8	 length;
122657a56fd4SAnderson Briglia 	__u8	 data[0];
122757a56fd4SAnderson Briglia } __packed;
122857a56fd4SAnderson Briglia 
12291da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
1230a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
12311da177e4SLinus Torvalds struct hci_ev_stack_internal {
12321da177e4SLinus Torvalds 	__u16    type;
12331da177e4SLinus Torvalds 	__u8     data[0];
123466c853ccSGustavo F. Padovan } __packed;
12351da177e4SLinus Torvalds 
12361da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
12371da177e4SLinus Torvalds struct hci_ev_si_device {
12381da177e4SLinus Torvalds 	__u16    event;
12391da177e4SLinus Torvalds 	__u16    dev_id;
124066c853ccSGustavo F. Padovan } __packed;
12411da177e4SLinus Torvalds 
12421da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
12431da177e4SLinus Torvalds struct hci_ev_si_security {
12441da177e4SLinus Torvalds 	__u16    event;
12451da177e4SLinus Torvalds 	__u16    proto;
12461da177e4SLinus Torvalds 	__u16    subproto;
12471da177e4SLinus Torvalds 	__u8     incoming;
124866c853ccSGustavo F. Padovan } __packed;
12491da177e4SLinus Torvalds 
12501da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
12511da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
12521da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
12531da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
12541da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
12551da177e4SLinus Torvalds 
12561da177e4SLinus Torvalds struct hci_command_hdr {
12571ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
12581da177e4SLinus Torvalds 	__u8	plen;
125966c853ccSGustavo F. Padovan } __packed;
12601da177e4SLinus Torvalds 
12611da177e4SLinus Torvalds struct hci_event_hdr {
12621da177e4SLinus Torvalds 	__u8	evt;
12631da177e4SLinus Torvalds 	__u8	plen;
126466c853ccSGustavo F. Padovan } __packed;
12651da177e4SLinus Torvalds 
12661da177e4SLinus Torvalds struct hci_acl_hdr {
12671ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
12681ebb9252SMarcel Holtmann 	__le16	dlen;
126966c853ccSGustavo F. Padovan } __packed;
12701da177e4SLinus Torvalds 
12711da177e4SLinus Torvalds struct hci_sco_hdr {
12721ebb9252SMarcel Holtmann 	__le16	handle;
12731da177e4SLinus Torvalds 	__u8	dlen;
127466c853ccSGustavo F. Padovan } __packed;
12751da177e4SLinus Torvalds 
12762a123b86SArnaldo Carvalho de Melo #include <linux/skbuff.h>
12772a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
12782a123b86SArnaldo Carvalho de Melo {
12792a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
12802a123b86SArnaldo Carvalho de Melo }
12812a123b86SArnaldo Carvalho de Melo 
12822a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
12832a123b86SArnaldo Carvalho de Melo {
12842a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
12852a123b86SArnaldo Carvalho de Melo }
12862a123b86SArnaldo Carvalho de Melo 
12872a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
12882a123b86SArnaldo Carvalho de Melo {
12892a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
12902a123b86SArnaldo Carvalho de Melo }
12912a123b86SArnaldo Carvalho de Melo 
12921da177e4SLinus Torvalds /* Command opcode pack/unpack */
12931da177e4SLinus Torvalds #define hci_opcode_pack(ogf, ocf)	(__u16) ((ocf & 0x03ff)|(ogf << 10))
12941da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
12951da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
12961da177e4SLinus Torvalds 
12971da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
12981da177e4SLinus Torvalds #define hci_handle_pack(h, f)	(__u16) ((h & 0x0fff)|(f << 12))
12991da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
13001da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
13011da177e4SLinus Torvalds 
13021da177e4SLinus Torvalds /* ---- HCI Sockets ---- */
13031da177e4SLinus Torvalds 
13041da177e4SLinus Torvalds /* Socket options */
13051da177e4SLinus Torvalds #define HCI_DATA_DIR	1
13061da177e4SLinus Torvalds #define HCI_FILTER	2
13071da177e4SLinus Torvalds #define HCI_TIME_STAMP	3
13081da177e4SLinus Torvalds 
13091da177e4SLinus Torvalds /* CMSG flags */
13101da177e4SLinus Torvalds #define HCI_CMSG_DIR	0x0001
13111da177e4SLinus Torvalds #define HCI_CMSG_TSTAMP	0x0002
13121da177e4SLinus Torvalds 
13131da177e4SLinus Torvalds struct sockaddr_hci {
13141da177e4SLinus Torvalds 	sa_family_t    hci_family;
13151da177e4SLinus Torvalds 	unsigned short hci_dev;
1316c02178d2SJohan Hedberg 	unsigned short hci_channel;
13171da177e4SLinus Torvalds };
13181da177e4SLinus Torvalds #define HCI_DEV_NONE	0xffff
13191da177e4SLinus Torvalds 
1320c02178d2SJohan Hedberg #define HCI_CHANNEL_RAW		0
1321c02178d2SJohan Hedberg #define HCI_CHANNEL_CONTROL	1
1322c02178d2SJohan Hedberg 
13231da177e4SLinus Torvalds struct hci_filter {
13241da177e4SLinus Torvalds 	unsigned long type_mask;
13251da177e4SLinus Torvalds 	unsigned long event_mask[2];
1326905f3ed6SAl Viro 	__le16 opcode;
13271da177e4SLinus Torvalds };
13281da177e4SLinus Torvalds 
13291da177e4SLinus Torvalds struct hci_ufilter {
13301da177e4SLinus Torvalds 	__u32  type_mask;
13311da177e4SLinus Torvalds 	__u32  event_mask[2];
1332905f3ed6SAl Viro 	__le16 opcode;
13331da177e4SLinus Torvalds };
13341da177e4SLinus Torvalds 
13351da177e4SLinus Torvalds #define HCI_FLT_TYPE_BITS	31
13361da177e4SLinus Torvalds #define HCI_FLT_EVENT_BITS	63
13371da177e4SLinus Torvalds #define HCI_FLT_OGF_BITS	63
13381da177e4SLinus Torvalds #define HCI_FLT_OCF_BITS	127
13391da177e4SLinus Torvalds 
13401da177e4SLinus Torvalds /* ---- HCI Ioctl requests structures ---- */
13411da177e4SLinus Torvalds struct hci_dev_stats {
13421da177e4SLinus Torvalds 	__u32 err_rx;
13431da177e4SLinus Torvalds 	__u32 err_tx;
13441da177e4SLinus Torvalds 	__u32 cmd_tx;
13451da177e4SLinus Torvalds 	__u32 evt_rx;
13461da177e4SLinus Torvalds 	__u32 acl_tx;
13471da177e4SLinus Torvalds 	__u32 acl_rx;
13481da177e4SLinus Torvalds 	__u32 sco_tx;
13491da177e4SLinus Torvalds 	__u32 sco_rx;
13501da177e4SLinus Torvalds 	__u32 byte_rx;
13511da177e4SLinus Torvalds 	__u32 byte_tx;
13521da177e4SLinus Torvalds };
13531da177e4SLinus Torvalds 
13541da177e4SLinus Torvalds struct hci_dev_info {
13551da177e4SLinus Torvalds 	__u16 dev_id;
13561da177e4SLinus Torvalds 	char  name[8];
13571da177e4SLinus Torvalds 
13581da177e4SLinus Torvalds 	bdaddr_t bdaddr;
13591da177e4SLinus Torvalds 
13601da177e4SLinus Torvalds 	__u32 flags;
13611da177e4SLinus Torvalds 	__u8  type;
13621da177e4SLinus Torvalds 
13631da177e4SLinus Torvalds 	__u8  features[8];
13641da177e4SLinus Torvalds 
13651da177e4SLinus Torvalds 	__u32 pkt_type;
13661da177e4SLinus Torvalds 	__u32 link_policy;
13671da177e4SLinus Torvalds 	__u32 link_mode;
13681da177e4SLinus Torvalds 
13691da177e4SLinus Torvalds 	__u16 acl_mtu;
13701da177e4SLinus Torvalds 	__u16 acl_pkts;
13711da177e4SLinus Torvalds 	__u16 sco_mtu;
13721da177e4SLinus Torvalds 	__u16 sco_pkts;
13731da177e4SLinus Torvalds 
13741da177e4SLinus Torvalds 	struct hci_dev_stats stat;
13751da177e4SLinus Torvalds };
13761da177e4SLinus Torvalds 
13771da177e4SLinus Torvalds struct hci_conn_info {
13781da177e4SLinus Torvalds 	__u16    handle;
13791da177e4SLinus Torvalds 	bdaddr_t bdaddr;
13801da177e4SLinus Torvalds 	__u8     type;
13811da177e4SLinus Torvalds 	__u8     out;
13821da177e4SLinus Torvalds 	__u16    state;
13831da177e4SLinus Torvalds 	__u32    link_mode;
13841da177e4SLinus Torvalds };
13851da177e4SLinus Torvalds 
13861da177e4SLinus Torvalds struct hci_dev_req {
13871da177e4SLinus Torvalds 	__u16  dev_id;
13881da177e4SLinus Torvalds 	__u32  dev_opt;
13891da177e4SLinus Torvalds };
13901da177e4SLinus Torvalds 
13911da177e4SLinus Torvalds struct hci_dev_list_req {
13921da177e4SLinus Torvalds 	__u16  dev_num;
13931da177e4SLinus Torvalds 	struct hci_dev_req dev_req[0];	/* hci_dev_req structures */
13941da177e4SLinus Torvalds };
13951da177e4SLinus Torvalds 
13961da177e4SLinus Torvalds struct hci_conn_list_req {
13971da177e4SLinus Torvalds 	__u16  dev_id;
13981da177e4SLinus Torvalds 	__u16  conn_num;
13991da177e4SLinus Torvalds 	struct hci_conn_info conn_info[0];
14001da177e4SLinus Torvalds };
14011da177e4SLinus Torvalds 
14021da177e4SLinus Torvalds struct hci_conn_info_req {
14031da177e4SLinus Torvalds 	bdaddr_t bdaddr;
14041da177e4SLinus Torvalds 	__u8     type;
14051da177e4SLinus Torvalds 	struct   hci_conn_info conn_info[0];
14061da177e4SLinus Torvalds };
14071da177e4SLinus Torvalds 
140840be492fSMarcel Holtmann struct hci_auth_info_req {
140940be492fSMarcel Holtmann 	bdaddr_t bdaddr;
141040be492fSMarcel Holtmann 	__u8     type;
141140be492fSMarcel Holtmann };
141240be492fSMarcel Holtmann 
14131da177e4SLinus Torvalds struct hci_inquiry_req {
14141da177e4SLinus Torvalds 	__u16 dev_id;
14151da177e4SLinus Torvalds 	__u16 flags;
14161da177e4SLinus Torvalds 	__u8  lap[3];
14171da177e4SLinus Torvalds 	__u8  length;
14181da177e4SLinus Torvalds 	__u8  num_rsp;
14191da177e4SLinus Torvalds };
14201da177e4SLinus Torvalds #define IREQ_CACHE_FLUSH 0x0001
14211da177e4SLinus Torvalds 
14228b281b9cSFabio Estevam extern bool enable_hs;
14238830f514SAndrei Emeltchenko 
14241da177e4SLinus Torvalds #endif /* __HCI_H */
1425