xref: /openbmc/linux/include/net/bluetooth/hci.h (revision 9e14606d8f38ea52a38c27692a9c1513c987a5da)
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,
312*9e14606dSHilda Wu 
313*9e14606dSHilda Wu 	/* When this quirk is set, MSFT extension monitor tracking by
314*9e14606dSHilda Wu 	 * address filter is supported. Since tracking quantity of each
315*9e14606dSHilda Wu 	 * pattern is limited, this feature supports tracking multiple
316*9e14606dSHilda Wu 	 * devices concurrently if controller supports multiple
317*9e14606dSHilda Wu 	 * address filters.
318*9e14606dSHilda Wu 	 *
319*9e14606dSHilda Wu 	 * This quirk must be set before hci_register_dev is called.
320*9e14606dSHilda Wu 	 */
321*9e14606dSHilda Wu 	HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
3221da177e4SLinus Torvalds };
3231da177e4SLinus Torvalds 
3241da177e4SLinus Torvalds /* HCI device flags */
3251da177e4SLinus Torvalds enum {
3261da177e4SLinus Torvalds 	HCI_UP,
3271da177e4SLinus Torvalds 	HCI_INIT,
3281da177e4SLinus Torvalds 	HCI_RUNNING,
3291da177e4SLinus Torvalds 
3301da177e4SLinus Torvalds 	HCI_PSCAN,
3311da177e4SLinus Torvalds 	HCI_ISCAN,
3321da177e4SLinus Torvalds 	HCI_AUTH,
3331da177e4SLinus Torvalds 	HCI_ENCRYPT,
3341da177e4SLinus Torvalds 	HCI_INQUIRY,
3351da177e4SLinus Torvalds 
3361da177e4SLinus Torvalds 	HCI_RAW,
337ab81cbf9SJohan Hedberg 
33810572132SGustavo F. Padovan 	HCI_RESET,
3391da177e4SLinus Torvalds };
3401da177e4SLinus Torvalds 
341f9207338SMarcel Holtmann /* HCI socket flags */
342f9207338SMarcel Holtmann enum {
34350ebc055SMarcel Holtmann 	HCI_SOCK_TRUSTED,
344f9207338SMarcel Holtmann 	HCI_MGMT_INDEX_EVENTS,
345f9207338SMarcel Holtmann 	HCI_MGMT_UNCONF_INDEX_EVENTS,
346ced85549SMarcel Holtmann 	HCI_MGMT_EXT_INDEX_EVENTS,
347321c6feeSMarcel Holtmann 	HCI_MGMT_EXT_INFO_EVENTS,
3485504c3a3SMarcel Holtmann 	HCI_MGMT_OPTION_EVENTS,
3495504c3a3SMarcel Holtmann 	HCI_MGMT_SETTING_EVENTS,
3505504c3a3SMarcel Holtmann 	HCI_MGMT_DEV_CLASS_EVENTS,
3515504c3a3SMarcel Holtmann 	HCI_MGMT_LOCAL_NAME_EVENTS,
35272000df2SMarcel Holtmann 	HCI_MGMT_OOB_DATA_EVENTS,
353a10c907cSMarcel Holtmann 	HCI_MGMT_EXP_FEATURE_EVENTS,
354f9207338SMarcel Holtmann };
355f9207338SMarcel Holtmann 
356d23264a8SAndre Guedes /*
357d23264a8SAndre Guedes  * BR/EDR and/or LE controller flags: the flags defined here should represent
358d23264a8SAndre Guedes  * states from the controller.
359d23264a8SAndre Guedes  */
360d23264a8SAndre Guedes enum {
361a8b2d5c2SJohan Hedberg 	HCI_SETUP,
362d603b76bSMarcel Holtmann 	HCI_CONFIG,
363fe2ccc6cSJohan Hovold 	HCI_DEBUGFS_CREATED,
364a8b2d5c2SJohan Hedberg 	HCI_AUTO_OFF,
3655e130367SJohan Hedberg 	HCI_RFKILLED,
366a8b2d5c2SJohan Hedberg 	HCI_MGMT,
367b6ae8457SJohan Hedberg 	HCI_BONDABLE,
368a8b2d5c2SJohan Hedberg 	HCI_SERVICE_CACHE,
3690663b297SJohan Hedberg 	HCI_KEEP_DEBUG_KEYS,
3703769972bSJohan Hedberg 	HCI_USE_DEBUG_KEYS,
37194324962SJohan Hovold 	HCI_UNREGISTER,
3724a964404SMarcel Holtmann 	HCI_UNCONFIGURED,
3730736cfa8SMarcel Holtmann 	HCI_USER_CHANNEL,
374dbece37aSMarcel Holtmann 	HCI_EXT_CONFIGURED,
37566c417c1SJohan Hedberg 	HCI_LE_ADV,
376eca0ae4aSLuiz Augusto von Dentz 	HCI_LE_PER_ADV,
377d23264a8SAndre Guedes 	HCI_LE_SCAN,
37884bde9d6SJohan Hedberg 	HCI_SSP_ENABLED,
379e98d2ce2SMarcel Holtmann 	HCI_SC_ENABLED,
380134c2a89SMarcel Holtmann 	HCI_SC_ONLY,
381863efaf2SJohan Hedberg 	HCI_PRIVACY,
38282a37adeSJohan Hedberg 	HCI_LIMITED_PRIVACY,
383d6bfd59cSJohan Hedberg 	HCI_RPA_EXPIRED,
38441edf160SJohan Hedberg 	HCI_RPA_RESOLVING,
3856d80dfd0SJohan Hedberg 	HCI_HS_ENABLED,
38606199cf8SJohan Hedberg 	HCI_LE_ENABLED,
387f3d3444aSJohan Hedberg 	HCI_ADVERTISING,
388cc91cb04SMarcel Holtmann 	HCI_ADVERTISING_CONNECTABLE,
3895e5282bbSJohan Hedberg 	HCI_CONNECTABLE,
3905e5282bbSJohan Hedberg 	HCI_DISCOVERABLE,
3916acd7db4SMarcel Holtmann 	HCI_LIMITED_DISCOVERABLE,
39247990ea0SJohan Hedberg 	HCI_LINK_SECURITY,
39321693c15SAndre Guedes 	HCI_PERIODIC_INQ,
3941a4d3c4bSJohan Hedberg 	HCI_FAST_CONNECTABLE,
39556f87901SJohan Hedberg 	HCI_BREDR_ENABLED,
39681ad6fd9SJohan Hedberg 	HCI_LE_SCAN_INTERRUPTED,
39700bce3fbSAlain Michaud 	HCI_WIDEBAND_SPEECH_ENABLED,
398e5b0ad69SAbhishek Pandit-Subedi 	HCI_EVENT_FILTER_CONFIGURED,
399eca0ae4aSLuiz Augusto von Dentz 	HCI_PA_SYNC,
400b7cb93e5SMarcel Holtmann 
401b7cb93e5SMarcel Holtmann 	HCI_DUT_MODE,
4024b4113d6SMarcel Holtmann 	HCI_VENDOR_DIAG,
403b7cb93e5SMarcel Holtmann 	HCI_FORCE_BREDR_SMP,
404b7cb93e5SMarcel Holtmann 	HCI_FORCE_STATIC_ADDR,
405aa12af77SAnkit Navik 	HCI_LL_RPA_RESOLUTION,
406cbbdfa6fSSathish Narasimman 	HCI_ENABLE_LL_PRIVACY,
407f80c5dadSJoão Paulo Rechi Vita 	HCI_CMD_PENDING,
408c2aa30dbSArchie Pusaka 	HCI_FORCE_NO_MITM,
409ae7d925bSJoseph Hwang 	HCI_QUALITY_REPORT,
410248733e8SKiran K 	HCI_OFFLOAD_CODECS_ENABLED,
41176d0685bSLuiz Augusto von Dentz 	HCI_LE_SIMULTANEOUS_ROLES,
412877afadaSSchspa Shi 	HCI_CMD_DRAIN_WORKQUEUE,
413b7cb93e5SMarcel Holtmann 
414af6bcc19SBrian Gix 	HCI_MESH_EXPERIMENTAL,
415b338d917SBrian Gix 	HCI_MESH,
416b338d917SBrian Gix 	HCI_MESH_SENDING,
417b338d917SBrian Gix 
418eacb44dfSMarcel Holtmann 	__HCI_NUM_FLAGS,
419d23264a8SAndre Guedes };
420d23264a8SAndre Guedes 
4211da177e4SLinus Torvalds /* HCI timeouts */
4225f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
4235f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
4245f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
425d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
426de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
4275f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
4289345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
429a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT	msecs_to_jiffies(5000)	/* 5 seconds */
4309489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT	msecs_to_jiffies(20000)	/* 20 seconds */
4311f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT	msecs_to_jiffies(4000)	/* 4 seconds */
4321da177e4SLinus Torvalds 
4335b7f9909SMarcel Holtmann /* HCI data types */
4341da177e4SLinus Torvalds #define HCI_COMMAND_PKT		0x01
4351da177e4SLinus Torvalds #define HCI_ACLDATA_PKT		0x02
4361da177e4SLinus Torvalds #define HCI_SCODATA_PKT		0x03
4371da177e4SLinus Torvalds #define HCI_EVENT_PKT		0x04
4384de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT		0x05
439e875ff84SMarcel Holtmann #define HCI_DIAG_PKT		0xf0
4401da177e4SLinus Torvalds #define HCI_VENDOR_PKT		0xff
4411da177e4SLinus Torvalds 
4425b7f9909SMarcel Holtmann /* HCI packet types */
4431da177e4SLinus Torvalds #define HCI_DM1		0x0008
4441da177e4SLinus Torvalds #define HCI_DM3		0x0400
4451da177e4SLinus Torvalds #define HCI_DM5		0x4000
4461da177e4SLinus Torvalds #define HCI_DH1		0x0010
4471da177e4SLinus Torvalds #define HCI_DH3		0x0800
4481da177e4SLinus Torvalds #define HCI_DH5		0x8000
4491da177e4SLinus Torvalds 
4505075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
4515075b972SJaganath Kanakkassery #define HCI_2DH1	0x0002
4525075b972SJaganath Kanakkassery #define HCI_3DH1	0x0004
4535075b972SJaganath Kanakkassery #define HCI_2DH3	0x0100
4545075b972SJaganath Kanakkassery #define HCI_3DH3	0x0200
4555075b972SJaganath Kanakkassery #define HCI_2DH5	0x1000
4565075b972SJaganath Kanakkassery #define HCI_3DH5	0x2000
4575075b972SJaganath Kanakkassery 
4581da177e4SLinus Torvalds #define HCI_HV1		0x0020
4591da177e4SLinus Torvalds #define HCI_HV2		0x0040
4601da177e4SLinus Torvalds #define HCI_HV3		0x0080
4611da177e4SLinus Torvalds 
4621da177e4SLinus Torvalds #define SCO_PTYPE_MASK	(HCI_HV1 | HCI_HV2 | HCI_HV3)
4631da177e4SLinus Torvalds #define ACL_PTYPE_MASK	(~SCO_PTYPE_MASK)
4641da177e4SLinus Torvalds 
4655b7f9909SMarcel Holtmann /* eSCO packet types */
4665b7f9909SMarcel Holtmann #define ESCO_HV1	0x0001
4675b7f9909SMarcel Holtmann #define ESCO_HV2	0x0002
4685b7f9909SMarcel Holtmann #define ESCO_HV3	0x0004
4695b7f9909SMarcel Holtmann #define ESCO_EV3	0x0008
4705b7f9909SMarcel Holtmann #define ESCO_EV4	0x0010
4715b7f9909SMarcel Holtmann #define ESCO_EV5	0x0020
472efc7688bSMarcel Holtmann #define ESCO_2EV3	0x0040
473efc7688bSMarcel Holtmann #define ESCO_3EV3	0x0080
474efc7688bSMarcel Holtmann #define ESCO_2EV5	0x0100
475efc7688bSMarcel Holtmann #define ESCO_3EV5	0x0200
4765b7f9909SMarcel Holtmann 
477a8746417SMarcel Holtmann #define SCO_ESCO_MASK  (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
478efc7688bSMarcel Holtmann #define EDR_ESCO_MASK  (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
479a8746417SMarcel Holtmann 
4801da177e4SLinus Torvalds /* ACL flags */
481e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH	0x00
4821da177e4SLinus Torvalds #define ACL_CONT		0x01
4831da177e4SLinus Torvalds #define ACL_START		0x02
484d73a0988SAndrei Emeltchenko #define ACL_COMPLETE		0x03
4851da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST	0x04
4861da177e4SLinus Torvalds #define ACL_PICO_BCAST		0x08
4871da177e4SLinus Torvalds 
4884de0fc59SLuiz Augusto von Dentz /* ISO PB flags */
4894de0fc59SLuiz Augusto von Dentz #define ISO_START		0x00
4904de0fc59SLuiz Augusto von Dentz #define ISO_CONT		0x01
4914de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE		0x02
4924de0fc59SLuiz Augusto von Dentz #define ISO_END			0x03
4934de0fc59SLuiz Augusto von Dentz 
4944de0fc59SLuiz Augusto von Dentz /* ISO TS flags */
4954de0fc59SLuiz Augusto von Dentz #define ISO_TS			0x01
4964de0fc59SLuiz Augusto von Dentz 
4971da177e4SLinus Torvalds /* Baseband links */
4981da177e4SLinus Torvalds #define SCO_LINK	0x00
4991da177e4SLinus Torvalds #define ACL_LINK	0x01
5005b7f9909SMarcel Holtmann #define ESCO_LINK	0x02
501fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
502fcd89c09SVille Tervo #define LE_LINK		0x80
5033161ae1cSAndrei Emeltchenko #define AMP_LINK	0x81
5044de0fc59SLuiz Augusto von Dentz #define ISO_LINK	0x82
505845472e8SMarcel Holtmann #define INVALID_LINK	0xff
5061da177e4SLinus Torvalds 
5071da177e4SLinus Torvalds /* LMP features */
5081da177e4SLinus Torvalds #define LMP_3SLOT	0x01
5091da177e4SLinus Torvalds #define LMP_5SLOT	0x02
5101da177e4SLinus Torvalds #define LMP_ENCRYPT	0x04
5111da177e4SLinus Torvalds #define LMP_SOFFSET	0x08
5121da177e4SLinus Torvalds #define LMP_TACCURACY	0x10
5131da177e4SLinus Torvalds #define LMP_RSWITCH	0x20
5141da177e4SLinus Torvalds #define LMP_HOLD	0x40
51504837f64SMarcel Holtmann #define LMP_SNIFF	0x80
5161da177e4SLinus Torvalds 
5171da177e4SLinus Torvalds #define LMP_PARK	0x01
5181da177e4SLinus Torvalds #define LMP_RSSI	0x02
5191da177e4SLinus Torvalds #define LMP_QUALITY	0x04
5201da177e4SLinus Torvalds #define LMP_SCO		0x08
5211da177e4SLinus Torvalds #define LMP_HV2		0x10
5221da177e4SLinus Torvalds #define LMP_HV3		0x20
5231da177e4SLinus Torvalds #define LMP_ULAW	0x40
5241da177e4SLinus Torvalds #define LMP_ALAW	0x80
5251da177e4SLinus Torvalds 
5261da177e4SLinus Torvalds #define LMP_CVSD	0x01
5271da177e4SLinus Torvalds #define LMP_PSCHEME	0x02
5281da177e4SLinus Torvalds #define LMP_PCONTROL	0x04
52907a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT	0x08
5301da177e4SLinus Torvalds 
5315075b972SJaganath Kanakkassery #define LMP_EDR_2M		0x02
5325075b972SJaganath Kanakkassery #define LMP_EDR_3M		0x04
533d5859e22SJohan Hedberg #define LMP_RSSI_INQ	0x40
5345b7f9909SMarcel Holtmann #define LMP_ESCO	0x80
5355b7f9909SMarcel Holtmann 
5365b7f9909SMarcel Holtmann #define LMP_EV4		0x01
5375b7f9909SMarcel Holtmann #define LMP_EV5		0x02
53869ab39eaSJohan Hedberg #define LMP_NO_BREDR	0x20
539d5859e22SJohan Hedberg #define LMP_LE		0x40
5405075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT	0x80
5415b7f9909SMarcel Holtmann 
5425075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT	0x01
54304837f64SMarcel Holtmann #define LMP_SNIFF_SUBR	0x02
544d5859e22SJohan Hedberg #define LMP_PAUSE_ENC	0x04
545efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M	0x20
546efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M	0x40
547efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO	0x80
54804837f64SMarcel Holtmann 
549d5859e22SJohan Hedberg #define LMP_EXT_INQ	0x01
550e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR	0x02
551769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR	0x08
552766ae242SZijun Hu #define LMP_ERR_DATA_REPORTING 0x20
553e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH	0x40
554769be974SMarcel Holtmann 
555d5859e22SJohan Hedberg #define LMP_LSTO	0x01
556d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR	0x02
557971e3a4bSAndre Guedes #define LMP_EXTFEATURES	0x80
558d5859e22SJohan Hedberg 
559eead27daSAndre Guedes /* Extended LMP features */
5606397729bSArchie Pusaka #define LMP_CPB_CENTRAL		0x01
5616397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL	0x02
56253b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN		0x04
56353b834d2SMarcel Holtmann #define LMP_SYNC_SCAN		0x08
56453b834d2SMarcel Holtmann 
565d5991585SMarcel Holtmann #define LMP_SC		0x01
566d5991585SMarcel Holtmann #define LMP_PING	0x02
567d5991585SMarcel Holtmann 
56853b834d2SMarcel Holtmann /* Host features */
569cc2c04ecSJohan Hedberg #define LMP_HOST_SSP		0x01
570eead27daSAndre Guedes #define LMP_HOST_LE		0x02
571cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR	0x04
572d5991585SMarcel Holtmann #define LMP_HOST_SC		0x08
573eead27daSAndre Guedes 
574662bc2e6SAndre Guedes /* LE features */
5750da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION		0x01
576662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC	0x02
577ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES	0x08
578cd7ca0ecSMarcel Holtmann #define HCI_LE_PING			0x10
57994a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT		0x20
580ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY		0x40
5814b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY		0x80
5825075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M			0x01
5835075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED		0x08
58455beec10SMarcel Holtmann #define HCI_LE_EXT_ADV			0x10
585eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_PERIODIC_ADV		0x20
5869756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2		0x40
587ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL		0x10
588ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL		0x20
589eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_ISO_BROADCASTER		0x40
590ae753361SClaudia Draghicescu #define HCI_LE_ISO_SYNC_RECEIVER	0x80
591662bc2e6SAndre Guedes 
59204837f64SMarcel Holtmann /* Connection modes */
59304837f64SMarcel Holtmann #define HCI_CM_ACTIVE	0x0000
59404837f64SMarcel Holtmann #define HCI_CM_HOLD	0x0001
59504837f64SMarcel Holtmann #define HCI_CM_SNIFF	0x0002
59604837f64SMarcel Holtmann #define HCI_CM_PARK	0x0003
59704837f64SMarcel Holtmann 
5981da177e4SLinus Torvalds /* Link policies */
5991da177e4SLinus Torvalds #define HCI_LP_RSWITCH	0x0001
6001da177e4SLinus Torvalds #define HCI_LP_HOLD	0x0002
6011da177e4SLinus Torvalds #define HCI_LP_SNIFF	0x0004
6021da177e4SLinus Torvalds #define HCI_LP_PARK	0x0008
6031da177e4SLinus Torvalds 
60404837f64SMarcel Holtmann /* Link modes */
6051da177e4SLinus Torvalds #define HCI_LM_ACCEPT	0x8000
6061da177e4SLinus Torvalds #define HCI_LM_MASTER	0x0001
6071da177e4SLinus Torvalds #define HCI_LM_AUTH	0x0002
6081da177e4SLinus Torvalds #define HCI_LM_ENCRYPT	0x0004
6091da177e4SLinus Torvalds #define HCI_LM_TRUSTED	0x0008
6101da177e4SLinus Torvalds #define HCI_LM_RELIABLE	0x0010
6111da177e4SLinus Torvalds #define HCI_LM_SECURE	0x0020
6127b5a9241SMarcel Holtmann #define HCI_LM_FIPS	0x0040
6131da177e4SLinus Torvalds 
61440be492fSMarcel Holtmann /* Authentication types */
61540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING		0x00
61640be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM		0x01
61740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING	0x02
61840be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM	0x03
61940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING		0x04
62040be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM	0x05
62140be492fSMarcel Holtmann 
622a77b15a6SMikel Astiz /* I/O capabilities */
623a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY	0x00
624a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO	0x01
625a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY	0x02
626a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT	0x03
627a77b15a6SMikel Astiz 
628b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
629b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION		0x00
630b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT		0x01
631b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT		0x02
632b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION	0x03
63311015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192	0x04
63411015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192	0x05
635b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION	0x06
63611015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256	0x07
63711015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256	0x08
638b6020ba0SWaldemar Rymarkiewicz 
6399f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
6408e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID	0x02
6419f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE		0x05
642160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING	0x06
6432acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED	0x07
644cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT	0x08
645d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES	0x0d
6469f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR		0x0f
647c86cc5a3SLuiz Augusto von Dentz #define HCI_ERROR_INVALID_PARAMETERS	0x12
6489f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM	0x13
649cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES	0x14
650cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF	0x15
6519f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM	0x16
6529f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED	0x18
6534ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS	0x1e
6544ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED		0x1f
6553c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT	0x3c
6560f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST	0x44
6579f5a0d7bSAndrei Emeltchenko 
6582455a3eaSAndrei Emeltchenko /* Flow control modes */
6592455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED	0x00
6602455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED	0x01
6612455a3eaSAndrei Emeltchenko 
662bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
663bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID	127
664a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID	127
665bbaf444aSJohan Hedberg 
666ba165a90SJohan Hedberg #define HCI_ROLE_MASTER		0x00
667ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE		0x01
668ba165a90SJohan Hedberg 
66932748db0SJohan Hedberg /* Extended Inquiry Response field types */
67032748db0SJohan Hedberg #define EIR_FLAGS		0x01 /* flags */
67132748db0SJohan Hedberg #define EIR_UUID16_SOME		0x02 /* 16-bit UUID, more available */
67232748db0SJohan Hedberg #define EIR_UUID16_ALL		0x03 /* 16-bit UUID, all listed */
67332748db0SJohan Hedberg #define EIR_UUID32_SOME		0x04 /* 32-bit UUID, more available */
67432748db0SJohan Hedberg #define EIR_UUID32_ALL		0x05 /* 32-bit UUID, all listed */
67532748db0SJohan Hedberg #define EIR_UUID128_SOME	0x06 /* 128-bit UUID, more available */
67632748db0SJohan Hedberg #define EIR_UUID128_ALL		0x07 /* 128-bit UUID, all listed */
67732748db0SJohan Hedberg #define EIR_NAME_SHORT		0x08 /* shortened local name */
67832748db0SJohan Hedberg #define EIR_NAME_COMPLETE	0x09 /* complete local name */
67932748db0SJohan Hedberg #define EIR_TX_POWER		0x0A /* transmit power level */
6809ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV	0x0D /* Class of Device */
681d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192	0x0E /* Simple Pairing Hash C-192 */
682d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192	0x0F /* Simple Pairing Randomizer R-192 */
68332748db0SJohan Hedberg #define EIR_DEVICE_ID		0x10 /* device ID */
6844453b006SArman Uguray #define EIR_APPEARANCE		0x19 /* Device appearance */
6858f9ae5b3SLuiz Augusto von Dentz #define EIR_SERVICE_DATA	0x16 /* Service Data */
6861471aae0SMarcel Holtmann #define EIR_LE_BDADDR		0x1B /* LE Bluetooth device address */
6871471aae0SMarcel Holtmann #define EIR_LE_ROLE		0x1C /* LE role */
688d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256	0x1D /* Simple Pairing Hash C-256 */
689d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256	0x1E /* Simple Pairing Rand R-256 */
690f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM	0x22 /* LE SC Confirmation Value */
691f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM	0x23 /* LE SC Random Value */
69232748db0SJohan Hedberg 
6933f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
6943f0f524bSJohan Hedberg #define LE_AD_LIMITED		0x01 /* Limited Discoverable */
6953f0f524bSJohan Hedberg #define LE_AD_GENERAL		0x02 /* General Discoverable */
6963f0f524bSJohan Hedberg #define LE_AD_NO_BREDR		0x04 /* BR/EDR not supported */
6973f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL	0x08 /* Simultaneous LE & BR/EDR Controller */
6983f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST	0x10 /* Simultaneous LE & BR/EDR Host */
6993f0f524bSJohan Hedberg 
7001da177e4SLinus Torvalds /* -----  HCI Commands ---- */
7016bd32326SVille Tervo #define HCI_OP_NOP			0x0000
7026bd32326SVille Tervo 
703a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY			0x0401
704a9de9248SMarcel Holtmann struct hci_cp_inquiry {
705a9de9248SMarcel Holtmann 	__u8     lap[3];
706a9de9248SMarcel Holtmann 	__u8     length;
707a9de9248SMarcel Holtmann 	__u8     num_rsp;
70866c853ccSGustavo F. Padovan } __packed;
7091da177e4SLinus Torvalds 
710a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL		0x0402
711a9de9248SMarcel Holtmann 
71279d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ		0x0403
71379d6e068SAndre Guedes 
714a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ	0x0404
715a9de9248SMarcel Holtmann 
716a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN		0x0405
717a9de9248SMarcel Holtmann struct hci_cp_create_conn {
718a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
719a9de9248SMarcel Holtmann 	__le16   pkt_type;
720a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
721a9de9248SMarcel Holtmann 	__u8     pscan_mode;
722a9de9248SMarcel Holtmann 	__le16   clock_offset;
723a9de9248SMarcel Holtmann 	__u8     role_switch;
72466c853ccSGustavo F. Padovan } __packed;
7251da177e4SLinus Torvalds 
726a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT		0x0406
727a9de9248SMarcel Holtmann struct hci_cp_disconnect {
728a9de9248SMarcel Holtmann 	__le16   handle;
729a9de9248SMarcel Holtmann 	__u8     reason;
73066c853ccSGustavo F. Padovan } __packed;
7311da177e4SLinus Torvalds 
732a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO			0x0407
733a9de9248SMarcel Holtmann struct hci_cp_add_sco {
734a9de9248SMarcel Holtmann 	__le16   handle;
735a9de9248SMarcel Holtmann 	__le16   pkt_type;
73666c853ccSGustavo F. Padovan } __packed;
737a9de9248SMarcel Holtmann 
738a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL	0x0408
739a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
7401da177e4SLinus Torvalds 	bdaddr_t bdaddr;
74166c853ccSGustavo F. Padovan } __packed;
7421da177e4SLinus Torvalds 
743a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ		0x0409
744a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
745a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
746a9de9248SMarcel Holtmann 	__u8     role;
74766c853ccSGustavo F. Padovan } __packed;
7481da177e4SLinus Torvalds 
749a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ		0x040a
750a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
751a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
752a9de9248SMarcel Holtmann 	__u8     reason;
75366c853ccSGustavo F. Padovan } __packed;
7541da177e4SLinus Torvalds 
755a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY		0x040b
756a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
757a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
7589b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
75966c853ccSGustavo F. Padovan } __packed;
7601da177e4SLinus Torvalds 
761a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY	0x040c
762a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
763a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
76466c853ccSGustavo F. Padovan } __packed;
7651da177e4SLinus Torvalds 
766a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY		0x040d
767a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
768a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
769a9de9248SMarcel Holtmann 	__u8     pin_len;
770a9de9248SMarcel Holtmann 	__u8     pin_code[16];
77166c853ccSGustavo F. Padovan } __packed;
772980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
773980e1a53SJohan Hedberg 	__u8     status;
774980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
775980e1a53SJohan Hedberg } __packed;
776a9de9248SMarcel Holtmann 
777a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY	0x040e
778a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
779a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
78066c853ccSGustavo F. Padovan } __packed;
781980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
782980e1a53SJohan Hedberg 	__u8     status;
783980e1a53SJohan Hedberg 	bdaddr_t bdaddr;
784980e1a53SJohan Hedberg } __packed;
785a9de9248SMarcel Holtmann 
786a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE	0x040f
787a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
788a9de9248SMarcel Holtmann 	__le16   handle;
789a9de9248SMarcel Holtmann 	__le16   pkt_type;
79066c853ccSGustavo F. Padovan } __packed;
791a9de9248SMarcel Holtmann 
792a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED		0x0411
793a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
794a9de9248SMarcel Holtmann 	__le16   handle;
79566c853ccSGustavo F. Padovan } __packed;
796a9de9248SMarcel Holtmann 
797a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT		0x0413
798a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
799a9de9248SMarcel Holtmann 	__le16   handle;
800a9de9248SMarcel Holtmann 	__u8     encrypt;
80166c853ccSGustavo F. Padovan } __packed;
802a9de9248SMarcel Holtmann 
803a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY	0x0415
804a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
805a9de9248SMarcel Holtmann 	__le16   handle;
80666c853ccSGustavo F. Padovan } __packed;
807a9de9248SMarcel Holtmann 
808a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ		0x0419
809a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
810a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
811a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
812a9de9248SMarcel Holtmann 	__u8     pscan_mode;
813a9de9248SMarcel Holtmann 	__le16   clock_offset;
81466c853ccSGustavo F. Padovan } __packed;
815a9de9248SMarcel Holtmann 
816a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL	0x041a
817a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
818a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
81966c853ccSGustavo F. Padovan } __packed;
820a9de9248SMarcel Holtmann 
821a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES	0x041b
822a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
823a9de9248SMarcel Holtmann 	__le16   handle;
82466c853ccSGustavo F. Padovan } __packed;
825a9de9248SMarcel Holtmann 
826a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES	0x041c
827a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
828a9de9248SMarcel Holtmann 	__le16   handle;
829a9de9248SMarcel Holtmann 	__u8     page;
83066c853ccSGustavo F. Padovan } __packed;
831a9de9248SMarcel Holtmann 
832a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION	0x041d
833a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
834a9de9248SMarcel Holtmann 	__le16   handle;
83566c853ccSGustavo F. Padovan } __packed;
836a9de9248SMarcel Holtmann 
837df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET	0x041f
838df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
839df935429SMarcel Holtmann 	__le16   handle;
840df935429SMarcel Holtmann } __packed;
841df935429SMarcel Holtmann 
842a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN		0x0428
843a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
844a9de9248SMarcel Holtmann 	__le16   handle;
845a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
846a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
847a9de9248SMarcel Holtmann 	__le16   max_latency;
848a9de9248SMarcel Holtmann 	__le16   voice_setting;
849a9de9248SMarcel Holtmann 	__u8     retrans_effort;
850a9de9248SMarcel Holtmann 	__le16   pkt_type;
85166c853ccSGustavo F. Padovan } __packed;
852a9de9248SMarcel Holtmann 
853a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ	0x0429
854a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
855a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
856a9de9248SMarcel Holtmann 	__le32   tx_bandwidth;
857a9de9248SMarcel Holtmann 	__le32   rx_bandwidth;
858a9de9248SMarcel Holtmann 	__le16   max_latency;
859a9de9248SMarcel Holtmann 	__le16   content_format;
860a9de9248SMarcel Holtmann 	__u8     retrans_effort;
861a9de9248SMarcel Holtmann 	__le16   pkt_type;
86266c853ccSGustavo F. Padovan } __packed;
863a9de9248SMarcel Holtmann 
864a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ	0x042a
865a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
866a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
867a9de9248SMarcel Holtmann 	__u8     reason;
86866c853ccSGustavo F. Padovan } __packed;
869a9de9248SMarcel Holtmann 
87017fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY	0x042b
87117fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
87217fa4b9dSJohan Hedberg 	bdaddr_t bdaddr;
87317fa4b9dSJohan Hedberg 	__u8     capability;
87417fa4b9dSJohan Hedberg 	__u8     oob_data;
87517fa4b9dSJohan Hedberg 	__u8     authentication;
87617fa4b9dSJohan Hedberg } __packed;
87717fa4b9dSJohan Hedberg 
878a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY		0x042c
879a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
880a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
881a5c29683SJohan Hedberg } __packed;
882a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
883a5c29683SJohan Hedberg 	__u8     status;
884a5c29683SJohan Hedberg 	bdaddr_t bdaddr;
885a5c29683SJohan Hedberg } __packed;
886a5c29683SJohan Hedberg 
887a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY	0x042d
888a5c29683SJohan Hedberg 
8899ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY		0x042e
8909ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
8919ad4019aSBrian Gix 	bdaddr_t bdaddr;
8929ad4019aSBrian Gix 	__le32	passkey;
8939ad4019aSBrian Gix } __packed;
8949ad4019aSBrian Gix 
8959ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY	0x042f
8969ad4019aSBrian Gix 
8972763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY	0x0430
8982763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
8992763eda6SSzymon Janc 	bdaddr_t bdaddr;
9002763eda6SSzymon Janc 	__u8     hash[16];
90138da1703SJohan Hedberg 	__u8     rand[16];
9022763eda6SSzymon Janc } __packed;
9032763eda6SSzymon Janc 
9042763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
9052763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
9062763eda6SSzymon Janc 	bdaddr_t bdaddr;
9072763eda6SSzymon Janc } __packed;
9082763eda6SSzymon Janc 
90903b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY	0x0434
91003b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
91103b555e1SJohan Hedberg 	bdaddr_t bdaddr;
91203b555e1SJohan Hedberg 	__u8     reason;
91303b555e1SJohan Hedberg } __packed;
91403b555e1SJohan Hedberg 
915523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK		0x0435
916523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link {
917523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
918523e93cdSAndrei Emeltchenko 	__u8     key_len;
919523e93cdSAndrei Emeltchenko 	__u8     key_type;
920523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
921523e93cdSAndrei Emeltchenko } __packed;
922523e93cdSAndrei Emeltchenko 
923523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK		0x0436
924523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link {
925523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
926523e93cdSAndrei Emeltchenko 	__u8     key_len;
927523e93cdSAndrei Emeltchenko 	__u8     key_type;
928523e93cdSAndrei Emeltchenko 	__u8     key[HCI_AMP_LINK_KEY_SIZE];
929523e93cdSAndrei Emeltchenko } __packed;
930523e93cdSAndrei Emeltchenko 
931523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK		0x0437
932523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link {
933523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
934523e93cdSAndrei Emeltchenko 	__u8     reason;
935b078b564SAndrei Emeltchenko } __packed;
936b078b564SAndrei Emeltchenko 
937b078b564SAndrei Emeltchenko struct ext_flow_spec {
938b078b564SAndrei Emeltchenko 	__u8       id;
939b078b564SAndrei Emeltchenko 	__u8       stype;
940b078b564SAndrei Emeltchenko 	__le16     msdu;
941b078b564SAndrei Emeltchenko 	__le32     sdu_itime;
942b078b564SAndrei Emeltchenko 	__le32     acc_lat;
943b078b564SAndrei Emeltchenko 	__le32     flush_to;
944b078b564SAndrei Emeltchenko } __packed;
945b078b564SAndrei Emeltchenko 
946b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK	0x0438
947b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK	0x0439
948b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link {
949b078b564SAndrei Emeltchenko 	__u8                  phy_handle;
950b078b564SAndrei Emeltchenko 	struct ext_flow_spec  tx_flow_spec;
951b078b564SAndrei Emeltchenko 	struct ext_flow_spec  rx_flow_spec;
952b078b564SAndrei Emeltchenko } __packed;
953b078b564SAndrei Emeltchenko 
954b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK	0x043a
955b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link {
956b078b564SAndrei Emeltchenko 	__le16   log_handle;
957b078b564SAndrei Emeltchenko } __packed;
958b078b564SAndrei Emeltchenko 
959b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL	0x043b
960b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel {
961b078b564SAndrei Emeltchenko 	__u8     phy_handle;
962b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
963b078b564SAndrei Emeltchenko } __packed;
964b078b564SAndrei Emeltchenko 
965b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN		0x043d
966b2af264aSKiran K struct hci_coding_format {
967b2af264aSKiran K 	__u8	id;
968b2af264aSKiran K 	__le16	cid;
969b2af264aSKiran K 	__le16	vid;
970b2af264aSKiran K } __packed;
971b2af264aSKiran K 
972b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn {
973b2af264aSKiran K 	__le16   handle;
974b2af264aSKiran K 	__le32   tx_bandwidth;
975b2af264aSKiran K 	__le32   rx_bandwidth;
976b2af264aSKiran K 	struct	 hci_coding_format tx_coding_format;
977b2af264aSKiran K 	struct	 hci_coding_format rx_coding_format;
978b2af264aSKiran K 	__le16	 tx_codec_frame_size;
979b2af264aSKiran K 	__le16	 rx_codec_frame_size;
980b2af264aSKiran K 	__le32	 in_bandwidth;
981b2af264aSKiran K 	__le32	 out_bandwidth;
982b2af264aSKiran K 	struct	 hci_coding_format in_coding_format;
983b2af264aSKiran K 	struct	 hci_coding_format out_coding_format;
984b2af264aSKiran K 	__le16   in_coded_data_size;
985b2af264aSKiran K 	__le16	 out_coded_data_size;
986b2af264aSKiran K 	__u8	 in_pcm_data_format;
987b2af264aSKiran K 	__u8	 out_pcm_data_format;
988b2af264aSKiran K 	__u8	 in_pcm_sample_payload_msb_pos;
989b2af264aSKiran K 	__u8	 out_pcm_sample_payload_msb_pos;
990b2af264aSKiran K 	__u8	 in_data_path;
991b2af264aSKiran K 	__u8	 out_data_path;
992b2af264aSKiran K 	__u8	 in_transport_unit_size;
993b2af264aSKiran K 	__u8	 out_transport_unit_size;
994b2af264aSKiran K 	__le16   max_latency;
995b2af264aSKiran K 	__le16   pkt_type;
996b2af264aSKiran K 	__u8     retrans_effort;
997b2af264aSKiran K } __packed;
998b2af264aSKiran K 
999b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
1000b078b564SAndrei Emeltchenko 	__u8     status;
1001b078b564SAndrei Emeltchenko 	__u8     phy_handle;
1002b078b564SAndrei Emeltchenko 	__u8     flow_spec_id;
1003523e93cdSAndrei Emeltchenko } __packed;
1004523e93cdSAndrei Emeltchenko 
10056397729bSArchie Pusaka #define HCI_OP_SET_CPB			0x0441
10066397729bSArchie Pusaka struct hci_cp_set_cpb {
10078c9a041bSDoHyun Pyun 	__u8	enable;
10088c9a041bSDoHyun Pyun 	__u8	lt_addr;
10098c9a041bSDoHyun Pyun 	__u8	lpo_allowed;
10108c9a041bSDoHyun Pyun 	__le16	packet_type;
10118c9a041bSDoHyun Pyun 	__le16	interval_min;
10128c9a041bSDoHyun Pyun 	__le16	interval_max;
10136397729bSArchie Pusaka 	__le16	cpb_sv_tout;
10148c9a041bSDoHyun Pyun } __packed;
10156397729bSArchie Pusaka struct hci_rp_set_cpb {
10168c9a041bSDoHyun Pyun 	__u8	status;
10178c9a041bSDoHyun Pyun 	__u8	lt_addr;
10188c9a041bSDoHyun Pyun 	__le16	interval;
10198c9a041bSDoHyun Pyun } __packed;
10208c9a041bSDoHyun Pyun 
1021cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN		0x0443
1022cefded98SDoHyun Pyun 
1023e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY	0x0445
1024e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
1025e2f99131SMarcel Holtmann 	bdaddr_t bdaddr;
1026e2f99131SMarcel Holtmann 	__u8     hash192[16];
102738da1703SJohan Hedberg 	__u8     rand192[16];
1028e2f99131SMarcel Holtmann 	__u8     hash256[16];
102938da1703SJohan Hedberg 	__u8     rand256[16];
1030e2f99131SMarcel Holtmann } __packed;
1031e2f99131SMarcel Holtmann 
1032a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE		0x0803
1033a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
1034a9de9248SMarcel Holtmann 	__le16   handle;
1035a9de9248SMarcel Holtmann 	__le16   max_interval;
1036a9de9248SMarcel Holtmann 	__le16   min_interval;
1037a9de9248SMarcel Holtmann 	__le16   attempt;
1038a9de9248SMarcel Holtmann 	__le16   timeout;
103966c853ccSGustavo F. Padovan } __packed;
1040a9de9248SMarcel Holtmann 
1041a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE		0x0804
1042a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
1043a9de9248SMarcel Holtmann 	__le16   handle;
104466c853ccSGustavo F. Padovan } __packed;
1045a9de9248SMarcel Holtmann 
1046a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY		0x0809
1047a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
1048a9de9248SMarcel Holtmann 	__le16   handle;
104966c853ccSGustavo F. Padovan } __packed;
1050a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
1051a9de9248SMarcel Holtmann 	__u8     status;
1052a9de9248SMarcel Holtmann 	__le16   handle;
1053a9de9248SMarcel Holtmann 	__u8     role;
105466c853ccSGustavo F. Padovan } __packed;
1055a9de9248SMarcel Holtmann 
1056a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE		0x080b
1057a9de9248SMarcel Holtmann struct hci_cp_switch_role {
1058a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
1059a9de9248SMarcel Holtmann 	__u8     role;
106066c853ccSGustavo F. Padovan } __packed;
1061a9de9248SMarcel Holtmann 
1062a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY		0x080c
1063a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
1064a9de9248SMarcel Holtmann 	__le16   handle;
106566c853ccSGustavo F. Padovan } __packed;
1066a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
1067a9de9248SMarcel Holtmann 	__u8     status;
1068a9de9248SMarcel Holtmann 	__le16   handle;
1069a9de9248SMarcel Holtmann 	__le16   policy;
107066c853ccSGustavo F. Padovan } __packed;
1071a9de9248SMarcel Holtmann 
1072a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY	0x080d
1073a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
1074a9de9248SMarcel Holtmann 	__le16   handle;
1075a9de9248SMarcel Holtmann 	__le16   policy;
107666c853ccSGustavo F. Padovan } __packed;
1077a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
1078a9de9248SMarcel Holtmann 	__u8     status;
1079a9de9248SMarcel Holtmann 	__le16   handle;
108066c853ccSGustavo F. Padovan } __packed;
1081a9de9248SMarcel Holtmann 
1082e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY	0x080e
1083e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
1084e4e8e37cSMarcel Holtmann 	__u8     status;
1085e4e8e37cSMarcel Holtmann 	__le16   policy;
108666c853ccSGustavo F. Padovan } __packed;
1087e4e8e37cSMarcel Holtmann 
1088e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY	0x080f
1089e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
1090e4e8e37cSMarcel Holtmann 	__le16   policy;
109166c853ccSGustavo F. Padovan } __packed;
1092e4e8e37cSMarcel Holtmann 
1093a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE		0x0811
1094a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
1095a9de9248SMarcel Holtmann 	__le16   handle;
1096a9de9248SMarcel Holtmann 	__le16   max_latency;
1097a9de9248SMarcel Holtmann 	__le16   min_remote_timeout;
1098a9de9248SMarcel Holtmann 	__le16   min_local_timeout;
109966c853ccSGustavo F. Padovan } __packed;
1100a9de9248SMarcel Holtmann 
1101a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK		0x0c01
1102a9de9248SMarcel Holtmann 
1103a9de9248SMarcel Holtmann #define HCI_OP_RESET			0x0c03
1104a9de9248SMarcel Holtmann 
1105a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT		0x0c05
11064f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE		9
11074f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter {
11081da177e4SLinus Torvalds 	__u8		flt_type;
11091da177e4SLinus Torvalds 	__u8		cond_type;
11104f40afc6SAbhishek Pandit-Subedi 	struct {
11114f40afc6SAbhishek Pandit-Subedi 		bdaddr_t bdaddr;
11124f40afc6SAbhishek Pandit-Subedi 		__u8 auto_accept;
11134f40afc6SAbhishek Pandit-Subedi 	} __packed	addr_conn_flt;
111466c853ccSGustavo F. Padovan } __packed;
11151da177e4SLinus Torvalds 
11161da177e4SLinus Torvalds /* Filter types */
11171da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL	0x00
11181da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT	0x01
11191da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP	0x02
11201da177e4SLinus Torvalds 
11211da177e4SLinus Torvalds /* CONN_SETUP Condition types */
11221da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL	0x00
11231da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS	0x01
11241da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR	0x02
11251da177e4SLinus Torvalds 
11261da177e4SLinus Torvalds /* CONN_SETUP Conditions */
11271da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF		0x01
11281da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON		0x02
11294f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS	0x03
11301da177e4SLinus Torvalds 
1131cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY	0x0c0d
1132cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
1133cb962780SMarcel Holtmann 	bdaddr_t bdaddr;
1134cb962780SMarcel Holtmann 	__u8     read_all;
1135cb962780SMarcel Holtmann } __packed;
1136cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
1137cb962780SMarcel Holtmann 	__u8     status;
1138e88422bcSLuiz Augusto von Dentz 	__le16   max_keys;
1139e88422bcSLuiz Augusto von Dentz 	__le16   num_keys;
1140cb962780SMarcel Holtmann } __packed;
1141cb962780SMarcel Holtmann 
1142b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY	0x0c12
1143b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
1144b0916ea0SJohan Hedberg 	bdaddr_t bdaddr;
1145b0916ea0SJohan Hedberg 	__u8     delete_all;
1146b0916ea0SJohan Hedberg } __packed;
1147039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
1148039d4e41SMarcel Holtmann 	__u8     status;
11497978656cSLuiz Augusto von Dentz 	__le16   num_keys;
1150039d4e41SMarcel Holtmann } __packed;
1151b0916ea0SJohan Hedberg 
11521f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH		248
11531f6c6378SJohan Hedberg 
1154a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME		0x0c13
1155a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
11561f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
115766c853ccSGustavo F. Padovan } __packed;
1158a9de9248SMarcel Holtmann 
1159a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME		0x0c14
1160a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
1161a9de9248SMarcel Holtmann 	__u8     status;
11621f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
116366c853ccSGustavo F. Padovan } __packed;
1164a9de9248SMarcel Holtmann 
1165a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT		0x0c16
1166a9de9248SMarcel Holtmann 
1167a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT		0x0c18
1168a9de9248SMarcel Holtmann 
1169a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE	0x0c1a
1170a9de9248SMarcel Holtmann 	#define SCAN_DISABLED		0x00
1171a9de9248SMarcel Holtmann 	#define SCAN_INQUIRY		0x01
1172a9de9248SMarcel Holtmann 	#define SCAN_PAGE		0x02
1173a9de9248SMarcel Holtmann 
1174a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE		0x0c1f
1175a9de9248SMarcel Holtmann 
1176a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE	0x0c20
1177a9de9248SMarcel Holtmann 	#define AUTH_DISABLED		0x00
1178a9de9248SMarcel Holtmann 	#define AUTH_ENABLED		0x01
1179a9de9248SMarcel Holtmann 
1180a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE	0x0c21
1181a9de9248SMarcel Holtmann 
1182a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE	0x0c22
1183a9de9248SMarcel Holtmann 	#define ENCRYPT_DISABLED	0x00
1184a9de9248SMarcel Holtmann 	#define ENCRYPT_P2P		0x01
1185a9de9248SMarcel Holtmann 	#define ENCRYPT_BOTH		0x02
1186a9de9248SMarcel Holtmann 
1187a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV	0x0c23
1188a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
11891da177e4SLinus Torvalds 	__u8     status;
11901da177e4SLinus Torvalds 	__u8     dev_class[3];
119166c853ccSGustavo F. Padovan } __packed;
11921da177e4SLinus Torvalds 
1193a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV	0x0c24
1194a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
11951da177e4SLinus Torvalds 	__u8     dev_class[3];
119666c853ccSGustavo F. Padovan } __packed;
11971da177e4SLinus Torvalds 
1198a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING	0x0c25
11991da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
12001da177e4SLinus Torvalds 	__u8     status;
12011ebb9252SMarcel Holtmann 	__le16   voice_setting;
120266c853ccSGustavo F. Padovan } __packed;
12031da177e4SLinus Torvalds 
1204a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING	0x0c26
12051da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
12061ebb9252SMarcel Holtmann 	__le16   voice_setting;
120766c853ccSGustavo F. Padovan } __packed;
12081da177e4SLinus Torvalds 
1209a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE		0x0c33
12101da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
12111ebb9252SMarcel Holtmann 	__le16   acl_mtu;
12121da177e4SLinus Torvalds 	__u8     sco_mtu;
12131ebb9252SMarcel Holtmann 	__le16   acl_max_pkt;
12141ebb9252SMarcel Holtmann 	__le16   sco_max_pkt;
121566c853ccSGustavo F. Padovan } __packed;
12161da177e4SLinus Torvalds 
1217b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC	0x0c38
1218b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1219b4cb9fb2SMarcel Holtmann 	__u8	status;
1220b4cb9fb2SMarcel Holtmann 	__u8	num_iac;
1221b4cb9fb2SMarcel Holtmann } __packed;
1222b4cb9fb2SMarcel Holtmann 
12234b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP	0x0c39
12244b836f39SMarcel Holtmann 
12253d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP	0x0c3a
12263d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
12273d505312SMarcel Holtmann 	__u8	num_iac;
12283d505312SMarcel Holtmann 	__u8	iac_lap[6];
12293d505312SMarcel Holtmann } __packed;
12303d505312SMarcel Holtmann 
1231d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE	0x0c45
1232d5859e22SJohan Hedberg 
123380a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH		240
123480a1e1dbSJohan Hedberg 
123580a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR		0x0c52
123680a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1237816a11d5SJohan Hedberg 	__u8	fec;
1238816a11d5SJohan Hedberg 	__u8	data[HCI_MAX_EIR_LENGTH];
123980a1e1dbSJohan Hedberg } __packed;
124080a1e1dbSJohan Hedberg 
1241333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE		0x0c55
1242333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1243333140b5SMarcel Holtmann 	__u8     status;
1244333140b5SMarcel Holtmann 	__u8     mode;
124566c853ccSGustavo F. Padovan } __packed;
1246333140b5SMarcel Holtmann 
1247333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE		0x0c56
1248333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1249333140b5SMarcel Holtmann 	__u8     mode;
125066c853ccSGustavo F. Padovan } __packed;
1251333140b5SMarcel Holtmann 
1252c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA		0x0c57
1253c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1254c35938b2SSzymon Janc 	__u8     status;
1255c35938b2SSzymon Janc 	__u8     hash[16];
125638da1703SJohan Hedberg 	__u8     rand[16];
1257c35938b2SSzymon Janc } __packed;
1258c35938b2SSzymon Janc 
1259d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
126091c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
126191c4e9b1SMarcel Holtmann 	__u8     status;
126291c4e9b1SMarcel Holtmann 	__s8     tx_power;
126391c4e9b1SMarcel Holtmann } __packed;
1264d5859e22SJohan Hedberg 
126500bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING	0x0c5a
126600bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_DISABLED	0x00
126700bce3fbSAlain Michaud 	#define ERR_DATA_REPORTING_ENABLED	0x01
126800bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting {
126900bce3fbSAlain Michaud 	__u8     status;
127000bce3fbSAlain Michaud 	__u8     err_data_reporting;
127100bce3fbSAlain Michaud } __packed;
127200bce3fbSAlain Michaud 
127300bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING	0x0c5b
127400bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting {
127500bce3fbSAlain Michaud 	__u8     err_data_reporting;
127600bce3fbSAlain Michaud } __packed;
127700bce3fbSAlain Michaud 
1278d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2	0x0c63
1279d62e6d67SJohan Hedberg 
12807528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA	0x0c64
12817528ca1cSMarcel Holtmann 
12821e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE	0x0c66
12831e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
12841e89cffbSAndrei Emeltchenko 	__u8     status;
12851e89cffbSAndrei Emeltchenko 	__u8     mode;
12861e89cffbSAndrei Emeltchenko } __packed;
12871e89cffbSAndrei Emeltchenko 
1288f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED	0x0c6d
1289f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1290f9b49306SAndre Guedes 	__u8	le;
1291f9b49306SAndre Guedes 	__u8	simul;
1292f9b49306SAndre Guedes } __packed;
1293f9b49306SAndre Guedes 
1294d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR	0x0c74
1295d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1296d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1297d0bf75a5SDoHyun Pyun } __packed;
1298d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1299d0bf75a5SDoHyun Pyun 	__u8	status;
1300d0bf75a5SDoHyun Pyun 	__u8	lt_addr;
1301d0bf75a5SDoHyun Pyun } __packed;
1302d0bf75a5SDoHyun Pyun 
13036a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR	0x0c75
13046a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
13056a20eaf4SDoHyun Pyun 	__u8	lt_addr;
13066a20eaf4SDoHyun Pyun } __packed;
13076a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
13086a20eaf4SDoHyun Pyun 	__u8	status;
13096a20eaf4SDoHyun Pyun 	__u8	lt_addr;
13106a20eaf4SDoHyun Pyun } __packed;
13116a20eaf4SDoHyun Pyun 
13126397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA		0x0c76
13136397729bSArchie Pusaka struct hci_cp_set_cpb_data {
13147d1dab49SDoHyun Pyun 	__u8	lt_addr;
13157d1dab49SDoHyun Pyun 	__u8	fragment;
13167d1dab49SDoHyun Pyun 	__u8	data_length;
13176397729bSArchie Pusaka 	__u8	data[HCI_MAX_CPB_DATA_SIZE];
13187d1dab49SDoHyun Pyun } __packed;
13196397729bSArchie Pusaka struct hci_rp_set_cpb_data {
13207d1dab49SDoHyun Pyun 	__u8	status;
13217d1dab49SDoHyun Pyun 	__u8	lt_addr;
13227d1dab49SDoHyun Pyun } __packed;
13237d1dab49SDoHyun Pyun 
13245d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS	0x0c77
13255d4e7e8dSJohan Hedberg 
1326a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS	0x0c78
1327a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1328a9b07a64SDoHyun Pyun 	__le16	interval_min;
1329a9b07a64SDoHyun Pyun 	__le16	interval_max;
1330a9b07a64SDoHyun Pyun 	__le32	sync_train_tout;
1331a9b07a64SDoHyun Pyun 	__u8	service_data;
1332a9b07a64SDoHyun Pyun } __packed;
1333a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1334a9b07a64SDoHyun Pyun 	__u8	status;
1335a9b07a64SDoHyun Pyun 	__le16	sync_train_int;
1336a9b07a64SDoHyun Pyun } __packed;
1337a9b07a64SDoHyun Pyun 
1338eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT		0x0c79
1339eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1340eb4b95c6SMarcel Holtmann 	__u8	status;
1341eb4b95c6SMarcel Holtmann 	__u8	support;
1342eb4b95c6SMarcel Holtmann } __packed;
1343eb4b95c6SMarcel Holtmann 
1344eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT		0x0c7a
1345eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1346eb4b95c6SMarcel Holtmann 	__u8	support;
1347eb4b95c6SMarcel Holtmann } __packed;
1348eb4b95c6SMarcel Holtmann 
1349302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO    0x0c7b
1350302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to {
1351302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1352302975cbSSpoorthi Ravishankar Koppad } __packed;
1353302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to {
1354302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1355302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1356302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1357302975cbSSpoorthi Ravishankar Koppad } __packed;
1358302975cbSSpoorthi Ravishankar Koppad 
1359302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO    0x0c7c
1360302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to {
1361302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1362302975cbSSpoorthi Ravishankar Koppad 	__le16  timeout;
1363302975cbSSpoorthi Ravishankar Koppad } __packed;
1364302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to {
1365302975cbSSpoorthi Ravishankar Koppad 	__u8    status;
1366302975cbSSpoorthi Ravishankar Koppad 	__le16  handle;
1367302975cbSSpoorthi Ravishankar Koppad } __packed;
1368302975cbSSpoorthi Ravishankar Koppad 
1369e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA	0x0c7d
1370e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1371e2f99131SMarcel Holtmann 	__u8     status;
1372e2f99131SMarcel Holtmann 	__u8     hash192[16];
137338da1703SJohan Hedberg 	__u8     rand192[16];
1374e2f99131SMarcel Holtmann 	__u8     hash256[16];
137538da1703SJohan Hedberg 	__u8     rand256[16];
1376e2f99131SMarcel Holtmann } __packed;
1377e2f99131SMarcel Holtmann 
13789798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH	0x0c83
13799798fbdeSKiran K struct hci_op_configure_data_path {
13809798fbdeSKiran K 	__u8	direction;
13819798fbdeSKiran K 	__u8	data_path_id;
13829798fbdeSKiran K 	__u8	vnd_len;
13839798fbdeSKiran K 	__u8	vnd_data[];
13849798fbdeSKiran K } __packed;
13859798fbdeSKiran K 
1386a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION	0x1001
1387a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
13881da177e4SLinus Torvalds 	__u8     status;
1389a9de9248SMarcel Holtmann 	__u8     hci_ver;
1390a9de9248SMarcel Holtmann 	__le16   hci_rev;
1391a9de9248SMarcel Holtmann 	__u8     lmp_ver;
1392a9de9248SMarcel Holtmann 	__le16   manufacturer;
1393a9de9248SMarcel Holtmann 	__le16   lmp_subver;
139466c853ccSGustavo F. Padovan } __packed;
13951da177e4SLinus Torvalds 
1396a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS	0x1002
1397a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
13981da177e4SLinus Torvalds 	__u8     status;
1399a9de9248SMarcel Holtmann 	__u8     commands[64];
140066c853ccSGustavo F. Padovan } __packed;
14011da177e4SLinus Torvalds 
1402a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES	0x1003
1403a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1404a9de9248SMarcel Holtmann 	__u8     status;
1405a9de9248SMarcel Holtmann 	__u8     features[8];
140666c853ccSGustavo F. Padovan } __packed;
1407a9de9248SMarcel Holtmann 
1408a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES	0x1004
1409971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1410971e3a4bSAndre Guedes 	__u8     page;
1411971e3a4bSAndre Guedes } __packed;
1412a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1413a9de9248SMarcel Holtmann 	__u8     status;
1414a9de9248SMarcel Holtmann 	__u8     page;
1415a9de9248SMarcel Holtmann 	__u8     max_page;
1416a9de9248SMarcel Holtmann 	__u8     features[8];
141766c853ccSGustavo F. Padovan } __packed;
1418a9de9248SMarcel Holtmann 
1419a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE		0x1005
1420a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1421a9de9248SMarcel Holtmann 	__u8     status;
1422a9de9248SMarcel Holtmann 	__le16   acl_mtu;
1423a9de9248SMarcel Holtmann 	__u8     sco_mtu;
1424a9de9248SMarcel Holtmann 	__le16   acl_max_pkt;
1425a9de9248SMarcel Holtmann 	__le16   sco_max_pkt;
142666c853ccSGustavo F. Padovan } __packed;
1427a9de9248SMarcel Holtmann 
1428a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR		0x1009
1429a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1430a9de9248SMarcel Holtmann 	__u8     status;
14311da177e4SLinus Torvalds 	bdaddr_t bdaddr;
143266c853ccSGustavo F. Padovan } __packed;
14331da177e4SLinus Torvalds 
1434350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE	0x100a
1435350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1436350ee4cfSAndrei Emeltchenko 	__u8     status;
1437350ee4cfSAndrei Emeltchenko 	__le16   max_acl_len;
1438350ee4cfSAndrei Emeltchenko 	__le16   block_len;
1439350ee4cfSAndrei Emeltchenko 	__le16   num_blocks;
1440350ee4cfSAndrei Emeltchenko } __packed;
1441350ee4cfSAndrei Emeltchenko 
1442109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS	0x100b
14438961987fSKiran K struct hci_std_codecs {
14448961987fSKiran K 	__u8	num;
14458961987fSKiran K 	__u8	codec[];
14468961987fSKiran K } __packed;
14478961987fSKiran K 
14488961987fSKiran K struct hci_vnd_codec {
14498961987fSKiran K 	/* company id */
14508961987fSKiran K 	__le16	cid;
14518961987fSKiran K 	/* vendor codec id */
14528961987fSKiran K 	__le16	vid;
14538961987fSKiran K } __packed;
14548961987fSKiran K 
14558961987fSKiran K struct hci_vnd_codecs {
14568961987fSKiran K 	__u8	num;
14578961987fSKiran K 	struct hci_vnd_codec codec[];
14588961987fSKiran K } __packed;
14598961987fSKiran K 
14608961987fSKiran K struct hci_rp_read_local_supported_codecs {
14618961987fSKiran K 	__u8	status;
14628961987fSKiran K 	struct hci_std_codecs std_codecs;
14638961987fSKiran K 	struct hci_vnd_codecs vnd_codecs;
14648961987fSKiran K } __packed;
1465109e3191SMarcel Holtmann 
1466a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS	0x100c
1467a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts {
1468a4790360SMarcel Holtmann 	__u8     status;
1469a4790360SMarcel Holtmann 	__u8     pairing_opts;
1470a4790360SMarcel Holtmann 	__u8     max_key_size;
1471a4790360SMarcel Holtmann } __packed;
1472a4790360SMarcel Holtmann 
14739ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2	0x100d
14749ae66402SKiran K struct hci_std_codec_v2 {
14759ae66402SKiran K 	__u8	id;
14769ae66402SKiran K 	__u8	transport;
14779ae66402SKiran K } __packed;
14789ae66402SKiran K 
14799ae66402SKiran K struct hci_std_codecs_v2 {
14809ae66402SKiran K 	__u8	num;
14819ae66402SKiran K 	struct hci_std_codec_v2 codec[];
14829ae66402SKiran K } __packed;
14839ae66402SKiran K 
14849ae66402SKiran K struct hci_vnd_codec_v2 {
14859ae66402SKiran K 	__le16	cid;
14869ae66402SKiran K 	__le16	vid;
14879ae66402SKiran K 	__u8	transport;
14889ae66402SKiran K } __packed;
14899ae66402SKiran K 
14909ae66402SKiran K struct hci_vnd_codecs_v2 {
14919ae66402SKiran K 	__u8	num;
14929ae66402SKiran K 	struct hci_vnd_codec_v2 codec[];
14939ae66402SKiran K } __packed;
14949ae66402SKiran K 
14959ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 {
14969ae66402SKiran K 	__u8	status;
14979ae66402SKiran K 	struct hci_std_codecs_v2 std_codecs;
14989ae66402SKiran K 	struct hci_vnd_codecs_v2 vendor_codecs;
14999ae66402SKiran K } __packed;
15009ae66402SKiran K 
15018961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS	0x100e
15028961987fSKiran K struct hci_op_read_local_codec_caps {
15038961987fSKiran K 	__u8	id;
15048961987fSKiran K 	__le16	cid;
15058961987fSKiran K 	__le16	vid;
15068961987fSKiran K 	__u8	transport;
15078961987fSKiran K 	__u8	direction;
15088961987fSKiran K } __packed;
15098961987fSKiran K 
15108961987fSKiran K struct hci_codec_caps {
15118961987fSKiran K 	__u8	len;
15128961987fSKiran K 	__u8	data[];
15138961987fSKiran K } __packed;
15148961987fSKiran K 
15158961987fSKiran K struct hci_rp_read_local_codec_caps {
15168961987fSKiran K 	__u8	status;
15178961987fSKiran K 	__u8	num_caps;
15188961987fSKiran K } __packed;
15198961987fSKiran K 
1520f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY	0x0c1b
1521f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1522f332ec66SJohan Hedberg 	__u8     status;
1523f332ec66SJohan Hedberg 	__le16   interval;
1524f332ec66SJohan Hedberg 	__le16   window;
1525f332ec66SJohan Hedberg } __packed;
1526f332ec66SJohan Hedberg 
1527f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY	0x0c1c
1528f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1529f6422ec6SAntti Julku 	__le16   interval;
1530f6422ec6SAntti Julku 	__le16   window;
1531f6422ec6SAntti Julku } __packed;
1532f6422ec6SAntti Julku 
15335a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER		0x0c2d
15345a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
15355a134faeSAndrzej Kaczmarek 	__le16   handle;
15365a134faeSAndrzej Kaczmarek 	__u8     type;
15375a134faeSAndrzej Kaczmarek } __packed;
15385a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
15395a134faeSAndrzej Kaczmarek 	__u8     status;
15405a134faeSAndrzej Kaczmarek 	__le16   handle;
15415a134faeSAndrzej Kaczmarek 	__s8     tx_power;
15425a134faeSAndrzej Kaczmarek } __packed;
15435a134faeSAndrzej Kaczmarek 
1544f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE	0x0c46
1545f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1546f332ec66SJohan Hedberg 	__u8     status;
1547f332ec66SJohan Hedberg 	__u8     type;
1548f332ec66SJohan Hedberg } __packed;
1549f332ec66SJohan Hedberg 
1550f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE	0x0c47
1551f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_STANDARD		0x00
1552f6422ec6SAntti Julku 	#define PAGE_SCAN_TYPE_INTERLACED	0x01
1553f6422ec6SAntti Julku 
15545ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI		0x1405
15555ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
15565ae76a94SAndrzej Kaczmarek 	__le16   handle;
15575ae76a94SAndrzej Kaczmarek } __packed;
15585ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
15595ae76a94SAndrzej Kaczmarek 	__u8     status;
15605ae76a94SAndrzej Kaczmarek 	__le16   handle;
15615ae76a94SAndrzej Kaczmarek 	__s8     rssi;
15625ae76a94SAndrzej Kaczmarek } __packed;
15635ae76a94SAndrzej Kaczmarek 
156433f35721SJohan Hedberg #define HCI_OP_READ_CLOCK		0x1407
156533f35721SJohan Hedberg struct hci_cp_read_clock {
156633f35721SJohan Hedberg 	__le16   handle;
156733f35721SJohan Hedberg 	__u8     which;
156833f35721SJohan Hedberg } __packed;
156933f35721SJohan Hedberg struct hci_rp_read_clock {
157033f35721SJohan Hedberg 	__u8     status;
157133f35721SJohan Hedberg 	__le16   handle;
157233f35721SJohan Hedberg 	__le32   clock;
157333f35721SJohan Hedberg 	__le16   accuracy;
157433f35721SJohan Hedberg } __packed;
157533f35721SJohan Hedberg 
1576821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE	0x1408
1577821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1578821f3766SJohan Hedberg 	__le16   handle;
1579821f3766SJohan Hedberg } __packed;
1580821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1581821f3766SJohan Hedberg 	__u8     status;
1582821f3766SJohan Hedberg 	__le16   handle;
1583821f3766SJohan Hedberg 	__u8     key_size;
1584821f3766SJohan Hedberg } __packed;
1585821f3766SJohan Hedberg 
1586928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO	0x1409
1587928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info {
1588928abaa7SAndrei Emeltchenko 	__u8     status;
1589928abaa7SAndrei Emeltchenko 	__u8     amp_status;
1590928abaa7SAndrei Emeltchenko 	__le32   total_bw;
1591928abaa7SAndrei Emeltchenko 	__le32   max_bw;
1592928abaa7SAndrei Emeltchenko 	__le32   min_latency;
1593928abaa7SAndrei Emeltchenko 	__le32   max_pdu;
1594928abaa7SAndrei Emeltchenko 	__u8     amp_type;
1595928abaa7SAndrei Emeltchenko 	__le16   pal_cap;
1596928abaa7SAndrei Emeltchenko 	__le16   max_assoc_size;
1597928abaa7SAndrei Emeltchenko 	__le32   max_flush_to;
1598928abaa7SAndrei Emeltchenko 	__le32   be_flush_to;
1599928abaa7SAndrei Emeltchenko } __packed;
1600928abaa7SAndrei Emeltchenko 
1601523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC	0x140a
1602523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc {
1603523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1604523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1605523e93cdSAndrei Emeltchenko 	__le16   max_len;
1606523e93cdSAndrei Emeltchenko } __packed;
1607523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc {
1608523e93cdSAndrei Emeltchenko 	__u8     status;
1609523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1610523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1611a7e45454SGustavo A. R. Silva 	__u8     frag[];
1612523e93cdSAndrei Emeltchenko } __packed;
1613523e93cdSAndrei Emeltchenko 
1614523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC	0x140b
1615523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc {
1616523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1617523e93cdSAndrei Emeltchenko 	__le16   len_so_far;
1618523e93cdSAndrei Emeltchenko 	__le16   rem_len;
1619a7e45454SGustavo A. R. Silva 	__u8     frag[];
1620523e93cdSAndrei Emeltchenko } __packed;
1621523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc {
1622523e93cdSAndrei Emeltchenko 	__u8     status;
1623523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
1624523e93cdSAndrei Emeltchenko } __packed;
1625523e93cdSAndrei Emeltchenko 
1626f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG	0x140c
1627f4fe73edSMarcel Holtmann 
16284b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE		0x1803
16294b4148e9SMarcel Holtmann 
163006f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
163106f5b778SMarcel Holtmann 
163263185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK	0x2001
163363185f64SVille Tervo struct hci_cp_le_set_event_mask {
163463185f64SVille Tervo 	__u8     mask[8];
163563185f64SVille Tervo } __packed;
163663185f64SVille Tervo 
163763185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE	0x2002
163863185f64SVille Tervo struct hci_rp_le_read_buffer_size {
163963185f64SVille Tervo 	__u8     status;
164063185f64SVille Tervo 	__le16   le_mtu;
164163185f64SVille Tervo 	__u8     le_max_pkt;
164263185f64SVille Tervo } __packed;
164363185f64SVille Tervo 
164460e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES	0x2003
164560e77321SJohan Hedberg struct hci_rp_le_read_local_features {
164660e77321SJohan Hedberg 	__u8     status;
164760e77321SJohan Hedberg 	__u8     features[8];
164860e77321SJohan Hedberg } __packed;
164960e77321SJohan Hedberg 
1650d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR	0x2005
1651d13eafceSMarcel Holtmann 
16521e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM		0x2006
16531e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
16541e191893SMarcel Holtmann 	__le16   min_interval;
16551e191893SMarcel Holtmann 	__le16   max_interval;
16561e191893SMarcel Holtmann 	__u8     type;
16571e191893SMarcel Holtmann 	__u8     own_address_type;
16581e191893SMarcel Holtmann 	__u8     direct_addr_type;
16591e191893SMarcel Holtmann 	bdaddr_t direct_addr;
16601e191893SMarcel Holtmann 	__u8     channel_map;
16611e191893SMarcel Holtmann 	__u8     filter_policy;
16621e191893SMarcel Holtmann } __packed;
16631e191893SMarcel Holtmann 
16648fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER	0x2007
16658fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
16668fa19098SJohan Hedberg 	__u8	status;
16678fa19098SJohan Hedberg 	__s8	tx_power;
16688fa19098SJohan Hedberg } __packed;
16698fa19098SJohan Hedberg 
16703f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH		31
16713f0f524bSJohan Hedberg 
16723f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA		0x2008
16733f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
16743f0f524bSJohan Hedberg 	__u8	length;
16753f0f524bSJohan Hedberg 	__u8	data[HCI_MAX_AD_LENGTH];
16763f0f524bSJohan Hedberg } __packed;
16773f0f524bSJohan Hedberg 
1678f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA	0x2009
1679f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1680f14d8f64SMarcel Holtmann 	__u8	length;
1681f14d8f64SMarcel Holtmann 	__u8	data[HCI_MAX_AD_LENGTH];
1682f14d8f64SMarcel Holtmann } __packed;
1683f14d8f64SMarcel Holtmann 
1684c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE	0x200a
1685c1d5dc4aSJohan Hedberg 
16865df480b5SAndre Guedes #define LE_SCAN_PASSIVE			0x00
16875df480b5SAndre Guedes #define LE_SCAN_ACTIVE			0x01
16885df480b5SAndre Guedes 
168907f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM	0x200b
169007f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
169107f7fa5dSAndre Guedes 	__u8    type;
169207f7fa5dSAndre Guedes 	__le16  interval;
169307f7fa5dSAndre Guedes 	__le16  window;
169407f7fa5dSAndre Guedes 	__u8    own_address_type;
169507f7fa5dSAndre Guedes 	__u8    filter_policy;
169607f7fa5dSAndre Guedes } __packed;
169707f7fa5dSAndre Guedes 
169876a388beSAndre Guedes #define LE_SCAN_DISABLE			0x00
169976a388beSAndre Guedes #define LE_SCAN_ENABLE			0x01
1700525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE	0x00
1701525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE	0x01
170268a8aea4SAndrei Emeltchenko 
1703eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE	0x200c
1704eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1705eb9d91f5SAndre Guedes 	__u8     enable;
1706eb9d91f5SAndre Guedes 	__u8     filter_dup;
1707eb9d91f5SAndre Guedes } __packed;
1708eb9d91f5SAndre Guedes 
1709a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR		0x00
17103d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST		0x01
1711a7139eddSJohan Hedberg 
171263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN		0x200d
171363185f64SVille Tervo struct hci_cp_le_create_conn {
171463185f64SVille Tervo 	__le16   scan_interval;
171563185f64SVille Tervo 	__le16   scan_window;
171663185f64SVille Tervo 	__u8     filter_policy;
171763185f64SVille Tervo 	__u8     peer_addr_type;
171863185f64SVille Tervo 	bdaddr_t peer_addr;
171963185f64SVille Tervo 	__u8     own_address_type;
172063185f64SVille Tervo 	__le16   conn_interval_min;
172163185f64SVille Tervo 	__le16   conn_interval_max;
172263185f64SVille Tervo 	__le16   conn_latency;
172363185f64SVille Tervo 	__le16   supervision_timeout;
172463185f64SVille Tervo 	__le16   min_ce_len;
172563185f64SVille Tervo 	__le16   max_ce_len;
172663185f64SVille Tervo } __packed;
172763185f64SVille Tervo 
172863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL	0x200e
172963185f64SVille Tervo 
17303d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE	0x200f
17313d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size {
1732cf1d081fSJohan Hedberg 	__u8	status;
1733cf1d081fSJohan Hedberg 	__u8	size;
1734cf1d081fSJohan Hedberg } __packed;
1735cf1d081fSJohan Hedberg 
17363d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST	0x2010
1737d9a7b0a5SMarcel Holtmann 
17383d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST	0x2011
17393d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list {
1740d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1741d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1742d9a7b0a5SMarcel Holtmann } __packed;
1743d9a7b0a5SMarcel Holtmann 
17443d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST	0x2012
17453d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list {
1746d9a7b0a5SMarcel Holtmann 	__u8     bdaddr_type;
1747d9a7b0a5SMarcel Holtmann 	bdaddr_t bdaddr;
1748d9a7b0a5SMarcel Holtmann } __packed;
1749d9a7b0a5SMarcel Holtmann 
17502ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE		0x2013
17512ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
17522ce603ebSClaudio Takahasi 	__le16   handle;
17532ce603ebSClaudio Takahasi 	__le16   conn_interval_min;
17542ce603ebSClaudio Takahasi 	__le16   conn_interval_max;
17552ce603ebSClaudio Takahasi 	__le16   conn_latency;
17562ce603ebSClaudio Takahasi 	__le16   supervision_timeout;
17572ce603ebSClaudio Takahasi 	__le16   min_ce_len;
17582ce603ebSClaudio Takahasi 	__le16   max_ce_len;
17592ce603ebSClaudio Takahasi } __packed;
17602ce603ebSClaudio Takahasi 
17610fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES	0x2016
17620fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
17630fe29fd1SMarcel Holtmann 	__le16	 handle;
17640fe29fd1SMarcel Holtmann } __packed;
17650fe29fd1SMarcel Holtmann 
1766a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC		0x2019
1767a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1768a7a595f6SVinicius Costa Gomes 	__le16	handle;
1769fe39c7b2SMarcel Holtmann 	__le64	rand;
1770a7a595f6SVinicius Costa Gomes 	__le16	ediv;
1771a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1772a7a595f6SVinicius Costa Gomes } __packed;
1773a7a595f6SVinicius Costa Gomes 
1774a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY		0x201a
1775a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1776a7a595f6SVinicius Costa Gomes 	__le16	handle;
1777a7a595f6SVinicius Costa Gomes 	__u8	ltk[16];
1778a7a595f6SVinicius Costa Gomes } __packed;
1779a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1780a7a595f6SVinicius Costa Gomes 	__u8	status;
1781a7a595f6SVinicius Costa Gomes 	__le16	handle;
1782a7a595f6SVinicius Costa Gomes } __packed;
1783a7a595f6SVinicius Costa Gomes 
1784a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY		0x201b
1785a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1786a7a595f6SVinicius Costa Gomes 	__le16	handle;
1787a7a595f6SVinicius Costa Gomes } __packed;
1788a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1789a7a595f6SVinicius Costa Gomes 	__u8	status;
1790a7a595f6SVinicius Costa Gomes 	__le16	handle;
1791a7a595f6SVinicius Costa Gomes } __packed;
1792a7a595f6SVinicius Costa Gomes 
17939b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES	0x201c
17949b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
17959b008c04SJohan Hedberg 	__u8	status;
17969b008c04SJohan Hedberg 	__u8	le_states[8];
17979b008c04SJohan Hedberg } __packed;
17989b008c04SJohan Hedberg 
17998e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY	0x2020
18008e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
18018e75b46aSAndre Guedes 	__le16	handle;
18028e75b46aSAndre Guedes 	__le16	interval_min;
18038e75b46aSAndre Guedes 	__le16	interval_max;
18048e75b46aSAndre Guedes 	__le16	latency;
18058e75b46aSAndre Guedes 	__le16	timeout;
18068e75b46aSAndre Guedes 	__le16	min_ce_len;
18078e75b46aSAndre Guedes 	__le16	max_ce_len;
18088e75b46aSAndre Guedes } __packed;
18098e75b46aSAndre Guedes 
18108e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY	0x2021
18118e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
18128e75b46aSAndre Guedes 	__le16	handle;
18138e75b46aSAndre Guedes 	__u8	reason;
18148e75b46aSAndre Guedes } __packed;
18158e75b46aSAndre Guedes 
181694a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN		0x2022
181794a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
181894a3bd02SMarcel Holtmann 	__le16	handle;
181994a3bd02SMarcel Holtmann 	__le16	tx_len;
182094a3bd02SMarcel Holtmann 	__le16	tx_time;
182194a3bd02SMarcel Holtmann } __packed;
182294a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
182394a3bd02SMarcel Holtmann 	__u8	status;
182494a3bd02SMarcel Holtmann 	__le16	handle;
182594a3bd02SMarcel Holtmann } __packed;
182694a3bd02SMarcel Holtmann 
182794a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN	0x2023
182894a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
182994a3bd02SMarcel Holtmann 	__u8	status;
183094a3bd02SMarcel Holtmann 	__le16	tx_len;
183194a3bd02SMarcel Holtmann 	__le16	tx_time;
183294a3bd02SMarcel Holtmann } __packed;
183394a3bd02SMarcel Holtmann 
183494a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN	0x2024
183594a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
183694a3bd02SMarcel Holtmann 	__le16	tx_len;
183794a3bd02SMarcel Holtmann 	__le16	tx_time;
183894a3bd02SMarcel Holtmann } __packed;
183994a3bd02SMarcel Holtmann 
1840b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST	0x2027
1841b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list {
1842b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1843b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1844b950aa88SAnkit Navik 	__u8	 peer_irk[16];
1845b950aa88SAnkit Navik 	__u8	 local_irk[16];
1846b950aa88SAnkit Navik } __packed;
1847b950aa88SAnkit Navik 
1848b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST	0x2028
1849b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list {
1850b950aa88SAnkit Navik 	__u8	 bdaddr_type;
1851b950aa88SAnkit Navik 	bdaddr_t bdaddr;
1852b950aa88SAnkit Navik } __packed;
1853b950aa88SAnkit Navik 
1854545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST	0x2029
1855545f2596SAnkit Navik 
1856cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE	0x202a
1857cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1858cfdb0c2dSAnkit Navik 	__u8	status;
1859cfdb0c2dSAnkit Navik 	__u8	size;
1860cfdb0c2dSAnkit Navik } __packed;
1861cfdb0c2dSAnkit Navik 
1862aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1863aa12af77SAnkit Navik 
1864b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT	0x202e
1865b2cc2339SSathish Narasimman 
186694a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN	0x202f
186794a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
186894a3bd02SMarcel Holtmann 	__u8	status;
186994a3bd02SMarcel Holtmann 	__le16	tx_len;
187094a3bd02SMarcel Holtmann 	__le16	tx_time;
187194a3bd02SMarcel Holtmann 	__le16	rx_len;
187294a3bd02SMarcel Holtmann 	__le16	rx_time;
187394a3bd02SMarcel Holtmann } __packed;
187494a3bd02SMarcel Holtmann 
1875de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY	0x2031
1876de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1877de2ba303SMarcel Holtmann 	__u8    all_phys;
1878de2ba303SMarcel Holtmann 	__u8    tx_phys;
1879de2ba303SMarcel Holtmann 	__u8    rx_phys;
1880de2ba303SMarcel Holtmann } __packed;
1881de2ba303SMarcel Holtmann 
18826decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M		0x01
18836decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M		0x02
18846decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED		0x04
18856decb5b4SJaganath Kanakkassery 
1886a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS   0x2041
1887a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1888a2344b9eSJaganath Kanakkassery 	__u8    own_addr_type;
1889a2344b9eSJaganath Kanakkassery 	__u8    filter_policy;
1890a2344b9eSJaganath Kanakkassery 	__u8    scanning_phys;
1891a7e45454SGustavo A. R. Silva 	__u8    data[];
1892a2344b9eSJaganath Kanakkassery } __packed;
1893a2344b9eSJaganath Kanakkassery 
1894a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M		0x01
189545bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M		0x02
189645bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED	0x04
1897a2344b9eSJaganath Kanakkassery 
1898a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1899a2344b9eSJaganath Kanakkassery 	__u8    type;
1900a2344b9eSJaganath Kanakkassery 	__le16  interval;
1901a2344b9eSJaganath Kanakkassery 	__le16  window;
1902a2344b9eSJaganath Kanakkassery } __packed;
1903a2344b9eSJaganath Kanakkassery 
1904a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE   0x2042
1905a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1906a2344b9eSJaganath Kanakkassery 	__u8    enable;
1907a2344b9eSJaganath Kanakkassery 	__u8    filter_dup;
1908a2344b9eSJaganath Kanakkassery 	__le16  duration;
1909a2344b9eSJaganath Kanakkassery 	__le16  period;
1910a2344b9eSJaganath Kanakkassery } __packed;
1911a2344b9eSJaganath Kanakkassery 
19124d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN    0x2043
19134d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
19144d94f95dSJaganath Kanakkassery 	__u8      filter_policy;
19154d94f95dSJaganath Kanakkassery 	__u8      own_addr_type;
19164d94f95dSJaganath Kanakkassery 	__u8      peer_addr_type;
19174d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_addr;
19184d94f95dSJaganath Kanakkassery 	__u8      phys;
1919a7e45454SGustavo A. R. Silva 	__u8      data[];
19204d94f95dSJaganath Kanakkassery } __packed;
19214d94f95dSJaganath Kanakkassery 
19224d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
19234d94f95dSJaganath Kanakkassery 	__le16 scan_interval;
19244d94f95dSJaganath Kanakkassery 	__le16 scan_window;
19254d94f95dSJaganath Kanakkassery 	__le16 conn_interval_min;
19264d94f95dSJaganath Kanakkassery 	__le16 conn_interval_max;
19274d94f95dSJaganath Kanakkassery 	__le16 conn_latency;
19284d94f95dSJaganath Kanakkassery 	__le16 supervision_timeout;
19294d94f95dSJaganath Kanakkassery 	__le16 min_ce_len;
19304d94f95dSJaganath Kanakkassery 	__le16 max_ce_len;
19314d94f95dSJaganath Kanakkassery } __packed;
19324d94f95dSJaganath Kanakkassery 
1933eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_CREATE_SYNC	0x2044
1934eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_create_sync {
1935eca0ae4aSLuiz Augusto von Dentz 	__u8      options;
1936eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
1937eca0ae4aSLuiz Augusto von Dentz 	__u8      addr_type;
1938eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  addr;
1939eca0ae4aSLuiz Augusto von Dentz 	__le16    skip;
1940eca0ae4aSLuiz Augusto von Dentz 	__le16    sync_timeout;
1941eca0ae4aSLuiz Augusto von Dentz 	__u8      sync_cte_type;
1942eca0ae4aSLuiz Augusto von Dentz } __packed;
1943eca0ae4aSLuiz Augusto von Dentz 
1944eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_TERM_SYNC		0x2046
1945eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_term_sync {
1946eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
1947eca0ae4aSLuiz Augusto von Dentz } __packed;
1948eca0ae4aSLuiz Augusto von Dentz 
19496b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS	0x203b
19506b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
19516b49bcb4SJaganath Kanakkassery 	__u8  status;
19526b49bcb4SJaganath Kanakkassery 	__u8  num_of_sets;
19536b49bcb4SJaganath Kanakkassery } __packed;
19546b49bcb4SJaganath Kanakkassery 
1955de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS		0x2036
1956de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1957de181e88SJaganath Kanakkassery 	__u8      handle;
1958de181e88SJaganath Kanakkassery 	__le16    evt_properties;
1959de181e88SJaganath Kanakkassery 	__u8      min_interval[3];
1960de181e88SJaganath Kanakkassery 	__u8      max_interval[3];
1961de181e88SJaganath Kanakkassery 	__u8      channel_map;
1962de181e88SJaganath Kanakkassery 	__u8      own_addr_type;
1963de181e88SJaganath Kanakkassery 	__u8      peer_addr_type;
1964de181e88SJaganath Kanakkassery 	bdaddr_t  peer_addr;
1965de181e88SJaganath Kanakkassery 	__u8      filter_policy;
1966de181e88SJaganath Kanakkassery 	__u8      tx_power;
1967de181e88SJaganath Kanakkassery 	__u8      primary_phy;
1968de181e88SJaganath Kanakkassery 	__u8      secondary_max_skip;
1969de181e88SJaganath Kanakkassery 	__u8      secondary_phy;
1970de181e88SJaganath Kanakkassery 	__u8      sid;
1971de181e88SJaganath Kanakkassery 	__u8      notif_enable;
1972de181e88SJaganath Kanakkassery } __packed;
1973de181e88SJaganath Kanakkassery 
1974de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M		0X01
197585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M		0x02
197685a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED	0x03
1977de181e88SJaganath Kanakkassery 
1978de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1979de181e88SJaganath Kanakkassery 	__u8  status;
1980de181e88SJaganath Kanakkassery 	__u8  tx_power;
1981de181e88SJaganath Kanakkassery } __packed;
1982de181e88SJaganath Kanakkassery 
1983de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1984de181e88SJaganath Kanakkassery 	__u8  handle;
1985de181e88SJaganath Kanakkassery 	__le16 duration;
1986de181e88SJaganath Kanakkassery 	__u8  max_events;
1987de181e88SJaganath Kanakkassery } __packed;
1988de181e88SJaganath Kanakkassery 
1989c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH	251
1990c9ed0a70SLuiz Augusto von Dentz 
1991a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA		0x2037
1992a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1993a0fb3726SJaganath Kanakkassery 	__u8  handle;
1994a0fb3726SJaganath Kanakkassery 	__u8  operation;
1995a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
1996a0fb3726SJaganath Kanakkassery 	__u8  length;
1997c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
1998a0fb3726SJaganath Kanakkassery } __packed;
1999a0fb3726SJaganath Kanakkassery 
2000a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA		0x2038
2001a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
2002a0fb3726SJaganath Kanakkassery 	__u8  handle;
2003a0fb3726SJaganath Kanakkassery 	__u8  operation;
2004a0fb3726SJaganath Kanakkassery 	__u8  frag_pref;
2005a0fb3726SJaganath Kanakkassery 	__u8  length;
2006c9ed0a70SLuiz Augusto von Dentz 	__u8  data[];
2007a0fb3726SJaganath Kanakkassery } __packed;
2008a0fb3726SJaganath Kanakkassery 
2009eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_EXT_ADV_ENABLE		0x2039
2010eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_ext_adv_enable {
2011eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
2012eca0ae4aSLuiz Augusto von Dentz 	__u8  num_of_sets;
2013eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
2014eca0ae4aSLuiz Augusto von Dentz } __packed;
2015eca0ae4aSLuiz Augusto von Dentz 
2016eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_PARAMS		0x203e
2017eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_params {
2018eca0ae4aSLuiz Augusto von Dentz 	__u8      handle;
2019eca0ae4aSLuiz Augusto von Dentz 	__le16    min_interval;
2020eca0ae4aSLuiz Augusto von Dentz 	__le16    max_interval;
2021eca0ae4aSLuiz Augusto von Dentz 	__le16    periodic_properties;
2022eca0ae4aSLuiz Augusto von Dentz } __packed;
2023eca0ae4aSLuiz Augusto von Dentz 
2024eca0ae4aSLuiz Augusto von Dentz #define HCI_MAX_PER_AD_LENGTH	252
2025eca0ae4aSLuiz Augusto von Dentz 
2026eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_DATA		0x203f
2027eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_data {
2028eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
2029eca0ae4aSLuiz Augusto von Dentz 	__u8  operation;
2030eca0ae4aSLuiz Augusto von Dentz 	__u8  length;
2031eca0ae4aSLuiz Augusto von Dentz 	__u8  data[];
2032eca0ae4aSLuiz Augusto von Dentz } __packed;
2033eca0ae4aSLuiz Augusto von Dentz 
2034eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_ENABLE		0x2040
2035eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_enable {
2036eca0ae4aSLuiz Augusto von Dentz 	__u8  enable;
2037eca0ae4aSLuiz Augusto von Dentz 	__u8  handle;
2038eca0ae4aSLuiz Augusto von Dentz } __packed;
2039eca0ae4aSLuiz Augusto von Dentz 
2040a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE	0x03
2041a0fb3726SJaganath Kanakkassery 
2042a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG		0x01
2043a0fb3726SJaganath Kanakkassery 
2044a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET	0x203c
2045a9e45698SSathish Narsimman 
204645b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS	0x203d
204745b7749fSJaganath Kanakkassery 
2048a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR	0x2035
2049a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
2050a73c046aSJaganath Kanakkassery 	__u8  handle;
2051a73c046aSJaganath Kanakkassery 	bdaddr_t  bdaddr;
2052a73c046aSJaganath Kanakkassery } __packed;
2053a73c046aSJaganath Kanakkassery 
20547c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER	0x204b
20557c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power {
20567c395ea5SDaniel Winkler 	__u8  status;
20577c395ea5SDaniel Winkler 	__s8  min_le_tx_power;
20587c395ea5SDaniel Winkler 	__s8  max_le_tx_power;
20597c395ea5SDaniel Winkler } __packed;
20607c395ea5SDaniel Winkler 
2061853b70b5SLuiz Augusto von Dentz #define HCI_NETWORK_PRIVACY		0x00
2062853b70b5SLuiz Augusto von Dentz #define HCI_DEVICE_PRIVACY		0x01
2063853b70b5SLuiz Augusto von Dentz 
2064853b70b5SLuiz Augusto von Dentz #define HCI_OP_LE_SET_PRIVACY_MODE	0x204e
2065853b70b5SLuiz Augusto von Dentz struct hci_cp_le_set_privacy_mode {
2066853b70b5SLuiz Augusto von Dentz 	__u8  bdaddr_type;
2067853b70b5SLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2068853b70b5SLuiz Augusto von Dentz 	__u8  mode;
2069853b70b5SLuiz Augusto von Dentz } __packed;
2070853b70b5SLuiz Augusto von Dentz 
20714de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2	0x2060
20724de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 {
20734de0fc59SLuiz Augusto von Dentz 	__u8    status;
20744de0fc59SLuiz Augusto von Dentz 	__le16  acl_mtu;
20754de0fc59SLuiz Augusto von Dentz 	__u8    acl_max_pkt;
20764de0fc59SLuiz Augusto von Dentz 	__le16  iso_mtu;
20774de0fc59SLuiz Augusto von Dentz 	__u8    iso_max_pkt;
20784de0fc59SLuiz Augusto von Dentz } __packed;
20794de0fc59SLuiz Augusto von Dentz 
20804de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC		0x2061
20814de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync {
20824de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20834de0fc59SLuiz Augusto von Dentz } __packed;
20844de0fc59SLuiz Augusto von Dentz 
20854de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync {
20864de0fc59SLuiz Augusto von Dentz 	__u8    status;
20874de0fc59SLuiz Augusto von Dentz 	__le16  handle;
20884de0fc59SLuiz Augusto von Dentz 	__le16  seq;
20894de0fc59SLuiz Augusto von Dentz 	__le32  imestamp;
20904de0fc59SLuiz Augusto von Dentz 	__u8    offset[3];
20914de0fc59SLuiz Augusto von Dentz } __packed;
20924de0fc59SLuiz Augusto von Dentz 
20934de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS		0x2062
20944de0fc59SLuiz Augusto von Dentz struct hci_cis_params {
20954de0fc59SLuiz Augusto von Dentz 	__u8    cis_id;
209676c185a5SArchie Pusaka 	__le16  c_sdu;
209726afbd82SLuiz Augusto von Dentz 	__le16  p_sdu;
209876c185a5SArchie Pusaka 	__u8    c_phy;
209976c185a5SArchie Pusaka 	__u8    p_phy;
210076c185a5SArchie Pusaka 	__u8    c_rtn;
210176c185a5SArchie Pusaka 	__u8    p_rtn;
21024de0fc59SLuiz Augusto von Dentz } __packed;
21034de0fc59SLuiz Augusto von Dentz 
21044de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params {
21054de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
210676c185a5SArchie Pusaka 	__u8    c_interval[3];
210776c185a5SArchie Pusaka 	__u8    p_interval[3];
210826afbd82SLuiz Augusto von Dentz 	__u8    sca;
21094de0fc59SLuiz Augusto von Dentz 	__u8    packing;
21104de0fc59SLuiz Augusto von Dentz 	__u8    framing;
211176c185a5SArchie Pusaka 	__le16  c_latency;
211276c185a5SArchie Pusaka 	__le16  p_latency;
21134de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2114a7e45454SGustavo A. R. Silva 	struct hci_cis_params cis[];
21154de0fc59SLuiz Augusto von Dentz } __packed;
21164de0fc59SLuiz Augusto von Dentz 
21174de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params {
21184de0fc59SLuiz Augusto von Dentz 	__u8    status;
21194de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
21204de0fc59SLuiz Augusto von Dentz 	__u8    num_handles;
2121a7e45454SGustavo A. R. Silva 	__le16  handle[];
21224de0fc59SLuiz Augusto von Dentz } __packed;
21234de0fc59SLuiz Augusto von Dentz 
21244de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS			0x2064
21254de0fc59SLuiz Augusto von Dentz struct hci_cis {
21264de0fc59SLuiz Augusto von Dentz 	__le16  cis_handle;
21274de0fc59SLuiz Augusto von Dentz 	__le16  acl_handle;
21284de0fc59SLuiz Augusto von Dentz } __packed;
21294de0fc59SLuiz Augusto von Dentz 
21304de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis {
21314de0fc59SLuiz Augusto von Dentz 	__u8    num_cis;
2132a7e45454SGustavo A. R. Silva 	struct hci_cis cis[];
21334de0fc59SLuiz Augusto von Dentz } __packed;
21344de0fc59SLuiz Augusto von Dentz 
21354de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG			0x2065
21364de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig {
21374de0fc59SLuiz Augusto von Dentz 	__u8    cig_id;
21384de0fc59SLuiz Augusto von Dentz } __packed;
21394de0fc59SLuiz Augusto von Dentz 
21404de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS			0x2066
21414de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis {
21424de0fc59SLuiz Augusto von Dentz 	__le16  handle;
21434de0fc59SLuiz Augusto von Dentz } __packed;
21444de0fc59SLuiz Augusto von Dentz 
21454de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS			0x2067
21464de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis {
21474de0fc59SLuiz Augusto von Dentz 	__le16  handle;
21484de0fc59SLuiz Augusto von Dentz 	__u8    reason;
21494de0fc59SLuiz Augusto von Dentz } __packed;
21504de0fc59SLuiz Augusto von Dentz 
2151eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_BIG			0x2068
2152eca0ae4aSLuiz Augusto von Dentz struct hci_bis {
2153eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2154eca0ae4aSLuiz Augusto von Dentz 	__le16  sdu;
2155eca0ae4aSLuiz Augusto von Dentz 	__le16  latency;
2156eca0ae4aSLuiz Augusto von Dentz 	__u8    rtn;
2157eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2158eca0ae4aSLuiz Augusto von Dentz 	__u8    packing;
2159eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2160eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2161eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2162eca0ae4aSLuiz Augusto von Dentz } __packed;
2163eca0ae4aSLuiz Augusto von Dentz 
2164eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_create_big {
2165eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2166eca0ae4aSLuiz Augusto von Dentz 	__u8    adv_handle;
2167eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2168eca0ae4aSLuiz Augusto von Dentz 	struct hci_bis bis;
2169eca0ae4aSLuiz Augusto von Dentz } __packed;
2170eca0ae4aSLuiz Augusto von Dentz 
2171eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_TERM_BIG			0x206a
2172eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_term_big {
2173eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2174eca0ae4aSLuiz Augusto von Dentz 	__u8    reason;
2175eca0ae4aSLuiz Augusto von Dentz } __packed;
2176eca0ae4aSLuiz Augusto von Dentz 
2177eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_CREATE_SYNC		0x206b
2178eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_create_sync {
2179eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2180eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2181eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2182eca0ae4aSLuiz Augusto von Dentz 	__u8    bcode[16];
2183eca0ae4aSLuiz Augusto von Dentz 	__u8    mse;
2184eca0ae4aSLuiz Augusto von Dentz 	__le16  timeout;
2185eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2186969cf3e6SGustavo A. R. Silva 	__u8    bis[];
2187eca0ae4aSLuiz Augusto von Dentz } __packed;
2188eca0ae4aSLuiz Augusto von Dentz 
2189eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_TERM_SYNC			0x206c
2190eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_term_sync {
2191eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2192eca0ae4aSLuiz Augusto von Dentz } __packed;
2193eca0ae4aSLuiz Augusto von Dentz 
219426afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SETUP_ISO_PATH		0x206e
219526afbd82SLuiz Augusto von Dentz struct hci_cp_le_setup_iso_path {
219626afbd82SLuiz Augusto von Dentz 	__le16  handle;
219726afbd82SLuiz Augusto von Dentz 	__u8    direction;
219826afbd82SLuiz Augusto von Dentz 	__u8    path;
219926afbd82SLuiz Augusto von Dentz 	__u8    codec;
220026afbd82SLuiz Augusto von Dentz 	__le16  codec_cid;
220126afbd82SLuiz Augusto von Dentz 	__le16  codec_vid;
220226afbd82SLuiz Augusto von Dentz 	__u8    delay[3];
220326afbd82SLuiz Augusto von Dentz 	__u8    codec_cfg_len;
2204969cf3e6SGustavo A. R. Silva 	__u8    codec_cfg[];
220526afbd82SLuiz Augusto von Dentz } __packed;
220626afbd82SLuiz Augusto von Dentz 
220726afbd82SLuiz Augusto von Dentz struct hci_rp_le_setup_iso_path {
220826afbd82SLuiz Augusto von Dentz 	__u8    status;
220926afbd82SLuiz Augusto von Dentz 	__le16  handle;
221026afbd82SLuiz Augusto von Dentz } __packed;
221126afbd82SLuiz Augusto von Dentz 
221226afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SET_HOST_FEATURE		0x2074
221326afbd82SLuiz Augusto von Dentz struct hci_cp_le_set_host_feature {
221426afbd82SLuiz Augusto von Dentz 	__u8     bit_number;
221526afbd82SLuiz Augusto von Dentz 	__u8     bit_value;
221626afbd82SLuiz Augusto von Dentz } __packed;
221726afbd82SLuiz Augusto von Dentz 
22181da177e4SLinus Torvalds /* ---- HCI Events ---- */
2219ae61a10dSLuiz Augusto von Dentz struct hci_ev_status {
2220ae61a10dSLuiz Augusto von Dentz 	__u8    status;
2221ae61a10dSLuiz Augusto von Dentz } __packed;
2222ae61a10dSLuiz Augusto von Dentz 
22231da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE		0x01
22241da177e4SLinus Torvalds 
22251da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT		0x02
22261da177e4SLinus Torvalds struct inquiry_info {
22271da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22281da177e4SLinus Torvalds 	__u8     pscan_rep_mode;
22291da177e4SLinus Torvalds 	__u8     pscan_period_mode;
22301da177e4SLinus Torvalds 	__u8     pscan_mode;
22311da177e4SLinus Torvalds 	__u8     dev_class[3];
22321ebb9252SMarcel Holtmann 	__le16   clock_offset;
223366c853ccSGustavo F. Padovan } __packed;
22341da177e4SLinus Torvalds 
223527d9eb4bSLuiz Augusto von Dentz struct hci_ev_inquiry_result {
223627d9eb4bSLuiz Augusto von Dentz 	__u8    num;
223727d9eb4bSLuiz Augusto von Dentz 	struct inquiry_info info[];
223827d9eb4bSLuiz Augusto von Dentz };
223927d9eb4bSLuiz Augusto von Dentz 
22401da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE		0x03
22411da177e4SLinus Torvalds struct hci_ev_conn_complete {
22421da177e4SLinus Torvalds 	__u8     status;
22431ebb9252SMarcel Holtmann 	__le16   handle;
22441da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22451da177e4SLinus Torvalds 	__u8     link_type;
22461da177e4SLinus Torvalds 	__u8     encr_mode;
224766c853ccSGustavo F. Padovan } __packed;
22481da177e4SLinus Torvalds 
22491da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST		0x04
22501da177e4SLinus Torvalds struct hci_ev_conn_request {
22511da177e4SLinus Torvalds 	bdaddr_t bdaddr;
22521da177e4SLinus Torvalds 	__u8     dev_class[3];
22531da177e4SLinus Torvalds 	__u8     link_type;
225466c853ccSGustavo F. Padovan } __packed;
22551da177e4SLinus Torvalds 
22561da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE		0x05
22571da177e4SLinus Torvalds struct hci_ev_disconn_complete {
22581da177e4SLinus Torvalds 	__u8     status;
22591ebb9252SMarcel Holtmann 	__le16   handle;
22601da177e4SLinus Torvalds 	__u8     reason;
226166c853ccSGustavo F. Padovan } __packed;
22621da177e4SLinus Torvalds 
22631da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE		0x06
22641da177e4SLinus Torvalds struct hci_ev_auth_complete {
22651da177e4SLinus Torvalds 	__u8     status;
22661ebb9252SMarcel Holtmann 	__le16   handle;
226766c853ccSGustavo F. Padovan } __packed;
22681da177e4SLinus Torvalds 
2269a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME		0x07
2270a9de9248SMarcel Holtmann struct hci_ev_remote_name {
2271a9de9248SMarcel Holtmann 	__u8     status;
2272a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
22731f6c6378SJohan Hedberg 	__u8     name[HCI_MAX_NAME_LENGTH];
227466c853ccSGustavo F. Padovan } __packed;
2275a9de9248SMarcel Holtmann 
22761da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE		0x08
22771da177e4SLinus Torvalds struct hci_ev_encrypt_change {
22781da177e4SLinus Torvalds 	__u8     status;
22791ebb9252SMarcel Holtmann 	__le16   handle;
22801da177e4SLinus Torvalds 	__u8     encrypt;
228166c853ccSGustavo F. Padovan } __packed;
22821da177e4SLinus Torvalds 
2283a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE	0x09
2284a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
22851da177e4SLinus Torvalds 	__u8     status;
22861ebb9252SMarcel Holtmann 	__le16   handle;
228766c853ccSGustavo F. Padovan } __packed;
22881da177e4SLinus Torvalds 
2289a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES		0x0b
2290a9de9248SMarcel Holtmann struct hci_ev_remote_features {
2291a9de9248SMarcel Holtmann 	__u8     status;
2292a9de9248SMarcel Holtmann 	__le16   handle;
2293a9de9248SMarcel Holtmann 	__u8     features[8];
229466c853ccSGustavo F. Padovan } __packed;
2295a9de9248SMarcel Holtmann 
2296a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION		0x0c
2297a9de9248SMarcel Holtmann struct hci_ev_remote_version {
2298a9de9248SMarcel Holtmann 	__u8     status;
2299a9de9248SMarcel Holtmann 	__le16   handle;
2300a9de9248SMarcel Holtmann 	__u8     lmp_ver;
2301a9de9248SMarcel Holtmann 	__le16   manufacturer;
2302a9de9248SMarcel Holtmann 	__le16   lmp_subver;
230366c853ccSGustavo F. Padovan } __packed;
2304a9de9248SMarcel Holtmann 
2305a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE	0x0d
23061da177e4SLinus Torvalds struct hci_qos {
23071da177e4SLinus Torvalds 	__u8     service_type;
23081da177e4SLinus Torvalds 	__u32    token_rate;
23091da177e4SLinus Torvalds 	__u32    peak_bandwidth;
23101da177e4SLinus Torvalds 	__u32    latency;
23111da177e4SLinus Torvalds 	__u32    delay_variation;
231266c853ccSGustavo F. Padovan } __packed;
23131da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
23141da177e4SLinus Torvalds 	__u8     status;
23151ebb9252SMarcel Holtmann 	__le16   handle;
23161da177e4SLinus Torvalds 	struct   hci_qos qos;
231766c853ccSGustavo F. Padovan } __packed;
23181da177e4SLinus Torvalds 
2319a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE		0x0e
23201da177e4SLinus Torvalds struct hci_ev_cmd_complete {
23211da177e4SLinus Torvalds 	__u8     ncmd;
23221ebb9252SMarcel Holtmann 	__le16   opcode;
232366c853ccSGustavo F. Padovan } __packed;
23241da177e4SLinus Torvalds 
2325a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS		0x0f
23261da177e4SLinus Torvalds struct hci_ev_cmd_status {
23271da177e4SLinus Torvalds 	__u8     status;
23281da177e4SLinus Torvalds 	__u8     ncmd;
23291ebb9252SMarcel Holtmann 	__le16   opcode;
233066c853ccSGustavo F. Padovan } __packed;
23311da177e4SLinus Torvalds 
233224dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR		0x10
233324dfa343SMarcel Holtmann struct hci_ev_hardware_error {
233424dfa343SMarcel Holtmann 	__u8     code;
233524dfa343SMarcel Holtmann } __packed;
233624dfa343SMarcel Holtmann 
23371da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE		0x12
23381da177e4SLinus Torvalds struct hci_ev_role_change {
23391da177e4SLinus Torvalds 	__u8     status;
23401da177e4SLinus Torvalds 	bdaddr_t bdaddr;
23411da177e4SLinus Torvalds 	__u8     role;
234266c853ccSGustavo F. Padovan } __packed;
23431da177e4SLinus Torvalds 
2344a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS		0x13
2345613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
2346613a1c0cSAndrei Emeltchenko 	__le16   handle;
2347613a1c0cSAndrei Emeltchenko 	__le16   count;
2348613a1c0cSAndrei Emeltchenko } __packed;
2349613a1c0cSAndrei Emeltchenko 
2350a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
2351aadc3d2fSLuiz Augusto von Dentz 	__u8     num;
2352a7e45454SGustavo A. R. Silva 	struct hci_comp_pkts_info handles[];
235366c853ccSGustavo F. Padovan } __packed;
2354a9de9248SMarcel Holtmann 
23551da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE		0x14
23561da177e4SLinus Torvalds struct hci_ev_mode_change {
23571da177e4SLinus Torvalds 	__u8     status;
23581ebb9252SMarcel Holtmann 	__le16   handle;
23591da177e4SLinus Torvalds 	__u8     mode;
23601ebb9252SMarcel Holtmann 	__le16   interval;
236166c853ccSGustavo F. Padovan } __packed;
23621da177e4SLinus Torvalds 
23631da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ		0x16
23641da177e4SLinus Torvalds struct hci_ev_pin_code_req {
23651da177e4SLinus Torvalds 	bdaddr_t bdaddr;
236666c853ccSGustavo F. Padovan } __packed;
23671da177e4SLinus Torvalds 
23681da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ		0x17
23691da177e4SLinus Torvalds struct hci_ev_link_key_req {
23701da177e4SLinus Torvalds 	bdaddr_t bdaddr;
237166c853ccSGustavo F. Padovan } __packed;
23721da177e4SLinus Torvalds 
23731da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY		0x18
23741da177e4SLinus Torvalds struct hci_ev_link_key_notify {
23751da177e4SLinus Torvalds 	bdaddr_t bdaddr;
23769b3b4460SAndrei Emeltchenko 	__u8     link_key[HCI_LINK_KEY_SIZE];
23771da177e4SLinus Torvalds 	__u8     key_type;
237866c853ccSGustavo F. Padovan } __packed;
23791da177e4SLinus Torvalds 
2380a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET		0x1c
23811da177e4SLinus Torvalds struct hci_ev_clock_offset {
23821da177e4SLinus Torvalds 	__u8     status;
23831ebb9252SMarcel Holtmann 	__le16   handle;
23841ebb9252SMarcel Holtmann 	__le16   clock_offset;
238566c853ccSGustavo F. Padovan } __packed;
23861da177e4SLinus Torvalds 
2387a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE		0x1d
2388a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
2389a8746417SMarcel Holtmann 	__u8     status;
2390a8746417SMarcel Holtmann 	__le16   handle;
2391a8746417SMarcel Holtmann 	__le16   pkt_type;
239266c853ccSGustavo F. Padovan } __packed;
2393a8746417SMarcel Holtmann 
239485a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE		0x20
239585a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
239685a1e930SMarcel Holtmann 	bdaddr_t bdaddr;
239785a1e930SMarcel Holtmann 	__u8     pscan_rep_mode;
239866c853ccSGustavo F. Padovan } __packed;
239985a1e930SMarcel Holtmann 
2400a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI	0x22
24018d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi {
2402a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2403a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2404a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2405a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2406a9de9248SMarcel Holtmann 	__le16   clock_offset;
2407a9de9248SMarcel Holtmann 	__s8     rssi;
240866c853ccSGustavo F. Padovan } __packed;
24098d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi_pscan {
2410a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2411a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2412a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2413a9de9248SMarcel Holtmann 	__u8     pscan_mode;
2414a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2415a9de9248SMarcel Holtmann 	__le16   clock_offset;
2416a9de9248SMarcel Holtmann 	__s8     rssi;
241766c853ccSGustavo F. Padovan } __packed;
24188d08d324SLuiz Augusto von Dentz struct hci_ev_inquiry_result_rssi {
24198d08d324SLuiz Augusto von Dentz 	__u8     num;
242072279d17SLuiz Augusto von Dentz 	__u8     data[];
24218d08d324SLuiz Augusto von Dentz } __packed;
2422a9de9248SMarcel Holtmann 
2423a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES	0x23
2424a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
2425a9de9248SMarcel Holtmann 	__u8     status;
2426a9de9248SMarcel Holtmann 	__le16   handle;
2427a9de9248SMarcel Holtmann 	__u8     page;
2428a9de9248SMarcel Holtmann 	__u8     max_page;
2429a9de9248SMarcel Holtmann 	__u8     features[8];
243066c853ccSGustavo F. Padovan } __packed;
2431a9de9248SMarcel Holtmann 
2432a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE	0x2c
2433a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
2434a9de9248SMarcel Holtmann 	__u8     status;
2435a9de9248SMarcel Holtmann 	__le16   handle;
2436a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2437a9de9248SMarcel Holtmann 	__u8     link_type;
2438a9de9248SMarcel Holtmann 	__u8     tx_interval;
2439a9de9248SMarcel Holtmann 	__u8     retrans_window;
2440a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2441a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
2442a9de9248SMarcel Holtmann 	__u8     air_mode;
244366c853ccSGustavo F. Padovan } __packed;
2444a9de9248SMarcel Holtmann 
2445a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED	0x2d
2446a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
2447a9de9248SMarcel Holtmann 	__u8     status;
2448a9de9248SMarcel Holtmann 	__le16   handle;
2449a9de9248SMarcel Holtmann 	__u8     tx_interval;
2450a9de9248SMarcel Holtmann 	__u8     retrans_window;
2451a9de9248SMarcel Holtmann 	__le16   rx_pkt_len;
2452a9de9248SMarcel Holtmann 	__le16   tx_pkt_len;
245366c853ccSGustavo F. Padovan } __packed;
2454a9de9248SMarcel Holtmann 
2455a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE		0x2e
245604837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
245704837f64SMarcel Holtmann 	__u8     status;
245804837f64SMarcel Holtmann 	__le16   handle;
245904837f64SMarcel Holtmann 	__le16   max_tx_latency;
246004837f64SMarcel Holtmann 	__le16   max_rx_latency;
246104837f64SMarcel Holtmann 	__le16   max_remote_timeout;
246204837f64SMarcel Holtmann 	__le16   max_local_timeout;
246366c853ccSGustavo F. Padovan } __packed;
246404837f64SMarcel Holtmann 
2465a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT	0x2f
2466a9de9248SMarcel Holtmann struct extended_inquiry_info {
2467a9de9248SMarcel Holtmann 	bdaddr_t bdaddr;
2468a9de9248SMarcel Holtmann 	__u8     pscan_rep_mode;
2469a9de9248SMarcel Holtmann 	__u8     pscan_period_mode;
2470a9de9248SMarcel Holtmann 	__u8     dev_class[3];
2471a9de9248SMarcel Holtmann 	__le16   clock_offset;
2472a9de9248SMarcel Holtmann 	__s8     rssi;
2473a9de9248SMarcel Holtmann 	__u8     data[240];
247466c853ccSGustavo F. Padovan } __packed;
2475a9de9248SMarcel Holtmann 
247670a6b8deSLuiz Augusto von Dentz struct hci_ev_ext_inquiry_result {
247770a6b8deSLuiz Augusto von Dentz 	__u8     num;
247870a6b8deSLuiz Augusto von Dentz 	struct extended_inquiry_info info[];
247970a6b8deSLuiz Augusto von Dentz } __packed;
248070a6b8deSLuiz Augusto von Dentz 
24811c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE	0x30
24821c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
24831c2e0041SJohan Hedberg 	__u8	status;
24841c2e0041SJohan Hedberg 	__le16	handle;
24851c2e0041SJohan Hedberg } __packed;
24861c2e0041SJohan Hedberg 
24870493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST		0x31
24880493684eSMarcel Holtmann struct hci_ev_io_capa_request {
24890493684eSMarcel Holtmann 	bdaddr_t bdaddr;
249066c853ccSGustavo F. Padovan } __packed;
24910493684eSMarcel Holtmann 
249203b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY		0x32
249303b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
249403b555e1SJohan Hedberg 	bdaddr_t bdaddr;
249503b555e1SJohan Hedberg 	__u8     capability;
249603b555e1SJohan Hedberg 	__u8     oob_data;
249703b555e1SJohan Hedberg 	__u8     authentication;
249803b555e1SJohan Hedberg } __packed;
249903b555e1SJohan Hedberg 
2500a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST	0x33
2501a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
2502a5c29683SJohan Hedberg 	bdaddr_t	bdaddr;
2503a5c29683SJohan Hedberg 	__le32		passkey;
2504a5c29683SJohan Hedberg } __packed;
2505a5c29683SJohan Hedberg 
25069ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST	0x34
25079ad4019aSBrian Gix struct hci_ev_user_passkey_req {
25089ad4019aSBrian Gix 	bdaddr_t	bdaddr;
25099ad4019aSBrian Gix } __packed;
25109ad4019aSBrian Gix 
25112763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST	0x35
25122763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
25132763eda6SSzymon Janc 	bdaddr_t bdaddr;
25142763eda6SSzymon Janc } __packed;
25152763eda6SSzymon Janc 
25160493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE	0x36
25170493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
25180493684eSMarcel Holtmann 	__u8     status;
25190493684eSMarcel Holtmann 	bdaddr_t bdaddr;
252066c853ccSGustavo F. Padovan } __packed;
25210493684eSMarcel Holtmann 
252292a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY	0x3b
252392a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
252492a25256SJohan Hedberg 	bdaddr_t	bdaddr;
252592a25256SJohan Hedberg 	__le32		passkey;
252692a25256SJohan Hedberg } __packed;
252792a25256SJohan Hedberg 
252892a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED		0
252992a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED		1
253092a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED		2
253192a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED		3
253292a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED		4
253392a25256SJohan Hedberg 
253492a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY		0x3c
253592a25256SJohan Hedberg struct hci_ev_keypress_notify {
253692a25256SJohan Hedberg 	bdaddr_t	bdaddr;
253792a25256SJohan Hedberg 	__u8		type;
253892a25256SJohan Hedberg } __packed;
253992a25256SJohan Hedberg 
254041a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES	0x3d
254141a96212SMarcel Holtmann struct hci_ev_remote_host_features {
254241a96212SMarcel Holtmann 	bdaddr_t bdaddr;
254341a96212SMarcel Holtmann 	__u8     features[8];
254466c853ccSGustavo F. Padovan } __packed;
254541a96212SMarcel Holtmann 
254663185f64SVille Tervo #define HCI_EV_LE_META			0x3e
254763185f64SVille Tervo struct hci_ev_le_meta {
254863185f64SVille Tervo 	__u8     subevent;
254963185f64SVille Tervo } __packed;
255063185f64SVille Tervo 
2551523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE	0x40
2552523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
2553523e93cdSAndrei Emeltchenko 	__u8     status;
2554523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2555523e93cdSAndrei Emeltchenko } __packed;
2556523e93cdSAndrei Emeltchenko 
2557523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED		0x41
2558523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
2559523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2560523e93cdSAndrei Emeltchenko } __packed;
2561523e93cdSAndrei Emeltchenko 
2562523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE	0x42
2563523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2564523e93cdSAndrei Emeltchenko 	__u8     status;
2565523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2566523e93cdSAndrei Emeltchenko 	__u8     reason;
2567523e93cdSAndrei Emeltchenko } __packed;
2568523e93cdSAndrei Emeltchenko 
2569523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE		0x45
2570523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2571523e93cdSAndrei Emeltchenko 	__u8     status;
2572523e93cdSAndrei Emeltchenko 	__le16   handle;
2573523e93cdSAndrei Emeltchenko 	__u8     phy_handle;
2574523e93cdSAndrei Emeltchenko 	__u8     flow_spec_id;
2575523e93cdSAndrei Emeltchenko } __packed;
2576523e93cdSAndrei Emeltchenko 
2577523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE	0x46
2578523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2579523e93cdSAndrei Emeltchenko 	__u8     status;
2580523e93cdSAndrei Emeltchenko 	__le16   handle;
2581523e93cdSAndrei Emeltchenko 	__u8     reason;
2582523e93cdSAndrei Emeltchenko } __packed;
2583523e93cdSAndrei Emeltchenko 
258425e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS		0x48
258525e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
258625e89e99SAndrei Emeltchenko 	__le16   handle;
258725e89e99SAndrei Emeltchenko 	__le16   pkts;
258825e89e99SAndrei Emeltchenko 	__le16   blocks;
258925e89e99SAndrei Emeltchenko } __packed;
259025e89e99SAndrei Emeltchenko 
259125e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
259225e89e99SAndrei Emeltchenko 	__le16   num_blocks;
259325e89e99SAndrei Emeltchenko 	__u8     num_hndl;
2594a7e45454SGustavo A. R. Silva 	struct hci_comp_blocks_info handles[];
259525e89e99SAndrei Emeltchenko } __packed;
259625e89e99SAndrei Emeltchenko 
25972b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE	0x4F
25982b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
25992b359445SDoHyun Pyun 	__u8	status;
26002b359445SDoHyun Pyun } __packed;
26012b359445SDoHyun Pyun 
260276c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT	0x54
26032ed01805SDoHyun Pyun 
260463185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE		0x01
260563185f64SVille Tervo struct hci_ev_le_conn_complete {
260663185f64SVille Tervo 	__u8     status;
260763185f64SVille Tervo 	__le16   handle;
260863185f64SVille Tervo 	__u8     role;
260963185f64SVille Tervo 	__u8     bdaddr_type;
261063185f64SVille Tervo 	bdaddr_t bdaddr;
261163185f64SVille Tervo 	__le16   interval;
261263185f64SVille Tervo 	__le16   latency;
261363185f64SVille Tervo 	__le16   supervision_timeout;
261463185f64SVille Tervo 	__u8     clk_accurancy;
261563185f64SVille Tervo } __packed;
261663185f64SVille Tervo 
26172331fd46SMarcel Holtmann /* Advertising report event types */
26182331fd46SMarcel Holtmann #define LE_ADV_IND		0x00
26192331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND	0x01
26202331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND		0x02
26212331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND	0x03
26222331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP		0x04
2623c215e939SJaganath Kanakkassery #define LE_ADV_INVALID		0x05
2624c215e939SJaganath Kanakkassery 
2625c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2626c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND		0x0013
2627c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 	0x0015
2628c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND		0x0012
2629c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND		0x0010
2630c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV		0x001b
2631c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN	0x001a
26322331fd46SMarcel Holtmann 
2633b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2634b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND		0x0000
2635b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND		0x0001
2636b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND		0x0002
2637b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND		0x0004
2638b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP		0x0008
2639b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU		0x0010
2640ad38e55eSSven Peter #define LE_EXT_ADV_EVT_TYPE_MASK	0x007f
2641b2cc9761SJaganath Kanakkassery 
26422331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC		0x00
26432331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM		0x01
26446540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED	0x02
26456540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED	0x03
26462331fd46SMarcel Holtmann 
26472331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT	0x02
26482331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
264947afe93cSLuiz Augusto von Dentz 	__u8	 type;
26502331fd46SMarcel Holtmann 	__u8	 bdaddr_type;
26512331fd46SMarcel Holtmann 	bdaddr_t bdaddr;
26522331fd46SMarcel Holtmann 	__u8	 length;
2653a7e45454SGustavo A. R. Silva 	__u8	 data[];
26542331fd46SMarcel Holtmann } __packed;
26552331fd46SMarcel Holtmann 
265647afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_report {
265747afe93cSLuiz Augusto von Dentz 	__u8    num;
265847afe93cSLuiz Augusto von Dentz 	struct hci_ev_le_advertising_info info[];
265947afe93cSLuiz Augusto von Dentz } __packed;
266047afe93cSLuiz Augusto von Dentz 
26611855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE	0x03
26621855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
26631855d92dSMarcel Holtmann 	__u8     status;
26641855d92dSMarcel Holtmann 	__le16   handle;
26651855d92dSMarcel Holtmann 	__le16   interval;
26661855d92dSMarcel Holtmann 	__le16   latency;
26671855d92dSMarcel Holtmann 	__le16   supervision_timeout;
26681855d92dSMarcel Holtmann } __packed;
26691855d92dSMarcel Holtmann 
26700fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE	0x04
26710fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
26720fe29fd1SMarcel Holtmann 	__u8     status;
26730fe29fd1SMarcel Holtmann 	__le16   handle;
26740fe29fd1SMarcel Holtmann 	__u8     features[8];
26750fe29fd1SMarcel Holtmann } __packed;
26760fe29fd1SMarcel Holtmann 
2677a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ		0x05
2678a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2679a7a595f6SVinicius Costa Gomes 	__le16	handle;
2680fe39c7b2SMarcel Holtmann 	__le64	rand;
2681a7a595f6SVinicius Costa Gomes 	__le16	ediv;
2682a7a595f6SVinicius Costa Gomes } __packed;
2683a7a595f6SVinicius Costa Gomes 
26848e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ	0x06
26858e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
26868e75b46aSAndre Guedes 	__le16 handle;
26878e75b46aSAndre Guedes 	__le16 interval_min;
26888e75b46aSAndre Guedes 	__le16 interval_max;
26898e75b46aSAndre Guedes 	__le16 latency;
26908e75b46aSAndre Guedes 	__le16 timeout;
26918e75b46aSAndre Guedes } __packed;
26928e75b46aSAndre Guedes 
269394a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE	0x07
269494a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
269594a3bd02SMarcel Holtmann 	__le16	handle;
269694a3bd02SMarcel Holtmann 	__le16	tx_len;
269794a3bd02SMarcel Holtmann 	__le16	tx_time;
269894a3bd02SMarcel Holtmann 	__le16	rx_len;
269994a3bd02SMarcel Holtmann 	__le16	rx_time;
270094a3bd02SMarcel Holtmann } __packed;
270194a3bd02SMarcel Holtmann 
270232c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT	0x0B
270332c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
2704a3679649SLuiz Augusto von Dentz 	__u8	 type;
270532c9d43fSMarcel Holtmann 	__u8	 bdaddr_type;
270632c9d43fSMarcel Holtmann 	bdaddr_t bdaddr;
270732c9d43fSMarcel Holtmann 	__u8	 direct_addr_type;
270832c9d43fSMarcel Holtmann 	bdaddr_t direct_addr;
270932c9d43fSMarcel Holtmann 	__s8	 rssi;
271032c9d43fSMarcel Holtmann } __packed;
271132c9d43fSMarcel Holtmann 
2712a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_report {
2713a3679649SLuiz Augusto von Dentz 	__u8	 num;
2714a3679649SLuiz Augusto von Dentz 	struct hci_ev_le_direct_adv_info info[];
2715a3679649SLuiz Augusto von Dentz } __packed;
2716a3679649SLuiz Augusto von Dentz 
27171efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE	0x0c
27181efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete {
27191efd927dSLuiz Augusto von Dentz 	__u8  status;
27204de0fc59SLuiz Augusto von Dentz 	__le16 handle;
27211efd927dSLuiz Augusto von Dentz 	__u8  tx_phy;
27221efd927dSLuiz Augusto von Dentz 	__u8  rx_phy;
27231efd927dSLuiz Augusto von Dentz } __packed;
27241efd927dSLuiz Augusto von Dentz 
2725c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT    0x0d
2726b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info {
2727b48b833fSLuiz Augusto von Dentz 	__le16   type;
2728c215e939SJaganath Kanakkassery 	__u8	 bdaddr_type;
2729c215e939SJaganath Kanakkassery 	bdaddr_t bdaddr;
2730c215e939SJaganath Kanakkassery 	__u8	 primary_phy;
2731c215e939SJaganath Kanakkassery 	__u8	 secondary_phy;
2732c215e939SJaganath Kanakkassery 	__u8	 sid;
2733c215e939SJaganath Kanakkassery 	__u8	 tx_power;
2734c215e939SJaganath Kanakkassery 	__s8	 rssi;
2735c215e939SJaganath Kanakkassery 	__le16   interval;
2736c215e939SJaganath Kanakkassery 	__u8     direct_addr_type;
2737c215e939SJaganath Kanakkassery 	bdaddr_t direct_addr;
2738c215e939SJaganath Kanakkassery 	__u8     length;
2739a7e45454SGustavo A. R. Silva 	__u8     data[];
2740c215e939SJaganath Kanakkassery } __packed;
2741c215e939SJaganath Kanakkassery 
2742b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_report {
2743b48b833fSLuiz Augusto von Dentz 	__u8     num;
2744b48b833fSLuiz Augusto von Dentz 	struct hci_ev_le_ext_adv_info info[];
2745b48b833fSLuiz Augusto von Dentz } __packed;
2746b48b833fSLuiz Augusto von Dentz 
2747eca0ae4aSLuiz Augusto von Dentz #define HCI_EV_LE_PA_SYNC_ESTABLISHED	0x0e
2748eca0ae4aSLuiz Augusto von Dentz struct hci_ev_le_pa_sync_established {
2749eca0ae4aSLuiz Augusto von Dentz 	__u8      status;
2750eca0ae4aSLuiz Augusto von Dentz 	__le16    handle;
2751eca0ae4aSLuiz Augusto von Dentz 	__u8      sid;
2752eca0ae4aSLuiz Augusto von Dentz 	__u8      bdaddr_type;
2753eca0ae4aSLuiz Augusto von Dentz 	bdaddr_t  bdaddr;
2754eca0ae4aSLuiz Augusto von Dentz 	__u8      phy;
2755eca0ae4aSLuiz Augusto von Dentz 	__le16    interval;
2756eca0ae4aSLuiz Augusto von Dentz 	__u8      clock_accuracy;
2757eca0ae4aSLuiz Augusto von Dentz } __packed;
2758eca0ae4aSLuiz Augusto von Dentz 
27594d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE    0x0a
27604d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
27614d94f95dSJaganath Kanakkassery 	__u8      status;
27624d94f95dSJaganath Kanakkassery 	__le16    handle;
27634d94f95dSJaganath Kanakkassery 	__u8      role;
27644d94f95dSJaganath Kanakkassery 	__u8      bdaddr_type;
27654d94f95dSJaganath Kanakkassery 	bdaddr_t  bdaddr;
27664d94f95dSJaganath Kanakkassery 	bdaddr_t  local_rpa;
27674d94f95dSJaganath Kanakkassery 	bdaddr_t  peer_rpa;
27684d94f95dSJaganath Kanakkassery 	__le16    interval;
27694d94f95dSJaganath Kanakkassery 	__le16    latency;
27704d94f95dSJaganath Kanakkassery 	__le16    supervision_timeout;
27714d94f95dSJaganath Kanakkassery 	__u8      clk_accurancy;
27724d94f95dSJaganath Kanakkassery } __packed;
27734d94f95dSJaganath Kanakkassery 
2774acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM	0x12
2775acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2776acf0aeaeSJaganath Kanakkassery 	__u8	status;
2777acf0aeaeSJaganath Kanakkassery 	__u8	handle;
2778acf0aeaeSJaganath Kanakkassery 	__le16	conn_handle;
2779acf0aeaeSJaganath Kanakkassery 	__u8	num_evts;
2780acf0aeaeSJaganath Kanakkassery } __packed;
2781acf0aeaeSJaganath Kanakkassery 
27824de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED	0x19
27834de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established {
27844de0fc59SLuiz Augusto von Dentz 	__u8  status;
27854de0fc59SLuiz Augusto von Dentz 	__le16 handle;
27864de0fc59SLuiz Augusto von Dentz 	__u8  cig_sync_delay[3];
27874de0fc59SLuiz Augusto von Dentz 	__u8  cis_sync_delay[3];
278876c185a5SArchie Pusaka 	__u8  c_latency[3];
278976c185a5SArchie Pusaka 	__u8  p_latency[3];
279076c185a5SArchie Pusaka 	__u8  c_phy;
279176c185a5SArchie Pusaka 	__u8  p_phy;
27924de0fc59SLuiz Augusto von Dentz 	__u8  nse;
279376c185a5SArchie Pusaka 	__u8  c_bn;
279476c185a5SArchie Pusaka 	__u8  p_bn;
279576c185a5SArchie Pusaka 	__u8  c_ft;
279676c185a5SArchie Pusaka 	__u8  p_ft;
279776c185a5SArchie Pusaka 	__le16 c_mtu;
279876c185a5SArchie Pusaka 	__le16 p_mtu;
27994de0fc59SLuiz Augusto von Dentz 	__le16 interval;
28004de0fc59SLuiz Augusto von Dentz } __packed;
28014de0fc59SLuiz Augusto von Dentz 
28024de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ		0x1a
28034de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req {
28044de0fc59SLuiz Augusto von Dentz 	__le16 acl_handle;
28054de0fc59SLuiz Augusto von Dentz 	__le16 cis_handle;
28064de0fc59SLuiz Augusto von Dentz 	__u8  cig_id;
28074de0fc59SLuiz Augusto von Dentz 	__u8  cis_id;
28084de0fc59SLuiz Augusto von Dentz } __packed;
28094de0fc59SLuiz Augusto von Dentz 
2810eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_CREATE_BIG_COMPLETE	0x1b
2811eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_create_big_complete {
2812eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2813eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2814eca0ae4aSLuiz Augusto von Dentz 	__u8    sync_delay[3];
2815eca0ae4aSLuiz Augusto von Dentz 	__u8    transport_delay[3];
2816eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2817eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2818eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2819eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2820eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2821eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2822eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2823eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2824eca0ae4aSLuiz Augusto von Dentz 	__le16  bis_handle[];
2825eca0ae4aSLuiz Augusto von Dentz } __packed;
2826eca0ae4aSLuiz Augusto von Dentz 
2827eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_SYNC_ESTABILISHED 0x1d
2828eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_sync_estabilished {
2829eca0ae4aSLuiz Augusto von Dentz 	__u8    status;
2830eca0ae4aSLuiz Augusto von Dentz 	__u8    handle;
2831eca0ae4aSLuiz Augusto von Dentz 	__u8    latency[3];
2832eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2833eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2834eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2835eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2836eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2837eca0ae4aSLuiz Augusto von Dentz 	__le16  interval;
2838eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2839eca0ae4aSLuiz Augusto von Dentz 	__le16  bis[];
2840eca0ae4aSLuiz Augusto von Dentz } __packed;
2841eca0ae4aSLuiz Augusto von Dentz 
2842eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_INFO_ADV_REPORT	0x22
2843eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_info_adv_report {
2844eca0ae4aSLuiz Augusto von Dentz 	__le16  sync_handle;
2845eca0ae4aSLuiz Augusto von Dentz 	__u8    num_bis;
2846eca0ae4aSLuiz Augusto von Dentz 	__u8    nse;
2847eca0ae4aSLuiz Augusto von Dentz 	__le16  iso_interval;
2848eca0ae4aSLuiz Augusto von Dentz 	__u8    bn;
2849eca0ae4aSLuiz Augusto von Dentz 	__u8    pto;
2850eca0ae4aSLuiz Augusto von Dentz 	__u8    irc;
2851eca0ae4aSLuiz Augusto von Dentz 	__le16  max_pdu;
2852eca0ae4aSLuiz Augusto von Dentz 	__u8    sdu_interval[3];
2853eca0ae4aSLuiz Augusto von Dentz 	__le16  max_sdu;
2854eca0ae4aSLuiz Augusto von Dentz 	__u8    phy;
2855eca0ae4aSLuiz Augusto von Dentz 	__u8    framing;
2856eca0ae4aSLuiz Augusto von Dentz 	__u8    encryption;
2857eca0ae4aSLuiz Augusto von Dentz } __packed;
2858eca0ae4aSLuiz Augusto von Dentz 
2859e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR			0xff
2860e4cc5a18SMarcel Holtmann 
28611da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2862a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL	0xfd
28631da177e4SLinus Torvalds struct hci_ev_stack_internal {
28641da177e4SLinus Torvalds 	__u16    type;
2865a7e45454SGustavo A. R. Silva 	__u8     data[];
286666c853ccSGustavo F. Padovan } __packed;
28671da177e4SLinus Torvalds 
28681da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE	0x01
28691da177e4SLinus Torvalds struct hci_ev_si_device {
28701da177e4SLinus Torvalds 	__u16    event;
28711da177e4SLinus Torvalds 	__u16    dev_id;
287266c853ccSGustavo F. Padovan } __packed;
28731da177e4SLinus Torvalds 
28741da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY	0x02
28751da177e4SLinus Torvalds struct hci_ev_si_security {
28761da177e4SLinus Torvalds 	__u16    event;
28771da177e4SLinus Torvalds 	__u16    proto;
28781da177e4SLinus Torvalds 	__u16    subproto;
28791da177e4SLinus Torvalds 	__u8     incoming;
288066c853ccSGustavo F. Padovan } __packed;
28811da177e4SLinus Torvalds 
28821da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
28831da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
28841da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE   2
28851da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE     4
28861da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE     3
28874de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE     4
28881da177e4SLinus Torvalds 
28891da177e4SLinus Torvalds struct hci_command_hdr {
28901ebb9252SMarcel Holtmann 	__le16	opcode;		/* OCF & OGF */
28911da177e4SLinus Torvalds 	__u8	plen;
289266c853ccSGustavo F. Padovan } __packed;
28931da177e4SLinus Torvalds 
28941da177e4SLinus Torvalds struct hci_event_hdr {
28951da177e4SLinus Torvalds 	__u8	evt;
28961da177e4SLinus Torvalds 	__u8	plen;
289766c853ccSGustavo F. Padovan } __packed;
28981da177e4SLinus Torvalds 
28991da177e4SLinus Torvalds struct hci_acl_hdr {
29001ebb9252SMarcel Holtmann 	__le16	handle;		/* Handle & Flags(PB, BC) */
29011ebb9252SMarcel Holtmann 	__le16	dlen;
290266c853ccSGustavo F. Padovan } __packed;
29031da177e4SLinus Torvalds 
29041da177e4SLinus Torvalds struct hci_sco_hdr {
29051ebb9252SMarcel Holtmann 	__le16	handle;
29061da177e4SLinus Torvalds 	__u8	dlen;
290766c853ccSGustavo F. Padovan } __packed;
29081da177e4SLinus Torvalds 
29094de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr {
29104de0fc59SLuiz Augusto von Dentz 	__le16	handle;
29114de0fc59SLuiz Augusto von Dentz 	__le16	dlen;
2912a7e45454SGustavo A. R. Silva 	__u8	data[];
29134de0fc59SLuiz Augusto von Dentz } __packed;
29144de0fc59SLuiz Augusto von Dentz 
29154de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */
29164de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID	0x00
29174de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID	0x01
29184de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP	0x02
29194de0fc59SLuiz Augusto von Dentz 
29204de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE	4
29214de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr {
29224de0fc59SLuiz Augusto von Dentz 	__le16	sn;
29234de0fc59SLuiz Augusto von Dentz 	__le16	slen;
29244de0fc59SLuiz Augusto von Dentz };
29254de0fc59SLuiz Augusto von Dentz 
29264de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8
29274de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr {
29284de0fc59SLuiz Augusto von Dentz 	__le32	ts;
29294de0fc59SLuiz Augusto von Dentz 	__le16	sn;
29304de0fc59SLuiz Augusto von Dentz 	__le16	slen;
29314de0fc59SLuiz Augusto von Dentz };
29324de0fc59SLuiz Augusto von Dentz 
29332a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
29342a123b86SArnaldo Carvalho de Melo {
29352a123b86SArnaldo Carvalho de Melo 	return (struct hci_event_hdr *) skb->data;
29362a123b86SArnaldo Carvalho de Melo }
29372a123b86SArnaldo Carvalho de Melo 
29382a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
29392a123b86SArnaldo Carvalho de Melo {
29402a123b86SArnaldo Carvalho de Melo 	return (struct hci_acl_hdr *) skb->data;
29412a123b86SArnaldo Carvalho de Melo }
29422a123b86SArnaldo Carvalho de Melo 
29432a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
29442a123b86SArnaldo Carvalho de Melo {
29452a123b86SArnaldo Carvalho de Melo 	return (struct hci_sco_hdr *) skb->data;
29462a123b86SArnaldo Carvalho de Melo }
29472a123b86SArnaldo Carvalho de Melo 
29481da177e4SLinus Torvalds /* Command opcode pack/unpack */
2949c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf)	((__u16) ((ocf & 0x03ff)|(ogf << 10)))
29501da177e4SLinus Torvalds #define hci_opcode_ogf(op)		(op >> 10)
29511da177e4SLinus Torvalds #define hci_opcode_ocf(op)		(op & 0x03ff)
29521da177e4SLinus Torvalds 
29531da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2954c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f)	((__u16) ((h & 0x0fff)|(f << 12)))
29551da177e4SLinus Torvalds #define hci_handle(h)		(h & 0x0fff)
29561da177e4SLinus Torvalds #define hci_flags(h)		(h >> 12)
29571da177e4SLinus Torvalds 
29584de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */
29594de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f)		(f & 0x0003)
29604de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f)		((f >> 2) & 0x0001)
29614de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts)	((pb & 0x03) | ((ts & 0x01) << 2))
29624de0fc59SLuiz Augusto von Dentz 
29634de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */
29644de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f)	((__u16) ((h) | ((f) << 14)))
29654de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h)		((h) & 0x3fff)
29664de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h)		((h) >> 14)
29674de0fc59SLuiz Augusto von Dentz 
2968248733e8SKiran K /* codec transport types */
2969248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO	0x01
2970248733e8SKiran K 
29715cbd3ebdSAlain Michaud /* le24 support */
29725cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3])
29735cbd3ebdSAlain Michaud {
29745cbd3ebdSAlain Michaud 	dst[0] = val & 0xff;
29755cbd3ebdSAlain Michaud 	dst[1] = (val & 0xff00) >> 8;
29765cbd3ebdSAlain Michaud 	dst[2] = (val & 0xff0000) >> 16;
29775cbd3ebdSAlain Michaud }
29785cbd3ebdSAlain Michaud 
29791da177e4SLinus Torvalds #endif /* __HCI_H */
2980