11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux 31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 81da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 91da177e4SLinus Torvalds published by the Free Software Foundation; 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 121da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 131da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 141da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 151da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 161da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 171da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 181da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 191da177e4SLinus Torvalds 201da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 211da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 221da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #ifndef __HCI_H 261da177e4SLinus Torvalds #define __HCI_H 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024 291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255 30*4de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE 251 311da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260 321da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 331da177e4SLinus Torvalds 349b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16 35523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 369b3b4460SAndrei Emeltchenko 37903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE 672 38903e4541SAndrei Emeltchenko 397d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE 252 407d1dab49SDoHyun Pyun 411da177e4SLinus Torvalds /* HCI dev events */ 421da177e4SLinus Torvalds #define HCI_DEV_REG 1 431da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 441da177e4SLinus Torvalds #define HCI_DEV_UP 3 451da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 471da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds /* HCI notify events */ 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 561da177e4SLinus Torvalds 57c13854ceSMarcel Holtmann /* HCI bus types */ 580ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 591da177e4SLinus Torvalds #define HCI_USB 1 601da177e4SLinus Torvalds #define HCI_PCCARD 2 611da177e4SLinus Torvalds #define HCI_UART 3 621da177e4SLinus Torvalds #define HCI_RS232 4 631da177e4SLinus Torvalds #define HCI_PCI 5 640ac53939SMarcel Holtmann #define HCI_SDIO 6 655c0e03cdSJohan Hedberg #define HCI_SPI 7 665c0e03cdSJohan Hedberg #define HCI_I2C 8 6765010e68SBjorn Andersson #define HCI_SMD 9 681da177e4SLinus Torvalds 69943da25dSMarcel Holtmann /* HCI controller types */ 70ca8bee5dSMarcel Holtmann #define HCI_PRIMARY 0x00 718f1e1742SDavid Vrabel #define HCI_AMP 0x01 72943da25dSMarcel Holtmann 738598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 746ed971caSMarcel Holtmann #define AMP_ID_BREDR 0x00 758598d064SAndrei Emeltchenko 767c13823dSMarcel Holtmann /* AMP controller types */ 777c13823dSMarcel Holtmann #define AMP_TYPE_BREDR 0x00 787c13823dSMarcel Holtmann #define AMP_TYPE_80211 0x01 797c13823dSMarcel Holtmann 80ab846ec4SAndrei Emeltchenko /* AMP controller status */ 81536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN 0x00 82536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY 0x01 83536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY 0x02 84536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY 0x03 85536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY 0x04 86536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY 0x05 87536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY 0x06 88ab846ec4SAndrei Emeltchenko 891da177e4SLinus Torvalds /* HCI device quirks */ 901da177e4SLinus Torvalds enum { 91118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when 92118305b5SMarcel Holtmann * closing the transport instead of when opening it. 93118305b5SMarcel Holtmann * 94118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 95118305b5SMarcel Holtmann */ 96a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 97118305b5SMarcel Holtmann 98118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only 99118305b5SMarcel Holtmann * device and it will stay in unconfigured state. 100118305b5SMarcel Holtmann * 101118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 102118305b5SMarcel Holtmann */ 103da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 104118305b5SMarcel Holtmann 105118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by 106118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid. 107118305b5SMarcel Holtmann * 108118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 109118305b5SMarcel Holtmann */ 110f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE, 111118305b5SMarcel Holtmann 112043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not 113043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to 114043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had 115043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing 116043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the 117043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better 118043ec9bfSMarcel Holtmann * user expierence. 119043ec9bfSMarcel Holtmann * 120043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called. 121043ec9bfSMarcel Holtmann */ 122043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE, 123043ec9bfSMarcel Holtmann 124711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported 125711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2 126711ffa78SMarcel Holtmann * and later controllers should support this command. However 127711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do 128711ffa78SMarcel Holtmann * not support this command. 129711ffa78SMarcel Holtmann * 130711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 131711ffa78SMarcel Holtmann */ 132711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS, 133711ffa78SMarcel Holtmann 134118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling 135118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the 136118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but 137118305b5SMarcel Holtmann * not supported. 138118305b5SMarcel Holtmann * 139118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 140118305b5SMarcel Holtmann */ 141f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY, 14289bc22d2SMarcel Holtmann 143eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step 144eb1904f4SMarcel Holtmann * is required and will be indicated with the controller 145eb1904f4SMarcel Holtmann * configuation. 146eb1904f4SMarcel Holtmann * 147eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 148eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback. 149eb1904f4SMarcel Holtmann */ 150eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG, 151eb1904f4SMarcel Holtmann 15289bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address 15389bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command 15489bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is 15589bc22d2SMarcel Holtmann * required before this device can be used. 15689bc22d2SMarcel Holtmann * 15789bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 15889bc22d2SMarcel Holtmann * during the hdev->setup vendor callback. 15989bc22d2SMarcel Holtmann */ 16089bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR, 16143d6bc46SMarcel Holtmann 1627a0e5b15SMatthias Kaehlcke /* When this quirk is set, the public Bluetooth address 1637a0e5b15SMatthias Kaehlcke * initially reported by HCI Read BD Address command 1647a0e5b15SMatthias Kaehlcke * is considered invalid. The public BD Address can be 1657a0e5b15SMatthias Kaehlcke * specified in the fwnode property 'local-bd-address'. 1667a0e5b15SMatthias Kaehlcke * If this property does not exist or is invalid controller 1677a0e5b15SMatthias Kaehlcke * configuration is required before this device can be used. 1687a0e5b15SMatthias Kaehlcke * 1697a0e5b15SMatthias Kaehlcke * This quirk can be set before hci_register_dev is called or 1707a0e5b15SMatthias Kaehlcke * during the hdev->setup vendor callback. 1717a0e5b15SMatthias Kaehlcke */ 1727a0e5b15SMatthias Kaehlcke HCI_QUIRK_USE_BDADDR_PROPERTY, 1737a0e5b15SMatthias Kaehlcke 17443d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 17543d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 17643d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 17743d6bc46SMarcel Holtmann * 17843d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 17943d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 18043d6bc46SMarcel Holtmann */ 18143d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 182695c4cb6SJakub Pawlowski 183695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 184695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 185695c4cb6SJakub Pawlowski * 186695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 187695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 188695c4cb6SJakub Pawlowski */ 189695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1907e995b9eSMarcel Holtmann 1917e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1927e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1937e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1947e995b9eSMarcel Holtmann * 1957e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 1967e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 1977e995b9eSMarcel Holtmann */ 1987e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 199740011cfSSean Wang 200740011cfSSean Wang /* When this quirk is set, setup() would be run after every 201740011cfSSean Wang * open() and not just after the first open(). 202740011cfSSean Wang * 203740011cfSSean Wang * This quirk can be set before hci_register_dev is called or 204740011cfSSean Wang * during the hdev->setup vendor callback. 205740011cfSSean Wang * 206740011cfSSean Wang */ 207740011cfSSean Wang HCI_QUIRK_NON_PERSISTENT_SETUP, 2081da177e4SLinus Torvalds }; 2091da177e4SLinus Torvalds 2101da177e4SLinus Torvalds /* HCI device flags */ 2111da177e4SLinus Torvalds enum { 2121da177e4SLinus Torvalds HCI_UP, 2131da177e4SLinus Torvalds HCI_INIT, 2141da177e4SLinus Torvalds HCI_RUNNING, 2151da177e4SLinus Torvalds 2161da177e4SLinus Torvalds HCI_PSCAN, 2171da177e4SLinus Torvalds HCI_ISCAN, 2181da177e4SLinus Torvalds HCI_AUTH, 2191da177e4SLinus Torvalds HCI_ENCRYPT, 2201da177e4SLinus Torvalds HCI_INQUIRY, 2211da177e4SLinus Torvalds 2221da177e4SLinus Torvalds HCI_RAW, 223ab81cbf9SJohan Hedberg 22410572132SGustavo F. Padovan HCI_RESET, 2251da177e4SLinus Torvalds }; 2261da177e4SLinus Torvalds 227f9207338SMarcel Holtmann /* HCI socket flags */ 228f9207338SMarcel Holtmann enum { 22950ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 230f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 231f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 232ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 233321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2345504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2355504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2365504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2375504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 23872000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 239f9207338SMarcel Holtmann }; 240f9207338SMarcel Holtmann 241d23264a8SAndre Guedes /* 242d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 243d23264a8SAndre Guedes * states from the controller. 244d23264a8SAndre Guedes */ 245d23264a8SAndre Guedes enum { 246a8b2d5c2SJohan Hedberg HCI_SETUP, 247d603b76bSMarcel Holtmann HCI_CONFIG, 248a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2495e130367SJohan Hedberg HCI_RFKILLED, 250a8b2d5c2SJohan Hedberg HCI_MGMT, 251b6ae8457SJohan Hedberg HCI_BONDABLE, 252a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2530663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2543769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 25594324962SJohan Hovold HCI_UNREGISTER, 2564a964404SMarcel Holtmann HCI_UNCONFIGURED, 2570736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 258dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 25966c417c1SJohan Hedberg HCI_LE_ADV, 260d23264a8SAndre Guedes HCI_LE_SCAN, 26184bde9d6SJohan Hedberg HCI_SSP_ENABLED, 262e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 263134c2a89SMarcel Holtmann HCI_SC_ONLY, 264863efaf2SJohan Hedberg HCI_PRIVACY, 26582a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 266d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 26741edf160SJohan Hedberg HCI_RPA_RESOLVING, 2686d80dfd0SJohan Hedberg HCI_HS_ENABLED, 26906199cf8SJohan Hedberg HCI_LE_ENABLED, 270f3d3444aSJohan Hedberg HCI_ADVERTISING, 271cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 2725e5282bbSJohan Hedberg HCI_CONNECTABLE, 2735e5282bbSJohan Hedberg HCI_DISCOVERABLE, 2746acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 27547990ea0SJohan Hedberg HCI_LINK_SECURITY, 27621693c15SAndre Guedes HCI_PERIODIC_INQ, 2771a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 27856f87901SJohan Hedberg HCI_BREDR_ENABLED, 27981ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 280b7cb93e5SMarcel Holtmann 281b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 2824b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 283b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 284b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 285aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 286f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 287b7cb93e5SMarcel Holtmann 288eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 289d23264a8SAndre Guedes }; 290d23264a8SAndre Guedes 2911da177e4SLinus Torvalds /* HCI timeouts */ 2925f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2935f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 2945f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 295d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2965f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 2979345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 298a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 2999489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 3001f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3011da177e4SLinus Torvalds 3025b7f9909SMarcel Holtmann /* HCI data types */ 3031da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3041da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3051da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3061da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 307*4de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05 308e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3091da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3101da177e4SLinus Torvalds 3115b7f9909SMarcel Holtmann /* HCI packet types */ 3121da177e4SLinus Torvalds #define HCI_DM1 0x0008 3131da177e4SLinus Torvalds #define HCI_DM3 0x0400 3141da177e4SLinus Torvalds #define HCI_DM5 0x4000 3151da177e4SLinus Torvalds #define HCI_DH1 0x0010 3161da177e4SLinus Torvalds #define HCI_DH3 0x0800 3171da177e4SLinus Torvalds #define HCI_DH5 0x8000 3181da177e4SLinus Torvalds 3195075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3205075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3215075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3225075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3235075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3245075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3255075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3265075b972SJaganath Kanakkassery 3271da177e4SLinus Torvalds #define HCI_HV1 0x0020 3281da177e4SLinus Torvalds #define HCI_HV2 0x0040 3291da177e4SLinus Torvalds #define HCI_HV3 0x0080 3301da177e4SLinus Torvalds 3311da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3321da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3331da177e4SLinus Torvalds 3345b7f9909SMarcel Holtmann /* eSCO packet types */ 3355b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3365b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3375b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3385b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3395b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3405b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 341efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 342efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 343efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 344efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3455b7f9909SMarcel Holtmann 346a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 347efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 348a8746417SMarcel Holtmann 3491da177e4SLinus Torvalds /* ACL flags */ 350e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3511da177e4SLinus Torvalds #define ACL_CONT 0x01 3521da177e4SLinus Torvalds #define ACL_START 0x02 353d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 3541da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 3551da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 3561da177e4SLinus Torvalds 357*4de0fc59SLuiz Augusto von Dentz /* ISO PB flags */ 358*4de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00 359*4de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01 360*4de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02 361*4de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03 362*4de0fc59SLuiz Augusto von Dentz 363*4de0fc59SLuiz Augusto von Dentz /* ISO TS flags */ 364*4de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01 365*4de0fc59SLuiz Augusto von Dentz 3661da177e4SLinus Torvalds /* Baseband links */ 3671da177e4SLinus Torvalds #define SCO_LINK 0x00 3681da177e4SLinus Torvalds #define ACL_LINK 0x01 3695b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 370fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 371fcd89c09SVille Tervo #define LE_LINK 0x80 3723161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 373*4de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82 374845472e8SMarcel Holtmann #define INVALID_LINK 0xff 3751da177e4SLinus Torvalds 3761da177e4SLinus Torvalds /* LMP features */ 3771da177e4SLinus Torvalds #define LMP_3SLOT 0x01 3781da177e4SLinus Torvalds #define LMP_5SLOT 0x02 3791da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 3801da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 3811da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 3821da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 3831da177e4SLinus Torvalds #define LMP_HOLD 0x40 38404837f64SMarcel Holtmann #define LMP_SNIFF 0x80 3851da177e4SLinus Torvalds 3861da177e4SLinus Torvalds #define LMP_PARK 0x01 3871da177e4SLinus Torvalds #define LMP_RSSI 0x02 3881da177e4SLinus Torvalds #define LMP_QUALITY 0x04 3891da177e4SLinus Torvalds #define LMP_SCO 0x08 3901da177e4SLinus Torvalds #define LMP_HV2 0x10 3911da177e4SLinus Torvalds #define LMP_HV3 0x20 3921da177e4SLinus Torvalds #define LMP_ULAW 0x40 3931da177e4SLinus Torvalds #define LMP_ALAW 0x80 3941da177e4SLinus Torvalds 3951da177e4SLinus Torvalds #define LMP_CVSD 0x01 3961da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 3971da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 39807a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 3991da177e4SLinus Torvalds 4005075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 4015075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 402d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 4035b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 4045b7f9909SMarcel Holtmann 4055b7f9909SMarcel Holtmann #define LMP_EV4 0x01 4065b7f9909SMarcel Holtmann #define LMP_EV5 0x02 40769ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 408d5859e22SJohan Hedberg #define LMP_LE 0x40 4095075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 4105b7f9909SMarcel Holtmann 4115075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 41204837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 413d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 414efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 415efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 416efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 41704837f64SMarcel Holtmann 418d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 419e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 420769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 421e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 422769be974SMarcel Holtmann 423d5859e22SJohan Hedberg #define LMP_LSTO 0x01 424d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 425971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 426d5859e22SJohan Hedberg 427eead27daSAndre Guedes /* Extended LMP features */ 42853b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 42953b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 43053b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 43153b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 43253b834d2SMarcel Holtmann 433d5991585SMarcel Holtmann #define LMP_SC 0x01 434d5991585SMarcel Holtmann #define LMP_PING 0x02 435d5991585SMarcel Holtmann 43653b834d2SMarcel Holtmann /* Host features */ 437cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 438eead27daSAndre Guedes #define LMP_HOST_LE 0x02 439cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 440d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 441eead27daSAndre Guedes 442662bc2e6SAndre Guedes /* LE features */ 4430da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 444662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 4450fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 446cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 44794a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 44885a721a8SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 44985a721a8SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4506b49bcb4SJaganath Kanakkassery #define HCI_LE_EXT_ADV 0x10 4514b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4525075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 4535075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4549756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 455*4de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_MASTER 0x10 456*4de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_SLAVE 0x20 457662bc2e6SAndre Guedes 45804837f64SMarcel Holtmann /* Connection modes */ 45904837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 46004837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 46104837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 46204837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 46304837f64SMarcel Holtmann 4641da177e4SLinus Torvalds /* Link policies */ 4651da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 4661da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 4671da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 4681da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 4691da177e4SLinus Torvalds 47004837f64SMarcel Holtmann /* Link modes */ 4711da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 4721da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 4731da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 4741da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 4751da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 4761da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 4771da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 4787b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 4791da177e4SLinus Torvalds 48040be492fSMarcel Holtmann /* Authentication types */ 48140be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 48240be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 48340be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 48440be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 48540be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 48640be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 48740be492fSMarcel Holtmann 488a77b15a6SMikel Astiz /* I/O capabilities */ 489a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 490a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 491a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 492a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 493a77b15a6SMikel Astiz 494b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 495b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 496b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 497b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 498b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 49911015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 50011015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 501b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 50211015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 50311015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 504b6020ba0SWaldemar Rymarkiewicz 5059f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 5068e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 5079f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 508160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 5092acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 510cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 511d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 5129f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 5139f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 514cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 515cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5169f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5179f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5184ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5194ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5203c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5219f5a0d7bSAndrei Emeltchenko 5222455a3eaSAndrei Emeltchenko /* Flow control modes */ 5232455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5242455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5252455a3eaSAndrei Emeltchenko 526bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 527bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 528a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 529bbaf444aSJohan Hedberg 530ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 531ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 532ba165a90SJohan Hedberg 53332748db0SJohan Hedberg /* Extended Inquiry Response field types */ 53432748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 53532748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 53632748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 53732748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 53832748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 53932748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 54032748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 54132748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 54232748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 54332748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5449ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 545d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 546d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 54732748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5484453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5491471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5501471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 551d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 552d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 553f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 554f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 55532748db0SJohan Hedberg 5563f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 5573f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 5583f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 5593f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 5603f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 5613f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 5623f0f524bSJohan Hedberg 5631da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 5646bd32326SVille Tervo #define HCI_OP_NOP 0x0000 5656bd32326SVille Tervo 566a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 567a9de9248SMarcel Holtmann struct hci_cp_inquiry { 568a9de9248SMarcel Holtmann __u8 lap[3]; 569a9de9248SMarcel Holtmann __u8 length; 570a9de9248SMarcel Holtmann __u8 num_rsp; 57166c853ccSGustavo F. Padovan } __packed; 5721da177e4SLinus Torvalds 573a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 574a9de9248SMarcel Holtmann 57579d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 57679d6e068SAndre Guedes 577a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 578a9de9248SMarcel Holtmann 579a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 580a9de9248SMarcel Holtmann struct hci_cp_create_conn { 581a9de9248SMarcel Holtmann bdaddr_t bdaddr; 582a9de9248SMarcel Holtmann __le16 pkt_type; 583a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 584a9de9248SMarcel Holtmann __u8 pscan_mode; 585a9de9248SMarcel Holtmann __le16 clock_offset; 586a9de9248SMarcel Holtmann __u8 role_switch; 58766c853ccSGustavo F. Padovan } __packed; 5881da177e4SLinus Torvalds 589a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 590a9de9248SMarcel Holtmann struct hci_cp_disconnect { 591a9de9248SMarcel Holtmann __le16 handle; 592a9de9248SMarcel Holtmann __u8 reason; 59366c853ccSGustavo F. Padovan } __packed; 5941da177e4SLinus Torvalds 595a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 596a9de9248SMarcel Holtmann struct hci_cp_add_sco { 597a9de9248SMarcel Holtmann __le16 handle; 598a9de9248SMarcel Holtmann __le16 pkt_type; 59966c853ccSGustavo F. Padovan } __packed; 600a9de9248SMarcel Holtmann 601a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 602a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 6031da177e4SLinus Torvalds bdaddr_t bdaddr; 60466c853ccSGustavo F. Padovan } __packed; 6051da177e4SLinus Torvalds 606a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 607a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 608a9de9248SMarcel Holtmann bdaddr_t bdaddr; 609a9de9248SMarcel Holtmann __u8 role; 61066c853ccSGustavo F. Padovan } __packed; 6111da177e4SLinus Torvalds 612a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 613a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 614a9de9248SMarcel Holtmann bdaddr_t bdaddr; 615a9de9248SMarcel Holtmann __u8 reason; 61666c853ccSGustavo F. Padovan } __packed; 6171da177e4SLinus Torvalds 618a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 619a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 620a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6219b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 62266c853ccSGustavo F. Padovan } __packed; 6231da177e4SLinus Torvalds 624a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 625a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 626a9de9248SMarcel Holtmann bdaddr_t bdaddr; 62766c853ccSGustavo F. Padovan } __packed; 6281da177e4SLinus Torvalds 629a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 630a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 631a9de9248SMarcel Holtmann bdaddr_t bdaddr; 632a9de9248SMarcel Holtmann __u8 pin_len; 633a9de9248SMarcel Holtmann __u8 pin_code[16]; 63466c853ccSGustavo F. Padovan } __packed; 635980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 636980e1a53SJohan Hedberg __u8 status; 637980e1a53SJohan Hedberg bdaddr_t bdaddr; 638980e1a53SJohan Hedberg } __packed; 639a9de9248SMarcel Holtmann 640a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 641a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 642a9de9248SMarcel Holtmann bdaddr_t bdaddr; 64366c853ccSGustavo F. Padovan } __packed; 644980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 645980e1a53SJohan Hedberg __u8 status; 646980e1a53SJohan Hedberg bdaddr_t bdaddr; 647980e1a53SJohan Hedberg } __packed; 648a9de9248SMarcel Holtmann 649a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 650a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 651a9de9248SMarcel Holtmann __le16 handle; 652a9de9248SMarcel Holtmann __le16 pkt_type; 65366c853ccSGustavo F. Padovan } __packed; 654a9de9248SMarcel Holtmann 655a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 656a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 657a9de9248SMarcel Holtmann __le16 handle; 65866c853ccSGustavo F. Padovan } __packed; 659a9de9248SMarcel Holtmann 660a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 661a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 662a9de9248SMarcel Holtmann __le16 handle; 663a9de9248SMarcel Holtmann __u8 encrypt; 66466c853ccSGustavo F. Padovan } __packed; 665a9de9248SMarcel Holtmann 666a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 667a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 668a9de9248SMarcel Holtmann __le16 handle; 66966c853ccSGustavo F. Padovan } __packed; 670a9de9248SMarcel Holtmann 671a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 672a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 673a9de9248SMarcel Holtmann bdaddr_t bdaddr; 674a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 675a9de9248SMarcel Holtmann __u8 pscan_mode; 676a9de9248SMarcel Holtmann __le16 clock_offset; 67766c853ccSGustavo F. Padovan } __packed; 678a9de9248SMarcel Holtmann 679a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 680a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 681a9de9248SMarcel Holtmann bdaddr_t bdaddr; 68266c853ccSGustavo F. Padovan } __packed; 683a9de9248SMarcel Holtmann 684a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 685a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 686a9de9248SMarcel Holtmann __le16 handle; 68766c853ccSGustavo F. Padovan } __packed; 688a9de9248SMarcel Holtmann 689a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 690a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 691a9de9248SMarcel Holtmann __le16 handle; 692a9de9248SMarcel Holtmann __u8 page; 69366c853ccSGustavo F. Padovan } __packed; 694a9de9248SMarcel Holtmann 695a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 696a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 697a9de9248SMarcel Holtmann __le16 handle; 69866c853ccSGustavo F. Padovan } __packed; 699a9de9248SMarcel Holtmann 700df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 701df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 702df935429SMarcel Holtmann __le16 handle; 703df935429SMarcel Holtmann } __packed; 704df935429SMarcel Holtmann 705a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 706a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 707a9de9248SMarcel Holtmann __le16 handle; 708a9de9248SMarcel Holtmann __le32 tx_bandwidth; 709a9de9248SMarcel Holtmann __le32 rx_bandwidth; 710a9de9248SMarcel Holtmann __le16 max_latency; 711a9de9248SMarcel Holtmann __le16 voice_setting; 712a9de9248SMarcel Holtmann __u8 retrans_effort; 713a9de9248SMarcel Holtmann __le16 pkt_type; 71466c853ccSGustavo F. Padovan } __packed; 715a9de9248SMarcel Holtmann 716a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 717a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 718a9de9248SMarcel Holtmann bdaddr_t bdaddr; 719a9de9248SMarcel Holtmann __le32 tx_bandwidth; 720a9de9248SMarcel Holtmann __le32 rx_bandwidth; 721a9de9248SMarcel Holtmann __le16 max_latency; 722a9de9248SMarcel Holtmann __le16 content_format; 723a9de9248SMarcel Holtmann __u8 retrans_effort; 724a9de9248SMarcel Holtmann __le16 pkt_type; 72566c853ccSGustavo F. Padovan } __packed; 726a9de9248SMarcel Holtmann 727a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 728a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 729a9de9248SMarcel Holtmann bdaddr_t bdaddr; 730a9de9248SMarcel Holtmann __u8 reason; 73166c853ccSGustavo F. Padovan } __packed; 732a9de9248SMarcel Holtmann 73317fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 73417fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 73517fa4b9dSJohan Hedberg bdaddr_t bdaddr; 73617fa4b9dSJohan Hedberg __u8 capability; 73717fa4b9dSJohan Hedberg __u8 oob_data; 73817fa4b9dSJohan Hedberg __u8 authentication; 73917fa4b9dSJohan Hedberg } __packed; 74017fa4b9dSJohan Hedberg 741a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 742a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 743a5c29683SJohan Hedberg bdaddr_t bdaddr; 744a5c29683SJohan Hedberg } __packed; 745a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 746a5c29683SJohan Hedberg __u8 status; 747a5c29683SJohan Hedberg bdaddr_t bdaddr; 748a5c29683SJohan Hedberg } __packed; 749a5c29683SJohan Hedberg 750a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 751a5c29683SJohan Hedberg 7529ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 7539ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 7549ad4019aSBrian Gix bdaddr_t bdaddr; 7559ad4019aSBrian Gix __le32 passkey; 7569ad4019aSBrian Gix } __packed; 7579ad4019aSBrian Gix 7589ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 7599ad4019aSBrian Gix 7602763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 7612763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 7622763eda6SSzymon Janc bdaddr_t bdaddr; 7632763eda6SSzymon Janc __u8 hash[16]; 76438da1703SJohan Hedberg __u8 rand[16]; 7652763eda6SSzymon Janc } __packed; 7662763eda6SSzymon Janc 7672763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 7682763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 7692763eda6SSzymon Janc bdaddr_t bdaddr; 7702763eda6SSzymon Janc } __packed; 7712763eda6SSzymon Janc 77203b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 77303b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 77403b555e1SJohan Hedberg bdaddr_t bdaddr; 77503b555e1SJohan Hedberg __u8 reason; 77603b555e1SJohan Hedberg } __packed; 77703b555e1SJohan Hedberg 778523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 779523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 780523e93cdSAndrei Emeltchenko __u8 phy_handle; 781523e93cdSAndrei Emeltchenko __u8 key_len; 782523e93cdSAndrei Emeltchenko __u8 key_type; 783523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 784523e93cdSAndrei Emeltchenko } __packed; 785523e93cdSAndrei Emeltchenko 786523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 787523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 788523e93cdSAndrei Emeltchenko __u8 phy_handle; 789523e93cdSAndrei Emeltchenko __u8 key_len; 790523e93cdSAndrei Emeltchenko __u8 key_type; 791523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 792523e93cdSAndrei Emeltchenko } __packed; 793523e93cdSAndrei Emeltchenko 794523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 795523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 796523e93cdSAndrei Emeltchenko __u8 phy_handle; 797523e93cdSAndrei Emeltchenko __u8 reason; 798b078b564SAndrei Emeltchenko } __packed; 799b078b564SAndrei Emeltchenko 800b078b564SAndrei Emeltchenko struct ext_flow_spec { 801b078b564SAndrei Emeltchenko __u8 id; 802b078b564SAndrei Emeltchenko __u8 stype; 803b078b564SAndrei Emeltchenko __le16 msdu; 804b078b564SAndrei Emeltchenko __le32 sdu_itime; 805b078b564SAndrei Emeltchenko __le32 acc_lat; 806b078b564SAndrei Emeltchenko __le32 flush_to; 807b078b564SAndrei Emeltchenko } __packed; 808b078b564SAndrei Emeltchenko 809b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 810b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 811b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 812b078b564SAndrei Emeltchenko __u8 phy_handle; 813b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 814b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 815b078b564SAndrei Emeltchenko } __packed; 816b078b564SAndrei Emeltchenko 817b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 818b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 819b078b564SAndrei Emeltchenko __le16 log_handle; 820b078b564SAndrei Emeltchenko } __packed; 821b078b564SAndrei Emeltchenko 822b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 823b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 824b078b564SAndrei Emeltchenko __u8 phy_handle; 825b078b564SAndrei Emeltchenko __u8 flow_spec_id; 826b078b564SAndrei Emeltchenko } __packed; 827b078b564SAndrei Emeltchenko 828b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 829b078b564SAndrei Emeltchenko __u8 status; 830b078b564SAndrei Emeltchenko __u8 phy_handle; 831b078b564SAndrei Emeltchenko __u8 flow_spec_id; 832523e93cdSAndrei Emeltchenko } __packed; 833523e93cdSAndrei Emeltchenko 8348c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 8358c9a041bSDoHyun Pyun struct hci_cp_set_csb { 8368c9a041bSDoHyun Pyun __u8 enable; 8378c9a041bSDoHyun Pyun __u8 lt_addr; 8388c9a041bSDoHyun Pyun __u8 lpo_allowed; 8398c9a041bSDoHyun Pyun __le16 packet_type; 8408c9a041bSDoHyun Pyun __le16 interval_min; 8418c9a041bSDoHyun Pyun __le16 interval_max; 8428c9a041bSDoHyun Pyun __le16 csb_sv_tout; 8438c9a041bSDoHyun Pyun } __packed; 8448c9a041bSDoHyun Pyun struct hci_rp_set_csb { 8458c9a041bSDoHyun Pyun __u8 status; 8468c9a041bSDoHyun Pyun __u8 lt_addr; 8478c9a041bSDoHyun Pyun __le16 interval; 8488c9a041bSDoHyun Pyun } __packed; 8498c9a041bSDoHyun Pyun 850cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 851cefded98SDoHyun Pyun 852e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 853e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 854e2f99131SMarcel Holtmann bdaddr_t bdaddr; 855e2f99131SMarcel Holtmann __u8 hash192[16]; 85638da1703SJohan Hedberg __u8 rand192[16]; 857e2f99131SMarcel Holtmann __u8 hash256[16]; 85838da1703SJohan Hedberg __u8 rand256[16]; 859e2f99131SMarcel Holtmann } __packed; 860e2f99131SMarcel Holtmann 861a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 862a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 863a9de9248SMarcel Holtmann __le16 handle; 864a9de9248SMarcel Holtmann __le16 max_interval; 865a9de9248SMarcel Holtmann __le16 min_interval; 866a9de9248SMarcel Holtmann __le16 attempt; 867a9de9248SMarcel Holtmann __le16 timeout; 86866c853ccSGustavo F. Padovan } __packed; 869a9de9248SMarcel Holtmann 870a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 871a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 872a9de9248SMarcel Holtmann __le16 handle; 87366c853ccSGustavo F. Padovan } __packed; 874a9de9248SMarcel Holtmann 875a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 876a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 877a9de9248SMarcel Holtmann __le16 handle; 87866c853ccSGustavo F. Padovan } __packed; 879a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 880a9de9248SMarcel Holtmann __u8 status; 881a9de9248SMarcel Holtmann __le16 handle; 882a9de9248SMarcel Holtmann __u8 role; 88366c853ccSGustavo F. Padovan } __packed; 884a9de9248SMarcel Holtmann 885a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 886a9de9248SMarcel Holtmann struct hci_cp_switch_role { 887a9de9248SMarcel Holtmann bdaddr_t bdaddr; 888a9de9248SMarcel Holtmann __u8 role; 88966c853ccSGustavo F. Padovan } __packed; 890a9de9248SMarcel Holtmann 891a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 892a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 893a9de9248SMarcel Holtmann __le16 handle; 89466c853ccSGustavo F. Padovan } __packed; 895a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 896a9de9248SMarcel Holtmann __u8 status; 897a9de9248SMarcel Holtmann __le16 handle; 898a9de9248SMarcel Holtmann __le16 policy; 89966c853ccSGustavo F. Padovan } __packed; 900a9de9248SMarcel Holtmann 901a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 902a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 903a9de9248SMarcel Holtmann __le16 handle; 904a9de9248SMarcel Holtmann __le16 policy; 90566c853ccSGustavo F. Padovan } __packed; 906a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 907a9de9248SMarcel Holtmann __u8 status; 908a9de9248SMarcel Holtmann __le16 handle; 90966c853ccSGustavo F. Padovan } __packed; 910a9de9248SMarcel Holtmann 911e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 912e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 913e4e8e37cSMarcel Holtmann __u8 status; 914e4e8e37cSMarcel Holtmann __le16 policy; 91566c853ccSGustavo F. Padovan } __packed; 916e4e8e37cSMarcel Holtmann 917e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 918e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 919e4e8e37cSMarcel Holtmann __le16 policy; 92066c853ccSGustavo F. Padovan } __packed; 921e4e8e37cSMarcel Holtmann 922a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 923a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 924a9de9248SMarcel Holtmann __le16 handle; 925a9de9248SMarcel Holtmann __le16 max_latency; 926a9de9248SMarcel Holtmann __le16 min_remote_timeout; 927a9de9248SMarcel Holtmann __le16 min_local_timeout; 92866c853ccSGustavo F. Padovan } __packed; 929a9de9248SMarcel Holtmann 930a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 931a9de9248SMarcel Holtmann 932a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 933a9de9248SMarcel Holtmann 934a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 9351da177e4SLinus Torvalds struct hci_cp_set_event_flt { 9361da177e4SLinus Torvalds __u8 flt_type; 9371da177e4SLinus Torvalds __u8 cond_type; 9381da177e4SLinus Torvalds __u8 condition[0]; 93966c853ccSGustavo F. Padovan } __packed; 9401da177e4SLinus Torvalds 9411da177e4SLinus Torvalds /* Filter types */ 9421da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 9431da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 9441da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 9451da177e4SLinus Torvalds 9461da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 9471da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 9481da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 9491da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 9501da177e4SLinus Torvalds 9511da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 9521da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 9531da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 9541da177e4SLinus Torvalds 955cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 956cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 957cb962780SMarcel Holtmann bdaddr_t bdaddr; 958cb962780SMarcel Holtmann __u8 read_all; 959cb962780SMarcel Holtmann } __packed; 960cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 961cb962780SMarcel Holtmann __u8 status; 962cb962780SMarcel Holtmann __u8 max_keys; 963cb962780SMarcel Holtmann __u8 num_keys; 964cb962780SMarcel Holtmann } __packed; 965cb962780SMarcel Holtmann 966b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 967b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 968b0916ea0SJohan Hedberg bdaddr_t bdaddr; 969b0916ea0SJohan Hedberg __u8 delete_all; 970b0916ea0SJohan Hedberg } __packed; 971039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 972039d4e41SMarcel Holtmann __u8 status; 973039d4e41SMarcel Holtmann __u8 num_keys; 974039d4e41SMarcel Holtmann } __packed; 975b0916ea0SJohan Hedberg 9761f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 9771f6c6378SJohan Hedberg 978a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 979a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 9801f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 98166c853ccSGustavo F. Padovan } __packed; 982a9de9248SMarcel Holtmann 983a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 984a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 985a9de9248SMarcel Holtmann __u8 status; 9861f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 98766c853ccSGustavo F. Padovan } __packed; 988a9de9248SMarcel Holtmann 989a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 990a9de9248SMarcel Holtmann 991a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 992a9de9248SMarcel Holtmann 993a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 994a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 995a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 996a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 997a9de9248SMarcel Holtmann 998a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 999a9de9248SMarcel Holtmann 1000a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 1001a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 1002a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 1003a9de9248SMarcel Holtmann 1004a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 1005a9de9248SMarcel Holtmann 1006a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 1007a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 1008a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 1009a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 1010a9de9248SMarcel Holtmann 1011a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 1012a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 10131da177e4SLinus Torvalds __u8 status; 10141da177e4SLinus Torvalds __u8 dev_class[3]; 101566c853ccSGustavo F. Padovan } __packed; 10161da177e4SLinus Torvalds 1017a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1018a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 10191da177e4SLinus Torvalds __u8 dev_class[3]; 102066c853ccSGustavo F. Padovan } __packed; 10211da177e4SLinus Torvalds 1022a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 10231da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 10241da177e4SLinus Torvalds __u8 status; 10251ebb9252SMarcel Holtmann __le16 voice_setting; 102666c853ccSGustavo F. Padovan } __packed; 10271da177e4SLinus Torvalds 1028a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 10291da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 10301ebb9252SMarcel Holtmann __le16 voice_setting; 103166c853ccSGustavo F. Padovan } __packed; 10321da177e4SLinus Torvalds 1033a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 10341da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 10351ebb9252SMarcel Holtmann __le16 acl_mtu; 10361da177e4SLinus Torvalds __u8 sco_mtu; 10371ebb9252SMarcel Holtmann __le16 acl_max_pkt; 10381ebb9252SMarcel Holtmann __le16 sco_max_pkt; 103966c853ccSGustavo F. Padovan } __packed; 10401da177e4SLinus Torvalds 1041b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1042b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1043b4cb9fb2SMarcel Holtmann __u8 status; 1044b4cb9fb2SMarcel Holtmann __u8 num_iac; 1045b4cb9fb2SMarcel Holtmann } __packed; 1046b4cb9fb2SMarcel Holtmann 10474b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 10484b836f39SMarcel Holtmann 10493d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 10503d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 10513d505312SMarcel Holtmann __u8 num_iac; 10523d505312SMarcel Holtmann __u8 iac_lap[6]; 10533d505312SMarcel Holtmann } __packed; 10543d505312SMarcel Holtmann 1055d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1056d5859e22SJohan Hedberg 105780a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 105880a1e1dbSJohan Hedberg 105980a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 106080a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1061816a11d5SJohan Hedberg __u8 fec; 1062816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 106380a1e1dbSJohan Hedberg } __packed; 106480a1e1dbSJohan Hedberg 1065333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1066333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1067333140b5SMarcel Holtmann __u8 status; 1068333140b5SMarcel Holtmann __u8 mode; 106966c853ccSGustavo F. Padovan } __packed; 1070333140b5SMarcel Holtmann 1071333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1072333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1073333140b5SMarcel Holtmann __u8 mode; 107466c853ccSGustavo F. Padovan } __packed; 1075333140b5SMarcel Holtmann 1076c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1077c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1078c35938b2SSzymon Janc __u8 status; 1079c35938b2SSzymon Janc __u8 hash[16]; 108038da1703SJohan Hedberg __u8 rand[16]; 1081c35938b2SSzymon Janc } __packed; 1082c35938b2SSzymon Janc 1083d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 108491c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 108591c4e9b1SMarcel Holtmann __u8 status; 108691c4e9b1SMarcel Holtmann __s8 tx_power; 108791c4e9b1SMarcel Holtmann } __packed; 1088d5859e22SJohan Hedberg 1089d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1090d62e6d67SJohan Hedberg 10917528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 10927528ca1cSMarcel Holtmann 10931e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 10941e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 10951e89cffbSAndrei Emeltchenko __u8 status; 10961e89cffbSAndrei Emeltchenko __u8 mode; 10971e89cffbSAndrei Emeltchenko } __packed; 10981e89cffbSAndrei Emeltchenko 1099f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1100f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1101f9b49306SAndre Guedes __u8 le; 1102f9b49306SAndre Guedes __u8 simul; 1103f9b49306SAndre Guedes } __packed; 1104f9b49306SAndre Guedes 1105d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1106d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1107d0bf75a5SDoHyun Pyun __u8 lt_addr; 1108d0bf75a5SDoHyun Pyun } __packed; 1109d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1110d0bf75a5SDoHyun Pyun __u8 status; 1111d0bf75a5SDoHyun Pyun __u8 lt_addr; 1112d0bf75a5SDoHyun Pyun } __packed; 1113d0bf75a5SDoHyun Pyun 11146a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 11156a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 11166a20eaf4SDoHyun Pyun __u8 lt_addr; 11176a20eaf4SDoHyun Pyun } __packed; 11186a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 11196a20eaf4SDoHyun Pyun __u8 status; 11206a20eaf4SDoHyun Pyun __u8 lt_addr; 11216a20eaf4SDoHyun Pyun } __packed; 11226a20eaf4SDoHyun Pyun 11237d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 11247d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 11257d1dab49SDoHyun Pyun __u8 lt_addr; 11267d1dab49SDoHyun Pyun __u8 fragment; 11277d1dab49SDoHyun Pyun __u8 data_length; 11287d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 11297d1dab49SDoHyun Pyun } __packed; 11307d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 11317d1dab49SDoHyun Pyun __u8 status; 11327d1dab49SDoHyun Pyun __u8 lt_addr; 11337d1dab49SDoHyun Pyun } __packed; 11347d1dab49SDoHyun Pyun 11355d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 11365d4e7e8dSJohan Hedberg 1137a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1138a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1139a9b07a64SDoHyun Pyun __le16 interval_min; 1140a9b07a64SDoHyun Pyun __le16 interval_max; 1141a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1142a9b07a64SDoHyun Pyun __u8 service_data; 1143a9b07a64SDoHyun Pyun } __packed; 1144a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1145a9b07a64SDoHyun Pyun __u8 status; 1146a9b07a64SDoHyun Pyun __le16 sync_train_int; 1147a9b07a64SDoHyun Pyun } __packed; 1148a9b07a64SDoHyun Pyun 1149eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1150eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1151eb4b95c6SMarcel Holtmann __u8 status; 1152eb4b95c6SMarcel Holtmann __u8 support; 1153eb4b95c6SMarcel Holtmann } __packed; 1154eb4b95c6SMarcel Holtmann 1155eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1156eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1157eb4b95c6SMarcel Holtmann __u8 support; 1158eb4b95c6SMarcel Holtmann } __packed; 1159eb4b95c6SMarcel Holtmann 1160302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1161302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1162302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1163302975cbSSpoorthi Ravishankar Koppad } __packed; 1164302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1165302975cbSSpoorthi Ravishankar Koppad __u8 status; 1166302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1167302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1168302975cbSSpoorthi Ravishankar Koppad } __packed; 1169302975cbSSpoorthi Ravishankar Koppad 1170302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1171302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1172302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1173302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1174302975cbSSpoorthi Ravishankar Koppad } __packed; 1175302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1176302975cbSSpoorthi Ravishankar Koppad __u8 status; 1177302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1178302975cbSSpoorthi Ravishankar Koppad } __packed; 1179302975cbSSpoorthi Ravishankar Koppad 1180e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1181e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1182e2f99131SMarcel Holtmann __u8 status; 1183e2f99131SMarcel Holtmann __u8 hash192[16]; 118438da1703SJohan Hedberg __u8 rand192[16]; 1185e2f99131SMarcel Holtmann __u8 hash256[16]; 118638da1703SJohan Hedberg __u8 rand256[16]; 1187e2f99131SMarcel Holtmann } __packed; 1188e2f99131SMarcel Holtmann 1189a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1190a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 11911da177e4SLinus Torvalds __u8 status; 1192a9de9248SMarcel Holtmann __u8 hci_ver; 1193a9de9248SMarcel Holtmann __le16 hci_rev; 1194a9de9248SMarcel Holtmann __u8 lmp_ver; 1195a9de9248SMarcel Holtmann __le16 manufacturer; 1196a9de9248SMarcel Holtmann __le16 lmp_subver; 119766c853ccSGustavo F. Padovan } __packed; 11981da177e4SLinus Torvalds 1199a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1200a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 12011da177e4SLinus Torvalds __u8 status; 1202a9de9248SMarcel Holtmann __u8 commands[64]; 120366c853ccSGustavo F. Padovan } __packed; 12041da177e4SLinus Torvalds 1205a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1206a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1207a9de9248SMarcel Holtmann __u8 status; 1208a9de9248SMarcel Holtmann __u8 features[8]; 120966c853ccSGustavo F. Padovan } __packed; 1210a9de9248SMarcel Holtmann 1211a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1212971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1213971e3a4bSAndre Guedes __u8 page; 1214971e3a4bSAndre Guedes } __packed; 1215a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1216a9de9248SMarcel Holtmann __u8 status; 1217a9de9248SMarcel Holtmann __u8 page; 1218a9de9248SMarcel Holtmann __u8 max_page; 1219a9de9248SMarcel Holtmann __u8 features[8]; 122066c853ccSGustavo F. Padovan } __packed; 1221a9de9248SMarcel Holtmann 1222a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1223a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1224a9de9248SMarcel Holtmann __u8 status; 1225a9de9248SMarcel Holtmann __le16 acl_mtu; 1226a9de9248SMarcel Holtmann __u8 sco_mtu; 1227a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1228a9de9248SMarcel Holtmann __le16 sco_max_pkt; 122966c853ccSGustavo F. Padovan } __packed; 1230a9de9248SMarcel Holtmann 1231a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1232a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1233a9de9248SMarcel Holtmann __u8 status; 12341da177e4SLinus Torvalds bdaddr_t bdaddr; 123566c853ccSGustavo F. Padovan } __packed; 12361da177e4SLinus Torvalds 1237350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1238350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1239350ee4cfSAndrei Emeltchenko __u8 status; 1240350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1241350ee4cfSAndrei Emeltchenko __le16 block_len; 1242350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1243350ee4cfSAndrei Emeltchenko } __packed; 1244350ee4cfSAndrei Emeltchenko 1245109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1246109e3191SMarcel Holtmann 1247f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1248f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1249f332ec66SJohan Hedberg __u8 status; 1250f332ec66SJohan Hedberg __le16 interval; 1251f332ec66SJohan Hedberg __le16 window; 1252f332ec66SJohan Hedberg } __packed; 1253f332ec66SJohan Hedberg 1254f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1255f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1256f6422ec6SAntti Julku __le16 interval; 1257f6422ec6SAntti Julku __le16 window; 1258f6422ec6SAntti Julku } __packed; 1259f6422ec6SAntti Julku 12605a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 12615a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 12625a134faeSAndrzej Kaczmarek __le16 handle; 12635a134faeSAndrzej Kaczmarek __u8 type; 12645a134faeSAndrzej Kaczmarek } __packed; 12655a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 12665a134faeSAndrzej Kaczmarek __u8 status; 12675a134faeSAndrzej Kaczmarek __le16 handle; 12685a134faeSAndrzej Kaczmarek __s8 tx_power; 12695a134faeSAndrzej Kaczmarek } __packed; 12705a134faeSAndrzej Kaczmarek 1271f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1272f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1273f332ec66SJohan Hedberg __u8 status; 1274f332ec66SJohan Hedberg __u8 type; 1275f332ec66SJohan Hedberg } __packed; 1276f332ec66SJohan Hedberg 1277f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1278f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1279f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1280f6422ec6SAntti Julku 12815ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 12825ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 12835ae76a94SAndrzej Kaczmarek __le16 handle; 12845ae76a94SAndrzej Kaczmarek } __packed; 12855ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 12865ae76a94SAndrzej Kaczmarek __u8 status; 12875ae76a94SAndrzej Kaczmarek __le16 handle; 12885ae76a94SAndrzej Kaczmarek __s8 rssi; 12895ae76a94SAndrzej Kaczmarek } __packed; 12905ae76a94SAndrzej Kaczmarek 129133f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 129233f35721SJohan Hedberg struct hci_cp_read_clock { 129333f35721SJohan Hedberg __le16 handle; 129433f35721SJohan Hedberg __u8 which; 129533f35721SJohan Hedberg } __packed; 129633f35721SJohan Hedberg struct hci_rp_read_clock { 129733f35721SJohan Hedberg __u8 status; 129833f35721SJohan Hedberg __le16 handle; 129933f35721SJohan Hedberg __le32 clock; 130033f35721SJohan Hedberg __le16 accuracy; 130133f35721SJohan Hedberg } __packed; 130233f35721SJohan Hedberg 1303821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1304821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1305821f3766SJohan Hedberg __le16 handle; 1306821f3766SJohan Hedberg } __packed; 1307821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1308821f3766SJohan Hedberg __u8 status; 1309821f3766SJohan Hedberg __le16 handle; 1310821f3766SJohan Hedberg __u8 key_size; 1311821f3766SJohan Hedberg } __packed; 1312821f3766SJohan Hedberg 1313928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1314928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1315928abaa7SAndrei Emeltchenko __u8 status; 1316928abaa7SAndrei Emeltchenko __u8 amp_status; 1317928abaa7SAndrei Emeltchenko __le32 total_bw; 1318928abaa7SAndrei Emeltchenko __le32 max_bw; 1319928abaa7SAndrei Emeltchenko __le32 min_latency; 1320928abaa7SAndrei Emeltchenko __le32 max_pdu; 1321928abaa7SAndrei Emeltchenko __u8 amp_type; 1322928abaa7SAndrei Emeltchenko __le16 pal_cap; 1323928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1324928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1325928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1326928abaa7SAndrei Emeltchenko } __packed; 1327928abaa7SAndrei Emeltchenko 1328523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1329523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1330523e93cdSAndrei Emeltchenko __u8 phy_handle; 1331523e93cdSAndrei Emeltchenko __le16 len_so_far; 1332523e93cdSAndrei Emeltchenko __le16 max_len; 1333523e93cdSAndrei Emeltchenko } __packed; 1334523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1335523e93cdSAndrei Emeltchenko __u8 status; 1336523e93cdSAndrei Emeltchenko __u8 phy_handle; 1337523e93cdSAndrei Emeltchenko __le16 rem_len; 1338523e93cdSAndrei Emeltchenko __u8 frag[0]; 1339523e93cdSAndrei Emeltchenko } __packed; 1340523e93cdSAndrei Emeltchenko 1341523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1342523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1343523e93cdSAndrei Emeltchenko __u8 phy_handle; 1344523e93cdSAndrei Emeltchenko __le16 len_so_far; 1345523e93cdSAndrei Emeltchenko __le16 rem_len; 1346523e93cdSAndrei Emeltchenko __u8 frag[0]; 1347523e93cdSAndrei Emeltchenko } __packed; 1348523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1349523e93cdSAndrei Emeltchenko __u8 status; 1350523e93cdSAndrei Emeltchenko __u8 phy_handle; 1351523e93cdSAndrei Emeltchenko } __packed; 1352523e93cdSAndrei Emeltchenko 1353f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1354f4fe73edSMarcel Holtmann 13554b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 13564b4148e9SMarcel Holtmann 135706f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 135806f5b778SMarcel Holtmann 135963185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 136063185f64SVille Tervo struct hci_cp_le_set_event_mask { 136163185f64SVille Tervo __u8 mask[8]; 136263185f64SVille Tervo } __packed; 136363185f64SVille Tervo 136463185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 136563185f64SVille Tervo struct hci_rp_le_read_buffer_size { 136663185f64SVille Tervo __u8 status; 136763185f64SVille Tervo __le16 le_mtu; 136863185f64SVille Tervo __u8 le_max_pkt; 136963185f64SVille Tervo } __packed; 137063185f64SVille Tervo 137160e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 137260e77321SJohan Hedberg struct hci_rp_le_read_local_features { 137360e77321SJohan Hedberg __u8 status; 137460e77321SJohan Hedberg __u8 features[8]; 137560e77321SJohan Hedberg } __packed; 137660e77321SJohan Hedberg 1377d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1378d13eafceSMarcel Holtmann 13791e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 13801e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 13811e191893SMarcel Holtmann __le16 min_interval; 13821e191893SMarcel Holtmann __le16 max_interval; 13831e191893SMarcel Holtmann __u8 type; 13841e191893SMarcel Holtmann __u8 own_address_type; 13851e191893SMarcel Holtmann __u8 direct_addr_type; 13861e191893SMarcel Holtmann bdaddr_t direct_addr; 13871e191893SMarcel Holtmann __u8 channel_map; 13881e191893SMarcel Holtmann __u8 filter_policy; 13891e191893SMarcel Holtmann } __packed; 13901e191893SMarcel Holtmann 13918fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 13928fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 13938fa19098SJohan Hedberg __u8 status; 13948fa19098SJohan Hedberg __s8 tx_power; 13958fa19098SJohan Hedberg } __packed; 13968fa19098SJohan Hedberg 13973f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 13983f0f524bSJohan Hedberg 13993f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 14003f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 14013f0f524bSJohan Hedberg __u8 length; 14023f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 14033f0f524bSJohan Hedberg } __packed; 14043f0f524bSJohan Hedberg 1405f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1406f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1407f14d8f64SMarcel Holtmann __u8 length; 1408f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1409f14d8f64SMarcel Holtmann } __packed; 1410f14d8f64SMarcel Holtmann 1411c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1412c1d5dc4aSJohan Hedberg 14135df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 14145df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 14155df480b5SAndre Guedes 141607f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 141707f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 141807f7fa5dSAndre Guedes __u8 type; 141907f7fa5dSAndre Guedes __le16 interval; 142007f7fa5dSAndre Guedes __le16 window; 142107f7fa5dSAndre Guedes __u8 own_address_type; 142207f7fa5dSAndre Guedes __u8 filter_policy; 142307f7fa5dSAndre Guedes } __packed; 142407f7fa5dSAndre Guedes 142576a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 142676a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1427525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1428525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 142968a8aea4SAndrei Emeltchenko 1430eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1431eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1432eb9d91f5SAndre Guedes __u8 enable; 1433eb9d91f5SAndre Guedes __u8 filter_dup; 1434eb9d91f5SAndre Guedes } __packed; 1435eb9d91f5SAndre Guedes 1436a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1437a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1438a7139eddSJohan Hedberg 143963185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 144063185f64SVille Tervo struct hci_cp_le_create_conn { 144163185f64SVille Tervo __le16 scan_interval; 144263185f64SVille Tervo __le16 scan_window; 144363185f64SVille Tervo __u8 filter_policy; 144463185f64SVille Tervo __u8 peer_addr_type; 144563185f64SVille Tervo bdaddr_t peer_addr; 144663185f64SVille Tervo __u8 own_address_type; 144763185f64SVille Tervo __le16 conn_interval_min; 144863185f64SVille Tervo __le16 conn_interval_max; 144963185f64SVille Tervo __le16 conn_latency; 145063185f64SVille Tervo __le16 supervision_timeout; 145163185f64SVille Tervo __le16 min_ce_len; 145263185f64SVille Tervo __le16 max_ce_len; 145363185f64SVille Tervo } __packed; 145463185f64SVille Tervo 145563185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 145663185f64SVille Tervo 1457cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1458cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1459cf1d081fSJohan Hedberg __u8 status; 1460cf1d081fSJohan Hedberg __u8 size; 1461cf1d081fSJohan Hedberg } __packed; 1462cf1d081fSJohan Hedberg 1463d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1464d9a7b0a5SMarcel Holtmann 1465d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1466d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1467d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1468d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1469d9a7b0a5SMarcel Holtmann } __packed; 1470d9a7b0a5SMarcel Holtmann 1471d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1472d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1473d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1474d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1475d9a7b0a5SMarcel Holtmann } __packed; 1476d9a7b0a5SMarcel Holtmann 14772ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 14782ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 14792ce603ebSClaudio Takahasi __le16 handle; 14802ce603ebSClaudio Takahasi __le16 conn_interval_min; 14812ce603ebSClaudio Takahasi __le16 conn_interval_max; 14822ce603ebSClaudio Takahasi __le16 conn_latency; 14832ce603ebSClaudio Takahasi __le16 supervision_timeout; 14842ce603ebSClaudio Takahasi __le16 min_ce_len; 14852ce603ebSClaudio Takahasi __le16 max_ce_len; 14862ce603ebSClaudio Takahasi } __packed; 14872ce603ebSClaudio Takahasi 14880fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 14890fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 14900fe29fd1SMarcel Holtmann __le16 handle; 14910fe29fd1SMarcel Holtmann } __packed; 14920fe29fd1SMarcel Holtmann 1493a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1494a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1495a7a595f6SVinicius Costa Gomes __le16 handle; 1496fe39c7b2SMarcel Holtmann __le64 rand; 1497a7a595f6SVinicius Costa Gomes __le16 ediv; 1498a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1499a7a595f6SVinicius Costa Gomes } __packed; 1500a7a595f6SVinicius Costa Gomes 1501a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1502a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1503a7a595f6SVinicius Costa Gomes __le16 handle; 1504a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1505a7a595f6SVinicius Costa Gomes } __packed; 1506a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1507a7a595f6SVinicius Costa Gomes __u8 status; 1508a7a595f6SVinicius Costa Gomes __le16 handle; 1509a7a595f6SVinicius Costa Gomes } __packed; 1510a7a595f6SVinicius Costa Gomes 1511a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1512a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1513a7a595f6SVinicius Costa Gomes __le16 handle; 1514a7a595f6SVinicius Costa Gomes } __packed; 1515a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1516a7a595f6SVinicius Costa Gomes __u8 status; 1517a7a595f6SVinicius Costa Gomes __le16 handle; 1518a7a595f6SVinicius Costa Gomes } __packed; 1519a7a595f6SVinicius Costa Gomes 15209b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 15219b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 15229b008c04SJohan Hedberg __u8 status; 15239b008c04SJohan Hedberg __u8 le_states[8]; 15249b008c04SJohan Hedberg } __packed; 15259b008c04SJohan Hedberg 15268e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 15278e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 15288e75b46aSAndre Guedes __le16 handle; 15298e75b46aSAndre Guedes __le16 interval_min; 15308e75b46aSAndre Guedes __le16 interval_max; 15318e75b46aSAndre Guedes __le16 latency; 15328e75b46aSAndre Guedes __le16 timeout; 15338e75b46aSAndre Guedes __le16 min_ce_len; 15348e75b46aSAndre Guedes __le16 max_ce_len; 15358e75b46aSAndre Guedes } __packed; 15368e75b46aSAndre Guedes 15378e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 15388e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 15398e75b46aSAndre Guedes __le16 handle; 15408e75b46aSAndre Guedes __u8 reason; 15418e75b46aSAndre Guedes } __packed; 15428e75b46aSAndre Guedes 154394a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 154494a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 154594a3bd02SMarcel Holtmann __le16 handle; 154694a3bd02SMarcel Holtmann __le16 tx_len; 154794a3bd02SMarcel Holtmann __le16 tx_time; 154894a3bd02SMarcel Holtmann } __packed; 154994a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 155094a3bd02SMarcel Holtmann __u8 status; 155194a3bd02SMarcel Holtmann __le16 handle; 155294a3bd02SMarcel Holtmann } __packed; 155394a3bd02SMarcel Holtmann 155494a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 155594a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 155694a3bd02SMarcel Holtmann __u8 status; 155794a3bd02SMarcel Holtmann __le16 tx_len; 155894a3bd02SMarcel Holtmann __le16 tx_time; 155994a3bd02SMarcel Holtmann } __packed; 156094a3bd02SMarcel Holtmann 156194a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 156294a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 156394a3bd02SMarcel Holtmann __le16 tx_len; 156494a3bd02SMarcel Holtmann __le16 tx_time; 156594a3bd02SMarcel Holtmann } __packed; 156694a3bd02SMarcel Holtmann 1567b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1568b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1569b950aa88SAnkit Navik __u8 bdaddr_type; 1570b950aa88SAnkit Navik bdaddr_t bdaddr; 1571b950aa88SAnkit Navik __u8 peer_irk[16]; 1572b950aa88SAnkit Navik __u8 local_irk[16]; 1573b950aa88SAnkit Navik } __packed; 1574b950aa88SAnkit Navik 1575b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1576b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1577b950aa88SAnkit Navik __u8 bdaddr_type; 1578b950aa88SAnkit Navik bdaddr_t bdaddr; 1579b950aa88SAnkit Navik } __packed; 1580b950aa88SAnkit Navik 1581545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1582545f2596SAnkit Navik 1583cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1584cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1585cfdb0c2dSAnkit Navik __u8 status; 1586cfdb0c2dSAnkit Navik __u8 size; 1587cfdb0c2dSAnkit Navik } __packed; 1588cfdb0c2dSAnkit Navik 1589aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1590aa12af77SAnkit Navik 159194a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 159294a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 159394a3bd02SMarcel Holtmann __u8 status; 159494a3bd02SMarcel Holtmann __le16 tx_len; 159594a3bd02SMarcel Holtmann __le16 tx_time; 159694a3bd02SMarcel Holtmann __le16 rx_len; 159794a3bd02SMarcel Holtmann __le16 rx_time; 159894a3bd02SMarcel Holtmann } __packed; 159994a3bd02SMarcel Holtmann 1600de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1601de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1602de2ba303SMarcel Holtmann __u8 all_phys; 1603de2ba303SMarcel Holtmann __u8 tx_phys; 1604de2ba303SMarcel Holtmann __u8 rx_phys; 1605de2ba303SMarcel Holtmann } __packed; 1606de2ba303SMarcel Holtmann 16076decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 16086decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 16096decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 16106decb5b4SJaganath Kanakkassery 1611a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1612a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1613a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1614a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1615a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1616a2344b9eSJaganath Kanakkassery __u8 data[0]; 1617a2344b9eSJaganath Kanakkassery } __packed; 1618a2344b9eSJaganath Kanakkassery 1619a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 162045bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 162145bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1622a2344b9eSJaganath Kanakkassery 1623a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1624a2344b9eSJaganath Kanakkassery __u8 type; 1625a2344b9eSJaganath Kanakkassery __le16 interval; 1626a2344b9eSJaganath Kanakkassery __le16 window; 1627a2344b9eSJaganath Kanakkassery } __packed; 1628a2344b9eSJaganath Kanakkassery 1629a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1630a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1631a2344b9eSJaganath Kanakkassery __u8 enable; 1632a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1633a2344b9eSJaganath Kanakkassery __le16 duration; 1634a2344b9eSJaganath Kanakkassery __le16 period; 1635a2344b9eSJaganath Kanakkassery } __packed; 1636a2344b9eSJaganath Kanakkassery 16374d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 16384d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 16394d94f95dSJaganath Kanakkassery __u8 filter_policy; 16404d94f95dSJaganath Kanakkassery __u8 own_addr_type; 16414d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 16424d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 16434d94f95dSJaganath Kanakkassery __u8 phys; 16444d94f95dSJaganath Kanakkassery __u8 data[0]; 16454d94f95dSJaganath Kanakkassery } __packed; 16464d94f95dSJaganath Kanakkassery 16474d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 16484d94f95dSJaganath Kanakkassery __le16 scan_interval; 16494d94f95dSJaganath Kanakkassery __le16 scan_window; 16504d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 16514d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 16524d94f95dSJaganath Kanakkassery __le16 conn_latency; 16534d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 16544d94f95dSJaganath Kanakkassery __le16 min_ce_len; 16554d94f95dSJaganath Kanakkassery __le16 max_ce_len; 16564d94f95dSJaganath Kanakkassery } __packed; 16574d94f95dSJaganath Kanakkassery 16586b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 16596b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 16606b49bcb4SJaganath Kanakkassery __u8 status; 16616b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 16626b49bcb4SJaganath Kanakkassery } __packed; 16636b49bcb4SJaganath Kanakkassery 1664de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1665de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1666de181e88SJaganath Kanakkassery __u8 handle; 1667de181e88SJaganath Kanakkassery __le16 evt_properties; 1668de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1669de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1670de181e88SJaganath Kanakkassery __u8 channel_map; 1671de181e88SJaganath Kanakkassery __u8 own_addr_type; 1672de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1673de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1674de181e88SJaganath Kanakkassery __u8 filter_policy; 1675de181e88SJaganath Kanakkassery __u8 tx_power; 1676de181e88SJaganath Kanakkassery __u8 primary_phy; 1677de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1678de181e88SJaganath Kanakkassery __u8 secondary_phy; 1679de181e88SJaganath Kanakkassery __u8 sid; 1680de181e88SJaganath Kanakkassery __u8 notif_enable; 1681de181e88SJaganath Kanakkassery } __packed; 1682de181e88SJaganath Kanakkassery 1683de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 168485a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 168585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1686de181e88SJaganath Kanakkassery 1687de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1688de181e88SJaganath Kanakkassery __u8 status; 1689de181e88SJaganath Kanakkassery __u8 tx_power; 1690de181e88SJaganath Kanakkassery } __packed; 1691de181e88SJaganath Kanakkassery 1692de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1693de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1694de181e88SJaganath Kanakkassery __u8 enable; 1695de181e88SJaganath Kanakkassery __u8 num_of_sets; 1696de181e88SJaganath Kanakkassery __u8 data[0]; 1697de181e88SJaganath Kanakkassery } __packed; 1698de181e88SJaganath Kanakkassery 1699de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1700de181e88SJaganath Kanakkassery __u8 handle; 1701de181e88SJaganath Kanakkassery __le16 duration; 1702de181e88SJaganath Kanakkassery __u8 max_events; 1703de181e88SJaganath Kanakkassery } __packed; 1704de181e88SJaganath Kanakkassery 1705a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1706a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1707a0fb3726SJaganath Kanakkassery __u8 handle; 1708a0fb3726SJaganath Kanakkassery __u8 operation; 1709a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1710a0fb3726SJaganath Kanakkassery __u8 length; 1711a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1712a0fb3726SJaganath Kanakkassery } __packed; 1713a0fb3726SJaganath Kanakkassery 1714a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1715a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1716a0fb3726SJaganath Kanakkassery __u8 handle; 1717a0fb3726SJaganath Kanakkassery __u8 operation; 1718a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1719a0fb3726SJaganath Kanakkassery __u8 length; 1720a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1721a0fb3726SJaganath Kanakkassery } __packed; 1722a0fb3726SJaganath Kanakkassery 1723a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1724a0fb3726SJaganath Kanakkassery 1725a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1726a0fb3726SJaganath Kanakkassery 172745b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 172845b7749fSJaganath Kanakkassery 1729a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1730a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1731a73c046aSJaganath Kanakkassery __u8 handle; 1732a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1733a73c046aSJaganath Kanakkassery } __packed; 1734a73c046aSJaganath Kanakkassery 1735*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 1736*4de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 { 1737*4de0fc59SLuiz Augusto von Dentz __u8 status; 1738*4de0fc59SLuiz Augusto von Dentz __le16 acl_mtu; 1739*4de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt; 1740*4de0fc59SLuiz Augusto von Dentz __le16 iso_mtu; 1741*4de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt; 1742*4de0fc59SLuiz Augusto von Dentz } __packed; 1743*4de0fc59SLuiz Augusto von Dentz 1744*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 1745*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync { 1746*4de0fc59SLuiz Augusto von Dentz __le16 handle; 1747*4de0fc59SLuiz Augusto von Dentz } __packed; 1748*4de0fc59SLuiz Augusto von Dentz 1749*4de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync { 1750*4de0fc59SLuiz Augusto von Dentz __u8 status; 1751*4de0fc59SLuiz Augusto von Dentz __le16 handle; 1752*4de0fc59SLuiz Augusto von Dentz __le16 seq; 1753*4de0fc59SLuiz Augusto von Dentz __le32 imestamp; 1754*4de0fc59SLuiz Augusto von Dentz __u8 offset[3]; 1755*4de0fc59SLuiz Augusto von Dentz } __packed; 1756*4de0fc59SLuiz Augusto von Dentz 1757*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062 1758*4de0fc59SLuiz Augusto von Dentz struct hci_cis_params { 1759*4de0fc59SLuiz Augusto von Dentz __u8 cis_id; 1760*4de0fc59SLuiz Augusto von Dentz __le16 m_sdu; 1761*4de0fc59SLuiz Augusto von Dentz __le16 s_sdu; 1762*4de0fc59SLuiz Augusto von Dentz __u8 m_phy; 1763*4de0fc59SLuiz Augusto von Dentz __u8 s_phy; 1764*4de0fc59SLuiz Augusto von Dentz __u8 m_rtn; 1765*4de0fc59SLuiz Augusto von Dentz __u8 s_rtn; 1766*4de0fc59SLuiz Augusto von Dentz } __packed; 1767*4de0fc59SLuiz Augusto von Dentz 1768*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params { 1769*4de0fc59SLuiz Augusto von Dentz __u8 cig_id; 1770*4de0fc59SLuiz Augusto von Dentz __u8 m_interval[3]; 1771*4de0fc59SLuiz Augusto von Dentz __u8 s_interval[3]; 1772*4de0fc59SLuiz Augusto von Dentz __u8 sca; 1773*4de0fc59SLuiz Augusto von Dentz __u8 packing; 1774*4de0fc59SLuiz Augusto von Dentz __u8 framing; 1775*4de0fc59SLuiz Augusto von Dentz __le16 m_latency; 1776*4de0fc59SLuiz Augusto von Dentz __le16 s_latency; 1777*4de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1778*4de0fc59SLuiz Augusto von Dentz struct hci_cis_params cis[0]; 1779*4de0fc59SLuiz Augusto von Dentz } __packed; 1780*4de0fc59SLuiz Augusto von Dentz 1781*4de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params { 1782*4de0fc59SLuiz Augusto von Dentz __u8 status; 1783*4de0fc59SLuiz Augusto von Dentz __u8 cig_id; 1784*4de0fc59SLuiz Augusto von Dentz __u8 num_handles; 1785*4de0fc59SLuiz Augusto von Dentz __le16 handle[0]; 1786*4de0fc59SLuiz Augusto von Dentz } __packed; 1787*4de0fc59SLuiz Augusto von Dentz 1788*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064 1789*4de0fc59SLuiz Augusto von Dentz struct hci_cis { 1790*4de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 1791*4de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 1792*4de0fc59SLuiz Augusto von Dentz } __packed; 1793*4de0fc59SLuiz Augusto von Dentz 1794*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis { 1795*4de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1796*4de0fc59SLuiz Augusto von Dentz struct hci_cis cis[0]; 1797*4de0fc59SLuiz Augusto von Dentz } __packed; 1798*4de0fc59SLuiz Augusto von Dentz 1799*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065 1800*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig { 1801*4de0fc59SLuiz Augusto von Dentz __u8 cig_id; 1802*4de0fc59SLuiz Augusto von Dentz } __packed; 1803*4de0fc59SLuiz Augusto von Dentz 1804*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066 1805*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis { 1806*4de0fc59SLuiz Augusto von Dentz __le16 handle; 1807*4de0fc59SLuiz Augusto von Dentz } __packed; 1808*4de0fc59SLuiz Augusto von Dentz 1809*4de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067 1810*4de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis { 1811*4de0fc59SLuiz Augusto von Dentz __le16 handle; 1812*4de0fc59SLuiz Augusto von Dentz __u8 reason; 1813*4de0fc59SLuiz Augusto von Dentz } __packed; 1814*4de0fc59SLuiz Augusto von Dentz 18151da177e4SLinus Torvalds /* ---- HCI Events ---- */ 18161da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 18171da177e4SLinus Torvalds 18181da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 18191da177e4SLinus Torvalds struct inquiry_info { 18201da177e4SLinus Torvalds bdaddr_t bdaddr; 18211da177e4SLinus Torvalds __u8 pscan_rep_mode; 18221da177e4SLinus Torvalds __u8 pscan_period_mode; 18231da177e4SLinus Torvalds __u8 pscan_mode; 18241da177e4SLinus Torvalds __u8 dev_class[3]; 18251ebb9252SMarcel Holtmann __le16 clock_offset; 182666c853ccSGustavo F. Padovan } __packed; 18271da177e4SLinus Torvalds 18281da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 18291da177e4SLinus Torvalds struct hci_ev_conn_complete { 18301da177e4SLinus Torvalds __u8 status; 18311ebb9252SMarcel Holtmann __le16 handle; 18321da177e4SLinus Torvalds bdaddr_t bdaddr; 18331da177e4SLinus Torvalds __u8 link_type; 18341da177e4SLinus Torvalds __u8 encr_mode; 183566c853ccSGustavo F. Padovan } __packed; 18361da177e4SLinus Torvalds 18371da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 18381da177e4SLinus Torvalds struct hci_ev_conn_request { 18391da177e4SLinus Torvalds bdaddr_t bdaddr; 18401da177e4SLinus Torvalds __u8 dev_class[3]; 18411da177e4SLinus Torvalds __u8 link_type; 184266c853ccSGustavo F. Padovan } __packed; 18431da177e4SLinus Torvalds 18441da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 18451da177e4SLinus Torvalds struct hci_ev_disconn_complete { 18461da177e4SLinus Torvalds __u8 status; 18471ebb9252SMarcel Holtmann __le16 handle; 18481da177e4SLinus Torvalds __u8 reason; 184966c853ccSGustavo F. Padovan } __packed; 18501da177e4SLinus Torvalds 18511da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 18521da177e4SLinus Torvalds struct hci_ev_auth_complete { 18531da177e4SLinus Torvalds __u8 status; 18541ebb9252SMarcel Holtmann __le16 handle; 185566c853ccSGustavo F. Padovan } __packed; 18561da177e4SLinus Torvalds 1857a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1858a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1859a9de9248SMarcel Holtmann __u8 status; 1860a9de9248SMarcel Holtmann bdaddr_t bdaddr; 18611f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 186266c853ccSGustavo F. Padovan } __packed; 1863a9de9248SMarcel Holtmann 18641da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 18651da177e4SLinus Torvalds struct hci_ev_encrypt_change { 18661da177e4SLinus Torvalds __u8 status; 18671ebb9252SMarcel Holtmann __le16 handle; 18681da177e4SLinus Torvalds __u8 encrypt; 186966c853ccSGustavo F. Padovan } __packed; 18701da177e4SLinus Torvalds 1871a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1872a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 18731da177e4SLinus Torvalds __u8 status; 18741ebb9252SMarcel Holtmann __le16 handle; 187566c853ccSGustavo F. Padovan } __packed; 18761da177e4SLinus Torvalds 1877a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1878a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1879a9de9248SMarcel Holtmann __u8 status; 1880a9de9248SMarcel Holtmann __le16 handle; 1881a9de9248SMarcel Holtmann __u8 features[8]; 188266c853ccSGustavo F. Padovan } __packed; 1883a9de9248SMarcel Holtmann 1884a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1885a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1886a9de9248SMarcel Holtmann __u8 status; 1887a9de9248SMarcel Holtmann __le16 handle; 1888a9de9248SMarcel Holtmann __u8 lmp_ver; 1889a9de9248SMarcel Holtmann __le16 manufacturer; 1890a9de9248SMarcel Holtmann __le16 lmp_subver; 189166c853ccSGustavo F. Padovan } __packed; 1892a9de9248SMarcel Holtmann 1893a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 18941da177e4SLinus Torvalds struct hci_qos { 18951da177e4SLinus Torvalds __u8 service_type; 18961da177e4SLinus Torvalds __u32 token_rate; 18971da177e4SLinus Torvalds __u32 peak_bandwidth; 18981da177e4SLinus Torvalds __u32 latency; 18991da177e4SLinus Torvalds __u32 delay_variation; 190066c853ccSGustavo F. Padovan } __packed; 19011da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 19021da177e4SLinus Torvalds __u8 status; 19031ebb9252SMarcel Holtmann __le16 handle; 19041da177e4SLinus Torvalds struct hci_qos qos; 190566c853ccSGustavo F. Padovan } __packed; 19061da177e4SLinus Torvalds 1907a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 19081da177e4SLinus Torvalds struct hci_ev_cmd_complete { 19091da177e4SLinus Torvalds __u8 ncmd; 19101ebb9252SMarcel Holtmann __le16 opcode; 191166c853ccSGustavo F. Padovan } __packed; 19121da177e4SLinus Torvalds 1913a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 19141da177e4SLinus Torvalds struct hci_ev_cmd_status { 19151da177e4SLinus Torvalds __u8 status; 19161da177e4SLinus Torvalds __u8 ncmd; 19171ebb9252SMarcel Holtmann __le16 opcode; 191866c853ccSGustavo F. Padovan } __packed; 19191da177e4SLinus Torvalds 192024dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 192124dfa343SMarcel Holtmann struct hci_ev_hardware_error { 192224dfa343SMarcel Holtmann __u8 code; 192324dfa343SMarcel Holtmann } __packed; 192424dfa343SMarcel Holtmann 19251da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 19261da177e4SLinus Torvalds struct hci_ev_role_change { 19271da177e4SLinus Torvalds __u8 status; 19281da177e4SLinus Torvalds bdaddr_t bdaddr; 19291da177e4SLinus Torvalds __u8 role; 193066c853ccSGustavo F. Padovan } __packed; 19311da177e4SLinus Torvalds 1932a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 1933613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 1934613a1c0cSAndrei Emeltchenko __le16 handle; 1935613a1c0cSAndrei Emeltchenko __le16 count; 1936613a1c0cSAndrei Emeltchenko } __packed; 1937613a1c0cSAndrei Emeltchenko 1938a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 1939a9de9248SMarcel Holtmann __u8 num_hndl; 1940613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info handles[0]; 194166c853ccSGustavo F. Padovan } __packed; 1942a9de9248SMarcel Holtmann 19431da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 19441da177e4SLinus Torvalds struct hci_ev_mode_change { 19451da177e4SLinus Torvalds __u8 status; 19461ebb9252SMarcel Holtmann __le16 handle; 19471da177e4SLinus Torvalds __u8 mode; 19481ebb9252SMarcel Holtmann __le16 interval; 194966c853ccSGustavo F. Padovan } __packed; 19501da177e4SLinus Torvalds 19511da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 19521da177e4SLinus Torvalds struct hci_ev_pin_code_req { 19531da177e4SLinus Torvalds bdaddr_t bdaddr; 195466c853ccSGustavo F. Padovan } __packed; 19551da177e4SLinus Torvalds 19561da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 19571da177e4SLinus Torvalds struct hci_ev_link_key_req { 19581da177e4SLinus Torvalds bdaddr_t bdaddr; 195966c853ccSGustavo F. Padovan } __packed; 19601da177e4SLinus Torvalds 19611da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 19621da177e4SLinus Torvalds struct hci_ev_link_key_notify { 19631da177e4SLinus Torvalds bdaddr_t bdaddr; 19649b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 19651da177e4SLinus Torvalds __u8 key_type; 196666c853ccSGustavo F. Padovan } __packed; 19671da177e4SLinus Torvalds 1968a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 19691da177e4SLinus Torvalds struct hci_ev_clock_offset { 19701da177e4SLinus Torvalds __u8 status; 19711ebb9252SMarcel Holtmann __le16 handle; 19721ebb9252SMarcel Holtmann __le16 clock_offset; 197366c853ccSGustavo F. Padovan } __packed; 19741da177e4SLinus Torvalds 1975a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 1976a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 1977a8746417SMarcel Holtmann __u8 status; 1978a8746417SMarcel Holtmann __le16 handle; 1979a8746417SMarcel Holtmann __le16 pkt_type; 198066c853ccSGustavo F. Padovan } __packed; 1981a8746417SMarcel Holtmann 198285a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 198385a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 198485a1e930SMarcel Holtmann bdaddr_t bdaddr; 198585a1e930SMarcel Holtmann __u8 pscan_rep_mode; 198666c853ccSGustavo F. Padovan } __packed; 198785a1e930SMarcel Holtmann 1988a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 1989a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 1990a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1991a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1992a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1993a9de9248SMarcel Holtmann __u8 dev_class[3]; 1994a9de9248SMarcel Holtmann __le16 clock_offset; 1995a9de9248SMarcel Holtmann __s8 rssi; 199666c853ccSGustavo F. Padovan } __packed; 1997a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 1998a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1999a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2000a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2001a9de9248SMarcel Holtmann __u8 pscan_mode; 2002a9de9248SMarcel Holtmann __u8 dev_class[3]; 2003a9de9248SMarcel Holtmann __le16 clock_offset; 2004a9de9248SMarcel Holtmann __s8 rssi; 200566c853ccSGustavo F. Padovan } __packed; 2006a9de9248SMarcel Holtmann 2007a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 2008a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 2009a9de9248SMarcel Holtmann __u8 status; 2010a9de9248SMarcel Holtmann __le16 handle; 2011a9de9248SMarcel Holtmann __u8 page; 2012a9de9248SMarcel Holtmann __u8 max_page; 2013a9de9248SMarcel Holtmann __u8 features[8]; 201466c853ccSGustavo F. Padovan } __packed; 2015a9de9248SMarcel Holtmann 2016a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 2017a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 2018a9de9248SMarcel Holtmann __u8 status; 2019a9de9248SMarcel Holtmann __le16 handle; 2020a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2021a9de9248SMarcel Holtmann __u8 link_type; 2022a9de9248SMarcel Holtmann __u8 tx_interval; 2023a9de9248SMarcel Holtmann __u8 retrans_window; 2024a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2025a9de9248SMarcel Holtmann __le16 tx_pkt_len; 2026a9de9248SMarcel Holtmann __u8 air_mode; 202766c853ccSGustavo F. Padovan } __packed; 2028a9de9248SMarcel Holtmann 2029a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 2030a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 2031a9de9248SMarcel Holtmann __u8 status; 2032a9de9248SMarcel Holtmann __le16 handle; 2033a9de9248SMarcel Holtmann __u8 tx_interval; 2034a9de9248SMarcel Holtmann __u8 retrans_window; 2035a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2036a9de9248SMarcel Holtmann __le16 tx_pkt_len; 203766c853ccSGustavo F. Padovan } __packed; 2038a9de9248SMarcel Holtmann 2039a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 204004837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 204104837f64SMarcel Holtmann __u8 status; 204204837f64SMarcel Holtmann __le16 handle; 204304837f64SMarcel Holtmann __le16 max_tx_latency; 204404837f64SMarcel Holtmann __le16 max_rx_latency; 204504837f64SMarcel Holtmann __le16 max_remote_timeout; 204604837f64SMarcel Holtmann __le16 max_local_timeout; 204766c853ccSGustavo F. Padovan } __packed; 204804837f64SMarcel Holtmann 2049a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 2050a9de9248SMarcel Holtmann struct extended_inquiry_info { 2051a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2052a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2053a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2054a9de9248SMarcel Holtmann __u8 dev_class[3]; 2055a9de9248SMarcel Holtmann __le16 clock_offset; 2056a9de9248SMarcel Holtmann __s8 rssi; 2057a9de9248SMarcel Holtmann __u8 data[240]; 205866c853ccSGustavo F. Padovan } __packed; 2059a9de9248SMarcel Holtmann 20601c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 20611c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 20621c2e0041SJohan Hedberg __u8 status; 20631c2e0041SJohan Hedberg __le16 handle; 20641c2e0041SJohan Hedberg } __packed; 20651c2e0041SJohan Hedberg 20660493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 20670493684eSMarcel Holtmann struct hci_ev_io_capa_request { 20680493684eSMarcel Holtmann bdaddr_t bdaddr; 206966c853ccSGustavo F. Padovan } __packed; 20700493684eSMarcel Holtmann 207103b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 207203b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 207303b555e1SJohan Hedberg bdaddr_t bdaddr; 207403b555e1SJohan Hedberg __u8 capability; 207503b555e1SJohan Hedberg __u8 oob_data; 207603b555e1SJohan Hedberg __u8 authentication; 207703b555e1SJohan Hedberg } __packed; 207803b555e1SJohan Hedberg 2079a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 2080a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 2081a5c29683SJohan Hedberg bdaddr_t bdaddr; 2082a5c29683SJohan Hedberg __le32 passkey; 2083a5c29683SJohan Hedberg } __packed; 2084a5c29683SJohan Hedberg 20859ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 20869ad4019aSBrian Gix struct hci_ev_user_passkey_req { 20879ad4019aSBrian Gix bdaddr_t bdaddr; 20889ad4019aSBrian Gix } __packed; 20899ad4019aSBrian Gix 20902763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 20912763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 20922763eda6SSzymon Janc bdaddr_t bdaddr; 20932763eda6SSzymon Janc } __packed; 20942763eda6SSzymon Janc 20950493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 20960493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 20970493684eSMarcel Holtmann __u8 status; 20980493684eSMarcel Holtmann bdaddr_t bdaddr; 209966c853ccSGustavo F. Padovan } __packed; 21000493684eSMarcel Holtmann 210192a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 210292a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 210392a25256SJohan Hedberg bdaddr_t bdaddr; 210492a25256SJohan Hedberg __le32 passkey; 210592a25256SJohan Hedberg } __packed; 210692a25256SJohan Hedberg 210792a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 210892a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 210992a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 211092a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 211192a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 211292a25256SJohan Hedberg 211392a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 211492a25256SJohan Hedberg struct hci_ev_keypress_notify { 211592a25256SJohan Hedberg bdaddr_t bdaddr; 211692a25256SJohan Hedberg __u8 type; 211792a25256SJohan Hedberg } __packed; 211892a25256SJohan Hedberg 211941a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 212041a96212SMarcel Holtmann struct hci_ev_remote_host_features { 212141a96212SMarcel Holtmann bdaddr_t bdaddr; 212241a96212SMarcel Holtmann __u8 features[8]; 212366c853ccSGustavo F. Padovan } __packed; 212441a96212SMarcel Holtmann 212563185f64SVille Tervo #define HCI_EV_LE_META 0x3e 212663185f64SVille Tervo struct hci_ev_le_meta { 212763185f64SVille Tervo __u8 subevent; 212863185f64SVille Tervo } __packed; 212963185f64SVille Tervo 2130523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2131523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2132523e93cdSAndrei Emeltchenko __u8 status; 2133523e93cdSAndrei Emeltchenko __u8 phy_handle; 2134523e93cdSAndrei Emeltchenko } __packed; 2135523e93cdSAndrei Emeltchenko 2136523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2137523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2138523e93cdSAndrei Emeltchenko __u8 phy_handle; 2139523e93cdSAndrei Emeltchenko } __packed; 2140523e93cdSAndrei Emeltchenko 2141523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2142523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2143523e93cdSAndrei Emeltchenko __u8 status; 2144523e93cdSAndrei Emeltchenko __u8 phy_handle; 2145523e93cdSAndrei Emeltchenko __u8 reason; 2146523e93cdSAndrei Emeltchenko } __packed; 2147523e93cdSAndrei Emeltchenko 2148523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2149523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2150523e93cdSAndrei Emeltchenko __u8 status; 2151523e93cdSAndrei Emeltchenko __le16 handle; 2152523e93cdSAndrei Emeltchenko __u8 phy_handle; 2153523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2154523e93cdSAndrei Emeltchenko } __packed; 2155523e93cdSAndrei Emeltchenko 2156523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2157523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2158523e93cdSAndrei Emeltchenko __u8 status; 2159523e93cdSAndrei Emeltchenko __le16 handle; 2160523e93cdSAndrei Emeltchenko __u8 reason; 2161523e93cdSAndrei Emeltchenko } __packed; 2162523e93cdSAndrei Emeltchenko 216325e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 216425e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 216525e89e99SAndrei Emeltchenko __le16 handle; 216625e89e99SAndrei Emeltchenko __le16 pkts; 216725e89e99SAndrei Emeltchenko __le16 blocks; 216825e89e99SAndrei Emeltchenko } __packed; 216925e89e99SAndrei Emeltchenko 217025e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 217125e89e99SAndrei Emeltchenko __le16 num_blocks; 217225e89e99SAndrei Emeltchenko __u8 num_hndl; 217325e89e99SAndrei Emeltchenko struct hci_comp_blocks_info handles[0]; 217425e89e99SAndrei Emeltchenko } __packed; 217525e89e99SAndrei Emeltchenko 21762b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 21772b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 21782b359445SDoHyun Pyun __u8 status; 21792b359445SDoHyun Pyun } __packed; 21802b359445SDoHyun Pyun 21812ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 21822ed01805SDoHyun Pyun 218363185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 218463185f64SVille Tervo struct hci_ev_le_conn_complete { 218563185f64SVille Tervo __u8 status; 218663185f64SVille Tervo __le16 handle; 218763185f64SVille Tervo __u8 role; 218863185f64SVille Tervo __u8 bdaddr_type; 218963185f64SVille Tervo bdaddr_t bdaddr; 219063185f64SVille Tervo __le16 interval; 219163185f64SVille Tervo __le16 latency; 219263185f64SVille Tervo __le16 supervision_timeout; 219363185f64SVille Tervo __u8 clk_accurancy; 219463185f64SVille Tervo } __packed; 219563185f64SVille Tervo 21962331fd46SMarcel Holtmann /* Advertising report event types */ 21972331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 21982331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 21992331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 22002331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 22012331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2202c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2203c215e939SJaganath Kanakkassery 2204c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2205c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2206c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2207c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2208c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2209c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2210c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 22112331fd46SMarcel Holtmann 2212b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2213b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2214b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2215b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2216b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2217b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2218b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2219b2cc9761SJaganath Kanakkassery 22202331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 22212331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 22222331fd46SMarcel Holtmann 22232331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 22242331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 22252331fd46SMarcel Holtmann __u8 evt_type; 22262331fd46SMarcel Holtmann __u8 bdaddr_type; 22272331fd46SMarcel Holtmann bdaddr_t bdaddr; 22282331fd46SMarcel Holtmann __u8 length; 22292331fd46SMarcel Holtmann __u8 data[0]; 22302331fd46SMarcel Holtmann } __packed; 22312331fd46SMarcel Holtmann 22321855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 22331855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 22341855d92dSMarcel Holtmann __u8 status; 22351855d92dSMarcel Holtmann __le16 handle; 22361855d92dSMarcel Holtmann __le16 interval; 22371855d92dSMarcel Holtmann __le16 latency; 22381855d92dSMarcel Holtmann __le16 supervision_timeout; 22391855d92dSMarcel Holtmann } __packed; 22401855d92dSMarcel Holtmann 22410fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 22420fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 22430fe29fd1SMarcel Holtmann __u8 status; 22440fe29fd1SMarcel Holtmann __le16 handle; 22450fe29fd1SMarcel Holtmann __u8 features[8]; 22460fe29fd1SMarcel Holtmann } __packed; 22470fe29fd1SMarcel Holtmann 2248a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2249a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2250a7a595f6SVinicius Costa Gomes __le16 handle; 2251fe39c7b2SMarcel Holtmann __le64 rand; 2252a7a595f6SVinicius Costa Gomes __le16 ediv; 2253a7a595f6SVinicius Costa Gomes } __packed; 2254a7a595f6SVinicius Costa Gomes 22558e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 22568e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 22578e75b46aSAndre Guedes __le16 handle; 22588e75b46aSAndre Guedes __le16 interval_min; 22598e75b46aSAndre Guedes __le16 interval_max; 22608e75b46aSAndre Guedes __le16 latency; 22618e75b46aSAndre Guedes __le16 timeout; 22628e75b46aSAndre Guedes } __packed; 22638e75b46aSAndre Guedes 226494a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 226594a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 226694a3bd02SMarcel Holtmann __le16 handle; 226794a3bd02SMarcel Holtmann __le16 tx_len; 226894a3bd02SMarcel Holtmann __le16 tx_time; 226994a3bd02SMarcel Holtmann __le16 rx_len; 227094a3bd02SMarcel Holtmann __le16 rx_time; 227194a3bd02SMarcel Holtmann } __packed; 227294a3bd02SMarcel Holtmann 227332c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 227432c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 227532c9d43fSMarcel Holtmann __u8 evt_type; 227632c9d43fSMarcel Holtmann __u8 bdaddr_type; 227732c9d43fSMarcel Holtmann bdaddr_t bdaddr; 227832c9d43fSMarcel Holtmann __u8 direct_addr_type; 227932c9d43fSMarcel Holtmann bdaddr_t direct_addr; 228032c9d43fSMarcel Holtmann __s8 rssi; 228132c9d43fSMarcel Holtmann } __packed; 228232c9d43fSMarcel Holtmann 22831efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 22841efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 22851efd927dSLuiz Augusto von Dentz __u8 status; 2286*4de0fc59SLuiz Augusto von Dentz __le16 handle; 22871efd927dSLuiz Augusto von Dentz __u8 tx_phy; 22881efd927dSLuiz Augusto von Dentz __u8 rx_phy; 22891efd927dSLuiz Augusto von Dentz } __packed; 22901efd927dSLuiz Augusto von Dentz 2291c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2292c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2293c215e939SJaganath Kanakkassery __le16 evt_type; 2294c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2295c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2296c215e939SJaganath Kanakkassery __u8 primary_phy; 2297c215e939SJaganath Kanakkassery __u8 secondary_phy; 2298c215e939SJaganath Kanakkassery __u8 sid; 2299c215e939SJaganath Kanakkassery __u8 tx_power; 2300c215e939SJaganath Kanakkassery __s8 rssi; 2301c215e939SJaganath Kanakkassery __le16 interval; 2302c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2303c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2304c215e939SJaganath Kanakkassery __u8 length; 2305c215e939SJaganath Kanakkassery __u8 data[0]; 2306c215e939SJaganath Kanakkassery } __packed; 2307c215e939SJaganath Kanakkassery 23084d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 23094d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 23104d94f95dSJaganath Kanakkassery __u8 status; 23114d94f95dSJaganath Kanakkassery __le16 handle; 23124d94f95dSJaganath Kanakkassery __u8 role; 23134d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 23144d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 23154d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 23164d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 23174d94f95dSJaganath Kanakkassery __le16 interval; 23184d94f95dSJaganath Kanakkassery __le16 latency; 23194d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 23204d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 23214d94f95dSJaganath Kanakkassery } __packed; 23224d94f95dSJaganath Kanakkassery 2323acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2324acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2325acf0aeaeSJaganath Kanakkassery __u8 status; 2326acf0aeaeSJaganath Kanakkassery __u8 handle; 2327acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2328acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2329acf0aeaeSJaganath Kanakkassery } __packed; 2330acf0aeaeSJaganath Kanakkassery 2331*4de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19 2332*4de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established { 2333*4de0fc59SLuiz Augusto von Dentz __u8 status; 2334*4de0fc59SLuiz Augusto von Dentz __le16 handle; 2335*4de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3]; 2336*4de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3]; 2337*4de0fc59SLuiz Augusto von Dentz __u8 m_latency[3]; 2338*4de0fc59SLuiz Augusto von Dentz __u8 s_latency[3]; 2339*4de0fc59SLuiz Augusto von Dentz __u8 m_phy; 2340*4de0fc59SLuiz Augusto von Dentz __u8 s_phy; 2341*4de0fc59SLuiz Augusto von Dentz __u8 nse; 2342*4de0fc59SLuiz Augusto von Dentz __u8 m_bn; 2343*4de0fc59SLuiz Augusto von Dentz __u8 s_bn; 2344*4de0fc59SLuiz Augusto von Dentz __u8 m_ft; 2345*4de0fc59SLuiz Augusto von Dentz __u8 s_ft; 2346*4de0fc59SLuiz Augusto von Dentz __le16 m_mtu; 2347*4de0fc59SLuiz Augusto von Dentz __le16 s_mtu; 2348*4de0fc59SLuiz Augusto von Dentz __le16 interval; 2349*4de0fc59SLuiz Augusto von Dentz } __packed; 2350*4de0fc59SLuiz Augusto von Dentz 2351*4de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a 2352*4de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req { 2353*4de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 2354*4de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 2355*4de0fc59SLuiz Augusto von Dentz __u8 cig_id; 2356*4de0fc59SLuiz Augusto von Dentz __u8 cis_id; 2357*4de0fc59SLuiz Augusto von Dentz } __packed; 2358*4de0fc59SLuiz Augusto von Dentz 2359e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2360e4cc5a18SMarcel Holtmann 23611da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2362a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 23631da177e4SLinus Torvalds struct hci_ev_stack_internal { 23641da177e4SLinus Torvalds __u16 type; 23651da177e4SLinus Torvalds __u8 data[0]; 236666c853ccSGustavo F. Padovan } __packed; 23671da177e4SLinus Torvalds 23681da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 23691da177e4SLinus Torvalds struct hci_ev_si_device { 23701da177e4SLinus Torvalds __u16 event; 23711da177e4SLinus Torvalds __u16 dev_id; 237266c853ccSGustavo F. Padovan } __packed; 23731da177e4SLinus Torvalds 23741da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 23751da177e4SLinus Torvalds struct hci_ev_si_security { 23761da177e4SLinus Torvalds __u16 event; 23771da177e4SLinus Torvalds __u16 proto; 23781da177e4SLinus Torvalds __u16 subproto; 23791da177e4SLinus Torvalds __u8 incoming; 238066c853ccSGustavo F. Padovan } __packed; 23811da177e4SLinus Torvalds 23821da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 23831da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 23841da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 23851da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 23861da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 2387*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4 23881da177e4SLinus Torvalds 23891da177e4SLinus Torvalds struct hci_command_hdr { 23901ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 23911da177e4SLinus Torvalds __u8 plen; 239266c853ccSGustavo F. Padovan } __packed; 23931da177e4SLinus Torvalds 23941da177e4SLinus Torvalds struct hci_event_hdr { 23951da177e4SLinus Torvalds __u8 evt; 23961da177e4SLinus Torvalds __u8 plen; 239766c853ccSGustavo F. Padovan } __packed; 23981da177e4SLinus Torvalds 23991da177e4SLinus Torvalds struct hci_acl_hdr { 24001ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 24011ebb9252SMarcel Holtmann __le16 dlen; 240266c853ccSGustavo F. Padovan } __packed; 24031da177e4SLinus Torvalds 24041da177e4SLinus Torvalds struct hci_sco_hdr { 24051ebb9252SMarcel Holtmann __le16 handle; 24061da177e4SLinus Torvalds __u8 dlen; 240766c853ccSGustavo F. Padovan } __packed; 24081da177e4SLinus Torvalds 2409*4de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr { 2410*4de0fc59SLuiz Augusto von Dentz __le16 handle; 2411*4de0fc59SLuiz Augusto von Dentz __le16 dlen; 2412*4de0fc59SLuiz Augusto von Dentz __u8 data[0]; 2413*4de0fc59SLuiz Augusto von Dentz } __packed; 2414*4de0fc59SLuiz Augusto von Dentz 2415*4de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */ 2416*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00 2417*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01 2418*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02 2419*4de0fc59SLuiz Augusto von Dentz 2420*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4 2421*4de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr { 2422*4de0fc59SLuiz Augusto von Dentz __le16 sn; 2423*4de0fc59SLuiz Augusto von Dentz __le16 slen; 2424*4de0fc59SLuiz Augusto von Dentz }; 2425*4de0fc59SLuiz Augusto von Dentz 2426*4de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8 2427*4de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr { 2428*4de0fc59SLuiz Augusto von Dentz __le32 ts; 2429*4de0fc59SLuiz Augusto von Dentz __le16 sn; 2430*4de0fc59SLuiz Augusto von Dentz __le16 slen; 2431*4de0fc59SLuiz Augusto von Dentz }; 2432*4de0fc59SLuiz Augusto von Dentz 24332a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 24342a123b86SArnaldo Carvalho de Melo { 24352a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 24362a123b86SArnaldo Carvalho de Melo } 24372a123b86SArnaldo Carvalho de Melo 24382a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 24392a123b86SArnaldo Carvalho de Melo { 24402a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 24412a123b86SArnaldo Carvalho de Melo } 24422a123b86SArnaldo Carvalho de Melo 24432a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 24442a123b86SArnaldo Carvalho de Melo { 24452a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 24462a123b86SArnaldo Carvalho de Melo } 24472a123b86SArnaldo Carvalho de Melo 24481da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2449c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 24501da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 24511da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 24521da177e4SLinus Torvalds 24531da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2454c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 24551da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 24561da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 24571da177e4SLinus Torvalds 2458*4de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */ 2459*4de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003) 2460*4de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) 2461*4de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) 2462*4de0fc59SLuiz Augusto von Dentz 2463*4de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */ 2464*4de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) 2465*4de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff) 2466*4de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14) 2467*4de0fc59SLuiz Augusto von Dentz 24681da177e4SLinus Torvalds #endif /* __HCI_H */ 2469