11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux 31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 81da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 91da177e4SLinus Torvalds published by the Free Software Foundation; 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 121da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 131da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 141da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 151da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 161da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 171da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 181da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 191da177e4SLinus Torvalds 201da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 211da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 221da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #ifndef __HCI_H 261da177e4SLinus Torvalds #define __HCI_H 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024 291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255 301da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260 311da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 321da177e4SLinus Torvalds 339b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16 34523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 359b3b4460SAndrei Emeltchenko 36903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE 672 37903e4541SAndrei Emeltchenko 387d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE 252 397d1dab49SDoHyun Pyun 401da177e4SLinus Torvalds /* HCI dev events */ 411da177e4SLinus Torvalds #define HCI_DEV_REG 1 421da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 431da177e4SLinus Torvalds #define HCI_DEV_UP 3 441da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 451da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 461da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 474a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 484a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 49e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds /* HCI notify events */ 521da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 541da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 551da177e4SLinus Torvalds 56c13854ceSMarcel Holtmann /* HCI bus types */ 570ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 581da177e4SLinus Torvalds #define HCI_USB 1 591da177e4SLinus Torvalds #define HCI_PCCARD 2 601da177e4SLinus Torvalds #define HCI_UART 3 611da177e4SLinus Torvalds #define HCI_RS232 4 621da177e4SLinus Torvalds #define HCI_PCI 5 630ac53939SMarcel Holtmann #define HCI_SDIO 6 645c0e03cdSJohan Hedberg #define HCI_SPI 7 655c0e03cdSJohan Hedberg #define HCI_I2C 8 6665010e68SBjorn Andersson #define HCI_SMD 9 671da177e4SLinus Torvalds 68943da25dSMarcel Holtmann /* HCI controller types */ 69ca8bee5dSMarcel Holtmann #define HCI_PRIMARY 0x00 708f1e1742SDavid Vrabel #define HCI_AMP 0x01 71943da25dSMarcel Holtmann 728598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 736ed971caSMarcel Holtmann #define AMP_ID_BREDR 0x00 748598d064SAndrei Emeltchenko 757c13823dSMarcel Holtmann /* AMP controller types */ 767c13823dSMarcel Holtmann #define AMP_TYPE_BREDR 0x00 777c13823dSMarcel Holtmann #define AMP_TYPE_80211 0x01 787c13823dSMarcel Holtmann 79ab846ec4SAndrei Emeltchenko /* AMP controller status */ 80536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN 0x00 81536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY 0x01 82536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY 0x02 83536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY 0x03 84536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY 0x04 85536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY 0x05 86536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY 0x06 87ab846ec4SAndrei Emeltchenko 881da177e4SLinus Torvalds /* HCI device quirks */ 891da177e4SLinus Torvalds enum { 90118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when 91118305b5SMarcel Holtmann * closing the transport instead of when opening it. 92118305b5SMarcel Holtmann * 93118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 94118305b5SMarcel Holtmann */ 95a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 96118305b5SMarcel Holtmann 97118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only 98118305b5SMarcel Holtmann * device and it will stay in unconfigured state. 99118305b5SMarcel Holtmann * 100118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 101118305b5SMarcel Holtmann */ 102da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 103118305b5SMarcel Holtmann 104118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by 105118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid. 106118305b5SMarcel Holtmann * 107118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 108118305b5SMarcel Holtmann */ 109f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE, 110118305b5SMarcel Holtmann 111043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not 112043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to 113043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had 114043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing 115043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the 116043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better 117043ec9bfSMarcel Holtmann * user expierence. 118043ec9bfSMarcel Holtmann * 119043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called. 120043ec9bfSMarcel Holtmann */ 121043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE, 122043ec9bfSMarcel Holtmann 123711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported 124711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2 125711ffa78SMarcel Holtmann * and later controllers should support this command. However 126711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do 127711ffa78SMarcel Holtmann * not support this command. 128711ffa78SMarcel Holtmann * 129711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 130711ffa78SMarcel Holtmann */ 131711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS, 132711ffa78SMarcel Holtmann 133118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling 134118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the 135118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but 136118305b5SMarcel Holtmann * not supported. 137118305b5SMarcel Holtmann * 138118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 139118305b5SMarcel Holtmann */ 140f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY, 14189bc22d2SMarcel Holtmann 142eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step 143eb1904f4SMarcel Holtmann * is required and will be indicated with the controller 144eb1904f4SMarcel Holtmann * configuation. 145eb1904f4SMarcel Holtmann * 146eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 147eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback. 148eb1904f4SMarcel Holtmann */ 149eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG, 150eb1904f4SMarcel Holtmann 15189bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address 15289bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command 15389bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is 15489bc22d2SMarcel Holtmann * required before this device can be used. 15589bc22d2SMarcel Holtmann * 15689bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 15789bc22d2SMarcel Holtmann * during the hdev->setup vendor callback. 15889bc22d2SMarcel Holtmann */ 15989bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR, 16043d6bc46SMarcel Holtmann 1617a0e5b15SMatthias Kaehlcke /* When this quirk is set, the public Bluetooth address 1627a0e5b15SMatthias Kaehlcke * initially reported by HCI Read BD Address command 1637a0e5b15SMatthias Kaehlcke * is considered invalid. The public BD Address can be 1647a0e5b15SMatthias Kaehlcke * specified in the fwnode property 'local-bd-address'. 1657a0e5b15SMatthias Kaehlcke * If this property does not exist or is invalid controller 1667a0e5b15SMatthias Kaehlcke * configuration is required before this device can be used. 1677a0e5b15SMatthias Kaehlcke * 1687a0e5b15SMatthias Kaehlcke * This quirk can be set before hci_register_dev is called or 1697a0e5b15SMatthias Kaehlcke * during the hdev->setup vendor callback. 1707a0e5b15SMatthias Kaehlcke */ 1717a0e5b15SMatthias Kaehlcke HCI_QUIRK_USE_BDADDR_PROPERTY, 1727a0e5b15SMatthias Kaehlcke 17343d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 17443d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 17543d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 17643d6bc46SMarcel Holtmann * 17743d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 17843d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 17943d6bc46SMarcel Holtmann */ 18043d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 181695c4cb6SJakub Pawlowski 182695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 183695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 184695c4cb6SJakub Pawlowski * 185695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 186695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 187695c4cb6SJakub Pawlowski */ 188695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1897e995b9eSMarcel Holtmann 1907e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1917e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1927e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1937e995b9eSMarcel Holtmann * 1947e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 1957e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 1967e995b9eSMarcel Holtmann */ 1977e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 198740011cfSSean Wang 199740011cfSSean Wang /* When this quirk is set, setup() would be run after every 200740011cfSSean Wang * open() and not just after the first open(). 201740011cfSSean Wang * 202740011cfSSean Wang * This quirk can be set before hci_register_dev is called or 203740011cfSSean Wang * during the hdev->setup vendor callback. 204740011cfSSean Wang * 205740011cfSSean Wang */ 206740011cfSSean Wang HCI_QUIRK_NON_PERSISTENT_SETUP, 2071da177e4SLinus Torvalds }; 2081da177e4SLinus Torvalds 2091da177e4SLinus Torvalds /* HCI device flags */ 2101da177e4SLinus Torvalds enum { 2111da177e4SLinus Torvalds HCI_UP, 2121da177e4SLinus Torvalds HCI_INIT, 2131da177e4SLinus Torvalds HCI_RUNNING, 2141da177e4SLinus Torvalds 2151da177e4SLinus Torvalds HCI_PSCAN, 2161da177e4SLinus Torvalds HCI_ISCAN, 2171da177e4SLinus Torvalds HCI_AUTH, 2181da177e4SLinus Torvalds HCI_ENCRYPT, 2191da177e4SLinus Torvalds HCI_INQUIRY, 2201da177e4SLinus Torvalds 2211da177e4SLinus Torvalds HCI_RAW, 222ab81cbf9SJohan Hedberg 22310572132SGustavo F. Padovan HCI_RESET, 2241da177e4SLinus Torvalds }; 2251da177e4SLinus Torvalds 226f9207338SMarcel Holtmann /* HCI socket flags */ 227f9207338SMarcel Holtmann enum { 22850ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 229f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 230f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 231ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 232321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2335504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2345504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2355504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2365504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 23772000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 238f9207338SMarcel Holtmann }; 239f9207338SMarcel Holtmann 240d23264a8SAndre Guedes /* 241d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 242d23264a8SAndre Guedes * states from the controller. 243d23264a8SAndre Guedes */ 244d23264a8SAndre Guedes enum { 245a8b2d5c2SJohan Hedberg HCI_SETUP, 246d603b76bSMarcel Holtmann HCI_CONFIG, 247a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2485e130367SJohan Hedberg HCI_RFKILLED, 249a8b2d5c2SJohan Hedberg HCI_MGMT, 250b6ae8457SJohan Hedberg HCI_BONDABLE, 251a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2520663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2533769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 25494324962SJohan Hovold HCI_UNREGISTER, 2554a964404SMarcel Holtmann HCI_UNCONFIGURED, 2560736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 257dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 25866c417c1SJohan Hedberg HCI_LE_ADV, 259d23264a8SAndre Guedes HCI_LE_SCAN, 26084bde9d6SJohan Hedberg HCI_SSP_ENABLED, 261e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 262134c2a89SMarcel Holtmann HCI_SC_ONLY, 263863efaf2SJohan Hedberg HCI_PRIVACY, 26482a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 265d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 26641edf160SJohan Hedberg HCI_RPA_RESOLVING, 2676d80dfd0SJohan Hedberg HCI_HS_ENABLED, 26806199cf8SJohan Hedberg HCI_LE_ENABLED, 269f3d3444aSJohan Hedberg HCI_ADVERTISING, 270cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 2715e5282bbSJohan Hedberg HCI_CONNECTABLE, 2725e5282bbSJohan Hedberg HCI_DISCOVERABLE, 2736acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 27447990ea0SJohan Hedberg HCI_LINK_SECURITY, 27521693c15SAndre Guedes HCI_PERIODIC_INQ, 2761a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 27756f87901SJohan Hedberg HCI_BREDR_ENABLED, 27881ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 279b7cb93e5SMarcel Holtmann 280b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 2814b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 282b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 283b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 284aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 285f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 286b7cb93e5SMarcel Holtmann 287eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 288d23264a8SAndre Guedes }; 289d23264a8SAndre Guedes 2901da177e4SLinus Torvalds /* HCI timeouts */ 2915f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2925f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 2935f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 294d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2955f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 2969345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 297a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 2989489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 2991f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3001da177e4SLinus Torvalds 3015b7f9909SMarcel Holtmann /* HCI data types */ 3021da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3031da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3041da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3051da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 306e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3071da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3081da177e4SLinus Torvalds 3095b7f9909SMarcel Holtmann /* HCI packet types */ 3101da177e4SLinus Torvalds #define HCI_DM1 0x0008 3111da177e4SLinus Torvalds #define HCI_DM3 0x0400 3121da177e4SLinus Torvalds #define HCI_DM5 0x4000 3131da177e4SLinus Torvalds #define HCI_DH1 0x0010 3141da177e4SLinus Torvalds #define HCI_DH3 0x0800 3151da177e4SLinus Torvalds #define HCI_DH5 0x8000 3161da177e4SLinus Torvalds 3175075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3185075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3195075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3205075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3215075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3225075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3235075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3245075b972SJaganath Kanakkassery 3251da177e4SLinus Torvalds #define HCI_HV1 0x0020 3261da177e4SLinus Torvalds #define HCI_HV2 0x0040 3271da177e4SLinus Torvalds #define HCI_HV3 0x0080 3281da177e4SLinus Torvalds 3291da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3301da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3311da177e4SLinus Torvalds 3325b7f9909SMarcel Holtmann /* eSCO packet types */ 3335b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3345b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3355b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3365b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3375b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3385b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 339efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 340efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 341efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 342efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3435b7f9909SMarcel Holtmann 344a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 345efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 346a8746417SMarcel Holtmann 3471da177e4SLinus Torvalds /* ACL flags */ 348e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3491da177e4SLinus Torvalds #define ACL_CONT 0x01 3501da177e4SLinus Torvalds #define ACL_START 0x02 351d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 3521da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 3531da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 3541da177e4SLinus Torvalds 3551da177e4SLinus Torvalds /* Baseband links */ 3561da177e4SLinus Torvalds #define SCO_LINK 0x00 3571da177e4SLinus Torvalds #define ACL_LINK 0x01 3585b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 359fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 360fcd89c09SVille Tervo #define LE_LINK 0x80 3613161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 362845472e8SMarcel Holtmann #define INVALID_LINK 0xff 3631da177e4SLinus Torvalds 3641da177e4SLinus Torvalds /* LMP features */ 3651da177e4SLinus Torvalds #define LMP_3SLOT 0x01 3661da177e4SLinus Torvalds #define LMP_5SLOT 0x02 3671da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 3681da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 3691da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 3701da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 3711da177e4SLinus Torvalds #define LMP_HOLD 0x40 37204837f64SMarcel Holtmann #define LMP_SNIFF 0x80 3731da177e4SLinus Torvalds 3741da177e4SLinus Torvalds #define LMP_PARK 0x01 3751da177e4SLinus Torvalds #define LMP_RSSI 0x02 3761da177e4SLinus Torvalds #define LMP_QUALITY 0x04 3771da177e4SLinus Torvalds #define LMP_SCO 0x08 3781da177e4SLinus Torvalds #define LMP_HV2 0x10 3791da177e4SLinus Torvalds #define LMP_HV3 0x20 3801da177e4SLinus Torvalds #define LMP_ULAW 0x40 3811da177e4SLinus Torvalds #define LMP_ALAW 0x80 3821da177e4SLinus Torvalds 3831da177e4SLinus Torvalds #define LMP_CVSD 0x01 3841da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 3851da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 38607a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 3871da177e4SLinus Torvalds 3885075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 3895075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 390d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 3915b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 3925b7f9909SMarcel Holtmann 3935b7f9909SMarcel Holtmann #define LMP_EV4 0x01 3945b7f9909SMarcel Holtmann #define LMP_EV5 0x02 39569ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 396d5859e22SJohan Hedberg #define LMP_LE 0x40 3975075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 3985b7f9909SMarcel Holtmann 3995075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 40004837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 401d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 402efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 403efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 404efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 40504837f64SMarcel Holtmann 406d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 407e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 408769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 409e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 410769be974SMarcel Holtmann 411d5859e22SJohan Hedberg #define LMP_LSTO 0x01 412d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 413971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 414d5859e22SJohan Hedberg 415eead27daSAndre Guedes /* Extended LMP features */ 41653b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 41753b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 41853b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 41953b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 42053b834d2SMarcel Holtmann 421d5991585SMarcel Holtmann #define LMP_SC 0x01 422d5991585SMarcel Holtmann #define LMP_PING 0x02 423d5991585SMarcel Holtmann 42453b834d2SMarcel Holtmann /* Host features */ 425cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 426eead27daSAndre Guedes #define LMP_HOST_LE 0x02 427cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 428d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 429eead27daSAndre Guedes 430662bc2e6SAndre Guedes /* LE features */ 4310da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 432662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 4330fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 434cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 43594a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 43685a721a8SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 43785a721a8SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4386b49bcb4SJaganath Kanakkassery #define HCI_LE_EXT_ADV 0x10 4394b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4405075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 4415075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4429756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 443662bc2e6SAndre Guedes 44404837f64SMarcel Holtmann /* Connection modes */ 44504837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 44604837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 44704837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 44804837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 44904837f64SMarcel Holtmann 4501da177e4SLinus Torvalds /* Link policies */ 4511da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 4521da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 4531da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 4541da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 4551da177e4SLinus Torvalds 45604837f64SMarcel Holtmann /* Link modes */ 4571da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 4581da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 4591da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 4601da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 4611da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 4621da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 4631da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 4647b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 4651da177e4SLinus Torvalds 46640be492fSMarcel Holtmann /* Authentication types */ 46740be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 46840be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 46940be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 47040be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 47140be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 47240be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 47340be492fSMarcel Holtmann 474a77b15a6SMikel Astiz /* I/O capabilities */ 475a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 476a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 477a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 478a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 479a77b15a6SMikel Astiz 480b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 481b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 482b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 483b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 484b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 48511015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 48611015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 487b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 48811015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 48911015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 490b6020ba0SWaldemar Rymarkiewicz 4919f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 4928e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 4939f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 494160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 4952acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 496cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 497d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 4989f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 4999f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 500cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 501cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5029f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5039f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5044ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5054ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5063c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5079f5a0d7bSAndrei Emeltchenko 5082455a3eaSAndrei Emeltchenko /* Flow control modes */ 5092455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5102455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5112455a3eaSAndrei Emeltchenko 512bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 513bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 514a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 515bbaf444aSJohan Hedberg 516ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 517ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 518ba165a90SJohan Hedberg 51932748db0SJohan Hedberg /* Extended Inquiry Response field types */ 52032748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 52132748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 52232748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 52332748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 52432748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 52532748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 52632748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 52732748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 52832748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 52932748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5309ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 531d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 532d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 53332748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5344453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5351471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5361471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 537d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 538d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 539f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 540f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 54132748db0SJohan Hedberg 5423f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 5433f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 5443f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 5453f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 5463f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 5473f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 5483f0f524bSJohan Hedberg 5491da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 5506bd32326SVille Tervo #define HCI_OP_NOP 0x0000 5516bd32326SVille Tervo 552a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 553a9de9248SMarcel Holtmann struct hci_cp_inquiry { 554a9de9248SMarcel Holtmann __u8 lap[3]; 555a9de9248SMarcel Holtmann __u8 length; 556a9de9248SMarcel Holtmann __u8 num_rsp; 55766c853ccSGustavo F. Padovan } __packed; 5581da177e4SLinus Torvalds 559a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 560a9de9248SMarcel Holtmann 56179d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 56279d6e068SAndre Guedes 563a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 564a9de9248SMarcel Holtmann 565a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 566a9de9248SMarcel Holtmann struct hci_cp_create_conn { 567a9de9248SMarcel Holtmann bdaddr_t bdaddr; 568a9de9248SMarcel Holtmann __le16 pkt_type; 569a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 570a9de9248SMarcel Holtmann __u8 pscan_mode; 571a9de9248SMarcel Holtmann __le16 clock_offset; 572a9de9248SMarcel Holtmann __u8 role_switch; 57366c853ccSGustavo F. Padovan } __packed; 5741da177e4SLinus Torvalds 575a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 576a9de9248SMarcel Holtmann struct hci_cp_disconnect { 577a9de9248SMarcel Holtmann __le16 handle; 578a9de9248SMarcel Holtmann __u8 reason; 57966c853ccSGustavo F. Padovan } __packed; 5801da177e4SLinus Torvalds 581a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 582a9de9248SMarcel Holtmann struct hci_cp_add_sco { 583a9de9248SMarcel Holtmann __le16 handle; 584a9de9248SMarcel Holtmann __le16 pkt_type; 58566c853ccSGustavo F. Padovan } __packed; 586a9de9248SMarcel Holtmann 587a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 588a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 5891da177e4SLinus Torvalds bdaddr_t bdaddr; 59066c853ccSGustavo F. Padovan } __packed; 5911da177e4SLinus Torvalds 592a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 593a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 594a9de9248SMarcel Holtmann bdaddr_t bdaddr; 595a9de9248SMarcel Holtmann __u8 role; 59666c853ccSGustavo F. Padovan } __packed; 5971da177e4SLinus Torvalds 598a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 599a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 600a9de9248SMarcel Holtmann bdaddr_t bdaddr; 601a9de9248SMarcel Holtmann __u8 reason; 60266c853ccSGustavo F. Padovan } __packed; 6031da177e4SLinus Torvalds 604a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 605a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 606a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6079b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 60866c853ccSGustavo F. Padovan } __packed; 6091da177e4SLinus Torvalds 610a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 611a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 612a9de9248SMarcel Holtmann bdaddr_t bdaddr; 61366c853ccSGustavo F. Padovan } __packed; 6141da177e4SLinus Torvalds 615a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 616a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 617a9de9248SMarcel Holtmann bdaddr_t bdaddr; 618a9de9248SMarcel Holtmann __u8 pin_len; 619a9de9248SMarcel Holtmann __u8 pin_code[16]; 62066c853ccSGustavo F. Padovan } __packed; 621980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 622980e1a53SJohan Hedberg __u8 status; 623980e1a53SJohan Hedberg bdaddr_t bdaddr; 624980e1a53SJohan Hedberg } __packed; 625a9de9248SMarcel Holtmann 626a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 627a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 628a9de9248SMarcel Holtmann bdaddr_t bdaddr; 62966c853ccSGustavo F. Padovan } __packed; 630980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 631980e1a53SJohan Hedberg __u8 status; 632980e1a53SJohan Hedberg bdaddr_t bdaddr; 633980e1a53SJohan Hedberg } __packed; 634a9de9248SMarcel Holtmann 635a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 636a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 637a9de9248SMarcel Holtmann __le16 handle; 638a9de9248SMarcel Holtmann __le16 pkt_type; 63966c853ccSGustavo F. Padovan } __packed; 640a9de9248SMarcel Holtmann 641a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 642a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 643a9de9248SMarcel Holtmann __le16 handle; 64466c853ccSGustavo F. Padovan } __packed; 645a9de9248SMarcel Holtmann 646a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 647a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 648a9de9248SMarcel Holtmann __le16 handle; 649a9de9248SMarcel Holtmann __u8 encrypt; 65066c853ccSGustavo F. Padovan } __packed; 651a9de9248SMarcel Holtmann 652a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 653a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 654a9de9248SMarcel Holtmann __le16 handle; 65566c853ccSGustavo F. Padovan } __packed; 656a9de9248SMarcel Holtmann 657a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 658a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 659a9de9248SMarcel Holtmann bdaddr_t bdaddr; 660a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 661a9de9248SMarcel Holtmann __u8 pscan_mode; 662a9de9248SMarcel Holtmann __le16 clock_offset; 66366c853ccSGustavo F. Padovan } __packed; 664a9de9248SMarcel Holtmann 665a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 666a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 667a9de9248SMarcel Holtmann bdaddr_t bdaddr; 66866c853ccSGustavo F. Padovan } __packed; 669a9de9248SMarcel Holtmann 670a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 671a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 672a9de9248SMarcel Holtmann __le16 handle; 67366c853ccSGustavo F. Padovan } __packed; 674a9de9248SMarcel Holtmann 675a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 676a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 677a9de9248SMarcel Holtmann __le16 handle; 678a9de9248SMarcel Holtmann __u8 page; 67966c853ccSGustavo F. Padovan } __packed; 680a9de9248SMarcel Holtmann 681a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 682a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 683a9de9248SMarcel Holtmann __le16 handle; 68466c853ccSGustavo F. Padovan } __packed; 685a9de9248SMarcel Holtmann 686df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 687df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 688df935429SMarcel Holtmann __le16 handle; 689df935429SMarcel Holtmann } __packed; 690df935429SMarcel Holtmann 691a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 692a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 693a9de9248SMarcel Holtmann __le16 handle; 694a9de9248SMarcel Holtmann __le32 tx_bandwidth; 695a9de9248SMarcel Holtmann __le32 rx_bandwidth; 696a9de9248SMarcel Holtmann __le16 max_latency; 697a9de9248SMarcel Holtmann __le16 voice_setting; 698a9de9248SMarcel Holtmann __u8 retrans_effort; 699a9de9248SMarcel Holtmann __le16 pkt_type; 70066c853ccSGustavo F. Padovan } __packed; 701a9de9248SMarcel Holtmann 702a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 703a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 704a9de9248SMarcel Holtmann bdaddr_t bdaddr; 705a9de9248SMarcel Holtmann __le32 tx_bandwidth; 706a9de9248SMarcel Holtmann __le32 rx_bandwidth; 707a9de9248SMarcel Holtmann __le16 max_latency; 708a9de9248SMarcel Holtmann __le16 content_format; 709a9de9248SMarcel Holtmann __u8 retrans_effort; 710a9de9248SMarcel Holtmann __le16 pkt_type; 71166c853ccSGustavo F. Padovan } __packed; 712a9de9248SMarcel Holtmann 713a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 714a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 715a9de9248SMarcel Holtmann bdaddr_t bdaddr; 716a9de9248SMarcel Holtmann __u8 reason; 71766c853ccSGustavo F. Padovan } __packed; 718a9de9248SMarcel Holtmann 71917fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 72017fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 72117fa4b9dSJohan Hedberg bdaddr_t bdaddr; 72217fa4b9dSJohan Hedberg __u8 capability; 72317fa4b9dSJohan Hedberg __u8 oob_data; 72417fa4b9dSJohan Hedberg __u8 authentication; 72517fa4b9dSJohan Hedberg } __packed; 72617fa4b9dSJohan Hedberg 727a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 728a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 729a5c29683SJohan Hedberg bdaddr_t bdaddr; 730a5c29683SJohan Hedberg } __packed; 731a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 732a5c29683SJohan Hedberg __u8 status; 733a5c29683SJohan Hedberg bdaddr_t bdaddr; 734a5c29683SJohan Hedberg } __packed; 735a5c29683SJohan Hedberg 736a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 737a5c29683SJohan Hedberg 7389ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 7399ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 7409ad4019aSBrian Gix bdaddr_t bdaddr; 7419ad4019aSBrian Gix __le32 passkey; 7429ad4019aSBrian Gix } __packed; 7439ad4019aSBrian Gix 7449ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 7459ad4019aSBrian Gix 7462763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 7472763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 7482763eda6SSzymon Janc bdaddr_t bdaddr; 7492763eda6SSzymon Janc __u8 hash[16]; 75038da1703SJohan Hedberg __u8 rand[16]; 7512763eda6SSzymon Janc } __packed; 7522763eda6SSzymon Janc 7532763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 7542763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 7552763eda6SSzymon Janc bdaddr_t bdaddr; 7562763eda6SSzymon Janc } __packed; 7572763eda6SSzymon Janc 75803b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 75903b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 76003b555e1SJohan Hedberg bdaddr_t bdaddr; 76103b555e1SJohan Hedberg __u8 reason; 76203b555e1SJohan Hedberg } __packed; 76303b555e1SJohan Hedberg 764523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 765523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 766523e93cdSAndrei Emeltchenko __u8 phy_handle; 767523e93cdSAndrei Emeltchenko __u8 key_len; 768523e93cdSAndrei Emeltchenko __u8 key_type; 769523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 770523e93cdSAndrei Emeltchenko } __packed; 771523e93cdSAndrei Emeltchenko 772523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 773523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 774523e93cdSAndrei Emeltchenko __u8 phy_handle; 775523e93cdSAndrei Emeltchenko __u8 key_len; 776523e93cdSAndrei Emeltchenko __u8 key_type; 777523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 778523e93cdSAndrei Emeltchenko } __packed; 779523e93cdSAndrei Emeltchenko 780523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 781523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 782523e93cdSAndrei Emeltchenko __u8 phy_handle; 783523e93cdSAndrei Emeltchenko __u8 reason; 784b078b564SAndrei Emeltchenko } __packed; 785b078b564SAndrei Emeltchenko 786b078b564SAndrei Emeltchenko struct ext_flow_spec { 787b078b564SAndrei Emeltchenko __u8 id; 788b078b564SAndrei Emeltchenko __u8 stype; 789b078b564SAndrei Emeltchenko __le16 msdu; 790b078b564SAndrei Emeltchenko __le32 sdu_itime; 791b078b564SAndrei Emeltchenko __le32 acc_lat; 792b078b564SAndrei Emeltchenko __le32 flush_to; 793b078b564SAndrei Emeltchenko } __packed; 794b078b564SAndrei Emeltchenko 795b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 796b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 797b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 798b078b564SAndrei Emeltchenko __u8 phy_handle; 799b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 800b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 801b078b564SAndrei Emeltchenko } __packed; 802b078b564SAndrei Emeltchenko 803b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 804b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 805b078b564SAndrei Emeltchenko __le16 log_handle; 806b078b564SAndrei Emeltchenko } __packed; 807b078b564SAndrei Emeltchenko 808b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 809b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 810b078b564SAndrei Emeltchenko __u8 phy_handle; 811b078b564SAndrei Emeltchenko __u8 flow_spec_id; 812b078b564SAndrei Emeltchenko } __packed; 813b078b564SAndrei Emeltchenko 814b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 815b078b564SAndrei Emeltchenko __u8 status; 816b078b564SAndrei Emeltchenko __u8 phy_handle; 817b078b564SAndrei Emeltchenko __u8 flow_spec_id; 818523e93cdSAndrei Emeltchenko } __packed; 819523e93cdSAndrei Emeltchenko 8208c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 8218c9a041bSDoHyun Pyun struct hci_cp_set_csb { 8228c9a041bSDoHyun Pyun __u8 enable; 8238c9a041bSDoHyun Pyun __u8 lt_addr; 8248c9a041bSDoHyun Pyun __u8 lpo_allowed; 8258c9a041bSDoHyun Pyun __le16 packet_type; 8268c9a041bSDoHyun Pyun __le16 interval_min; 8278c9a041bSDoHyun Pyun __le16 interval_max; 8288c9a041bSDoHyun Pyun __le16 csb_sv_tout; 8298c9a041bSDoHyun Pyun } __packed; 8308c9a041bSDoHyun Pyun struct hci_rp_set_csb { 8318c9a041bSDoHyun Pyun __u8 status; 8328c9a041bSDoHyun Pyun __u8 lt_addr; 8338c9a041bSDoHyun Pyun __le16 interval; 8348c9a041bSDoHyun Pyun } __packed; 8358c9a041bSDoHyun Pyun 836cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 837cefded98SDoHyun Pyun 838e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 839e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 840e2f99131SMarcel Holtmann bdaddr_t bdaddr; 841e2f99131SMarcel Holtmann __u8 hash192[16]; 84238da1703SJohan Hedberg __u8 rand192[16]; 843e2f99131SMarcel Holtmann __u8 hash256[16]; 84438da1703SJohan Hedberg __u8 rand256[16]; 845e2f99131SMarcel Holtmann } __packed; 846e2f99131SMarcel Holtmann 847a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 848a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 849a9de9248SMarcel Holtmann __le16 handle; 850a9de9248SMarcel Holtmann __le16 max_interval; 851a9de9248SMarcel Holtmann __le16 min_interval; 852a9de9248SMarcel Holtmann __le16 attempt; 853a9de9248SMarcel Holtmann __le16 timeout; 85466c853ccSGustavo F. Padovan } __packed; 855a9de9248SMarcel Holtmann 856a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 857a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 858a9de9248SMarcel Holtmann __le16 handle; 85966c853ccSGustavo F. Padovan } __packed; 860a9de9248SMarcel Holtmann 861a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 862a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 863a9de9248SMarcel Holtmann __le16 handle; 86466c853ccSGustavo F. Padovan } __packed; 865a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 866a9de9248SMarcel Holtmann __u8 status; 867a9de9248SMarcel Holtmann __le16 handle; 868a9de9248SMarcel Holtmann __u8 role; 86966c853ccSGustavo F. Padovan } __packed; 870a9de9248SMarcel Holtmann 871a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 872a9de9248SMarcel Holtmann struct hci_cp_switch_role { 873a9de9248SMarcel Holtmann bdaddr_t bdaddr; 874a9de9248SMarcel Holtmann __u8 role; 87566c853ccSGustavo F. Padovan } __packed; 876a9de9248SMarcel Holtmann 877a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 878a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 879a9de9248SMarcel Holtmann __le16 handle; 88066c853ccSGustavo F. Padovan } __packed; 881a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 882a9de9248SMarcel Holtmann __u8 status; 883a9de9248SMarcel Holtmann __le16 handle; 884a9de9248SMarcel Holtmann __le16 policy; 88566c853ccSGustavo F. Padovan } __packed; 886a9de9248SMarcel Holtmann 887a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 888a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 889a9de9248SMarcel Holtmann __le16 handle; 890a9de9248SMarcel Holtmann __le16 policy; 89166c853ccSGustavo F. Padovan } __packed; 892a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 893a9de9248SMarcel Holtmann __u8 status; 894a9de9248SMarcel Holtmann __le16 handle; 89566c853ccSGustavo F. Padovan } __packed; 896a9de9248SMarcel Holtmann 897e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 898e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 899e4e8e37cSMarcel Holtmann __u8 status; 900e4e8e37cSMarcel Holtmann __le16 policy; 90166c853ccSGustavo F. Padovan } __packed; 902e4e8e37cSMarcel Holtmann 903e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 904e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 905e4e8e37cSMarcel Holtmann __le16 policy; 90666c853ccSGustavo F. Padovan } __packed; 907e4e8e37cSMarcel Holtmann 908a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 909a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 910a9de9248SMarcel Holtmann __le16 handle; 911a9de9248SMarcel Holtmann __le16 max_latency; 912a9de9248SMarcel Holtmann __le16 min_remote_timeout; 913a9de9248SMarcel Holtmann __le16 min_local_timeout; 91466c853ccSGustavo F. Padovan } __packed; 915a9de9248SMarcel Holtmann 916a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 917a9de9248SMarcel Holtmann 918a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 919a9de9248SMarcel Holtmann 920a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 9211da177e4SLinus Torvalds struct hci_cp_set_event_flt { 9221da177e4SLinus Torvalds __u8 flt_type; 9231da177e4SLinus Torvalds __u8 cond_type; 9241da177e4SLinus Torvalds __u8 condition[0]; 92566c853ccSGustavo F. Padovan } __packed; 9261da177e4SLinus Torvalds 9271da177e4SLinus Torvalds /* Filter types */ 9281da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 9291da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 9301da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 9311da177e4SLinus Torvalds 9321da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 9331da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 9341da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 9351da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 9361da177e4SLinus Torvalds 9371da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 9381da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 9391da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 9401da177e4SLinus Torvalds 941cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 942cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 943cb962780SMarcel Holtmann bdaddr_t bdaddr; 944cb962780SMarcel Holtmann __u8 read_all; 945cb962780SMarcel Holtmann } __packed; 946cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 947cb962780SMarcel Holtmann __u8 status; 948cb962780SMarcel Holtmann __u8 max_keys; 949cb962780SMarcel Holtmann __u8 num_keys; 950cb962780SMarcel Holtmann } __packed; 951cb962780SMarcel Holtmann 952b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 953b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 954b0916ea0SJohan Hedberg bdaddr_t bdaddr; 955b0916ea0SJohan Hedberg __u8 delete_all; 956b0916ea0SJohan Hedberg } __packed; 957039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 958039d4e41SMarcel Holtmann __u8 status; 959039d4e41SMarcel Holtmann __u8 num_keys; 960039d4e41SMarcel Holtmann } __packed; 961b0916ea0SJohan Hedberg 9621f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 9631f6c6378SJohan Hedberg 964a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 965a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 9661f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 96766c853ccSGustavo F. Padovan } __packed; 968a9de9248SMarcel Holtmann 969a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 970a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 971a9de9248SMarcel Holtmann __u8 status; 9721f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 97366c853ccSGustavo F. Padovan } __packed; 974a9de9248SMarcel Holtmann 975a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 976a9de9248SMarcel Holtmann 977a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 978a9de9248SMarcel Holtmann 979a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 980a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 981a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 982a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 983a9de9248SMarcel Holtmann 984a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 985a9de9248SMarcel Holtmann 986a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 987a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 988a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 989a9de9248SMarcel Holtmann 990a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 991a9de9248SMarcel Holtmann 992a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 993a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 994a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 995a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 996a9de9248SMarcel Holtmann 997a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 998a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 9991da177e4SLinus Torvalds __u8 status; 10001da177e4SLinus Torvalds __u8 dev_class[3]; 100166c853ccSGustavo F. Padovan } __packed; 10021da177e4SLinus Torvalds 1003a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1004a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 10051da177e4SLinus Torvalds __u8 dev_class[3]; 100666c853ccSGustavo F. Padovan } __packed; 10071da177e4SLinus Torvalds 1008a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 10091da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 10101da177e4SLinus Torvalds __u8 status; 10111ebb9252SMarcel Holtmann __le16 voice_setting; 101266c853ccSGustavo F. Padovan } __packed; 10131da177e4SLinus Torvalds 1014a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 10151da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 10161ebb9252SMarcel Holtmann __le16 voice_setting; 101766c853ccSGustavo F. Padovan } __packed; 10181da177e4SLinus Torvalds 1019a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 10201da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 10211ebb9252SMarcel Holtmann __le16 acl_mtu; 10221da177e4SLinus Torvalds __u8 sco_mtu; 10231ebb9252SMarcel Holtmann __le16 acl_max_pkt; 10241ebb9252SMarcel Holtmann __le16 sco_max_pkt; 102566c853ccSGustavo F. Padovan } __packed; 10261da177e4SLinus Torvalds 1027b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1028b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1029b4cb9fb2SMarcel Holtmann __u8 status; 1030b4cb9fb2SMarcel Holtmann __u8 num_iac; 1031b4cb9fb2SMarcel Holtmann } __packed; 1032b4cb9fb2SMarcel Holtmann 10334b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 10344b836f39SMarcel Holtmann 10353d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 10363d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 10373d505312SMarcel Holtmann __u8 num_iac; 10383d505312SMarcel Holtmann __u8 iac_lap[6]; 10393d505312SMarcel Holtmann } __packed; 10403d505312SMarcel Holtmann 1041d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1042d5859e22SJohan Hedberg 104380a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 104480a1e1dbSJohan Hedberg 104580a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 104680a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1047816a11d5SJohan Hedberg __u8 fec; 1048816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 104980a1e1dbSJohan Hedberg } __packed; 105080a1e1dbSJohan Hedberg 1051333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1052333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1053333140b5SMarcel Holtmann __u8 status; 1054333140b5SMarcel Holtmann __u8 mode; 105566c853ccSGustavo F. Padovan } __packed; 1056333140b5SMarcel Holtmann 1057333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1058333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1059333140b5SMarcel Holtmann __u8 mode; 106066c853ccSGustavo F. Padovan } __packed; 1061333140b5SMarcel Holtmann 1062c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1063c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1064c35938b2SSzymon Janc __u8 status; 1065c35938b2SSzymon Janc __u8 hash[16]; 106638da1703SJohan Hedberg __u8 rand[16]; 1067c35938b2SSzymon Janc } __packed; 1068c35938b2SSzymon Janc 1069d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 107091c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 107191c4e9b1SMarcel Holtmann __u8 status; 107291c4e9b1SMarcel Holtmann __s8 tx_power; 107391c4e9b1SMarcel Holtmann } __packed; 1074d5859e22SJohan Hedberg 1075d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1076d62e6d67SJohan Hedberg 10777528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 10787528ca1cSMarcel Holtmann 10791e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 10801e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 10811e89cffbSAndrei Emeltchenko __u8 status; 10821e89cffbSAndrei Emeltchenko __u8 mode; 10831e89cffbSAndrei Emeltchenko } __packed; 10841e89cffbSAndrei Emeltchenko 1085f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1086f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1087f9b49306SAndre Guedes __u8 le; 1088f9b49306SAndre Guedes __u8 simul; 1089f9b49306SAndre Guedes } __packed; 1090f9b49306SAndre Guedes 1091d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1092d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1093d0bf75a5SDoHyun Pyun __u8 lt_addr; 1094d0bf75a5SDoHyun Pyun } __packed; 1095d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1096d0bf75a5SDoHyun Pyun __u8 status; 1097d0bf75a5SDoHyun Pyun __u8 lt_addr; 1098d0bf75a5SDoHyun Pyun } __packed; 1099d0bf75a5SDoHyun Pyun 11006a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 11016a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 11026a20eaf4SDoHyun Pyun __u8 lt_addr; 11036a20eaf4SDoHyun Pyun } __packed; 11046a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 11056a20eaf4SDoHyun Pyun __u8 status; 11066a20eaf4SDoHyun Pyun __u8 lt_addr; 11076a20eaf4SDoHyun Pyun } __packed; 11086a20eaf4SDoHyun Pyun 11097d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 11107d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 11117d1dab49SDoHyun Pyun __u8 lt_addr; 11127d1dab49SDoHyun Pyun __u8 fragment; 11137d1dab49SDoHyun Pyun __u8 data_length; 11147d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 11157d1dab49SDoHyun Pyun } __packed; 11167d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 11177d1dab49SDoHyun Pyun __u8 status; 11187d1dab49SDoHyun Pyun __u8 lt_addr; 11197d1dab49SDoHyun Pyun } __packed; 11207d1dab49SDoHyun Pyun 11215d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 11225d4e7e8dSJohan Hedberg 1123a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1124a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1125a9b07a64SDoHyun Pyun __le16 interval_min; 1126a9b07a64SDoHyun Pyun __le16 interval_max; 1127a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1128a9b07a64SDoHyun Pyun __u8 service_data; 1129a9b07a64SDoHyun Pyun } __packed; 1130a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1131a9b07a64SDoHyun Pyun __u8 status; 1132a9b07a64SDoHyun Pyun __le16 sync_train_int; 1133a9b07a64SDoHyun Pyun } __packed; 1134a9b07a64SDoHyun Pyun 1135eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1136eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1137eb4b95c6SMarcel Holtmann __u8 status; 1138eb4b95c6SMarcel Holtmann __u8 support; 1139eb4b95c6SMarcel Holtmann } __packed; 1140eb4b95c6SMarcel Holtmann 1141eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1142eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1143eb4b95c6SMarcel Holtmann __u8 support; 1144eb4b95c6SMarcel Holtmann } __packed; 1145eb4b95c6SMarcel Holtmann 1146302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1147302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1148302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1149302975cbSSpoorthi Ravishankar Koppad } __packed; 1150302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1151302975cbSSpoorthi Ravishankar Koppad __u8 status; 1152302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1153302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1154302975cbSSpoorthi Ravishankar Koppad } __packed; 1155302975cbSSpoorthi Ravishankar Koppad 1156302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1157302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1158302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1159302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1160302975cbSSpoorthi Ravishankar Koppad } __packed; 1161302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1162302975cbSSpoorthi Ravishankar Koppad __u8 status; 1163302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1164302975cbSSpoorthi Ravishankar Koppad } __packed; 1165302975cbSSpoorthi Ravishankar Koppad 1166e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1167e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1168e2f99131SMarcel Holtmann __u8 status; 1169e2f99131SMarcel Holtmann __u8 hash192[16]; 117038da1703SJohan Hedberg __u8 rand192[16]; 1171e2f99131SMarcel Holtmann __u8 hash256[16]; 117238da1703SJohan Hedberg __u8 rand256[16]; 1173e2f99131SMarcel Holtmann } __packed; 1174e2f99131SMarcel Holtmann 1175a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1176a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 11771da177e4SLinus Torvalds __u8 status; 1178a9de9248SMarcel Holtmann __u8 hci_ver; 1179a9de9248SMarcel Holtmann __le16 hci_rev; 1180a9de9248SMarcel Holtmann __u8 lmp_ver; 1181a9de9248SMarcel Holtmann __le16 manufacturer; 1182a9de9248SMarcel Holtmann __le16 lmp_subver; 118366c853ccSGustavo F. Padovan } __packed; 11841da177e4SLinus Torvalds 1185a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1186a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 11871da177e4SLinus Torvalds __u8 status; 1188a9de9248SMarcel Holtmann __u8 commands[64]; 118966c853ccSGustavo F. Padovan } __packed; 11901da177e4SLinus Torvalds 1191a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1192a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1193a9de9248SMarcel Holtmann __u8 status; 1194a9de9248SMarcel Holtmann __u8 features[8]; 119566c853ccSGustavo F. Padovan } __packed; 1196a9de9248SMarcel Holtmann 1197a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1198971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1199971e3a4bSAndre Guedes __u8 page; 1200971e3a4bSAndre Guedes } __packed; 1201a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1202a9de9248SMarcel Holtmann __u8 status; 1203a9de9248SMarcel Holtmann __u8 page; 1204a9de9248SMarcel Holtmann __u8 max_page; 1205a9de9248SMarcel Holtmann __u8 features[8]; 120666c853ccSGustavo F. Padovan } __packed; 1207a9de9248SMarcel Holtmann 1208a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1209a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1210a9de9248SMarcel Holtmann __u8 status; 1211a9de9248SMarcel Holtmann __le16 acl_mtu; 1212a9de9248SMarcel Holtmann __u8 sco_mtu; 1213a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1214a9de9248SMarcel Holtmann __le16 sco_max_pkt; 121566c853ccSGustavo F. Padovan } __packed; 1216a9de9248SMarcel Holtmann 1217a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1218a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1219a9de9248SMarcel Holtmann __u8 status; 12201da177e4SLinus Torvalds bdaddr_t bdaddr; 122166c853ccSGustavo F. Padovan } __packed; 12221da177e4SLinus Torvalds 1223350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1224350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1225350ee4cfSAndrei Emeltchenko __u8 status; 1226350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1227350ee4cfSAndrei Emeltchenko __le16 block_len; 1228350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1229350ee4cfSAndrei Emeltchenko } __packed; 1230350ee4cfSAndrei Emeltchenko 1231109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1232109e3191SMarcel Holtmann 1233f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1234f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1235f332ec66SJohan Hedberg __u8 status; 1236f332ec66SJohan Hedberg __le16 interval; 1237f332ec66SJohan Hedberg __le16 window; 1238f332ec66SJohan Hedberg } __packed; 1239f332ec66SJohan Hedberg 1240f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1241f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1242f6422ec6SAntti Julku __le16 interval; 1243f6422ec6SAntti Julku __le16 window; 1244f6422ec6SAntti Julku } __packed; 1245f6422ec6SAntti Julku 12465a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 12475a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 12485a134faeSAndrzej Kaczmarek __le16 handle; 12495a134faeSAndrzej Kaczmarek __u8 type; 12505a134faeSAndrzej Kaczmarek } __packed; 12515a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 12525a134faeSAndrzej Kaczmarek __u8 status; 12535a134faeSAndrzej Kaczmarek __le16 handle; 12545a134faeSAndrzej Kaczmarek __s8 tx_power; 12555a134faeSAndrzej Kaczmarek } __packed; 12565a134faeSAndrzej Kaczmarek 1257f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1258f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1259f332ec66SJohan Hedberg __u8 status; 1260f332ec66SJohan Hedberg __u8 type; 1261f332ec66SJohan Hedberg } __packed; 1262f332ec66SJohan Hedberg 1263f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1264f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1265f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1266f6422ec6SAntti Julku 12675ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 12685ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 12695ae76a94SAndrzej Kaczmarek __le16 handle; 12705ae76a94SAndrzej Kaczmarek } __packed; 12715ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 12725ae76a94SAndrzej Kaczmarek __u8 status; 12735ae76a94SAndrzej Kaczmarek __le16 handle; 12745ae76a94SAndrzej Kaczmarek __s8 rssi; 12755ae76a94SAndrzej Kaczmarek } __packed; 12765ae76a94SAndrzej Kaczmarek 127733f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 127833f35721SJohan Hedberg struct hci_cp_read_clock { 127933f35721SJohan Hedberg __le16 handle; 128033f35721SJohan Hedberg __u8 which; 128133f35721SJohan Hedberg } __packed; 128233f35721SJohan Hedberg struct hci_rp_read_clock { 128333f35721SJohan Hedberg __u8 status; 128433f35721SJohan Hedberg __le16 handle; 128533f35721SJohan Hedberg __le32 clock; 128633f35721SJohan Hedberg __le16 accuracy; 128733f35721SJohan Hedberg } __packed; 128833f35721SJohan Hedberg 1289821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1290821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1291821f3766SJohan Hedberg __le16 handle; 1292821f3766SJohan Hedberg } __packed; 1293821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1294821f3766SJohan Hedberg __u8 status; 1295821f3766SJohan Hedberg __le16 handle; 1296821f3766SJohan Hedberg __u8 key_size; 1297821f3766SJohan Hedberg } __packed; 1298821f3766SJohan Hedberg 1299928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1300928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1301928abaa7SAndrei Emeltchenko __u8 status; 1302928abaa7SAndrei Emeltchenko __u8 amp_status; 1303928abaa7SAndrei Emeltchenko __le32 total_bw; 1304928abaa7SAndrei Emeltchenko __le32 max_bw; 1305928abaa7SAndrei Emeltchenko __le32 min_latency; 1306928abaa7SAndrei Emeltchenko __le32 max_pdu; 1307928abaa7SAndrei Emeltchenko __u8 amp_type; 1308928abaa7SAndrei Emeltchenko __le16 pal_cap; 1309928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1310928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1311928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1312928abaa7SAndrei Emeltchenko } __packed; 1313928abaa7SAndrei Emeltchenko 1314523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1315523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1316523e93cdSAndrei Emeltchenko __u8 phy_handle; 1317523e93cdSAndrei Emeltchenko __le16 len_so_far; 1318523e93cdSAndrei Emeltchenko __le16 max_len; 1319523e93cdSAndrei Emeltchenko } __packed; 1320523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1321523e93cdSAndrei Emeltchenko __u8 status; 1322523e93cdSAndrei Emeltchenko __u8 phy_handle; 1323523e93cdSAndrei Emeltchenko __le16 rem_len; 1324523e93cdSAndrei Emeltchenko __u8 frag[0]; 1325523e93cdSAndrei Emeltchenko } __packed; 1326523e93cdSAndrei Emeltchenko 1327523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1328523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1329523e93cdSAndrei Emeltchenko __u8 phy_handle; 1330523e93cdSAndrei Emeltchenko __le16 len_so_far; 1331523e93cdSAndrei Emeltchenko __le16 rem_len; 1332523e93cdSAndrei Emeltchenko __u8 frag[0]; 1333523e93cdSAndrei Emeltchenko } __packed; 1334523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1335523e93cdSAndrei Emeltchenko __u8 status; 1336523e93cdSAndrei Emeltchenko __u8 phy_handle; 1337523e93cdSAndrei Emeltchenko } __packed; 1338523e93cdSAndrei Emeltchenko 1339f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1340f4fe73edSMarcel Holtmann 13414b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 13424b4148e9SMarcel Holtmann 134306f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 134406f5b778SMarcel Holtmann 134563185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 134663185f64SVille Tervo struct hci_cp_le_set_event_mask { 134763185f64SVille Tervo __u8 mask[8]; 134863185f64SVille Tervo } __packed; 134963185f64SVille Tervo 135063185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 135163185f64SVille Tervo struct hci_rp_le_read_buffer_size { 135263185f64SVille Tervo __u8 status; 135363185f64SVille Tervo __le16 le_mtu; 135463185f64SVille Tervo __u8 le_max_pkt; 135563185f64SVille Tervo } __packed; 135663185f64SVille Tervo 135760e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 135860e77321SJohan Hedberg struct hci_rp_le_read_local_features { 135960e77321SJohan Hedberg __u8 status; 136060e77321SJohan Hedberg __u8 features[8]; 136160e77321SJohan Hedberg } __packed; 136260e77321SJohan Hedberg 1363d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1364d13eafceSMarcel Holtmann 13651e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 13661e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 13671e191893SMarcel Holtmann __le16 min_interval; 13681e191893SMarcel Holtmann __le16 max_interval; 13691e191893SMarcel Holtmann __u8 type; 13701e191893SMarcel Holtmann __u8 own_address_type; 13711e191893SMarcel Holtmann __u8 direct_addr_type; 13721e191893SMarcel Holtmann bdaddr_t direct_addr; 13731e191893SMarcel Holtmann __u8 channel_map; 13741e191893SMarcel Holtmann __u8 filter_policy; 13751e191893SMarcel Holtmann } __packed; 13761e191893SMarcel Holtmann 13778fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 13788fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 13798fa19098SJohan Hedberg __u8 status; 13808fa19098SJohan Hedberg __s8 tx_power; 13818fa19098SJohan Hedberg } __packed; 13828fa19098SJohan Hedberg 13833f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 13843f0f524bSJohan Hedberg 13853f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 13863f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 13873f0f524bSJohan Hedberg __u8 length; 13883f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 13893f0f524bSJohan Hedberg } __packed; 13903f0f524bSJohan Hedberg 1391f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1392f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1393f14d8f64SMarcel Holtmann __u8 length; 1394f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1395f14d8f64SMarcel Holtmann } __packed; 1396f14d8f64SMarcel Holtmann 1397c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1398c1d5dc4aSJohan Hedberg 13995df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 14005df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 14015df480b5SAndre Guedes 140207f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 140307f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 140407f7fa5dSAndre Guedes __u8 type; 140507f7fa5dSAndre Guedes __le16 interval; 140607f7fa5dSAndre Guedes __le16 window; 140707f7fa5dSAndre Guedes __u8 own_address_type; 140807f7fa5dSAndre Guedes __u8 filter_policy; 140907f7fa5dSAndre Guedes } __packed; 141007f7fa5dSAndre Guedes 141176a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 141276a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1413525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1414525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 141568a8aea4SAndrei Emeltchenko 1416eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1417eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1418eb9d91f5SAndre Guedes __u8 enable; 1419eb9d91f5SAndre Guedes __u8 filter_dup; 1420eb9d91f5SAndre Guedes } __packed; 1421eb9d91f5SAndre Guedes 1422a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1423a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1424a7139eddSJohan Hedberg 142563185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 142663185f64SVille Tervo struct hci_cp_le_create_conn { 142763185f64SVille Tervo __le16 scan_interval; 142863185f64SVille Tervo __le16 scan_window; 142963185f64SVille Tervo __u8 filter_policy; 143063185f64SVille Tervo __u8 peer_addr_type; 143163185f64SVille Tervo bdaddr_t peer_addr; 143263185f64SVille Tervo __u8 own_address_type; 143363185f64SVille Tervo __le16 conn_interval_min; 143463185f64SVille Tervo __le16 conn_interval_max; 143563185f64SVille Tervo __le16 conn_latency; 143663185f64SVille Tervo __le16 supervision_timeout; 143763185f64SVille Tervo __le16 min_ce_len; 143863185f64SVille Tervo __le16 max_ce_len; 143963185f64SVille Tervo } __packed; 144063185f64SVille Tervo 144163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 144263185f64SVille Tervo 1443cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1444cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1445cf1d081fSJohan Hedberg __u8 status; 1446cf1d081fSJohan Hedberg __u8 size; 1447cf1d081fSJohan Hedberg } __packed; 1448cf1d081fSJohan Hedberg 1449d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1450d9a7b0a5SMarcel Holtmann 1451d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1452d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1453d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1454d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1455d9a7b0a5SMarcel Holtmann } __packed; 1456d9a7b0a5SMarcel Holtmann 1457d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1458d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1459d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1460d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1461d9a7b0a5SMarcel Holtmann } __packed; 1462d9a7b0a5SMarcel Holtmann 14632ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 14642ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 14652ce603ebSClaudio Takahasi __le16 handle; 14662ce603ebSClaudio Takahasi __le16 conn_interval_min; 14672ce603ebSClaudio Takahasi __le16 conn_interval_max; 14682ce603ebSClaudio Takahasi __le16 conn_latency; 14692ce603ebSClaudio Takahasi __le16 supervision_timeout; 14702ce603ebSClaudio Takahasi __le16 min_ce_len; 14712ce603ebSClaudio Takahasi __le16 max_ce_len; 14722ce603ebSClaudio Takahasi } __packed; 14732ce603ebSClaudio Takahasi 14740fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 14750fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 14760fe29fd1SMarcel Holtmann __le16 handle; 14770fe29fd1SMarcel Holtmann } __packed; 14780fe29fd1SMarcel Holtmann 1479a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1480a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1481a7a595f6SVinicius Costa Gomes __le16 handle; 1482fe39c7b2SMarcel Holtmann __le64 rand; 1483a7a595f6SVinicius Costa Gomes __le16 ediv; 1484a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1485a7a595f6SVinicius Costa Gomes } __packed; 1486a7a595f6SVinicius Costa Gomes 1487a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1488a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1489a7a595f6SVinicius Costa Gomes __le16 handle; 1490a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1491a7a595f6SVinicius Costa Gomes } __packed; 1492a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1493a7a595f6SVinicius Costa Gomes __u8 status; 1494a7a595f6SVinicius Costa Gomes __le16 handle; 1495a7a595f6SVinicius Costa Gomes } __packed; 1496a7a595f6SVinicius Costa Gomes 1497a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1498a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1499a7a595f6SVinicius Costa Gomes __le16 handle; 1500a7a595f6SVinicius Costa Gomes } __packed; 1501a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1502a7a595f6SVinicius Costa Gomes __u8 status; 1503a7a595f6SVinicius Costa Gomes __le16 handle; 1504a7a595f6SVinicius Costa Gomes } __packed; 1505a7a595f6SVinicius Costa Gomes 15069b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 15079b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 15089b008c04SJohan Hedberg __u8 status; 15099b008c04SJohan Hedberg __u8 le_states[8]; 15109b008c04SJohan Hedberg } __packed; 15119b008c04SJohan Hedberg 15128e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 15138e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 15148e75b46aSAndre Guedes __le16 handle; 15158e75b46aSAndre Guedes __le16 interval_min; 15168e75b46aSAndre Guedes __le16 interval_max; 15178e75b46aSAndre Guedes __le16 latency; 15188e75b46aSAndre Guedes __le16 timeout; 15198e75b46aSAndre Guedes __le16 min_ce_len; 15208e75b46aSAndre Guedes __le16 max_ce_len; 15218e75b46aSAndre Guedes } __packed; 15228e75b46aSAndre Guedes 15238e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 15248e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 15258e75b46aSAndre Guedes __le16 handle; 15268e75b46aSAndre Guedes __u8 reason; 15278e75b46aSAndre Guedes } __packed; 15288e75b46aSAndre Guedes 152994a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 153094a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 153194a3bd02SMarcel Holtmann __le16 handle; 153294a3bd02SMarcel Holtmann __le16 tx_len; 153394a3bd02SMarcel Holtmann __le16 tx_time; 153494a3bd02SMarcel Holtmann } __packed; 153594a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 153694a3bd02SMarcel Holtmann __u8 status; 153794a3bd02SMarcel Holtmann __le16 handle; 153894a3bd02SMarcel Holtmann } __packed; 153994a3bd02SMarcel Holtmann 154094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 154194a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 154294a3bd02SMarcel Holtmann __u8 status; 154394a3bd02SMarcel Holtmann __le16 tx_len; 154494a3bd02SMarcel Holtmann __le16 tx_time; 154594a3bd02SMarcel Holtmann } __packed; 154694a3bd02SMarcel Holtmann 154794a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 154894a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 154994a3bd02SMarcel Holtmann __le16 tx_len; 155094a3bd02SMarcel Holtmann __le16 tx_time; 155194a3bd02SMarcel Holtmann } __packed; 155294a3bd02SMarcel Holtmann 1553b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1554b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1555b950aa88SAnkit Navik __u8 bdaddr_type; 1556b950aa88SAnkit Navik bdaddr_t bdaddr; 1557b950aa88SAnkit Navik __u8 peer_irk[16]; 1558b950aa88SAnkit Navik __u8 local_irk[16]; 1559b950aa88SAnkit Navik } __packed; 1560b950aa88SAnkit Navik 1561b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1562b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1563b950aa88SAnkit Navik __u8 bdaddr_type; 1564b950aa88SAnkit Navik bdaddr_t bdaddr; 1565b950aa88SAnkit Navik } __packed; 1566b950aa88SAnkit Navik 1567545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1568545f2596SAnkit Navik 1569cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1570cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1571cfdb0c2dSAnkit Navik __u8 status; 1572cfdb0c2dSAnkit Navik __u8 size; 1573cfdb0c2dSAnkit Navik } __packed; 1574cfdb0c2dSAnkit Navik 1575aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1576aa12af77SAnkit Navik 157794a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 157894a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 157994a3bd02SMarcel Holtmann __u8 status; 158094a3bd02SMarcel Holtmann __le16 tx_len; 158194a3bd02SMarcel Holtmann __le16 tx_time; 158294a3bd02SMarcel Holtmann __le16 rx_len; 158394a3bd02SMarcel Holtmann __le16 rx_time; 158494a3bd02SMarcel Holtmann } __packed; 158594a3bd02SMarcel Holtmann 1586de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1587de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1588de2ba303SMarcel Holtmann __u8 all_phys; 1589de2ba303SMarcel Holtmann __u8 tx_phys; 1590de2ba303SMarcel Holtmann __u8 rx_phys; 1591de2ba303SMarcel Holtmann } __packed; 1592de2ba303SMarcel Holtmann 15936decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 15946decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 15956decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 15966decb5b4SJaganath Kanakkassery 1597a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1598a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1599a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1600a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1601a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1602a2344b9eSJaganath Kanakkassery __u8 data[0]; 1603a2344b9eSJaganath Kanakkassery } __packed; 1604a2344b9eSJaganath Kanakkassery 1605a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 160645bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 160745bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1608a2344b9eSJaganath Kanakkassery 1609a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1610a2344b9eSJaganath Kanakkassery __u8 type; 1611a2344b9eSJaganath Kanakkassery __le16 interval; 1612a2344b9eSJaganath Kanakkassery __le16 window; 1613a2344b9eSJaganath Kanakkassery } __packed; 1614a2344b9eSJaganath Kanakkassery 1615a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1616a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1617a2344b9eSJaganath Kanakkassery __u8 enable; 1618a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1619a2344b9eSJaganath Kanakkassery __le16 duration; 1620a2344b9eSJaganath Kanakkassery __le16 period; 1621a2344b9eSJaganath Kanakkassery } __packed; 1622a2344b9eSJaganath Kanakkassery 16234d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 16244d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 16254d94f95dSJaganath Kanakkassery __u8 filter_policy; 16264d94f95dSJaganath Kanakkassery __u8 own_addr_type; 16274d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 16284d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 16294d94f95dSJaganath Kanakkassery __u8 phys; 16304d94f95dSJaganath Kanakkassery __u8 data[0]; 16314d94f95dSJaganath Kanakkassery } __packed; 16324d94f95dSJaganath Kanakkassery 16334d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 16344d94f95dSJaganath Kanakkassery __le16 scan_interval; 16354d94f95dSJaganath Kanakkassery __le16 scan_window; 16364d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 16374d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 16384d94f95dSJaganath Kanakkassery __le16 conn_latency; 16394d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 16404d94f95dSJaganath Kanakkassery __le16 min_ce_len; 16414d94f95dSJaganath Kanakkassery __le16 max_ce_len; 16424d94f95dSJaganath Kanakkassery } __packed; 16434d94f95dSJaganath Kanakkassery 16446b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 16456b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 16466b49bcb4SJaganath Kanakkassery __u8 status; 16476b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 16486b49bcb4SJaganath Kanakkassery } __packed; 16496b49bcb4SJaganath Kanakkassery 1650de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1651de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1652de181e88SJaganath Kanakkassery __u8 handle; 1653de181e88SJaganath Kanakkassery __le16 evt_properties; 1654de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1655de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1656de181e88SJaganath Kanakkassery __u8 channel_map; 1657de181e88SJaganath Kanakkassery __u8 own_addr_type; 1658de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1659de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1660de181e88SJaganath Kanakkassery __u8 filter_policy; 1661de181e88SJaganath Kanakkassery __u8 tx_power; 1662de181e88SJaganath Kanakkassery __u8 primary_phy; 1663de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1664de181e88SJaganath Kanakkassery __u8 secondary_phy; 1665de181e88SJaganath Kanakkassery __u8 sid; 1666de181e88SJaganath Kanakkassery __u8 notif_enable; 1667de181e88SJaganath Kanakkassery } __packed; 1668de181e88SJaganath Kanakkassery 1669de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 167085a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 167185a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1672de181e88SJaganath Kanakkassery 1673de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1674de181e88SJaganath Kanakkassery __u8 status; 1675de181e88SJaganath Kanakkassery __u8 tx_power; 1676de181e88SJaganath Kanakkassery } __packed; 1677de181e88SJaganath Kanakkassery 1678de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1679de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1680de181e88SJaganath Kanakkassery __u8 enable; 1681de181e88SJaganath Kanakkassery __u8 num_of_sets; 1682de181e88SJaganath Kanakkassery __u8 data[0]; 1683de181e88SJaganath Kanakkassery } __packed; 1684de181e88SJaganath Kanakkassery 1685de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1686de181e88SJaganath Kanakkassery __u8 handle; 1687de181e88SJaganath Kanakkassery __le16 duration; 1688de181e88SJaganath Kanakkassery __u8 max_events; 1689de181e88SJaganath Kanakkassery } __packed; 1690de181e88SJaganath Kanakkassery 1691a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1692a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1693a0fb3726SJaganath Kanakkassery __u8 handle; 1694a0fb3726SJaganath Kanakkassery __u8 operation; 1695a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1696a0fb3726SJaganath Kanakkassery __u8 length; 1697a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1698a0fb3726SJaganath Kanakkassery } __packed; 1699a0fb3726SJaganath Kanakkassery 1700a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1701a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1702a0fb3726SJaganath Kanakkassery __u8 handle; 1703a0fb3726SJaganath Kanakkassery __u8 operation; 1704a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1705a0fb3726SJaganath Kanakkassery __u8 length; 1706a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1707a0fb3726SJaganath Kanakkassery } __packed; 1708a0fb3726SJaganath Kanakkassery 1709a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1710a0fb3726SJaganath Kanakkassery 1711a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1712a0fb3726SJaganath Kanakkassery 171345b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 171445b7749fSJaganath Kanakkassery 1715a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1716a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1717a73c046aSJaganath Kanakkassery __u8 handle; 1718a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1719a73c046aSJaganath Kanakkassery } __packed; 1720a73c046aSJaganath Kanakkassery 17211da177e4SLinus Torvalds /* ---- HCI Events ---- */ 17221da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 17231da177e4SLinus Torvalds 17241da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 17251da177e4SLinus Torvalds struct inquiry_info { 17261da177e4SLinus Torvalds bdaddr_t bdaddr; 17271da177e4SLinus Torvalds __u8 pscan_rep_mode; 17281da177e4SLinus Torvalds __u8 pscan_period_mode; 17291da177e4SLinus Torvalds __u8 pscan_mode; 17301da177e4SLinus Torvalds __u8 dev_class[3]; 17311ebb9252SMarcel Holtmann __le16 clock_offset; 173266c853ccSGustavo F. Padovan } __packed; 17331da177e4SLinus Torvalds 17341da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 17351da177e4SLinus Torvalds struct hci_ev_conn_complete { 17361da177e4SLinus Torvalds __u8 status; 17371ebb9252SMarcel Holtmann __le16 handle; 17381da177e4SLinus Torvalds bdaddr_t bdaddr; 17391da177e4SLinus Torvalds __u8 link_type; 17401da177e4SLinus Torvalds __u8 encr_mode; 174166c853ccSGustavo F. Padovan } __packed; 17421da177e4SLinus Torvalds 17431da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 17441da177e4SLinus Torvalds struct hci_ev_conn_request { 17451da177e4SLinus Torvalds bdaddr_t bdaddr; 17461da177e4SLinus Torvalds __u8 dev_class[3]; 17471da177e4SLinus Torvalds __u8 link_type; 174866c853ccSGustavo F. Padovan } __packed; 17491da177e4SLinus Torvalds 17501da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 17511da177e4SLinus Torvalds struct hci_ev_disconn_complete { 17521da177e4SLinus Torvalds __u8 status; 17531ebb9252SMarcel Holtmann __le16 handle; 17541da177e4SLinus Torvalds __u8 reason; 175566c853ccSGustavo F. Padovan } __packed; 17561da177e4SLinus Torvalds 17571da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 17581da177e4SLinus Torvalds struct hci_ev_auth_complete { 17591da177e4SLinus Torvalds __u8 status; 17601ebb9252SMarcel Holtmann __le16 handle; 176166c853ccSGustavo F. Padovan } __packed; 17621da177e4SLinus Torvalds 1763a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1764a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1765a9de9248SMarcel Holtmann __u8 status; 1766a9de9248SMarcel Holtmann bdaddr_t bdaddr; 17671f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 176866c853ccSGustavo F. Padovan } __packed; 1769a9de9248SMarcel Holtmann 17701da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 17711da177e4SLinus Torvalds struct hci_ev_encrypt_change { 17721da177e4SLinus Torvalds __u8 status; 17731ebb9252SMarcel Holtmann __le16 handle; 17741da177e4SLinus Torvalds __u8 encrypt; 177566c853ccSGustavo F. Padovan } __packed; 17761da177e4SLinus Torvalds 1777a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1778a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 17791da177e4SLinus Torvalds __u8 status; 17801ebb9252SMarcel Holtmann __le16 handle; 178166c853ccSGustavo F. Padovan } __packed; 17821da177e4SLinus Torvalds 1783a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1784a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1785a9de9248SMarcel Holtmann __u8 status; 1786a9de9248SMarcel Holtmann __le16 handle; 1787a9de9248SMarcel Holtmann __u8 features[8]; 178866c853ccSGustavo F. Padovan } __packed; 1789a9de9248SMarcel Holtmann 1790a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1791a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1792a9de9248SMarcel Holtmann __u8 status; 1793a9de9248SMarcel Holtmann __le16 handle; 1794a9de9248SMarcel Holtmann __u8 lmp_ver; 1795a9de9248SMarcel Holtmann __le16 manufacturer; 1796a9de9248SMarcel Holtmann __le16 lmp_subver; 179766c853ccSGustavo F. Padovan } __packed; 1798a9de9248SMarcel Holtmann 1799a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 18001da177e4SLinus Torvalds struct hci_qos { 18011da177e4SLinus Torvalds __u8 service_type; 18021da177e4SLinus Torvalds __u32 token_rate; 18031da177e4SLinus Torvalds __u32 peak_bandwidth; 18041da177e4SLinus Torvalds __u32 latency; 18051da177e4SLinus Torvalds __u32 delay_variation; 180666c853ccSGustavo F. Padovan } __packed; 18071da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 18081da177e4SLinus Torvalds __u8 status; 18091ebb9252SMarcel Holtmann __le16 handle; 18101da177e4SLinus Torvalds struct hci_qos qos; 181166c853ccSGustavo F. Padovan } __packed; 18121da177e4SLinus Torvalds 1813a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 18141da177e4SLinus Torvalds struct hci_ev_cmd_complete { 18151da177e4SLinus Torvalds __u8 ncmd; 18161ebb9252SMarcel Holtmann __le16 opcode; 181766c853ccSGustavo F. Padovan } __packed; 18181da177e4SLinus Torvalds 1819a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 18201da177e4SLinus Torvalds struct hci_ev_cmd_status { 18211da177e4SLinus Torvalds __u8 status; 18221da177e4SLinus Torvalds __u8 ncmd; 18231ebb9252SMarcel Holtmann __le16 opcode; 182466c853ccSGustavo F. Padovan } __packed; 18251da177e4SLinus Torvalds 182624dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 182724dfa343SMarcel Holtmann struct hci_ev_hardware_error { 182824dfa343SMarcel Holtmann __u8 code; 182924dfa343SMarcel Holtmann } __packed; 183024dfa343SMarcel Holtmann 18311da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 18321da177e4SLinus Torvalds struct hci_ev_role_change { 18331da177e4SLinus Torvalds __u8 status; 18341da177e4SLinus Torvalds bdaddr_t bdaddr; 18351da177e4SLinus Torvalds __u8 role; 183666c853ccSGustavo F. Padovan } __packed; 18371da177e4SLinus Torvalds 1838a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 1839613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 1840613a1c0cSAndrei Emeltchenko __le16 handle; 1841613a1c0cSAndrei Emeltchenko __le16 count; 1842613a1c0cSAndrei Emeltchenko } __packed; 1843613a1c0cSAndrei Emeltchenko 1844a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 1845a9de9248SMarcel Holtmann __u8 num_hndl; 1846613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info handles[0]; 184766c853ccSGustavo F. Padovan } __packed; 1848a9de9248SMarcel Holtmann 18491da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 18501da177e4SLinus Torvalds struct hci_ev_mode_change { 18511da177e4SLinus Torvalds __u8 status; 18521ebb9252SMarcel Holtmann __le16 handle; 18531da177e4SLinus Torvalds __u8 mode; 18541ebb9252SMarcel Holtmann __le16 interval; 185566c853ccSGustavo F. Padovan } __packed; 18561da177e4SLinus Torvalds 18571da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 18581da177e4SLinus Torvalds struct hci_ev_pin_code_req { 18591da177e4SLinus Torvalds bdaddr_t bdaddr; 186066c853ccSGustavo F. Padovan } __packed; 18611da177e4SLinus Torvalds 18621da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 18631da177e4SLinus Torvalds struct hci_ev_link_key_req { 18641da177e4SLinus Torvalds bdaddr_t bdaddr; 186566c853ccSGustavo F. Padovan } __packed; 18661da177e4SLinus Torvalds 18671da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 18681da177e4SLinus Torvalds struct hci_ev_link_key_notify { 18691da177e4SLinus Torvalds bdaddr_t bdaddr; 18709b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 18711da177e4SLinus Torvalds __u8 key_type; 187266c853ccSGustavo F. Padovan } __packed; 18731da177e4SLinus Torvalds 1874a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 18751da177e4SLinus Torvalds struct hci_ev_clock_offset { 18761da177e4SLinus Torvalds __u8 status; 18771ebb9252SMarcel Holtmann __le16 handle; 18781ebb9252SMarcel Holtmann __le16 clock_offset; 187966c853ccSGustavo F. Padovan } __packed; 18801da177e4SLinus Torvalds 1881a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 1882a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 1883a8746417SMarcel Holtmann __u8 status; 1884a8746417SMarcel Holtmann __le16 handle; 1885a8746417SMarcel Holtmann __le16 pkt_type; 188666c853ccSGustavo F. Padovan } __packed; 1887a8746417SMarcel Holtmann 188885a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 188985a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 189085a1e930SMarcel Holtmann bdaddr_t bdaddr; 189185a1e930SMarcel Holtmann __u8 pscan_rep_mode; 189266c853ccSGustavo F. Padovan } __packed; 189385a1e930SMarcel Holtmann 1894a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 1895a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 1896a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1897a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1898a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1899a9de9248SMarcel Holtmann __u8 dev_class[3]; 1900a9de9248SMarcel Holtmann __le16 clock_offset; 1901a9de9248SMarcel Holtmann __s8 rssi; 190266c853ccSGustavo F. Padovan } __packed; 1903a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 1904a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1905a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1906a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1907a9de9248SMarcel Holtmann __u8 pscan_mode; 1908a9de9248SMarcel Holtmann __u8 dev_class[3]; 1909a9de9248SMarcel Holtmann __le16 clock_offset; 1910a9de9248SMarcel Holtmann __s8 rssi; 191166c853ccSGustavo F. Padovan } __packed; 1912a9de9248SMarcel Holtmann 1913a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 1914a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 1915a9de9248SMarcel Holtmann __u8 status; 1916a9de9248SMarcel Holtmann __le16 handle; 1917a9de9248SMarcel Holtmann __u8 page; 1918a9de9248SMarcel Holtmann __u8 max_page; 1919a9de9248SMarcel Holtmann __u8 features[8]; 192066c853ccSGustavo F. Padovan } __packed; 1921a9de9248SMarcel Holtmann 1922a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 1923a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 1924a9de9248SMarcel Holtmann __u8 status; 1925a9de9248SMarcel Holtmann __le16 handle; 1926a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1927a9de9248SMarcel Holtmann __u8 link_type; 1928a9de9248SMarcel Holtmann __u8 tx_interval; 1929a9de9248SMarcel Holtmann __u8 retrans_window; 1930a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1931a9de9248SMarcel Holtmann __le16 tx_pkt_len; 1932a9de9248SMarcel Holtmann __u8 air_mode; 193366c853ccSGustavo F. Padovan } __packed; 1934a9de9248SMarcel Holtmann 1935a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 1936a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 1937a9de9248SMarcel Holtmann __u8 status; 1938a9de9248SMarcel Holtmann __le16 handle; 1939a9de9248SMarcel Holtmann __u8 tx_interval; 1940a9de9248SMarcel Holtmann __u8 retrans_window; 1941a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1942a9de9248SMarcel Holtmann __le16 tx_pkt_len; 194366c853ccSGustavo F. Padovan } __packed; 1944a9de9248SMarcel Holtmann 1945a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 194604837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 194704837f64SMarcel Holtmann __u8 status; 194804837f64SMarcel Holtmann __le16 handle; 194904837f64SMarcel Holtmann __le16 max_tx_latency; 195004837f64SMarcel Holtmann __le16 max_rx_latency; 195104837f64SMarcel Holtmann __le16 max_remote_timeout; 195204837f64SMarcel Holtmann __le16 max_local_timeout; 195366c853ccSGustavo F. Padovan } __packed; 195404837f64SMarcel Holtmann 1955a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 1956a9de9248SMarcel Holtmann struct extended_inquiry_info { 1957a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1958a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1959a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1960a9de9248SMarcel Holtmann __u8 dev_class[3]; 1961a9de9248SMarcel Holtmann __le16 clock_offset; 1962a9de9248SMarcel Holtmann __s8 rssi; 1963a9de9248SMarcel Holtmann __u8 data[240]; 196466c853ccSGustavo F. Padovan } __packed; 1965a9de9248SMarcel Holtmann 19661c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 19671c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 19681c2e0041SJohan Hedberg __u8 status; 19691c2e0041SJohan Hedberg __le16 handle; 19701c2e0041SJohan Hedberg } __packed; 19711c2e0041SJohan Hedberg 19720493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 19730493684eSMarcel Holtmann struct hci_ev_io_capa_request { 19740493684eSMarcel Holtmann bdaddr_t bdaddr; 197566c853ccSGustavo F. Padovan } __packed; 19760493684eSMarcel Holtmann 197703b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 197803b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 197903b555e1SJohan Hedberg bdaddr_t bdaddr; 198003b555e1SJohan Hedberg __u8 capability; 198103b555e1SJohan Hedberg __u8 oob_data; 198203b555e1SJohan Hedberg __u8 authentication; 198303b555e1SJohan Hedberg } __packed; 198403b555e1SJohan Hedberg 1985a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 1986a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 1987a5c29683SJohan Hedberg bdaddr_t bdaddr; 1988a5c29683SJohan Hedberg __le32 passkey; 1989a5c29683SJohan Hedberg } __packed; 1990a5c29683SJohan Hedberg 19919ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 19929ad4019aSBrian Gix struct hci_ev_user_passkey_req { 19939ad4019aSBrian Gix bdaddr_t bdaddr; 19949ad4019aSBrian Gix } __packed; 19959ad4019aSBrian Gix 19962763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 19972763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 19982763eda6SSzymon Janc bdaddr_t bdaddr; 19992763eda6SSzymon Janc } __packed; 20002763eda6SSzymon Janc 20010493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 20020493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 20030493684eSMarcel Holtmann __u8 status; 20040493684eSMarcel Holtmann bdaddr_t bdaddr; 200566c853ccSGustavo F. Padovan } __packed; 20060493684eSMarcel Holtmann 200792a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 200892a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 200992a25256SJohan Hedberg bdaddr_t bdaddr; 201092a25256SJohan Hedberg __le32 passkey; 201192a25256SJohan Hedberg } __packed; 201292a25256SJohan Hedberg 201392a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 201492a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 201592a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 201692a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 201792a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 201892a25256SJohan Hedberg 201992a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 202092a25256SJohan Hedberg struct hci_ev_keypress_notify { 202192a25256SJohan Hedberg bdaddr_t bdaddr; 202292a25256SJohan Hedberg __u8 type; 202392a25256SJohan Hedberg } __packed; 202492a25256SJohan Hedberg 202541a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 202641a96212SMarcel Holtmann struct hci_ev_remote_host_features { 202741a96212SMarcel Holtmann bdaddr_t bdaddr; 202841a96212SMarcel Holtmann __u8 features[8]; 202966c853ccSGustavo F. Padovan } __packed; 203041a96212SMarcel Holtmann 203163185f64SVille Tervo #define HCI_EV_LE_META 0x3e 203263185f64SVille Tervo struct hci_ev_le_meta { 203363185f64SVille Tervo __u8 subevent; 203463185f64SVille Tervo } __packed; 203563185f64SVille Tervo 2036523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2037523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2038523e93cdSAndrei Emeltchenko __u8 status; 2039523e93cdSAndrei Emeltchenko __u8 phy_handle; 2040523e93cdSAndrei Emeltchenko } __packed; 2041523e93cdSAndrei Emeltchenko 2042523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2043523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2044523e93cdSAndrei Emeltchenko __u8 phy_handle; 2045523e93cdSAndrei Emeltchenko } __packed; 2046523e93cdSAndrei Emeltchenko 2047523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2048523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2049523e93cdSAndrei Emeltchenko __u8 status; 2050523e93cdSAndrei Emeltchenko __u8 phy_handle; 2051523e93cdSAndrei Emeltchenko __u8 reason; 2052523e93cdSAndrei Emeltchenko } __packed; 2053523e93cdSAndrei Emeltchenko 2054523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2055523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2056523e93cdSAndrei Emeltchenko __u8 status; 2057523e93cdSAndrei Emeltchenko __le16 handle; 2058523e93cdSAndrei Emeltchenko __u8 phy_handle; 2059523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2060523e93cdSAndrei Emeltchenko } __packed; 2061523e93cdSAndrei Emeltchenko 2062523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2063523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2064523e93cdSAndrei Emeltchenko __u8 status; 2065523e93cdSAndrei Emeltchenko __le16 handle; 2066523e93cdSAndrei Emeltchenko __u8 reason; 2067523e93cdSAndrei Emeltchenko } __packed; 2068523e93cdSAndrei Emeltchenko 206925e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 207025e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 207125e89e99SAndrei Emeltchenko __le16 handle; 207225e89e99SAndrei Emeltchenko __le16 pkts; 207325e89e99SAndrei Emeltchenko __le16 blocks; 207425e89e99SAndrei Emeltchenko } __packed; 207525e89e99SAndrei Emeltchenko 207625e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 207725e89e99SAndrei Emeltchenko __le16 num_blocks; 207825e89e99SAndrei Emeltchenko __u8 num_hndl; 207925e89e99SAndrei Emeltchenko struct hci_comp_blocks_info handles[0]; 208025e89e99SAndrei Emeltchenko } __packed; 208125e89e99SAndrei Emeltchenko 20822b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 20832b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 20842b359445SDoHyun Pyun __u8 status; 20852b359445SDoHyun Pyun } __packed; 20862b359445SDoHyun Pyun 20872ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 20882ed01805SDoHyun Pyun 208963185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 209063185f64SVille Tervo struct hci_ev_le_conn_complete { 209163185f64SVille Tervo __u8 status; 209263185f64SVille Tervo __le16 handle; 209363185f64SVille Tervo __u8 role; 209463185f64SVille Tervo __u8 bdaddr_type; 209563185f64SVille Tervo bdaddr_t bdaddr; 209663185f64SVille Tervo __le16 interval; 209763185f64SVille Tervo __le16 latency; 209863185f64SVille Tervo __le16 supervision_timeout; 209963185f64SVille Tervo __u8 clk_accurancy; 210063185f64SVille Tervo } __packed; 210163185f64SVille Tervo 21022331fd46SMarcel Holtmann /* Advertising report event types */ 21032331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 21042331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 21052331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 21062331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 21072331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2108c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2109c215e939SJaganath Kanakkassery 2110c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2111c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2112c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2113c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2114c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2115c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2116c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 21172331fd46SMarcel Holtmann 2118b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2119b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2120b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2121b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2122b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2123b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2124b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2125b2cc9761SJaganath Kanakkassery 21262331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 21272331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 21282331fd46SMarcel Holtmann 21292331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 21302331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 21312331fd46SMarcel Holtmann __u8 evt_type; 21322331fd46SMarcel Holtmann __u8 bdaddr_type; 21332331fd46SMarcel Holtmann bdaddr_t bdaddr; 21342331fd46SMarcel Holtmann __u8 length; 21352331fd46SMarcel Holtmann __u8 data[0]; 21362331fd46SMarcel Holtmann } __packed; 21372331fd46SMarcel Holtmann 21381855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 21391855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 21401855d92dSMarcel Holtmann __u8 status; 21411855d92dSMarcel Holtmann __le16 handle; 21421855d92dSMarcel Holtmann __le16 interval; 21431855d92dSMarcel Holtmann __le16 latency; 21441855d92dSMarcel Holtmann __le16 supervision_timeout; 21451855d92dSMarcel Holtmann } __packed; 21461855d92dSMarcel Holtmann 21470fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 21480fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 21490fe29fd1SMarcel Holtmann __u8 status; 21500fe29fd1SMarcel Holtmann __le16 handle; 21510fe29fd1SMarcel Holtmann __u8 features[8]; 21520fe29fd1SMarcel Holtmann } __packed; 21530fe29fd1SMarcel Holtmann 2154a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2155a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2156a7a595f6SVinicius Costa Gomes __le16 handle; 2157fe39c7b2SMarcel Holtmann __le64 rand; 2158a7a595f6SVinicius Costa Gomes __le16 ediv; 2159a7a595f6SVinicius Costa Gomes } __packed; 2160a7a595f6SVinicius Costa Gomes 21618e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 21628e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 21638e75b46aSAndre Guedes __le16 handle; 21648e75b46aSAndre Guedes __le16 interval_min; 21658e75b46aSAndre Guedes __le16 interval_max; 21668e75b46aSAndre Guedes __le16 latency; 21678e75b46aSAndre Guedes __le16 timeout; 21688e75b46aSAndre Guedes } __packed; 21698e75b46aSAndre Guedes 217094a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 217194a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 217294a3bd02SMarcel Holtmann __le16 handle; 217394a3bd02SMarcel Holtmann __le16 tx_len; 217494a3bd02SMarcel Holtmann __le16 tx_time; 217594a3bd02SMarcel Holtmann __le16 rx_len; 217694a3bd02SMarcel Holtmann __le16 rx_time; 217794a3bd02SMarcel Holtmann } __packed; 217894a3bd02SMarcel Holtmann 217932c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 218032c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 218132c9d43fSMarcel Holtmann __u8 evt_type; 218232c9d43fSMarcel Holtmann __u8 bdaddr_type; 218332c9d43fSMarcel Holtmann bdaddr_t bdaddr; 218432c9d43fSMarcel Holtmann __u8 direct_addr_type; 218532c9d43fSMarcel Holtmann bdaddr_t direct_addr; 218632c9d43fSMarcel Holtmann __s8 rssi; 218732c9d43fSMarcel Holtmann } __packed; 218832c9d43fSMarcel Holtmann 2189*1efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 2190*1efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 2191*1efd927dSLuiz Augusto von Dentz __u8 status; 2192*1efd927dSLuiz Augusto von Dentz __u16 handle; 2193*1efd927dSLuiz Augusto von Dentz __u8 tx_phy; 2194*1efd927dSLuiz Augusto von Dentz __u8 rx_phy; 2195*1efd927dSLuiz Augusto von Dentz } __packed; 2196*1efd927dSLuiz Augusto von Dentz 2197c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2198c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2199c215e939SJaganath Kanakkassery __le16 evt_type; 2200c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2201c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2202c215e939SJaganath Kanakkassery __u8 primary_phy; 2203c215e939SJaganath Kanakkassery __u8 secondary_phy; 2204c215e939SJaganath Kanakkassery __u8 sid; 2205c215e939SJaganath Kanakkassery __u8 tx_power; 2206c215e939SJaganath Kanakkassery __s8 rssi; 2207c215e939SJaganath Kanakkassery __le16 interval; 2208c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2209c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2210c215e939SJaganath Kanakkassery __u8 length; 2211c215e939SJaganath Kanakkassery __u8 data[0]; 2212c215e939SJaganath Kanakkassery } __packed; 2213c215e939SJaganath Kanakkassery 22144d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 22154d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 22164d94f95dSJaganath Kanakkassery __u8 status; 22174d94f95dSJaganath Kanakkassery __le16 handle; 22184d94f95dSJaganath Kanakkassery __u8 role; 22194d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 22204d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 22214d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 22224d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 22234d94f95dSJaganath Kanakkassery __le16 interval; 22244d94f95dSJaganath Kanakkassery __le16 latency; 22254d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 22264d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 22274d94f95dSJaganath Kanakkassery } __packed; 22284d94f95dSJaganath Kanakkassery 2229acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2230acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2231acf0aeaeSJaganath Kanakkassery __u8 status; 2232acf0aeaeSJaganath Kanakkassery __u8 handle; 2233acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2234acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2235acf0aeaeSJaganath Kanakkassery } __packed; 2236acf0aeaeSJaganath Kanakkassery 2237e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2238e4cc5a18SMarcel Holtmann 22391da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2240a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 22411da177e4SLinus Torvalds struct hci_ev_stack_internal { 22421da177e4SLinus Torvalds __u16 type; 22431da177e4SLinus Torvalds __u8 data[0]; 224466c853ccSGustavo F. Padovan } __packed; 22451da177e4SLinus Torvalds 22461da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 22471da177e4SLinus Torvalds struct hci_ev_si_device { 22481da177e4SLinus Torvalds __u16 event; 22491da177e4SLinus Torvalds __u16 dev_id; 225066c853ccSGustavo F. Padovan } __packed; 22511da177e4SLinus Torvalds 22521da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 22531da177e4SLinus Torvalds struct hci_ev_si_security { 22541da177e4SLinus Torvalds __u16 event; 22551da177e4SLinus Torvalds __u16 proto; 22561da177e4SLinus Torvalds __u16 subproto; 22571da177e4SLinus Torvalds __u8 incoming; 225866c853ccSGustavo F. Padovan } __packed; 22591da177e4SLinus Torvalds 22601da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 22611da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 22621da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 22631da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 22641da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 22651da177e4SLinus Torvalds 22661da177e4SLinus Torvalds struct hci_command_hdr { 22671ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 22681da177e4SLinus Torvalds __u8 plen; 226966c853ccSGustavo F. Padovan } __packed; 22701da177e4SLinus Torvalds 22711da177e4SLinus Torvalds struct hci_event_hdr { 22721da177e4SLinus Torvalds __u8 evt; 22731da177e4SLinus Torvalds __u8 plen; 227466c853ccSGustavo F. Padovan } __packed; 22751da177e4SLinus Torvalds 22761da177e4SLinus Torvalds struct hci_acl_hdr { 22771ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 22781ebb9252SMarcel Holtmann __le16 dlen; 227966c853ccSGustavo F. Padovan } __packed; 22801da177e4SLinus Torvalds 22811da177e4SLinus Torvalds struct hci_sco_hdr { 22821ebb9252SMarcel Holtmann __le16 handle; 22831da177e4SLinus Torvalds __u8 dlen; 228466c853ccSGustavo F. Padovan } __packed; 22851da177e4SLinus Torvalds 22862a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 22872a123b86SArnaldo Carvalho de Melo { 22882a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 22892a123b86SArnaldo Carvalho de Melo } 22902a123b86SArnaldo Carvalho de Melo 22912a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 22922a123b86SArnaldo Carvalho de Melo { 22932a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 22942a123b86SArnaldo Carvalho de Melo } 22952a123b86SArnaldo Carvalho de Melo 22962a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 22972a123b86SArnaldo Carvalho de Melo { 22982a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 22992a123b86SArnaldo Carvalho de Melo } 23002a123b86SArnaldo Carvalho de Melo 23011da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2302c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 23031da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 23041da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 23051da177e4SLinus Torvalds 23061da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2307c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 23081da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 23091da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 23101da177e4SLinus Torvalds 23111da177e4SLinus Torvalds #endif /* __HCI_H */ 2312