xref: /openbmc/linux/include/net/bluetooth/hci.h (revision fe2ccc6c29d53e14d3c8b3ddf8ad965a92e074ee)
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
304de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE	251
311da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE	260
321da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE	(HCI_MAX_ACL_SIZE + 4)
331da177e4SLinus Torvalds 
349b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE	16
35523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE	(2 * HCI_LINK_KEY_SIZE)
369b3b4460SAndrei Emeltchenko 
37903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE	672
38903e4541SAndrei Emeltchenko 
396397729bSArchie Pusaka #define HCI_MAX_CPB_DATA_SIZE	252
407d1dab49SDoHyun Pyun 
411da177e4SLinus Torvalds /* HCI dev events */
421da177e4SLinus Torvalds #define HCI_DEV_REG			1
431da177e4SLinus Torvalds #define HCI_DEV_UNREG			2
441da177e4SLinus Torvalds #define HCI_DEV_UP			3
451da177e4SLinus Torvalds #define HCI_DEV_DOWN			4
461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND			5
471da177e4SLinus Torvalds #define HCI_DEV_RESUME			6
484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN			7
494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE			8
50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP			9
511da177e4SLinus Torvalds 
521da177e4SLinus Torvalds /* HCI notify events */
531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD		1
541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL		2
551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING	3
561f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_CVSD	4
571f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_TRANSP	5
581f8330eaSSathish Narsimman #define HCI_NOTIFY_DISABLE_SCO		6
591da177e4SLinus Torvalds 
60c13854ceSMarcel Holtmann /* HCI bus types */
610ac53939SMarcel Holtmann #define HCI_VIRTUAL	0
621da177e4SLinus Torvalds #define HCI_USB		1
631da177e4SLinus Torvalds #define HCI_PCCARD	2
641da177e4SLinus Torvalds #define HCI_UART	3
651da177e4SLinus Torvalds #define HCI_RS232	4
661da177e4SLinus Torvalds #define HCI_PCI		5
670ac53939SMarcel Holtmann #define HCI_SDIO	6
685c0e03cdSJohan Hedberg #define HCI_SPI		7
695c0e03cdSJohan Hedberg #define HCI_I2C		8
7065010e68SBjorn Andersson #define HCI_SMD		9
71d2a3f5f4SMarcel Holtmann #define HCI_VIRTIO	10
721da177e4SLinus Torvalds 
73943da25dSMarcel Holtmann /* HCI controller types */
74ca8bee5dSMarcel Holtmann #define HCI_PRIMARY	0x00
758f1e1742SDavid Vrabel #define HCI_AMP		0x01
76943da25dSMarcel Holtmann 
778598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */
786ed971caSMarcel Holtmann #define AMP_ID_BREDR	0x00
798598d064SAndrei Emeltchenko 
807c13823dSMarcel Holtmann /* AMP controller types */
817c13823dSMarcel Holtmann #define AMP_TYPE_BREDR	0x00
827c13823dSMarcel Holtmann #define AMP_TYPE_80211	0x01
837c13823dSMarcel Holtmann 
84ab846ec4SAndrei Emeltchenko /* AMP controller status */
85536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN			0x00
86536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY		0x01
87536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY			0x02
88536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY			0x03
89536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY		0x04
90536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY		0x05
91536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY		0x06
92ab846ec4SAndrei Emeltchenko 
931da177e4SLinus Torvalds /* HCI device quirks */
941da177e4SLinus Torvalds enum {
95118305b5SMarcel Holtmann 	/* When this quirk is set, the HCI Reset command is send when
96118305b5SMarcel Holtmann 	 * closing the transport instead of when opening it.
97118305b5SMarcel Holtmann 	 *
98118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
99118305b5SMarcel Holtmann 	 */
100a6c511c6SSzymon Janc 	HCI_QUIRK_RESET_ON_CLOSE,
101118305b5SMarcel Holtmann 
102118305b5SMarcel Holtmann 	/* When this quirk is set, the device is turned into a raw-only
103118305b5SMarcel Holtmann 	 * device and it will stay in unconfigured state.
104118305b5SMarcel Holtmann 	 *
105118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
106118305b5SMarcel Holtmann 	 */
107da1f5198SMarcel Holtmann 	HCI_QUIRK_RAW_DEVICE,
108118305b5SMarcel Holtmann 
109118305b5SMarcel Holtmann 	/* When this quirk is set, the buffer sizes reported by
110118305b5SMarcel Holtmann 	 * HCI Read Buffer Size command are corrected if invalid.
111118305b5SMarcel Holtmann 	 *
112118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
113118305b5SMarcel Holtmann 	 */
114f9f462faSMarcel Holtmann 	HCI_QUIRK_FIXUP_BUFFER_SIZE,
115118305b5SMarcel Holtmann 
116043ec9bfSMarcel Holtmann 	/* When this quirk is set, then a controller that does not
117043ec9bfSMarcel Holtmann 	 * indicate support for Inquiry Result with RSSI is assumed to
118043ec9bfSMarcel Holtmann 	 * support it anyway. Some early Bluetooth 1.2 controllers had
119043ec9bfSMarcel Holtmann 	 * wrongly configured local features that will require forcing
120043ec9bfSMarcel Holtmann 	 * them to enable this mode. Getting RSSI information with the
121043ec9bfSMarcel Holtmann 	 * inquiry responses is preferred since it allows for a better
122e37c57a8SAlain Michaud 	 * user experience.
123043ec9bfSMarcel Holtmann 	 *
124043ec9bfSMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
125043ec9bfSMarcel Holtmann 	 */
126043ec9bfSMarcel Holtmann 	HCI_QUIRK_FIXUP_INQUIRY_MODE,
127043ec9bfSMarcel Holtmann 
128711ffa78SMarcel Holtmann 	/* When this quirk is set, then the HCI Read Local Supported
129711ffa78SMarcel Holtmann 	 * Commands command is not supported. In general Bluetooth 1.2
130711ffa78SMarcel Holtmann 	 * and later controllers should support this command. However
131711ffa78SMarcel Holtmann 	 * some controllers indicate Bluetooth 1.2 support, but do
132711ffa78SMarcel Holtmann 	 * not support this command.
133711ffa78SMarcel Holtmann 	 *
134711ffa78SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
135711ffa78SMarcel Holtmann 	 */
136711ffa78SMarcel Holtmann 	HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
137711ffa78SMarcel Holtmann 
138118305b5SMarcel Holtmann 	/* When this quirk is set, then no stored link key handling
139118305b5SMarcel Holtmann 	 * is performed. This is mainly due to the fact that the
140118305b5SMarcel Holtmann 	 * HCI Delete Stored Link Key command is advertised, but
141118305b5SMarcel Holtmann 	 * not supported.
142118305b5SMarcel Holtmann 	 *
143118305b5SMarcel Holtmann 	 * This quirk must be set before hci_register_dev is called.
144118305b5SMarcel Holtmann 	 */
145f9f462faSMarcel Holtmann 	HCI_QUIRK_BROKEN_STORED_LINK_KEY,
14689bc22d2SMarcel Holtmann 
147eb1904f4SMarcel Holtmann 	/* When this quirk is set, an external configuration step
148eb1904f4SMarcel Holtmann 	 * is required and will be indicated with the controller
149e37c57a8SAlain Michaud 	 * configuration.
150eb1904f4SMarcel Holtmann 	 *
151eb1904f4SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
152eb1904f4SMarcel Holtmann 	 * during the hdev->setup vendor callback.
153eb1904f4SMarcel Holtmann 	 */
154eb1904f4SMarcel Holtmann 	HCI_QUIRK_EXTERNAL_CONFIG,
155eb1904f4SMarcel Holtmann 
15689bc22d2SMarcel Holtmann 	/* When this quirk is set, the public Bluetooth address
15789bc22d2SMarcel Holtmann 	 * initially reported by HCI Read BD Address command
15889bc22d2SMarcel Holtmann 	 * is considered invalid. Controller configuration is
15989bc22d2SMarcel Holtmann 	 * required before this device can be used.
16089bc22d2SMarcel Holtmann 	 *
16189bc22d2SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
16289bc22d2SMarcel Holtmann 	 * during the hdev->setup vendor callback.
16389bc22d2SMarcel Holtmann 	 */
16489bc22d2SMarcel Holtmann 	HCI_QUIRK_INVALID_BDADDR,
16543d6bc46SMarcel Holtmann 
1667a0e5b15SMatthias Kaehlcke 	/* When this quirk is set, the public Bluetooth address
1677a0e5b15SMatthias Kaehlcke 	 * initially reported by HCI Read BD Address command
1687a0e5b15SMatthias Kaehlcke 	 * is considered invalid. The public BD Address can be
1697a0e5b15SMatthias Kaehlcke 	 * specified in the fwnode property 'local-bd-address'.
1707a0e5b15SMatthias Kaehlcke 	 * If this property does not exist or is invalid controller
1717a0e5b15SMatthias Kaehlcke 	 * configuration is required before this device can be used.
1727a0e5b15SMatthias Kaehlcke 	 *
1737a0e5b15SMatthias Kaehlcke 	 * This quirk can be set before hci_register_dev is called or
1747a0e5b15SMatthias Kaehlcke 	 * during the hdev->setup vendor callback.
1757a0e5b15SMatthias Kaehlcke 	 */
1767a0e5b15SMatthias Kaehlcke 	HCI_QUIRK_USE_BDADDR_PROPERTY,
1777a0e5b15SMatthias Kaehlcke 
17843d6bc46SMarcel Holtmann 	/* When this quirk is set, the duplicate filtering during
17943d6bc46SMarcel Holtmann 	 * scanning is based on Bluetooth devices addresses. To allow
18043d6bc46SMarcel Holtmann 	 * RSSI based updates, restart scanning if needed.
18143d6bc46SMarcel Holtmann 	 *
18243d6bc46SMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
18343d6bc46SMarcel Holtmann 	 * during the hdev->setup vendor callback.
18443d6bc46SMarcel Holtmann 	 */
18543d6bc46SMarcel Holtmann 	HCI_QUIRK_STRICT_DUPLICATE_FILTER,
186695c4cb6SJakub Pawlowski 
187695c4cb6SJakub Pawlowski 	/* When this quirk is set, LE scan and BR/EDR inquiry is done
188695c4cb6SJakub Pawlowski 	 * simultaneously, otherwise it's interleaved.
189695c4cb6SJakub Pawlowski 	 *
190695c4cb6SJakub Pawlowski 	 * This quirk can be set before hci_register_dev is called or
191695c4cb6SJakub Pawlowski 	 * during the hdev->setup vendor callback.
192695c4cb6SJakub Pawlowski 	 */
193695c4cb6SJakub Pawlowski 	HCI_QUIRK_SIMULTANEOUS_DISCOVERY,
1947e995b9eSMarcel Holtmann 
1957e995b9eSMarcel Holtmann 	/* When this quirk is set, the enabling of diagnostic mode is
1967e995b9eSMarcel Holtmann 	 * not persistent over HCI Reset. Every time the controller
1977e995b9eSMarcel Holtmann 	 * is brought up it needs to be reprogrammed.
1987e995b9eSMarcel Holtmann 	 *
1997e995b9eSMarcel Holtmann 	 * This quirk can be set before hci_register_dev is called or
2007e995b9eSMarcel Holtmann 	 * during the hdev->setup vendor callback.
2017e995b9eSMarcel Holtmann 	 */
2027e995b9eSMarcel Holtmann 	HCI_QUIRK_NON_PERSISTENT_DIAG,
203740011cfSSean Wang 
204740011cfSSean Wang 	/* When this quirk is set, setup() would be run after every
205740011cfSSean Wang 	 * open() and not just after the first open().
206740011cfSSean Wang 	 *
207740011cfSSean Wang 	 * This quirk can be set before hci_register_dev is called or
208740011cfSSean Wang 	 * during the hdev->setup vendor callback.
209740011cfSSean Wang 	 *
210740011cfSSean Wang 	 */
211740011cfSSean Wang 	HCI_QUIRK_NON_PERSISTENT_SETUP,
2124b127bd5SAlain Michaud 
2134b127bd5SAlain Michaud 	/* When this quirk is set, wide band speech is supported by
2144b127bd5SAlain Michaud 	 * the driver since no reliable mechanism exist to report
2154b127bd5SAlain Michaud 	 * this from the hardware, a driver flag is use to convey
2164b127bd5SAlain Michaud 	 * this support
2174b127bd5SAlain Michaud 	 *
2184b127bd5SAlain Michaud 	 * This quirk must be set before hci_register_dev is called.
2194b127bd5SAlain Michaud 	 */
22000bce3fbSAlain Michaud 	HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
22122091585SAlain Michaud 
22222091585SAlain Michaud 	/* When this quirk is set, the controller has validated that
22322091585SAlain Michaud 	 * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are
22422091585SAlain Michaud 	 * valid.  This mechanism is necessary as many controllers have
22522091585SAlain Michaud 	 * been seen has having trouble initiating a connectable
22622091585SAlain Michaud 	 * advertisement despite the state combination being reported as
22722091585SAlain Michaud 	 * supported.
22822091585SAlain Michaud 	 */
22922091585SAlain Michaud 	HCI_QUIRK_VALID_LE_STATES,
230cde1a8a9SIsmael Ferreras Morezuelas 
23142d7731eSIsmael Ferreras Morezuelas 	/* When this quirk is set, then erroneous data reporting
23242d7731eSIsmael Ferreras Morezuelas 	 * is ignored. This is mainly due to the fact that the HCI
23342d7731eSIsmael Ferreras Morezuelas 	 * Read Default Erroneous Data Reporting command is advertised,
23442d7731eSIsmael Ferreras Morezuelas 	 * but not supported; these controllers often reply with unknown
23542d7731eSIsmael Ferreras Morezuelas 	 * command and tend to lock up randomly. Needing a hard reset.
23642d7731eSIsmael Ferreras Morezuelas 	 *
23742d7731eSIsmael Ferreras Morezuelas 	 * This quirk can be set before hci_register_dev is called or
23842d7731eSIsmael Ferreras Morezuelas 	 * during the hdev->setup vendor callback.
23942d7731eSIsmael Ferreras Morezuelas 	 */
24042d7731eSIsmael Ferreras Morezuelas 	HCI_QUIRK_BROKEN_ERR_DATA_REPORTING,
24142d7731eSIsmael Ferreras Morezuelas 
242219991e6SHans de Goede 	/*
243219991e6SHans de Goede 	 * When this quirk is set, then the hci_suspend_notifier is not
244219991e6SHans de Goede 	 * registered. This is intended for devices which drop completely
245219991e6SHans de Goede 	 * from the bus on system-suspend and which will show up as a new
246219991e6SHans de Goede 	 * HCI after resume.
247219991e6SHans de Goede 	 */
248219991e6SHans de Goede 	HCI_QUIRK_NO_SUSPEND_NOTIFIER,
249d2f8114fSAditya Garg 
250d2f8114fSAditya Garg 	/*
251d2f8114fSAditya Garg 	 * When this quirk is set, LE tx power is not queried on startup
252d2f8114fSAditya Garg 	 * and the min/max tx power values default to HCI_TX_POWER_INVALID.
253d2f8114fSAditya Garg 	 *
254d2f8114fSAditya Garg 	 * This quirk can be set before hci_register_dev is called or
255d2f8114fSAditya Garg 	 * during the hdev->setup vendor callback.
256d2f8114fSAditya Garg 	 */
257d2f8114fSAditya Garg 	HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
2580eaecfb2SIsmael Ferreras Morezuelas 
2590eaecfb2SIsmael Ferreras Morezuelas 	/* When this quirk is set, HCI_OP_SET_EVENT_FLT requests with
2600eaecfb2SIsmael Ferreras Morezuelas 	 * HCI_FLT_CLEAR_ALL are ignored and event filtering is
2610eaecfb2SIsmael Ferreras Morezuelas 	 * completely avoided. A subset of the CSR controller
2620eaecfb2SIsmael Ferreras Morezuelas 	 * clones struggle with this and instantly lock up.
2630eaecfb2SIsmael Ferreras Morezuelas 	 *
2640eaecfb2SIsmael Ferreras Morezuelas 	 * Note that devices using this must (separately) disable
2650eaecfb2SIsmael Ferreras Morezuelas 	 * runtime suspend, because event filtering takes place there.
2660eaecfb2SIsmael Ferreras Morezuelas 	 */
2670eaecfb2SIsmael Ferreras Morezuelas 	HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL,
26805abad85SLuiz Augusto von Dentz 
26905abad85SLuiz Augusto von Dentz 	/*
27005abad85SLuiz Augusto von Dentz 	 * When this quirk is set, disables the use of
27105abad85SLuiz Augusto von Dentz 	 * HCI_OP_ENHANCED_SETUP_SYNC_CONN command to setup SCO connections.
27205abad85SLuiz Augusto von Dentz 	 *
27305abad85SLuiz Augusto von Dentz 	 * This quirk can be set before hci_register_dev is called or
27405abad85SLuiz Augusto von Dentz 	 * during the hdev->setup vendor callback.
27505abad85SLuiz Augusto von Dentz 	 */
27605abad85SLuiz Augusto von Dentz 	HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN,
277392fca35SSven Peter 
278392fca35SSven Peter 	/*
279392fca35SSven Peter 	 * When this quirk is set, the HCI_OP_LE_SET_EXT_SCAN_ENABLE command is
280392fca35SSven Peter 	 * disabled. This is required for some Broadcom controllers which
281392fca35SSven Peter 	 * erroneously claim to support extended scanning.
282392fca35SSven Peter 	 *
283392fca35SSven Peter 	 * This quirk can be set before hci_register_dev is called or
284392fca35SSven Peter 	 * during the hdev->setup vendor callback.
285392fca35SSven Peter 	 */
286392fca35SSven Peter 	HCI_QUIRK_BROKEN_EXT_SCAN,
287ffcb0a44SSven Peter 
288ffcb0a44SSven Peter 	/*
289ffcb0a44SSven Peter 	 * When this quirk is set, the HCI_OP_GET_MWS_TRANSPORT_CONFIG command is
290ffcb0a44SSven Peter 	 * disabled. This is required for some Broadcom controllers which
291ffcb0a44SSven Peter 	 * erroneously claim to support MWS Transport Layer Configuration.
292ffcb0a44SSven Peter 	 *
293ffcb0a44SSven Peter 	 * This quirk can be set before hci_register_dev is called or
294ffcb0a44SSven Peter 	 * during the hdev->setup vendor callback.
295ffcb0a44SSven Peter 	 */
296ffcb0a44SSven Peter 	HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG,
2978194f1efSVasily Khoruzhick 
2988194f1efSVasily Khoruzhick 	/* When this quirk is set, max_page for local extended features
2998194f1efSVasily Khoruzhick 	 * is set to 1, even if controller reports higher number. Some
3008194f1efSVasily Khoruzhick 	 * controllers (e.g. RTL8723CS) report more pages, but they
3018194f1efSVasily Khoruzhick 	 * don't actually support features declared there.
3028194f1efSVasily Khoruzhick 	 */
3038194f1efSVasily Khoruzhick 	HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
30491b6d02dSRaul Cheleguini 
30591b6d02dSRaul Cheleguini 	/*
30691b6d02dSRaul Cheleguini 	 * When this quirk is set, the HCI_OP_LE_SET_RPA_TIMEOUT command is
30791b6d02dSRaul Cheleguini 	 * skipped during initialization. This is required for the Actions
30891b6d02dSRaul Cheleguini 	 * Semiconductor ATS2851 based controllers, which erroneously claims
30991b6d02dSRaul Cheleguini 	 * to support it.
31091b6d02dSRaul Cheleguini 	 */
31191b6d02dSRaul Cheleguini 	HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT,
3121da177e4SLinus Torvalds };
3131da177e4SLinus Torvalds 
3141da177e4SLinus Torvalds /* HCI device flags */
3151da177e4SLinus Torvalds enum {
3161da177e4SLinus Torvalds 	HCI_UP,
3171da177e4SLinus Torvalds 	HCI_INIT,
3181da177e4SLinus Torvalds 	HCI_RUNNING,
3191da177e4SLinus Torvalds 
3201da177e4SLinus Torvalds 	HCI_PSCAN,
3211da177e4SLinus Torvalds 	HCI_ISCAN,
3221da177e4SLinus Torvalds 	HCI_AUTH,
3231da177e4SLinus Torvalds 	HCI_ENCRYPT,
3241da177e4SLinus Torvalds 	HCI_INQUIRY,
3251da177e4SLinus Torvalds 
3261da177e4SLinus Torvalds 	HCI_RAW,
327ab81cbf9SJohan Hedberg 
32810572132SGustavo F. Padovan 	HCI_RESET,
3291da177e4SLinus Torvalds };
3301da177e4SLinus Torvalds 
331f9207338SMarcel Holtmann /* HCI socket flags */
332f9207338SMarcel Holtmann enum {
33350ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
334f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
335f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
336ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
337321c6feeSMarcel Holtmann 	HCI_MGMT_EXT_INFO_EVENTS,
3385504c3a3SMarcel Holtmann 	HCI_MGMT_OPTION_EVENTS,
3395504c3a3SMarcel Holtmann 	HCI_MGMT_SETTING_EVENTS,
3405504c3a3SMarcel Holtmann 	HCI_MGMT_DEV_CLASS_EVENTS,
3415504c3a3SMarcel Holtmann 	HCI_MGMT_LOCAL_NAME_EVENTS,
34272000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
343a10c907cSMarcel Holtmann 	HCI_MGMT_EXP_FEATURE_EVENTS,
344f9207338SMarcel Holtmann };
345f9207338SMarcel Holtmann 
346d23264a8SAndre Guedes /*
347d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
348d23264a8SAndre Guedes  * states from the controller.
349d23264a8SAndre Guedes  */
350d23264a8SAndre Guedes enum {
351a8b2d5c2SJohan Hedberg 	HCI_SETUP,
352d603b76bSMarcel Holtmann 	HCI_CONFIG,
353*fe2ccc6cSJohan Hovold 	HCI_DEBUGFS_CREATED,
354a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
3555e130367SJohan Hedberg 	HCI_RFKILLED,
356a8b2d5c2SJohan Hedberg 	HCI_MGMT,
357b6ae8457SJohan Hedberg 	HCI_BONDABLE,
358a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
3590663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
3603769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
36194324962SJohan Hovold 	HCI_UNREGISTER,
3624a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
3630736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
364dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
36566c417c1SJohan Hedberg 	HCI_LE_ADV,
366eca0ae4aSLuiz Augusto von Dentz 	HCI_LE_PER_ADV,
367d23264a8SAndre Guedes 	HCI_LE_SCAN,
36884bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
369e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
370134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
371863efaf2SJohan Hedberg 	HCI_PRIVACY,
37282a37adeSJohan Hedberg 	HCI_LIMITED_PRIVACY,
373d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
37441edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
3756d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
37606199cf8SJohan Hedberg 	HCI_LE_ENABLED,
377f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
378cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
3795e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
3805e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
3816acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
38247990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
38321693c15SAndre Guedes 	HCI_PERIODIC_INQ,
3841a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
38556f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
38681ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
38700bce3fbSAlain Michaud 	HCI_WIDEBAND_SPEECH_ENABLED,
388e5b0ad69SAbhishek Pandit-Subedi 	HCI_EVENT_FILTER_CONFIGURED,
389eca0ae4aSLuiz Augusto von Dentz 	HCI_PA_SYNC,
390b7cb93e5SMarcel Holtmann 
391b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
3924b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
393b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
394b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
395aa12af77SAnkit Navik 	HCI_LL_RPA_RESOLUTION,
396cbbdfa6fSSathish Narasimman 	HCI_ENABLE_LL_PRIVACY,
397f80c5dadSJoão Paulo Rechi Vita 	HCI_CMD_PENDING,
398c2aa30dbSArchie Pusaka 	HCI_FORCE_NO_MITM,
399ae7d925bSJoseph Hwang 	HCI_QUALITY_REPORT,
400248733e8SKiran K 	HCI_OFFLOAD_CODECS_ENABLED,
40176d0685bSLuiz Augusto von Dentz 	HCI_LE_SIMULTANEOUS_ROLES,
402877afadaSSchspa Shi 	HCI_CMD_DRAIN_WORKQUEUE,
403b7cb93e5SMarcel Holtmann 
404af6bcc19SBrian Gix 	HCI_MESH_EXPERIMENTAL,
405b338d917SBrian Gix 	HCI_MESH,
406b338d917SBrian Gix 	HCI_MESH_SENDING,
407b338d917SBrian Gix 
408eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
409d23264a8SAndre Guedes };
410d23264a8SAndre Guedes 
4111da177e4SLinus Torvalds /* HCI timeouts */
4125f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
4135f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
4145f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
415d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
416de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
4175f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
4189345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
419a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
4209489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
4211f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
4221da177e4SLinus Torvalds 
4235b7f9909SMarcel Holtmann /* HCI data types */
4241da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
4251da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
4261da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
4271da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
4284de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT		0x05
429e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
4301da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
4311da177e4SLinus Torvalds 
4325b7f9909SMarcel Holtmann /* HCI packet types */
4331da177e4SLinus Torvalds #define HCI_DM1		0x0008
4341da177e4SLinus Torvalds #define HCI_DM3		0x0400
4351da177e4SLinus Torvalds #define HCI_DM5		0x4000
4361da177e4SLinus Torvalds #define HCI_DH1		0x0010
4371da177e4SLinus Torvalds #define HCI_DH3		0x0800
4381da177e4SLinus Torvalds #define HCI_DH5		0x8000
4391da177e4SLinus Torvalds 
4405075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
4415075b972SJaganath Kanakkassery #define HCI_2DH1	0x0002
4425075b972SJaganath Kanakkassery #define HCI_3DH1	0x0004
4435075b972SJaganath Kanakkassery #define HCI_2DH3	0x0100
4445075b972SJaganath Kanakkassery #define HCI_3DH3	0x0200
4455075b972SJaganath Kanakkassery #define HCI_2DH5	0x1000
4465075b972SJaganath Kanakkassery #define HCI_3DH5	0x2000
4475075b972SJaganath Kanakkassery 
4481da177e4SLinus Torvalds #define HCI_HV1		0x0020
4491da177e4SLinus Torvalds #define HCI_HV2		0x0040
4501da177e4SLinus Torvalds #define HCI_HV3		0x0080
4511da177e4SLinus Torvalds 
4521da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
4531da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
4541da177e4SLinus Torvalds 
4555b7f9909SMarcel Holtmann /* eSCO packet types */
4565b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
4575b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
4585b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
4595b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
4605b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
4615b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
462efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
463efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
464efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
465efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
4665b7f9909SMarcel Holtmann 
467a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
468efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
469a8746417SMarcel Holtmann 
4701da177e4SLinus Torvalds /* ACL flags */
471e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
4721da177e4SLinus Torvalds #define ACL_CONT		0x01
4731da177e4SLinus Torvalds #define ACL_START		0x02
474d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
4751da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
4761da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
4771da177e4SLinus Torvalds 
4784de0fc59SLuiz Augusto von Dentz /* ISO PB flags */
4794de0fc59SLuiz Augusto von Dentz #define ISO_START		0x00
4804de0fc59SLuiz Augusto von Dentz #define ISO_CONT		0x01
4814de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE		0x02
4824de0fc59SLuiz Augusto von Dentz #define ISO_END			0x03
4834de0fc59SLuiz Augusto von Dentz 
4844de0fc59SLuiz Augusto von Dentz /* ISO TS flags */
4854de0fc59SLuiz Augusto von Dentz #define ISO_TS			0x01
4864de0fc59SLuiz Augusto von Dentz 
4871da177e4SLinus Torvalds /* Baseband links */
4881da177e4SLinus Torvalds #define SCO_LINK	0x00
4891da177e4SLinus Torvalds #define ACL_LINK	0x01
4905b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
491fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
492fcd89c09SVille Tervo #define LE_LINK		0x80
4933161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
4944de0fc59SLuiz Augusto von Dentz #define ISO_LINK	0x82
495845472e8SMarcel Holtmann #define INVALID_LINK	0xff
4961da177e4SLinus Torvalds 
4971da177e4SLinus Torvalds /* LMP features */
4981da177e4SLinus Torvalds #define LMP_3SLOT	0x01
4991da177e4SLinus Torvalds #define LMP_5SLOT	0x02
5001da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
5011da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
5021da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
5031da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
5041da177e4SLinus Torvalds #define LMP_HOLD	0x40
50504837f64SMarcel Holtmann #define LMP_SNIFF	0x80
5061da177e4SLinus Torvalds 
5071da177e4SLinus Torvalds #define LMP_PARK	0x01
5081da177e4SLinus Torvalds #define LMP_RSSI	0x02
5091da177e4SLinus Torvalds #define LMP_QUALITY	0x04
5101da177e4SLinus Torvalds #define LMP_SCO		0x08
5111da177e4SLinus Torvalds #define LMP_HV2		0x10
5121da177e4SLinus Torvalds #define LMP_HV3		0x20
5131da177e4SLinus Torvalds #define LMP_ULAW	0x40
5141da177e4SLinus Torvalds #define LMP_ALAW	0x80
5151da177e4SLinus Torvalds 
5161da177e4SLinus Torvalds #define LMP_CVSD	0x01
5171da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
5181da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
51907a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
5201da177e4SLinus Torvalds 
5215075b972SJaganath Kanakkassery #define LMP_EDR_2M		0x02
5225075b972SJaganath Kanakkassery #define LMP_EDR_3M		0x04
523d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
5245b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
5255b7f9909SMarcel Holtmann 
5265b7f9909SMarcel Holtmann #define LMP_EV4		0x01
5275b7f9909SMarcel Holtmann #define LMP_EV5		0x02
52869ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
529d5859e22SJohan Hedberg #define LMP_LE		0x40
5305075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT	0x80
5315b7f9909SMarcel Holtmann 
5325075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT	0x01
53304837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
534d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
535efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
536efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
537efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
53804837f64SMarcel Holtmann 
539d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
540e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
541769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
542766ae242SZijun Hu #define LMP_ERR_DATA_REPORTING 0x20
543e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
544769be974SMarcel Holtmann 
545d5859e22SJohan Hedberg #define LMP_LSTO	0x01
546d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
547971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
548d5859e22SJohan Hedberg 
549eead27daSAndre Guedes /* Extended LMP features */
5506397729bSArchie Pusaka #define LMP_CPB_CENTRAL		0x01
5516397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL	0x02
55253b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN		0x04
55353b834d2SMarcel Holtmann #define LMP_SYNC_SCAN		0x08
55453b834d2SMarcel Holtmann 
555d5991585SMarcel Holtmann #define LMP_SC		0x01
556d5991585SMarcel Holtmann #define LMP_PING	0x02
557d5991585SMarcel Holtmann 
55853b834d2SMarcel Holtmann /* Host features */
559cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
560eead27daSAndre Guedes #define LMP_HOST_LE		0x02
561cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
562d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
563eead27daSAndre Guedes 
564662bc2e6SAndre Guedes /* LE features */
5650da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
566662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
567ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES	0x08
568cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
56994a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
570ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY		0x40
5714b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
5725075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
5735075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
57455beec10SMarcel Holtmann #define HCI_LE_EXT_ADV			0x10
575eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_PERIODIC_ADV		0x20
5769756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2		0x40
577ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL		0x10
578ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL		0x20
579eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_ISO_BROADCASTER		0x40
580662bc2e6SAndre Guedes 
58104837f64SMarcel Holtmann /* Connection modes */
58204837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
58304837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
58404837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
58504837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
58604837f64SMarcel Holtmann 
5871da177e4SLinus Torvalds /* Link policies */
5881da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
5891da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
5901da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
5911da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
5921da177e4SLinus Torvalds 
59304837f64SMarcel Holtmann /* Link modes */
5941da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
5951da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
5961da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
5971da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
5981da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
5991da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
6001da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
6017b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
6021da177e4SLinus Torvalds 
60340be492fSMarcel Holtmann /* Authentication types */
60440be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
60540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
60640be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
60740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
60840be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
60940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
61040be492fSMarcel Holtmann 
611a77b15a6SMikel Astiz /* I/O capabilities */
612a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
613a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
614a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
615a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
616a77b15a6SMikel Astiz 
617b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
618b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
619b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
620b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
621b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
62211015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
62311015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
624b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
62511015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
62611015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
627b6020ba0SWaldemar Rymarkiewicz 
6289f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
6298e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
6309f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
631160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING	0x06
6322acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
633cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
634d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
6359f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
636c86cc5a3SLuiz Augusto von Dentz #define HCI_ERROR_INVALID_PARAMETERS	0x12
6379f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
638cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
639cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
6409f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
6419f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
6424ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS	0x1e
6434ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED		0x1f
6443c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
6450f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST	0x44
6469f5a0d7bSAndrei Emeltchenko 
6472455a3eaSAndrei Emeltchenko /* Flow control modes */
6482455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
6492455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
6502455a3eaSAndrei Emeltchenko 
651bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
652bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
653a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
654bbaf444aSJohan Hedberg 
655ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
656ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
657ba165a90SJohan Hedberg 
65832748db0SJohan Hedberg /* Extended Inquiry Response field types */
65932748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
66032748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
66132748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
66232748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
66332748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
66432748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
66532748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
66632748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
66732748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
66832748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
6699ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
670d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
671d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
67232748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
6734453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
6748f9ae5b3SLuiz Augusto von Dentz #define EIR_SERVICE_DATA	0x16 /* Service Data */
6751471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
6761471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
677d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
678d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
679f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
680f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
68132748db0SJohan Hedberg 
6823f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
6833f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
6843f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
6853f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
6863f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
6873f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
6883f0f524bSJohan Hedberg 
6891da177e4SLinus Torvalds /* -----  HCI Commands ---- */
6906bd32326SVille Tervo #define HCI_OP_NOP			0x0000
6916bd32326SVille Tervo 
692a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
693a9de9248SMarcel Holtmann struct hci_cp_inquiry {
694a9de9248SMarcel Holtmann 	__u8     lap[3];
695a9de9248SMarcel Holtmann 	__u8     length;
696a9de9248SMarcel Holtmann 	__u8     num_rsp;
69766c853ccSGustavo F. Padovan } __packed;
6981da177e4SLinus Torvalds 
699a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
700a9de9248SMarcel Holtmann 
70179d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
70279d6e068SAndre Guedes 
703a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
704a9de9248SMarcel Holtmann 
705a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
706a9de9248SMarcel Holtmann struct hci_cp_create_conn {
707a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
708a9de9248SMarcel Holtmann 	__le16   pkt_type;
709a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
710a9de9248SMarcel Holtmann 	__u8     pscan_mode;
711a9de9248SMarcel Holtmann 	__le16   clock_offset;
712a9de9248SMarcel Holtmann 	__u8     role_switch;
71366c853ccSGustavo F. Padovan } __packed;
7141da177e4SLinus Torvalds 
715a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
716a9de9248SMarcel Holtmann struct hci_cp_disconnect {
717a9de9248SMarcel Holtmann 	__le16   handle;
718a9de9248SMarcel Holtmann 	__u8     reason;
71966c853ccSGustavo F. Padovan } __packed;
7201da177e4SLinus Torvalds 
721a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
722a9de9248SMarcel Holtmann struct hci_cp_add_sco {
723a9de9248SMarcel Holtmann 	__le16   handle;
724a9de9248SMarcel Holtmann 	__le16   pkt_type;
72566c853ccSGustavo F. Padovan } __packed;
726a9de9248SMarcel Holtmann 
727a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
728a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
7291da177e4SLinus Torvalds 	bdaddr_t bdaddr;
73066c853ccSGustavo F. Padovan } __packed;
7311da177e4SLinus Torvalds 
732a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
733a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
734a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
735a9de9248SMarcel Holtmann 	__u8     role;
73666c853ccSGustavo F. Padovan } __packed;
7371da177e4SLinus Torvalds 
738a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
739a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
740a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
741a9de9248SMarcel Holtmann 	__u8     reason;
74266c853ccSGustavo F. Padovan } __packed;
7431da177e4SLinus Torvalds 
744a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
745a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
746a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
7479b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
74866c853ccSGustavo F. Padovan } __packed;
7491da177e4SLinus Torvalds 
750a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
751a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
752a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
75366c853ccSGustavo F. Padovan } __packed;
7541da177e4SLinus Torvalds 
755a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
756a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
757a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
758a9de9248SMarcel Holtmann 	__u8     pin_len;
759a9de9248SMarcel Holtmann 	__u8     pin_code[16];
76066c853ccSGustavo F. Padovan } __packed;
761980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
762980e1a53SJohan Hedberg 	__u8     status;
763980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
764980e1a53SJohan Hedberg } __packed;
765a9de9248SMarcel Holtmann 
766a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
767a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
768a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
76966c853ccSGustavo F. Padovan } __packed;
770980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
771980e1a53SJohan Hedberg 	__u8     status;
772980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
773980e1a53SJohan Hedberg } __packed;
774a9de9248SMarcel Holtmann 
775a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
776a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
777a9de9248SMarcel Holtmann 	__le16   handle;
778a9de9248SMarcel Holtmann 	__le16   pkt_type;
77966c853ccSGustavo F. Padovan } __packed;
780a9de9248SMarcel Holtmann 
781a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
782a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
783a9de9248SMarcel Holtmann 	__le16   handle;
78466c853ccSGustavo F. Padovan } __packed;
785a9de9248SMarcel Holtmann 
786a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
787a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
788a9de9248SMarcel Holtmann 	__le16   handle;
789a9de9248SMarcel Holtmann 	__u8     encrypt;
79066c853ccSGustavo F. Padovan } __packed;
791a9de9248SMarcel Holtmann 
792a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
793a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
794a9de9248SMarcel Holtmann 	__le16   handle;
79566c853ccSGustavo F. Padovan } __packed;
796a9de9248SMarcel Holtmann 
797a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
798a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
799a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
800a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
801a9de9248SMarcel Holtmann 	__u8     pscan_mode;
802a9de9248SMarcel Holtmann 	__le16   clock_offset;
80366c853ccSGustavo F. Padovan } __packed;
804a9de9248SMarcel Holtmann 
805a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
806a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
807a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
80866c853ccSGustavo F. Padovan } __packed;
809a9de9248SMarcel Holtmann 
810a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
811a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
812a9de9248SMarcel Holtmann 	__le16   handle;
81366c853ccSGustavo F. Padovan } __packed;
814a9de9248SMarcel Holtmann 
815a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
816a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
817a9de9248SMarcel Holtmann 	__le16   handle;
818a9de9248SMarcel Holtmann 	__u8     page;
81966c853ccSGustavo F. Padovan } __packed;
820a9de9248SMarcel Holtmann 
821a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
822a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
823a9de9248SMarcel Holtmann 	__le16   handle;
82466c853ccSGustavo F. Padovan } __packed;
825a9de9248SMarcel Holtmann 
826df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
827df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
828df935429SMarcel Holtmann 	__le16   handle;
829df935429SMarcel Holtmann } __packed;
830df935429SMarcel Holtmann 
831a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
832a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
833a9de9248SMarcel Holtmann 	__le16   handle;
834a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
835a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
836a9de9248SMarcel Holtmann 	__le16   max_latency;
837a9de9248SMarcel Holtmann 	__le16   voice_setting;
838a9de9248SMarcel Holtmann 	__u8     retrans_effort;
839a9de9248SMarcel Holtmann 	__le16   pkt_type;
84066c853ccSGustavo F. Padovan } __packed;
841a9de9248SMarcel Holtmann 
842a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
843a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
844a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
845a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
846a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
847a9de9248SMarcel Holtmann 	__le16   max_latency;
848a9de9248SMarcel Holtmann 	__le16   content_format;
849a9de9248SMarcel Holtmann 	__u8     retrans_effort;
850a9de9248SMarcel Holtmann 	__le16   pkt_type;
85166c853ccSGustavo F. Padovan } __packed;
852a9de9248SMarcel Holtmann 
853a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
854a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
855a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
856a9de9248SMarcel Holtmann 	__u8     reason;
85766c853ccSGustavo F. Padovan } __packed;
858a9de9248SMarcel Holtmann 
85917fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
86017fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
86117fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
86217fa4b9dSJohan Hedberg 	__u8     capability;
86317fa4b9dSJohan Hedberg 	__u8     oob_data;
86417fa4b9dSJohan Hedberg 	__u8     authentication;
86517fa4b9dSJohan Hedberg } __packed;
86617fa4b9dSJohan Hedberg 
867a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
868a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
869a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
870a5c29683SJohan Hedberg } __packed;
871a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
872a5c29683SJohan Hedberg 	__u8     status;
873a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
874a5c29683SJohan Hedberg } __packed;
875a5c29683SJohan Hedberg 
876a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
877a5c29683SJohan Hedberg 
8789ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
8799ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
8809ad4019aSBrian Gix 	bdaddr_t bdaddr;
8819ad4019aSBrian Gix 	__le32	passkey;
8829ad4019aSBrian Gix } __packed;
8839ad4019aSBrian Gix 
8849ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
8859ad4019aSBrian Gix 
8862763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
8872763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
8882763eda6SSzymon Janc 	bdaddr_t bdaddr;
8892763eda6SSzymon Janc 	__u8     hash[16];
89038da1703SJohan Hedberg 	__u8     rand[16];
8912763eda6SSzymon Janc } __packed;
8922763eda6SSzymon Janc 
8932763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
8942763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
8952763eda6SSzymon Janc 	bdaddr_t bdaddr;
8962763eda6SSzymon Janc } __packed;
8972763eda6SSzymon Janc 
89803b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
89903b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
90003b555e1SJohan Hedberg 	bdaddr_t bdaddr;
90103b555e1SJohan Hedberg 	__u8     reason;
90203b555e1SJohan Hedberg } __packed;
90303b555e1SJohan Hedberg 
904523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
905523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
906523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
907523e93cdSAndrei Emeltchenko 	__u8     key_len;
908523e93cdSAndrei Emeltchenko 	__u8     key_type;
909523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
910523e93cdSAndrei Emeltchenko } __packed;
911523e93cdSAndrei Emeltchenko 
912523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
913523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
914523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
915523e93cdSAndrei Emeltchenko 	__u8     key_len;
916523e93cdSAndrei Emeltchenko 	__u8     key_type;
917523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
918523e93cdSAndrei Emeltchenko } __packed;
919523e93cdSAndrei Emeltchenko 
920523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
921523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
922523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
923523e93cdSAndrei Emeltchenko 	__u8     reason;
924b078b564SAndrei Emeltchenko } __packed;
925b078b564SAndrei Emeltchenko 
926b078b564SAndrei Emeltchenko struct ext_flow_spec {
927b078b564SAndrei Emeltchenko 	__u8       id;
928b078b564SAndrei Emeltchenko 	__u8       stype;
929b078b564SAndrei Emeltchenko 	__le16     msdu;
930b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
931b078b564SAndrei Emeltchenko 	__le32     acc_lat;
932b078b564SAndrei Emeltchenko 	__le32     flush_to;
933b078b564SAndrei Emeltchenko } __packed;
934b078b564SAndrei Emeltchenko 
935b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
936b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
937b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
938b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
939b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
940b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
941b078b564SAndrei Emeltchenko } __packed;
942b078b564SAndrei Emeltchenko 
943b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
944b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
945b078b564SAndrei Emeltchenko 	__le16   log_handle;
946b078b564SAndrei Emeltchenko } __packed;
947b078b564SAndrei Emeltchenko 
948b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
949b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
950b078b564SAndrei Emeltchenko 	__u8     phy_handle;
951b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
952b078b564SAndrei Emeltchenko } __packed;
953b078b564SAndrei Emeltchenko 
954b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN		0x043d
955b2af264aSKiran K struct hci_coding_format {
956b2af264aSKiran K 	__u8	id;
957b2af264aSKiran K 	__le16	cid;
958b2af264aSKiran K 	__le16	vid;
959b2af264aSKiran K } __packed;
960b2af264aSKiran K 
961b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn {
962b2af264aSKiran K 	__le16   handle;
963b2af264aSKiran K 	__le32   tx_bandwidth;
964b2af264aSKiran K 	__le32   rx_bandwidth;
965b2af264aSKiran K 	struct	 hci_coding_format tx_coding_format;
966b2af264aSKiran K 	struct	 hci_coding_format rx_coding_format;
967b2af264aSKiran K 	__le16	 tx_codec_frame_size;
968b2af264aSKiran K 	__le16	 rx_codec_frame_size;
969b2af264aSKiran K 	__le32	 in_bandwidth;
970b2af264aSKiran K 	__le32	 out_bandwidth;
971b2af264aSKiran K 	struct	 hci_coding_format in_coding_format;
972b2af264aSKiran K 	struct	 hci_coding_format out_coding_format;
973b2af264aSKiran K 	__le16   in_coded_data_size;
974b2af264aSKiran K 	__le16	 out_coded_data_size;
975b2af264aSKiran K 	__u8	 in_pcm_data_format;
976b2af264aSKiran K 	__u8	 out_pcm_data_format;
977b2af264aSKiran K 	__u8	 in_pcm_sample_payload_msb_pos;
978b2af264aSKiran K 	__u8	 out_pcm_sample_payload_msb_pos;
979b2af264aSKiran K 	__u8	 in_data_path;
980b2af264aSKiran K 	__u8	 out_data_path;
981b2af264aSKiran K 	__u8	 in_transport_unit_size;
982b2af264aSKiran K 	__u8	 out_transport_unit_size;
983b2af264aSKiran K 	__le16   max_latency;
984b2af264aSKiran K 	__le16   pkt_type;
985b2af264aSKiran K 	__u8     retrans_effort;
986b2af264aSKiran K } __packed;
987b2af264aSKiran K 
988b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
989b078b564SAndrei Emeltchenko 	__u8     status;
990b078b564SAndrei Emeltchenko 	__u8     phy_handle;
991b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
992523e93cdSAndrei Emeltchenko } __packed;
993523e93cdSAndrei Emeltchenko 
9946397729bSArchie Pusaka #define HCI_OP_SET_CPB			0x0441
9956397729bSArchie Pusaka struct hci_cp_set_cpb {
9968c9a041bSDoHyun Pyun 	__u8	enable;
9978c9a041bSDoHyun Pyun 	__u8	lt_addr;
9988c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
9998c9a041bSDoHyun Pyun 	__le16	packet_type;
10008c9a041bSDoHyun Pyun 	__le16	interval_min;
10018c9a041bSDoHyun Pyun 	__le16	interval_max;
10026397729bSArchie Pusaka 	__le16	cpb_sv_tout;
10038c9a041bSDoHyun Pyun } __packed;
10046397729bSArchie Pusaka struct hci_rp_set_cpb {
10058c9a041bSDoHyun Pyun 	__u8	status;
10068c9a041bSDoHyun Pyun 	__u8	lt_addr;
10078c9a041bSDoHyun Pyun 	__le16	interval;
10088c9a041bSDoHyun Pyun } __packed;
10098c9a041bSDoHyun Pyun 
1010cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
1011cefded98SDoHyun Pyun 
1012e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
1013e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
1014e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
1015e2f99131SMarcel Holtmann 	__u8     hash192[16];
101638da1703SJohan Hedberg 	__u8     rand192[16];
1017e2f99131SMarcel Holtmann 	__u8     hash256[16];
101838da1703SJohan Hedberg 	__u8     rand256[16];
1019e2f99131SMarcel Holtmann } __packed;
1020e2f99131SMarcel Holtmann 
1021a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
1022a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
1023a9de9248SMarcel Holtmann 	__le16   handle;
1024a9de9248SMarcel Holtmann 	__le16   max_interval;
1025a9de9248SMarcel Holtmann 	__le16   min_interval;
1026a9de9248SMarcel Holtmann 	__le16   attempt;
1027a9de9248SMarcel Holtmann 	__le16   timeout;
102866c853ccSGustavo F. Padovan } __packed;
1029a9de9248SMarcel Holtmann 
1030a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
1031a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
1032a9de9248SMarcel Holtmann 	__le16   handle;
103366c853ccSGustavo F. Padovan } __packed;
1034a9de9248SMarcel Holtmann 
1035a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
1036a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
1037a9de9248SMarcel Holtmann 	__le16   handle;
103866c853ccSGustavo F. Padovan } __packed;
1039a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
1040a9de9248SMarcel Holtmann 	__u8     status;
1041a9de9248SMarcel Holtmann 	__le16   handle;
1042a9de9248SMarcel Holtmann 	__u8     role;
104366c853ccSGustavo F. Padovan } __packed;
1044a9de9248SMarcel Holtmann 
1045a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
1046a9de9248SMarcel Holtmann struct hci_cp_switch_role {
1047a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1048a9de9248SMarcel Holtmann 	__u8     role;
104966c853ccSGustavo F. Padovan } __packed;
1050a9de9248SMarcel Holtmann 
1051a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
1052a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
1053a9de9248SMarcel Holtmann 	__le16   handle;
105466c853ccSGustavo F. Padovan } __packed;
1055a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
1056a9de9248SMarcel Holtmann 	__u8     status;
1057a9de9248SMarcel Holtmann 	__le16   handle;
1058a9de9248SMarcel Holtmann 	__le16   policy;
105966c853ccSGustavo F. Padovan } __packed;
1060a9de9248SMarcel Holtmann 
1061a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
1062a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
1063a9de9248SMarcel Holtmann 	__le16   handle;
1064a9de9248SMarcel Holtmann 	__le16   policy;
106566c853ccSGustavo F. Padovan } __packed;
1066a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
1067a9de9248SMarcel Holtmann 	__u8     status;
1068a9de9248SMarcel Holtmann 	__le16   handle;
106966c853ccSGustavo F. Padovan } __packed;
1070a9de9248SMarcel Holtmann 
1071e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
1072e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
1073e4e8e37cSMarcel Holtmann 	__u8     status;
1074e4e8e37cSMarcel Holtmann 	__le16   policy;
107566c853ccSGustavo F. Padovan } __packed;
1076e4e8e37cSMarcel Holtmann 
1077e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
1078e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
1079e4e8e37cSMarcel Holtmann 	__le16   policy;
108066c853ccSGustavo F. Padovan } __packed;
1081e4e8e37cSMarcel Holtmann 
1082a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
1083a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
1084a9de9248SMarcel Holtmann 	__le16   handle;
1085a9de9248SMarcel Holtmann 	__le16   max_latency;
1086a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
1087a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
108866c853ccSGustavo F. Padovan } __packed;
1089a9de9248SMarcel Holtmann 
1090a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
1091a9de9248SMarcel Holtmann 
1092a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
1093a9de9248SMarcel Holtmann 
1094a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
10954f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE		9
10964f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter {
10971da177e4SLinus Torvalds 	__u8		flt_type;
10981da177e4SLinus Torvalds 	__u8		cond_type;
10994f40afc6SAbhishek Pandit-Subedi 	struct {
11004f40afc6SAbhishek Pandit-Subedi 		bdaddr_t bdaddr;
11014f40afc6SAbhishek Pandit-Subedi 		__u8 auto_accept;
11024f40afc6SAbhishek Pandit-Subedi 	} __packed	addr_conn_flt;
110366c853ccSGustavo F. Padovan } __packed;
11041da177e4SLinus Torvalds 
11051da177e4SLinus Torvalds /* Filter types */
11061da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
11071da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
11081da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
11091da177e4SLinus Torvalds 
11101da177e4SLinus Torvalds /* CONN_SETUP Condition types */
11111da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
11121da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
11131da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
11141da177e4SLinus Torvalds 
11151da177e4SLinus Torvalds /* CONN_SETUP Conditions */
11161da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF		0x01
11171da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON		0x02
11184f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS	0x03
11191da177e4SLinus Torvalds 
1120cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
1121cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
1122cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
1123cb962780SMarcel Holtmann 	__u8     read_all;
1124cb962780SMarcel Holtmann } __packed;
1125cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
1126cb962780SMarcel Holtmann 	__u8     status;
1127e88422bcSLuiz Augusto von Dentz 	__le16   max_keys;
1128e88422bcSLuiz Augusto von Dentz 	__le16   num_keys;
1129cb962780SMarcel Holtmann } __packed;
1130cb962780SMarcel Holtmann 
1131b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
1132b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
1133b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
1134b0916ea0SJohan Hedberg 	__u8     delete_all;
1135b0916ea0SJohan Hedberg } __packed;
1136039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
1137039d4e41SMarcel Holtmann 	__u8     status;
11387978656cSLuiz Augusto von Dentz 	__le16   num_keys;
1139039d4e41SMarcel Holtmann } __packed;
1140b0916ea0SJohan Hedberg 
11411f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
11421f6c6378SJohan Hedberg 
1143a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
1144a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
11451f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
114666c853ccSGustavo F. Padovan } __packed;
1147a9de9248SMarcel Holtmann 
1148a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
1149a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
1150a9de9248SMarcel Holtmann 	__u8     status;
11511f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
115266c853ccSGustavo F. Padovan } __packed;
1153a9de9248SMarcel Holtmann 
1154a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
1155a9de9248SMarcel Holtmann 
1156a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
1157a9de9248SMarcel Holtmann 
1158a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
1159a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
1160a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
1161a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
1162a9de9248SMarcel Holtmann 
1163a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
1164a9de9248SMarcel Holtmann 
1165a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
1166a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
1167a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
1168a9de9248SMarcel Holtmann 
1169a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
1170a9de9248SMarcel Holtmann 
1171a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
1172a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
1173a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
1174a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
1175a9de9248SMarcel Holtmann 
1176a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
1177a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
11781da177e4SLinus Torvalds 	__u8     status;
11791da177e4SLinus Torvalds 	__u8     dev_class[3];
118066c853ccSGustavo F. Padovan } __packed;
11811da177e4SLinus Torvalds 
1182a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
1183a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
11841da177e4SLinus Torvalds 	__u8     dev_class[3];
118566c853ccSGustavo F. Padovan } __packed;
11861da177e4SLinus Torvalds 
1187a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
11881da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
11891da177e4SLinus Torvalds 	__u8     status;
11901ebb9252SMarcel Holtmann 	__le16   voice_setting;
119166c853ccSGustavo F. Padovan } __packed;
11921da177e4SLinus Torvalds 
1193a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
11941da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
11951ebb9252SMarcel Holtmann 	__le16   voice_setting;
119666c853ccSGustavo F. Padovan } __packed;
11971da177e4SLinus Torvalds 
1198a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
11991da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
12001ebb9252SMarcel Holtmann 	__le16   acl_mtu;
12011da177e4SLinus Torvalds 	__u8     sco_mtu;
12021ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
12031ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
120466c853ccSGustavo F. Padovan } __packed;
12051da177e4SLinus Torvalds 
1206b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
1207b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1208b4cb9fb2SMarcel Holtmann 	__u8	status;
1209b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
1210b4cb9fb2SMarcel Holtmann } __packed;
1211b4cb9fb2SMarcel Holtmann 
12124b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
12134b836f39SMarcel Holtmann 
12143d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
12153d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
12163d505312SMarcel Holtmann 	__u8	num_iac;
12173d505312SMarcel Holtmann 	__u8	iac_lap[6];
12183d505312SMarcel Holtmann } __packed;
12193d505312SMarcel Holtmann 
1220d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
1221d5859e22SJohan Hedberg 
122280a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
122380a1e1dbSJohan Hedberg 
122480a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
122580a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1226816a11d5SJohan Hedberg 	__u8	fec;
1227816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
122880a1e1dbSJohan Hedberg } __packed;
122980a1e1dbSJohan Hedberg 
1230333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
1231333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1232333140b5SMarcel Holtmann 	__u8     status;
1233333140b5SMarcel Holtmann 	__u8     mode;
123466c853ccSGustavo F. Padovan } __packed;
1235333140b5SMarcel Holtmann 
1236333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
1237333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1238333140b5SMarcel Holtmann 	__u8     mode;
123966c853ccSGustavo F. Padovan } __packed;
1240333140b5SMarcel Holtmann 
1241c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1242c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1243c35938b2SSzymon Janc 	__u8     status;
1244c35938b2SSzymon Janc 	__u8     hash[16];
124538da1703SJohan Hedberg 	__u8     rand[16];
1246c35938b2SSzymon Janc } __packed;
1247c35938b2SSzymon Janc 
1248d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
124991c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
125091c4e9b1SMarcel Holtmann 	__u8     status;
125191c4e9b1SMarcel Holtmann 	__s8     tx_power;
125291c4e9b1SMarcel Holtmann } __packed;
1253d5859e22SJohan Hedberg 
125400bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING	0x0c5a
125500bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_DISABLED	0x00
125600bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_ENABLED	0x01
125700bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting {
125800bce3fbSAlain Michaud 	__u8     status;
125900bce3fbSAlain Michaud 	__u8     err_data_reporting;
126000bce3fbSAlain Michaud } __packed;
126100bce3fbSAlain Michaud 
126200bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING	0x0c5b
126300bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting {
126400bce3fbSAlain Michaud 	__u8     err_data_reporting;
126500bce3fbSAlain Michaud } __packed;
126600bce3fbSAlain Michaud 
1267d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1268d62e6d67SJohan Hedberg 
12697528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
12707528ca1cSMarcel Holtmann 
12711e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
12721e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
12731e89cffbSAndrei Emeltchenko 	__u8     status;
12741e89cffbSAndrei Emeltchenko 	__u8     mode;
12751e89cffbSAndrei Emeltchenko } __packed;
12761e89cffbSAndrei Emeltchenko 
1277f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1278f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1279f9b49306SAndre Guedes 	__u8	le;
1280f9b49306SAndre Guedes 	__u8	simul;
1281f9b49306SAndre Guedes } __packed;
1282f9b49306SAndre Guedes 
1283d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1284d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1285d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1286d0bf75a5SDoHyun Pyun } __packed;
1287d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1288d0bf75a5SDoHyun Pyun 	__u8	status;
1289d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1290d0bf75a5SDoHyun Pyun } __packed;
1291d0bf75a5SDoHyun Pyun 
12926a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
12936a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
12946a20eaf4SDoHyun Pyun 	__u8	lt_addr;
12956a20eaf4SDoHyun Pyun } __packed;
12966a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
12976a20eaf4SDoHyun Pyun 	__u8	status;
12986a20eaf4SDoHyun Pyun 	__u8	lt_addr;
12996a20eaf4SDoHyun Pyun } __packed;
13006a20eaf4SDoHyun Pyun 
13016397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA		0x0c76
13026397729bSArchie Pusaka struct hci_cp_set_cpb_data {
13037d1dab49SDoHyun Pyun 	__u8	lt_addr;
13047d1dab49SDoHyun Pyun 	__u8	fragment;
13057d1dab49SDoHyun Pyun 	__u8	data_length;
13066397729bSArchie Pusaka 	__u8	data[HCI_MAX_CPB_DATA_SIZE];
13077d1dab49SDoHyun Pyun } __packed;
13086397729bSArchie Pusaka struct hci_rp_set_cpb_data {
13097d1dab49SDoHyun Pyun 	__u8	status;
13107d1dab49SDoHyun Pyun 	__u8	lt_addr;
13117d1dab49SDoHyun Pyun } __packed;
13127d1dab49SDoHyun Pyun 
13135d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
13145d4e7e8dSJohan Hedberg 
1315a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1316a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1317a9b07a64SDoHyun Pyun 	__le16	interval_min;
1318a9b07a64SDoHyun Pyun 	__le16	interval_max;
1319a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1320a9b07a64SDoHyun Pyun 	__u8	service_data;
1321a9b07a64SDoHyun Pyun } __packed;
1322a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1323a9b07a64SDoHyun Pyun 	__u8	status;
1324a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1325a9b07a64SDoHyun Pyun } __packed;
1326a9b07a64SDoHyun Pyun 
1327eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1328eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1329eb4b95c6SMarcel Holtmann 	__u8	status;
1330eb4b95c6SMarcel Holtmann 	__u8	support;
1331eb4b95c6SMarcel Holtmann } __packed;
1332eb4b95c6SMarcel Holtmann 
1333eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1334eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1335eb4b95c6SMarcel Holtmann 	__u8	support;
1336eb4b95c6SMarcel Holtmann } __packed;
1337eb4b95c6SMarcel Holtmann 
1338302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO    0x0c7b
1339302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to {
1340302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1341302975cbSSpoorthi Ravishankar Koppad } __packed;
1342302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to {
1343302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1344302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1345302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1346302975cbSSpoorthi Ravishankar Koppad } __packed;
1347302975cbSSpoorthi Ravishankar Koppad 
1348302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO    0x0c7c
1349302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to {
1350302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1351302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1352302975cbSSpoorthi Ravishankar Koppad } __packed;
1353302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to {
1354302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1355302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1356302975cbSSpoorthi Ravishankar Koppad } __packed;
1357302975cbSSpoorthi Ravishankar Koppad 
1358e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1359e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1360e2f99131SMarcel Holtmann 	__u8     status;
1361e2f99131SMarcel Holtmann 	__u8     hash192[16];
136238da1703SJohan Hedberg 	__u8     rand192[16];
1363e2f99131SMarcel Holtmann 	__u8     hash256[16];
136438da1703SJohan Hedberg 	__u8     rand256[16];
1365e2f99131SMarcel Holtmann } __packed;
1366e2f99131SMarcel Holtmann 
13679798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH	0x0c83
13689798fbdeSKiran K struct hci_op_configure_data_path {
13699798fbdeSKiran K 	__u8	direction;
13709798fbdeSKiran K 	__u8	data_path_id;
13719798fbdeSKiran K 	__u8	vnd_len;
13729798fbdeSKiran K 	__u8	vnd_data[];
13739798fbdeSKiran K } __packed;
13749798fbdeSKiran K 
1375a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1376a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
13771da177e4SLinus Torvalds 	__u8     status;
1378a9de9248SMarcel Holtmann 	__u8     hci_ver;
1379a9de9248SMarcel Holtmann 	__le16   hci_rev;
1380a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1381a9de9248SMarcel Holtmann 	__le16   manufacturer;
1382a9de9248SMarcel Holtmann 	__le16   lmp_subver;
138366c853ccSGustavo F. Padovan } __packed;
13841da177e4SLinus Torvalds 
1385a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1386a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
13871da177e4SLinus Torvalds 	__u8     status;
1388a9de9248SMarcel Holtmann 	__u8     commands[64];
138966c853ccSGustavo F. Padovan } __packed;
13901da177e4SLinus Torvalds 
1391a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1392a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1393a9de9248SMarcel Holtmann 	__u8     status;
1394a9de9248SMarcel Holtmann 	__u8     features[8];
139566c853ccSGustavo F. Padovan } __packed;
1396a9de9248SMarcel Holtmann 
1397a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1398971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1399971e3a4bSAndre Guedes 	__u8     page;
1400971e3a4bSAndre Guedes } __packed;
1401a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1402a9de9248SMarcel Holtmann 	__u8     status;
1403a9de9248SMarcel Holtmann 	__u8     page;
1404a9de9248SMarcel Holtmann 	__u8     max_page;
1405a9de9248SMarcel Holtmann 	__u8     features[8];
140666c853ccSGustavo F. Padovan } __packed;
1407a9de9248SMarcel Holtmann 
1408a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1409a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1410a9de9248SMarcel Holtmann 	__u8     status;
1411a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1412a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1413a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1414a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
141566c853ccSGustavo F. Padovan } __packed;
1416a9de9248SMarcel Holtmann 
1417a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1418a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1419a9de9248SMarcel Holtmann 	__u8     status;
14201da177e4SLinus Torvalds 	bdaddr_t bdaddr;
142166c853ccSGustavo F. Padovan } __packed;
14221da177e4SLinus Torvalds 
1423350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1424350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1425350ee4cfSAndrei Emeltchenko 	__u8     status;
1426350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1427350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1428350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1429350ee4cfSAndrei Emeltchenko } __packed;
1430350ee4cfSAndrei Emeltchenko 
1431109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
14328961987fSKiran K struct hci_std_codecs {
14338961987fSKiran K 	__u8	num;
14348961987fSKiran K 	__u8	codec[];
14358961987fSKiran K } __packed;
14368961987fSKiran K 
14378961987fSKiran K struct hci_vnd_codec {
14388961987fSKiran K 	/* company id */
14398961987fSKiran K 	__le16	cid;
14408961987fSKiran K 	/* vendor codec id */
14418961987fSKiran K 	__le16	vid;
14428961987fSKiran K } __packed;
14438961987fSKiran K 
14448961987fSKiran K struct hci_vnd_codecs {
14458961987fSKiran K 	__u8	num;
14468961987fSKiran K 	struct hci_vnd_codec codec[];
14478961987fSKiran K } __packed;
14488961987fSKiran K 
14498961987fSKiran K struct hci_rp_read_local_supported_codecs {
14508961987fSKiran K 	__u8	status;
14518961987fSKiran K 	struct hci_std_codecs std_codecs;
14528961987fSKiran K 	struct hci_vnd_codecs vnd_codecs;
14538961987fSKiran K } __packed;
1454109e3191SMarcel Holtmann 
1455a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS	0x100c
1456a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts {
1457a4790360SMarcel Holtmann 	__u8     status;
1458a4790360SMarcel Holtmann 	__u8     pairing_opts;
1459a4790360SMarcel Holtmann 	__u8     max_key_size;
1460a4790360SMarcel Holtmann } __packed;
1461a4790360SMarcel Holtmann 
14629ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2	0x100d
14639ae66402SKiran K struct hci_std_codec_v2 {
14649ae66402SKiran K 	__u8	id;
14659ae66402SKiran K 	__u8	transport;
14669ae66402SKiran K } __packed;
14679ae66402SKiran K 
14689ae66402SKiran K struct hci_std_codecs_v2 {
14699ae66402SKiran K 	__u8	num;
14709ae66402SKiran K 	struct hci_std_codec_v2 codec[];
14719ae66402SKiran K } __packed;
14729ae66402SKiran K 
14739ae66402SKiran K struct hci_vnd_codec_v2 {
14749ae66402SKiran K 	__le16	cid;
14759ae66402SKiran K 	__le16	vid;
14769ae66402SKiran K 	__u8	transport;
14779ae66402SKiran K } __packed;
14789ae66402SKiran K 
14799ae66402SKiran K struct hci_vnd_codecs_v2 {
14809ae66402SKiran K 	__u8	num;
14819ae66402SKiran K 	struct hci_vnd_codec_v2 codec[];
14829ae66402SKiran K } __packed;
14839ae66402SKiran K 
14849ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 {
14859ae66402SKiran K 	__u8	status;
14869ae66402SKiran K 	struct hci_std_codecs_v2 std_codecs;
14879ae66402SKiran K 	struct hci_vnd_codecs_v2 vendor_codecs;
14889ae66402SKiran K } __packed;
14899ae66402SKiran K 
14908961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS	0x100e
14918961987fSKiran K struct hci_op_read_local_codec_caps {
14928961987fSKiran K 	__u8	id;
14938961987fSKiran K 	__le16	cid;
14948961987fSKiran K 	__le16	vid;
14958961987fSKiran K 	__u8	transport;
14968961987fSKiran K 	__u8	direction;
14978961987fSKiran K } __packed;
14988961987fSKiran K 
14998961987fSKiran K struct hci_codec_caps {
15008961987fSKiran K 	__u8	len;
15018961987fSKiran K 	__u8	data[];
15028961987fSKiran K } __packed;
15038961987fSKiran K 
15048961987fSKiran K struct hci_rp_read_local_codec_caps {
15058961987fSKiran K 	__u8	status;
15068961987fSKiran K 	__u8	num_caps;
15078961987fSKiran K } __packed;
15088961987fSKiran K 
1509f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1510f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1511f332ec66SJohan Hedberg 	__u8     status;
1512f332ec66SJohan Hedberg 	__le16   interval;
1513f332ec66SJohan Hedberg 	__le16   window;
1514f332ec66SJohan Hedberg } __packed;
1515f332ec66SJohan Hedberg 
1516f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1517f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1518f6422ec6SAntti Julku 	__le16   interval;
1519f6422ec6SAntti Julku 	__le16   window;
1520f6422ec6SAntti Julku } __packed;
1521f6422ec6SAntti Julku 
15225a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
15235a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
15245a134faeSAndrzej Kaczmarek 	__le16   handle;
15255a134faeSAndrzej Kaczmarek 	__u8     type;
15265a134faeSAndrzej Kaczmarek } __packed;
15275a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
15285a134faeSAndrzej Kaczmarek 	__u8     status;
15295a134faeSAndrzej Kaczmarek 	__le16   handle;
15305a134faeSAndrzej Kaczmarek 	__s8     tx_power;
15315a134faeSAndrzej Kaczmarek } __packed;
15325a134faeSAndrzej Kaczmarek 
1533f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1534f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1535f332ec66SJohan Hedberg 	__u8     status;
1536f332ec66SJohan Hedberg 	__u8     type;
1537f332ec66SJohan Hedberg } __packed;
1538f332ec66SJohan Hedberg 
1539f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1540f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1541f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1542f6422ec6SAntti Julku 
15435ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
15445ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
15455ae76a94SAndrzej Kaczmarek 	__le16   handle;
15465ae76a94SAndrzej Kaczmarek } __packed;
15475ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
15485ae76a94SAndrzej Kaczmarek 	__u8     status;
15495ae76a94SAndrzej Kaczmarek 	__le16   handle;
15505ae76a94SAndrzej Kaczmarek 	__s8     rssi;
15515ae76a94SAndrzej Kaczmarek } __packed;
15525ae76a94SAndrzej Kaczmarek 
155333f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
155433f35721SJohan Hedberg struct hci_cp_read_clock {
155533f35721SJohan Hedberg 	__le16   handle;
155633f35721SJohan Hedberg 	__u8     which;
155733f35721SJohan Hedberg } __packed;
155833f35721SJohan Hedberg struct hci_rp_read_clock {
155933f35721SJohan Hedberg 	__u8     status;
156033f35721SJohan Hedberg 	__le16   handle;
156133f35721SJohan Hedberg 	__le32   clock;
156233f35721SJohan Hedberg 	__le16   accuracy;
156333f35721SJohan Hedberg } __packed;
156433f35721SJohan Hedberg 
1565821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1566821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1567821f3766SJohan Hedberg 	__le16   handle;
1568821f3766SJohan Hedberg } __packed;
1569821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1570821f3766SJohan Hedberg 	__u8     status;
1571821f3766SJohan Hedberg 	__le16   handle;
1572821f3766SJohan Hedberg 	__u8     key_size;
1573821f3766SJohan Hedberg } __packed;
1574821f3766SJohan Hedberg 
1575928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1576928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1577928abaa7SAndrei Emeltchenko 	__u8     status;
1578928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1579928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1580928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1581928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1582928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1583928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1584928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1585928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1586928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1587928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1588928abaa7SAndrei Emeltchenko } __packed;
1589928abaa7SAndrei Emeltchenko 
1590523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1591523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1592523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1593523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1594523e93cdSAndrei Emeltchenko 	__le16   max_len;
1595523e93cdSAndrei Emeltchenko } __packed;
1596523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1597523e93cdSAndrei Emeltchenko 	__u8     status;
1598523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1599523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1600a7e45454SGustavo A. R. Silva 	__u8     frag[];
1601523e93cdSAndrei Emeltchenko } __packed;
1602523e93cdSAndrei Emeltchenko 
1603523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1604523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1605523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1606523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1607523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1608a7e45454SGustavo A. R. Silva 	__u8     frag[];
1609523e93cdSAndrei Emeltchenko } __packed;
1610523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1611523e93cdSAndrei Emeltchenko 	__u8     status;
1612523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1613523e93cdSAndrei Emeltchenko } __packed;
1614523e93cdSAndrei Emeltchenko 
1615f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1616f4fe73edSMarcel Holtmann 
16174b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
16184b4148e9SMarcel Holtmann 
161906f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
162006f5b778SMarcel Holtmann 
162163185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
162263185f64SVille Tervo struct hci_cp_le_set_event_mask {
162363185f64SVille Tervo 	__u8     mask[8];
162463185f64SVille Tervo } __packed;
162563185f64SVille Tervo 
162663185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
162763185f64SVille Tervo struct hci_rp_le_read_buffer_size {
162863185f64SVille Tervo 	__u8     status;
162963185f64SVille Tervo 	__le16   le_mtu;
163063185f64SVille Tervo 	__u8     le_max_pkt;
163163185f64SVille Tervo } __packed;
163263185f64SVille Tervo 
163360e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
163460e77321SJohan Hedberg struct hci_rp_le_read_local_features {
163560e77321SJohan Hedberg 	__u8     status;
163660e77321SJohan Hedberg 	__u8     features[8];
163760e77321SJohan Hedberg } __packed;
163860e77321SJohan Hedberg 
1639d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1640d13eafceSMarcel Holtmann 
16411e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
16421e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
16431e191893SMarcel Holtmann 	__le16   min_interval;
16441e191893SMarcel Holtmann 	__le16   max_interval;
16451e191893SMarcel Holtmann 	__u8     type;
16461e191893SMarcel Holtmann 	__u8     own_address_type;
16471e191893SMarcel Holtmann 	__u8     direct_addr_type;
16481e191893SMarcel Holtmann 	bdaddr_t direct_addr;
16491e191893SMarcel Holtmann 	__u8     channel_map;
16501e191893SMarcel Holtmann 	__u8     filter_policy;
16511e191893SMarcel Holtmann } __packed;
16521e191893SMarcel Holtmann 
16538fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
16548fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
16558fa19098SJohan Hedberg 	__u8	status;
16568fa19098SJohan Hedberg 	__s8	tx_power;
16578fa19098SJohan Hedberg } __packed;
16588fa19098SJohan Hedberg 
16593f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
16603f0f524bSJohan Hedberg 
16613f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
16623f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
16633f0f524bSJohan Hedberg 	__u8	length;
16643f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
16653f0f524bSJohan Hedberg } __packed;
16663f0f524bSJohan Hedberg 
1667f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1668f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1669f14d8f64SMarcel Holtmann 	__u8	length;
1670f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1671f14d8f64SMarcel Holtmann } __packed;
1672f14d8f64SMarcel Holtmann 
1673c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1674c1d5dc4aSJohan Hedberg 
16755df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
16765df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
16775df480b5SAndre Guedes 
167807f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
167907f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
168007f7fa5dSAndre Guedes 	__u8    type;
168107f7fa5dSAndre Guedes 	__le16  interval;
168207f7fa5dSAndre Guedes 	__le16  window;
168307f7fa5dSAndre Guedes 	__u8    own_address_type;
168407f7fa5dSAndre Guedes 	__u8    filter_policy;
168507f7fa5dSAndre Guedes } __packed;
168607f7fa5dSAndre Guedes 
168776a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
168876a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1689525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1690525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
169168a8aea4SAndrei Emeltchenko 
1692eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1693eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1694eb9d91f5SAndre Guedes 	__u8     enable;
1695eb9d91f5SAndre Guedes 	__u8     filter_dup;
1696eb9d91f5SAndre Guedes } __packed;
1697eb9d91f5SAndre Guedes 
1698a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
16993d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST		0x01
1700a7139eddSJohan Hedberg 
170163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
170263185f64SVille Tervo struct hci_cp_le_create_conn {
170363185f64SVille Tervo 	__le16   scan_interval;
170463185f64SVille Tervo 	__le16   scan_window;
170563185f64SVille Tervo 	__u8     filter_policy;
170663185f64SVille Tervo 	__u8     peer_addr_type;
170763185f64SVille Tervo 	bdaddr_t peer_addr;
170863185f64SVille Tervo 	__u8     own_address_type;
170963185f64SVille Tervo 	__le16   conn_interval_min;
171063185f64SVille Tervo 	__le16   conn_interval_max;
171163185f64SVille Tervo 	__le16   conn_latency;
171263185f64SVille Tervo 	__le16   supervision_timeout;
171363185f64SVille Tervo 	__le16   min_ce_len;
171463185f64SVille Tervo 	__le16   max_ce_len;
171563185f64SVille Tervo } __packed;
171663185f64SVille Tervo 
171763185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
171863185f64SVille Tervo 
17193d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE	0x200f
17203d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size {
1721cf1d081fSJohan Hedberg 	__u8	status;
1722cf1d081fSJohan Hedberg 	__u8	size;
1723cf1d081fSJohan Hedberg } __packed;
1724cf1d081fSJohan Hedberg 
17253d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST	0x2010
1726d9a7b0a5SMarcel Holtmann 
17273d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST	0x2011
17283d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list {
1729d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1730d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1731d9a7b0a5SMarcel Holtmann } __packed;
1732d9a7b0a5SMarcel Holtmann 
17333d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST	0x2012
17343d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list {
1735d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1736d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1737d9a7b0a5SMarcel Holtmann } __packed;
1738d9a7b0a5SMarcel Holtmann 
17392ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
17402ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
17412ce603ebSClaudio Takahasi 	__le16   handle;
17422ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
17432ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
17442ce603ebSClaudio Takahasi 	__le16   conn_latency;
17452ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
17462ce603ebSClaudio Takahasi 	__le16   min_ce_len;
17472ce603ebSClaudio Takahasi 	__le16   max_ce_len;
17482ce603ebSClaudio Takahasi } __packed;
17492ce603ebSClaudio Takahasi 
17500fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
17510fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
17520fe29fd1SMarcel Holtmann 	__le16	 handle;
17530fe29fd1SMarcel Holtmann } __packed;
17540fe29fd1SMarcel Holtmann 
1755a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1756a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1757a7a595f6SVinicius Costa Gomes 	__le16	handle;
1758fe39c7b2SMarcel Holtmann 	__le64	rand;
1759a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1760a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1761a7a595f6SVinicius Costa Gomes } __packed;
1762a7a595f6SVinicius Costa Gomes 
1763a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1764a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1765a7a595f6SVinicius Costa Gomes 	__le16	handle;
1766a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1767a7a595f6SVinicius Costa Gomes } __packed;
1768a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1769a7a595f6SVinicius Costa Gomes 	__u8	status;
1770a7a595f6SVinicius Costa Gomes 	__le16	handle;
1771a7a595f6SVinicius Costa Gomes } __packed;
1772a7a595f6SVinicius Costa Gomes 
1773a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1774a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1775a7a595f6SVinicius Costa Gomes 	__le16	handle;
1776a7a595f6SVinicius Costa Gomes } __packed;
1777a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1778a7a595f6SVinicius Costa Gomes 	__u8	status;
1779a7a595f6SVinicius Costa Gomes 	__le16	handle;
1780a7a595f6SVinicius Costa Gomes } __packed;
1781a7a595f6SVinicius Costa Gomes 
17829b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
17839b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
17849b008c04SJohan Hedberg 	__u8	status;
17859b008c04SJohan Hedberg 	__u8	le_states[8];
17869b008c04SJohan Hedberg } __packed;
17879b008c04SJohan Hedberg 
17888e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
17898e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
17908e75b46aSAndre Guedes 	__le16	handle;
17918e75b46aSAndre Guedes 	__le16	interval_min;
17928e75b46aSAndre Guedes 	__le16	interval_max;
17938e75b46aSAndre Guedes 	__le16	latency;
17948e75b46aSAndre Guedes 	__le16	timeout;
17958e75b46aSAndre Guedes 	__le16	min_ce_len;
17968e75b46aSAndre Guedes 	__le16	max_ce_len;
17978e75b46aSAndre Guedes } __packed;
17988e75b46aSAndre Guedes 
17998e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
18008e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
18018e75b46aSAndre Guedes 	__le16	handle;
18028e75b46aSAndre Guedes 	__u8	reason;
18038e75b46aSAndre Guedes } __packed;
18048e75b46aSAndre Guedes 
180594a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
180694a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
180794a3bd02SMarcel Holtmann 	__le16	handle;
180894a3bd02SMarcel Holtmann 	__le16	tx_len;
180994a3bd02SMarcel Holtmann 	__le16	tx_time;
181094a3bd02SMarcel Holtmann } __packed;
181194a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
181294a3bd02SMarcel Holtmann 	__u8	status;
181394a3bd02SMarcel Holtmann 	__le16	handle;
181494a3bd02SMarcel Holtmann } __packed;
181594a3bd02SMarcel Holtmann 
181694a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
181794a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
181894a3bd02SMarcel Holtmann 	__u8	status;
181994a3bd02SMarcel Holtmann 	__le16	tx_len;
182094a3bd02SMarcel Holtmann 	__le16	tx_time;
182194a3bd02SMarcel Holtmann } __packed;
182294a3bd02SMarcel Holtmann 
182394a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
182494a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
182594a3bd02SMarcel Holtmann 	__le16	tx_len;
182694a3bd02SMarcel Holtmann 	__le16	tx_time;
182794a3bd02SMarcel Holtmann } __packed;
182894a3bd02SMarcel Holtmann 
1829b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST	0x2027
1830b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list {
1831b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1832b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1833b950aa88SAnkit Navik 	__u8	 peer_irk[16];
1834b950aa88SAnkit Navik 	__u8	 local_irk[16];
1835b950aa88SAnkit Navik } __packed;
1836b950aa88SAnkit Navik 
1837b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST	0x2028
1838b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list {
1839b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1840b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1841b950aa88SAnkit Navik } __packed;
1842b950aa88SAnkit Navik 
1843545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST	0x2029
1844545f2596SAnkit Navik 
1845cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE	0x202a
1846cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1847cfdb0c2dSAnkit Navik 	__u8	status;
1848cfdb0c2dSAnkit Navik 	__u8	size;
1849cfdb0c2dSAnkit Navik } __packed;
1850cfdb0c2dSAnkit Navik 
1851aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1852aa12af77SAnkit Navik 
1853b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT	0x202e
1854b2cc2339SSathish Narasimman 
185594a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
185694a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
185794a3bd02SMarcel Holtmann 	__u8	status;
185894a3bd02SMarcel Holtmann 	__le16	tx_len;
185994a3bd02SMarcel Holtmann 	__le16	tx_time;
186094a3bd02SMarcel Holtmann 	__le16	rx_len;
186194a3bd02SMarcel Holtmann 	__le16	rx_time;
186294a3bd02SMarcel Holtmann } __packed;
186394a3bd02SMarcel Holtmann 
1864de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY	0x2031
1865de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1866de2ba303SMarcel Holtmann 	__u8    all_phys;
1867de2ba303SMarcel Holtmann 	__u8    tx_phys;
1868de2ba303SMarcel Holtmann 	__u8    rx_phys;
1869de2ba303SMarcel Holtmann } __packed;
1870de2ba303SMarcel Holtmann 
18716decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M		0x01
18726decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M		0x02
18736decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED		0x04
18746decb5b4SJaganath Kanakkassery 
1875a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS   0x2041
1876a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1877a2344b9eSJaganath Kanakkassery 	__u8    own_addr_type;
1878a2344b9eSJaganath Kanakkassery 	__u8    filter_policy;
1879a2344b9eSJaganath Kanakkassery 	__u8    scanning_phys;
1880a7e45454SGustavo A. R. Silva 	__u8    data[];
1881a2344b9eSJaganath Kanakkassery } __packed;
1882a2344b9eSJaganath Kanakkassery 
1883a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M		0x01
188445bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M		0x02
188545bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED	0x04
1886a2344b9eSJaganath Kanakkassery 
1887a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1888a2344b9eSJaganath Kanakkassery 	__u8    type;
1889a2344b9eSJaganath Kanakkassery 	__le16  interval;
1890a2344b9eSJaganath Kanakkassery 	__le16  window;
1891a2344b9eSJaganath Kanakkassery } __packed;
1892a2344b9eSJaganath Kanakkassery 
1893a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE   0x2042
1894a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1895a2344b9eSJaganath Kanakkassery 	__u8    enable;
1896a2344b9eSJaganath Kanakkassery 	__u8    filter_dup;
1897a2344b9eSJaganath Kanakkassery 	__le16  duration;
1898a2344b9eSJaganath Kanakkassery 	__le16  period;
1899a2344b9eSJaganath Kanakkassery } __packed;
1900a2344b9eSJaganath Kanakkassery 
19014d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN    0x2043
19024d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
19034d94f95dSJaganath Kanakkassery 	__u8      filter_policy;
19044d94f95dSJaganath Kanakkassery 	__u8      own_addr_type;
19054d94f95dSJaganath Kanakkassery 	__u8      peer_addr_type;
19064d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_addr;
19074d94f95dSJaganath Kanakkassery 	__u8      phys;
1908a7e45454SGustavo A. R. Silva 	__u8      data[];
19094d94f95dSJaganath Kanakkassery } __packed;
19104d94f95dSJaganath Kanakkassery 
19114d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
19124d94f95dSJaganath Kanakkassery 	__le16 scan_interval;
19134d94f95dSJaganath Kanakkassery 	__le16 scan_window;
19144d94f95dSJaganath Kanakkassery 	__le16 conn_interval_min;
19154d94f95dSJaganath Kanakkassery 	__le16 conn_interval_max;
19164d94f95dSJaganath Kanakkassery 	__le16 conn_latency;
19174d94f95dSJaganath Kanakkassery 	__le16 supervision_timeout;
19184d94f95dSJaganath Kanakkassery 	__le16 min_ce_len;
19194d94f95dSJaganath Kanakkassery 	__le16 max_ce_len;
19204d94f95dSJaganath Kanakkassery } __packed;
19214d94f95dSJaganath Kanakkassery 
1922eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_CREATE_SYNC	0x2044
1923eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_create_sync {
1924eca0ae4aSLuiz Augusto von Dentz 	__u8      options;
1925eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
1926eca0ae4aSLuiz Augusto von Dentz 	__u8      addr_type;
1927eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  addr;
1928eca0ae4aSLuiz Augusto von Dentz 	__le16    skip;
1929eca0ae4aSLuiz Augusto von Dentz 	__le16    sync_timeout;
1930eca0ae4aSLuiz Augusto von Dentz 	__u8      sync_cte_type;
1931eca0ae4aSLuiz Augusto von Dentz } __packed;
1932eca0ae4aSLuiz Augusto von Dentz 
1933eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_TERM_SYNC		0x2046
1934eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_term_sync {
1935eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
1936eca0ae4aSLuiz Augusto von Dentz } __packed;
1937eca0ae4aSLuiz Augusto von Dentz 
19386b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS	0x203b
19396b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
19406b49bcb4SJaganath Kanakkassery 	__u8  status;
19416b49bcb4SJaganath Kanakkassery 	__u8  num_of_sets;
19426b49bcb4SJaganath Kanakkassery } __packed;
19436b49bcb4SJaganath Kanakkassery 
1944de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS		0x2036
1945de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1946de181e88SJaganath Kanakkassery 	__u8      handle;
1947de181e88SJaganath Kanakkassery 	__le16    evt_properties;
1948de181e88SJaganath Kanakkassery 	__u8      min_interval[3];
1949de181e88SJaganath Kanakkassery 	__u8      max_interval[3];
1950de181e88SJaganath Kanakkassery 	__u8      channel_map;
1951de181e88SJaganath Kanakkassery 	__u8      own_addr_type;
1952de181e88SJaganath Kanakkassery 	__u8      peer_addr_type;
1953de181e88SJaganath Kanakkassery 	bdaddr_t  peer_addr;
1954de181e88SJaganath Kanakkassery 	__u8      filter_policy;
1955de181e88SJaganath Kanakkassery 	__u8      tx_power;
1956de181e88SJaganath Kanakkassery 	__u8      primary_phy;
1957de181e88SJaganath Kanakkassery 	__u8      secondary_max_skip;
1958de181e88SJaganath Kanakkassery 	__u8      secondary_phy;
1959de181e88SJaganath Kanakkassery 	__u8      sid;
1960de181e88SJaganath Kanakkassery 	__u8      notif_enable;
1961de181e88SJaganath Kanakkassery } __packed;
1962de181e88SJaganath Kanakkassery 
1963de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M		0X01
196485a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M		0x02
196585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED	0x03
1966de181e88SJaganath Kanakkassery 
1967de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1968de181e88SJaganath Kanakkassery 	__u8  status;
1969de181e88SJaganath Kanakkassery 	__u8  tx_power;
1970de181e88SJaganath Kanakkassery } __packed;
1971de181e88SJaganath Kanakkassery 
1972de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1973de181e88SJaganath Kanakkassery 	__u8  handle;
1974de181e88SJaganath Kanakkassery 	__le16 duration;
1975de181e88SJaganath Kanakkassery 	__u8  max_events;
1976de181e88SJaganath Kanakkassery } __packed;
1977de181e88SJaganath Kanakkassery 
1978c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH	251
1979c9ed0a70SLuiz Augusto von Dentz 
1980a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA		0x2037
1981a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1982a0fb3726SJaganath Kanakkassery 	__u8  handle;
1983a0fb3726SJaganath Kanakkassery 	__u8  operation;
1984a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1985a0fb3726SJaganath Kanakkassery 	__u8  length;
1986c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
1987a0fb3726SJaganath Kanakkassery } __packed;
1988a0fb3726SJaganath Kanakkassery 
1989a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA		0x2038
1990a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
1991a0fb3726SJaganath Kanakkassery 	__u8  handle;
1992a0fb3726SJaganath Kanakkassery 	__u8  operation;
1993a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1994a0fb3726SJaganath Kanakkassery 	__u8  length;
1995c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
1996a0fb3726SJaganath Kanakkassery } __packed;
1997a0fb3726SJaganath Kanakkassery 
1998eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_EXT_ADV_ENABLE		0x2039
1999eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_ext_adv_enable {
2000eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
2001eca0ae4aSLuiz Augusto von Dentz 	__u8  num_of_sets;
2002eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
2003eca0ae4aSLuiz Augusto von Dentz } __packed;
2004eca0ae4aSLuiz Augusto von Dentz 
2005eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_PARAMS		0x203e
2006eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_params {
2007eca0ae4aSLuiz Augusto von Dentz 	__u8      handle;
2008eca0ae4aSLuiz Augusto von Dentz 	__le16    min_interval;
2009eca0ae4aSLuiz Augusto von Dentz 	__le16    max_interval;
2010eca0ae4aSLuiz Augusto von Dentz 	__le16    periodic_properties;
2011eca0ae4aSLuiz Augusto von Dentz } __packed;
2012eca0ae4aSLuiz Augusto von Dentz 
2013eca0ae4aSLuiz Augusto von Dentz #define HCI_MAX_PER_AD_LENGTH	252
2014eca0ae4aSLuiz Augusto von Dentz 
2015eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_DATA		0x203f
2016eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_data {
2017eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
2018eca0ae4aSLuiz Augusto von Dentz 	__u8  operation;
2019eca0ae4aSLuiz Augusto von Dentz 	__u8  length;
2020eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
2021eca0ae4aSLuiz Augusto von Dentz } __packed;
2022eca0ae4aSLuiz Augusto von Dentz 
2023eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_ENABLE		0x2040
2024eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_enable {
2025eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
2026eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
2027eca0ae4aSLuiz Augusto von Dentz } __packed;
2028eca0ae4aSLuiz Augusto von Dentz 
2029a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE	0x03
2030a0fb3726SJaganath Kanakkassery 
2031a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG		0x01
2032a0fb3726SJaganath Kanakkassery 
2033a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET	0x203c
2034a9e45698SSathish Narsimman 
203545b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS	0x203d
203645b7749fSJaganath Kanakkassery 
2037a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR	0x2035
2038a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
2039a73c046aSJaganath Kanakkassery 	__u8  handle;
2040a73c046aSJaganath Kanakkassery 	bdaddr_t  bdaddr;
2041a73c046aSJaganath Kanakkassery } __packed;
2042a73c046aSJaganath Kanakkassery 
20437c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER	0x204b
20447c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power {
20457c395ea5SDaniel Winkler 	__u8  status;
20467c395ea5SDaniel Winkler 	__s8  min_le_tx_power;
20477c395ea5SDaniel Winkler 	__s8  max_le_tx_power;
20487c395ea5SDaniel Winkler } __packed;
20497c395ea5SDaniel Winkler 
2050853b70b5SLuiz Augusto von Dentz #define HCI_NETWORK_PRIVACY		0x00
2051853b70b5SLuiz Augusto von Dentz #define HCI_DEVICE_PRIVACY		0x01
2052853b70b5SLuiz Augusto von Dentz 
2053853b70b5SLuiz Augusto von Dentz #define HCI_OP_LE_SET_PRIVACY_MODE	0x204e
2054853b70b5SLuiz Augusto von Dentz struct hci_cp_le_set_privacy_mode {
2055853b70b5SLuiz Augusto von Dentz 	__u8  bdaddr_type;
2056853b70b5SLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2057853b70b5SLuiz Augusto von Dentz 	__u8  mode;
2058853b70b5SLuiz Augusto von Dentz } __packed;
2059853b70b5SLuiz Augusto von Dentz 
20604de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2	0x2060
20614de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 {
20624de0fc59SLuiz Augusto von Dentz 	__u8    status;
20634de0fc59SLuiz Augusto von Dentz 	__le16  acl_mtu;
20644de0fc59SLuiz Augusto von Dentz 	__u8    acl_max_pkt;
20654de0fc59SLuiz Augusto von Dentz 	__le16  iso_mtu;
20664de0fc59SLuiz Augusto von Dentz 	__u8    iso_max_pkt;
20674de0fc59SLuiz Augusto von Dentz } __packed;
20684de0fc59SLuiz Augusto von Dentz 
20694de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC		0x2061
20704de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync {
20714de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20724de0fc59SLuiz Augusto von Dentz } __packed;
20734de0fc59SLuiz Augusto von Dentz 
20744de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync {
20754de0fc59SLuiz Augusto von Dentz 	__u8    status;
20764de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20774de0fc59SLuiz Augusto von Dentz 	__le16  seq;
20784de0fc59SLuiz Augusto von Dentz 	__le32  imestamp;
20794de0fc59SLuiz Augusto von Dentz 	__u8    offset[3];
20804de0fc59SLuiz Augusto von Dentz } __packed;
20814de0fc59SLuiz Augusto von Dentz 
20824de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS		0x2062
20834de0fc59SLuiz Augusto von Dentz struct hci_cis_params {
20844de0fc59SLuiz Augusto von Dentz 	__u8    cis_id;
208576c185a5SArchie Pusaka 	__le16  c_sdu;
208626afbd82SLuiz Augusto von Dentz 	__le16  p_sdu;
208776c185a5SArchie Pusaka 	__u8    c_phy;
208876c185a5SArchie Pusaka 	__u8    p_phy;
208976c185a5SArchie Pusaka 	__u8    c_rtn;
209076c185a5SArchie Pusaka 	__u8    p_rtn;
20914de0fc59SLuiz Augusto von Dentz } __packed;
20924de0fc59SLuiz Augusto von Dentz 
20934de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params {
20944de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
209576c185a5SArchie Pusaka 	__u8    c_interval[3];
209676c185a5SArchie Pusaka 	__u8    p_interval[3];
209726afbd82SLuiz Augusto von Dentz 	__u8    sca;
20984de0fc59SLuiz Augusto von Dentz 	__u8    packing;
20994de0fc59SLuiz Augusto von Dentz 	__u8    framing;
210076c185a5SArchie Pusaka 	__le16  c_latency;
210176c185a5SArchie Pusaka 	__le16  p_latency;
21024de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2103a7e45454SGustavo A. R. Silva 	struct hci_cis_params cis[];
21044de0fc59SLuiz Augusto von Dentz } __packed;
21054de0fc59SLuiz Augusto von Dentz 
21064de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params {
21074de0fc59SLuiz Augusto von Dentz 	__u8    status;
21084de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
21094de0fc59SLuiz Augusto von Dentz 	__u8    num_handles;
2110a7e45454SGustavo A. R. Silva 	__le16  handle[];
21114de0fc59SLuiz Augusto von Dentz } __packed;
21124de0fc59SLuiz Augusto von Dentz 
21134de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS			0x2064
21144de0fc59SLuiz Augusto von Dentz struct hci_cis {
21154de0fc59SLuiz Augusto von Dentz 	__le16  cis_handle;
21164de0fc59SLuiz Augusto von Dentz 	__le16  acl_handle;
21174de0fc59SLuiz Augusto von Dentz } __packed;
21184de0fc59SLuiz Augusto von Dentz 
21194de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis {
21204de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2121a7e45454SGustavo A. R. Silva 	struct hci_cis cis[];
21224de0fc59SLuiz Augusto von Dentz } __packed;
21234de0fc59SLuiz Augusto von Dentz 
21244de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG			0x2065
21254de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig {
21264de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
21274de0fc59SLuiz Augusto von Dentz } __packed;
21284de0fc59SLuiz Augusto von Dentz 
21294de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS			0x2066
21304de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis {
21314de0fc59SLuiz Augusto von Dentz 	__le16  handle;
21324de0fc59SLuiz Augusto von Dentz } __packed;
21334de0fc59SLuiz Augusto von Dentz 
21344de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS			0x2067
21354de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis {
21364de0fc59SLuiz Augusto von Dentz 	__le16  handle;
21374de0fc59SLuiz Augusto von Dentz 	__u8    reason;
21384de0fc59SLuiz Augusto von Dentz } __packed;
21394de0fc59SLuiz Augusto von Dentz 
2140eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_BIG			0x2068
2141eca0ae4aSLuiz Augusto von Dentz struct hci_bis {
2142eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2143eca0ae4aSLuiz Augusto von Dentz 	__le16  sdu;
2144eca0ae4aSLuiz Augusto von Dentz 	__le16  latency;
2145eca0ae4aSLuiz Augusto von Dentz 	__u8    rtn;
2146eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2147eca0ae4aSLuiz Augusto von Dentz 	__u8    packing;
2148eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2149eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2150eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2151eca0ae4aSLuiz Augusto von Dentz } __packed;
2152eca0ae4aSLuiz Augusto von Dentz 
2153eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_create_big {
2154eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2155eca0ae4aSLuiz Augusto von Dentz 	__u8    adv_handle;
2156eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2157eca0ae4aSLuiz Augusto von Dentz 	struct hci_bis bis;
2158eca0ae4aSLuiz Augusto von Dentz } __packed;
2159eca0ae4aSLuiz Augusto von Dentz 
2160eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_TERM_BIG			0x206a
2161eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_term_big {
2162eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2163eca0ae4aSLuiz Augusto von Dentz 	__u8    reason;
2164eca0ae4aSLuiz Augusto von Dentz } __packed;
2165eca0ae4aSLuiz Augusto von Dentz 
2166eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_CREATE_SYNC		0x206b
2167eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_create_sync {
2168eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2169eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2170eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2171eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2172eca0ae4aSLuiz Augusto von Dentz 	__u8    mse;
2173eca0ae4aSLuiz Augusto von Dentz 	__le16  timeout;
2174eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2175969cf3e6SGustavo A. R. Silva 	__u8    bis[];
2176eca0ae4aSLuiz Augusto von Dentz } __packed;
2177eca0ae4aSLuiz Augusto von Dentz 
2178eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_TERM_SYNC			0x206c
2179eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_term_sync {
2180eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2181eca0ae4aSLuiz Augusto von Dentz } __packed;
2182eca0ae4aSLuiz Augusto von Dentz 
218326afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SETUP_ISO_PATH		0x206e
218426afbd82SLuiz Augusto von Dentz struct hci_cp_le_setup_iso_path {
218526afbd82SLuiz Augusto von Dentz 	__le16  handle;
218626afbd82SLuiz Augusto von Dentz 	__u8    direction;
218726afbd82SLuiz Augusto von Dentz 	__u8    path;
218826afbd82SLuiz Augusto von Dentz 	__u8    codec;
218926afbd82SLuiz Augusto von Dentz 	__le16  codec_cid;
219026afbd82SLuiz Augusto von Dentz 	__le16  codec_vid;
219126afbd82SLuiz Augusto von Dentz 	__u8    delay[3];
219226afbd82SLuiz Augusto von Dentz 	__u8    codec_cfg_len;
2193969cf3e6SGustavo A. R. Silva 	__u8    codec_cfg[];
219426afbd82SLuiz Augusto von Dentz } __packed;
219526afbd82SLuiz Augusto von Dentz 
219626afbd82SLuiz Augusto von Dentz struct hci_rp_le_setup_iso_path {
219726afbd82SLuiz Augusto von Dentz 	__u8    status;
219826afbd82SLuiz Augusto von Dentz 	__le16  handle;
219926afbd82SLuiz Augusto von Dentz } __packed;
220026afbd82SLuiz Augusto von Dentz 
220126afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SET_HOST_FEATURE		0x2074
220226afbd82SLuiz Augusto von Dentz struct hci_cp_le_set_host_feature {
220326afbd82SLuiz Augusto von Dentz 	__u8     bit_number;
220426afbd82SLuiz Augusto von Dentz 	__u8     bit_value;
220526afbd82SLuiz Augusto von Dentz } __packed;
220626afbd82SLuiz Augusto von Dentz 
22071da177e4SLinus Torvalds /* ---- HCI Events ---- */
2208ae61a10dSLuiz Augusto von Dentz struct hci_ev_status {
2209ae61a10dSLuiz Augusto von Dentz 	__u8    status;
2210ae61a10dSLuiz Augusto von Dentz } __packed;
2211ae61a10dSLuiz Augusto von Dentz 
22121da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
22131da177e4SLinus Torvalds 
22141da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
22151da177e4SLinus Torvalds struct inquiry_info {
22161da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22171da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
22181da177e4SLinus Torvalds 	__u8     pscan_period_mode;
22191da177e4SLinus Torvalds 	__u8     pscan_mode;
22201da177e4SLinus Torvalds 	__u8     dev_class[3];
22211ebb9252SMarcel Holtmann 	__le16   clock_offset;
222266c853ccSGustavo F. Padovan } __packed;
22231da177e4SLinus Torvalds 
222427d9eb4bSLuiz Augusto von Dentz struct hci_ev_inquiry_result {
222527d9eb4bSLuiz Augusto von Dentz 	__u8    num;
222627d9eb4bSLuiz Augusto von Dentz 	struct inquiry_info info[];
222727d9eb4bSLuiz Augusto von Dentz };
222827d9eb4bSLuiz Augusto von Dentz 
22291da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
22301da177e4SLinus Torvalds struct hci_ev_conn_complete {
22311da177e4SLinus Torvalds 	__u8     status;
22321ebb9252SMarcel Holtmann 	__le16   handle;
22331da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22341da177e4SLinus Torvalds 	__u8     link_type;
22351da177e4SLinus Torvalds 	__u8     encr_mode;
223666c853ccSGustavo F. Padovan } __packed;
22371da177e4SLinus Torvalds 
22381da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
22391da177e4SLinus Torvalds struct hci_ev_conn_request {
22401da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22411da177e4SLinus Torvalds 	__u8     dev_class[3];
22421da177e4SLinus Torvalds 	__u8     link_type;
224366c853ccSGustavo F. Padovan } __packed;
22441da177e4SLinus Torvalds 
22451da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
22461da177e4SLinus Torvalds struct hci_ev_disconn_complete {
22471da177e4SLinus Torvalds 	__u8     status;
22481ebb9252SMarcel Holtmann 	__le16   handle;
22491da177e4SLinus Torvalds 	__u8     reason;
225066c853ccSGustavo F. Padovan } __packed;
22511da177e4SLinus Torvalds 
22521da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
22531da177e4SLinus Torvalds struct hci_ev_auth_complete {
22541da177e4SLinus Torvalds 	__u8     status;
22551ebb9252SMarcel Holtmann 	__le16   handle;
225666c853ccSGustavo F. Padovan } __packed;
22571da177e4SLinus Torvalds 
2258a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
2259a9de9248SMarcel Holtmann struct hci_ev_remote_name {
2260a9de9248SMarcel Holtmann 	__u8     status;
2261a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
22621f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
226366c853ccSGustavo F. Padovan } __packed;
2264a9de9248SMarcel Holtmann 
22651da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
22661da177e4SLinus Torvalds struct hci_ev_encrypt_change {
22671da177e4SLinus Torvalds 	__u8     status;
22681ebb9252SMarcel Holtmann 	__le16   handle;
22691da177e4SLinus Torvalds 	__u8     encrypt;
227066c853ccSGustavo F. Padovan } __packed;
22711da177e4SLinus Torvalds 
2272a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
2273a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
22741da177e4SLinus Torvalds 	__u8     status;
22751ebb9252SMarcel Holtmann 	__le16   handle;
227666c853ccSGustavo F. Padovan } __packed;
22771da177e4SLinus Torvalds 
2278a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
2279a9de9248SMarcel Holtmann struct hci_ev_remote_features {
2280a9de9248SMarcel Holtmann 	__u8     status;
2281a9de9248SMarcel Holtmann 	__le16   handle;
2282a9de9248SMarcel Holtmann 	__u8     features[8];
228366c853ccSGustavo F. Padovan } __packed;
2284a9de9248SMarcel Holtmann 
2285a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
2286a9de9248SMarcel Holtmann struct hci_ev_remote_version {
2287a9de9248SMarcel Holtmann 	__u8     status;
2288a9de9248SMarcel Holtmann 	__le16   handle;
2289a9de9248SMarcel Holtmann 	__u8     lmp_ver;
2290a9de9248SMarcel Holtmann 	__le16   manufacturer;
2291a9de9248SMarcel Holtmann 	__le16   lmp_subver;
229266c853ccSGustavo F. Padovan } __packed;
2293a9de9248SMarcel Holtmann 
2294a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
22951da177e4SLinus Torvalds struct hci_qos {
22961da177e4SLinus Torvalds 	__u8     service_type;
22971da177e4SLinus Torvalds 	__u32    token_rate;
22981da177e4SLinus Torvalds 	__u32    peak_bandwidth;
22991da177e4SLinus Torvalds 	__u32    latency;
23001da177e4SLinus Torvalds 	__u32    delay_variation;
230166c853ccSGustavo F. Padovan } __packed;
23021da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
23031da177e4SLinus Torvalds 	__u8     status;
23041ebb9252SMarcel Holtmann 	__le16   handle;
23051da177e4SLinus Torvalds 	struct   hci_qos qos;
230666c853ccSGustavo F. Padovan } __packed;
23071da177e4SLinus Torvalds 
2308a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
23091da177e4SLinus Torvalds struct hci_ev_cmd_complete {
23101da177e4SLinus Torvalds 	__u8     ncmd;
23111ebb9252SMarcel Holtmann 	__le16   opcode;
231266c853ccSGustavo F. Padovan } __packed;
23131da177e4SLinus Torvalds 
2314a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
23151da177e4SLinus Torvalds struct hci_ev_cmd_status {
23161da177e4SLinus Torvalds 	__u8     status;
23171da177e4SLinus Torvalds 	__u8     ncmd;
23181ebb9252SMarcel Holtmann 	__le16   opcode;
231966c853ccSGustavo F. Padovan } __packed;
23201da177e4SLinus Torvalds 
232124dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
232224dfa343SMarcel Holtmann struct hci_ev_hardware_error {
232324dfa343SMarcel Holtmann 	__u8     code;
232424dfa343SMarcel Holtmann } __packed;
232524dfa343SMarcel Holtmann 
23261da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
23271da177e4SLinus Torvalds struct hci_ev_role_change {
23281da177e4SLinus Torvalds 	__u8     status;
23291da177e4SLinus Torvalds 	bdaddr_t bdaddr;
23301da177e4SLinus Torvalds 	__u8     role;
233166c853ccSGustavo F. Padovan } __packed;
23321da177e4SLinus Torvalds 
2333a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
2334613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
2335613a1c0cSAndrei Emeltchenko 	__le16   handle;
2336613a1c0cSAndrei Emeltchenko 	__le16   count;
2337613a1c0cSAndrei Emeltchenko } __packed;
2338613a1c0cSAndrei Emeltchenko 
2339a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
2340aadc3d2fSLuiz Augusto von Dentz 	__u8     num;
2341a7e45454SGustavo A. R. Silva 	struct hci_comp_pkts_info handles[];
234266c853ccSGustavo F. Padovan } __packed;
2343a9de9248SMarcel Holtmann 
23441da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
23451da177e4SLinus Torvalds struct hci_ev_mode_change {
23461da177e4SLinus Torvalds 	__u8     status;
23471ebb9252SMarcel Holtmann 	__le16   handle;
23481da177e4SLinus Torvalds 	__u8     mode;
23491ebb9252SMarcel Holtmann 	__le16   interval;
235066c853ccSGustavo F. Padovan } __packed;
23511da177e4SLinus Torvalds 
23521da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
23531da177e4SLinus Torvalds struct hci_ev_pin_code_req {
23541da177e4SLinus Torvalds 	bdaddr_t bdaddr;
235566c853ccSGustavo F. Padovan } __packed;
23561da177e4SLinus Torvalds 
23571da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
23581da177e4SLinus Torvalds struct hci_ev_link_key_req {
23591da177e4SLinus Torvalds 	bdaddr_t bdaddr;
236066c853ccSGustavo F. Padovan } __packed;
23611da177e4SLinus Torvalds 
23621da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
23631da177e4SLinus Torvalds struct hci_ev_link_key_notify {
23641da177e4SLinus Torvalds 	bdaddr_t bdaddr;
23659b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
23661da177e4SLinus Torvalds 	__u8     key_type;
236766c853ccSGustavo F. Padovan } __packed;
23681da177e4SLinus Torvalds 
2369a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
23701da177e4SLinus Torvalds struct hci_ev_clock_offset {
23711da177e4SLinus Torvalds 	__u8     status;
23721ebb9252SMarcel Holtmann 	__le16   handle;
23731ebb9252SMarcel Holtmann 	__le16   clock_offset;
237466c853ccSGustavo F. Padovan } __packed;
23751da177e4SLinus Torvalds 
2376a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
2377a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
2378a8746417SMarcel Holtmann 	__u8     status;
2379a8746417SMarcel Holtmann 	__le16   handle;
2380a8746417SMarcel Holtmann 	__le16   pkt_type;
238166c853ccSGustavo F. Padovan } __packed;
2382a8746417SMarcel Holtmann 
238385a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
238485a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
238585a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
238685a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
238766c853ccSGustavo F. Padovan } __packed;
238885a1e930SMarcel Holtmann 
2389a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
23908d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi {
2391a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2392a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2393a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2394a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2395a9de9248SMarcel Holtmann 	__le16   clock_offset;
2396a9de9248SMarcel Holtmann 	__s8     rssi;
239766c853ccSGustavo F. Padovan } __packed;
23988d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi_pscan {
2399a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2400a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2401a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2402a9de9248SMarcel Holtmann 	__u8     pscan_mode;
2403a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2404a9de9248SMarcel Holtmann 	__le16   clock_offset;
2405a9de9248SMarcel Holtmann 	__s8     rssi;
240666c853ccSGustavo F. Padovan } __packed;
24078d08d324SLuiz Augusto von Dentz struct hci_ev_inquiry_result_rssi {
24088d08d324SLuiz Augusto von Dentz 	__u8     num;
240972279d17SLuiz Augusto von Dentz 	__u8     data[];
24108d08d324SLuiz Augusto von Dentz } __packed;
2411a9de9248SMarcel Holtmann 
2412a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
2413a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
2414a9de9248SMarcel Holtmann 	__u8     status;
2415a9de9248SMarcel Holtmann 	__le16   handle;
2416a9de9248SMarcel Holtmann 	__u8     page;
2417a9de9248SMarcel Holtmann 	__u8     max_page;
2418a9de9248SMarcel Holtmann 	__u8     features[8];
241966c853ccSGustavo F. Padovan } __packed;
2420a9de9248SMarcel Holtmann 
2421a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
2422a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
2423a9de9248SMarcel Holtmann 	__u8     status;
2424a9de9248SMarcel Holtmann 	__le16   handle;
2425a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2426a9de9248SMarcel Holtmann 	__u8     link_type;
2427a9de9248SMarcel Holtmann 	__u8     tx_interval;
2428a9de9248SMarcel Holtmann 	__u8     retrans_window;
2429a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2430a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
2431a9de9248SMarcel Holtmann 	__u8     air_mode;
243266c853ccSGustavo F. Padovan } __packed;
2433a9de9248SMarcel Holtmann 
2434a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
2435a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
2436a9de9248SMarcel Holtmann 	__u8     status;
2437a9de9248SMarcel Holtmann 	__le16   handle;
2438a9de9248SMarcel Holtmann 	__u8     tx_interval;
2439a9de9248SMarcel Holtmann 	__u8     retrans_window;
2440a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2441a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
244266c853ccSGustavo F. Padovan } __packed;
2443a9de9248SMarcel Holtmann 
2444a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
244504837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
244604837f64SMarcel Holtmann 	__u8     status;
244704837f64SMarcel Holtmann 	__le16   handle;
244804837f64SMarcel Holtmann 	__le16   max_tx_latency;
244904837f64SMarcel Holtmann 	__le16   max_rx_latency;
245004837f64SMarcel Holtmann 	__le16   max_remote_timeout;
245104837f64SMarcel Holtmann 	__le16   max_local_timeout;
245266c853ccSGustavo F. Padovan } __packed;
245304837f64SMarcel Holtmann 
2454a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
2455a9de9248SMarcel Holtmann struct extended_inquiry_info {
2456a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2457a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2458a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2459a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2460a9de9248SMarcel Holtmann 	__le16   clock_offset;
2461a9de9248SMarcel Holtmann 	__s8     rssi;
2462a9de9248SMarcel Holtmann 	__u8     data[240];
246366c853ccSGustavo F. Padovan } __packed;
2464a9de9248SMarcel Holtmann 
246570a6b8deSLuiz Augusto von Dentz struct hci_ev_ext_inquiry_result {
246670a6b8deSLuiz Augusto von Dentz 	__u8     num;
246770a6b8deSLuiz Augusto von Dentz 	struct extended_inquiry_info info[];
246870a6b8deSLuiz Augusto von Dentz } __packed;
246970a6b8deSLuiz Augusto von Dentz 
24701c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
24711c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
24721c2e0041SJohan Hedberg 	__u8	status;
24731c2e0041SJohan Hedberg 	__le16	handle;
24741c2e0041SJohan Hedberg } __packed;
24751c2e0041SJohan Hedberg 
24760493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
24770493684eSMarcel Holtmann struct hci_ev_io_capa_request {
24780493684eSMarcel Holtmann 	bdaddr_t bdaddr;
247966c853ccSGustavo F. Padovan } __packed;
24800493684eSMarcel Holtmann 
248103b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
248203b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
248303b555e1SJohan Hedberg 	bdaddr_t bdaddr;
248403b555e1SJohan Hedberg 	__u8     capability;
248503b555e1SJohan Hedberg 	__u8     oob_data;
248603b555e1SJohan Hedberg 	__u8     authentication;
248703b555e1SJohan Hedberg } __packed;
248803b555e1SJohan Hedberg 
2489a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
2490a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
2491a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
2492a5c29683SJohan Hedberg 	__le32		passkey;
2493a5c29683SJohan Hedberg } __packed;
2494a5c29683SJohan Hedberg 
24959ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
24969ad4019aSBrian Gix struct hci_ev_user_passkey_req {
24979ad4019aSBrian Gix 	bdaddr_t	bdaddr;
24989ad4019aSBrian Gix } __packed;
24999ad4019aSBrian Gix 
25002763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
25012763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
25022763eda6SSzymon Janc 	bdaddr_t bdaddr;
25032763eda6SSzymon Janc } __packed;
25042763eda6SSzymon Janc 
25050493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
25060493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
25070493684eSMarcel Holtmann 	__u8     status;
25080493684eSMarcel Holtmann 	bdaddr_t bdaddr;
250966c853ccSGustavo F. Padovan } __packed;
25100493684eSMarcel Holtmann 
251192a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
251292a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
251392a25256SJohan Hedberg 	bdaddr_t	bdaddr;
251492a25256SJohan Hedberg 	__le32		passkey;
251592a25256SJohan Hedberg } __packed;
251692a25256SJohan Hedberg 
251792a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
251892a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
251992a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
252092a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
252192a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
252292a25256SJohan Hedberg 
252392a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
252492a25256SJohan Hedberg struct hci_ev_keypress_notify {
252592a25256SJohan Hedberg 	bdaddr_t	bdaddr;
252692a25256SJohan Hedberg 	__u8		type;
252792a25256SJohan Hedberg } __packed;
252892a25256SJohan Hedberg 
252941a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
253041a96212SMarcel Holtmann struct hci_ev_remote_host_features {
253141a96212SMarcel Holtmann 	bdaddr_t bdaddr;
253241a96212SMarcel Holtmann 	__u8     features[8];
253366c853ccSGustavo F. Padovan } __packed;
253441a96212SMarcel Holtmann 
253563185f64SVille Tervo #define HCI_EV_LE_META			0x3e
253663185f64SVille Tervo struct hci_ev_le_meta {
253763185f64SVille Tervo 	__u8     subevent;
253863185f64SVille Tervo } __packed;
253963185f64SVille Tervo 
2540523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
2541523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
2542523e93cdSAndrei Emeltchenko 	__u8     status;
2543523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2544523e93cdSAndrei Emeltchenko } __packed;
2545523e93cdSAndrei Emeltchenko 
2546523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
2547523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
2548523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2549523e93cdSAndrei Emeltchenko } __packed;
2550523e93cdSAndrei Emeltchenko 
2551523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
2552523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2553523e93cdSAndrei Emeltchenko 	__u8     status;
2554523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2555523e93cdSAndrei Emeltchenko 	__u8     reason;
2556523e93cdSAndrei Emeltchenko } __packed;
2557523e93cdSAndrei Emeltchenko 
2558523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
2559523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2560523e93cdSAndrei Emeltchenko 	__u8     status;
2561523e93cdSAndrei Emeltchenko 	__le16   handle;
2562523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2563523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
2564523e93cdSAndrei Emeltchenko } __packed;
2565523e93cdSAndrei Emeltchenko 
2566523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
2567523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2568523e93cdSAndrei Emeltchenko 	__u8     status;
2569523e93cdSAndrei Emeltchenko 	__le16   handle;
2570523e93cdSAndrei Emeltchenko 	__u8     reason;
2571523e93cdSAndrei Emeltchenko } __packed;
2572523e93cdSAndrei Emeltchenko 
257325e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
257425e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
257525e89e99SAndrei Emeltchenko 	__le16   handle;
257625e89e99SAndrei Emeltchenko 	__le16   pkts;
257725e89e99SAndrei Emeltchenko 	__le16   blocks;
257825e89e99SAndrei Emeltchenko } __packed;
257925e89e99SAndrei Emeltchenko 
258025e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
258125e89e99SAndrei Emeltchenko 	__le16   num_blocks;
258225e89e99SAndrei Emeltchenko 	__u8     num_hndl;
2583a7e45454SGustavo A. R. Silva 	struct hci_comp_blocks_info handles[];
258425e89e99SAndrei Emeltchenko } __packed;
258525e89e99SAndrei Emeltchenko 
25862b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
25872b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
25882b359445SDoHyun Pyun 	__u8	status;
25892b359445SDoHyun Pyun } __packed;
25902b359445SDoHyun Pyun 
259176c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT	0x54
25922ed01805SDoHyun Pyun 
259363185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
259463185f64SVille Tervo struct hci_ev_le_conn_complete {
259563185f64SVille Tervo 	__u8     status;
259663185f64SVille Tervo 	__le16   handle;
259763185f64SVille Tervo 	__u8     role;
259863185f64SVille Tervo 	__u8     bdaddr_type;
259963185f64SVille Tervo 	bdaddr_t bdaddr;
260063185f64SVille Tervo 	__le16   interval;
260163185f64SVille Tervo 	__le16   latency;
260263185f64SVille Tervo 	__le16   supervision_timeout;
260363185f64SVille Tervo 	__u8     clk_accurancy;
260463185f64SVille Tervo } __packed;
260563185f64SVille Tervo 
26062331fd46SMarcel Holtmann /* Advertising report event types */
26072331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
26082331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
26092331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
26102331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
26112331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
2612c215e939SJaganath Kanakkassery #define LE_ADV_INVALID		0x05
2613c215e939SJaganath Kanakkassery 
2614c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2615c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND		0x0013
2616c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 	0x0015
2617c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND		0x0012
2618c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND		0x0010
2619c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV		0x001b
2620c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN	0x001a
26212331fd46SMarcel Holtmann 
2622b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2623b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND		0x0000
2624b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND		0x0001
2625b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND		0x0002
2626b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND		0x0004
2627b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP		0x0008
2628b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU		0x0010
2629ad38e55eSSven Peter #define LE_EXT_ADV_EVT_TYPE_MASK	0x007f
2630b2cc9761SJaganath Kanakkassery 
26312331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC		0x00
26322331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM		0x01
26336540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED	0x02
26346540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED	0x03
26352331fd46SMarcel Holtmann 
26362331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
26372331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
263847afe93cSLuiz Augusto von Dentz 	__u8	 type;
26392331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
26402331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
26412331fd46SMarcel Holtmann 	__u8	 length;
2642a7e45454SGustavo A. R. Silva 	__u8	 data[];
26432331fd46SMarcel Holtmann } __packed;
26442331fd46SMarcel Holtmann 
264547afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_report {
264647afe93cSLuiz Augusto von Dentz 	__u8    num;
264747afe93cSLuiz Augusto von Dentz 	struct hci_ev_le_advertising_info info[];
264847afe93cSLuiz Augusto von Dentz } __packed;
264947afe93cSLuiz Augusto von Dentz 
26501855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
26511855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
26521855d92dSMarcel Holtmann 	__u8     status;
26531855d92dSMarcel Holtmann 	__le16   handle;
26541855d92dSMarcel Holtmann 	__le16   interval;
26551855d92dSMarcel Holtmann 	__le16   latency;
26561855d92dSMarcel Holtmann 	__le16   supervision_timeout;
26571855d92dSMarcel Holtmann } __packed;
26581855d92dSMarcel Holtmann 
26590fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
26600fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
26610fe29fd1SMarcel Holtmann 	__u8     status;
26620fe29fd1SMarcel Holtmann 	__le16   handle;
26630fe29fd1SMarcel Holtmann 	__u8     features[8];
26640fe29fd1SMarcel Holtmann } __packed;
26650fe29fd1SMarcel Holtmann 
2666a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
2667a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2668a7a595f6SVinicius Costa Gomes 	__le16	handle;
2669fe39c7b2SMarcel Holtmann 	__le64	rand;
2670a7a595f6SVinicius Costa Gomes 	__le16	ediv;
2671a7a595f6SVinicius Costa Gomes } __packed;
2672a7a595f6SVinicius Costa Gomes 
26738e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
26748e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
26758e75b46aSAndre Guedes 	__le16 handle;
26768e75b46aSAndre Guedes 	__le16 interval_min;
26778e75b46aSAndre Guedes 	__le16 interval_max;
26788e75b46aSAndre Guedes 	__le16 latency;
26798e75b46aSAndre Guedes 	__le16 timeout;
26808e75b46aSAndre Guedes } __packed;
26818e75b46aSAndre Guedes 
268294a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
268394a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
268494a3bd02SMarcel Holtmann 	__le16	handle;
268594a3bd02SMarcel Holtmann 	__le16	tx_len;
268694a3bd02SMarcel Holtmann 	__le16	tx_time;
268794a3bd02SMarcel Holtmann 	__le16	rx_len;
268894a3bd02SMarcel Holtmann 	__le16	rx_time;
268994a3bd02SMarcel Holtmann } __packed;
269094a3bd02SMarcel Holtmann 
269132c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
269232c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
2693a3679649SLuiz Augusto von Dentz 	__u8	 type;
269432c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
269532c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
269632c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
269732c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
269832c9d43fSMarcel Holtmann 	__s8	 rssi;
269932c9d43fSMarcel Holtmann } __packed;
270032c9d43fSMarcel Holtmann 
2701a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_report {
2702a3679649SLuiz Augusto von Dentz 	__u8	 num;
2703a3679649SLuiz Augusto von Dentz 	struct hci_ev_le_direct_adv_info info[];
2704a3679649SLuiz Augusto von Dentz } __packed;
2705a3679649SLuiz Augusto von Dentz 
27061efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE	0x0c
27071efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete {
27081efd927dSLuiz Augusto von Dentz 	__u8  status;
27094de0fc59SLuiz Augusto von Dentz 	__le16 handle;
27101efd927dSLuiz Augusto von Dentz 	__u8  tx_phy;
27111efd927dSLuiz Augusto von Dentz 	__u8  rx_phy;
27121efd927dSLuiz Augusto von Dentz } __packed;
27131efd927dSLuiz Augusto von Dentz 
2714c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT    0x0d
2715b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info {
2716b48b833fSLuiz Augusto von Dentz 	__le16   type;
2717c215e939SJaganath Kanakkassery 	__u8	 bdaddr_type;
2718c215e939SJaganath Kanakkassery 	bdaddr_t bdaddr;
2719c215e939SJaganath Kanakkassery 	__u8	 primary_phy;
2720c215e939SJaganath Kanakkassery 	__u8	 secondary_phy;
2721c215e939SJaganath Kanakkassery 	__u8	 sid;
2722c215e939SJaganath Kanakkassery 	__u8	 tx_power;
2723c215e939SJaganath Kanakkassery 	__s8	 rssi;
2724c215e939SJaganath Kanakkassery 	__le16   interval;
2725c215e939SJaganath Kanakkassery 	__u8     direct_addr_type;
2726c215e939SJaganath Kanakkassery 	bdaddr_t direct_addr;
2727c215e939SJaganath Kanakkassery 	__u8     length;
2728a7e45454SGustavo A. R. Silva 	__u8     data[];
2729c215e939SJaganath Kanakkassery } __packed;
2730c215e939SJaganath Kanakkassery 
2731b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_report {
2732b48b833fSLuiz Augusto von Dentz 	__u8     num;
2733b48b833fSLuiz Augusto von Dentz 	struct hci_ev_le_ext_adv_info info[];
2734b48b833fSLuiz Augusto von Dentz } __packed;
2735b48b833fSLuiz Augusto von Dentz 
2736eca0ae4aSLuiz Augusto von Dentz #define HCI_EV_LE_PA_SYNC_ESTABLISHED	0x0e
2737eca0ae4aSLuiz Augusto von Dentz struct hci_ev_le_pa_sync_established {
2738eca0ae4aSLuiz Augusto von Dentz 	__u8      status;
2739eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
2740eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
2741eca0ae4aSLuiz Augusto von Dentz 	__u8      bdaddr_type;
2742eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2743eca0ae4aSLuiz Augusto von Dentz 	__u8      phy;
2744eca0ae4aSLuiz Augusto von Dentz 	__le16    interval;
2745eca0ae4aSLuiz Augusto von Dentz 	__u8      clock_accuracy;
2746eca0ae4aSLuiz Augusto von Dentz } __packed;
2747eca0ae4aSLuiz Augusto von Dentz 
27484d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE    0x0a
27494d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
27504d94f95dSJaganath Kanakkassery 	__u8      status;
27514d94f95dSJaganath Kanakkassery 	__le16    handle;
27524d94f95dSJaganath Kanakkassery 	__u8      role;
27534d94f95dSJaganath Kanakkassery 	__u8      bdaddr_type;
27544d94f95dSJaganath Kanakkassery 	bdaddr_t  bdaddr;
27554d94f95dSJaganath Kanakkassery 	bdaddr_t  local_rpa;
27564d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_rpa;
27574d94f95dSJaganath Kanakkassery 	__le16    interval;
27584d94f95dSJaganath Kanakkassery 	__le16    latency;
27594d94f95dSJaganath Kanakkassery 	__le16    supervision_timeout;
27604d94f95dSJaganath Kanakkassery 	__u8      clk_accurancy;
27614d94f95dSJaganath Kanakkassery } __packed;
27624d94f95dSJaganath Kanakkassery 
2763acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM	0x12
2764acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2765acf0aeaeSJaganath Kanakkassery 	__u8	status;
2766acf0aeaeSJaganath Kanakkassery 	__u8	handle;
2767acf0aeaeSJaganath Kanakkassery 	__le16	conn_handle;
2768acf0aeaeSJaganath Kanakkassery 	__u8	num_evts;
2769acf0aeaeSJaganath Kanakkassery } __packed;
2770acf0aeaeSJaganath Kanakkassery 
27714de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED	0x19
27724de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established {
27734de0fc59SLuiz Augusto von Dentz 	__u8  status;
27744de0fc59SLuiz Augusto von Dentz 	__le16 handle;
27754de0fc59SLuiz Augusto von Dentz 	__u8  cig_sync_delay[3];
27764de0fc59SLuiz Augusto von Dentz 	__u8  cis_sync_delay[3];
277776c185a5SArchie Pusaka 	__u8  c_latency[3];
277876c185a5SArchie Pusaka 	__u8  p_latency[3];
277976c185a5SArchie Pusaka 	__u8  c_phy;
278076c185a5SArchie Pusaka 	__u8  p_phy;
27814de0fc59SLuiz Augusto von Dentz 	__u8  nse;
278276c185a5SArchie Pusaka 	__u8  c_bn;
278376c185a5SArchie Pusaka 	__u8  p_bn;
278476c185a5SArchie Pusaka 	__u8  c_ft;
278576c185a5SArchie Pusaka 	__u8  p_ft;
278676c185a5SArchie Pusaka 	__le16 c_mtu;
278776c185a5SArchie Pusaka 	__le16 p_mtu;
27884de0fc59SLuiz Augusto von Dentz 	__le16 interval;
27894de0fc59SLuiz Augusto von Dentz } __packed;
27904de0fc59SLuiz Augusto von Dentz 
27914de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ		0x1a
27924de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req {
27934de0fc59SLuiz Augusto von Dentz 	__le16 acl_handle;
27944de0fc59SLuiz Augusto von Dentz 	__le16 cis_handle;
27954de0fc59SLuiz Augusto von Dentz 	__u8  cig_id;
27964de0fc59SLuiz Augusto von Dentz 	__u8  cis_id;
27974de0fc59SLuiz Augusto von Dentz } __packed;
27984de0fc59SLuiz Augusto von Dentz 
2799eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_CREATE_BIG_COMPLETE	0x1b
2800eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_create_big_complete {
2801eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2802eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2803eca0ae4aSLuiz Augusto von Dentz 	__u8    sync_delay[3];
2804eca0ae4aSLuiz Augusto von Dentz 	__u8    transport_delay[3];
2805eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2806eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2807eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2808eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2809eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2810eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2811eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2812eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2813eca0ae4aSLuiz Augusto von Dentz 	__le16  bis_handle[];
2814eca0ae4aSLuiz Augusto von Dentz } __packed;
2815eca0ae4aSLuiz Augusto von Dentz 
2816eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_SYNC_ESTABILISHED 0x1d
2817eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_sync_estabilished {
2818eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2819eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2820eca0ae4aSLuiz Augusto von Dentz 	__u8    latency[3];
2821eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2822eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2823eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2824eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2825eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2826eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2827eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2828eca0ae4aSLuiz Augusto von Dentz 	__le16  bis[];
2829eca0ae4aSLuiz Augusto von Dentz } __packed;
2830eca0ae4aSLuiz Augusto von Dentz 
2831eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_INFO_ADV_REPORT	0x22
2832eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_info_adv_report {
2833eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2834eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2835eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2836eca0ae4aSLuiz Augusto von Dentz 	__le16  iso_interval;
2837eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2838eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2839eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2840eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2841eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2842eca0ae4aSLuiz Augusto von Dentz 	__le16  max_sdu;
2843eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2844eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2845eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2846eca0ae4aSLuiz Augusto von Dentz } __packed;
2847eca0ae4aSLuiz Augusto von Dentz 
2848e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR			0xff
2849e4cc5a18SMarcel Holtmann 
28501da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2851a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
28521da177e4SLinus Torvalds struct hci_ev_stack_internal {
28531da177e4SLinus Torvalds 	__u16    type;
2854a7e45454SGustavo A. R. Silva 	__u8     data[];
285566c853ccSGustavo F. Padovan } __packed;
28561da177e4SLinus Torvalds 
28571da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
28581da177e4SLinus Torvalds struct hci_ev_si_device {
28591da177e4SLinus Torvalds 	__u16    event;
28601da177e4SLinus Torvalds 	__u16    dev_id;
286166c853ccSGustavo F. Padovan } __packed;
28621da177e4SLinus Torvalds 
28631da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
28641da177e4SLinus Torvalds struct hci_ev_si_security {
28651da177e4SLinus Torvalds 	__u16    event;
28661da177e4SLinus Torvalds 	__u16    proto;
28671da177e4SLinus Torvalds 	__u16    subproto;
28681da177e4SLinus Torvalds 	__u8     incoming;
286966c853ccSGustavo F. Padovan } __packed;
28701da177e4SLinus Torvalds 
28711da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
28721da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
28731da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
28741da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
28751da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
28764de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE     4
28771da177e4SLinus Torvalds 
28781da177e4SLinus Torvalds struct hci_command_hdr {
28791ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
28801da177e4SLinus Torvalds 	__u8	plen;
288166c853ccSGustavo F. Padovan } __packed;
28821da177e4SLinus Torvalds 
28831da177e4SLinus Torvalds struct hci_event_hdr {
28841da177e4SLinus Torvalds 	__u8	evt;
28851da177e4SLinus Torvalds 	__u8	plen;
288666c853ccSGustavo F. Padovan } __packed;
28871da177e4SLinus Torvalds 
28881da177e4SLinus Torvalds struct hci_acl_hdr {
28891ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
28901ebb9252SMarcel Holtmann 	__le16	dlen;
289166c853ccSGustavo F. Padovan } __packed;
28921da177e4SLinus Torvalds 
28931da177e4SLinus Torvalds struct hci_sco_hdr {
28941ebb9252SMarcel Holtmann 	__le16	handle;
28951da177e4SLinus Torvalds 	__u8	dlen;
289666c853ccSGustavo F. Padovan } __packed;
28971da177e4SLinus Torvalds 
28984de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr {
28994de0fc59SLuiz Augusto von Dentz 	__le16	handle;
29004de0fc59SLuiz Augusto von Dentz 	__le16	dlen;
2901a7e45454SGustavo A. R. Silva 	__u8	data[];
29024de0fc59SLuiz Augusto von Dentz } __packed;
29034de0fc59SLuiz Augusto von Dentz 
29044de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */
29054de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID	0x00
29064de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID	0x01
29074de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP	0x02
29084de0fc59SLuiz Augusto von Dentz 
29094de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE	4
29104de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr {
29114de0fc59SLuiz Augusto von Dentz 	__le16	sn;
29124de0fc59SLuiz Augusto von Dentz 	__le16	slen;
29134de0fc59SLuiz Augusto von Dentz };
29144de0fc59SLuiz Augusto von Dentz 
29154de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8
29164de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr {
29174de0fc59SLuiz Augusto von Dentz 	__le32	ts;
29184de0fc59SLuiz Augusto von Dentz 	__le16	sn;
29194de0fc59SLuiz Augusto von Dentz 	__le16	slen;
29204de0fc59SLuiz Augusto von Dentz };
29214de0fc59SLuiz Augusto von Dentz 
29222a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
29232a123b86SArnaldo Carvalho de Melo {
29242a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
29252a123b86SArnaldo Carvalho de Melo }
29262a123b86SArnaldo Carvalho de Melo 
29272a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
29282a123b86SArnaldo Carvalho de Melo {
29292a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
29302a123b86SArnaldo Carvalho de Melo }
29312a123b86SArnaldo Carvalho de Melo 
29322a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
29332a123b86SArnaldo Carvalho de Melo {
29342a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
29352a123b86SArnaldo Carvalho de Melo }
29362a123b86SArnaldo Carvalho de Melo 
29371da177e4SLinus Torvalds /* Command opcode pack/unpack */
2938c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
29391da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
29401da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
29411da177e4SLinus Torvalds 
29421da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2943c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
29441da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
29451da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
29461da177e4SLinus Torvalds 
29474de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */
29484de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f)		(f & 0x0003)
29494de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f)		((f >> 2) & 0x0001)
29504de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts)	((pb & 0x03) | ((ts & 0x01) << 2))
29514de0fc59SLuiz Augusto von Dentz 
29524de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */
29534de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f)	((__u16) ((h) | ((f) << 14)))
29544de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h)		((h) & 0x3fff)
29554de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h)		((h) >> 14)
29564de0fc59SLuiz Augusto von Dentz 
2957248733e8SKiran K /* codec transport types */
2958248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO	0x01
2959248733e8SKiran K 
29605cbd3ebdSAlain Michaud /* le24 support */
29615cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3])
29625cbd3ebdSAlain Michaud {
29635cbd3ebdSAlain Michaud 	dst[0] = val & 0xff;
29645cbd3ebdSAlain Michaud 	dst[1] = (val & 0xff00) >> 8;
29655cbd3ebdSAlain Michaud 	dst[2] = (val & 0xff0000) >> 16;
29665cbd3ebdSAlain Michaud }
29675cbd3ebdSAlain Michaud 
29681da177e4SLinus Torvalds #endif /* __HCI_H */
2969