11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux
31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated
423417475SIulia Tanasescu Copyright 2023 NXP
51da177e4SLinus Torvalds
61da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
71da177e4SLinus Torvalds
81da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify
91da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as
101da177e4SLinus Torvalds published by the Free Software Foundation;
111da177e4SLinus Torvalds
121da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
131da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
141da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
151da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
161da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
171da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
181da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
191da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
201da177e4SLinus Torvalds
211da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
221da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
231da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED.
241da177e4SLinus Torvalds */
251da177e4SLinus Torvalds
261da177e4SLinus Torvalds #ifndef __HCI_H
271da177e4SLinus Torvalds #define __HCI_H
281da177e4SLinus Torvalds
291da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024
301da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255
314de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE 251
321da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260
331da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
341da177e4SLinus Torvalds
359b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16
36903e4541SAndrei Emeltchenko
376397729bSArchie Pusaka #define HCI_MAX_CPB_DATA_SIZE 252
387d1dab49SDoHyun Pyun
391da177e4SLinus Torvalds /* HCI dev events */
401da177e4SLinus Torvalds #define HCI_DEV_REG 1
411da177e4SLinus Torvalds #define HCI_DEV_UNREG 2
421da177e4SLinus Torvalds #define HCI_DEV_UP 3
431da177e4SLinus Torvalds #define HCI_DEV_DOWN 4
441da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5
451da177e4SLinus Torvalds #define HCI_DEV_RESUME 6
464a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7
474a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8
48e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9
491da177e4SLinus Torvalds
501da177e4SLinus Torvalds /* HCI notify events */
511da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1
521da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2
531da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3
541f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_CVSD 4
551f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_TRANSP 5
561f8330eaSSathish Narsimman #define HCI_NOTIFY_DISABLE_SCO 6
571da177e4SLinus Torvalds
58c13854ceSMarcel Holtmann /* HCI bus types */
590ac53939SMarcel Holtmann #define HCI_VIRTUAL 0
601da177e4SLinus Torvalds #define HCI_USB 1
611da177e4SLinus Torvalds #define HCI_PCCARD 2
621da177e4SLinus Torvalds #define HCI_UART 3
631da177e4SLinus Torvalds #define HCI_RS232 4
641da177e4SLinus Torvalds #define HCI_PCI 5
650ac53939SMarcel Holtmann #define HCI_SDIO 6
665c0e03cdSJohan Hedberg #define HCI_SPI 7
675c0e03cdSJohan Hedberg #define HCI_I2C 8
6865010e68SBjorn Andersson #define HCI_SMD 9
69d2a3f5f4SMarcel Holtmann #define HCI_VIRTIO 10
701da177e4SLinus Torvalds
711da177e4SLinus Torvalds /* HCI device quirks */
721da177e4SLinus Torvalds enum {
73118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when
74118305b5SMarcel Holtmann * closing the transport instead of when opening it.
75118305b5SMarcel Holtmann *
76118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called.
77118305b5SMarcel Holtmann */
78a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE,
79118305b5SMarcel Holtmann
80118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only
81118305b5SMarcel Holtmann * device and it will stay in unconfigured state.
82118305b5SMarcel Holtmann *
83118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called.
84118305b5SMarcel Holtmann */
85da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE,
86118305b5SMarcel Holtmann
87118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by
88118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid.
89118305b5SMarcel Holtmann *
90118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called.
91118305b5SMarcel Holtmann */
92f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE,
93118305b5SMarcel Holtmann
94043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not
95043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to
96043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had
97043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing
98043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the
99043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better
100e37c57a8SAlain Michaud * user experience.
101043ec9bfSMarcel Holtmann *
102043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called.
103043ec9bfSMarcel Holtmann */
104043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE,
105043ec9bfSMarcel Holtmann
106711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported
107711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2
108711ffa78SMarcel Holtmann * and later controllers should support this command. However
109711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do
110711ffa78SMarcel Holtmann * not support this command.
111711ffa78SMarcel Holtmann *
112711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called.
113711ffa78SMarcel Holtmann */
114711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS,
115711ffa78SMarcel Holtmann
116118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling
117118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the
118118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but
119118305b5SMarcel Holtmann * not supported.
120118305b5SMarcel Holtmann *
121118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called.
122118305b5SMarcel Holtmann */
123f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY,
12489bc22d2SMarcel Holtmann
125eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step
126eb1904f4SMarcel Holtmann * is required and will be indicated with the controller
127e37c57a8SAlain Michaud * configuration.
128eb1904f4SMarcel Holtmann *
129eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or
130eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback.
131eb1904f4SMarcel Holtmann */
132eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG,
133eb1904f4SMarcel Holtmann
13489bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address
13589bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command
13689bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is
13789bc22d2SMarcel Holtmann * required before this device can be used.
13889bc22d2SMarcel Holtmann *
13989bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or
14089bc22d2SMarcel Holtmann * during the hdev->setup vendor callback.
14189bc22d2SMarcel Holtmann */
14289bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR,
14343d6bc46SMarcel Holtmann
1447a0e5b15SMatthias Kaehlcke /* When this quirk is set, the public Bluetooth address
1457a0e5b15SMatthias Kaehlcke * initially reported by HCI Read BD Address command
1467a0e5b15SMatthias Kaehlcke * is considered invalid. The public BD Address can be
1477a0e5b15SMatthias Kaehlcke * specified in the fwnode property 'local-bd-address'.
1487a0e5b15SMatthias Kaehlcke * If this property does not exist or is invalid controller
1497a0e5b15SMatthias Kaehlcke * configuration is required before this device can be used.
1507a0e5b15SMatthias Kaehlcke *
1517a0e5b15SMatthias Kaehlcke * This quirk can be set before hci_register_dev is called or
1527a0e5b15SMatthias Kaehlcke * during the hdev->setup vendor callback.
1537a0e5b15SMatthias Kaehlcke */
1547a0e5b15SMatthias Kaehlcke HCI_QUIRK_USE_BDADDR_PROPERTY,
1557a0e5b15SMatthias Kaehlcke
15657e089d3SJohan Hovold /* When this quirk is set, the Bluetooth Device Address provided by
15757e089d3SJohan Hovold * the 'local-bd-address' fwnode property is incorrectly specified in
15857e089d3SJohan Hovold * big-endian order.
15957e089d3SJohan Hovold *
16057e089d3SJohan Hovold * This quirk can be set before hci_register_dev is called or
16157e089d3SJohan Hovold * during the hdev->setup vendor callback.
16257e089d3SJohan Hovold */
16357e089d3SJohan Hovold HCI_QUIRK_BDADDR_PROPERTY_BROKEN,
16457e089d3SJohan Hovold
16543d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during
16643d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow
16743d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed.
16843d6bc46SMarcel Holtmann *
16943d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or
17043d6bc46SMarcel Holtmann * during the hdev->setup vendor callback.
17143d6bc46SMarcel Holtmann */
17243d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER,
173695c4cb6SJakub Pawlowski
174695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done
175695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved.
176695c4cb6SJakub Pawlowski *
177695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or
178695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback.
179695c4cb6SJakub Pawlowski */
180695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY,
1817e995b9eSMarcel Holtmann
1827e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is
1837e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller
1847e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed.
1857e995b9eSMarcel Holtmann *
1867e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or
1877e995b9eSMarcel Holtmann * during the hdev->setup vendor callback.
1887e995b9eSMarcel Holtmann */
1897e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG,
190740011cfSSean Wang
191740011cfSSean Wang /* When this quirk is set, setup() would be run after every
192740011cfSSean Wang * open() and not just after the first open().
193740011cfSSean Wang *
194740011cfSSean Wang * This quirk can be set before hci_register_dev is called or
195740011cfSSean Wang * during the hdev->setup vendor callback.
196740011cfSSean Wang *
197740011cfSSean Wang */
198740011cfSSean Wang HCI_QUIRK_NON_PERSISTENT_SETUP,
1994b127bd5SAlain Michaud
2004b127bd5SAlain Michaud /* When this quirk is set, wide band speech is supported by
2014b127bd5SAlain Michaud * the driver since no reliable mechanism exist to report
2024b127bd5SAlain Michaud * this from the hardware, a driver flag is use to convey
2034b127bd5SAlain Michaud * this support
2044b127bd5SAlain Michaud *
2054b127bd5SAlain Michaud * This quirk must be set before hci_register_dev is called.
2064b127bd5SAlain Michaud */
20700bce3fbSAlain Michaud HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
20822091585SAlain Michaud
20922091585SAlain Michaud /* When this quirk is set, the controller has validated that
21022091585SAlain Michaud * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are
21122091585SAlain Michaud * valid. This mechanism is necessary as many controllers have
21222091585SAlain Michaud * been seen has having trouble initiating a connectable
21322091585SAlain Michaud * advertisement despite the state combination being reported as
21422091585SAlain Michaud * supported.
21522091585SAlain Michaud */
21622091585SAlain Michaud HCI_QUIRK_VALID_LE_STATES,
217cde1a8a9SIsmael Ferreras Morezuelas
21842d7731eSIsmael Ferreras Morezuelas /* When this quirk is set, then erroneous data reporting
21942d7731eSIsmael Ferreras Morezuelas * is ignored. This is mainly due to the fact that the HCI
22042d7731eSIsmael Ferreras Morezuelas * Read Default Erroneous Data Reporting command is advertised,
22142d7731eSIsmael Ferreras Morezuelas * but not supported; these controllers often reply with unknown
22242d7731eSIsmael Ferreras Morezuelas * command and tend to lock up randomly. Needing a hard reset.
22342d7731eSIsmael Ferreras Morezuelas *
22442d7731eSIsmael Ferreras Morezuelas * This quirk can be set before hci_register_dev is called or
22542d7731eSIsmael Ferreras Morezuelas * during the hdev->setup vendor callback.
22642d7731eSIsmael Ferreras Morezuelas */
22742d7731eSIsmael Ferreras Morezuelas HCI_QUIRK_BROKEN_ERR_DATA_REPORTING,
22842d7731eSIsmael Ferreras Morezuelas
229219991e6SHans de Goede /*
230219991e6SHans de Goede * When this quirk is set, then the hci_suspend_notifier is not
231219991e6SHans de Goede * registered. This is intended for devices which drop completely
232219991e6SHans de Goede * from the bus on system-suspend and which will show up as a new
233219991e6SHans de Goede * HCI after resume.
234219991e6SHans de Goede */
235219991e6SHans de Goede HCI_QUIRK_NO_SUSPEND_NOTIFIER,
236d2f8114fSAditya Garg
237d2f8114fSAditya Garg /*
238d2f8114fSAditya Garg * When this quirk is set, LE tx power is not queried on startup
239d2f8114fSAditya Garg * and the min/max tx power values default to HCI_TX_POWER_INVALID.
240d2f8114fSAditya Garg *
241d2f8114fSAditya Garg * This quirk can be set before hci_register_dev is called or
242d2f8114fSAditya Garg * during the hdev->setup vendor callback.
243d2f8114fSAditya Garg */
244d2f8114fSAditya Garg HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
2450eaecfb2SIsmael Ferreras Morezuelas
2460eaecfb2SIsmael Ferreras Morezuelas /* When this quirk is set, HCI_OP_SET_EVENT_FLT requests with
2470eaecfb2SIsmael Ferreras Morezuelas * HCI_FLT_CLEAR_ALL are ignored and event filtering is
2480eaecfb2SIsmael Ferreras Morezuelas * completely avoided. A subset of the CSR controller
2490eaecfb2SIsmael Ferreras Morezuelas * clones struggle with this and instantly lock up.
2500eaecfb2SIsmael Ferreras Morezuelas *
2510eaecfb2SIsmael Ferreras Morezuelas * Note that devices using this must (separately) disable
2520eaecfb2SIsmael Ferreras Morezuelas * runtime suspend, because event filtering takes place there.
2530eaecfb2SIsmael Ferreras Morezuelas */
2540eaecfb2SIsmael Ferreras Morezuelas HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL,
25505abad85SLuiz Augusto von Dentz
25605abad85SLuiz Augusto von Dentz /*
25705abad85SLuiz Augusto von Dentz * When this quirk is set, disables the use of
25805abad85SLuiz Augusto von Dentz * HCI_OP_ENHANCED_SETUP_SYNC_CONN command to setup SCO connections.
25905abad85SLuiz Augusto von Dentz *
26005abad85SLuiz Augusto von Dentz * This quirk can be set before hci_register_dev is called or
26105abad85SLuiz Augusto von Dentz * during the hdev->setup vendor callback.
26205abad85SLuiz Augusto von Dentz */
26305abad85SLuiz Augusto von Dentz HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN,
264392fca35SSven Peter
265392fca35SSven Peter /*
266392fca35SSven Peter * When this quirk is set, the HCI_OP_LE_SET_EXT_SCAN_ENABLE command is
267392fca35SSven Peter * disabled. This is required for some Broadcom controllers which
268392fca35SSven Peter * erroneously claim to support extended scanning.
269392fca35SSven Peter *
270392fca35SSven Peter * This quirk can be set before hci_register_dev is called or
271392fca35SSven Peter * during the hdev->setup vendor callback.
272392fca35SSven Peter */
273392fca35SSven Peter HCI_QUIRK_BROKEN_EXT_SCAN,
274ffcb0a44SSven Peter
275ffcb0a44SSven Peter /*
276ffcb0a44SSven Peter * When this quirk is set, the HCI_OP_GET_MWS_TRANSPORT_CONFIG command is
277ffcb0a44SSven Peter * disabled. This is required for some Broadcom controllers which
278ffcb0a44SSven Peter * erroneously claim to support MWS Transport Layer Configuration.
279ffcb0a44SSven Peter *
280ffcb0a44SSven Peter * This quirk can be set before hci_register_dev is called or
281ffcb0a44SSven Peter * during the hdev->setup vendor callback.
282ffcb0a44SSven Peter */
283ffcb0a44SSven Peter HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG,
2848194f1efSVasily Khoruzhick
2858194f1efSVasily Khoruzhick /* When this quirk is set, max_page for local extended features
2868194f1efSVasily Khoruzhick * is set to 1, even if controller reports higher number. Some
2878194f1efSVasily Khoruzhick * controllers (e.g. RTL8723CS) report more pages, but they
2888194f1efSVasily Khoruzhick * don't actually support features declared there.
2898194f1efSVasily Khoruzhick */
2908194f1efSVasily Khoruzhick HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
29191b6d02dSRaul Cheleguini
29291b6d02dSRaul Cheleguini /*
29391b6d02dSRaul Cheleguini * When this quirk is set, the HCI_OP_LE_SET_RPA_TIMEOUT command is
29491b6d02dSRaul Cheleguini * skipped during initialization. This is required for the Actions
29591b6d02dSRaul Cheleguini * Semiconductor ATS2851 based controllers, which erroneously claims
29691b6d02dSRaul Cheleguini * to support it.
29791b6d02dSRaul Cheleguini */
29891b6d02dSRaul Cheleguini HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT,
2999e14606dSHilda Wu
300*5af48b48SDanil Pylaev /*
301*5af48b48SDanil Pylaev * When this quirk is set, the HCI_OP_LE_EXT_CREATE_CONN command is
302*5af48b48SDanil Pylaev * disabled. This is required for the Actions Semiconductor ATS2851
303*5af48b48SDanil Pylaev * based controllers, which erroneously claims to support it.
304*5af48b48SDanil Pylaev */
305*5af48b48SDanil Pylaev HCI_QUIRK_BROKEN_EXT_CREATE_CONN,
306*5af48b48SDanil Pylaev
307*5af48b48SDanil Pylaev /*
308*5af48b48SDanil Pylaev * When this quirk is set, the command WRITE_AUTH_PAYLOAD_TIMEOUT is
309*5af48b48SDanil Pylaev * skipped. This is required for the Actions Semiconductor ATS2851
310*5af48b48SDanil Pylaev * based controllers, due to a race condition in pairing process.
311*5af48b48SDanil Pylaev */
312*5af48b48SDanil Pylaev HCI_QUIRK_BROKEN_WRITE_AUTH_PAYLOAD_TIMEOUT,
313*5af48b48SDanil Pylaev
3149e14606dSHilda Wu /* When this quirk is set, MSFT extension monitor tracking by
3159e14606dSHilda Wu * address filter is supported. Since tracking quantity of each
3169e14606dSHilda Wu * pattern is limited, this feature supports tracking multiple
3179e14606dSHilda Wu * devices concurrently if controller supports multiple
3189e14606dSHilda Wu * address filters.
3199e14606dSHilda Wu *
3209e14606dSHilda Wu * This quirk must be set before hci_register_dev is called.
3219e14606dSHilda Wu */
3229e14606dSHilda Wu HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
323253f3399SLuiz Augusto von Dentz
324253f3399SLuiz Augusto von Dentz /*
325253f3399SLuiz Augusto von Dentz * When this quirk is set, LE Coded PHY shall not be used. This is
326253f3399SLuiz Augusto von Dentz * required for some Intel controllers which erroneously claim to
327253f3399SLuiz Augusto von Dentz * support it but it causes problems with extended scanning.
328253f3399SLuiz Augusto von Dentz *
329253f3399SLuiz Augusto von Dentz * This quirk can be set before hci_register_dev is called or
330253f3399SLuiz Augusto von Dentz * during the hdev->setup vendor callback.
331253f3399SLuiz Augusto von Dentz */
332253f3399SLuiz Augusto von Dentz HCI_QUIRK_BROKEN_LE_CODED,
3338677a14aSVinicius Peixoto
3348677a14aSVinicius Peixoto /*
3358677a14aSVinicius Peixoto * When this quirk is set, the HCI_OP_READ_ENC_KEY_SIZE command is
3368677a14aSVinicius Peixoto * skipped during an HCI_EV_ENCRYPT_CHANGE event. This is required
3378677a14aSVinicius Peixoto * for Actions Semiconductor ATS2851 based controllers, which erroneously
3388677a14aSVinicius Peixoto * claim to support it.
3398677a14aSVinicius Peixoto */
3408677a14aSVinicius Peixoto HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE,
3411da177e4SLinus Torvalds };
3421da177e4SLinus Torvalds
3431da177e4SLinus Torvalds /* HCI device flags */
3441da177e4SLinus Torvalds enum {
3451da177e4SLinus Torvalds HCI_UP,
3461da177e4SLinus Torvalds HCI_INIT,
3471da177e4SLinus Torvalds HCI_RUNNING,
3481da177e4SLinus Torvalds
3491da177e4SLinus Torvalds HCI_PSCAN,
3501da177e4SLinus Torvalds HCI_ISCAN,
3511da177e4SLinus Torvalds HCI_AUTH,
3521da177e4SLinus Torvalds HCI_ENCRYPT,
3531da177e4SLinus Torvalds HCI_INQUIRY,
3541da177e4SLinus Torvalds
3551da177e4SLinus Torvalds HCI_RAW,
356ab81cbf9SJohan Hedberg
35710572132SGustavo F. Padovan HCI_RESET,
3581da177e4SLinus Torvalds };
3591da177e4SLinus Torvalds
360f9207338SMarcel Holtmann /* HCI socket flags */
361f9207338SMarcel Holtmann enum {
36250ebc055SMarcel Holtmann HCI_SOCK_TRUSTED,
363f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS,
364f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS,
365ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS,
366321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS,
3675504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS,
3685504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS,
3695504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS,
3705504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS,
37172000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS,
372a10c907cSMarcel Holtmann HCI_MGMT_EXP_FEATURE_EVENTS,
373f9207338SMarcel Holtmann };
374f9207338SMarcel Holtmann
375d23264a8SAndre Guedes /*
376d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent
377d23264a8SAndre Guedes * states from the controller.
378d23264a8SAndre Guedes */
379d23264a8SAndre Guedes enum {
380a8b2d5c2SJohan Hedberg HCI_SETUP,
381d603b76bSMarcel Holtmann HCI_CONFIG,
382fe2ccc6cSJohan Hovold HCI_DEBUGFS_CREATED,
383a8b2d5c2SJohan Hedberg HCI_AUTO_OFF,
3845e130367SJohan Hedberg HCI_RFKILLED,
385a8b2d5c2SJohan Hedberg HCI_MGMT,
386b6ae8457SJohan Hedberg HCI_BONDABLE,
387a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE,
3880663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS,
3893769972bSJohan Hedberg HCI_USE_DEBUG_KEYS,
39094324962SJohan Hovold HCI_UNREGISTER,
3914a964404SMarcel Holtmann HCI_UNCONFIGURED,
3920736cfa8SMarcel Holtmann HCI_USER_CHANNEL,
393dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED,
39466c417c1SJohan Hedberg HCI_LE_ADV,
395eca0ae4aSLuiz Augusto von Dentz HCI_LE_PER_ADV,
396d23264a8SAndre Guedes HCI_LE_SCAN,
39784bde9d6SJohan Hedberg HCI_SSP_ENABLED,
398e98d2ce2SMarcel Holtmann HCI_SC_ENABLED,
399134c2a89SMarcel Holtmann HCI_SC_ONLY,
400863efaf2SJohan Hedberg HCI_PRIVACY,
40182a37adeSJohan Hedberg HCI_LIMITED_PRIVACY,
402d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED,
40341edf160SJohan Hedberg HCI_RPA_RESOLVING,
40406199cf8SJohan Hedberg HCI_LE_ENABLED,
405f3d3444aSJohan Hedberg HCI_ADVERTISING,
406cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE,
4075e5282bbSJohan Hedberg HCI_CONNECTABLE,
4085e5282bbSJohan Hedberg HCI_DISCOVERABLE,
4096acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE,
41047990ea0SJohan Hedberg HCI_LINK_SECURITY,
41121693c15SAndre Guedes HCI_PERIODIC_INQ,
4121a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE,
41356f87901SJohan Hedberg HCI_BREDR_ENABLED,
41481ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED,
41500bce3fbSAlain Michaud HCI_WIDEBAND_SPEECH_ENABLED,
416e5b0ad69SAbhishek Pandit-Subedi HCI_EVENT_FILTER_CONFIGURED,
417eca0ae4aSLuiz Augusto von Dentz HCI_PA_SYNC,
418b7cb93e5SMarcel Holtmann
419b7cb93e5SMarcel Holtmann HCI_DUT_MODE,
4204b4113d6SMarcel Holtmann HCI_VENDOR_DIAG,
421b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP,
422b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR,
423aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION,
424cbbdfa6fSSathish Narasimman HCI_ENABLE_LL_PRIVACY,
425f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING,
426c2aa30dbSArchie Pusaka HCI_FORCE_NO_MITM,
427ae7d925bSJoseph Hwang HCI_QUALITY_REPORT,
428248733e8SKiran K HCI_OFFLOAD_CODECS_ENABLED,
42976d0685bSLuiz Augusto von Dentz HCI_LE_SIMULTANEOUS_ROLES,
430877afadaSSchspa Shi HCI_CMD_DRAIN_WORKQUEUE,
431b7cb93e5SMarcel Holtmann
432af6bcc19SBrian Gix HCI_MESH_EXPERIMENTAL,
433b338d917SBrian Gix HCI_MESH,
434b338d917SBrian Gix HCI_MESH_SENDING,
435b338d917SBrian Gix
436eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS,
437d23264a8SAndre Guedes };
438d23264a8SAndre Guedes
4391da177e4SLinus Torvalds /* HCI timeouts */
4405f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
4415f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
4425f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
443d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
444de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */
4455f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
4469345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
447c57edb54SJonas Dreßler #define HCI_ACL_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */
4489489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */
4491f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */
4501da177e4SLinus Torvalds
4515b7f9909SMarcel Holtmann /* HCI data types */
4521da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01
4531da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02
4541da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03
4551da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04
4564de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05
457e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0
4581da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff
4591da177e4SLinus Torvalds
4605b7f9909SMarcel Holtmann /* HCI packet types */
4611da177e4SLinus Torvalds #define HCI_DM1 0x0008
4621da177e4SLinus Torvalds #define HCI_DM3 0x0400
4631da177e4SLinus Torvalds #define HCI_DM5 0x4000
4641da177e4SLinus Torvalds #define HCI_DH1 0x0010
4651da177e4SLinus Torvalds #define HCI_DH3 0x0800
4661da177e4SLinus Torvalds #define HCI_DH5 0x8000
4671da177e4SLinus Torvalds
4685075b972SJaganath Kanakkassery /* HCI packet types inverted masks */
4695075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002
4705075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004
4715075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100
4725075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200
4735075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000
4745075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000
4755075b972SJaganath Kanakkassery
4761da177e4SLinus Torvalds #define HCI_HV1 0x0020
4771da177e4SLinus Torvalds #define HCI_HV2 0x0040
4781da177e4SLinus Torvalds #define HCI_HV3 0x0080
4791da177e4SLinus Torvalds
4801da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
4811da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK)
4821da177e4SLinus Torvalds
4835b7f9909SMarcel Holtmann /* eSCO packet types */
4845b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001
4855b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002
4865b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004
4875b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008
4885b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010
4895b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020
490efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040
491efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080
492efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100
493efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200
4945b7f9909SMarcel Holtmann
495a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3)
496efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5)
497a8746417SMarcel Holtmann
4981da177e4SLinus Torvalds /* ACL flags */
499e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00
5001da177e4SLinus Torvalds #define ACL_CONT 0x01
5011da177e4SLinus Torvalds #define ACL_START 0x02
502d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03
5031da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04
5041da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08
5051da177e4SLinus Torvalds
5064de0fc59SLuiz Augusto von Dentz /* ISO PB flags */
5074de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00
5084de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01
5094de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02
5104de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03
5114de0fc59SLuiz Augusto von Dentz
5124de0fc59SLuiz Augusto von Dentz /* ISO TS flags */
5134de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01
5144de0fc59SLuiz Augusto von Dentz
5151da177e4SLinus Torvalds /* Baseband links */
5161da177e4SLinus Torvalds #define SCO_LINK 0x00
5171da177e4SLinus Torvalds #define ACL_LINK 0x01
5185b7f9909SMarcel Holtmann #define ESCO_LINK 0x02
519fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */
520fcd89c09SVille Tervo #define LE_LINK 0x80
5214de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82
522845472e8SMarcel Holtmann #define INVALID_LINK 0xff
5231da177e4SLinus Torvalds
5241da177e4SLinus Torvalds /* LMP features */
5251da177e4SLinus Torvalds #define LMP_3SLOT 0x01
5261da177e4SLinus Torvalds #define LMP_5SLOT 0x02
5271da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04
5281da177e4SLinus Torvalds #define LMP_SOFFSET 0x08
5291da177e4SLinus Torvalds #define LMP_TACCURACY 0x10
5301da177e4SLinus Torvalds #define LMP_RSWITCH 0x20
5311da177e4SLinus Torvalds #define LMP_HOLD 0x40
53204837f64SMarcel Holtmann #define LMP_SNIFF 0x80
5331da177e4SLinus Torvalds
5341da177e4SLinus Torvalds #define LMP_PARK 0x01
5351da177e4SLinus Torvalds #define LMP_RSSI 0x02
5361da177e4SLinus Torvalds #define LMP_QUALITY 0x04
5371da177e4SLinus Torvalds #define LMP_SCO 0x08
5381da177e4SLinus Torvalds #define LMP_HV2 0x10
5391da177e4SLinus Torvalds #define LMP_HV3 0x20
5401da177e4SLinus Torvalds #define LMP_ULAW 0x40
5411da177e4SLinus Torvalds #define LMP_ALAW 0x80
5421da177e4SLinus Torvalds
5431da177e4SLinus Torvalds #define LMP_CVSD 0x01
5441da177e4SLinus Torvalds #define LMP_PSCHEME 0x02
5451da177e4SLinus Torvalds #define LMP_PCONTROL 0x04
54607a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08
5471da177e4SLinus Torvalds
5485075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02
5495075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04
550d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40
5515b7f9909SMarcel Holtmann #define LMP_ESCO 0x80
5525b7f9909SMarcel Holtmann
5535b7f9909SMarcel Holtmann #define LMP_EV4 0x01
5545b7f9909SMarcel Holtmann #define LMP_EV5 0x02
55569ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20
556d5859e22SJohan Hedberg #define LMP_LE 0x40
5575075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80
5585b7f9909SMarcel Holtmann
5595075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01
56004837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02
561d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04
562efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20
563efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40
564efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80
56504837f64SMarcel Holtmann
566d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01
567e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02
568769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08
569766ae242SZijun Hu #define LMP_ERR_DATA_REPORTING 0x20
570e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40
571769be974SMarcel Holtmann
572d5859e22SJohan Hedberg #define LMP_LSTO 0x01
573d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02
574971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80
575d5859e22SJohan Hedberg
576eead27daSAndre Guedes /* Extended LMP features */
5776397729bSArchie Pusaka #define LMP_CPB_CENTRAL 0x01
5786397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL 0x02
57953b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04
58053b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08
58153b834d2SMarcel Holtmann
582d5991585SMarcel Holtmann #define LMP_SC 0x01
583d5991585SMarcel Holtmann #define LMP_PING 0x02
584d5991585SMarcel Holtmann
58553b834d2SMarcel Holtmann /* Host features */
586cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01
587eead27daSAndre Guedes #define LMP_HOST_LE 0x02
588cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04
589d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08
590eead27daSAndre Guedes
591662bc2e6SAndre Guedes /* LE features */
5920da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01
593662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02
594ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES 0x08
595cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10
59694a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20
597ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY 0x40
5984b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80
5995075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01
6005075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08
60155beec10SMarcel Holtmann #define HCI_LE_EXT_ADV 0x10
602eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_PERIODIC_ADV 0x20
6039756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40
604ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL 0x10
605ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL 0x20
606eca0ae4aSLuiz Augusto von Dentz #define HCI_LE_ISO_BROADCASTER 0x40
607ae753361SClaudia Draghicescu #define HCI_LE_ISO_SYNC_RECEIVER 0x80
608662bc2e6SAndre Guedes
60904837f64SMarcel Holtmann /* Connection modes */
61004837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000
61104837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001
61204837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002
61304837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003
61404837f64SMarcel Holtmann
6151da177e4SLinus Torvalds /* Link policies */
6161da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001
6171da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002
6181da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004
6191da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008
6201da177e4SLinus Torvalds
62104837f64SMarcel Holtmann /* Link modes */
6221da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000
6231da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001
6241da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002
6251da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004
6261da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008
6271da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010
6281da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020
6297b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040
6301da177e4SLinus Torvalds
63140be492fSMarcel Holtmann /* Authentication types */
63240be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00
63340be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01
63440be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02
63540be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03
63640be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04
63740be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05
63840be492fSMarcel Holtmann
639a77b15a6SMikel Astiz /* I/O capabilities */
640a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00
641a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01
642a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02
643a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03
644a77b15a6SMikel Astiz
645b6020ba0SWaldemar Rymarkiewicz /* Link Key types */
646b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00
647b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01
648b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02
649b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03
65011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04
65111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05
652b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06
65311015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07
65411015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08
655b6020ba0SWaldemar Rymarkiewicz
6569f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */
6578e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02
6589f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05
659160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06
6602acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07
661cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08
6629cd7289bSJonas Dreßler #define HCI_ERROR_COMMAND_DISALLOWED 0x0c
663d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d
6649f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f
665c86cc5a3SLuiz Augusto von Dentz #define HCI_ERROR_INVALID_PARAMETERS 0x12
6669f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13
667cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14
668cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15
6699f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16
6709f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18
6719cd7289bSJonas Dreßler #define HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE 0x1e
6724ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e
6734ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f
6743c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c
6750f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST 0x44
6769f5a0d7bSAndrei Emeltchenko
6772455a3eaSAndrei Emeltchenko /* Flow control modes */
6782455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
6792455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
6802455a3eaSAndrei Emeltchenko
681bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */
682bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127
683a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127
684bbaf444aSJohan Hedberg
68523417475SIulia Tanasescu #define HCI_SYNC_HANDLE_INVALID 0xffff
68623417475SIulia Tanasescu
687ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00
688ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01
689ba165a90SJohan Hedberg
69032748db0SJohan Hedberg /* Extended Inquiry Response field types */
69132748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */
69232748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
69332748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */
69432748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */
69532748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */
69632748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */
69732748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */
69832748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */
69932748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */
70032748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */
7019ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */
702d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */
703d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */
70432748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */
7054453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */
7068f9ae5b3SLuiz Augusto von Dentz #define EIR_SERVICE_DATA 0x16 /* Service Data */
7071471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */
7081471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */
709d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */
710d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */
711f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */
712f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */
71332748db0SJohan Hedberg
7143f0f524bSJohan Hedberg /* Low Energy Advertising Flags */
7153f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */
7163f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */
7173f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
7183f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */
7193f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */
7203f0f524bSJohan Hedberg
7211da177e4SLinus Torvalds /* ----- HCI Commands ---- */
7226bd32326SVille Tervo #define HCI_OP_NOP 0x0000
7236bd32326SVille Tervo
724a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401
725a9de9248SMarcel Holtmann struct hci_cp_inquiry {
726a9de9248SMarcel Holtmann __u8 lap[3];
727a9de9248SMarcel Holtmann __u8 length;
728a9de9248SMarcel Holtmann __u8 num_rsp;
72966c853ccSGustavo F. Padovan } __packed;
7301da177e4SLinus Torvalds
731a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402
732a9de9248SMarcel Holtmann
73379d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403
73479d6e068SAndre Guedes
735a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404
736a9de9248SMarcel Holtmann
737a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405
738a9de9248SMarcel Holtmann struct hci_cp_create_conn {
739a9de9248SMarcel Holtmann bdaddr_t bdaddr;
740a9de9248SMarcel Holtmann __le16 pkt_type;
741a9de9248SMarcel Holtmann __u8 pscan_rep_mode;
742a9de9248SMarcel Holtmann __u8 pscan_mode;
743a9de9248SMarcel Holtmann __le16 clock_offset;
744a9de9248SMarcel Holtmann __u8 role_switch;
74566c853ccSGustavo F. Padovan } __packed;
7461da177e4SLinus Torvalds
747a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406
748a9de9248SMarcel Holtmann struct hci_cp_disconnect {
749a9de9248SMarcel Holtmann __le16 handle;
750a9de9248SMarcel Holtmann __u8 reason;
75166c853ccSGustavo F. Padovan } __packed;
7521da177e4SLinus Torvalds
753a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407
754a9de9248SMarcel Holtmann struct hci_cp_add_sco {
755a9de9248SMarcel Holtmann __le16 handle;
756a9de9248SMarcel Holtmann __le16 pkt_type;
75766c853ccSGustavo F. Padovan } __packed;
758a9de9248SMarcel Holtmann
759a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408
760a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel {
7611da177e4SLinus Torvalds bdaddr_t bdaddr;
76266c853ccSGustavo F. Padovan } __packed;
7631da177e4SLinus Torvalds
764a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409
765a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req {
766a9de9248SMarcel Holtmann bdaddr_t bdaddr;
767a9de9248SMarcel Holtmann __u8 role;
76866c853ccSGustavo F. Padovan } __packed;
7691da177e4SLinus Torvalds
770a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a
771a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req {
772a9de9248SMarcel Holtmann bdaddr_t bdaddr;
773a9de9248SMarcel Holtmann __u8 reason;
77466c853ccSGustavo F. Padovan } __packed;
7751da177e4SLinus Torvalds
776a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b
777a9de9248SMarcel Holtmann struct hci_cp_link_key_reply {
778a9de9248SMarcel Holtmann bdaddr_t bdaddr;
7799b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE];
78066c853ccSGustavo F. Padovan } __packed;
7811da177e4SLinus Torvalds
782a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c
783a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply {
784a9de9248SMarcel Holtmann bdaddr_t bdaddr;
78566c853ccSGustavo F. Padovan } __packed;
7861da177e4SLinus Torvalds
787a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d
788a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply {
789a9de9248SMarcel Holtmann bdaddr_t bdaddr;
790a9de9248SMarcel Holtmann __u8 pin_len;
791a9de9248SMarcel Holtmann __u8 pin_code[16];
79266c853ccSGustavo F. Padovan } __packed;
793980e1a53SJohan Hedberg struct hci_rp_pin_code_reply {
794980e1a53SJohan Hedberg __u8 status;
795980e1a53SJohan Hedberg bdaddr_t bdaddr;
796980e1a53SJohan Hedberg } __packed;
797a9de9248SMarcel Holtmann
798a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e
799a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply {
800a9de9248SMarcel Holtmann bdaddr_t bdaddr;
80166c853ccSGustavo F. Padovan } __packed;
802980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply {
803980e1a53SJohan Hedberg __u8 status;
804980e1a53SJohan Hedberg bdaddr_t bdaddr;
805980e1a53SJohan Hedberg } __packed;
806a9de9248SMarcel Holtmann
807a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f
808a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype {
809a9de9248SMarcel Holtmann __le16 handle;
810a9de9248SMarcel Holtmann __le16 pkt_type;
81166c853ccSGustavo F. Padovan } __packed;
812a9de9248SMarcel Holtmann
813a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411
814a9de9248SMarcel Holtmann struct hci_cp_auth_requested {
815a9de9248SMarcel Holtmann __le16 handle;
81666c853ccSGustavo F. Padovan } __packed;
817a9de9248SMarcel Holtmann
818a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413
819a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt {
820a9de9248SMarcel Holtmann __le16 handle;
821a9de9248SMarcel Holtmann __u8 encrypt;
82266c853ccSGustavo F. Padovan } __packed;
823a9de9248SMarcel Holtmann
824a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415
825a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key {
826a9de9248SMarcel Holtmann __le16 handle;
82766c853ccSGustavo F. Padovan } __packed;
828a9de9248SMarcel Holtmann
829a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419
830a9de9248SMarcel Holtmann struct hci_cp_remote_name_req {
831a9de9248SMarcel Holtmann bdaddr_t bdaddr;
832a9de9248SMarcel Holtmann __u8 pscan_rep_mode;
833a9de9248SMarcel Holtmann __u8 pscan_mode;
834a9de9248SMarcel Holtmann __le16 clock_offset;
83566c853ccSGustavo F. Padovan } __packed;
836a9de9248SMarcel Holtmann
837a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a
838a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel {
839a9de9248SMarcel Holtmann bdaddr_t bdaddr;
84066c853ccSGustavo F. Padovan } __packed;
841a9de9248SMarcel Holtmann
842a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b
843a9de9248SMarcel Holtmann struct hci_cp_read_remote_features {
844a9de9248SMarcel Holtmann __le16 handle;
84566c853ccSGustavo F. Padovan } __packed;
846a9de9248SMarcel Holtmann
847a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c
848a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features {
849a9de9248SMarcel Holtmann __le16 handle;
850a9de9248SMarcel Holtmann __u8 page;
85166c853ccSGustavo F. Padovan } __packed;
852a9de9248SMarcel Holtmann
853a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d
854a9de9248SMarcel Holtmann struct hci_cp_read_remote_version {
855a9de9248SMarcel Holtmann __le16 handle;
85666c853ccSGustavo F. Padovan } __packed;
857a9de9248SMarcel Holtmann
858df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f
859df935429SMarcel Holtmann struct hci_cp_read_clock_offset {
860df935429SMarcel Holtmann __le16 handle;
861df935429SMarcel Holtmann } __packed;
862df935429SMarcel Holtmann
863a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428
864a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn {
865a9de9248SMarcel Holtmann __le16 handle;
866a9de9248SMarcel Holtmann __le32 tx_bandwidth;
867a9de9248SMarcel Holtmann __le32 rx_bandwidth;
868a9de9248SMarcel Holtmann __le16 max_latency;
869a9de9248SMarcel Holtmann __le16 voice_setting;
870a9de9248SMarcel Holtmann __u8 retrans_effort;
871a9de9248SMarcel Holtmann __le16 pkt_type;
87266c853ccSGustavo F. Padovan } __packed;
873a9de9248SMarcel Holtmann
874a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429
875a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req {
876a9de9248SMarcel Holtmann bdaddr_t bdaddr;
877a9de9248SMarcel Holtmann __le32 tx_bandwidth;
878a9de9248SMarcel Holtmann __le32 rx_bandwidth;
879a9de9248SMarcel Holtmann __le16 max_latency;
880a9de9248SMarcel Holtmann __le16 content_format;
881a9de9248SMarcel Holtmann __u8 retrans_effort;
882a9de9248SMarcel Holtmann __le16 pkt_type;
88366c853ccSGustavo F. Padovan } __packed;
884a9de9248SMarcel Holtmann
885a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a
886a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req {
887a9de9248SMarcel Holtmann bdaddr_t bdaddr;
888a9de9248SMarcel Holtmann __u8 reason;
88966c853ccSGustavo F. Padovan } __packed;
890a9de9248SMarcel Holtmann
89117fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b
89217fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply {
89317fa4b9dSJohan Hedberg bdaddr_t bdaddr;
89417fa4b9dSJohan Hedberg __u8 capability;
89517fa4b9dSJohan Hedberg __u8 oob_data;
89617fa4b9dSJohan Hedberg __u8 authentication;
89717fa4b9dSJohan Hedberg } __packed;
89817fa4b9dSJohan Hedberg
899a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c
900a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply {
901a5c29683SJohan Hedberg bdaddr_t bdaddr;
902a5c29683SJohan Hedberg } __packed;
903a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply {
904a5c29683SJohan Hedberg __u8 status;
905a5c29683SJohan Hedberg bdaddr_t bdaddr;
906a5c29683SJohan Hedberg } __packed;
907a5c29683SJohan Hedberg
908a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d
909a5c29683SJohan Hedberg
9109ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e
9119ad4019aSBrian Gix struct hci_cp_user_passkey_reply {
9129ad4019aSBrian Gix bdaddr_t bdaddr;
9139ad4019aSBrian Gix __le32 passkey;
9149ad4019aSBrian Gix } __packed;
9159ad4019aSBrian Gix
9169ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f
9179ad4019aSBrian Gix
9182763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430
9192763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply {
9202763eda6SSzymon Janc bdaddr_t bdaddr;
9212763eda6SSzymon Janc __u8 hash[16];
92238da1703SJohan Hedberg __u8 rand[16];
9232763eda6SSzymon Janc } __packed;
9242763eda6SSzymon Janc
9252763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433
9262763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply {
9272763eda6SSzymon Janc bdaddr_t bdaddr;
9282763eda6SSzymon Janc } __packed;
9292763eda6SSzymon Janc
93003b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434
93103b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply {
93203b555e1SJohan Hedberg bdaddr_t bdaddr;
93303b555e1SJohan Hedberg __u8 reason;
93403b555e1SJohan Hedberg } __packed;
93503b555e1SJohan Hedberg
936b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN 0x043d
937b2af264aSKiran K struct hci_coding_format {
938b2af264aSKiran K __u8 id;
939b2af264aSKiran K __le16 cid;
940b2af264aSKiran K __le16 vid;
941b2af264aSKiran K } __packed;
942b2af264aSKiran K
943b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn {
944b2af264aSKiran K __le16 handle;
945b2af264aSKiran K __le32 tx_bandwidth;
946b2af264aSKiran K __le32 rx_bandwidth;
947b2af264aSKiran K struct hci_coding_format tx_coding_format;
948b2af264aSKiran K struct hci_coding_format rx_coding_format;
949b2af264aSKiran K __le16 tx_codec_frame_size;
950b2af264aSKiran K __le16 rx_codec_frame_size;
951b2af264aSKiran K __le32 in_bandwidth;
952b2af264aSKiran K __le32 out_bandwidth;
953b2af264aSKiran K struct hci_coding_format in_coding_format;
954b2af264aSKiran K struct hci_coding_format out_coding_format;
955b2af264aSKiran K __le16 in_coded_data_size;
956b2af264aSKiran K __le16 out_coded_data_size;
957b2af264aSKiran K __u8 in_pcm_data_format;
958b2af264aSKiran K __u8 out_pcm_data_format;
959b2af264aSKiran K __u8 in_pcm_sample_payload_msb_pos;
960b2af264aSKiran K __u8 out_pcm_sample_payload_msb_pos;
961b2af264aSKiran K __u8 in_data_path;
962b2af264aSKiran K __u8 out_data_path;
963b2af264aSKiran K __u8 in_transport_unit_size;
964b2af264aSKiran K __u8 out_transport_unit_size;
965b2af264aSKiran K __le16 max_latency;
966b2af264aSKiran K __le16 pkt_type;
967b2af264aSKiran K __u8 retrans_effort;
968b2af264aSKiran K } __packed;
969b2af264aSKiran K
970b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel {
971b078b564SAndrei Emeltchenko __u8 status;
972b078b564SAndrei Emeltchenko __u8 phy_handle;
973b078b564SAndrei Emeltchenko __u8 flow_spec_id;
974523e93cdSAndrei Emeltchenko } __packed;
975523e93cdSAndrei Emeltchenko
9766397729bSArchie Pusaka #define HCI_OP_SET_CPB 0x0441
9776397729bSArchie Pusaka struct hci_cp_set_cpb {
9788c9a041bSDoHyun Pyun __u8 enable;
9798c9a041bSDoHyun Pyun __u8 lt_addr;
9808c9a041bSDoHyun Pyun __u8 lpo_allowed;
9818c9a041bSDoHyun Pyun __le16 packet_type;
9828c9a041bSDoHyun Pyun __le16 interval_min;
9838c9a041bSDoHyun Pyun __le16 interval_max;
9846397729bSArchie Pusaka __le16 cpb_sv_tout;
9858c9a041bSDoHyun Pyun } __packed;
9866397729bSArchie Pusaka struct hci_rp_set_cpb {
9878c9a041bSDoHyun Pyun __u8 status;
9888c9a041bSDoHyun Pyun __u8 lt_addr;
9898c9a041bSDoHyun Pyun __le16 interval;
9908c9a041bSDoHyun Pyun } __packed;
9918c9a041bSDoHyun Pyun
992cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443
993cefded98SDoHyun Pyun
994e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445
995e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply {
996e2f99131SMarcel Holtmann bdaddr_t bdaddr;
997e2f99131SMarcel Holtmann __u8 hash192[16];
99838da1703SJohan Hedberg __u8 rand192[16];
999e2f99131SMarcel Holtmann __u8 hash256[16];
100038da1703SJohan Hedberg __u8 rand256[16];
1001e2f99131SMarcel Holtmann } __packed;
1002e2f99131SMarcel Holtmann
1003a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803
1004a9de9248SMarcel Holtmann struct hci_cp_sniff_mode {
1005a9de9248SMarcel Holtmann __le16 handle;
1006a9de9248SMarcel Holtmann __le16 max_interval;
1007a9de9248SMarcel Holtmann __le16 min_interval;
1008a9de9248SMarcel Holtmann __le16 attempt;
1009a9de9248SMarcel Holtmann __le16 timeout;
101066c853ccSGustavo F. Padovan } __packed;
1011a9de9248SMarcel Holtmann
1012a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804
1013a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode {
1014a9de9248SMarcel Holtmann __le16 handle;
101566c853ccSGustavo F. Padovan } __packed;
1016a9de9248SMarcel Holtmann
1017a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809
1018a9de9248SMarcel Holtmann struct hci_cp_role_discovery {
1019a9de9248SMarcel Holtmann __le16 handle;
102066c853ccSGustavo F. Padovan } __packed;
1021a9de9248SMarcel Holtmann struct hci_rp_role_discovery {
1022a9de9248SMarcel Holtmann __u8 status;
1023a9de9248SMarcel Holtmann __le16 handle;
1024a9de9248SMarcel Holtmann __u8 role;
102566c853ccSGustavo F. Padovan } __packed;
1026a9de9248SMarcel Holtmann
1027a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b
1028a9de9248SMarcel Holtmann struct hci_cp_switch_role {
1029a9de9248SMarcel Holtmann bdaddr_t bdaddr;
1030a9de9248SMarcel Holtmann __u8 role;
103166c853ccSGustavo F. Padovan } __packed;
1032a9de9248SMarcel Holtmann
1033a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c
1034a9de9248SMarcel Holtmann struct hci_cp_read_link_policy {
1035a9de9248SMarcel Holtmann __le16 handle;
103666c853ccSGustavo F. Padovan } __packed;
1037a9de9248SMarcel Holtmann struct hci_rp_read_link_policy {
1038a9de9248SMarcel Holtmann __u8 status;
1039a9de9248SMarcel Holtmann __le16 handle;
1040a9de9248SMarcel Holtmann __le16 policy;
104166c853ccSGustavo F. Padovan } __packed;
1042a9de9248SMarcel Holtmann
1043a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d
1044a9de9248SMarcel Holtmann struct hci_cp_write_link_policy {
1045a9de9248SMarcel Holtmann __le16 handle;
1046a9de9248SMarcel Holtmann __le16 policy;
104766c853ccSGustavo F. Padovan } __packed;
1048a9de9248SMarcel Holtmann struct hci_rp_write_link_policy {
1049a9de9248SMarcel Holtmann __u8 status;
1050a9de9248SMarcel Holtmann __le16 handle;
105166c853ccSGustavo F. Padovan } __packed;
1052a9de9248SMarcel Holtmann
1053e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e
1054e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy {
1055e4e8e37cSMarcel Holtmann __u8 status;
1056e4e8e37cSMarcel Holtmann __le16 policy;
105766c853ccSGustavo F. Padovan } __packed;
1058e4e8e37cSMarcel Holtmann
1059e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f
1060e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy {
1061e4e8e37cSMarcel Holtmann __le16 policy;
106266c853ccSGustavo F. Padovan } __packed;
1063e4e8e37cSMarcel Holtmann
1064a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811
1065a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate {
1066a9de9248SMarcel Holtmann __le16 handle;
1067a9de9248SMarcel Holtmann __le16 max_latency;
1068a9de9248SMarcel Holtmann __le16 min_remote_timeout;
1069a9de9248SMarcel Holtmann __le16 min_local_timeout;
107066c853ccSGustavo F. Padovan } __packed;
1071a9de9248SMarcel Holtmann
1072a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01
1073a9de9248SMarcel Holtmann
1074a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03
1075a9de9248SMarcel Holtmann
1076a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05
10774f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE 9
10784f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter {
10791da177e4SLinus Torvalds __u8 flt_type;
10801da177e4SLinus Torvalds __u8 cond_type;
10814f40afc6SAbhishek Pandit-Subedi struct {
10824f40afc6SAbhishek Pandit-Subedi bdaddr_t bdaddr;
10834f40afc6SAbhishek Pandit-Subedi __u8 auto_accept;
10844f40afc6SAbhishek Pandit-Subedi } __packed addr_conn_flt;
108566c853ccSGustavo F. Padovan } __packed;
10861da177e4SLinus Torvalds
10871da177e4SLinus Torvalds /* Filter types */
10881da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00
10891da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01
10901da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02
10911da177e4SLinus Torvalds
10921da177e4SLinus Torvalds /* CONN_SETUP Condition types */
10931da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00
10941da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01
10951da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02
10961da177e4SLinus Torvalds
10971da177e4SLinus Torvalds /* CONN_SETUP Conditions */
10981da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01
10991da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02
11004f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03
11011da177e4SLinus Torvalds
1102cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d
1103cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key {
1104cb962780SMarcel Holtmann bdaddr_t bdaddr;
1105cb962780SMarcel Holtmann __u8 read_all;
1106cb962780SMarcel Holtmann } __packed;
1107cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key {
1108cb962780SMarcel Holtmann __u8 status;
1109e88422bcSLuiz Augusto von Dentz __le16 max_keys;
1110e88422bcSLuiz Augusto von Dentz __le16 num_keys;
1111cb962780SMarcel Holtmann } __packed;
1112cb962780SMarcel Holtmann
1113b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
1114b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key {
1115b0916ea0SJohan Hedberg bdaddr_t bdaddr;
1116b0916ea0SJohan Hedberg __u8 delete_all;
1117b0916ea0SJohan Hedberg } __packed;
1118039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key {
1119039d4e41SMarcel Holtmann __u8 status;
11207978656cSLuiz Augusto von Dentz __le16 num_keys;
1121039d4e41SMarcel Holtmann } __packed;
1122b0916ea0SJohan Hedberg
11231f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248
11241f6c6378SJohan Hedberg
1125a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13
1126a9de9248SMarcel Holtmann struct hci_cp_write_local_name {
11271f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH];
112866c853ccSGustavo F. Padovan } __packed;
1129a9de9248SMarcel Holtmann
1130a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14
1131a9de9248SMarcel Holtmann struct hci_rp_read_local_name {
1132a9de9248SMarcel Holtmann __u8 status;
11331f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH];
113466c853ccSGustavo F. Padovan } __packed;
1135a9de9248SMarcel Holtmann
1136a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16
1137a9de9248SMarcel Holtmann
1138a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18
1139a9de9248SMarcel Holtmann
1140a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a
1141a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00
1142a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01
1143a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02
1144a9de9248SMarcel Holtmann
1145a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f
1146a9de9248SMarcel Holtmann
1147a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20
1148a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00
1149a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01
1150a9de9248SMarcel Holtmann
1151a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21
1152a9de9248SMarcel Holtmann
1153a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22
1154a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00
1155a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01
1156a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02
1157a9de9248SMarcel Holtmann
1158a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23
1159a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev {
11601da177e4SLinus Torvalds __u8 status;
11611da177e4SLinus Torvalds __u8 dev_class[3];
116266c853ccSGustavo F. Padovan } __packed;
11631da177e4SLinus Torvalds
1164a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24
1165a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev {
11661da177e4SLinus Torvalds __u8 dev_class[3];
116766c853ccSGustavo F. Padovan } __packed;
11681da177e4SLinus Torvalds
1169a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25
11701da177e4SLinus Torvalds struct hci_rp_read_voice_setting {
11711da177e4SLinus Torvalds __u8 status;
11721ebb9252SMarcel Holtmann __le16 voice_setting;
117366c853ccSGustavo F. Padovan } __packed;
11741da177e4SLinus Torvalds
1175a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26
11761da177e4SLinus Torvalds struct hci_cp_write_voice_setting {
11771ebb9252SMarcel Holtmann __le16 voice_setting;
117866c853ccSGustavo F. Padovan } __packed;
11791da177e4SLinus Torvalds
1180a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33
11811da177e4SLinus Torvalds struct hci_cp_host_buffer_size {
11821ebb9252SMarcel Holtmann __le16 acl_mtu;
11831da177e4SLinus Torvalds __u8 sco_mtu;
11841ebb9252SMarcel Holtmann __le16 acl_max_pkt;
11851ebb9252SMarcel Holtmann __le16 sco_max_pkt;
118666c853ccSGustavo F. Padovan } __packed;
11871da177e4SLinus Torvalds
1188b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38
1189b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac {
1190b4cb9fb2SMarcel Holtmann __u8 status;
1191b4cb9fb2SMarcel Holtmann __u8 num_iac;
1192b4cb9fb2SMarcel Holtmann } __packed;
1193b4cb9fb2SMarcel Holtmann
11944b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39
11954b836f39SMarcel Holtmann
11963d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a
11973d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap {
11983d505312SMarcel Holtmann __u8 num_iac;
11993d505312SMarcel Holtmann __u8 iac_lap[6];
12003d505312SMarcel Holtmann } __packed;
12013d505312SMarcel Holtmann
1202d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45
1203d5859e22SJohan Hedberg
120480a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240
120580a1e1dbSJohan Hedberg
120680a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52
120780a1e1dbSJohan Hedberg struct hci_cp_write_eir {
1208816a11d5SJohan Hedberg __u8 fec;
1209816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH];
121080a1e1dbSJohan Hedberg } __packed;
121180a1e1dbSJohan Hedberg
1212333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55
1213333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode {
1214333140b5SMarcel Holtmann __u8 status;
1215333140b5SMarcel Holtmann __u8 mode;
121666c853ccSGustavo F. Padovan } __packed;
1217333140b5SMarcel Holtmann
1218333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56
1219333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode {
1220333140b5SMarcel Holtmann __u8 mode;
122166c853ccSGustavo F. Padovan } __packed;
1222333140b5SMarcel Holtmann
1223c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57
1224c35938b2SSzymon Janc struct hci_rp_read_local_oob_data {
1225c35938b2SSzymon Janc __u8 status;
1226c35938b2SSzymon Janc __u8 hash[16];
122738da1703SJohan Hedberg __u8 rand[16];
1228c35938b2SSzymon Janc } __packed;
1229c35938b2SSzymon Janc
1230d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
123191c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power {
123291c4e9b1SMarcel Holtmann __u8 status;
123391c4e9b1SMarcel Holtmann __s8 tx_power;
123491c4e9b1SMarcel Holtmann } __packed;
1235d5859e22SJohan Hedberg
123600bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a
123700bce3fbSAlain Michaud #define ERR_DATA_REPORTING_DISABLED 0x00
123800bce3fbSAlain Michaud #define ERR_DATA_REPORTING_ENABLED 0x01
123900bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting {
124000bce3fbSAlain Michaud __u8 status;
124100bce3fbSAlain Michaud __u8 err_data_reporting;
124200bce3fbSAlain Michaud } __packed;
124300bce3fbSAlain Michaud
124400bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b
124500bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting {
124600bce3fbSAlain Michaud __u8 err_data_reporting;
124700bce3fbSAlain Michaud } __packed;
124800bce3fbSAlain Michaud
1249d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63
1250d62e6d67SJohan Hedberg
12517528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64
12527528ca1cSMarcel Holtmann
12531e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66
12541e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode {
12551e89cffbSAndrei Emeltchenko __u8 status;
12561e89cffbSAndrei Emeltchenko __u8 mode;
12571e89cffbSAndrei Emeltchenko } __packed;
12581e89cffbSAndrei Emeltchenko
1259f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
1260f9b49306SAndre Guedes struct hci_cp_write_le_host_supported {
1261f9b49306SAndre Guedes __u8 le;
1262f9b49306SAndre Guedes __u8 simul;
1263f9b49306SAndre Guedes } __packed;
1264f9b49306SAndre Guedes
1265d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74
1266d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr {
1267d0bf75a5SDoHyun Pyun __u8 lt_addr;
1268d0bf75a5SDoHyun Pyun } __packed;
1269d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr {
1270d0bf75a5SDoHyun Pyun __u8 status;
1271d0bf75a5SDoHyun Pyun __u8 lt_addr;
1272d0bf75a5SDoHyun Pyun } __packed;
1273d0bf75a5SDoHyun Pyun
12746a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75
12756a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr {
12766a20eaf4SDoHyun Pyun __u8 lt_addr;
12776a20eaf4SDoHyun Pyun } __packed;
12786a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr {
12796a20eaf4SDoHyun Pyun __u8 status;
12806a20eaf4SDoHyun Pyun __u8 lt_addr;
12816a20eaf4SDoHyun Pyun } __packed;
12826a20eaf4SDoHyun Pyun
12836397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA 0x0c76
12846397729bSArchie Pusaka struct hci_cp_set_cpb_data {
12857d1dab49SDoHyun Pyun __u8 lt_addr;
12867d1dab49SDoHyun Pyun __u8 fragment;
12877d1dab49SDoHyun Pyun __u8 data_length;
12886397729bSArchie Pusaka __u8 data[HCI_MAX_CPB_DATA_SIZE];
12897d1dab49SDoHyun Pyun } __packed;
12906397729bSArchie Pusaka struct hci_rp_set_cpb_data {
12917d1dab49SDoHyun Pyun __u8 status;
12927d1dab49SDoHyun Pyun __u8 lt_addr;
12937d1dab49SDoHyun Pyun } __packed;
12947d1dab49SDoHyun Pyun
12955d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77
12965d4e7e8dSJohan Hedberg
1297a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78
1298a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params {
1299a9b07a64SDoHyun Pyun __le16 interval_min;
1300a9b07a64SDoHyun Pyun __le16 interval_max;
1301a9b07a64SDoHyun Pyun __le32 sync_train_tout;
1302a9b07a64SDoHyun Pyun __u8 service_data;
1303a9b07a64SDoHyun Pyun } __packed;
1304a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params {
1305a9b07a64SDoHyun Pyun __u8 status;
1306a9b07a64SDoHyun Pyun __le16 sync_train_int;
1307a9b07a64SDoHyun Pyun } __packed;
1308a9b07a64SDoHyun Pyun
1309eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79
1310eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support {
1311eb4b95c6SMarcel Holtmann __u8 status;
1312eb4b95c6SMarcel Holtmann __u8 support;
1313eb4b95c6SMarcel Holtmann } __packed;
1314eb4b95c6SMarcel Holtmann
1315eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a
1316eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support {
1317eb4b95c6SMarcel Holtmann __u8 support;
1318eb4b95c6SMarcel Holtmann } __packed;
1319eb4b95c6SMarcel Holtmann
1320302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b
1321302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to {
1322302975cbSSpoorthi Ravishankar Koppad __le16 handle;
1323302975cbSSpoorthi Ravishankar Koppad } __packed;
1324302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to {
1325302975cbSSpoorthi Ravishankar Koppad __u8 status;
1326302975cbSSpoorthi Ravishankar Koppad __le16 handle;
1327302975cbSSpoorthi Ravishankar Koppad __le16 timeout;
1328302975cbSSpoorthi Ravishankar Koppad } __packed;
1329302975cbSSpoorthi Ravishankar Koppad
1330302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c
1331302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to {
1332302975cbSSpoorthi Ravishankar Koppad __le16 handle;
1333302975cbSSpoorthi Ravishankar Koppad __le16 timeout;
1334302975cbSSpoorthi Ravishankar Koppad } __packed;
1335302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to {
1336302975cbSSpoorthi Ravishankar Koppad __u8 status;
1337302975cbSSpoorthi Ravishankar Koppad __le16 handle;
1338302975cbSSpoorthi Ravishankar Koppad } __packed;
1339302975cbSSpoorthi Ravishankar Koppad
1340e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d
1341e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data {
1342e2f99131SMarcel Holtmann __u8 status;
1343e2f99131SMarcel Holtmann __u8 hash192[16];
134438da1703SJohan Hedberg __u8 rand192[16];
1345e2f99131SMarcel Holtmann __u8 hash256[16];
134638da1703SJohan Hedberg __u8 rand256[16];
1347e2f99131SMarcel Holtmann } __packed;
1348e2f99131SMarcel Holtmann
13499798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH 0x0c83
13509798fbdeSKiran K struct hci_op_configure_data_path {
13519798fbdeSKiran K __u8 direction;
13529798fbdeSKiran K __u8 data_path_id;
13539798fbdeSKiran K __u8 vnd_len;
13549798fbdeSKiran K __u8 vnd_data[];
13559798fbdeSKiran K } __packed;
13569798fbdeSKiran K
1357a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001
1358a9de9248SMarcel Holtmann struct hci_rp_read_local_version {
13591da177e4SLinus Torvalds __u8 status;
1360a9de9248SMarcel Holtmann __u8 hci_ver;
1361a9de9248SMarcel Holtmann __le16 hci_rev;
1362a9de9248SMarcel Holtmann __u8 lmp_ver;
1363a9de9248SMarcel Holtmann __le16 manufacturer;
1364a9de9248SMarcel Holtmann __le16 lmp_subver;
136566c853ccSGustavo F. Padovan } __packed;
13661da177e4SLinus Torvalds
1367a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002
1368a9de9248SMarcel Holtmann struct hci_rp_read_local_commands {
13691da177e4SLinus Torvalds __u8 status;
1370a9de9248SMarcel Holtmann __u8 commands[64];
137166c853ccSGustavo F. Padovan } __packed;
13721da177e4SLinus Torvalds
1373a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003
1374a9de9248SMarcel Holtmann struct hci_rp_read_local_features {
1375a9de9248SMarcel Holtmann __u8 status;
1376a9de9248SMarcel Holtmann __u8 features[8];
137766c853ccSGustavo F. Padovan } __packed;
1378a9de9248SMarcel Holtmann
1379a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
1380971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features {
1381971e3a4bSAndre Guedes __u8 page;
1382971e3a4bSAndre Guedes } __packed;
1383a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features {
1384a9de9248SMarcel Holtmann __u8 status;
1385a9de9248SMarcel Holtmann __u8 page;
1386a9de9248SMarcel Holtmann __u8 max_page;
1387a9de9248SMarcel Holtmann __u8 features[8];
138866c853ccSGustavo F. Padovan } __packed;
1389a9de9248SMarcel Holtmann
1390a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005
1391a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size {
1392a9de9248SMarcel Holtmann __u8 status;
1393a9de9248SMarcel Holtmann __le16 acl_mtu;
1394a9de9248SMarcel Holtmann __u8 sco_mtu;
1395a9de9248SMarcel Holtmann __le16 acl_max_pkt;
1396a9de9248SMarcel Holtmann __le16 sco_max_pkt;
139766c853ccSGustavo F. Padovan } __packed;
1398a9de9248SMarcel Holtmann
1399a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009
1400a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr {
1401a9de9248SMarcel Holtmann __u8 status;
14021da177e4SLinus Torvalds bdaddr_t bdaddr;
140366c853ccSGustavo F. Padovan } __packed;
14041da177e4SLinus Torvalds
1405350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a
1406350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size {
1407350ee4cfSAndrei Emeltchenko __u8 status;
1408350ee4cfSAndrei Emeltchenko __le16 max_acl_len;
1409350ee4cfSAndrei Emeltchenko __le16 block_len;
1410350ee4cfSAndrei Emeltchenko __le16 num_blocks;
1411350ee4cfSAndrei Emeltchenko } __packed;
1412350ee4cfSAndrei Emeltchenko
1413109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b
14148961987fSKiran K struct hci_std_codecs {
14158961987fSKiran K __u8 num;
14168961987fSKiran K __u8 codec[];
14178961987fSKiran K } __packed;
14188961987fSKiran K
14198961987fSKiran K struct hci_vnd_codec {
14208961987fSKiran K /* company id */
14218961987fSKiran K __le16 cid;
14228961987fSKiran K /* vendor codec id */
14238961987fSKiran K __le16 vid;
14248961987fSKiran K } __packed;
14258961987fSKiran K
14268961987fSKiran K struct hci_vnd_codecs {
14278961987fSKiran K __u8 num;
14288961987fSKiran K struct hci_vnd_codec codec[];
14298961987fSKiran K } __packed;
14308961987fSKiran K
14318961987fSKiran K struct hci_rp_read_local_supported_codecs {
14328961987fSKiran K __u8 status;
14338961987fSKiran K struct hci_std_codecs std_codecs;
14348961987fSKiran K struct hci_vnd_codecs vnd_codecs;
14358961987fSKiran K } __packed;
1436109e3191SMarcel Holtmann
1437a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c
1438a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts {
1439a4790360SMarcel Holtmann __u8 status;
1440a4790360SMarcel Holtmann __u8 pairing_opts;
1441a4790360SMarcel Holtmann __u8 max_key_size;
1442a4790360SMarcel Holtmann } __packed;
1443a4790360SMarcel Holtmann
14449ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2 0x100d
14459ae66402SKiran K struct hci_std_codec_v2 {
14469ae66402SKiran K __u8 id;
14479ae66402SKiran K __u8 transport;
14489ae66402SKiran K } __packed;
14499ae66402SKiran K
14509ae66402SKiran K struct hci_std_codecs_v2 {
14519ae66402SKiran K __u8 num;
14529ae66402SKiran K struct hci_std_codec_v2 codec[];
14539ae66402SKiran K } __packed;
14549ae66402SKiran K
14559ae66402SKiran K struct hci_vnd_codec_v2 {
14569ae66402SKiran K __le16 cid;
14579ae66402SKiran K __le16 vid;
14589ae66402SKiran K __u8 transport;
14599ae66402SKiran K } __packed;
14609ae66402SKiran K
14619ae66402SKiran K struct hci_vnd_codecs_v2 {
14629ae66402SKiran K __u8 num;
14639ae66402SKiran K struct hci_vnd_codec_v2 codec[];
14649ae66402SKiran K } __packed;
14659ae66402SKiran K
14669ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 {
14679ae66402SKiran K __u8 status;
14689ae66402SKiran K struct hci_std_codecs_v2 std_codecs;
14699ae66402SKiran K struct hci_vnd_codecs_v2 vendor_codecs;
14709ae66402SKiran K } __packed;
14719ae66402SKiran K
14728961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS 0x100e
14738961987fSKiran K struct hci_op_read_local_codec_caps {
14748961987fSKiran K __u8 id;
14758961987fSKiran K __le16 cid;
14768961987fSKiran K __le16 vid;
14778961987fSKiran K __u8 transport;
14788961987fSKiran K __u8 direction;
14798961987fSKiran K } __packed;
14808961987fSKiran K
14818961987fSKiran K struct hci_codec_caps {
14828961987fSKiran K __u8 len;
14838961987fSKiran K __u8 data[];
14848961987fSKiran K } __packed;
14858961987fSKiran K
14868961987fSKiran K struct hci_rp_read_local_codec_caps {
14878961987fSKiran K __u8 status;
14888961987fSKiran K __u8 num_caps;
14898961987fSKiran K } __packed;
14908961987fSKiran K
1491f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b
1492f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity {
1493f332ec66SJohan Hedberg __u8 status;
1494f332ec66SJohan Hedberg __le16 interval;
1495f332ec66SJohan Hedberg __le16 window;
1496f332ec66SJohan Hedberg } __packed;
1497f332ec66SJohan Hedberg
1498f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c
1499f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity {
1500f6422ec6SAntti Julku __le16 interval;
1501f6422ec6SAntti Julku __le16 window;
1502f6422ec6SAntti Julku } __packed;
1503f6422ec6SAntti Julku
15045a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d
15055a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power {
15065a134faeSAndrzej Kaczmarek __le16 handle;
15075a134faeSAndrzej Kaczmarek __u8 type;
15085a134faeSAndrzej Kaczmarek } __packed;
15095a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power {
15105a134faeSAndrzej Kaczmarek __u8 status;
15115a134faeSAndrzej Kaczmarek __le16 handle;
15125a134faeSAndrzej Kaczmarek __s8 tx_power;
15135a134faeSAndrzej Kaczmarek } __packed;
15145a134faeSAndrzej Kaczmarek
1515f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46
1516f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type {
1517f332ec66SJohan Hedberg __u8 status;
1518f332ec66SJohan Hedberg __u8 type;
1519f332ec66SJohan Hedberg } __packed;
1520f332ec66SJohan Hedberg
1521f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47
1522f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00
1523f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01
1524f6422ec6SAntti Julku
15255ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405
15265ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi {
15275ae76a94SAndrzej Kaczmarek __le16 handle;
15285ae76a94SAndrzej Kaczmarek } __packed;
15295ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi {
15305ae76a94SAndrzej Kaczmarek __u8 status;
15315ae76a94SAndrzej Kaczmarek __le16 handle;
15325ae76a94SAndrzej Kaczmarek __s8 rssi;
15335ae76a94SAndrzej Kaczmarek } __packed;
15345ae76a94SAndrzej Kaczmarek
153533f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407
153633f35721SJohan Hedberg struct hci_cp_read_clock {
153733f35721SJohan Hedberg __le16 handle;
153833f35721SJohan Hedberg __u8 which;
153933f35721SJohan Hedberg } __packed;
154033f35721SJohan Hedberg struct hci_rp_read_clock {
154133f35721SJohan Hedberg __u8 status;
154233f35721SJohan Hedberg __le16 handle;
154333f35721SJohan Hedberg __le32 clock;
154433f35721SJohan Hedberg __le16 accuracy;
154533f35721SJohan Hedberg } __packed;
154633f35721SJohan Hedberg
1547821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408
1548821f3766SJohan Hedberg struct hci_cp_read_enc_key_size {
1549821f3766SJohan Hedberg __le16 handle;
1550821f3766SJohan Hedberg } __packed;
1551821f3766SJohan Hedberg struct hci_rp_read_enc_key_size {
1552821f3766SJohan Hedberg __u8 status;
1553821f3766SJohan Hedberg __le16 handle;
1554821f3766SJohan Hedberg __u8 key_size;
1555821f3766SJohan Hedberg } __packed;
1556821f3766SJohan Hedberg
1557f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c
1558f4fe73edSMarcel Holtmann
15594b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803
15604b4148e9SMarcel Holtmann
156106f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804
156206f5b778SMarcel Holtmann
156363185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001
156463185f64SVille Tervo struct hci_cp_le_set_event_mask {
156563185f64SVille Tervo __u8 mask[8];
156663185f64SVille Tervo } __packed;
156763185f64SVille Tervo
1568ad3f7986SSungwoo Kim /* BLUETOOTH CORE SPECIFICATION Version 5.4 | Vol 4, Part E
1569ad3f7986SSungwoo Kim * 7.8.2 LE Read Buffer Size command
1570ad3f7986SSungwoo Kim * MAX_LE_MTU is 0xffff.
1571ad3f7986SSungwoo Kim * 0 is also valid. It means that no dedicated LE Buffer exists.
1572ad3f7986SSungwoo Kim * It should use the HCI_Read_Buffer_Size command and mtu is shared
1573ad3f7986SSungwoo Kim * between BR/EDR and LE.
1574ad3f7986SSungwoo Kim */
1575ad3f7986SSungwoo Kim #define HCI_MIN_LE_MTU 0x001b
1576ad3f7986SSungwoo Kim
157763185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002
157863185f64SVille Tervo struct hci_rp_le_read_buffer_size {
157963185f64SVille Tervo __u8 status;
158063185f64SVille Tervo __le16 le_mtu;
158163185f64SVille Tervo __u8 le_max_pkt;
158263185f64SVille Tervo } __packed;
158363185f64SVille Tervo
158460e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003
158560e77321SJohan Hedberg struct hci_rp_le_read_local_features {
158660e77321SJohan Hedberg __u8 status;
158760e77321SJohan Hedberg __u8 features[8];
158860e77321SJohan Hedberg } __packed;
158960e77321SJohan Hedberg
1590d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005
1591d13eafceSMarcel Holtmann
15921e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006
15931e191893SMarcel Holtmann struct hci_cp_le_set_adv_param {
15941e191893SMarcel Holtmann __le16 min_interval;
15951e191893SMarcel Holtmann __le16 max_interval;
15961e191893SMarcel Holtmann __u8 type;
15971e191893SMarcel Holtmann __u8 own_address_type;
15981e191893SMarcel Holtmann __u8 direct_addr_type;
15991e191893SMarcel Holtmann bdaddr_t direct_addr;
16001e191893SMarcel Holtmann __u8 channel_map;
16011e191893SMarcel Holtmann __u8 filter_policy;
16021e191893SMarcel Holtmann } __packed;
16031e191893SMarcel Holtmann
16048fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007
16058fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power {
16068fa19098SJohan Hedberg __u8 status;
16078fa19098SJohan Hedberg __s8 tx_power;
16088fa19098SJohan Hedberg } __packed;
16098fa19098SJohan Hedberg
16103f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31
16113f0f524bSJohan Hedberg
16123f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008
16133f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data {
16143f0f524bSJohan Hedberg __u8 length;
16153f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH];
16163f0f524bSJohan Hedberg } __packed;
16173f0f524bSJohan Hedberg
1618f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009
1619f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data {
1620f14d8f64SMarcel Holtmann __u8 length;
1621f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH];
1622f14d8f64SMarcel Holtmann } __packed;
1623f14d8f64SMarcel Holtmann
1624c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a
1625c1d5dc4aSJohan Hedberg
16265df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00
16275df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01
16285df480b5SAndre Guedes
162907f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b
163007f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param {
163107f7fa5dSAndre Guedes __u8 type;
163207f7fa5dSAndre Guedes __le16 interval;
163307f7fa5dSAndre Guedes __le16 window;
163407f7fa5dSAndre Guedes __u8 own_address_type;
163507f7fa5dSAndre Guedes __u8 filter_policy;
163607f7fa5dSAndre Guedes } __packed;
163707f7fa5dSAndre Guedes
163876a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00
163976a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01
1640525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00
1641525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01
164268a8aea4SAndrei Emeltchenko
1643eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c
1644eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable {
1645eb9d91f5SAndre Guedes __u8 enable;
1646eb9d91f5SAndre Guedes __u8 filter_dup;
1647eb9d91f5SAndre Guedes } __packed;
1648eb9d91f5SAndre Guedes
1649a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00
16503d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST 0x01
1651a7139eddSJohan Hedberg
165263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d
165363185f64SVille Tervo struct hci_cp_le_create_conn {
165463185f64SVille Tervo __le16 scan_interval;
165563185f64SVille Tervo __le16 scan_window;
165663185f64SVille Tervo __u8 filter_policy;
165763185f64SVille Tervo __u8 peer_addr_type;
165863185f64SVille Tervo bdaddr_t peer_addr;
165963185f64SVille Tervo __u8 own_address_type;
166063185f64SVille Tervo __le16 conn_interval_min;
166163185f64SVille Tervo __le16 conn_interval_max;
166263185f64SVille Tervo __le16 conn_latency;
166363185f64SVille Tervo __le16 supervision_timeout;
166463185f64SVille Tervo __le16 min_ce_len;
166563185f64SVille Tervo __le16 max_ce_len;
166663185f64SVille Tervo } __packed;
166763185f64SVille Tervo
166863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e
166963185f64SVille Tervo
16703d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE 0x200f
16713d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size {
1672cf1d081fSJohan Hedberg __u8 status;
1673cf1d081fSJohan Hedberg __u8 size;
1674cf1d081fSJohan Hedberg } __packed;
1675cf1d081fSJohan Hedberg
16763d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST 0x2010
1677d9a7b0a5SMarcel Holtmann
16783d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST 0x2011
16793d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list {
1680d9a7b0a5SMarcel Holtmann __u8 bdaddr_type;
1681d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr;
1682d9a7b0a5SMarcel Holtmann } __packed;
1683d9a7b0a5SMarcel Holtmann
16843d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST 0x2012
16853d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list {
1686d9a7b0a5SMarcel Holtmann __u8 bdaddr_type;
1687d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr;
1688d9a7b0a5SMarcel Holtmann } __packed;
1689d9a7b0a5SMarcel Holtmann
16902ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013
16912ce603ebSClaudio Takahasi struct hci_cp_le_conn_update {
16922ce603ebSClaudio Takahasi __le16 handle;
16932ce603ebSClaudio Takahasi __le16 conn_interval_min;
16942ce603ebSClaudio Takahasi __le16 conn_interval_max;
16952ce603ebSClaudio Takahasi __le16 conn_latency;
16962ce603ebSClaudio Takahasi __le16 supervision_timeout;
16972ce603ebSClaudio Takahasi __le16 min_ce_len;
16982ce603ebSClaudio Takahasi __le16 max_ce_len;
16992ce603ebSClaudio Takahasi } __packed;
17002ce603ebSClaudio Takahasi
17010fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016
17020fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features {
17030fe29fd1SMarcel Holtmann __le16 handle;
17040fe29fd1SMarcel Holtmann } __packed;
17050fe29fd1SMarcel Holtmann
1706a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019
1707a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc {
1708a7a595f6SVinicius Costa Gomes __le16 handle;
1709fe39c7b2SMarcel Holtmann __le64 rand;
1710a7a595f6SVinicius Costa Gomes __le16 ediv;
1711a7a595f6SVinicius Costa Gomes __u8 ltk[16];
1712a7a595f6SVinicius Costa Gomes } __packed;
1713a7a595f6SVinicius Costa Gomes
1714a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a
1715a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply {
1716a7a595f6SVinicius Costa Gomes __le16 handle;
1717a7a595f6SVinicius Costa Gomes __u8 ltk[16];
1718a7a595f6SVinicius Costa Gomes } __packed;
1719a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply {
1720a7a595f6SVinicius Costa Gomes __u8 status;
1721a7a595f6SVinicius Costa Gomes __le16 handle;
1722a7a595f6SVinicius Costa Gomes } __packed;
1723a7a595f6SVinicius Costa Gomes
1724a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b
1725a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply {
1726a7a595f6SVinicius Costa Gomes __le16 handle;
1727a7a595f6SVinicius Costa Gomes } __packed;
1728a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply {
1729a7a595f6SVinicius Costa Gomes __u8 status;
1730a7a595f6SVinicius Costa Gomes __le16 handle;
1731a7a595f6SVinicius Costa Gomes } __packed;
1732a7a595f6SVinicius Costa Gomes
17339b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c
17349b008c04SJohan Hedberg struct hci_rp_le_read_supported_states {
17359b008c04SJohan Hedberg __u8 status;
17369b008c04SJohan Hedberg __u8 le_states[8];
17379b008c04SJohan Hedberg } __packed;
17389b008c04SJohan Hedberg
17398e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020
17408e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply {
17418e75b46aSAndre Guedes __le16 handle;
17428e75b46aSAndre Guedes __le16 interval_min;
17438e75b46aSAndre Guedes __le16 interval_max;
17448e75b46aSAndre Guedes __le16 latency;
17458e75b46aSAndre Guedes __le16 timeout;
17468e75b46aSAndre Guedes __le16 min_ce_len;
17478e75b46aSAndre Guedes __le16 max_ce_len;
17488e75b46aSAndre Guedes } __packed;
17498e75b46aSAndre Guedes
17508e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021
17518e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply {
17528e75b46aSAndre Guedes __le16 handle;
17538e75b46aSAndre Guedes __u8 reason;
17548e75b46aSAndre Guedes } __packed;
17558e75b46aSAndre Guedes
175694a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022
175794a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len {
175894a3bd02SMarcel Holtmann __le16 handle;
175994a3bd02SMarcel Holtmann __le16 tx_len;
176094a3bd02SMarcel Holtmann __le16 tx_time;
176194a3bd02SMarcel Holtmann } __packed;
176294a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len {
176394a3bd02SMarcel Holtmann __u8 status;
176494a3bd02SMarcel Holtmann __le16 handle;
176594a3bd02SMarcel Holtmann } __packed;
176694a3bd02SMarcel Holtmann
176794a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023
176894a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len {
176994a3bd02SMarcel Holtmann __u8 status;
177094a3bd02SMarcel Holtmann __le16 tx_len;
177194a3bd02SMarcel Holtmann __le16 tx_time;
177294a3bd02SMarcel Holtmann } __packed;
177394a3bd02SMarcel Holtmann
177494a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024
177594a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len {
177694a3bd02SMarcel Holtmann __le16 tx_len;
177794a3bd02SMarcel Holtmann __le16 tx_time;
177894a3bd02SMarcel Holtmann } __packed;
177994a3bd02SMarcel Holtmann
1780b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027
1781b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list {
1782b950aa88SAnkit Navik __u8 bdaddr_type;
1783b950aa88SAnkit Navik bdaddr_t bdaddr;
1784b950aa88SAnkit Navik __u8 peer_irk[16];
1785b950aa88SAnkit Navik __u8 local_irk[16];
1786b950aa88SAnkit Navik } __packed;
1787b950aa88SAnkit Navik
1788b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028
1789b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list {
1790b950aa88SAnkit Navik __u8 bdaddr_type;
1791b950aa88SAnkit Navik bdaddr_t bdaddr;
1792b950aa88SAnkit Navik } __packed;
1793b950aa88SAnkit Navik
1794545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029
1795545f2596SAnkit Navik
1796cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a
1797cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size {
1798cfdb0c2dSAnkit Navik __u8 status;
1799cfdb0c2dSAnkit Navik __u8 size;
1800cfdb0c2dSAnkit Navik } __packed;
1801cfdb0c2dSAnkit Navik
1802aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d
1803aa12af77SAnkit Navik
1804b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e
1805b2cc2339SSathish Narasimman
180694a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f
180794a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len {
180894a3bd02SMarcel Holtmann __u8 status;
180994a3bd02SMarcel Holtmann __le16 tx_len;
181094a3bd02SMarcel Holtmann __le16 tx_time;
181194a3bd02SMarcel Holtmann __le16 rx_len;
181294a3bd02SMarcel Holtmann __le16 rx_time;
181394a3bd02SMarcel Holtmann } __packed;
181494a3bd02SMarcel Holtmann
1815de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031
1816de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy {
1817de2ba303SMarcel Holtmann __u8 all_phys;
1818de2ba303SMarcel Holtmann __u8 tx_phys;
1819de2ba303SMarcel Holtmann __u8 rx_phys;
1820de2ba303SMarcel Holtmann } __packed;
1821de2ba303SMarcel Holtmann
18226decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01
18236decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02
18246decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04
18256decb5b4SJaganath Kanakkassery
1826a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041
1827a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params {
1828a2344b9eSJaganath Kanakkassery __u8 own_addr_type;
1829a2344b9eSJaganath Kanakkassery __u8 filter_policy;
1830a2344b9eSJaganath Kanakkassery __u8 scanning_phys;
1831a7e45454SGustavo A. R. Silva __u8 data[];
1832a2344b9eSJaganath Kanakkassery } __packed;
1833a2344b9eSJaganath Kanakkassery
1834a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01
183545bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02
183645bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04
1837a2344b9eSJaganath Kanakkassery
1838a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params {
1839a2344b9eSJaganath Kanakkassery __u8 type;
1840a2344b9eSJaganath Kanakkassery __le16 interval;
1841a2344b9eSJaganath Kanakkassery __le16 window;
1842a2344b9eSJaganath Kanakkassery } __packed;
1843a2344b9eSJaganath Kanakkassery
1844a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042
1845a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable {
1846a2344b9eSJaganath Kanakkassery __u8 enable;
1847a2344b9eSJaganath Kanakkassery __u8 filter_dup;
1848a2344b9eSJaganath Kanakkassery __le16 duration;
1849a2344b9eSJaganath Kanakkassery __le16 period;
1850a2344b9eSJaganath Kanakkassery } __packed;
1851a2344b9eSJaganath Kanakkassery
18524d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043
18534d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn {
18544d94f95dSJaganath Kanakkassery __u8 filter_policy;
18554d94f95dSJaganath Kanakkassery __u8 own_addr_type;
18564d94f95dSJaganath Kanakkassery __u8 peer_addr_type;
18574d94f95dSJaganath Kanakkassery bdaddr_t peer_addr;
18584d94f95dSJaganath Kanakkassery __u8 phys;
1859a7e45454SGustavo A. R. Silva __u8 data[];
18604d94f95dSJaganath Kanakkassery } __packed;
18614d94f95dSJaganath Kanakkassery
18624d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param {
18634d94f95dSJaganath Kanakkassery __le16 scan_interval;
18644d94f95dSJaganath Kanakkassery __le16 scan_window;
18654d94f95dSJaganath Kanakkassery __le16 conn_interval_min;
18664d94f95dSJaganath Kanakkassery __le16 conn_interval_max;
18674d94f95dSJaganath Kanakkassery __le16 conn_latency;
18684d94f95dSJaganath Kanakkassery __le16 supervision_timeout;
18694d94f95dSJaganath Kanakkassery __le16 min_ce_len;
18704d94f95dSJaganath Kanakkassery __le16 max_ce_len;
18714d94f95dSJaganath Kanakkassery } __packed;
18724d94f95dSJaganath Kanakkassery
1873eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_CREATE_SYNC 0x2044
1874eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_create_sync {
1875eca0ae4aSLuiz Augusto von Dentz __u8 options;
1876eca0ae4aSLuiz Augusto von Dentz __u8 sid;
1877eca0ae4aSLuiz Augusto von Dentz __u8 addr_type;
1878eca0ae4aSLuiz Augusto von Dentz bdaddr_t addr;
1879eca0ae4aSLuiz Augusto von Dentz __le16 skip;
1880eca0ae4aSLuiz Augusto von Dentz __le16 sync_timeout;
1881eca0ae4aSLuiz Augusto von Dentz __u8 sync_cte_type;
1882eca0ae4aSLuiz Augusto von Dentz } __packed;
1883eca0ae4aSLuiz Augusto von Dentz
1884eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_PA_TERM_SYNC 0x2046
1885eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_pa_term_sync {
1886eca0ae4aSLuiz Augusto von Dentz __le16 handle;
1887eca0ae4aSLuiz Augusto von Dentz } __packed;
1888eca0ae4aSLuiz Augusto von Dentz
18896b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b
18906b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets {
18916b49bcb4SJaganath Kanakkassery __u8 status;
18926b49bcb4SJaganath Kanakkassery __u8 num_of_sets;
18936b49bcb4SJaganath Kanakkassery } __packed;
18946b49bcb4SJaganath Kanakkassery
1895de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036
1896de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params {
1897de181e88SJaganath Kanakkassery __u8 handle;
1898de181e88SJaganath Kanakkassery __le16 evt_properties;
1899de181e88SJaganath Kanakkassery __u8 min_interval[3];
1900de181e88SJaganath Kanakkassery __u8 max_interval[3];
1901de181e88SJaganath Kanakkassery __u8 channel_map;
1902de181e88SJaganath Kanakkassery __u8 own_addr_type;
1903de181e88SJaganath Kanakkassery __u8 peer_addr_type;
1904de181e88SJaganath Kanakkassery bdaddr_t peer_addr;
1905de181e88SJaganath Kanakkassery __u8 filter_policy;
1906de181e88SJaganath Kanakkassery __u8 tx_power;
1907de181e88SJaganath Kanakkassery __u8 primary_phy;
1908de181e88SJaganath Kanakkassery __u8 secondary_max_skip;
1909de181e88SJaganath Kanakkassery __u8 secondary_phy;
1910de181e88SJaganath Kanakkassery __u8 sid;
1911de181e88SJaganath Kanakkassery __u8 notif_enable;
1912de181e88SJaganath Kanakkassery } __packed;
1913de181e88SJaganath Kanakkassery
1914de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01
191585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02
191685a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03
1917de181e88SJaganath Kanakkassery
1918de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params {
1919de181e88SJaganath Kanakkassery __u8 status;
1920de181e88SJaganath Kanakkassery __u8 tx_power;
1921de181e88SJaganath Kanakkassery } __packed;
1922de181e88SJaganath Kanakkassery
1923de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set {
1924de181e88SJaganath Kanakkassery __u8 handle;
1925de181e88SJaganath Kanakkassery __le16 duration;
1926de181e88SJaganath Kanakkassery __u8 max_events;
1927de181e88SJaganath Kanakkassery } __packed;
1928de181e88SJaganath Kanakkassery
1929c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH 251
1930c9ed0a70SLuiz Augusto von Dentz
1931a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037
1932a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data {
1933a0fb3726SJaganath Kanakkassery __u8 handle;
1934a0fb3726SJaganath Kanakkassery __u8 operation;
1935a0fb3726SJaganath Kanakkassery __u8 frag_pref;
1936a0fb3726SJaganath Kanakkassery __u8 length;
1937c9ed0a70SLuiz Augusto von Dentz __u8 data[];
1938a0fb3726SJaganath Kanakkassery } __packed;
1939a0fb3726SJaganath Kanakkassery
1940a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038
1941a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data {
1942a0fb3726SJaganath Kanakkassery __u8 handle;
1943a0fb3726SJaganath Kanakkassery __u8 operation;
1944a0fb3726SJaganath Kanakkassery __u8 frag_pref;
1945a0fb3726SJaganath Kanakkassery __u8 length;
1946c9ed0a70SLuiz Augusto von Dentz __u8 data[];
1947a0fb3726SJaganath Kanakkassery } __packed;
1948a0fb3726SJaganath Kanakkassery
1949eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039
1950eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_ext_adv_enable {
1951eca0ae4aSLuiz Augusto von Dentz __u8 enable;
1952eca0ae4aSLuiz Augusto von Dentz __u8 num_of_sets;
1953eca0ae4aSLuiz Augusto von Dentz __u8 data[];
1954eca0ae4aSLuiz Augusto von Dentz } __packed;
1955eca0ae4aSLuiz Augusto von Dentz
1956eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_PARAMS 0x203e
1957eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_params {
1958eca0ae4aSLuiz Augusto von Dentz __u8 handle;
1959eca0ae4aSLuiz Augusto von Dentz __le16 min_interval;
1960eca0ae4aSLuiz Augusto von Dentz __le16 max_interval;
1961eca0ae4aSLuiz Augusto von Dentz __le16 periodic_properties;
1962eca0ae4aSLuiz Augusto von Dentz } __packed;
1963eca0ae4aSLuiz Augusto von Dentz
1964eca0ae4aSLuiz Augusto von Dentz #define HCI_MAX_PER_AD_LENGTH 252
1965eca0ae4aSLuiz Augusto von Dentz
1966eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_DATA 0x203f
1967eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_data {
1968eca0ae4aSLuiz Augusto von Dentz __u8 handle;
1969eca0ae4aSLuiz Augusto von Dentz __u8 operation;
1970eca0ae4aSLuiz Augusto von Dentz __u8 length;
1971eca0ae4aSLuiz Augusto von Dentz __u8 data[];
1972eca0ae4aSLuiz Augusto von Dentz } __packed;
1973eca0ae4aSLuiz Augusto von Dentz
1974eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_SET_PER_ADV_ENABLE 0x2040
1975eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_set_per_adv_enable {
1976eca0ae4aSLuiz Augusto von Dentz __u8 enable;
1977eca0ae4aSLuiz Augusto von Dentz __u8 handle;
1978eca0ae4aSLuiz Augusto von Dentz } __packed;
1979eca0ae4aSLuiz Augusto von Dentz
1980a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03
1981a0fb3726SJaganath Kanakkassery
1982a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01
1983a0fb3726SJaganath Kanakkassery
1984a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET 0x203c
1985a9e45698SSathish Narsimman
198645b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d
198745b7749fSJaganath Kanakkassery
1988a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035
1989a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr {
1990a73c046aSJaganath Kanakkassery __u8 handle;
1991a73c046aSJaganath Kanakkassery bdaddr_t bdaddr;
1992a73c046aSJaganath Kanakkassery } __packed;
1993a73c046aSJaganath Kanakkassery
19947c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b
19957c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power {
19967c395ea5SDaniel Winkler __u8 status;
19977c395ea5SDaniel Winkler __s8 min_le_tx_power;
19987c395ea5SDaniel Winkler __s8 max_le_tx_power;
19997c395ea5SDaniel Winkler } __packed;
20007c395ea5SDaniel Winkler
2001853b70b5SLuiz Augusto von Dentz #define HCI_NETWORK_PRIVACY 0x00
2002853b70b5SLuiz Augusto von Dentz #define HCI_DEVICE_PRIVACY 0x01
2003853b70b5SLuiz Augusto von Dentz
2004853b70b5SLuiz Augusto von Dentz #define HCI_OP_LE_SET_PRIVACY_MODE 0x204e
2005853b70b5SLuiz Augusto von Dentz struct hci_cp_le_set_privacy_mode {
2006853b70b5SLuiz Augusto von Dentz __u8 bdaddr_type;
2007853b70b5SLuiz Augusto von Dentz bdaddr_t bdaddr;
2008853b70b5SLuiz Augusto von Dentz __u8 mode;
2009853b70b5SLuiz Augusto von Dentz } __packed;
2010853b70b5SLuiz Augusto von Dentz
20114de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060
20124de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 {
20134de0fc59SLuiz Augusto von Dentz __u8 status;
20144de0fc59SLuiz Augusto von Dentz __le16 acl_mtu;
20154de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt;
20164de0fc59SLuiz Augusto von Dentz __le16 iso_mtu;
20174de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt;
20184de0fc59SLuiz Augusto von Dentz } __packed;
20194de0fc59SLuiz Augusto von Dentz
20204de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061
20214de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync {
20224de0fc59SLuiz Augusto von Dentz __le16 handle;
20234de0fc59SLuiz Augusto von Dentz } __packed;
20244de0fc59SLuiz Augusto von Dentz
20254de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync {
20264de0fc59SLuiz Augusto von Dentz __u8 status;
20274de0fc59SLuiz Augusto von Dentz __le16 handle;
20284de0fc59SLuiz Augusto von Dentz __le16 seq;
20294de0fc59SLuiz Augusto von Dentz __le32 imestamp;
20304de0fc59SLuiz Augusto von Dentz __u8 offset[3];
20314de0fc59SLuiz Augusto von Dentz } __packed;
20324de0fc59SLuiz Augusto von Dentz
20334de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062
20344de0fc59SLuiz Augusto von Dentz struct hci_cis_params {
20354de0fc59SLuiz Augusto von Dentz __u8 cis_id;
203676c185a5SArchie Pusaka __le16 c_sdu;
203726afbd82SLuiz Augusto von Dentz __le16 p_sdu;
203876c185a5SArchie Pusaka __u8 c_phy;
203976c185a5SArchie Pusaka __u8 p_phy;
204076c185a5SArchie Pusaka __u8 c_rtn;
204176c185a5SArchie Pusaka __u8 p_rtn;
20424de0fc59SLuiz Augusto von Dentz } __packed;
20434de0fc59SLuiz Augusto von Dentz
20444de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params {
20454de0fc59SLuiz Augusto von Dentz __u8 cig_id;
204676c185a5SArchie Pusaka __u8 c_interval[3];
204776c185a5SArchie Pusaka __u8 p_interval[3];
204826afbd82SLuiz Augusto von Dentz __u8 sca;
20494de0fc59SLuiz Augusto von Dentz __u8 packing;
20504de0fc59SLuiz Augusto von Dentz __u8 framing;
205176c185a5SArchie Pusaka __le16 c_latency;
205276c185a5SArchie Pusaka __le16 p_latency;
20534de0fc59SLuiz Augusto von Dentz __u8 num_cis;
2054a7e45454SGustavo A. R. Silva struct hci_cis_params cis[];
20554de0fc59SLuiz Augusto von Dentz } __packed;
20564de0fc59SLuiz Augusto von Dentz
20574de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params {
20584de0fc59SLuiz Augusto von Dentz __u8 status;
20594de0fc59SLuiz Augusto von Dentz __u8 cig_id;
20604de0fc59SLuiz Augusto von Dentz __u8 num_handles;
2061a7e45454SGustavo A. R. Silva __le16 handle[];
20624de0fc59SLuiz Augusto von Dentz } __packed;
20634de0fc59SLuiz Augusto von Dentz
20644de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064
20654de0fc59SLuiz Augusto von Dentz struct hci_cis {
20664de0fc59SLuiz Augusto von Dentz __le16 cis_handle;
20674de0fc59SLuiz Augusto von Dentz __le16 acl_handle;
20684de0fc59SLuiz Augusto von Dentz } __packed;
20694de0fc59SLuiz Augusto von Dentz
20704de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis {
20714de0fc59SLuiz Augusto von Dentz __u8 num_cis;
2072a7e45454SGustavo A. R. Silva struct hci_cis cis[];
20734de0fc59SLuiz Augusto von Dentz } __packed;
20744de0fc59SLuiz Augusto von Dentz
20754de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065
20764de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig {
20774de0fc59SLuiz Augusto von Dentz __u8 cig_id;
20784de0fc59SLuiz Augusto von Dentz } __packed;
20794de0fc59SLuiz Augusto von Dentz
20804de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066
20814de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis {
20824de0fc59SLuiz Augusto von Dentz __le16 handle;
20834de0fc59SLuiz Augusto von Dentz } __packed;
20844de0fc59SLuiz Augusto von Dentz
20854de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067
20864de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis {
20874de0fc59SLuiz Augusto von Dentz __le16 handle;
20884de0fc59SLuiz Augusto von Dentz __u8 reason;
20894de0fc59SLuiz Augusto von Dentz } __packed;
20904de0fc59SLuiz Augusto von Dentz
2091eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_BIG 0x2068
2092eca0ae4aSLuiz Augusto von Dentz struct hci_bis {
2093eca0ae4aSLuiz Augusto von Dentz __u8 sdu_interval[3];
2094eca0ae4aSLuiz Augusto von Dentz __le16 sdu;
2095eca0ae4aSLuiz Augusto von Dentz __le16 latency;
2096eca0ae4aSLuiz Augusto von Dentz __u8 rtn;
2097eca0ae4aSLuiz Augusto von Dentz __u8 phy;
2098eca0ae4aSLuiz Augusto von Dentz __u8 packing;
2099eca0ae4aSLuiz Augusto von Dentz __u8 framing;
2100eca0ae4aSLuiz Augusto von Dentz __u8 encryption;
2101eca0ae4aSLuiz Augusto von Dentz __u8 bcode[16];
2102eca0ae4aSLuiz Augusto von Dentz } __packed;
2103eca0ae4aSLuiz Augusto von Dentz
2104eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_create_big {
2105eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2106eca0ae4aSLuiz Augusto von Dentz __u8 adv_handle;
2107eca0ae4aSLuiz Augusto von Dentz __u8 num_bis;
2108eca0ae4aSLuiz Augusto von Dentz struct hci_bis bis;
2109eca0ae4aSLuiz Augusto von Dentz } __packed;
2110eca0ae4aSLuiz Augusto von Dentz
2111eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_TERM_BIG 0x206a
2112eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_term_big {
2113eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2114eca0ae4aSLuiz Augusto von Dentz __u8 reason;
2115eca0ae4aSLuiz Augusto von Dentz } __packed;
2116eca0ae4aSLuiz Augusto von Dentz
2117eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_CREATE_SYNC 0x206b
2118eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_create_sync {
2119eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2120eca0ae4aSLuiz Augusto von Dentz __le16 sync_handle;
2121eca0ae4aSLuiz Augusto von Dentz __u8 encryption;
2122eca0ae4aSLuiz Augusto von Dentz __u8 bcode[16];
2123eca0ae4aSLuiz Augusto von Dentz __u8 mse;
2124eca0ae4aSLuiz Augusto von Dentz __le16 timeout;
2125eca0ae4aSLuiz Augusto von Dentz __u8 num_bis;
2126969cf3e6SGustavo A. R. Silva __u8 bis[];
2127eca0ae4aSLuiz Augusto von Dentz } __packed;
2128eca0ae4aSLuiz Augusto von Dentz
2129eca0ae4aSLuiz Augusto von Dentz #define HCI_OP_LE_BIG_TERM_SYNC 0x206c
2130eca0ae4aSLuiz Augusto von Dentz struct hci_cp_le_big_term_sync {
2131eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2132eca0ae4aSLuiz Augusto von Dentz } __packed;
2133eca0ae4aSLuiz Augusto von Dentz
213426afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SETUP_ISO_PATH 0x206e
213526afbd82SLuiz Augusto von Dentz struct hci_cp_le_setup_iso_path {
213626afbd82SLuiz Augusto von Dentz __le16 handle;
213726afbd82SLuiz Augusto von Dentz __u8 direction;
213826afbd82SLuiz Augusto von Dentz __u8 path;
213926afbd82SLuiz Augusto von Dentz __u8 codec;
214026afbd82SLuiz Augusto von Dentz __le16 codec_cid;
214126afbd82SLuiz Augusto von Dentz __le16 codec_vid;
214226afbd82SLuiz Augusto von Dentz __u8 delay[3];
214326afbd82SLuiz Augusto von Dentz __u8 codec_cfg_len;
2144969cf3e6SGustavo A. R. Silva __u8 codec_cfg[];
214526afbd82SLuiz Augusto von Dentz } __packed;
214626afbd82SLuiz Augusto von Dentz
214726afbd82SLuiz Augusto von Dentz struct hci_rp_le_setup_iso_path {
214826afbd82SLuiz Augusto von Dentz __u8 status;
214926afbd82SLuiz Augusto von Dentz __le16 handle;
215026afbd82SLuiz Augusto von Dentz } __packed;
215126afbd82SLuiz Augusto von Dentz
215226afbd82SLuiz Augusto von Dentz #define HCI_OP_LE_SET_HOST_FEATURE 0x2074
215326afbd82SLuiz Augusto von Dentz struct hci_cp_le_set_host_feature {
215426afbd82SLuiz Augusto von Dentz __u8 bit_number;
215526afbd82SLuiz Augusto von Dentz __u8 bit_value;
215626afbd82SLuiz Augusto von Dentz } __packed;
215726afbd82SLuiz Augusto von Dentz
21581da177e4SLinus Torvalds /* ---- HCI Events ---- */
2159ae61a10dSLuiz Augusto von Dentz struct hci_ev_status {
2160ae61a10dSLuiz Augusto von Dentz __u8 status;
2161ae61a10dSLuiz Augusto von Dentz } __packed;
2162ae61a10dSLuiz Augusto von Dentz
21631da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01
21641da177e4SLinus Torvalds
21651da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02
21661da177e4SLinus Torvalds struct inquiry_info {
21671da177e4SLinus Torvalds bdaddr_t bdaddr;
21681da177e4SLinus Torvalds __u8 pscan_rep_mode;
21691da177e4SLinus Torvalds __u8 pscan_period_mode;
21701da177e4SLinus Torvalds __u8 pscan_mode;
21711da177e4SLinus Torvalds __u8 dev_class[3];
21721ebb9252SMarcel Holtmann __le16 clock_offset;
217366c853ccSGustavo F. Padovan } __packed;
21741da177e4SLinus Torvalds
217527d9eb4bSLuiz Augusto von Dentz struct hci_ev_inquiry_result {
217627d9eb4bSLuiz Augusto von Dentz __u8 num;
217727d9eb4bSLuiz Augusto von Dentz struct inquiry_info info[];
217827d9eb4bSLuiz Augusto von Dentz };
217927d9eb4bSLuiz Augusto von Dentz
21801da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03
21811da177e4SLinus Torvalds struct hci_ev_conn_complete {
21821da177e4SLinus Torvalds __u8 status;
21831ebb9252SMarcel Holtmann __le16 handle;
21841da177e4SLinus Torvalds bdaddr_t bdaddr;
21851da177e4SLinus Torvalds __u8 link_type;
21861da177e4SLinus Torvalds __u8 encr_mode;
218766c853ccSGustavo F. Padovan } __packed;
21881da177e4SLinus Torvalds
21891da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04
21901da177e4SLinus Torvalds struct hci_ev_conn_request {
21911da177e4SLinus Torvalds bdaddr_t bdaddr;
21921da177e4SLinus Torvalds __u8 dev_class[3];
21931da177e4SLinus Torvalds __u8 link_type;
219466c853ccSGustavo F. Padovan } __packed;
21951da177e4SLinus Torvalds
21961da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05
21971da177e4SLinus Torvalds struct hci_ev_disconn_complete {
21981da177e4SLinus Torvalds __u8 status;
21991ebb9252SMarcel Holtmann __le16 handle;
22001da177e4SLinus Torvalds __u8 reason;
220166c853ccSGustavo F. Padovan } __packed;
22021da177e4SLinus Torvalds
22031da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06
22041da177e4SLinus Torvalds struct hci_ev_auth_complete {
22051da177e4SLinus Torvalds __u8 status;
22061ebb9252SMarcel Holtmann __le16 handle;
220766c853ccSGustavo F. Padovan } __packed;
22081da177e4SLinus Torvalds
2209a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07
2210a9de9248SMarcel Holtmann struct hci_ev_remote_name {
2211a9de9248SMarcel Holtmann __u8 status;
2212a9de9248SMarcel Holtmann bdaddr_t bdaddr;
22131f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH];
221466c853ccSGustavo F. Padovan } __packed;
2215a9de9248SMarcel Holtmann
22161da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08
22171da177e4SLinus Torvalds struct hci_ev_encrypt_change {
22181da177e4SLinus Torvalds __u8 status;
22191ebb9252SMarcel Holtmann __le16 handle;
22201da177e4SLinus Torvalds __u8 encrypt;
222166c853ccSGustavo F. Padovan } __packed;
22221da177e4SLinus Torvalds
2223a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09
2224a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete {
22251da177e4SLinus Torvalds __u8 status;
22261ebb9252SMarcel Holtmann __le16 handle;
222766c853ccSGustavo F. Padovan } __packed;
22281da177e4SLinus Torvalds
2229a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b
2230a9de9248SMarcel Holtmann struct hci_ev_remote_features {
2231a9de9248SMarcel Holtmann __u8 status;
2232a9de9248SMarcel Holtmann __le16 handle;
2233a9de9248SMarcel Holtmann __u8 features[8];
223466c853ccSGustavo F. Padovan } __packed;
2235a9de9248SMarcel Holtmann
2236a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c
2237a9de9248SMarcel Holtmann struct hci_ev_remote_version {
2238a9de9248SMarcel Holtmann __u8 status;
2239a9de9248SMarcel Holtmann __le16 handle;
2240a9de9248SMarcel Holtmann __u8 lmp_ver;
2241a9de9248SMarcel Holtmann __le16 manufacturer;
2242a9de9248SMarcel Holtmann __le16 lmp_subver;
224366c853ccSGustavo F. Padovan } __packed;
2244a9de9248SMarcel Holtmann
2245a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d
22461da177e4SLinus Torvalds struct hci_qos {
22471da177e4SLinus Torvalds __u8 service_type;
22481da177e4SLinus Torvalds __u32 token_rate;
22491da177e4SLinus Torvalds __u32 peak_bandwidth;
22501da177e4SLinus Torvalds __u32 latency;
22511da177e4SLinus Torvalds __u32 delay_variation;
225266c853ccSGustavo F. Padovan } __packed;
22531da177e4SLinus Torvalds struct hci_ev_qos_setup_complete {
22541da177e4SLinus Torvalds __u8 status;
22551ebb9252SMarcel Holtmann __le16 handle;
22561da177e4SLinus Torvalds struct hci_qos qos;
225766c853ccSGustavo F. Padovan } __packed;
22581da177e4SLinus Torvalds
2259a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e
22601da177e4SLinus Torvalds struct hci_ev_cmd_complete {
22611da177e4SLinus Torvalds __u8 ncmd;
22621ebb9252SMarcel Holtmann __le16 opcode;
226366c853ccSGustavo F. Padovan } __packed;
22641da177e4SLinus Torvalds
2265a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f
22661da177e4SLinus Torvalds struct hci_ev_cmd_status {
22671da177e4SLinus Torvalds __u8 status;
22681da177e4SLinus Torvalds __u8 ncmd;
22691ebb9252SMarcel Holtmann __le16 opcode;
227066c853ccSGustavo F. Padovan } __packed;
22711da177e4SLinus Torvalds
227224dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10
227324dfa343SMarcel Holtmann struct hci_ev_hardware_error {
227424dfa343SMarcel Holtmann __u8 code;
227524dfa343SMarcel Holtmann } __packed;
227624dfa343SMarcel Holtmann
22771da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12
22781da177e4SLinus Torvalds struct hci_ev_role_change {
22791da177e4SLinus Torvalds __u8 status;
22801da177e4SLinus Torvalds bdaddr_t bdaddr;
22811da177e4SLinus Torvalds __u8 role;
228266c853ccSGustavo F. Padovan } __packed;
22831da177e4SLinus Torvalds
2284a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13
2285613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info {
2286613a1c0cSAndrei Emeltchenko __le16 handle;
2287613a1c0cSAndrei Emeltchenko __le16 count;
2288613a1c0cSAndrei Emeltchenko } __packed;
2289613a1c0cSAndrei Emeltchenko
2290a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts {
2291aadc3d2fSLuiz Augusto von Dentz __u8 num;
2292a7e45454SGustavo A. R. Silva struct hci_comp_pkts_info handles[];
229366c853ccSGustavo F. Padovan } __packed;
2294a9de9248SMarcel Holtmann
22951da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14
22961da177e4SLinus Torvalds struct hci_ev_mode_change {
22971da177e4SLinus Torvalds __u8 status;
22981ebb9252SMarcel Holtmann __le16 handle;
22991da177e4SLinus Torvalds __u8 mode;
23001ebb9252SMarcel Holtmann __le16 interval;
230166c853ccSGustavo F. Padovan } __packed;
23021da177e4SLinus Torvalds
23031da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16
23041da177e4SLinus Torvalds struct hci_ev_pin_code_req {
23051da177e4SLinus Torvalds bdaddr_t bdaddr;
230666c853ccSGustavo F. Padovan } __packed;
23071da177e4SLinus Torvalds
23081da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17
23091da177e4SLinus Torvalds struct hci_ev_link_key_req {
23101da177e4SLinus Torvalds bdaddr_t bdaddr;
231166c853ccSGustavo F. Padovan } __packed;
23121da177e4SLinus Torvalds
23131da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18
23141da177e4SLinus Torvalds struct hci_ev_link_key_notify {
23151da177e4SLinus Torvalds bdaddr_t bdaddr;
23169b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE];
23171da177e4SLinus Torvalds __u8 key_type;
231866c853ccSGustavo F. Padovan } __packed;
23191da177e4SLinus Torvalds
2320a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c
23211da177e4SLinus Torvalds struct hci_ev_clock_offset {
23221da177e4SLinus Torvalds __u8 status;
23231ebb9252SMarcel Holtmann __le16 handle;
23241ebb9252SMarcel Holtmann __le16 clock_offset;
232566c853ccSGustavo F. Padovan } __packed;
23261da177e4SLinus Torvalds
2327a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d
2328a8746417SMarcel Holtmann struct hci_ev_pkt_type_change {
2329a8746417SMarcel Holtmann __u8 status;
2330a8746417SMarcel Holtmann __le16 handle;
2331a8746417SMarcel Holtmann __le16 pkt_type;
233266c853ccSGustavo F. Padovan } __packed;
2333a8746417SMarcel Holtmann
233485a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20
233585a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode {
233685a1e930SMarcel Holtmann bdaddr_t bdaddr;
233785a1e930SMarcel Holtmann __u8 pscan_rep_mode;
233866c853ccSGustavo F. Padovan } __packed;
233985a1e930SMarcel Holtmann
2340a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
23418d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi {
2342a9de9248SMarcel Holtmann bdaddr_t bdaddr;
2343a9de9248SMarcel Holtmann __u8 pscan_rep_mode;
2344a9de9248SMarcel Holtmann __u8 pscan_period_mode;
2345a9de9248SMarcel Holtmann __u8 dev_class[3];
2346a9de9248SMarcel Holtmann __le16 clock_offset;
2347a9de9248SMarcel Holtmann __s8 rssi;
234866c853ccSGustavo F. Padovan } __packed;
23498d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi_pscan {
2350a9de9248SMarcel Holtmann bdaddr_t bdaddr;
2351a9de9248SMarcel Holtmann __u8 pscan_rep_mode;
2352a9de9248SMarcel Holtmann __u8 pscan_period_mode;
2353a9de9248SMarcel Holtmann __u8 pscan_mode;
2354a9de9248SMarcel Holtmann __u8 dev_class[3];
2355a9de9248SMarcel Holtmann __le16 clock_offset;
2356a9de9248SMarcel Holtmann __s8 rssi;
235766c853ccSGustavo F. Padovan } __packed;
23588d08d324SLuiz Augusto von Dentz struct hci_ev_inquiry_result_rssi {
23598d08d324SLuiz Augusto von Dentz __u8 num;
236072279d17SLuiz Augusto von Dentz __u8 data[];
23618d08d324SLuiz Augusto von Dentz } __packed;
2362a9de9248SMarcel Holtmann
2363a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23
2364a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features {
2365a9de9248SMarcel Holtmann __u8 status;
2366a9de9248SMarcel Holtmann __le16 handle;
2367a9de9248SMarcel Holtmann __u8 page;
2368a9de9248SMarcel Holtmann __u8 max_page;
2369a9de9248SMarcel Holtmann __u8 features[8];
237066c853ccSGustavo F. Padovan } __packed;
2371a9de9248SMarcel Holtmann
2372a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c
2373a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete {
2374a9de9248SMarcel Holtmann __u8 status;
2375a9de9248SMarcel Holtmann __le16 handle;
2376a9de9248SMarcel Holtmann bdaddr_t bdaddr;
2377a9de9248SMarcel Holtmann __u8 link_type;
2378a9de9248SMarcel Holtmann __u8 tx_interval;
2379a9de9248SMarcel Holtmann __u8 retrans_window;
2380a9de9248SMarcel Holtmann __le16 rx_pkt_len;
2381a9de9248SMarcel Holtmann __le16 tx_pkt_len;
2382a9de9248SMarcel Holtmann __u8 air_mode;
238366c853ccSGustavo F. Padovan } __packed;
2384a9de9248SMarcel Holtmann
2385a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d
2386a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed {
2387a9de9248SMarcel Holtmann __u8 status;
2388a9de9248SMarcel Holtmann __le16 handle;
2389a9de9248SMarcel Holtmann __u8 tx_interval;
2390a9de9248SMarcel Holtmann __u8 retrans_window;
2391a9de9248SMarcel Holtmann __le16 rx_pkt_len;
2392a9de9248SMarcel Holtmann __le16 tx_pkt_len;
239366c853ccSGustavo F. Padovan } __packed;
2394a9de9248SMarcel Holtmann
2395a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e
239604837f64SMarcel Holtmann struct hci_ev_sniff_subrate {
239704837f64SMarcel Holtmann __u8 status;
239804837f64SMarcel Holtmann __le16 handle;
239904837f64SMarcel Holtmann __le16 max_tx_latency;
240004837f64SMarcel Holtmann __le16 max_rx_latency;
240104837f64SMarcel Holtmann __le16 max_remote_timeout;
240204837f64SMarcel Holtmann __le16 max_local_timeout;
240366c853ccSGustavo F. Padovan } __packed;
240404837f64SMarcel Holtmann
2405a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f
2406a9de9248SMarcel Holtmann struct extended_inquiry_info {
2407a9de9248SMarcel Holtmann bdaddr_t bdaddr;
2408a9de9248SMarcel Holtmann __u8 pscan_rep_mode;
2409a9de9248SMarcel Holtmann __u8 pscan_period_mode;
2410a9de9248SMarcel Holtmann __u8 dev_class[3];
2411a9de9248SMarcel Holtmann __le16 clock_offset;
2412a9de9248SMarcel Holtmann __s8 rssi;
2413a9de9248SMarcel Holtmann __u8 data[240];
241466c853ccSGustavo F. Padovan } __packed;
2415a9de9248SMarcel Holtmann
241670a6b8deSLuiz Augusto von Dentz struct hci_ev_ext_inquiry_result {
241770a6b8deSLuiz Augusto von Dentz __u8 num;
241870a6b8deSLuiz Augusto von Dentz struct extended_inquiry_info info[];
241970a6b8deSLuiz Augusto von Dentz } __packed;
242070a6b8deSLuiz Augusto von Dentz
24211c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30
24221c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete {
24231c2e0041SJohan Hedberg __u8 status;
24241c2e0041SJohan Hedberg __le16 handle;
24251c2e0041SJohan Hedberg } __packed;
24261c2e0041SJohan Hedberg
24270493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31
24280493684eSMarcel Holtmann struct hci_ev_io_capa_request {
24290493684eSMarcel Holtmann bdaddr_t bdaddr;
243066c853ccSGustavo F. Padovan } __packed;
24310493684eSMarcel Holtmann
243203b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32
243303b555e1SJohan Hedberg struct hci_ev_io_capa_reply {
243403b555e1SJohan Hedberg bdaddr_t bdaddr;
243503b555e1SJohan Hedberg __u8 capability;
243603b555e1SJohan Hedberg __u8 oob_data;
243703b555e1SJohan Hedberg __u8 authentication;
243803b555e1SJohan Hedberg } __packed;
243903b555e1SJohan Hedberg
2440a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33
2441a5c29683SJohan Hedberg struct hci_ev_user_confirm_req {
2442a5c29683SJohan Hedberg bdaddr_t bdaddr;
2443a5c29683SJohan Hedberg __le32 passkey;
2444a5c29683SJohan Hedberg } __packed;
2445a5c29683SJohan Hedberg
24469ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34
24479ad4019aSBrian Gix struct hci_ev_user_passkey_req {
24489ad4019aSBrian Gix bdaddr_t bdaddr;
24499ad4019aSBrian Gix } __packed;
24509ad4019aSBrian Gix
24512763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35
24522763eda6SSzymon Janc struct hci_ev_remote_oob_data_request {
24532763eda6SSzymon Janc bdaddr_t bdaddr;
24542763eda6SSzymon Janc } __packed;
24552763eda6SSzymon Janc
24560493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
24570493684eSMarcel Holtmann struct hci_ev_simple_pair_complete {
24580493684eSMarcel Holtmann __u8 status;
24590493684eSMarcel Holtmann bdaddr_t bdaddr;
246066c853ccSGustavo F. Padovan } __packed;
24610493684eSMarcel Holtmann
246292a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b
246392a25256SJohan Hedberg struct hci_ev_user_passkey_notify {
246492a25256SJohan Hedberg bdaddr_t bdaddr;
246592a25256SJohan Hedberg __le32 passkey;
246692a25256SJohan Hedberg } __packed;
246792a25256SJohan Hedberg
246892a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0
246992a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1
247092a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2
247192a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3
247292a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4
247392a25256SJohan Hedberg
247492a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c
247592a25256SJohan Hedberg struct hci_ev_keypress_notify {
247692a25256SJohan Hedberg bdaddr_t bdaddr;
247792a25256SJohan Hedberg __u8 type;
247892a25256SJohan Hedberg } __packed;
247992a25256SJohan Hedberg
248041a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d
248141a96212SMarcel Holtmann struct hci_ev_remote_host_features {
248241a96212SMarcel Holtmann bdaddr_t bdaddr;
248341a96212SMarcel Holtmann __u8 features[8];
248466c853ccSGustavo F. Padovan } __packed;
248541a96212SMarcel Holtmann
248663185f64SVille Tervo #define HCI_EV_LE_META 0x3e
248763185f64SVille Tervo struct hci_ev_le_meta {
248863185f64SVille Tervo __u8 subevent;
248963185f64SVille Tervo } __packed;
249063185f64SVille Tervo
2491523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40
2492523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete {
2493523e93cdSAndrei Emeltchenko __u8 status;
2494523e93cdSAndrei Emeltchenko __u8 phy_handle;
2495523e93cdSAndrei Emeltchenko } __packed;
2496523e93cdSAndrei Emeltchenko
2497523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41
2498523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected {
2499523e93cdSAndrei Emeltchenko __u8 phy_handle;
2500523e93cdSAndrei Emeltchenko } __packed;
2501523e93cdSAndrei Emeltchenko
2502523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42
2503523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete {
2504523e93cdSAndrei Emeltchenko __u8 status;
2505523e93cdSAndrei Emeltchenko __u8 phy_handle;
2506523e93cdSAndrei Emeltchenko __u8 reason;
2507523e93cdSAndrei Emeltchenko } __packed;
2508523e93cdSAndrei Emeltchenko
2509523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45
2510523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete {
2511523e93cdSAndrei Emeltchenko __u8 status;
2512523e93cdSAndrei Emeltchenko __le16 handle;
2513523e93cdSAndrei Emeltchenko __u8 phy_handle;
2514523e93cdSAndrei Emeltchenko __u8 flow_spec_id;
2515523e93cdSAndrei Emeltchenko } __packed;
2516523e93cdSAndrei Emeltchenko
2517523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46
2518523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete {
2519523e93cdSAndrei Emeltchenko __u8 status;
2520523e93cdSAndrei Emeltchenko __le16 handle;
2521523e93cdSAndrei Emeltchenko __u8 reason;
2522523e93cdSAndrei Emeltchenko } __packed;
2523523e93cdSAndrei Emeltchenko
252425e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48
252525e89e99SAndrei Emeltchenko struct hci_comp_blocks_info {
252625e89e99SAndrei Emeltchenko __le16 handle;
252725e89e99SAndrei Emeltchenko __le16 pkts;
252825e89e99SAndrei Emeltchenko __le16 blocks;
252925e89e99SAndrei Emeltchenko } __packed;
253025e89e99SAndrei Emeltchenko
253125e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks {
253225e89e99SAndrei Emeltchenko __le16 num_blocks;
253325e89e99SAndrei Emeltchenko __u8 num_hndl;
2534a7e45454SGustavo A. R. Silva struct hci_comp_blocks_info handles[];
253525e89e99SAndrei Emeltchenko } __packed;
253625e89e99SAndrei Emeltchenko
25372b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F
25382b359445SDoHyun Pyun struct hci_ev_sync_train_complete {
25392b359445SDoHyun Pyun __u8 status;
25402b359445SDoHyun Pyun } __packed;
25412b359445SDoHyun Pyun
254276c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT 0x54
25432ed01805SDoHyun Pyun
254463185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01
254563185f64SVille Tervo struct hci_ev_le_conn_complete {
254663185f64SVille Tervo __u8 status;
254763185f64SVille Tervo __le16 handle;
254863185f64SVille Tervo __u8 role;
254963185f64SVille Tervo __u8 bdaddr_type;
255063185f64SVille Tervo bdaddr_t bdaddr;
255163185f64SVille Tervo __le16 interval;
255263185f64SVille Tervo __le16 latency;
255363185f64SVille Tervo __le16 supervision_timeout;
255463185f64SVille Tervo __u8 clk_accurancy;
255563185f64SVille Tervo } __packed;
255663185f64SVille Tervo
25572331fd46SMarcel Holtmann /* Advertising report event types */
25582331fd46SMarcel Holtmann #define LE_ADV_IND 0x00
25592331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01
25602331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02
25612331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03
25622331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04
2563c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05
2564c215e939SJaganath Kanakkassery
2565c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */
2566c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013
2567c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015
2568c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012
2569c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010
2570c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b
2571c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a
25722331fd46SMarcel Holtmann
2573b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */
2574b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000
2575b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001
2576b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002
2577b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004
2578b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008
2579b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010
2580ad38e55eSSven Peter #define LE_EXT_ADV_EVT_TYPE_MASK 0x007f
2581b2cc9761SJaganath Kanakkassery
25822331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00
25832331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01
25846540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02
25856540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED 0x03
25862331fd46SMarcel Holtmann
25872331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02
25882331fd46SMarcel Holtmann struct hci_ev_le_advertising_info {
258947afe93cSLuiz Augusto von Dentz __u8 type;
25902331fd46SMarcel Holtmann __u8 bdaddr_type;
25912331fd46SMarcel Holtmann bdaddr_t bdaddr;
25922331fd46SMarcel Holtmann __u8 length;
2593a7e45454SGustavo A. R. Silva __u8 data[];
25942331fd46SMarcel Holtmann } __packed;
25952331fd46SMarcel Holtmann
259647afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_report {
259747afe93cSLuiz Augusto von Dentz __u8 num;
259847afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_info info[];
259947afe93cSLuiz Augusto von Dentz } __packed;
260047afe93cSLuiz Augusto von Dentz
26011855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03
26021855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete {
26031855d92dSMarcel Holtmann __u8 status;
26041855d92dSMarcel Holtmann __le16 handle;
26051855d92dSMarcel Holtmann __le16 interval;
26061855d92dSMarcel Holtmann __le16 latency;
26071855d92dSMarcel Holtmann __le16 supervision_timeout;
26081855d92dSMarcel Holtmann } __packed;
26091855d92dSMarcel Holtmann
26100fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04
26110fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete {
26120fe29fd1SMarcel Holtmann __u8 status;
26130fe29fd1SMarcel Holtmann __le16 handle;
26140fe29fd1SMarcel Holtmann __u8 features[8];
26150fe29fd1SMarcel Holtmann } __packed;
26160fe29fd1SMarcel Holtmann
2617a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05
2618a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req {
2619a7a595f6SVinicius Costa Gomes __le16 handle;
2620fe39c7b2SMarcel Holtmann __le64 rand;
2621a7a595f6SVinicius Costa Gomes __le16 ediv;
2622a7a595f6SVinicius Costa Gomes } __packed;
2623a7a595f6SVinicius Costa Gomes
26248e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06
26258e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req {
26268e75b46aSAndre Guedes __le16 handle;
26278e75b46aSAndre Guedes __le16 interval_min;
26288e75b46aSAndre Guedes __le16 interval_max;
26298e75b46aSAndre Guedes __le16 latency;
26308e75b46aSAndre Guedes __le16 timeout;
26318e75b46aSAndre Guedes } __packed;
26328e75b46aSAndre Guedes
263394a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07
263494a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change {
263594a3bd02SMarcel Holtmann __le16 handle;
263694a3bd02SMarcel Holtmann __le16 tx_len;
263794a3bd02SMarcel Holtmann __le16 tx_time;
263894a3bd02SMarcel Holtmann __le16 rx_len;
263994a3bd02SMarcel Holtmann __le16 rx_time;
264094a3bd02SMarcel Holtmann } __packed;
264194a3bd02SMarcel Holtmann
264232c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B
264332c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info {
2644a3679649SLuiz Augusto von Dentz __u8 type;
264532c9d43fSMarcel Holtmann __u8 bdaddr_type;
264632c9d43fSMarcel Holtmann bdaddr_t bdaddr;
264732c9d43fSMarcel Holtmann __u8 direct_addr_type;
264832c9d43fSMarcel Holtmann bdaddr_t direct_addr;
264932c9d43fSMarcel Holtmann __s8 rssi;
265032c9d43fSMarcel Holtmann } __packed;
265132c9d43fSMarcel Holtmann
2652a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_report {
2653a3679649SLuiz Augusto von Dentz __u8 num;
2654a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_info info[];
2655a3679649SLuiz Augusto von Dentz } __packed;
2656a3679649SLuiz Augusto von Dentz
26571efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c
26581efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete {
26591efd927dSLuiz Augusto von Dentz __u8 status;
26604de0fc59SLuiz Augusto von Dentz __le16 handle;
26611efd927dSLuiz Augusto von Dentz __u8 tx_phy;
26621efd927dSLuiz Augusto von Dentz __u8 rx_phy;
26631efd927dSLuiz Augusto von Dentz } __packed;
26641efd927dSLuiz Augusto von Dentz
2665c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d
2666b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info {
2667b48b833fSLuiz Augusto von Dentz __le16 type;
2668c215e939SJaganath Kanakkassery __u8 bdaddr_type;
2669c215e939SJaganath Kanakkassery bdaddr_t bdaddr;
2670c215e939SJaganath Kanakkassery __u8 primary_phy;
2671c215e939SJaganath Kanakkassery __u8 secondary_phy;
2672c215e939SJaganath Kanakkassery __u8 sid;
2673c215e939SJaganath Kanakkassery __u8 tx_power;
2674c215e939SJaganath Kanakkassery __s8 rssi;
2675c215e939SJaganath Kanakkassery __le16 interval;
2676c215e939SJaganath Kanakkassery __u8 direct_addr_type;
2677c215e939SJaganath Kanakkassery bdaddr_t direct_addr;
2678c215e939SJaganath Kanakkassery __u8 length;
2679a7e45454SGustavo A. R. Silva __u8 data[];
2680c215e939SJaganath Kanakkassery } __packed;
2681c215e939SJaganath Kanakkassery
2682b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_report {
2683b48b833fSLuiz Augusto von Dentz __u8 num;
2684b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info info[];
2685b48b833fSLuiz Augusto von Dentz } __packed;
2686b48b833fSLuiz Augusto von Dentz
2687eca0ae4aSLuiz Augusto von Dentz #define HCI_EV_LE_PA_SYNC_ESTABLISHED 0x0e
2688eca0ae4aSLuiz Augusto von Dentz struct hci_ev_le_pa_sync_established {
2689eca0ae4aSLuiz Augusto von Dentz __u8 status;
2690eca0ae4aSLuiz Augusto von Dentz __le16 handle;
2691eca0ae4aSLuiz Augusto von Dentz __u8 sid;
2692eca0ae4aSLuiz Augusto von Dentz __u8 bdaddr_type;
2693eca0ae4aSLuiz Augusto von Dentz bdaddr_t bdaddr;
2694eca0ae4aSLuiz Augusto von Dentz __u8 phy;
2695eca0ae4aSLuiz Augusto von Dentz __le16 interval;
2696eca0ae4aSLuiz Augusto von Dentz __u8 clock_accuracy;
2697eca0ae4aSLuiz Augusto von Dentz } __packed;
2698eca0ae4aSLuiz Augusto von Dentz
26994d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a
27004d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete {
27014d94f95dSJaganath Kanakkassery __u8 status;
27024d94f95dSJaganath Kanakkassery __le16 handle;
27034d94f95dSJaganath Kanakkassery __u8 role;
27044d94f95dSJaganath Kanakkassery __u8 bdaddr_type;
27054d94f95dSJaganath Kanakkassery bdaddr_t bdaddr;
27064d94f95dSJaganath Kanakkassery bdaddr_t local_rpa;
27074d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa;
27084d94f95dSJaganath Kanakkassery __le16 interval;
27094d94f95dSJaganath Kanakkassery __le16 latency;
27104d94f95dSJaganath Kanakkassery __le16 supervision_timeout;
27114d94f95dSJaganath Kanakkassery __u8 clk_accurancy;
27124d94f95dSJaganath Kanakkassery } __packed;
27134d94f95dSJaganath Kanakkassery
27149c082631SClaudia Draghicescu #define HCI_EV_LE_PER_ADV_REPORT 0x0f
27159c082631SClaudia Draghicescu struct hci_ev_le_per_adv_report {
27169c082631SClaudia Draghicescu __le16 sync_handle;
27179c082631SClaudia Draghicescu __u8 tx_power;
27189c082631SClaudia Draghicescu __u8 rssi;
27199c082631SClaudia Draghicescu __u8 cte_type;
27209c082631SClaudia Draghicescu __u8 data_status;
27219c082631SClaudia Draghicescu __u8 length;
27229c082631SClaudia Draghicescu __u8 data[];
27239c082631SClaudia Draghicescu } __packed;
27249c082631SClaudia Draghicescu
2725acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12
2726acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term {
2727acf0aeaeSJaganath Kanakkassery __u8 status;
2728acf0aeaeSJaganath Kanakkassery __u8 handle;
2729acf0aeaeSJaganath Kanakkassery __le16 conn_handle;
2730acf0aeaeSJaganath Kanakkassery __u8 num_evts;
2731acf0aeaeSJaganath Kanakkassery } __packed;
2732acf0aeaeSJaganath Kanakkassery
27334de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19
27344de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established {
27354de0fc59SLuiz Augusto von Dentz __u8 status;
27364de0fc59SLuiz Augusto von Dentz __le16 handle;
27374de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3];
27384de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3];
273976c185a5SArchie Pusaka __u8 c_latency[3];
274076c185a5SArchie Pusaka __u8 p_latency[3];
274176c185a5SArchie Pusaka __u8 c_phy;
274276c185a5SArchie Pusaka __u8 p_phy;
27434de0fc59SLuiz Augusto von Dentz __u8 nse;
274476c185a5SArchie Pusaka __u8 c_bn;
274576c185a5SArchie Pusaka __u8 p_bn;
274676c185a5SArchie Pusaka __u8 c_ft;
274776c185a5SArchie Pusaka __u8 p_ft;
274876c185a5SArchie Pusaka __le16 c_mtu;
274976c185a5SArchie Pusaka __le16 p_mtu;
27504de0fc59SLuiz Augusto von Dentz __le16 interval;
27514de0fc59SLuiz Augusto von Dentz } __packed;
27524de0fc59SLuiz Augusto von Dentz
27534de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a
27544de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req {
27554de0fc59SLuiz Augusto von Dentz __le16 acl_handle;
27564de0fc59SLuiz Augusto von Dentz __le16 cis_handle;
27574de0fc59SLuiz Augusto von Dentz __u8 cig_id;
27584de0fc59SLuiz Augusto von Dentz __u8 cis_id;
27594de0fc59SLuiz Augusto von Dentz } __packed;
27604de0fc59SLuiz Augusto von Dentz
2761eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_CREATE_BIG_COMPLETE 0x1b
2762eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_create_big_complete {
2763eca0ae4aSLuiz Augusto von Dentz __u8 status;
2764eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2765eca0ae4aSLuiz Augusto von Dentz __u8 sync_delay[3];
2766eca0ae4aSLuiz Augusto von Dentz __u8 transport_delay[3];
2767eca0ae4aSLuiz Augusto von Dentz __u8 phy;
2768eca0ae4aSLuiz Augusto von Dentz __u8 nse;
2769eca0ae4aSLuiz Augusto von Dentz __u8 bn;
2770eca0ae4aSLuiz Augusto von Dentz __u8 pto;
2771eca0ae4aSLuiz Augusto von Dentz __u8 irc;
2772eca0ae4aSLuiz Augusto von Dentz __le16 max_pdu;
2773eca0ae4aSLuiz Augusto von Dentz __le16 interval;
2774eca0ae4aSLuiz Augusto von Dentz __u8 num_bis;
2775eca0ae4aSLuiz Augusto von Dentz __le16 bis_handle[];
2776eca0ae4aSLuiz Augusto von Dentz } __packed;
2777eca0ae4aSLuiz Augusto von Dentz
2778eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_SYNC_ESTABILISHED 0x1d
2779eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_sync_estabilished {
2780eca0ae4aSLuiz Augusto von Dentz __u8 status;
2781eca0ae4aSLuiz Augusto von Dentz __u8 handle;
2782eca0ae4aSLuiz Augusto von Dentz __u8 latency[3];
2783eca0ae4aSLuiz Augusto von Dentz __u8 nse;
2784eca0ae4aSLuiz Augusto von Dentz __u8 bn;
2785eca0ae4aSLuiz Augusto von Dentz __u8 pto;
2786eca0ae4aSLuiz Augusto von Dentz __u8 irc;
2787eca0ae4aSLuiz Augusto von Dentz __le16 max_pdu;
2788eca0ae4aSLuiz Augusto von Dentz __le16 interval;
2789eca0ae4aSLuiz Augusto von Dentz __u8 num_bis;
2790eca0ae4aSLuiz Augusto von Dentz __le16 bis[];
2791eca0ae4aSLuiz Augusto von Dentz } __packed;
2792eca0ae4aSLuiz Augusto von Dentz
2793eca0ae4aSLuiz Augusto von Dentz #define HCI_EVT_LE_BIG_INFO_ADV_REPORT 0x22
2794eca0ae4aSLuiz Augusto von Dentz struct hci_evt_le_big_info_adv_report {
2795eca0ae4aSLuiz Augusto von Dentz __le16 sync_handle;
2796eca0ae4aSLuiz Augusto von Dentz __u8 num_bis;
2797eca0ae4aSLuiz Augusto von Dentz __u8 nse;
2798eca0ae4aSLuiz Augusto von Dentz __le16 iso_interval;
2799eca0ae4aSLuiz Augusto von Dentz __u8 bn;
2800eca0ae4aSLuiz Augusto von Dentz __u8 pto;
2801eca0ae4aSLuiz Augusto von Dentz __u8 irc;
2802eca0ae4aSLuiz Augusto von Dentz __le16 max_pdu;
2803eca0ae4aSLuiz Augusto von Dentz __u8 sdu_interval[3];
2804eca0ae4aSLuiz Augusto von Dentz __le16 max_sdu;
2805eca0ae4aSLuiz Augusto von Dentz __u8 phy;
2806eca0ae4aSLuiz Augusto von Dentz __u8 framing;
2807eca0ae4aSLuiz Augusto von Dentz __u8 encryption;
2808eca0ae4aSLuiz Augusto von Dentz } __packed;
2809eca0ae4aSLuiz Augusto von Dentz
2810e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff
2811e4cc5a18SMarcel Holtmann
28121da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */
2813a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd
28141da177e4SLinus Torvalds struct hci_ev_stack_internal {
28151da177e4SLinus Torvalds __u16 type;
2816a7e45454SGustavo A. R. Silva __u8 data[];
281766c853ccSGustavo F. Padovan } __packed;
28181da177e4SLinus Torvalds
28191da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01
28201da177e4SLinus Torvalds struct hci_ev_si_device {
28211da177e4SLinus Torvalds __u16 event;
28221da177e4SLinus Torvalds __u16 dev_id;
282366c853ccSGustavo F. Padovan } __packed;
28241da177e4SLinus Torvalds
28251da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02
28261da177e4SLinus Torvalds struct hci_ev_si_security {
28271da177e4SLinus Torvalds __u16 event;
28281da177e4SLinus Torvalds __u16 proto;
28291da177e4SLinus Torvalds __u16 subproto;
28301da177e4SLinus Torvalds __u8 incoming;
283166c853ccSGustavo F. Padovan } __packed;
28321da177e4SLinus Torvalds
28331da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */
28341da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3
28351da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2
28361da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4
28371da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3
28384de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4
28391da177e4SLinus Torvalds
28401da177e4SLinus Torvalds struct hci_command_hdr {
28411ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */
28421da177e4SLinus Torvalds __u8 plen;
284366c853ccSGustavo F. Padovan } __packed;
28441da177e4SLinus Torvalds
28451da177e4SLinus Torvalds struct hci_event_hdr {
28461da177e4SLinus Torvalds __u8 evt;
28471da177e4SLinus Torvalds __u8 plen;
284866c853ccSGustavo F. Padovan } __packed;
28491da177e4SLinus Torvalds
28501da177e4SLinus Torvalds struct hci_acl_hdr {
28511ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */
28521ebb9252SMarcel Holtmann __le16 dlen;
285366c853ccSGustavo F. Padovan } __packed;
28541da177e4SLinus Torvalds
28551da177e4SLinus Torvalds struct hci_sco_hdr {
28561ebb9252SMarcel Holtmann __le16 handle;
28571da177e4SLinus Torvalds __u8 dlen;
285866c853ccSGustavo F. Padovan } __packed;
28591da177e4SLinus Torvalds
28604de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr {
28614de0fc59SLuiz Augusto von Dentz __le16 handle;
28624de0fc59SLuiz Augusto von Dentz __le16 dlen;
2863a7e45454SGustavo A. R. Silva __u8 data[];
28644de0fc59SLuiz Augusto von Dentz } __packed;
28654de0fc59SLuiz Augusto von Dentz
28664de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */
28674de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00
28684de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01
28694de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02
28704de0fc59SLuiz Augusto von Dentz
28714de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4
28724de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr {
28734de0fc59SLuiz Augusto von Dentz __le16 sn;
28744de0fc59SLuiz Augusto von Dentz __le16 slen;
28754de0fc59SLuiz Augusto von Dentz };
28764de0fc59SLuiz Augusto von Dentz
28774de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8
28784de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr {
28794de0fc59SLuiz Augusto von Dentz __le32 ts;
28804de0fc59SLuiz Augusto von Dentz __le16 sn;
28814de0fc59SLuiz Augusto von Dentz __le16 slen;
28824de0fc59SLuiz Augusto von Dentz };
28834de0fc59SLuiz Augusto von Dentz
hci_event_hdr(const struct sk_buff * skb)28842a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb)
28852a123b86SArnaldo Carvalho de Melo {
28862a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data;
28872a123b86SArnaldo Carvalho de Melo }
28882a123b86SArnaldo Carvalho de Melo
hci_acl_hdr(const struct sk_buff * skb)28892a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb)
28902a123b86SArnaldo Carvalho de Melo {
28912a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data;
28922a123b86SArnaldo Carvalho de Melo }
28932a123b86SArnaldo Carvalho de Melo
hci_sco_hdr(const struct sk_buff * skb)28942a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
28952a123b86SArnaldo Carvalho de Melo {
28962a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data;
28972a123b86SArnaldo Carvalho de Melo }
28982a123b86SArnaldo Carvalho de Melo
28991da177e4SLinus Torvalds /* Command opcode pack/unpack */
2900c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10)))
29011da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10)
29021da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff)
29031da177e4SLinus Torvalds
29041da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */
2905c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12)))
29061da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff)
29071da177e4SLinus Torvalds #define hci_flags(h) (h >> 12)
29081da177e4SLinus Torvalds
29094de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */
29104de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003)
29114de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001)
29124de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2))
29134de0fc59SLuiz Augusto von Dentz
29144de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */
29154de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14)))
29164de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff)
29174de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14)
29184de0fc59SLuiz Augusto von Dentz
2919248733e8SKiran K /* codec transport types */
2920248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO 0x01
2921248733e8SKiran K
29225cbd3ebdSAlain Michaud /* le24 support */
hci_cpu_to_le24(__u32 val,__u8 dst[3])29235cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3])
29245cbd3ebdSAlain Michaud {
29255cbd3ebdSAlain Michaud dst[0] = val & 0xff;
29265cbd3ebdSAlain Michaud dst[1] = (val & 0xff00) >> 8;
29275cbd3ebdSAlain Michaud dst[2] = (val & 0xff0000) >> 16;
29285cbd3ebdSAlain Michaud }
29295cbd3ebdSAlain Michaud
29301da177e4SLinus Torvalds #endif /* __HCI_H */
2931