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 16143d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 16243d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 16343d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 16443d6bc46SMarcel Holtmann * 16543d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 16643d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 16743d6bc46SMarcel Holtmann */ 16843d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 169695c4cb6SJakub Pawlowski 170695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 171695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 172695c4cb6SJakub Pawlowski * 173695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 174695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 175695c4cb6SJakub Pawlowski */ 176695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1777e995b9eSMarcel Holtmann 1787e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1797e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1807e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1817e995b9eSMarcel Holtmann * 1827e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 1837e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 1847e995b9eSMarcel Holtmann */ 1857e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 1861da177e4SLinus Torvalds }; 1871da177e4SLinus Torvalds 1881da177e4SLinus Torvalds /* HCI device flags */ 1891da177e4SLinus Torvalds enum { 1901da177e4SLinus Torvalds HCI_UP, 1911da177e4SLinus Torvalds HCI_INIT, 1921da177e4SLinus Torvalds HCI_RUNNING, 1931da177e4SLinus Torvalds 1941da177e4SLinus Torvalds HCI_PSCAN, 1951da177e4SLinus Torvalds HCI_ISCAN, 1961da177e4SLinus Torvalds HCI_AUTH, 1971da177e4SLinus Torvalds HCI_ENCRYPT, 1981da177e4SLinus Torvalds HCI_INQUIRY, 1991da177e4SLinus Torvalds 2001da177e4SLinus Torvalds HCI_RAW, 201ab81cbf9SJohan Hedberg 20210572132SGustavo F. Padovan HCI_RESET, 2031da177e4SLinus Torvalds }; 2041da177e4SLinus Torvalds 205f9207338SMarcel Holtmann /* HCI socket flags */ 206f9207338SMarcel Holtmann enum { 20750ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 208f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 209f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 210ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 211321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2125504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2135504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2145504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2155504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 21672000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 217f9207338SMarcel Holtmann }; 218f9207338SMarcel Holtmann 219d23264a8SAndre Guedes /* 220d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 221d23264a8SAndre Guedes * states from the controller. 222d23264a8SAndre Guedes */ 223d23264a8SAndre Guedes enum { 224a8b2d5c2SJohan Hedberg HCI_SETUP, 225d603b76bSMarcel Holtmann HCI_CONFIG, 226a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2275e130367SJohan Hedberg HCI_RFKILLED, 228a8b2d5c2SJohan Hedberg HCI_MGMT, 229b6ae8457SJohan Hedberg HCI_BONDABLE, 230a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2310663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2323769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 23394324962SJohan Hovold HCI_UNREGISTER, 2344a964404SMarcel Holtmann HCI_UNCONFIGURED, 2350736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 236dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 23766c417c1SJohan Hedberg HCI_LE_ADV, 238d23264a8SAndre Guedes HCI_LE_SCAN, 23984bde9d6SJohan Hedberg HCI_SSP_ENABLED, 240e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 241134c2a89SMarcel Holtmann HCI_SC_ONLY, 242863efaf2SJohan Hedberg HCI_PRIVACY, 24382a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 244d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 24541edf160SJohan Hedberg HCI_RPA_RESOLVING, 2466d80dfd0SJohan Hedberg HCI_HS_ENABLED, 24706199cf8SJohan Hedberg HCI_LE_ENABLED, 248f3d3444aSJohan Hedberg HCI_ADVERTISING, 249cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 2505e5282bbSJohan Hedberg HCI_CONNECTABLE, 2515e5282bbSJohan Hedberg HCI_DISCOVERABLE, 2526acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 25347990ea0SJohan Hedberg HCI_LINK_SECURITY, 25421693c15SAndre Guedes HCI_PERIODIC_INQ, 2551a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 25656f87901SJohan Hedberg HCI_BREDR_ENABLED, 25781ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 258b7cb93e5SMarcel Holtmann 259b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 2604b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 261b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 262b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 263b7cb93e5SMarcel Holtmann 264eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 265d23264a8SAndre Guedes }; 266d23264a8SAndre Guedes 2671da177e4SLinus Torvalds /* HCI timeouts */ 2685f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2695f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 2705f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 271d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2725f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 2739345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 274a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 2759489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 2761f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 2771da177e4SLinus Torvalds 2785b7f9909SMarcel Holtmann /* HCI data types */ 2791da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 2801da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 2811da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 2821da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 283e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 2841da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 2851da177e4SLinus Torvalds 2865b7f9909SMarcel Holtmann /* HCI packet types */ 2871da177e4SLinus Torvalds #define HCI_DM1 0x0008 2881da177e4SLinus Torvalds #define HCI_DM3 0x0400 2891da177e4SLinus Torvalds #define HCI_DM5 0x4000 2901da177e4SLinus Torvalds #define HCI_DH1 0x0010 2911da177e4SLinus Torvalds #define HCI_DH3 0x0800 2921da177e4SLinus Torvalds #define HCI_DH5 0x8000 2931da177e4SLinus Torvalds 2945075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 2955075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 2965075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 2975075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 2985075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 2995075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3005075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3015075b972SJaganath Kanakkassery 3021da177e4SLinus Torvalds #define HCI_HV1 0x0020 3031da177e4SLinus Torvalds #define HCI_HV2 0x0040 3041da177e4SLinus Torvalds #define HCI_HV3 0x0080 3051da177e4SLinus Torvalds 3061da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3071da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3081da177e4SLinus Torvalds 3095b7f9909SMarcel Holtmann /* eSCO packet types */ 3105b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3115b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3125b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3135b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3145b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3155b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 316efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 317efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 318efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 319efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3205b7f9909SMarcel Holtmann 321a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 322efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 323a8746417SMarcel Holtmann 3241da177e4SLinus Torvalds /* ACL flags */ 325e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3261da177e4SLinus Torvalds #define ACL_CONT 0x01 3271da177e4SLinus Torvalds #define ACL_START 0x02 328d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 3291da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 3301da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 3311da177e4SLinus Torvalds 3321da177e4SLinus Torvalds /* Baseband links */ 3331da177e4SLinus Torvalds #define SCO_LINK 0x00 3341da177e4SLinus Torvalds #define ACL_LINK 0x01 3355b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 336fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 337fcd89c09SVille Tervo #define LE_LINK 0x80 3383161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 339845472e8SMarcel Holtmann #define INVALID_LINK 0xff 3401da177e4SLinus Torvalds 3411da177e4SLinus Torvalds /* LMP features */ 3421da177e4SLinus Torvalds #define LMP_3SLOT 0x01 3431da177e4SLinus Torvalds #define LMP_5SLOT 0x02 3441da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 3451da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 3461da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 3471da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 3481da177e4SLinus Torvalds #define LMP_HOLD 0x40 34904837f64SMarcel Holtmann #define LMP_SNIFF 0x80 3501da177e4SLinus Torvalds 3511da177e4SLinus Torvalds #define LMP_PARK 0x01 3521da177e4SLinus Torvalds #define LMP_RSSI 0x02 3531da177e4SLinus Torvalds #define LMP_QUALITY 0x04 3541da177e4SLinus Torvalds #define LMP_SCO 0x08 3551da177e4SLinus Torvalds #define LMP_HV2 0x10 3561da177e4SLinus Torvalds #define LMP_HV3 0x20 3571da177e4SLinus Torvalds #define LMP_ULAW 0x40 3581da177e4SLinus Torvalds #define LMP_ALAW 0x80 3591da177e4SLinus Torvalds 3601da177e4SLinus Torvalds #define LMP_CVSD 0x01 3611da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 3621da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 36307a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 3641da177e4SLinus Torvalds 3655075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 3665075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 367d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 3685b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 3695b7f9909SMarcel Holtmann 3705b7f9909SMarcel Holtmann #define LMP_EV4 0x01 3715b7f9909SMarcel Holtmann #define LMP_EV5 0x02 37269ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 373d5859e22SJohan Hedberg #define LMP_LE 0x40 3745075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 3755b7f9909SMarcel Holtmann 3765075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 37704837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 378d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 379efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 380efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 381efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 38204837f64SMarcel Holtmann 383d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 384e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 385769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 386e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 387769be974SMarcel Holtmann 388d5859e22SJohan Hedberg #define LMP_LSTO 0x01 389d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 390971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 391d5859e22SJohan Hedberg 392eead27daSAndre Guedes /* Extended LMP features */ 39353b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 39453b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 39553b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 39653b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 39753b834d2SMarcel Holtmann 398d5991585SMarcel Holtmann #define LMP_SC 0x01 399d5991585SMarcel Holtmann #define LMP_PING 0x02 400d5991585SMarcel Holtmann 40153b834d2SMarcel Holtmann /* Host features */ 402cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 403eead27daSAndre Guedes #define LMP_HOST_LE 0x02 404cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 405d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 406eead27daSAndre Guedes 407662bc2e6SAndre Guedes /* LE features */ 4080da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 409662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 4100fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 411cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 41294a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 413*85a721a8SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 414*85a721a8SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4156b49bcb4SJaganath Kanakkassery #define HCI_LE_EXT_ADV 0x10 4164b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4175075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 4185075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 4199756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 420662bc2e6SAndre Guedes 42104837f64SMarcel Holtmann /* Connection modes */ 42204837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 42304837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 42404837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 42504837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 42604837f64SMarcel Holtmann 4271da177e4SLinus Torvalds /* Link policies */ 4281da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 4291da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 4301da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 4311da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 4321da177e4SLinus Torvalds 43304837f64SMarcel Holtmann /* Link modes */ 4341da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 4351da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 4361da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 4371da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 4381da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 4391da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 4401da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 4417b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 4421da177e4SLinus Torvalds 44340be492fSMarcel Holtmann /* Authentication types */ 44440be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 44540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 44640be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 44740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 44840be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 44940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 45040be492fSMarcel Holtmann 451a77b15a6SMikel Astiz /* I/O capabilities */ 452a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 453a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 454a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 455a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 456a77b15a6SMikel Astiz 457b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 458b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 459b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 460b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 461b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 46211015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 46311015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 464b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 46511015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 46611015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 467b6020ba0SWaldemar Rymarkiewicz 4689f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 4698e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 4709f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 471160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 4722acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 473cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 474d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 4759f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 4769f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 477cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 478cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 4799f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 4809f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 4814ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 4824ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 4833c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 4849f5a0d7bSAndrei Emeltchenko 4852455a3eaSAndrei Emeltchenko /* Flow control modes */ 4862455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 4872455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 4882455a3eaSAndrei Emeltchenko 489bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 490bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 491a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 492bbaf444aSJohan Hedberg 493ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 494ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 495ba165a90SJohan Hedberg 49632748db0SJohan Hedberg /* Extended Inquiry Response field types */ 49732748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 49832748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 49932748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 50032748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 50132748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 50232748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 50332748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 50432748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 50532748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 50632748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5079ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 508d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 509d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 51032748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5114453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5121471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5131471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 514d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 515d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 516f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 517f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 51832748db0SJohan Hedberg 5193f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 5203f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 5213f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 5223f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 5233f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 5243f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 5253f0f524bSJohan Hedberg 5261da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 5276bd32326SVille Tervo #define HCI_OP_NOP 0x0000 5286bd32326SVille Tervo 529a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 530a9de9248SMarcel Holtmann struct hci_cp_inquiry { 531a9de9248SMarcel Holtmann __u8 lap[3]; 532a9de9248SMarcel Holtmann __u8 length; 533a9de9248SMarcel Holtmann __u8 num_rsp; 53466c853ccSGustavo F. Padovan } __packed; 5351da177e4SLinus Torvalds 536a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 537a9de9248SMarcel Holtmann 53879d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 53979d6e068SAndre Guedes 540a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 541a9de9248SMarcel Holtmann 542a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 543a9de9248SMarcel Holtmann struct hci_cp_create_conn { 544a9de9248SMarcel Holtmann bdaddr_t bdaddr; 545a9de9248SMarcel Holtmann __le16 pkt_type; 546a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 547a9de9248SMarcel Holtmann __u8 pscan_mode; 548a9de9248SMarcel Holtmann __le16 clock_offset; 549a9de9248SMarcel Holtmann __u8 role_switch; 55066c853ccSGustavo F. Padovan } __packed; 5511da177e4SLinus Torvalds 552a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 553a9de9248SMarcel Holtmann struct hci_cp_disconnect { 554a9de9248SMarcel Holtmann __le16 handle; 555a9de9248SMarcel Holtmann __u8 reason; 55666c853ccSGustavo F. Padovan } __packed; 5571da177e4SLinus Torvalds 558a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 559a9de9248SMarcel Holtmann struct hci_cp_add_sco { 560a9de9248SMarcel Holtmann __le16 handle; 561a9de9248SMarcel Holtmann __le16 pkt_type; 56266c853ccSGustavo F. Padovan } __packed; 563a9de9248SMarcel Holtmann 564a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 565a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 5661da177e4SLinus Torvalds bdaddr_t bdaddr; 56766c853ccSGustavo F. Padovan } __packed; 5681da177e4SLinus Torvalds 569a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 570a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 571a9de9248SMarcel Holtmann bdaddr_t bdaddr; 572a9de9248SMarcel Holtmann __u8 role; 57366c853ccSGustavo F. Padovan } __packed; 5741da177e4SLinus Torvalds 575a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 576a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 577a9de9248SMarcel Holtmann bdaddr_t bdaddr; 578a9de9248SMarcel Holtmann __u8 reason; 57966c853ccSGustavo F. Padovan } __packed; 5801da177e4SLinus Torvalds 581a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 582a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 583a9de9248SMarcel Holtmann bdaddr_t bdaddr; 5849b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 58566c853ccSGustavo F. Padovan } __packed; 5861da177e4SLinus Torvalds 587a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 588a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 589a9de9248SMarcel Holtmann bdaddr_t bdaddr; 59066c853ccSGustavo F. Padovan } __packed; 5911da177e4SLinus Torvalds 592a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 593a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 594a9de9248SMarcel Holtmann bdaddr_t bdaddr; 595a9de9248SMarcel Holtmann __u8 pin_len; 596a9de9248SMarcel Holtmann __u8 pin_code[16]; 59766c853ccSGustavo F. Padovan } __packed; 598980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 599980e1a53SJohan Hedberg __u8 status; 600980e1a53SJohan Hedberg bdaddr_t bdaddr; 601980e1a53SJohan Hedberg } __packed; 602a9de9248SMarcel Holtmann 603a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 604a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 605a9de9248SMarcel Holtmann bdaddr_t bdaddr; 60666c853ccSGustavo F. Padovan } __packed; 607980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 608980e1a53SJohan Hedberg __u8 status; 609980e1a53SJohan Hedberg bdaddr_t bdaddr; 610980e1a53SJohan Hedberg } __packed; 611a9de9248SMarcel Holtmann 612a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 613a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 614a9de9248SMarcel Holtmann __le16 handle; 615a9de9248SMarcel Holtmann __le16 pkt_type; 61666c853ccSGustavo F. Padovan } __packed; 617a9de9248SMarcel Holtmann 618a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 619a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 620a9de9248SMarcel Holtmann __le16 handle; 62166c853ccSGustavo F. Padovan } __packed; 622a9de9248SMarcel Holtmann 623a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 624a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 625a9de9248SMarcel Holtmann __le16 handle; 626a9de9248SMarcel Holtmann __u8 encrypt; 62766c853ccSGustavo F. Padovan } __packed; 628a9de9248SMarcel Holtmann 629a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 630a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 631a9de9248SMarcel Holtmann __le16 handle; 63266c853ccSGustavo F. Padovan } __packed; 633a9de9248SMarcel Holtmann 634a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 635a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 636a9de9248SMarcel Holtmann bdaddr_t bdaddr; 637a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 638a9de9248SMarcel Holtmann __u8 pscan_mode; 639a9de9248SMarcel Holtmann __le16 clock_offset; 64066c853ccSGustavo F. Padovan } __packed; 641a9de9248SMarcel Holtmann 642a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 643a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 644a9de9248SMarcel Holtmann bdaddr_t bdaddr; 64566c853ccSGustavo F. Padovan } __packed; 646a9de9248SMarcel Holtmann 647a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 648a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 649a9de9248SMarcel Holtmann __le16 handle; 65066c853ccSGustavo F. Padovan } __packed; 651a9de9248SMarcel Holtmann 652a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 653a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 654a9de9248SMarcel Holtmann __le16 handle; 655a9de9248SMarcel Holtmann __u8 page; 65666c853ccSGustavo F. Padovan } __packed; 657a9de9248SMarcel Holtmann 658a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 659a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 660a9de9248SMarcel Holtmann __le16 handle; 66166c853ccSGustavo F. Padovan } __packed; 662a9de9248SMarcel Holtmann 663df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 664df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 665df935429SMarcel Holtmann __le16 handle; 666df935429SMarcel Holtmann } __packed; 667df935429SMarcel Holtmann 668a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 669a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 670a9de9248SMarcel Holtmann __le16 handle; 671a9de9248SMarcel Holtmann __le32 tx_bandwidth; 672a9de9248SMarcel Holtmann __le32 rx_bandwidth; 673a9de9248SMarcel Holtmann __le16 max_latency; 674a9de9248SMarcel Holtmann __le16 voice_setting; 675a9de9248SMarcel Holtmann __u8 retrans_effort; 676a9de9248SMarcel Holtmann __le16 pkt_type; 67766c853ccSGustavo F. Padovan } __packed; 678a9de9248SMarcel Holtmann 679a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 680a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 681a9de9248SMarcel Holtmann bdaddr_t bdaddr; 682a9de9248SMarcel Holtmann __le32 tx_bandwidth; 683a9de9248SMarcel Holtmann __le32 rx_bandwidth; 684a9de9248SMarcel Holtmann __le16 max_latency; 685a9de9248SMarcel Holtmann __le16 content_format; 686a9de9248SMarcel Holtmann __u8 retrans_effort; 687a9de9248SMarcel Holtmann __le16 pkt_type; 68866c853ccSGustavo F. Padovan } __packed; 689a9de9248SMarcel Holtmann 690a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 691a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 692a9de9248SMarcel Holtmann bdaddr_t bdaddr; 693a9de9248SMarcel Holtmann __u8 reason; 69466c853ccSGustavo F. Padovan } __packed; 695a9de9248SMarcel Holtmann 69617fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 69717fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 69817fa4b9dSJohan Hedberg bdaddr_t bdaddr; 69917fa4b9dSJohan Hedberg __u8 capability; 70017fa4b9dSJohan Hedberg __u8 oob_data; 70117fa4b9dSJohan Hedberg __u8 authentication; 70217fa4b9dSJohan Hedberg } __packed; 70317fa4b9dSJohan Hedberg 704a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 705a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 706a5c29683SJohan Hedberg bdaddr_t bdaddr; 707a5c29683SJohan Hedberg } __packed; 708a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 709a5c29683SJohan Hedberg __u8 status; 710a5c29683SJohan Hedberg bdaddr_t bdaddr; 711a5c29683SJohan Hedberg } __packed; 712a5c29683SJohan Hedberg 713a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 714a5c29683SJohan Hedberg 7159ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 7169ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 7179ad4019aSBrian Gix bdaddr_t bdaddr; 7189ad4019aSBrian Gix __le32 passkey; 7199ad4019aSBrian Gix } __packed; 7209ad4019aSBrian Gix 7219ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 7229ad4019aSBrian Gix 7232763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 7242763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 7252763eda6SSzymon Janc bdaddr_t bdaddr; 7262763eda6SSzymon Janc __u8 hash[16]; 72738da1703SJohan Hedberg __u8 rand[16]; 7282763eda6SSzymon Janc } __packed; 7292763eda6SSzymon Janc 7302763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 7312763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 7322763eda6SSzymon Janc bdaddr_t bdaddr; 7332763eda6SSzymon Janc } __packed; 7342763eda6SSzymon Janc 73503b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 73603b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 73703b555e1SJohan Hedberg bdaddr_t bdaddr; 73803b555e1SJohan Hedberg __u8 reason; 73903b555e1SJohan Hedberg } __packed; 74003b555e1SJohan Hedberg 741523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 742523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 743523e93cdSAndrei Emeltchenko __u8 phy_handle; 744523e93cdSAndrei Emeltchenko __u8 key_len; 745523e93cdSAndrei Emeltchenko __u8 key_type; 746523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 747523e93cdSAndrei Emeltchenko } __packed; 748523e93cdSAndrei Emeltchenko 749523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 750523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 751523e93cdSAndrei Emeltchenko __u8 phy_handle; 752523e93cdSAndrei Emeltchenko __u8 key_len; 753523e93cdSAndrei Emeltchenko __u8 key_type; 754523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 755523e93cdSAndrei Emeltchenko } __packed; 756523e93cdSAndrei Emeltchenko 757523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 758523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 759523e93cdSAndrei Emeltchenko __u8 phy_handle; 760523e93cdSAndrei Emeltchenko __u8 reason; 761b078b564SAndrei Emeltchenko } __packed; 762b078b564SAndrei Emeltchenko 763b078b564SAndrei Emeltchenko struct ext_flow_spec { 764b078b564SAndrei Emeltchenko __u8 id; 765b078b564SAndrei Emeltchenko __u8 stype; 766b078b564SAndrei Emeltchenko __le16 msdu; 767b078b564SAndrei Emeltchenko __le32 sdu_itime; 768b078b564SAndrei Emeltchenko __le32 acc_lat; 769b078b564SAndrei Emeltchenko __le32 flush_to; 770b078b564SAndrei Emeltchenko } __packed; 771b078b564SAndrei Emeltchenko 772b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 773b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 774b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 775b078b564SAndrei Emeltchenko __u8 phy_handle; 776b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 777b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 778b078b564SAndrei Emeltchenko } __packed; 779b078b564SAndrei Emeltchenko 780b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 781b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 782b078b564SAndrei Emeltchenko __le16 log_handle; 783b078b564SAndrei Emeltchenko } __packed; 784b078b564SAndrei Emeltchenko 785b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 786b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 787b078b564SAndrei Emeltchenko __u8 phy_handle; 788b078b564SAndrei Emeltchenko __u8 flow_spec_id; 789b078b564SAndrei Emeltchenko } __packed; 790b078b564SAndrei Emeltchenko 791b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 792b078b564SAndrei Emeltchenko __u8 status; 793b078b564SAndrei Emeltchenko __u8 phy_handle; 794b078b564SAndrei Emeltchenko __u8 flow_spec_id; 795523e93cdSAndrei Emeltchenko } __packed; 796523e93cdSAndrei Emeltchenko 7978c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 7988c9a041bSDoHyun Pyun struct hci_cp_set_csb { 7998c9a041bSDoHyun Pyun __u8 enable; 8008c9a041bSDoHyun Pyun __u8 lt_addr; 8018c9a041bSDoHyun Pyun __u8 lpo_allowed; 8028c9a041bSDoHyun Pyun __le16 packet_type; 8038c9a041bSDoHyun Pyun __le16 interval_min; 8048c9a041bSDoHyun Pyun __le16 interval_max; 8058c9a041bSDoHyun Pyun __le16 csb_sv_tout; 8068c9a041bSDoHyun Pyun } __packed; 8078c9a041bSDoHyun Pyun struct hci_rp_set_csb { 8088c9a041bSDoHyun Pyun __u8 status; 8098c9a041bSDoHyun Pyun __u8 lt_addr; 8108c9a041bSDoHyun Pyun __le16 interval; 8118c9a041bSDoHyun Pyun } __packed; 8128c9a041bSDoHyun Pyun 813cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 814cefded98SDoHyun Pyun 815e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 816e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 817e2f99131SMarcel Holtmann bdaddr_t bdaddr; 818e2f99131SMarcel Holtmann __u8 hash192[16]; 81938da1703SJohan Hedberg __u8 rand192[16]; 820e2f99131SMarcel Holtmann __u8 hash256[16]; 82138da1703SJohan Hedberg __u8 rand256[16]; 822e2f99131SMarcel Holtmann } __packed; 823e2f99131SMarcel Holtmann 824a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 825a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 826a9de9248SMarcel Holtmann __le16 handle; 827a9de9248SMarcel Holtmann __le16 max_interval; 828a9de9248SMarcel Holtmann __le16 min_interval; 829a9de9248SMarcel Holtmann __le16 attempt; 830a9de9248SMarcel Holtmann __le16 timeout; 83166c853ccSGustavo F. Padovan } __packed; 832a9de9248SMarcel Holtmann 833a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 834a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 835a9de9248SMarcel Holtmann __le16 handle; 83666c853ccSGustavo F. Padovan } __packed; 837a9de9248SMarcel Holtmann 838a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 839a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 840a9de9248SMarcel Holtmann __le16 handle; 84166c853ccSGustavo F. Padovan } __packed; 842a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 843a9de9248SMarcel Holtmann __u8 status; 844a9de9248SMarcel Holtmann __le16 handle; 845a9de9248SMarcel Holtmann __u8 role; 84666c853ccSGustavo F. Padovan } __packed; 847a9de9248SMarcel Holtmann 848a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 849a9de9248SMarcel Holtmann struct hci_cp_switch_role { 850a9de9248SMarcel Holtmann bdaddr_t bdaddr; 851a9de9248SMarcel Holtmann __u8 role; 85266c853ccSGustavo F. Padovan } __packed; 853a9de9248SMarcel Holtmann 854a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 855a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 856a9de9248SMarcel Holtmann __le16 handle; 85766c853ccSGustavo F. Padovan } __packed; 858a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 859a9de9248SMarcel Holtmann __u8 status; 860a9de9248SMarcel Holtmann __le16 handle; 861a9de9248SMarcel Holtmann __le16 policy; 86266c853ccSGustavo F. Padovan } __packed; 863a9de9248SMarcel Holtmann 864a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 865a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 866a9de9248SMarcel Holtmann __le16 handle; 867a9de9248SMarcel Holtmann __le16 policy; 86866c853ccSGustavo F. Padovan } __packed; 869a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 870a9de9248SMarcel Holtmann __u8 status; 871a9de9248SMarcel Holtmann __le16 handle; 87266c853ccSGustavo F. Padovan } __packed; 873a9de9248SMarcel Holtmann 874e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 875e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 876e4e8e37cSMarcel Holtmann __u8 status; 877e4e8e37cSMarcel Holtmann __le16 policy; 87866c853ccSGustavo F. Padovan } __packed; 879e4e8e37cSMarcel Holtmann 880e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 881e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 882e4e8e37cSMarcel Holtmann __le16 policy; 88366c853ccSGustavo F. Padovan } __packed; 884e4e8e37cSMarcel Holtmann 885a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 886a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 887a9de9248SMarcel Holtmann __le16 handle; 888a9de9248SMarcel Holtmann __le16 max_latency; 889a9de9248SMarcel Holtmann __le16 min_remote_timeout; 890a9de9248SMarcel Holtmann __le16 min_local_timeout; 89166c853ccSGustavo F. Padovan } __packed; 892a9de9248SMarcel Holtmann 893a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 894a9de9248SMarcel Holtmann 895a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 896a9de9248SMarcel Holtmann 897a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 8981da177e4SLinus Torvalds struct hci_cp_set_event_flt { 8991da177e4SLinus Torvalds __u8 flt_type; 9001da177e4SLinus Torvalds __u8 cond_type; 9011da177e4SLinus Torvalds __u8 condition[0]; 90266c853ccSGustavo F. Padovan } __packed; 9031da177e4SLinus Torvalds 9041da177e4SLinus Torvalds /* Filter types */ 9051da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 9061da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 9071da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 9081da177e4SLinus Torvalds 9091da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 9101da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 9111da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 9121da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 9131da177e4SLinus Torvalds 9141da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 9151da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 9161da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 9171da177e4SLinus Torvalds 918cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 919cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 920cb962780SMarcel Holtmann bdaddr_t bdaddr; 921cb962780SMarcel Holtmann __u8 read_all; 922cb962780SMarcel Holtmann } __packed; 923cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 924cb962780SMarcel Holtmann __u8 status; 925cb962780SMarcel Holtmann __u8 max_keys; 926cb962780SMarcel Holtmann __u8 num_keys; 927cb962780SMarcel Holtmann } __packed; 928cb962780SMarcel Holtmann 929b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 930b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 931b0916ea0SJohan Hedberg bdaddr_t bdaddr; 932b0916ea0SJohan Hedberg __u8 delete_all; 933b0916ea0SJohan Hedberg } __packed; 934039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 935039d4e41SMarcel Holtmann __u8 status; 936039d4e41SMarcel Holtmann __u8 num_keys; 937039d4e41SMarcel Holtmann } __packed; 938b0916ea0SJohan Hedberg 9391f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 9401f6c6378SJohan Hedberg 941a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 942a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 9431f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 94466c853ccSGustavo F. Padovan } __packed; 945a9de9248SMarcel Holtmann 946a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 947a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 948a9de9248SMarcel Holtmann __u8 status; 9491f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 95066c853ccSGustavo F. Padovan } __packed; 951a9de9248SMarcel Holtmann 952a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 953a9de9248SMarcel Holtmann 954a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 955a9de9248SMarcel Holtmann 956a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 957a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 958a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 959a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 960a9de9248SMarcel Holtmann 961a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 962a9de9248SMarcel Holtmann 963a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 964a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 965a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 966a9de9248SMarcel Holtmann 967a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 968a9de9248SMarcel Holtmann 969a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 970a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 971a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 972a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 973a9de9248SMarcel Holtmann 974a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 975a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 9761da177e4SLinus Torvalds __u8 status; 9771da177e4SLinus Torvalds __u8 dev_class[3]; 97866c853ccSGustavo F. Padovan } __packed; 9791da177e4SLinus Torvalds 980a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 981a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 9821da177e4SLinus Torvalds __u8 dev_class[3]; 98366c853ccSGustavo F. Padovan } __packed; 9841da177e4SLinus Torvalds 985a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 9861da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 9871da177e4SLinus Torvalds __u8 status; 9881ebb9252SMarcel Holtmann __le16 voice_setting; 98966c853ccSGustavo F. Padovan } __packed; 9901da177e4SLinus Torvalds 991a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 9921da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 9931ebb9252SMarcel Holtmann __le16 voice_setting; 99466c853ccSGustavo F. Padovan } __packed; 9951da177e4SLinus Torvalds 996a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 9971da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 9981ebb9252SMarcel Holtmann __le16 acl_mtu; 9991da177e4SLinus Torvalds __u8 sco_mtu; 10001ebb9252SMarcel Holtmann __le16 acl_max_pkt; 10011ebb9252SMarcel Holtmann __le16 sco_max_pkt; 100266c853ccSGustavo F. Padovan } __packed; 10031da177e4SLinus Torvalds 1004b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1005b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1006b4cb9fb2SMarcel Holtmann __u8 status; 1007b4cb9fb2SMarcel Holtmann __u8 num_iac; 1008b4cb9fb2SMarcel Holtmann } __packed; 1009b4cb9fb2SMarcel Holtmann 10104b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 10114b836f39SMarcel Holtmann 10123d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 10133d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 10143d505312SMarcel Holtmann __u8 num_iac; 10153d505312SMarcel Holtmann __u8 iac_lap[6]; 10163d505312SMarcel Holtmann } __packed; 10173d505312SMarcel Holtmann 1018d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1019d5859e22SJohan Hedberg 102080a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 102180a1e1dbSJohan Hedberg 102280a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 102380a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1024816a11d5SJohan Hedberg __u8 fec; 1025816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 102680a1e1dbSJohan Hedberg } __packed; 102780a1e1dbSJohan Hedberg 1028333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1029333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1030333140b5SMarcel Holtmann __u8 status; 1031333140b5SMarcel Holtmann __u8 mode; 103266c853ccSGustavo F. Padovan } __packed; 1033333140b5SMarcel Holtmann 1034333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1035333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1036333140b5SMarcel Holtmann __u8 mode; 103766c853ccSGustavo F. Padovan } __packed; 1038333140b5SMarcel Holtmann 1039c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1040c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1041c35938b2SSzymon Janc __u8 status; 1042c35938b2SSzymon Janc __u8 hash[16]; 104338da1703SJohan Hedberg __u8 rand[16]; 1044c35938b2SSzymon Janc } __packed; 1045c35938b2SSzymon Janc 1046d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 104791c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 104891c4e9b1SMarcel Holtmann __u8 status; 104991c4e9b1SMarcel Holtmann __s8 tx_power; 105091c4e9b1SMarcel Holtmann } __packed; 1051d5859e22SJohan Hedberg 1052d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1053d62e6d67SJohan Hedberg 10547528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 10557528ca1cSMarcel Holtmann 10561e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 10571e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 10581e89cffbSAndrei Emeltchenko __u8 status; 10591e89cffbSAndrei Emeltchenko __u8 mode; 10601e89cffbSAndrei Emeltchenko } __packed; 10611e89cffbSAndrei Emeltchenko 1062f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1063f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1064f9b49306SAndre Guedes __u8 le; 1065f9b49306SAndre Guedes __u8 simul; 1066f9b49306SAndre Guedes } __packed; 1067f9b49306SAndre Guedes 1068d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1069d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1070d0bf75a5SDoHyun Pyun __u8 lt_addr; 1071d0bf75a5SDoHyun Pyun } __packed; 1072d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1073d0bf75a5SDoHyun Pyun __u8 status; 1074d0bf75a5SDoHyun Pyun __u8 lt_addr; 1075d0bf75a5SDoHyun Pyun } __packed; 1076d0bf75a5SDoHyun Pyun 10776a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 10786a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 10796a20eaf4SDoHyun Pyun __u8 lt_addr; 10806a20eaf4SDoHyun Pyun } __packed; 10816a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 10826a20eaf4SDoHyun Pyun __u8 status; 10836a20eaf4SDoHyun Pyun __u8 lt_addr; 10846a20eaf4SDoHyun Pyun } __packed; 10856a20eaf4SDoHyun Pyun 10867d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 10877d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 10887d1dab49SDoHyun Pyun __u8 lt_addr; 10897d1dab49SDoHyun Pyun __u8 fragment; 10907d1dab49SDoHyun Pyun __u8 data_length; 10917d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 10927d1dab49SDoHyun Pyun } __packed; 10937d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 10947d1dab49SDoHyun Pyun __u8 status; 10957d1dab49SDoHyun Pyun __u8 lt_addr; 10967d1dab49SDoHyun Pyun } __packed; 10977d1dab49SDoHyun Pyun 10985d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 10995d4e7e8dSJohan Hedberg 1100a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1101a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1102a9b07a64SDoHyun Pyun __le16 interval_min; 1103a9b07a64SDoHyun Pyun __le16 interval_max; 1104a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1105a9b07a64SDoHyun Pyun __u8 service_data; 1106a9b07a64SDoHyun Pyun } __packed; 1107a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1108a9b07a64SDoHyun Pyun __u8 status; 1109a9b07a64SDoHyun Pyun __le16 sync_train_int; 1110a9b07a64SDoHyun Pyun } __packed; 1111a9b07a64SDoHyun Pyun 1112eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1113eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1114eb4b95c6SMarcel Holtmann __u8 status; 1115eb4b95c6SMarcel Holtmann __u8 support; 1116eb4b95c6SMarcel Holtmann } __packed; 1117eb4b95c6SMarcel Holtmann 1118eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1119eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1120eb4b95c6SMarcel Holtmann __u8 support; 1121eb4b95c6SMarcel Holtmann } __packed; 1122eb4b95c6SMarcel Holtmann 1123e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1124e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1125e2f99131SMarcel Holtmann __u8 status; 1126e2f99131SMarcel Holtmann __u8 hash192[16]; 112738da1703SJohan Hedberg __u8 rand192[16]; 1128e2f99131SMarcel Holtmann __u8 hash256[16]; 112938da1703SJohan Hedberg __u8 rand256[16]; 1130e2f99131SMarcel Holtmann } __packed; 1131e2f99131SMarcel Holtmann 1132a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1133a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 11341da177e4SLinus Torvalds __u8 status; 1135a9de9248SMarcel Holtmann __u8 hci_ver; 1136a9de9248SMarcel Holtmann __le16 hci_rev; 1137a9de9248SMarcel Holtmann __u8 lmp_ver; 1138a9de9248SMarcel Holtmann __le16 manufacturer; 1139a9de9248SMarcel Holtmann __le16 lmp_subver; 114066c853ccSGustavo F. Padovan } __packed; 11411da177e4SLinus Torvalds 1142a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1143a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 11441da177e4SLinus Torvalds __u8 status; 1145a9de9248SMarcel Holtmann __u8 commands[64]; 114666c853ccSGustavo F. Padovan } __packed; 11471da177e4SLinus Torvalds 1148a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1149a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1150a9de9248SMarcel Holtmann __u8 status; 1151a9de9248SMarcel Holtmann __u8 features[8]; 115266c853ccSGustavo F. Padovan } __packed; 1153a9de9248SMarcel Holtmann 1154a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1155971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1156971e3a4bSAndre Guedes __u8 page; 1157971e3a4bSAndre Guedes } __packed; 1158a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1159a9de9248SMarcel Holtmann __u8 status; 1160a9de9248SMarcel Holtmann __u8 page; 1161a9de9248SMarcel Holtmann __u8 max_page; 1162a9de9248SMarcel Holtmann __u8 features[8]; 116366c853ccSGustavo F. Padovan } __packed; 1164a9de9248SMarcel Holtmann 1165a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1166a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1167a9de9248SMarcel Holtmann __u8 status; 1168a9de9248SMarcel Holtmann __le16 acl_mtu; 1169a9de9248SMarcel Holtmann __u8 sco_mtu; 1170a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1171a9de9248SMarcel Holtmann __le16 sco_max_pkt; 117266c853ccSGustavo F. Padovan } __packed; 1173a9de9248SMarcel Holtmann 1174a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1175a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1176a9de9248SMarcel Holtmann __u8 status; 11771da177e4SLinus Torvalds bdaddr_t bdaddr; 117866c853ccSGustavo F. Padovan } __packed; 11791da177e4SLinus Torvalds 1180350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1181350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1182350ee4cfSAndrei Emeltchenko __u8 status; 1183350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1184350ee4cfSAndrei Emeltchenko __le16 block_len; 1185350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1186350ee4cfSAndrei Emeltchenko } __packed; 1187350ee4cfSAndrei Emeltchenko 1188109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1189109e3191SMarcel Holtmann 1190f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1191f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1192f332ec66SJohan Hedberg __u8 status; 1193f332ec66SJohan Hedberg __le16 interval; 1194f332ec66SJohan Hedberg __le16 window; 1195f332ec66SJohan Hedberg } __packed; 1196f332ec66SJohan Hedberg 1197f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1198f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1199f6422ec6SAntti Julku __le16 interval; 1200f6422ec6SAntti Julku __le16 window; 1201f6422ec6SAntti Julku } __packed; 1202f6422ec6SAntti Julku 12035a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 12045a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 12055a134faeSAndrzej Kaczmarek __le16 handle; 12065a134faeSAndrzej Kaczmarek __u8 type; 12075a134faeSAndrzej Kaczmarek } __packed; 12085a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 12095a134faeSAndrzej Kaczmarek __u8 status; 12105a134faeSAndrzej Kaczmarek __le16 handle; 12115a134faeSAndrzej Kaczmarek __s8 tx_power; 12125a134faeSAndrzej Kaczmarek } __packed; 12135a134faeSAndrzej Kaczmarek 1214f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1215f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1216f332ec66SJohan Hedberg __u8 status; 1217f332ec66SJohan Hedberg __u8 type; 1218f332ec66SJohan Hedberg } __packed; 1219f332ec66SJohan Hedberg 1220f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1221f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1222f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1223f6422ec6SAntti Julku 12245ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 12255ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 12265ae76a94SAndrzej Kaczmarek __le16 handle; 12275ae76a94SAndrzej Kaczmarek } __packed; 12285ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 12295ae76a94SAndrzej Kaczmarek __u8 status; 12305ae76a94SAndrzej Kaczmarek __le16 handle; 12315ae76a94SAndrzej Kaczmarek __s8 rssi; 12325ae76a94SAndrzej Kaczmarek } __packed; 12335ae76a94SAndrzej Kaczmarek 123433f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 123533f35721SJohan Hedberg struct hci_cp_read_clock { 123633f35721SJohan Hedberg __le16 handle; 123733f35721SJohan Hedberg __u8 which; 123833f35721SJohan Hedberg } __packed; 123933f35721SJohan Hedberg struct hci_rp_read_clock { 124033f35721SJohan Hedberg __u8 status; 124133f35721SJohan Hedberg __le16 handle; 124233f35721SJohan Hedberg __le32 clock; 124333f35721SJohan Hedberg __le16 accuracy; 124433f35721SJohan Hedberg } __packed; 124533f35721SJohan Hedberg 1246821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1247821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1248821f3766SJohan Hedberg __le16 handle; 1249821f3766SJohan Hedberg } __packed; 1250821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1251821f3766SJohan Hedberg __u8 status; 1252821f3766SJohan Hedberg __le16 handle; 1253821f3766SJohan Hedberg __u8 key_size; 1254821f3766SJohan Hedberg } __packed; 1255821f3766SJohan Hedberg 1256928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1257928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1258928abaa7SAndrei Emeltchenko __u8 status; 1259928abaa7SAndrei Emeltchenko __u8 amp_status; 1260928abaa7SAndrei Emeltchenko __le32 total_bw; 1261928abaa7SAndrei Emeltchenko __le32 max_bw; 1262928abaa7SAndrei Emeltchenko __le32 min_latency; 1263928abaa7SAndrei Emeltchenko __le32 max_pdu; 1264928abaa7SAndrei Emeltchenko __u8 amp_type; 1265928abaa7SAndrei Emeltchenko __le16 pal_cap; 1266928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1267928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1268928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1269928abaa7SAndrei Emeltchenko } __packed; 1270928abaa7SAndrei Emeltchenko 1271523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1272523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1273523e93cdSAndrei Emeltchenko __u8 phy_handle; 1274523e93cdSAndrei Emeltchenko __le16 len_so_far; 1275523e93cdSAndrei Emeltchenko __le16 max_len; 1276523e93cdSAndrei Emeltchenko } __packed; 1277523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1278523e93cdSAndrei Emeltchenko __u8 status; 1279523e93cdSAndrei Emeltchenko __u8 phy_handle; 1280523e93cdSAndrei Emeltchenko __le16 rem_len; 1281523e93cdSAndrei Emeltchenko __u8 frag[0]; 1282523e93cdSAndrei Emeltchenko } __packed; 1283523e93cdSAndrei Emeltchenko 1284523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1285523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1286523e93cdSAndrei Emeltchenko __u8 phy_handle; 1287523e93cdSAndrei Emeltchenko __le16 len_so_far; 1288523e93cdSAndrei Emeltchenko __le16 rem_len; 1289523e93cdSAndrei Emeltchenko __u8 frag[0]; 1290523e93cdSAndrei Emeltchenko } __packed; 1291523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1292523e93cdSAndrei Emeltchenko __u8 status; 1293523e93cdSAndrei Emeltchenko __u8 phy_handle; 1294523e93cdSAndrei Emeltchenko } __packed; 1295523e93cdSAndrei Emeltchenko 1296f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1297f4fe73edSMarcel Holtmann 12984b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 12994b4148e9SMarcel Holtmann 130006f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 130106f5b778SMarcel Holtmann 130263185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 130363185f64SVille Tervo struct hci_cp_le_set_event_mask { 130463185f64SVille Tervo __u8 mask[8]; 130563185f64SVille Tervo } __packed; 130663185f64SVille Tervo 130763185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 130863185f64SVille Tervo struct hci_rp_le_read_buffer_size { 130963185f64SVille Tervo __u8 status; 131063185f64SVille Tervo __le16 le_mtu; 131163185f64SVille Tervo __u8 le_max_pkt; 131263185f64SVille Tervo } __packed; 131363185f64SVille Tervo 131460e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 131560e77321SJohan Hedberg struct hci_rp_le_read_local_features { 131660e77321SJohan Hedberg __u8 status; 131760e77321SJohan Hedberg __u8 features[8]; 131860e77321SJohan Hedberg } __packed; 131960e77321SJohan Hedberg 1320d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1321d13eafceSMarcel Holtmann 13221e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 13231e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 13241e191893SMarcel Holtmann __le16 min_interval; 13251e191893SMarcel Holtmann __le16 max_interval; 13261e191893SMarcel Holtmann __u8 type; 13271e191893SMarcel Holtmann __u8 own_address_type; 13281e191893SMarcel Holtmann __u8 direct_addr_type; 13291e191893SMarcel Holtmann bdaddr_t direct_addr; 13301e191893SMarcel Holtmann __u8 channel_map; 13311e191893SMarcel Holtmann __u8 filter_policy; 13321e191893SMarcel Holtmann } __packed; 13331e191893SMarcel Holtmann 13348fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 13358fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 13368fa19098SJohan Hedberg __u8 status; 13378fa19098SJohan Hedberg __s8 tx_power; 13388fa19098SJohan Hedberg } __packed; 13398fa19098SJohan Hedberg 13403f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 13413f0f524bSJohan Hedberg 13423f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 13433f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 13443f0f524bSJohan Hedberg __u8 length; 13453f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 13463f0f524bSJohan Hedberg } __packed; 13473f0f524bSJohan Hedberg 1348f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1349f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1350f14d8f64SMarcel Holtmann __u8 length; 1351f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1352f14d8f64SMarcel Holtmann } __packed; 1353f14d8f64SMarcel Holtmann 1354c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1355c1d5dc4aSJohan Hedberg 13565df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 13575df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 13585df480b5SAndre Guedes 135907f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 136007f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 136107f7fa5dSAndre Guedes __u8 type; 136207f7fa5dSAndre Guedes __le16 interval; 136307f7fa5dSAndre Guedes __le16 window; 136407f7fa5dSAndre Guedes __u8 own_address_type; 136507f7fa5dSAndre Guedes __u8 filter_policy; 136607f7fa5dSAndre Guedes } __packed; 136707f7fa5dSAndre Guedes 136876a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 136976a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1370525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1371525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 137268a8aea4SAndrei Emeltchenko 1373eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1374eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1375eb9d91f5SAndre Guedes __u8 enable; 1376eb9d91f5SAndre Guedes __u8 filter_dup; 1377eb9d91f5SAndre Guedes } __packed; 1378eb9d91f5SAndre Guedes 1379a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1380a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1381a7139eddSJohan Hedberg 138263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 138363185f64SVille Tervo struct hci_cp_le_create_conn { 138463185f64SVille Tervo __le16 scan_interval; 138563185f64SVille Tervo __le16 scan_window; 138663185f64SVille Tervo __u8 filter_policy; 138763185f64SVille Tervo __u8 peer_addr_type; 138863185f64SVille Tervo bdaddr_t peer_addr; 138963185f64SVille Tervo __u8 own_address_type; 139063185f64SVille Tervo __le16 conn_interval_min; 139163185f64SVille Tervo __le16 conn_interval_max; 139263185f64SVille Tervo __le16 conn_latency; 139363185f64SVille Tervo __le16 supervision_timeout; 139463185f64SVille Tervo __le16 min_ce_len; 139563185f64SVille Tervo __le16 max_ce_len; 139663185f64SVille Tervo } __packed; 139763185f64SVille Tervo 139863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 139963185f64SVille Tervo 1400cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1401cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1402cf1d081fSJohan Hedberg __u8 status; 1403cf1d081fSJohan Hedberg __u8 size; 1404cf1d081fSJohan Hedberg } __packed; 1405cf1d081fSJohan Hedberg 1406d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1407d9a7b0a5SMarcel Holtmann 1408d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1409d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1410d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1411d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1412d9a7b0a5SMarcel Holtmann } __packed; 1413d9a7b0a5SMarcel Holtmann 1414d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1415d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1416d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1417d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1418d9a7b0a5SMarcel Holtmann } __packed; 1419d9a7b0a5SMarcel Holtmann 14202ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 14212ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 14222ce603ebSClaudio Takahasi __le16 handle; 14232ce603ebSClaudio Takahasi __le16 conn_interval_min; 14242ce603ebSClaudio Takahasi __le16 conn_interval_max; 14252ce603ebSClaudio Takahasi __le16 conn_latency; 14262ce603ebSClaudio Takahasi __le16 supervision_timeout; 14272ce603ebSClaudio Takahasi __le16 min_ce_len; 14282ce603ebSClaudio Takahasi __le16 max_ce_len; 14292ce603ebSClaudio Takahasi } __packed; 14302ce603ebSClaudio Takahasi 14310fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 14320fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 14330fe29fd1SMarcel Holtmann __le16 handle; 14340fe29fd1SMarcel Holtmann } __packed; 14350fe29fd1SMarcel Holtmann 1436a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1437a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1438a7a595f6SVinicius Costa Gomes __le16 handle; 1439fe39c7b2SMarcel Holtmann __le64 rand; 1440a7a595f6SVinicius Costa Gomes __le16 ediv; 1441a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1442a7a595f6SVinicius Costa Gomes } __packed; 1443a7a595f6SVinicius Costa Gomes 1444a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1445a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1446a7a595f6SVinicius Costa Gomes __le16 handle; 1447a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1448a7a595f6SVinicius Costa Gomes } __packed; 1449a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1450a7a595f6SVinicius Costa Gomes __u8 status; 1451a7a595f6SVinicius Costa Gomes __le16 handle; 1452a7a595f6SVinicius Costa Gomes } __packed; 1453a7a595f6SVinicius Costa Gomes 1454a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1455a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1456a7a595f6SVinicius Costa Gomes __le16 handle; 1457a7a595f6SVinicius Costa Gomes } __packed; 1458a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1459a7a595f6SVinicius Costa Gomes __u8 status; 1460a7a595f6SVinicius Costa Gomes __le16 handle; 1461a7a595f6SVinicius Costa Gomes } __packed; 1462a7a595f6SVinicius Costa Gomes 14639b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 14649b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 14659b008c04SJohan Hedberg __u8 status; 14669b008c04SJohan Hedberg __u8 le_states[8]; 14679b008c04SJohan Hedberg } __packed; 14689b008c04SJohan Hedberg 14698e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 14708e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 14718e75b46aSAndre Guedes __le16 handle; 14728e75b46aSAndre Guedes __le16 interval_min; 14738e75b46aSAndre Guedes __le16 interval_max; 14748e75b46aSAndre Guedes __le16 latency; 14758e75b46aSAndre Guedes __le16 timeout; 14768e75b46aSAndre Guedes __le16 min_ce_len; 14778e75b46aSAndre Guedes __le16 max_ce_len; 14788e75b46aSAndre Guedes } __packed; 14798e75b46aSAndre Guedes 14808e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 14818e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 14828e75b46aSAndre Guedes __le16 handle; 14838e75b46aSAndre Guedes __u8 reason; 14848e75b46aSAndre Guedes } __packed; 14858e75b46aSAndre Guedes 148694a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 148794a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 148894a3bd02SMarcel Holtmann __le16 handle; 148994a3bd02SMarcel Holtmann __le16 tx_len; 149094a3bd02SMarcel Holtmann __le16 tx_time; 149194a3bd02SMarcel Holtmann } __packed; 149294a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 149394a3bd02SMarcel Holtmann __u8 status; 149494a3bd02SMarcel Holtmann __le16 handle; 149594a3bd02SMarcel Holtmann } __packed; 149694a3bd02SMarcel Holtmann 149794a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 149894a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 149994a3bd02SMarcel Holtmann __u8 status; 150094a3bd02SMarcel Holtmann __le16 tx_len; 150194a3bd02SMarcel Holtmann __le16 tx_time; 150294a3bd02SMarcel Holtmann } __packed; 150394a3bd02SMarcel Holtmann 150494a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 150594a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 150694a3bd02SMarcel Holtmann __le16 tx_len; 150794a3bd02SMarcel Holtmann __le16 tx_time; 150894a3bd02SMarcel Holtmann } __packed; 150994a3bd02SMarcel Holtmann 1510545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1511545f2596SAnkit Navik 1512cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1513cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1514cfdb0c2dSAnkit Navik __u8 status; 1515cfdb0c2dSAnkit Navik __u8 size; 1516cfdb0c2dSAnkit Navik } __packed; 1517cfdb0c2dSAnkit Navik 151894a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 151994a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 152094a3bd02SMarcel Holtmann __u8 status; 152194a3bd02SMarcel Holtmann __le16 tx_len; 152294a3bd02SMarcel Holtmann __le16 tx_time; 152394a3bd02SMarcel Holtmann __le16 rx_len; 152494a3bd02SMarcel Holtmann __le16 rx_time; 152594a3bd02SMarcel Holtmann } __packed; 152694a3bd02SMarcel Holtmann 1527de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1528de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1529de2ba303SMarcel Holtmann __u8 all_phys; 1530de2ba303SMarcel Holtmann __u8 tx_phys; 1531de2ba303SMarcel Holtmann __u8 rx_phys; 1532de2ba303SMarcel Holtmann } __packed; 1533de2ba303SMarcel Holtmann 15346decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 15356decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 15366decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 15376decb5b4SJaganath Kanakkassery 1538a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1539a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1540a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1541a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1542a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1543a2344b9eSJaganath Kanakkassery __u8 data[0]; 1544a2344b9eSJaganath Kanakkassery } __packed; 1545a2344b9eSJaganath Kanakkassery 1546a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 154745bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 154845bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1549a2344b9eSJaganath Kanakkassery 1550a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1551a2344b9eSJaganath Kanakkassery __u8 type; 1552a2344b9eSJaganath Kanakkassery __le16 interval; 1553a2344b9eSJaganath Kanakkassery __le16 window; 1554a2344b9eSJaganath Kanakkassery } __packed; 1555a2344b9eSJaganath Kanakkassery 1556a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1557a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1558a2344b9eSJaganath Kanakkassery __u8 enable; 1559a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1560a2344b9eSJaganath Kanakkassery __le16 duration; 1561a2344b9eSJaganath Kanakkassery __le16 period; 1562a2344b9eSJaganath Kanakkassery } __packed; 1563a2344b9eSJaganath Kanakkassery 15644d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 15654d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 15664d94f95dSJaganath Kanakkassery __u8 filter_policy; 15674d94f95dSJaganath Kanakkassery __u8 own_addr_type; 15684d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 15694d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 15704d94f95dSJaganath Kanakkassery __u8 phys; 15714d94f95dSJaganath Kanakkassery __u8 data[0]; 15724d94f95dSJaganath Kanakkassery } __packed; 15734d94f95dSJaganath Kanakkassery 15744d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 15754d94f95dSJaganath Kanakkassery __le16 scan_interval; 15764d94f95dSJaganath Kanakkassery __le16 scan_window; 15774d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 15784d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 15794d94f95dSJaganath Kanakkassery __le16 conn_latency; 15804d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 15814d94f95dSJaganath Kanakkassery __le16 min_ce_len; 15824d94f95dSJaganath Kanakkassery __le16 max_ce_len; 15834d94f95dSJaganath Kanakkassery } __packed; 15844d94f95dSJaganath Kanakkassery 15856b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 15866b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 15876b49bcb4SJaganath Kanakkassery __u8 status; 15886b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 15896b49bcb4SJaganath Kanakkassery } __packed; 15906b49bcb4SJaganath Kanakkassery 1591de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1592de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1593de181e88SJaganath Kanakkassery __u8 handle; 1594de181e88SJaganath Kanakkassery __le16 evt_properties; 1595de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1596de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1597de181e88SJaganath Kanakkassery __u8 channel_map; 1598de181e88SJaganath Kanakkassery __u8 own_addr_type; 1599de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1600de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1601de181e88SJaganath Kanakkassery __u8 filter_policy; 1602de181e88SJaganath Kanakkassery __u8 tx_power; 1603de181e88SJaganath Kanakkassery __u8 primary_phy; 1604de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1605de181e88SJaganath Kanakkassery __u8 secondary_phy; 1606de181e88SJaganath Kanakkassery __u8 sid; 1607de181e88SJaganath Kanakkassery __u8 notif_enable; 1608de181e88SJaganath Kanakkassery } __packed; 1609de181e88SJaganath Kanakkassery 1610de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 1611*85a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 1612*85a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1613de181e88SJaganath Kanakkassery 1614de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1615de181e88SJaganath Kanakkassery __u8 status; 1616de181e88SJaganath Kanakkassery __u8 tx_power; 1617de181e88SJaganath Kanakkassery } __packed; 1618de181e88SJaganath Kanakkassery 1619de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1620de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1621de181e88SJaganath Kanakkassery __u8 enable; 1622de181e88SJaganath Kanakkassery __u8 num_of_sets; 1623de181e88SJaganath Kanakkassery __u8 data[0]; 1624de181e88SJaganath Kanakkassery } __packed; 1625de181e88SJaganath Kanakkassery 1626de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1627de181e88SJaganath Kanakkassery __u8 handle; 1628de181e88SJaganath Kanakkassery __le16 duration; 1629de181e88SJaganath Kanakkassery __u8 max_events; 1630de181e88SJaganath Kanakkassery } __packed; 1631de181e88SJaganath Kanakkassery 1632a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1633a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1634a0fb3726SJaganath Kanakkassery __u8 handle; 1635a0fb3726SJaganath Kanakkassery __u8 operation; 1636a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1637a0fb3726SJaganath Kanakkassery __u8 length; 1638a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1639a0fb3726SJaganath Kanakkassery } __packed; 1640a0fb3726SJaganath Kanakkassery 1641a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1642a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1643a0fb3726SJaganath Kanakkassery __u8 handle; 1644a0fb3726SJaganath Kanakkassery __u8 operation; 1645a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1646a0fb3726SJaganath Kanakkassery __u8 length; 1647a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1648a0fb3726SJaganath Kanakkassery } __packed; 1649a0fb3726SJaganath Kanakkassery 1650a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1651a0fb3726SJaganath Kanakkassery 1652a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1653a0fb3726SJaganath Kanakkassery 165445b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 165545b7749fSJaganath Kanakkassery 1656a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1657a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1658a73c046aSJaganath Kanakkassery __u8 handle; 1659a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1660a73c046aSJaganath Kanakkassery } __packed; 1661a73c046aSJaganath Kanakkassery 16621da177e4SLinus Torvalds /* ---- HCI Events ---- */ 16631da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 16641da177e4SLinus Torvalds 16651da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 16661da177e4SLinus Torvalds struct inquiry_info { 16671da177e4SLinus Torvalds bdaddr_t bdaddr; 16681da177e4SLinus Torvalds __u8 pscan_rep_mode; 16691da177e4SLinus Torvalds __u8 pscan_period_mode; 16701da177e4SLinus Torvalds __u8 pscan_mode; 16711da177e4SLinus Torvalds __u8 dev_class[3]; 16721ebb9252SMarcel Holtmann __le16 clock_offset; 167366c853ccSGustavo F. Padovan } __packed; 16741da177e4SLinus Torvalds 16751da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 16761da177e4SLinus Torvalds struct hci_ev_conn_complete { 16771da177e4SLinus Torvalds __u8 status; 16781ebb9252SMarcel Holtmann __le16 handle; 16791da177e4SLinus Torvalds bdaddr_t bdaddr; 16801da177e4SLinus Torvalds __u8 link_type; 16811da177e4SLinus Torvalds __u8 encr_mode; 168266c853ccSGustavo F. Padovan } __packed; 16831da177e4SLinus Torvalds 16841da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 16851da177e4SLinus Torvalds struct hci_ev_conn_request { 16861da177e4SLinus Torvalds bdaddr_t bdaddr; 16871da177e4SLinus Torvalds __u8 dev_class[3]; 16881da177e4SLinus Torvalds __u8 link_type; 168966c853ccSGustavo F. Padovan } __packed; 16901da177e4SLinus Torvalds 16911da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 16921da177e4SLinus Torvalds struct hci_ev_disconn_complete { 16931da177e4SLinus Torvalds __u8 status; 16941ebb9252SMarcel Holtmann __le16 handle; 16951da177e4SLinus Torvalds __u8 reason; 169666c853ccSGustavo F. Padovan } __packed; 16971da177e4SLinus Torvalds 16981da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 16991da177e4SLinus Torvalds struct hci_ev_auth_complete { 17001da177e4SLinus Torvalds __u8 status; 17011ebb9252SMarcel Holtmann __le16 handle; 170266c853ccSGustavo F. Padovan } __packed; 17031da177e4SLinus Torvalds 1704a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1705a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1706a9de9248SMarcel Holtmann __u8 status; 1707a9de9248SMarcel Holtmann bdaddr_t bdaddr; 17081f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 170966c853ccSGustavo F. Padovan } __packed; 1710a9de9248SMarcel Holtmann 17111da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 17121da177e4SLinus Torvalds struct hci_ev_encrypt_change { 17131da177e4SLinus Torvalds __u8 status; 17141ebb9252SMarcel Holtmann __le16 handle; 17151da177e4SLinus Torvalds __u8 encrypt; 171666c853ccSGustavo F. Padovan } __packed; 17171da177e4SLinus Torvalds 1718a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1719a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 17201da177e4SLinus Torvalds __u8 status; 17211ebb9252SMarcel Holtmann __le16 handle; 172266c853ccSGustavo F. Padovan } __packed; 17231da177e4SLinus Torvalds 1724a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1725a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1726a9de9248SMarcel Holtmann __u8 status; 1727a9de9248SMarcel Holtmann __le16 handle; 1728a9de9248SMarcel Holtmann __u8 features[8]; 172966c853ccSGustavo F. Padovan } __packed; 1730a9de9248SMarcel Holtmann 1731a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1732a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1733a9de9248SMarcel Holtmann __u8 status; 1734a9de9248SMarcel Holtmann __le16 handle; 1735a9de9248SMarcel Holtmann __u8 lmp_ver; 1736a9de9248SMarcel Holtmann __le16 manufacturer; 1737a9de9248SMarcel Holtmann __le16 lmp_subver; 173866c853ccSGustavo F. Padovan } __packed; 1739a9de9248SMarcel Holtmann 1740a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 17411da177e4SLinus Torvalds struct hci_qos { 17421da177e4SLinus Torvalds __u8 service_type; 17431da177e4SLinus Torvalds __u32 token_rate; 17441da177e4SLinus Torvalds __u32 peak_bandwidth; 17451da177e4SLinus Torvalds __u32 latency; 17461da177e4SLinus Torvalds __u32 delay_variation; 174766c853ccSGustavo F. Padovan } __packed; 17481da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 17491da177e4SLinus Torvalds __u8 status; 17501ebb9252SMarcel Holtmann __le16 handle; 17511da177e4SLinus Torvalds struct hci_qos qos; 175266c853ccSGustavo F. Padovan } __packed; 17531da177e4SLinus Torvalds 1754a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 17551da177e4SLinus Torvalds struct hci_ev_cmd_complete { 17561da177e4SLinus Torvalds __u8 ncmd; 17571ebb9252SMarcel Holtmann __le16 opcode; 175866c853ccSGustavo F. Padovan } __packed; 17591da177e4SLinus Torvalds 1760a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 17611da177e4SLinus Torvalds struct hci_ev_cmd_status { 17621da177e4SLinus Torvalds __u8 status; 17631da177e4SLinus Torvalds __u8 ncmd; 17641ebb9252SMarcel Holtmann __le16 opcode; 176566c853ccSGustavo F. Padovan } __packed; 17661da177e4SLinus Torvalds 176724dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 176824dfa343SMarcel Holtmann struct hci_ev_hardware_error { 176924dfa343SMarcel Holtmann __u8 code; 177024dfa343SMarcel Holtmann } __packed; 177124dfa343SMarcel Holtmann 17721da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 17731da177e4SLinus Torvalds struct hci_ev_role_change { 17741da177e4SLinus Torvalds __u8 status; 17751da177e4SLinus Torvalds bdaddr_t bdaddr; 17761da177e4SLinus Torvalds __u8 role; 177766c853ccSGustavo F. Padovan } __packed; 17781da177e4SLinus Torvalds 1779a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 1780613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 1781613a1c0cSAndrei Emeltchenko __le16 handle; 1782613a1c0cSAndrei Emeltchenko __le16 count; 1783613a1c0cSAndrei Emeltchenko } __packed; 1784613a1c0cSAndrei Emeltchenko 1785a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 1786a9de9248SMarcel Holtmann __u8 num_hndl; 1787613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info handles[0]; 178866c853ccSGustavo F. Padovan } __packed; 1789a9de9248SMarcel Holtmann 17901da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 17911da177e4SLinus Torvalds struct hci_ev_mode_change { 17921da177e4SLinus Torvalds __u8 status; 17931ebb9252SMarcel Holtmann __le16 handle; 17941da177e4SLinus Torvalds __u8 mode; 17951ebb9252SMarcel Holtmann __le16 interval; 179666c853ccSGustavo F. Padovan } __packed; 17971da177e4SLinus Torvalds 17981da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 17991da177e4SLinus Torvalds struct hci_ev_pin_code_req { 18001da177e4SLinus Torvalds bdaddr_t bdaddr; 180166c853ccSGustavo F. Padovan } __packed; 18021da177e4SLinus Torvalds 18031da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 18041da177e4SLinus Torvalds struct hci_ev_link_key_req { 18051da177e4SLinus Torvalds bdaddr_t bdaddr; 180666c853ccSGustavo F. Padovan } __packed; 18071da177e4SLinus Torvalds 18081da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 18091da177e4SLinus Torvalds struct hci_ev_link_key_notify { 18101da177e4SLinus Torvalds bdaddr_t bdaddr; 18119b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 18121da177e4SLinus Torvalds __u8 key_type; 181366c853ccSGustavo F. Padovan } __packed; 18141da177e4SLinus Torvalds 1815a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 18161da177e4SLinus Torvalds struct hci_ev_clock_offset { 18171da177e4SLinus Torvalds __u8 status; 18181ebb9252SMarcel Holtmann __le16 handle; 18191ebb9252SMarcel Holtmann __le16 clock_offset; 182066c853ccSGustavo F. Padovan } __packed; 18211da177e4SLinus Torvalds 1822a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 1823a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 1824a8746417SMarcel Holtmann __u8 status; 1825a8746417SMarcel Holtmann __le16 handle; 1826a8746417SMarcel Holtmann __le16 pkt_type; 182766c853ccSGustavo F. Padovan } __packed; 1828a8746417SMarcel Holtmann 182985a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 183085a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 183185a1e930SMarcel Holtmann bdaddr_t bdaddr; 183285a1e930SMarcel Holtmann __u8 pscan_rep_mode; 183366c853ccSGustavo F. Padovan } __packed; 183485a1e930SMarcel Holtmann 1835a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 1836a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 1837a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1838a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1839a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1840a9de9248SMarcel Holtmann __u8 dev_class[3]; 1841a9de9248SMarcel Holtmann __le16 clock_offset; 1842a9de9248SMarcel Holtmann __s8 rssi; 184366c853ccSGustavo F. Padovan } __packed; 1844a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 1845a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1846a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1847a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1848a9de9248SMarcel Holtmann __u8 pscan_mode; 1849a9de9248SMarcel Holtmann __u8 dev_class[3]; 1850a9de9248SMarcel Holtmann __le16 clock_offset; 1851a9de9248SMarcel Holtmann __s8 rssi; 185266c853ccSGustavo F. Padovan } __packed; 1853a9de9248SMarcel Holtmann 1854a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 1855a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 1856a9de9248SMarcel Holtmann __u8 status; 1857a9de9248SMarcel Holtmann __le16 handle; 1858a9de9248SMarcel Holtmann __u8 page; 1859a9de9248SMarcel Holtmann __u8 max_page; 1860a9de9248SMarcel Holtmann __u8 features[8]; 186166c853ccSGustavo F. Padovan } __packed; 1862a9de9248SMarcel Holtmann 1863a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 1864a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 1865a9de9248SMarcel Holtmann __u8 status; 1866a9de9248SMarcel Holtmann __le16 handle; 1867a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1868a9de9248SMarcel Holtmann __u8 link_type; 1869a9de9248SMarcel Holtmann __u8 tx_interval; 1870a9de9248SMarcel Holtmann __u8 retrans_window; 1871a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1872a9de9248SMarcel Holtmann __le16 tx_pkt_len; 1873a9de9248SMarcel Holtmann __u8 air_mode; 187466c853ccSGustavo F. Padovan } __packed; 1875a9de9248SMarcel Holtmann 1876a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 1877a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 1878a9de9248SMarcel Holtmann __u8 status; 1879a9de9248SMarcel Holtmann __le16 handle; 1880a9de9248SMarcel Holtmann __u8 tx_interval; 1881a9de9248SMarcel Holtmann __u8 retrans_window; 1882a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1883a9de9248SMarcel Holtmann __le16 tx_pkt_len; 188466c853ccSGustavo F. Padovan } __packed; 1885a9de9248SMarcel Holtmann 1886a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 188704837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 188804837f64SMarcel Holtmann __u8 status; 188904837f64SMarcel Holtmann __le16 handle; 189004837f64SMarcel Holtmann __le16 max_tx_latency; 189104837f64SMarcel Holtmann __le16 max_rx_latency; 189204837f64SMarcel Holtmann __le16 max_remote_timeout; 189304837f64SMarcel Holtmann __le16 max_local_timeout; 189466c853ccSGustavo F. Padovan } __packed; 189504837f64SMarcel Holtmann 1896a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 1897a9de9248SMarcel Holtmann struct extended_inquiry_info { 1898a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1899a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1900a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1901a9de9248SMarcel Holtmann __u8 dev_class[3]; 1902a9de9248SMarcel Holtmann __le16 clock_offset; 1903a9de9248SMarcel Holtmann __s8 rssi; 1904a9de9248SMarcel Holtmann __u8 data[240]; 190566c853ccSGustavo F. Padovan } __packed; 1906a9de9248SMarcel Holtmann 19071c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 19081c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 19091c2e0041SJohan Hedberg __u8 status; 19101c2e0041SJohan Hedberg __le16 handle; 19111c2e0041SJohan Hedberg } __packed; 19121c2e0041SJohan Hedberg 19130493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 19140493684eSMarcel Holtmann struct hci_ev_io_capa_request { 19150493684eSMarcel Holtmann bdaddr_t bdaddr; 191666c853ccSGustavo F. Padovan } __packed; 19170493684eSMarcel Holtmann 191803b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 191903b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 192003b555e1SJohan Hedberg bdaddr_t bdaddr; 192103b555e1SJohan Hedberg __u8 capability; 192203b555e1SJohan Hedberg __u8 oob_data; 192303b555e1SJohan Hedberg __u8 authentication; 192403b555e1SJohan Hedberg } __packed; 192503b555e1SJohan Hedberg 1926a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 1927a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 1928a5c29683SJohan Hedberg bdaddr_t bdaddr; 1929a5c29683SJohan Hedberg __le32 passkey; 1930a5c29683SJohan Hedberg } __packed; 1931a5c29683SJohan Hedberg 19329ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 19339ad4019aSBrian Gix struct hci_ev_user_passkey_req { 19349ad4019aSBrian Gix bdaddr_t bdaddr; 19359ad4019aSBrian Gix } __packed; 19369ad4019aSBrian Gix 19372763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 19382763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 19392763eda6SSzymon Janc bdaddr_t bdaddr; 19402763eda6SSzymon Janc } __packed; 19412763eda6SSzymon Janc 19420493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 19430493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 19440493684eSMarcel Holtmann __u8 status; 19450493684eSMarcel Holtmann bdaddr_t bdaddr; 194666c853ccSGustavo F. Padovan } __packed; 19470493684eSMarcel Holtmann 194892a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 194992a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 195092a25256SJohan Hedberg bdaddr_t bdaddr; 195192a25256SJohan Hedberg __le32 passkey; 195292a25256SJohan Hedberg } __packed; 195392a25256SJohan Hedberg 195492a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 195592a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 195692a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 195792a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 195892a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 195992a25256SJohan Hedberg 196092a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 196192a25256SJohan Hedberg struct hci_ev_keypress_notify { 196292a25256SJohan Hedberg bdaddr_t bdaddr; 196392a25256SJohan Hedberg __u8 type; 196492a25256SJohan Hedberg } __packed; 196592a25256SJohan Hedberg 196641a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 196741a96212SMarcel Holtmann struct hci_ev_remote_host_features { 196841a96212SMarcel Holtmann bdaddr_t bdaddr; 196941a96212SMarcel Holtmann __u8 features[8]; 197066c853ccSGustavo F. Padovan } __packed; 197141a96212SMarcel Holtmann 197263185f64SVille Tervo #define HCI_EV_LE_META 0x3e 197363185f64SVille Tervo struct hci_ev_le_meta { 197463185f64SVille Tervo __u8 subevent; 197563185f64SVille Tervo } __packed; 197663185f64SVille Tervo 1977523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 1978523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 1979523e93cdSAndrei Emeltchenko __u8 status; 1980523e93cdSAndrei Emeltchenko __u8 phy_handle; 1981523e93cdSAndrei Emeltchenko } __packed; 1982523e93cdSAndrei Emeltchenko 1983523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 1984523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 1985523e93cdSAndrei Emeltchenko __u8 phy_handle; 1986523e93cdSAndrei Emeltchenko } __packed; 1987523e93cdSAndrei Emeltchenko 1988523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 1989523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 1990523e93cdSAndrei Emeltchenko __u8 status; 1991523e93cdSAndrei Emeltchenko __u8 phy_handle; 1992523e93cdSAndrei Emeltchenko __u8 reason; 1993523e93cdSAndrei Emeltchenko } __packed; 1994523e93cdSAndrei Emeltchenko 1995523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 1996523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 1997523e93cdSAndrei Emeltchenko __u8 status; 1998523e93cdSAndrei Emeltchenko __le16 handle; 1999523e93cdSAndrei Emeltchenko __u8 phy_handle; 2000523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2001523e93cdSAndrei Emeltchenko } __packed; 2002523e93cdSAndrei Emeltchenko 2003523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2004523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2005523e93cdSAndrei Emeltchenko __u8 status; 2006523e93cdSAndrei Emeltchenko __le16 handle; 2007523e93cdSAndrei Emeltchenko __u8 reason; 2008523e93cdSAndrei Emeltchenko } __packed; 2009523e93cdSAndrei Emeltchenko 201025e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 201125e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 201225e89e99SAndrei Emeltchenko __le16 handle; 201325e89e99SAndrei Emeltchenko __le16 pkts; 201425e89e99SAndrei Emeltchenko __le16 blocks; 201525e89e99SAndrei Emeltchenko } __packed; 201625e89e99SAndrei Emeltchenko 201725e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 201825e89e99SAndrei Emeltchenko __le16 num_blocks; 201925e89e99SAndrei Emeltchenko __u8 num_hndl; 202025e89e99SAndrei Emeltchenko struct hci_comp_blocks_info handles[0]; 202125e89e99SAndrei Emeltchenko } __packed; 202225e89e99SAndrei Emeltchenko 20232b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 20242b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 20252b359445SDoHyun Pyun __u8 status; 20262b359445SDoHyun Pyun } __packed; 20272b359445SDoHyun Pyun 20282ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 20292ed01805SDoHyun Pyun 203063185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 203163185f64SVille Tervo struct hci_ev_le_conn_complete { 203263185f64SVille Tervo __u8 status; 203363185f64SVille Tervo __le16 handle; 203463185f64SVille Tervo __u8 role; 203563185f64SVille Tervo __u8 bdaddr_type; 203663185f64SVille Tervo bdaddr_t bdaddr; 203763185f64SVille Tervo __le16 interval; 203863185f64SVille Tervo __le16 latency; 203963185f64SVille Tervo __le16 supervision_timeout; 204063185f64SVille Tervo __u8 clk_accurancy; 204163185f64SVille Tervo } __packed; 204263185f64SVille Tervo 20432331fd46SMarcel Holtmann /* Advertising report event types */ 20442331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 20452331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 20462331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 20472331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 20482331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2049c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2050c215e939SJaganath Kanakkassery 2051c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2052c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2053c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2054c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2055c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2056c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2057c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 20582331fd46SMarcel Holtmann 2059b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2060b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2061b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2062b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2063b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2064b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2065b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2066b2cc9761SJaganath Kanakkassery 20672331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 20682331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 20692331fd46SMarcel Holtmann 20702331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 20712331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 20722331fd46SMarcel Holtmann __u8 evt_type; 20732331fd46SMarcel Holtmann __u8 bdaddr_type; 20742331fd46SMarcel Holtmann bdaddr_t bdaddr; 20752331fd46SMarcel Holtmann __u8 length; 20762331fd46SMarcel Holtmann __u8 data[0]; 20772331fd46SMarcel Holtmann } __packed; 20782331fd46SMarcel Holtmann 20791855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 20801855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 20811855d92dSMarcel Holtmann __u8 status; 20821855d92dSMarcel Holtmann __le16 handle; 20831855d92dSMarcel Holtmann __le16 interval; 20841855d92dSMarcel Holtmann __le16 latency; 20851855d92dSMarcel Holtmann __le16 supervision_timeout; 20861855d92dSMarcel Holtmann } __packed; 20871855d92dSMarcel Holtmann 20880fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 20890fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 20900fe29fd1SMarcel Holtmann __u8 status; 20910fe29fd1SMarcel Holtmann __le16 handle; 20920fe29fd1SMarcel Holtmann __u8 features[8]; 20930fe29fd1SMarcel Holtmann } __packed; 20940fe29fd1SMarcel Holtmann 2095a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2096a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2097a7a595f6SVinicius Costa Gomes __le16 handle; 2098fe39c7b2SMarcel Holtmann __le64 rand; 2099a7a595f6SVinicius Costa Gomes __le16 ediv; 2100a7a595f6SVinicius Costa Gomes } __packed; 2101a7a595f6SVinicius Costa Gomes 21028e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 21038e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 21048e75b46aSAndre Guedes __le16 handle; 21058e75b46aSAndre Guedes __le16 interval_min; 21068e75b46aSAndre Guedes __le16 interval_max; 21078e75b46aSAndre Guedes __le16 latency; 21088e75b46aSAndre Guedes __le16 timeout; 21098e75b46aSAndre Guedes } __packed; 21108e75b46aSAndre Guedes 211194a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 211294a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 211394a3bd02SMarcel Holtmann __le16 handle; 211494a3bd02SMarcel Holtmann __le16 tx_len; 211594a3bd02SMarcel Holtmann __le16 tx_time; 211694a3bd02SMarcel Holtmann __le16 rx_len; 211794a3bd02SMarcel Holtmann __le16 rx_time; 211894a3bd02SMarcel Holtmann } __packed; 211994a3bd02SMarcel Holtmann 212032c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 212132c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 212232c9d43fSMarcel Holtmann __u8 evt_type; 212332c9d43fSMarcel Holtmann __u8 bdaddr_type; 212432c9d43fSMarcel Holtmann bdaddr_t bdaddr; 212532c9d43fSMarcel Holtmann __u8 direct_addr_type; 212632c9d43fSMarcel Holtmann bdaddr_t direct_addr; 212732c9d43fSMarcel Holtmann __s8 rssi; 212832c9d43fSMarcel Holtmann } __packed; 212932c9d43fSMarcel Holtmann 2130c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2131c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2132c215e939SJaganath Kanakkassery __le16 evt_type; 2133c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2134c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2135c215e939SJaganath Kanakkassery __u8 primary_phy; 2136c215e939SJaganath Kanakkassery __u8 secondary_phy; 2137c215e939SJaganath Kanakkassery __u8 sid; 2138c215e939SJaganath Kanakkassery __u8 tx_power; 2139c215e939SJaganath Kanakkassery __s8 rssi; 2140c215e939SJaganath Kanakkassery __le16 interval; 2141c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2142c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2143c215e939SJaganath Kanakkassery __u8 length; 2144c215e939SJaganath Kanakkassery __u8 data[0]; 2145c215e939SJaganath Kanakkassery } __packed; 2146c215e939SJaganath Kanakkassery 21474d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 21484d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 21494d94f95dSJaganath Kanakkassery __u8 status; 21504d94f95dSJaganath Kanakkassery __le16 handle; 21514d94f95dSJaganath Kanakkassery __u8 role; 21524d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 21534d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 21544d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 21554d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 21564d94f95dSJaganath Kanakkassery __le16 interval; 21574d94f95dSJaganath Kanakkassery __le16 latency; 21584d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 21594d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 21604d94f95dSJaganath Kanakkassery } __packed; 21614d94f95dSJaganath Kanakkassery 2162acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2163acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2164acf0aeaeSJaganath Kanakkassery __u8 status; 2165acf0aeaeSJaganath Kanakkassery __u8 handle; 2166acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2167acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2168acf0aeaeSJaganath Kanakkassery } __packed; 2169acf0aeaeSJaganath Kanakkassery 21701da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2171a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 21721da177e4SLinus Torvalds struct hci_ev_stack_internal { 21731da177e4SLinus Torvalds __u16 type; 21741da177e4SLinus Torvalds __u8 data[0]; 217566c853ccSGustavo F. Padovan } __packed; 21761da177e4SLinus Torvalds 21771da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 21781da177e4SLinus Torvalds struct hci_ev_si_device { 21791da177e4SLinus Torvalds __u16 event; 21801da177e4SLinus Torvalds __u16 dev_id; 218166c853ccSGustavo F. Padovan } __packed; 21821da177e4SLinus Torvalds 21831da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 21841da177e4SLinus Torvalds struct hci_ev_si_security { 21851da177e4SLinus Torvalds __u16 event; 21861da177e4SLinus Torvalds __u16 proto; 21871da177e4SLinus Torvalds __u16 subproto; 21881da177e4SLinus Torvalds __u8 incoming; 218966c853ccSGustavo F. Padovan } __packed; 21901da177e4SLinus Torvalds 21911da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 21921da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 21931da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 21941da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 21951da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 21961da177e4SLinus Torvalds 21971da177e4SLinus Torvalds struct hci_command_hdr { 21981ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 21991da177e4SLinus Torvalds __u8 plen; 220066c853ccSGustavo F. Padovan } __packed; 22011da177e4SLinus Torvalds 22021da177e4SLinus Torvalds struct hci_event_hdr { 22031da177e4SLinus Torvalds __u8 evt; 22041da177e4SLinus Torvalds __u8 plen; 220566c853ccSGustavo F. Padovan } __packed; 22061da177e4SLinus Torvalds 22071da177e4SLinus Torvalds struct hci_acl_hdr { 22081ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 22091ebb9252SMarcel Holtmann __le16 dlen; 221066c853ccSGustavo F. Padovan } __packed; 22111da177e4SLinus Torvalds 22121da177e4SLinus Torvalds struct hci_sco_hdr { 22131ebb9252SMarcel Holtmann __le16 handle; 22141da177e4SLinus Torvalds __u8 dlen; 221566c853ccSGustavo F. Padovan } __packed; 22161da177e4SLinus Torvalds 22172a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 22182a123b86SArnaldo Carvalho de Melo { 22192a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 22202a123b86SArnaldo Carvalho de Melo } 22212a123b86SArnaldo Carvalho de Melo 22222a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 22232a123b86SArnaldo Carvalho de Melo { 22242a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 22252a123b86SArnaldo Carvalho de Melo } 22262a123b86SArnaldo Carvalho de Melo 22272a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 22282a123b86SArnaldo Carvalho de Melo { 22292a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 22302a123b86SArnaldo Carvalho de Melo } 22312a123b86SArnaldo Carvalho de Melo 22321da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2233c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 22341da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 22351da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 22361da177e4SLinus Torvalds 22371da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2238c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 22391da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 22401da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 22411da177e4SLinus Torvalds 22421da177e4SLinus Torvalds #endif /* __HCI_H */ 2243