11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux 31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 81da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 91da177e4SLinus Torvalds published by the Free Software Foundation; 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 121da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 131da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 141da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 151da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 161da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 171da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 181da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 191da177e4SLinus Torvalds 201da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 211da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 221da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #ifndef __HCI_H 261da177e4SLinus Torvalds #define __HCI_H 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024 291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255 304de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE 251 311da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260 321da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 331da177e4SLinus Torvalds 349b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16 35523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 369b3b4460SAndrei Emeltchenko 37903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE 672 38903e4541SAndrei Emeltchenko 396397729bSArchie Pusaka #define HCI_MAX_CPB_DATA_SIZE 252 407d1dab49SDoHyun Pyun 411da177e4SLinus Torvalds /* HCI dev events */ 421da177e4SLinus Torvalds #define HCI_DEV_REG 1 431da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 441da177e4SLinus Torvalds #define HCI_DEV_UP 3 451da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 471da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds /* HCI notify events */ 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 561f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_CVSD 4 571f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_TRANSP 5 581f8330eaSSathish Narsimman #define HCI_NOTIFY_DISABLE_SCO 6 591da177e4SLinus Torvalds 60c13854ceSMarcel Holtmann /* HCI bus types */ 610ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 621da177e4SLinus Torvalds #define HCI_USB 1 631da177e4SLinus Torvalds #define HCI_PCCARD 2 641da177e4SLinus Torvalds #define HCI_UART 3 651da177e4SLinus Torvalds #define HCI_RS232 4 661da177e4SLinus Torvalds #define HCI_PCI 5 670ac53939SMarcel Holtmann #define HCI_SDIO 6 685c0e03cdSJohan Hedberg #define HCI_SPI 7 695c0e03cdSJohan Hedberg #define HCI_I2C 8 7065010e68SBjorn Andersson #define HCI_SMD 9 71d2a3f5f4SMarcel Holtmann #define HCI_VIRTIO 10 721da177e4SLinus Torvalds 73943da25dSMarcel Holtmann /* HCI controller types */ 74ca8bee5dSMarcel Holtmann #define HCI_PRIMARY 0x00 758f1e1742SDavid Vrabel #define HCI_AMP 0x01 76943da25dSMarcel Holtmann 778598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 786ed971caSMarcel Holtmann #define AMP_ID_BREDR 0x00 798598d064SAndrei Emeltchenko 807c13823dSMarcel Holtmann /* AMP controller types */ 817c13823dSMarcel Holtmann #define AMP_TYPE_BREDR 0x00 827c13823dSMarcel Holtmann #define AMP_TYPE_80211 0x01 837c13823dSMarcel Holtmann 84ab846ec4SAndrei Emeltchenko /* AMP controller status */ 85536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN 0x00 86536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY 0x01 87536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY 0x02 88536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY 0x03 89536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY 0x04 90536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY 0x05 91536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY 0x06 92ab846ec4SAndrei Emeltchenko 931da177e4SLinus Torvalds /* HCI device quirks */ 941da177e4SLinus Torvalds enum { 95118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when 96118305b5SMarcel Holtmann * closing the transport instead of when opening it. 97118305b5SMarcel Holtmann * 98118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 99118305b5SMarcel Holtmann */ 100a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 101118305b5SMarcel Holtmann 102118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only 103118305b5SMarcel Holtmann * device and it will stay in unconfigured state. 104118305b5SMarcel Holtmann * 105118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 106118305b5SMarcel Holtmann */ 107da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 108118305b5SMarcel Holtmann 109118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by 110118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid. 111118305b5SMarcel Holtmann * 112118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 113118305b5SMarcel Holtmann */ 114f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE, 115118305b5SMarcel Holtmann 116043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not 117043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to 118043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had 119043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing 120043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the 121043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better 122e37c57a8SAlain Michaud * user experience. 123043ec9bfSMarcel Holtmann * 124043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called. 125043ec9bfSMarcel Holtmann */ 126043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE, 127043ec9bfSMarcel Holtmann 128711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported 129711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2 130711ffa78SMarcel Holtmann * and later controllers should support this command. However 131711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do 132711ffa78SMarcel Holtmann * not support this command. 133711ffa78SMarcel Holtmann * 134711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 135711ffa78SMarcel Holtmann */ 136711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS, 137711ffa78SMarcel Holtmann 138118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling 139118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the 140118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but 141118305b5SMarcel Holtmann * not supported. 142118305b5SMarcel Holtmann * 143118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 144118305b5SMarcel Holtmann */ 145f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY, 14689bc22d2SMarcel Holtmann 147eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step 148eb1904f4SMarcel Holtmann * is required and will be indicated with the controller 149e37c57a8SAlain Michaud * configuration. 150eb1904f4SMarcel Holtmann * 151eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 152eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback. 153eb1904f4SMarcel Holtmann */ 154eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG, 155eb1904f4SMarcel Holtmann 15689bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address 15789bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command 15889bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is 15989bc22d2SMarcel Holtmann * required before this device can be used. 16089bc22d2SMarcel Holtmann * 16189bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 16289bc22d2SMarcel Holtmann * during the hdev->setup vendor callback. 16389bc22d2SMarcel Holtmann */ 16489bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR, 16543d6bc46SMarcel Holtmann 1667a0e5b15SMatthias Kaehlcke /* When this quirk is set, the public Bluetooth address 1677a0e5b15SMatthias Kaehlcke * initially reported by HCI Read BD Address command 1687a0e5b15SMatthias Kaehlcke * is considered invalid. The public BD Address can be 1697a0e5b15SMatthias Kaehlcke * specified in the fwnode property 'local-bd-address'. 1707a0e5b15SMatthias Kaehlcke * If this property does not exist or is invalid controller 1717a0e5b15SMatthias Kaehlcke * configuration is required before this device can be used. 1727a0e5b15SMatthias Kaehlcke * 1737a0e5b15SMatthias Kaehlcke * This quirk can be set before hci_register_dev is called or 1747a0e5b15SMatthias Kaehlcke * during the hdev->setup vendor callback. 1757a0e5b15SMatthias Kaehlcke */ 1767a0e5b15SMatthias Kaehlcke HCI_QUIRK_USE_BDADDR_PROPERTY, 1777a0e5b15SMatthias Kaehlcke 17843d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 17943d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 18043d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 18143d6bc46SMarcel Holtmann * 18243d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 18343d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 18443d6bc46SMarcel Holtmann */ 18543d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 186695c4cb6SJakub Pawlowski 187695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 188695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 189695c4cb6SJakub Pawlowski * 190695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 191695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 192695c4cb6SJakub Pawlowski */ 193695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1947e995b9eSMarcel Holtmann 1957e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1967e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1977e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1987e995b9eSMarcel Holtmann * 1997e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 2007e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 2017e995b9eSMarcel Holtmann */ 2027e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 203740011cfSSean Wang 204740011cfSSean Wang /* When this quirk is set, setup() would be run after every 205740011cfSSean Wang * open() and not just after the first open(). 206740011cfSSean Wang * 207740011cfSSean Wang * This quirk can be set before hci_register_dev is called or 208740011cfSSean Wang * during the hdev->setup vendor callback. 209740011cfSSean Wang * 210740011cfSSean Wang */ 211740011cfSSean Wang HCI_QUIRK_NON_PERSISTENT_SETUP, 2124b127bd5SAlain Michaud 2134b127bd5SAlain Michaud /* When this quirk is set, wide band speech is supported by 2144b127bd5SAlain Michaud * the driver since no reliable mechanism exist to report 2154b127bd5SAlain Michaud * this from the hardware, a driver flag is use to convey 2164b127bd5SAlain Michaud * this support 2174b127bd5SAlain Michaud * 2184b127bd5SAlain Michaud * This quirk must be set before hci_register_dev is called. 2194b127bd5SAlain Michaud */ 22000bce3fbSAlain Michaud HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 22122091585SAlain Michaud 22222091585SAlain Michaud /* When this quirk is set, the controller has validated that 22322091585SAlain Michaud * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are 22422091585SAlain Michaud * valid. This mechanism is necessary as many controllers have 22522091585SAlain Michaud * been seen has having trouble initiating a connectable 22622091585SAlain Michaud * advertisement despite the state combination being reported as 22722091585SAlain Michaud * supported. 22822091585SAlain Michaud */ 22922091585SAlain Michaud HCI_QUIRK_VALID_LE_STATES, 230cde1a8a9SIsmael Ferreras Morezuelas 231cde1a8a9SIsmael Ferreras Morezuelas /* When this quirk is set, then erroneous data reporting 232cde1a8a9SIsmael Ferreras Morezuelas * is ignored. This is mainly due to the fact that the HCI 233cde1a8a9SIsmael Ferreras Morezuelas * Read Default Erroneous Data Reporting command is advertised, 234cde1a8a9SIsmael Ferreras Morezuelas * but not supported; these controllers often reply with unknown 235cde1a8a9SIsmael Ferreras Morezuelas * command and tend to lock up randomly. Needing a hard reset. 236cde1a8a9SIsmael Ferreras Morezuelas * 237cde1a8a9SIsmael Ferreras Morezuelas * This quirk can be set before hci_register_dev is called or 238cde1a8a9SIsmael Ferreras Morezuelas * during the hdev->setup vendor callback. 239cde1a8a9SIsmael Ferreras Morezuelas */ 240cde1a8a9SIsmael Ferreras Morezuelas HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, 241219991e6SHans de Goede 242219991e6SHans de Goede /* 243219991e6SHans de Goede * When this quirk is set, then the hci_suspend_notifier is not 244219991e6SHans de Goede * registered. This is intended for devices which drop completely 245219991e6SHans de Goede * from the bus on system-suspend and which will show up as a new 246219991e6SHans de Goede * HCI after resume. 247219991e6SHans de Goede */ 248219991e6SHans de Goede HCI_QUIRK_NO_SUSPEND_NOTIFIER, 2491da177e4SLinus Torvalds }; 2501da177e4SLinus Torvalds 2511da177e4SLinus Torvalds /* HCI device flags */ 2521da177e4SLinus Torvalds enum { 2531da177e4SLinus Torvalds HCI_UP, 2541da177e4SLinus Torvalds HCI_INIT, 2551da177e4SLinus Torvalds HCI_RUNNING, 2561da177e4SLinus Torvalds 2571da177e4SLinus Torvalds HCI_PSCAN, 2581da177e4SLinus Torvalds HCI_ISCAN, 2591da177e4SLinus Torvalds HCI_AUTH, 2601da177e4SLinus Torvalds HCI_ENCRYPT, 2611da177e4SLinus Torvalds HCI_INQUIRY, 2621da177e4SLinus Torvalds 2631da177e4SLinus Torvalds HCI_RAW, 264ab81cbf9SJohan Hedberg 26510572132SGustavo F. Padovan HCI_RESET, 2661da177e4SLinus Torvalds }; 2671da177e4SLinus Torvalds 268f9207338SMarcel Holtmann /* HCI socket flags */ 269f9207338SMarcel Holtmann enum { 27050ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 271f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 272f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 273ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 274321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2755504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2765504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2775504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2785504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 27972000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 280a10c907cSMarcel Holtmann HCI_MGMT_EXP_FEATURE_EVENTS, 281f9207338SMarcel Holtmann }; 282f9207338SMarcel Holtmann 283d23264a8SAndre Guedes /* 284d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 285d23264a8SAndre Guedes * states from the controller. 286d23264a8SAndre Guedes */ 287d23264a8SAndre Guedes enum { 288a8b2d5c2SJohan Hedberg HCI_SETUP, 289d603b76bSMarcel Holtmann HCI_CONFIG, 290a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2915e130367SJohan Hedberg HCI_RFKILLED, 292a8b2d5c2SJohan Hedberg HCI_MGMT, 293b6ae8457SJohan Hedberg HCI_BONDABLE, 294a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2950663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2963769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 29794324962SJohan Hovold HCI_UNREGISTER, 2984a964404SMarcel Holtmann HCI_UNCONFIGURED, 2990736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 300dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 30166c417c1SJohan Hedberg HCI_LE_ADV, 302d23264a8SAndre Guedes HCI_LE_SCAN, 30384bde9d6SJohan Hedberg HCI_SSP_ENABLED, 304e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 305134c2a89SMarcel Holtmann HCI_SC_ONLY, 306863efaf2SJohan Hedberg HCI_PRIVACY, 30782a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 308d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 30941edf160SJohan Hedberg HCI_RPA_RESOLVING, 3106d80dfd0SJohan Hedberg HCI_HS_ENABLED, 31106199cf8SJohan Hedberg HCI_LE_ENABLED, 312f3d3444aSJohan Hedberg HCI_ADVERTISING, 313cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 3145e5282bbSJohan Hedberg HCI_CONNECTABLE, 3155e5282bbSJohan Hedberg HCI_DISCOVERABLE, 3166acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 31747990ea0SJohan Hedberg HCI_LINK_SECURITY, 31821693c15SAndre Guedes HCI_PERIODIC_INQ, 3191a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 32056f87901SJohan Hedberg HCI_BREDR_ENABLED, 32181ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 32200bce3fbSAlain Michaud HCI_WIDEBAND_SPEECH_ENABLED, 323e5b0ad69SAbhishek Pandit-Subedi HCI_EVENT_FILTER_CONFIGURED, 324b7cb93e5SMarcel Holtmann 325b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 3264b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 327b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 328b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 329aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 330cbbdfa6fSSathish Narasimman HCI_ENABLE_LL_PRIVACY, 331f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 332c2aa30dbSArchie Pusaka HCI_FORCE_NO_MITM, 333ae7d925bSJoseph Hwang HCI_QUALITY_REPORT, 334248733e8SKiran K HCI_OFFLOAD_CODECS_ENABLED, 335b7cb93e5SMarcel Holtmann 336eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 337d23264a8SAndre Guedes }; 338d23264a8SAndre Guedes 3391da177e4SLinus Torvalds /* HCI timeouts */ 3405f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 3415f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 3425f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 343d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 344de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3455f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 3469345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 347a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 3489489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 3491f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3501da177e4SLinus Torvalds 3515b7f9909SMarcel Holtmann /* HCI data types */ 3521da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3531da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3541da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3551da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 3564de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05 357e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3581da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3591da177e4SLinus Torvalds 3605b7f9909SMarcel Holtmann /* HCI packet types */ 3611da177e4SLinus Torvalds #define HCI_DM1 0x0008 3621da177e4SLinus Torvalds #define HCI_DM3 0x0400 3631da177e4SLinus Torvalds #define HCI_DM5 0x4000 3641da177e4SLinus Torvalds #define HCI_DH1 0x0010 3651da177e4SLinus Torvalds #define HCI_DH3 0x0800 3661da177e4SLinus Torvalds #define HCI_DH5 0x8000 3671da177e4SLinus Torvalds 3685075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3695075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3705075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3715075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3725075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3735075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3745075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3755075b972SJaganath Kanakkassery 3761da177e4SLinus Torvalds #define HCI_HV1 0x0020 3771da177e4SLinus Torvalds #define HCI_HV2 0x0040 3781da177e4SLinus Torvalds #define HCI_HV3 0x0080 3791da177e4SLinus Torvalds 3801da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3811da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3821da177e4SLinus Torvalds 3835b7f9909SMarcel Holtmann /* eSCO packet types */ 3845b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3855b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3865b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3875b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3885b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3895b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 390efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 391efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 392efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 393efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3945b7f9909SMarcel Holtmann 395a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 396efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 397a8746417SMarcel Holtmann 3981da177e4SLinus Torvalds /* ACL flags */ 399e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 4001da177e4SLinus Torvalds #define ACL_CONT 0x01 4011da177e4SLinus Torvalds #define ACL_START 0x02 402d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 4031da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 4041da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 4051da177e4SLinus Torvalds 4064de0fc59SLuiz Augusto von Dentz /* ISO PB flags */ 4074de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00 4084de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01 4094de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02 4104de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03 4114de0fc59SLuiz Augusto von Dentz 4124de0fc59SLuiz Augusto von Dentz /* ISO TS flags */ 4134de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01 4144de0fc59SLuiz Augusto von Dentz 4151da177e4SLinus Torvalds /* Baseband links */ 4161da177e4SLinus Torvalds #define SCO_LINK 0x00 4171da177e4SLinus Torvalds #define ACL_LINK 0x01 4185b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 419fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 420fcd89c09SVille Tervo #define LE_LINK 0x80 4213161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 4224de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82 423845472e8SMarcel Holtmann #define INVALID_LINK 0xff 4241da177e4SLinus Torvalds 4251da177e4SLinus Torvalds /* LMP features */ 4261da177e4SLinus Torvalds #define LMP_3SLOT 0x01 4271da177e4SLinus Torvalds #define LMP_5SLOT 0x02 4281da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 4291da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 4301da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 4311da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 4321da177e4SLinus Torvalds #define LMP_HOLD 0x40 43304837f64SMarcel Holtmann #define LMP_SNIFF 0x80 4341da177e4SLinus Torvalds 4351da177e4SLinus Torvalds #define LMP_PARK 0x01 4361da177e4SLinus Torvalds #define LMP_RSSI 0x02 4371da177e4SLinus Torvalds #define LMP_QUALITY 0x04 4381da177e4SLinus Torvalds #define LMP_SCO 0x08 4391da177e4SLinus Torvalds #define LMP_HV2 0x10 4401da177e4SLinus Torvalds #define LMP_HV3 0x20 4411da177e4SLinus Torvalds #define LMP_ULAW 0x40 4421da177e4SLinus Torvalds #define LMP_ALAW 0x80 4431da177e4SLinus Torvalds 4441da177e4SLinus Torvalds #define LMP_CVSD 0x01 4451da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 4461da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 44707a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 4481da177e4SLinus Torvalds 4495075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 4505075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 451d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 4525b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 4535b7f9909SMarcel Holtmann 4545b7f9909SMarcel Holtmann #define LMP_EV4 0x01 4555b7f9909SMarcel Holtmann #define LMP_EV5 0x02 45669ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 457d5859e22SJohan Hedberg #define LMP_LE 0x40 4585075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 4595b7f9909SMarcel Holtmann 4605075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 46104837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 462d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 463efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 464efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 465efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 46604837f64SMarcel Holtmann 467d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 468e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 469769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 470e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 471769be974SMarcel Holtmann 472d5859e22SJohan Hedberg #define LMP_LSTO 0x01 473d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 474971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 475d5859e22SJohan Hedberg 476eead27daSAndre Guedes /* Extended LMP features */ 4776397729bSArchie Pusaka #define LMP_CPB_CENTRAL 0x01 4786397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL 0x02 47953b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 48053b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 48153b834d2SMarcel Holtmann 482d5991585SMarcel Holtmann #define LMP_SC 0x01 483d5991585SMarcel Holtmann #define LMP_PING 0x02 484d5991585SMarcel Holtmann 48553b834d2SMarcel Holtmann /* Host features */ 486cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 487eead27daSAndre Guedes #define LMP_HOST_LE 0x02 488cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 489d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 490eead27daSAndre Guedes 491662bc2e6SAndre Guedes /* LE features */ 4920da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 493662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 494ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES 0x08 495cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 49694a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 497ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY 0x40 4984b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4995075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 5005075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 50155beec10SMarcel Holtmann #define HCI_LE_EXT_ADV 0x10 5029756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 503ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL 0x10 504ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL 0x20 505662bc2e6SAndre Guedes 50604837f64SMarcel Holtmann /* Connection modes */ 50704837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 50804837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 50904837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 51004837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 51104837f64SMarcel Holtmann 5121da177e4SLinus Torvalds /* Link policies */ 5131da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 5141da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 5151da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 5161da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 5171da177e4SLinus Torvalds 51804837f64SMarcel Holtmann /* Link modes */ 5191da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 5201da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 5211da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 5221da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 5231da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 5241da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 5251da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 5267b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 5271da177e4SLinus Torvalds 52840be492fSMarcel Holtmann /* Authentication types */ 52940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 53040be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 53140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 53240be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 53340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 53440be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 53540be492fSMarcel Holtmann 536a77b15a6SMikel Astiz /* I/O capabilities */ 537a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 538a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 539a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 540a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 541a77b15a6SMikel Astiz 542b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 543b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 544b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 545b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 546b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 54711015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 54811015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 549b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 55011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 55111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 552b6020ba0SWaldemar Rymarkiewicz 5539f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 5548e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 5559f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 556160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 5572acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 558cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 559d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 5609f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 5619f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 562cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 563cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5649f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5659f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5664ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5674ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5683c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5690f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST 0x44 5709f5a0d7bSAndrei Emeltchenko 5712455a3eaSAndrei Emeltchenko /* Flow control modes */ 5722455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5732455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5742455a3eaSAndrei Emeltchenko 575bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 576bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 577a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 578bbaf444aSJohan Hedberg 579ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 580ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 581ba165a90SJohan Hedberg 58232748db0SJohan Hedberg /* Extended Inquiry Response field types */ 58332748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 58432748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 58532748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 58632748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 58732748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 58832748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 58932748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 59032748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 59132748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 59232748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5939ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 594d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 595d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 59632748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5974453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5981471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5991471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 600d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 601d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 602f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 603f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 60432748db0SJohan Hedberg 6053f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 6063f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 6073f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 6083f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 6093f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 6103f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 6113f0f524bSJohan Hedberg 6121da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 6136bd32326SVille Tervo #define HCI_OP_NOP 0x0000 6146bd32326SVille Tervo 615a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 616a9de9248SMarcel Holtmann struct hci_cp_inquiry { 617a9de9248SMarcel Holtmann __u8 lap[3]; 618a9de9248SMarcel Holtmann __u8 length; 619a9de9248SMarcel Holtmann __u8 num_rsp; 62066c853ccSGustavo F. Padovan } __packed; 6211da177e4SLinus Torvalds 622a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 623a9de9248SMarcel Holtmann 62479d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 62579d6e068SAndre Guedes 626a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 627a9de9248SMarcel Holtmann 628a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 629a9de9248SMarcel Holtmann struct hci_cp_create_conn { 630a9de9248SMarcel Holtmann bdaddr_t bdaddr; 631a9de9248SMarcel Holtmann __le16 pkt_type; 632a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 633a9de9248SMarcel Holtmann __u8 pscan_mode; 634a9de9248SMarcel Holtmann __le16 clock_offset; 635a9de9248SMarcel Holtmann __u8 role_switch; 63666c853ccSGustavo F. Padovan } __packed; 6371da177e4SLinus Torvalds 638a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 639a9de9248SMarcel Holtmann struct hci_cp_disconnect { 640a9de9248SMarcel Holtmann __le16 handle; 641a9de9248SMarcel Holtmann __u8 reason; 64266c853ccSGustavo F. Padovan } __packed; 6431da177e4SLinus Torvalds 644a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 645a9de9248SMarcel Holtmann struct hci_cp_add_sco { 646a9de9248SMarcel Holtmann __le16 handle; 647a9de9248SMarcel Holtmann __le16 pkt_type; 64866c853ccSGustavo F. Padovan } __packed; 649a9de9248SMarcel Holtmann 650a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 651a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 6521da177e4SLinus Torvalds bdaddr_t bdaddr; 65366c853ccSGustavo F. Padovan } __packed; 6541da177e4SLinus Torvalds 655a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 656a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 657a9de9248SMarcel Holtmann bdaddr_t bdaddr; 658a9de9248SMarcel Holtmann __u8 role; 65966c853ccSGustavo F. Padovan } __packed; 6601da177e4SLinus Torvalds 661a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 662a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 663a9de9248SMarcel Holtmann bdaddr_t bdaddr; 664a9de9248SMarcel Holtmann __u8 reason; 66566c853ccSGustavo F. Padovan } __packed; 6661da177e4SLinus Torvalds 667a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 668a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 669a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6709b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 67166c853ccSGustavo F. Padovan } __packed; 6721da177e4SLinus Torvalds 673a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 674a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 675a9de9248SMarcel Holtmann bdaddr_t bdaddr; 67666c853ccSGustavo F. Padovan } __packed; 6771da177e4SLinus Torvalds 678a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 679a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 680a9de9248SMarcel Holtmann bdaddr_t bdaddr; 681a9de9248SMarcel Holtmann __u8 pin_len; 682a9de9248SMarcel Holtmann __u8 pin_code[16]; 68366c853ccSGustavo F. Padovan } __packed; 684980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 685980e1a53SJohan Hedberg __u8 status; 686980e1a53SJohan Hedberg bdaddr_t bdaddr; 687980e1a53SJohan Hedberg } __packed; 688a9de9248SMarcel Holtmann 689a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 690a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 691a9de9248SMarcel Holtmann bdaddr_t bdaddr; 69266c853ccSGustavo F. Padovan } __packed; 693980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 694980e1a53SJohan Hedberg __u8 status; 695980e1a53SJohan Hedberg bdaddr_t bdaddr; 696980e1a53SJohan Hedberg } __packed; 697a9de9248SMarcel Holtmann 698a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 699a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 700a9de9248SMarcel Holtmann __le16 handle; 701a9de9248SMarcel Holtmann __le16 pkt_type; 70266c853ccSGustavo F. Padovan } __packed; 703a9de9248SMarcel Holtmann 704a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 705a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 706a9de9248SMarcel Holtmann __le16 handle; 70766c853ccSGustavo F. Padovan } __packed; 708a9de9248SMarcel Holtmann 709a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 710a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 711a9de9248SMarcel Holtmann __le16 handle; 712a9de9248SMarcel Holtmann __u8 encrypt; 71366c853ccSGustavo F. Padovan } __packed; 714a9de9248SMarcel Holtmann 715a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 716a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 717a9de9248SMarcel Holtmann __le16 handle; 71866c853ccSGustavo F. Padovan } __packed; 719a9de9248SMarcel Holtmann 720a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 721a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 722a9de9248SMarcel Holtmann bdaddr_t bdaddr; 723a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 724a9de9248SMarcel Holtmann __u8 pscan_mode; 725a9de9248SMarcel Holtmann __le16 clock_offset; 72666c853ccSGustavo F. Padovan } __packed; 727a9de9248SMarcel Holtmann 728a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 729a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 730a9de9248SMarcel Holtmann bdaddr_t bdaddr; 73166c853ccSGustavo F. Padovan } __packed; 732a9de9248SMarcel Holtmann 733a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 734a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 735a9de9248SMarcel Holtmann __le16 handle; 73666c853ccSGustavo F. Padovan } __packed; 737a9de9248SMarcel Holtmann 738a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 739a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 740a9de9248SMarcel Holtmann __le16 handle; 741a9de9248SMarcel Holtmann __u8 page; 74266c853ccSGustavo F. Padovan } __packed; 743a9de9248SMarcel Holtmann 744a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 745a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 746a9de9248SMarcel Holtmann __le16 handle; 74766c853ccSGustavo F. Padovan } __packed; 748a9de9248SMarcel Holtmann 749df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 750df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 751df935429SMarcel Holtmann __le16 handle; 752df935429SMarcel Holtmann } __packed; 753df935429SMarcel Holtmann 754a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 755a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 756a9de9248SMarcel Holtmann __le16 handle; 757a9de9248SMarcel Holtmann __le32 tx_bandwidth; 758a9de9248SMarcel Holtmann __le32 rx_bandwidth; 759a9de9248SMarcel Holtmann __le16 max_latency; 760a9de9248SMarcel Holtmann __le16 voice_setting; 761a9de9248SMarcel Holtmann __u8 retrans_effort; 762a9de9248SMarcel Holtmann __le16 pkt_type; 76366c853ccSGustavo F. Padovan } __packed; 764a9de9248SMarcel Holtmann 765a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 766a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 767a9de9248SMarcel Holtmann bdaddr_t bdaddr; 768a9de9248SMarcel Holtmann __le32 tx_bandwidth; 769a9de9248SMarcel Holtmann __le32 rx_bandwidth; 770a9de9248SMarcel Holtmann __le16 max_latency; 771a9de9248SMarcel Holtmann __le16 content_format; 772a9de9248SMarcel Holtmann __u8 retrans_effort; 773a9de9248SMarcel Holtmann __le16 pkt_type; 77466c853ccSGustavo F. Padovan } __packed; 775a9de9248SMarcel Holtmann 776a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 777a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 778a9de9248SMarcel Holtmann bdaddr_t bdaddr; 779a9de9248SMarcel Holtmann __u8 reason; 78066c853ccSGustavo F. Padovan } __packed; 781a9de9248SMarcel Holtmann 78217fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 78317fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 78417fa4b9dSJohan Hedberg bdaddr_t bdaddr; 78517fa4b9dSJohan Hedberg __u8 capability; 78617fa4b9dSJohan Hedberg __u8 oob_data; 78717fa4b9dSJohan Hedberg __u8 authentication; 78817fa4b9dSJohan Hedberg } __packed; 78917fa4b9dSJohan Hedberg 790a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 791a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 792a5c29683SJohan Hedberg bdaddr_t bdaddr; 793a5c29683SJohan Hedberg } __packed; 794a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 795a5c29683SJohan Hedberg __u8 status; 796a5c29683SJohan Hedberg bdaddr_t bdaddr; 797a5c29683SJohan Hedberg } __packed; 798a5c29683SJohan Hedberg 799a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 800a5c29683SJohan Hedberg 8019ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 8029ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 8039ad4019aSBrian Gix bdaddr_t bdaddr; 8049ad4019aSBrian Gix __le32 passkey; 8059ad4019aSBrian Gix } __packed; 8069ad4019aSBrian Gix 8079ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 8089ad4019aSBrian Gix 8092763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 8102763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 8112763eda6SSzymon Janc bdaddr_t bdaddr; 8122763eda6SSzymon Janc __u8 hash[16]; 81338da1703SJohan Hedberg __u8 rand[16]; 8142763eda6SSzymon Janc } __packed; 8152763eda6SSzymon Janc 8162763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 8172763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 8182763eda6SSzymon Janc bdaddr_t bdaddr; 8192763eda6SSzymon Janc } __packed; 8202763eda6SSzymon Janc 82103b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 82203b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 82303b555e1SJohan Hedberg bdaddr_t bdaddr; 82403b555e1SJohan Hedberg __u8 reason; 82503b555e1SJohan Hedberg } __packed; 82603b555e1SJohan Hedberg 827523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 828523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 829523e93cdSAndrei Emeltchenko __u8 phy_handle; 830523e93cdSAndrei Emeltchenko __u8 key_len; 831523e93cdSAndrei Emeltchenko __u8 key_type; 832523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 833523e93cdSAndrei Emeltchenko } __packed; 834523e93cdSAndrei Emeltchenko 835523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 836523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 837523e93cdSAndrei Emeltchenko __u8 phy_handle; 838523e93cdSAndrei Emeltchenko __u8 key_len; 839523e93cdSAndrei Emeltchenko __u8 key_type; 840523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 841523e93cdSAndrei Emeltchenko } __packed; 842523e93cdSAndrei Emeltchenko 843523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 844523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 845523e93cdSAndrei Emeltchenko __u8 phy_handle; 846523e93cdSAndrei Emeltchenko __u8 reason; 847b078b564SAndrei Emeltchenko } __packed; 848b078b564SAndrei Emeltchenko 849b078b564SAndrei Emeltchenko struct ext_flow_spec { 850b078b564SAndrei Emeltchenko __u8 id; 851b078b564SAndrei Emeltchenko __u8 stype; 852b078b564SAndrei Emeltchenko __le16 msdu; 853b078b564SAndrei Emeltchenko __le32 sdu_itime; 854b078b564SAndrei Emeltchenko __le32 acc_lat; 855b078b564SAndrei Emeltchenko __le32 flush_to; 856b078b564SAndrei Emeltchenko } __packed; 857b078b564SAndrei Emeltchenko 858b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 859b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 860b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 861b078b564SAndrei Emeltchenko __u8 phy_handle; 862b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 863b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 864b078b564SAndrei Emeltchenko } __packed; 865b078b564SAndrei Emeltchenko 866b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 867b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 868b078b564SAndrei Emeltchenko __le16 log_handle; 869b078b564SAndrei Emeltchenko } __packed; 870b078b564SAndrei Emeltchenko 871b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 872b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 873b078b564SAndrei Emeltchenko __u8 phy_handle; 874b078b564SAndrei Emeltchenko __u8 flow_spec_id; 875b078b564SAndrei Emeltchenko } __packed; 876b078b564SAndrei Emeltchenko 877b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN 0x043d 878b2af264aSKiran K struct hci_coding_format { 879b2af264aSKiran K __u8 id; 880b2af264aSKiran K __le16 cid; 881b2af264aSKiran K __le16 vid; 882b2af264aSKiran K } __packed; 883b2af264aSKiran K 884b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn { 885b2af264aSKiran K __le16 handle; 886b2af264aSKiran K __le32 tx_bandwidth; 887b2af264aSKiran K __le32 rx_bandwidth; 888b2af264aSKiran K struct hci_coding_format tx_coding_format; 889b2af264aSKiran K struct hci_coding_format rx_coding_format; 890b2af264aSKiran K __le16 tx_codec_frame_size; 891b2af264aSKiran K __le16 rx_codec_frame_size; 892b2af264aSKiran K __le32 in_bandwidth; 893b2af264aSKiran K __le32 out_bandwidth; 894b2af264aSKiran K struct hci_coding_format in_coding_format; 895b2af264aSKiran K struct hci_coding_format out_coding_format; 896b2af264aSKiran K __le16 in_coded_data_size; 897b2af264aSKiran K __le16 out_coded_data_size; 898b2af264aSKiran K __u8 in_pcm_data_format; 899b2af264aSKiran K __u8 out_pcm_data_format; 900b2af264aSKiran K __u8 in_pcm_sample_payload_msb_pos; 901b2af264aSKiran K __u8 out_pcm_sample_payload_msb_pos; 902b2af264aSKiran K __u8 in_data_path; 903b2af264aSKiran K __u8 out_data_path; 904b2af264aSKiran K __u8 in_transport_unit_size; 905b2af264aSKiran K __u8 out_transport_unit_size; 906b2af264aSKiran K __le16 max_latency; 907b2af264aSKiran K __le16 pkt_type; 908b2af264aSKiran K __u8 retrans_effort; 909b2af264aSKiran K } __packed; 910b2af264aSKiran K 911b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 912b078b564SAndrei Emeltchenko __u8 status; 913b078b564SAndrei Emeltchenko __u8 phy_handle; 914b078b564SAndrei Emeltchenko __u8 flow_spec_id; 915523e93cdSAndrei Emeltchenko } __packed; 916523e93cdSAndrei Emeltchenko 9176397729bSArchie Pusaka #define HCI_OP_SET_CPB 0x0441 9186397729bSArchie Pusaka struct hci_cp_set_cpb { 9198c9a041bSDoHyun Pyun __u8 enable; 9208c9a041bSDoHyun Pyun __u8 lt_addr; 9218c9a041bSDoHyun Pyun __u8 lpo_allowed; 9228c9a041bSDoHyun Pyun __le16 packet_type; 9238c9a041bSDoHyun Pyun __le16 interval_min; 9248c9a041bSDoHyun Pyun __le16 interval_max; 9256397729bSArchie Pusaka __le16 cpb_sv_tout; 9268c9a041bSDoHyun Pyun } __packed; 9276397729bSArchie Pusaka struct hci_rp_set_cpb { 9288c9a041bSDoHyun Pyun __u8 status; 9298c9a041bSDoHyun Pyun __u8 lt_addr; 9308c9a041bSDoHyun Pyun __le16 interval; 9318c9a041bSDoHyun Pyun } __packed; 9328c9a041bSDoHyun Pyun 933cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 934cefded98SDoHyun Pyun 935e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 936e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 937e2f99131SMarcel Holtmann bdaddr_t bdaddr; 938e2f99131SMarcel Holtmann __u8 hash192[16]; 93938da1703SJohan Hedberg __u8 rand192[16]; 940e2f99131SMarcel Holtmann __u8 hash256[16]; 94138da1703SJohan Hedberg __u8 rand256[16]; 942e2f99131SMarcel Holtmann } __packed; 943e2f99131SMarcel Holtmann 944a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 945a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 946a9de9248SMarcel Holtmann __le16 handle; 947a9de9248SMarcel Holtmann __le16 max_interval; 948a9de9248SMarcel Holtmann __le16 min_interval; 949a9de9248SMarcel Holtmann __le16 attempt; 950a9de9248SMarcel Holtmann __le16 timeout; 95166c853ccSGustavo F. Padovan } __packed; 952a9de9248SMarcel Holtmann 953a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 954a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 955a9de9248SMarcel Holtmann __le16 handle; 95666c853ccSGustavo F. Padovan } __packed; 957a9de9248SMarcel Holtmann 958a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 959a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 960a9de9248SMarcel Holtmann __le16 handle; 96166c853ccSGustavo F. Padovan } __packed; 962a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 963a9de9248SMarcel Holtmann __u8 status; 964a9de9248SMarcel Holtmann __le16 handle; 965a9de9248SMarcel Holtmann __u8 role; 96666c853ccSGustavo F. Padovan } __packed; 967a9de9248SMarcel Holtmann 968a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 969a9de9248SMarcel Holtmann struct hci_cp_switch_role { 970a9de9248SMarcel Holtmann bdaddr_t bdaddr; 971a9de9248SMarcel Holtmann __u8 role; 97266c853ccSGustavo F. Padovan } __packed; 973a9de9248SMarcel Holtmann 974a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 975a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 976a9de9248SMarcel Holtmann __le16 handle; 97766c853ccSGustavo F. Padovan } __packed; 978a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 979a9de9248SMarcel Holtmann __u8 status; 980a9de9248SMarcel Holtmann __le16 handle; 981a9de9248SMarcel Holtmann __le16 policy; 98266c853ccSGustavo F. Padovan } __packed; 983a9de9248SMarcel Holtmann 984a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 985a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 986a9de9248SMarcel Holtmann __le16 handle; 987a9de9248SMarcel Holtmann __le16 policy; 98866c853ccSGustavo F. Padovan } __packed; 989a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 990a9de9248SMarcel Holtmann __u8 status; 991a9de9248SMarcel Holtmann __le16 handle; 99266c853ccSGustavo F. Padovan } __packed; 993a9de9248SMarcel Holtmann 994e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 995e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 996e4e8e37cSMarcel Holtmann __u8 status; 997e4e8e37cSMarcel Holtmann __le16 policy; 99866c853ccSGustavo F. Padovan } __packed; 999e4e8e37cSMarcel Holtmann 1000e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 1001e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 1002e4e8e37cSMarcel Holtmann __le16 policy; 100366c853ccSGustavo F. Padovan } __packed; 1004e4e8e37cSMarcel Holtmann 1005a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 1006a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 1007a9de9248SMarcel Holtmann __le16 handle; 1008a9de9248SMarcel Holtmann __le16 max_latency; 1009a9de9248SMarcel Holtmann __le16 min_remote_timeout; 1010a9de9248SMarcel Holtmann __le16 min_local_timeout; 101166c853ccSGustavo F. Padovan } __packed; 1012a9de9248SMarcel Holtmann 1013a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 1014a9de9248SMarcel Holtmann 1015a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 1016a9de9248SMarcel Holtmann 1017a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 10184f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE 9 10194f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter { 10201da177e4SLinus Torvalds __u8 flt_type; 10211da177e4SLinus Torvalds __u8 cond_type; 10224f40afc6SAbhishek Pandit-Subedi struct { 10234f40afc6SAbhishek Pandit-Subedi bdaddr_t bdaddr; 10244f40afc6SAbhishek Pandit-Subedi __u8 auto_accept; 10254f40afc6SAbhishek Pandit-Subedi } __packed addr_conn_flt; 102666c853ccSGustavo F. Padovan } __packed; 10271da177e4SLinus Torvalds 10281da177e4SLinus Torvalds /* Filter types */ 10291da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 10301da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 10311da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 10321da177e4SLinus Torvalds 10331da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 10341da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 10351da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 10361da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 10371da177e4SLinus Torvalds 10381da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 10391da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 10401da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 10414f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03 10421da177e4SLinus Torvalds 1043cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1044cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 1045cb962780SMarcel Holtmann bdaddr_t bdaddr; 1046cb962780SMarcel Holtmann __u8 read_all; 1047cb962780SMarcel Holtmann } __packed; 1048cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 1049cb962780SMarcel Holtmann __u8 status; 1050*e88422bcSLuiz Augusto von Dentz __le16 max_keys; 1051*e88422bcSLuiz Augusto von Dentz __le16 num_keys; 1052cb962780SMarcel Holtmann } __packed; 1053cb962780SMarcel Holtmann 1054b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1055b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 1056b0916ea0SJohan Hedberg bdaddr_t bdaddr; 1057b0916ea0SJohan Hedberg __u8 delete_all; 1058b0916ea0SJohan Hedberg } __packed; 1059039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 1060039d4e41SMarcel Holtmann __u8 status; 1061039d4e41SMarcel Holtmann __u8 num_keys; 1062039d4e41SMarcel Holtmann } __packed; 1063b0916ea0SJohan Hedberg 10641f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 10651f6c6378SJohan Hedberg 1066a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1067a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 10681f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 106966c853ccSGustavo F. Padovan } __packed; 1070a9de9248SMarcel Holtmann 1071a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 1072a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 1073a9de9248SMarcel Holtmann __u8 status; 10741f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 107566c853ccSGustavo F. Padovan } __packed; 1076a9de9248SMarcel Holtmann 1077a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 1078a9de9248SMarcel Holtmann 1079a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 1080a9de9248SMarcel Holtmann 1081a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 1082a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 1083a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 1084a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 1085a9de9248SMarcel Holtmann 1086a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 1087a9de9248SMarcel Holtmann 1088a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 1089a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 1090a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 1091a9de9248SMarcel Holtmann 1092a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 1093a9de9248SMarcel Holtmann 1094a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 1095a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 1096a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 1097a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 1098a9de9248SMarcel Holtmann 1099a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 1100a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 11011da177e4SLinus Torvalds __u8 status; 11021da177e4SLinus Torvalds __u8 dev_class[3]; 110366c853ccSGustavo F. Padovan } __packed; 11041da177e4SLinus Torvalds 1105a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1106a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 11071da177e4SLinus Torvalds __u8 dev_class[3]; 110866c853ccSGustavo F. Padovan } __packed; 11091da177e4SLinus Torvalds 1110a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 11111da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 11121da177e4SLinus Torvalds __u8 status; 11131ebb9252SMarcel Holtmann __le16 voice_setting; 111466c853ccSGustavo F. Padovan } __packed; 11151da177e4SLinus Torvalds 1116a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 11171da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 11181ebb9252SMarcel Holtmann __le16 voice_setting; 111966c853ccSGustavo F. Padovan } __packed; 11201da177e4SLinus Torvalds 1121a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 11221da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 11231ebb9252SMarcel Holtmann __le16 acl_mtu; 11241da177e4SLinus Torvalds __u8 sco_mtu; 11251ebb9252SMarcel Holtmann __le16 acl_max_pkt; 11261ebb9252SMarcel Holtmann __le16 sco_max_pkt; 112766c853ccSGustavo F. Padovan } __packed; 11281da177e4SLinus Torvalds 1129b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1130b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1131b4cb9fb2SMarcel Holtmann __u8 status; 1132b4cb9fb2SMarcel Holtmann __u8 num_iac; 1133b4cb9fb2SMarcel Holtmann } __packed; 1134b4cb9fb2SMarcel Holtmann 11354b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 11364b836f39SMarcel Holtmann 11373d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 11383d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 11393d505312SMarcel Holtmann __u8 num_iac; 11403d505312SMarcel Holtmann __u8 iac_lap[6]; 11413d505312SMarcel Holtmann } __packed; 11423d505312SMarcel Holtmann 1143d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1144d5859e22SJohan Hedberg 114580a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 114680a1e1dbSJohan Hedberg 114780a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 114880a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1149816a11d5SJohan Hedberg __u8 fec; 1150816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 115180a1e1dbSJohan Hedberg } __packed; 115280a1e1dbSJohan Hedberg 1153333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1154333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1155333140b5SMarcel Holtmann __u8 status; 1156333140b5SMarcel Holtmann __u8 mode; 115766c853ccSGustavo F. Padovan } __packed; 1158333140b5SMarcel Holtmann 1159333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1160333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1161333140b5SMarcel Holtmann __u8 mode; 116266c853ccSGustavo F. Padovan } __packed; 1163333140b5SMarcel Holtmann 1164c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1165c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1166c35938b2SSzymon Janc __u8 status; 1167c35938b2SSzymon Janc __u8 hash[16]; 116838da1703SJohan Hedberg __u8 rand[16]; 1169c35938b2SSzymon Janc } __packed; 1170c35938b2SSzymon Janc 1171d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 117291c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 117391c4e9b1SMarcel Holtmann __u8 status; 117491c4e9b1SMarcel Holtmann __s8 tx_power; 117591c4e9b1SMarcel Holtmann } __packed; 1176d5859e22SJohan Hedberg 117700bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a 117800bce3fbSAlain Michaud #define ERR_DATA_REPORTING_DISABLED 0x00 117900bce3fbSAlain Michaud #define ERR_DATA_REPORTING_ENABLED 0x01 118000bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting { 118100bce3fbSAlain Michaud __u8 status; 118200bce3fbSAlain Michaud __u8 err_data_reporting; 118300bce3fbSAlain Michaud } __packed; 118400bce3fbSAlain Michaud 118500bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b 118600bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting { 118700bce3fbSAlain Michaud __u8 err_data_reporting; 118800bce3fbSAlain Michaud } __packed; 118900bce3fbSAlain Michaud 1190d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1191d62e6d67SJohan Hedberg 11927528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 11937528ca1cSMarcel Holtmann 11941e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 11951e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 11961e89cffbSAndrei Emeltchenko __u8 status; 11971e89cffbSAndrei Emeltchenko __u8 mode; 11981e89cffbSAndrei Emeltchenko } __packed; 11991e89cffbSAndrei Emeltchenko 1200f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1201f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1202f9b49306SAndre Guedes __u8 le; 1203f9b49306SAndre Guedes __u8 simul; 1204f9b49306SAndre Guedes } __packed; 1205f9b49306SAndre Guedes 1206d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1207d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1208d0bf75a5SDoHyun Pyun __u8 lt_addr; 1209d0bf75a5SDoHyun Pyun } __packed; 1210d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1211d0bf75a5SDoHyun Pyun __u8 status; 1212d0bf75a5SDoHyun Pyun __u8 lt_addr; 1213d0bf75a5SDoHyun Pyun } __packed; 1214d0bf75a5SDoHyun Pyun 12156a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 12166a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 12176a20eaf4SDoHyun Pyun __u8 lt_addr; 12186a20eaf4SDoHyun Pyun } __packed; 12196a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 12206a20eaf4SDoHyun Pyun __u8 status; 12216a20eaf4SDoHyun Pyun __u8 lt_addr; 12226a20eaf4SDoHyun Pyun } __packed; 12236a20eaf4SDoHyun Pyun 12246397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA 0x0c76 12256397729bSArchie Pusaka struct hci_cp_set_cpb_data { 12267d1dab49SDoHyun Pyun __u8 lt_addr; 12277d1dab49SDoHyun Pyun __u8 fragment; 12287d1dab49SDoHyun Pyun __u8 data_length; 12296397729bSArchie Pusaka __u8 data[HCI_MAX_CPB_DATA_SIZE]; 12307d1dab49SDoHyun Pyun } __packed; 12316397729bSArchie Pusaka struct hci_rp_set_cpb_data { 12327d1dab49SDoHyun Pyun __u8 status; 12337d1dab49SDoHyun Pyun __u8 lt_addr; 12347d1dab49SDoHyun Pyun } __packed; 12357d1dab49SDoHyun Pyun 12365d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 12375d4e7e8dSJohan Hedberg 1238a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1239a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1240a9b07a64SDoHyun Pyun __le16 interval_min; 1241a9b07a64SDoHyun Pyun __le16 interval_max; 1242a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1243a9b07a64SDoHyun Pyun __u8 service_data; 1244a9b07a64SDoHyun Pyun } __packed; 1245a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1246a9b07a64SDoHyun Pyun __u8 status; 1247a9b07a64SDoHyun Pyun __le16 sync_train_int; 1248a9b07a64SDoHyun Pyun } __packed; 1249a9b07a64SDoHyun Pyun 1250eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1251eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1252eb4b95c6SMarcel Holtmann __u8 status; 1253eb4b95c6SMarcel Holtmann __u8 support; 1254eb4b95c6SMarcel Holtmann } __packed; 1255eb4b95c6SMarcel Holtmann 1256eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1257eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1258eb4b95c6SMarcel Holtmann __u8 support; 1259eb4b95c6SMarcel Holtmann } __packed; 1260eb4b95c6SMarcel Holtmann 1261302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1262302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1263302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1264302975cbSSpoorthi Ravishankar Koppad } __packed; 1265302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1266302975cbSSpoorthi Ravishankar Koppad __u8 status; 1267302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1268302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1269302975cbSSpoorthi Ravishankar Koppad } __packed; 1270302975cbSSpoorthi Ravishankar Koppad 1271302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1272302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1273302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1274302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1275302975cbSSpoorthi Ravishankar Koppad } __packed; 1276302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1277302975cbSSpoorthi Ravishankar Koppad __u8 status; 1278302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1279302975cbSSpoorthi Ravishankar Koppad } __packed; 1280302975cbSSpoorthi Ravishankar Koppad 1281e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1282e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1283e2f99131SMarcel Holtmann __u8 status; 1284e2f99131SMarcel Holtmann __u8 hash192[16]; 128538da1703SJohan Hedberg __u8 rand192[16]; 1286e2f99131SMarcel Holtmann __u8 hash256[16]; 128738da1703SJohan Hedberg __u8 rand256[16]; 1288e2f99131SMarcel Holtmann } __packed; 1289e2f99131SMarcel Holtmann 12909798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH 0x0c83 12919798fbdeSKiran K struct hci_op_configure_data_path { 12929798fbdeSKiran K __u8 direction; 12939798fbdeSKiran K __u8 data_path_id; 12949798fbdeSKiran K __u8 vnd_len; 12959798fbdeSKiran K __u8 vnd_data[]; 12969798fbdeSKiran K } __packed; 12979798fbdeSKiran K 1298a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1299a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 13001da177e4SLinus Torvalds __u8 status; 1301a9de9248SMarcel Holtmann __u8 hci_ver; 1302a9de9248SMarcel Holtmann __le16 hci_rev; 1303a9de9248SMarcel Holtmann __u8 lmp_ver; 1304a9de9248SMarcel Holtmann __le16 manufacturer; 1305a9de9248SMarcel Holtmann __le16 lmp_subver; 130666c853ccSGustavo F. Padovan } __packed; 13071da177e4SLinus Torvalds 1308a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1309a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 13101da177e4SLinus Torvalds __u8 status; 1311a9de9248SMarcel Holtmann __u8 commands[64]; 131266c853ccSGustavo F. Padovan } __packed; 13131da177e4SLinus Torvalds 1314a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1315a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1316a9de9248SMarcel Holtmann __u8 status; 1317a9de9248SMarcel Holtmann __u8 features[8]; 131866c853ccSGustavo F. Padovan } __packed; 1319a9de9248SMarcel Holtmann 1320a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1321971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1322971e3a4bSAndre Guedes __u8 page; 1323971e3a4bSAndre Guedes } __packed; 1324a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1325a9de9248SMarcel Holtmann __u8 status; 1326a9de9248SMarcel Holtmann __u8 page; 1327a9de9248SMarcel Holtmann __u8 max_page; 1328a9de9248SMarcel Holtmann __u8 features[8]; 132966c853ccSGustavo F. Padovan } __packed; 1330a9de9248SMarcel Holtmann 1331a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1332a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1333a9de9248SMarcel Holtmann __u8 status; 1334a9de9248SMarcel Holtmann __le16 acl_mtu; 1335a9de9248SMarcel Holtmann __u8 sco_mtu; 1336a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1337a9de9248SMarcel Holtmann __le16 sco_max_pkt; 133866c853ccSGustavo F. Padovan } __packed; 1339a9de9248SMarcel Holtmann 1340a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1341a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1342a9de9248SMarcel Holtmann __u8 status; 13431da177e4SLinus Torvalds bdaddr_t bdaddr; 134466c853ccSGustavo F. Padovan } __packed; 13451da177e4SLinus Torvalds 1346350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1347350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1348350ee4cfSAndrei Emeltchenko __u8 status; 1349350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1350350ee4cfSAndrei Emeltchenko __le16 block_len; 1351350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1352350ee4cfSAndrei Emeltchenko } __packed; 1353350ee4cfSAndrei Emeltchenko 1354109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 13558961987fSKiran K struct hci_std_codecs { 13568961987fSKiran K __u8 num; 13578961987fSKiran K __u8 codec[]; 13588961987fSKiran K } __packed; 13598961987fSKiran K 13608961987fSKiran K struct hci_vnd_codec { 13618961987fSKiran K /* company id */ 13628961987fSKiran K __le16 cid; 13638961987fSKiran K /* vendor codec id */ 13648961987fSKiran K __le16 vid; 13658961987fSKiran K } __packed; 13668961987fSKiran K 13678961987fSKiran K struct hci_vnd_codecs { 13688961987fSKiran K __u8 num; 13698961987fSKiran K struct hci_vnd_codec codec[]; 13708961987fSKiran K } __packed; 13718961987fSKiran K 13728961987fSKiran K struct hci_rp_read_local_supported_codecs { 13738961987fSKiran K __u8 status; 13748961987fSKiran K struct hci_std_codecs std_codecs; 13758961987fSKiran K struct hci_vnd_codecs vnd_codecs; 13768961987fSKiran K } __packed; 1377109e3191SMarcel Holtmann 1378a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c 1379a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts { 1380a4790360SMarcel Holtmann __u8 status; 1381a4790360SMarcel Holtmann __u8 pairing_opts; 1382a4790360SMarcel Holtmann __u8 max_key_size; 1383a4790360SMarcel Holtmann } __packed; 1384a4790360SMarcel Holtmann 13859ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2 0x100d 13869ae66402SKiran K struct hci_std_codec_v2 { 13879ae66402SKiran K __u8 id; 13889ae66402SKiran K __u8 transport; 13899ae66402SKiran K } __packed; 13909ae66402SKiran K 13919ae66402SKiran K struct hci_std_codecs_v2 { 13929ae66402SKiran K __u8 num; 13939ae66402SKiran K struct hci_std_codec_v2 codec[]; 13949ae66402SKiran K } __packed; 13959ae66402SKiran K 13969ae66402SKiran K struct hci_vnd_codec_v2 { 13979ae66402SKiran K __u8 id; 13989ae66402SKiran K __le16 cid; 13999ae66402SKiran K __le16 vid; 14009ae66402SKiran K __u8 transport; 14019ae66402SKiran K } __packed; 14029ae66402SKiran K 14039ae66402SKiran K struct hci_vnd_codecs_v2 { 14049ae66402SKiran K __u8 num; 14059ae66402SKiran K struct hci_vnd_codec_v2 codec[]; 14069ae66402SKiran K } __packed; 14079ae66402SKiran K 14089ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 { 14099ae66402SKiran K __u8 status; 14109ae66402SKiran K struct hci_std_codecs_v2 std_codecs; 14119ae66402SKiran K struct hci_vnd_codecs_v2 vendor_codecs; 14129ae66402SKiran K } __packed; 14139ae66402SKiran K 14148961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS 0x100e 14158961987fSKiran K struct hci_op_read_local_codec_caps { 14168961987fSKiran K __u8 id; 14178961987fSKiran K __le16 cid; 14188961987fSKiran K __le16 vid; 14198961987fSKiran K __u8 transport; 14208961987fSKiran K __u8 direction; 14218961987fSKiran K } __packed; 14228961987fSKiran K 14238961987fSKiran K struct hci_codec_caps { 14248961987fSKiran K __u8 len; 14258961987fSKiran K __u8 data[]; 14268961987fSKiran K } __packed; 14278961987fSKiran K 14288961987fSKiran K struct hci_rp_read_local_codec_caps { 14298961987fSKiran K __u8 status; 14308961987fSKiran K __u8 num_caps; 14318961987fSKiran K } __packed; 14328961987fSKiran K 1433f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1434f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1435f332ec66SJohan Hedberg __u8 status; 1436f332ec66SJohan Hedberg __le16 interval; 1437f332ec66SJohan Hedberg __le16 window; 1438f332ec66SJohan Hedberg } __packed; 1439f332ec66SJohan Hedberg 1440f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1441f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1442f6422ec6SAntti Julku __le16 interval; 1443f6422ec6SAntti Julku __le16 window; 1444f6422ec6SAntti Julku } __packed; 1445f6422ec6SAntti Julku 14465a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 14475a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 14485a134faeSAndrzej Kaczmarek __le16 handle; 14495a134faeSAndrzej Kaczmarek __u8 type; 14505a134faeSAndrzej Kaczmarek } __packed; 14515a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 14525a134faeSAndrzej Kaczmarek __u8 status; 14535a134faeSAndrzej Kaczmarek __le16 handle; 14545a134faeSAndrzej Kaczmarek __s8 tx_power; 14555a134faeSAndrzej Kaczmarek } __packed; 14565a134faeSAndrzej Kaczmarek 1457f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1458f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1459f332ec66SJohan Hedberg __u8 status; 1460f332ec66SJohan Hedberg __u8 type; 1461f332ec66SJohan Hedberg } __packed; 1462f332ec66SJohan Hedberg 1463f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1464f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1465f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1466f6422ec6SAntti Julku 14675ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 14685ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 14695ae76a94SAndrzej Kaczmarek __le16 handle; 14705ae76a94SAndrzej Kaczmarek } __packed; 14715ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 14725ae76a94SAndrzej Kaczmarek __u8 status; 14735ae76a94SAndrzej Kaczmarek __le16 handle; 14745ae76a94SAndrzej Kaczmarek __s8 rssi; 14755ae76a94SAndrzej Kaczmarek } __packed; 14765ae76a94SAndrzej Kaczmarek 147733f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 147833f35721SJohan Hedberg struct hci_cp_read_clock { 147933f35721SJohan Hedberg __le16 handle; 148033f35721SJohan Hedberg __u8 which; 148133f35721SJohan Hedberg } __packed; 148233f35721SJohan Hedberg struct hci_rp_read_clock { 148333f35721SJohan Hedberg __u8 status; 148433f35721SJohan Hedberg __le16 handle; 148533f35721SJohan Hedberg __le32 clock; 148633f35721SJohan Hedberg __le16 accuracy; 148733f35721SJohan Hedberg } __packed; 148833f35721SJohan Hedberg 1489821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1490821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1491821f3766SJohan Hedberg __le16 handle; 1492821f3766SJohan Hedberg } __packed; 1493821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1494821f3766SJohan Hedberg __u8 status; 1495821f3766SJohan Hedberg __le16 handle; 1496821f3766SJohan Hedberg __u8 key_size; 1497821f3766SJohan Hedberg } __packed; 1498821f3766SJohan Hedberg 1499928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1500928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1501928abaa7SAndrei Emeltchenko __u8 status; 1502928abaa7SAndrei Emeltchenko __u8 amp_status; 1503928abaa7SAndrei Emeltchenko __le32 total_bw; 1504928abaa7SAndrei Emeltchenko __le32 max_bw; 1505928abaa7SAndrei Emeltchenko __le32 min_latency; 1506928abaa7SAndrei Emeltchenko __le32 max_pdu; 1507928abaa7SAndrei Emeltchenko __u8 amp_type; 1508928abaa7SAndrei Emeltchenko __le16 pal_cap; 1509928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1510928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1511928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1512928abaa7SAndrei Emeltchenko } __packed; 1513928abaa7SAndrei Emeltchenko 1514523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1515523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1516523e93cdSAndrei Emeltchenko __u8 phy_handle; 1517523e93cdSAndrei Emeltchenko __le16 len_so_far; 1518523e93cdSAndrei Emeltchenko __le16 max_len; 1519523e93cdSAndrei Emeltchenko } __packed; 1520523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1521523e93cdSAndrei Emeltchenko __u8 status; 1522523e93cdSAndrei Emeltchenko __u8 phy_handle; 1523523e93cdSAndrei Emeltchenko __le16 rem_len; 1524a7e45454SGustavo A. R. Silva __u8 frag[]; 1525523e93cdSAndrei Emeltchenko } __packed; 1526523e93cdSAndrei Emeltchenko 1527523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1528523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1529523e93cdSAndrei Emeltchenko __u8 phy_handle; 1530523e93cdSAndrei Emeltchenko __le16 len_so_far; 1531523e93cdSAndrei Emeltchenko __le16 rem_len; 1532a7e45454SGustavo A. R. Silva __u8 frag[]; 1533523e93cdSAndrei Emeltchenko } __packed; 1534523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1535523e93cdSAndrei Emeltchenko __u8 status; 1536523e93cdSAndrei Emeltchenko __u8 phy_handle; 1537523e93cdSAndrei Emeltchenko } __packed; 1538523e93cdSAndrei Emeltchenko 1539f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1540f4fe73edSMarcel Holtmann 15414b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 15424b4148e9SMarcel Holtmann 154306f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 154406f5b778SMarcel Holtmann 154563185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 154663185f64SVille Tervo struct hci_cp_le_set_event_mask { 154763185f64SVille Tervo __u8 mask[8]; 154863185f64SVille Tervo } __packed; 154963185f64SVille Tervo 155063185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 155163185f64SVille Tervo struct hci_rp_le_read_buffer_size { 155263185f64SVille Tervo __u8 status; 155363185f64SVille Tervo __le16 le_mtu; 155463185f64SVille Tervo __u8 le_max_pkt; 155563185f64SVille Tervo } __packed; 155663185f64SVille Tervo 155760e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 155860e77321SJohan Hedberg struct hci_rp_le_read_local_features { 155960e77321SJohan Hedberg __u8 status; 156060e77321SJohan Hedberg __u8 features[8]; 156160e77321SJohan Hedberg } __packed; 156260e77321SJohan Hedberg 1563d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1564d13eafceSMarcel Holtmann 15651e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 15661e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 15671e191893SMarcel Holtmann __le16 min_interval; 15681e191893SMarcel Holtmann __le16 max_interval; 15691e191893SMarcel Holtmann __u8 type; 15701e191893SMarcel Holtmann __u8 own_address_type; 15711e191893SMarcel Holtmann __u8 direct_addr_type; 15721e191893SMarcel Holtmann bdaddr_t direct_addr; 15731e191893SMarcel Holtmann __u8 channel_map; 15741e191893SMarcel Holtmann __u8 filter_policy; 15751e191893SMarcel Holtmann } __packed; 15761e191893SMarcel Holtmann 15778fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 15788fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 15798fa19098SJohan Hedberg __u8 status; 15808fa19098SJohan Hedberg __s8 tx_power; 15818fa19098SJohan Hedberg } __packed; 15828fa19098SJohan Hedberg 15833f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 15843f0f524bSJohan Hedberg 15853f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 15863f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 15873f0f524bSJohan Hedberg __u8 length; 15883f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 15893f0f524bSJohan Hedberg } __packed; 15903f0f524bSJohan Hedberg 1591f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1592f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1593f14d8f64SMarcel Holtmann __u8 length; 1594f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1595f14d8f64SMarcel Holtmann } __packed; 1596f14d8f64SMarcel Holtmann 1597c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1598c1d5dc4aSJohan Hedberg 15995df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 16005df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 16015df480b5SAndre Guedes 160207f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 160307f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 160407f7fa5dSAndre Guedes __u8 type; 160507f7fa5dSAndre Guedes __le16 interval; 160607f7fa5dSAndre Guedes __le16 window; 160707f7fa5dSAndre Guedes __u8 own_address_type; 160807f7fa5dSAndre Guedes __u8 filter_policy; 160907f7fa5dSAndre Guedes } __packed; 161007f7fa5dSAndre Guedes 161176a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 161276a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1613525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1614525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 161568a8aea4SAndrei Emeltchenko 1616eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1617eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1618eb9d91f5SAndre Guedes __u8 enable; 1619eb9d91f5SAndre Guedes __u8 filter_dup; 1620eb9d91f5SAndre Guedes } __packed; 1621eb9d91f5SAndre Guedes 1622a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 16233d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST 0x01 1624a7139eddSJohan Hedberg 162563185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 162663185f64SVille Tervo struct hci_cp_le_create_conn { 162763185f64SVille Tervo __le16 scan_interval; 162863185f64SVille Tervo __le16 scan_window; 162963185f64SVille Tervo __u8 filter_policy; 163063185f64SVille Tervo __u8 peer_addr_type; 163163185f64SVille Tervo bdaddr_t peer_addr; 163263185f64SVille Tervo __u8 own_address_type; 163363185f64SVille Tervo __le16 conn_interval_min; 163463185f64SVille Tervo __le16 conn_interval_max; 163563185f64SVille Tervo __le16 conn_latency; 163663185f64SVille Tervo __le16 supervision_timeout; 163763185f64SVille Tervo __le16 min_ce_len; 163863185f64SVille Tervo __le16 max_ce_len; 163963185f64SVille Tervo } __packed; 164063185f64SVille Tervo 164163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 164263185f64SVille Tervo 16433d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE 0x200f 16443d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size { 1645cf1d081fSJohan Hedberg __u8 status; 1646cf1d081fSJohan Hedberg __u8 size; 1647cf1d081fSJohan Hedberg } __packed; 1648cf1d081fSJohan Hedberg 16493d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST 0x2010 1650d9a7b0a5SMarcel Holtmann 16513d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST 0x2011 16523d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list { 1653d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1654d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1655d9a7b0a5SMarcel Holtmann } __packed; 1656d9a7b0a5SMarcel Holtmann 16573d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST 0x2012 16583d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list { 1659d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1660d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1661d9a7b0a5SMarcel Holtmann } __packed; 1662d9a7b0a5SMarcel Holtmann 16632ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 16642ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 16652ce603ebSClaudio Takahasi __le16 handle; 16662ce603ebSClaudio Takahasi __le16 conn_interval_min; 16672ce603ebSClaudio Takahasi __le16 conn_interval_max; 16682ce603ebSClaudio Takahasi __le16 conn_latency; 16692ce603ebSClaudio Takahasi __le16 supervision_timeout; 16702ce603ebSClaudio Takahasi __le16 min_ce_len; 16712ce603ebSClaudio Takahasi __le16 max_ce_len; 16722ce603ebSClaudio Takahasi } __packed; 16732ce603ebSClaudio Takahasi 16740fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 16750fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 16760fe29fd1SMarcel Holtmann __le16 handle; 16770fe29fd1SMarcel Holtmann } __packed; 16780fe29fd1SMarcel Holtmann 1679a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1680a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1681a7a595f6SVinicius Costa Gomes __le16 handle; 1682fe39c7b2SMarcel Holtmann __le64 rand; 1683a7a595f6SVinicius Costa Gomes __le16 ediv; 1684a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1685a7a595f6SVinicius Costa Gomes } __packed; 1686a7a595f6SVinicius Costa Gomes 1687a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1688a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1689a7a595f6SVinicius Costa Gomes __le16 handle; 1690a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1691a7a595f6SVinicius Costa Gomes } __packed; 1692a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1693a7a595f6SVinicius Costa Gomes __u8 status; 1694a7a595f6SVinicius Costa Gomes __le16 handle; 1695a7a595f6SVinicius Costa Gomes } __packed; 1696a7a595f6SVinicius Costa Gomes 1697a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1698a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1699a7a595f6SVinicius Costa Gomes __le16 handle; 1700a7a595f6SVinicius Costa Gomes } __packed; 1701a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1702a7a595f6SVinicius Costa Gomes __u8 status; 1703a7a595f6SVinicius Costa Gomes __le16 handle; 1704a7a595f6SVinicius Costa Gomes } __packed; 1705a7a595f6SVinicius Costa Gomes 17069b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 17079b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 17089b008c04SJohan Hedberg __u8 status; 17099b008c04SJohan Hedberg __u8 le_states[8]; 17109b008c04SJohan Hedberg } __packed; 17119b008c04SJohan Hedberg 17128e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 17138e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 17148e75b46aSAndre Guedes __le16 handle; 17158e75b46aSAndre Guedes __le16 interval_min; 17168e75b46aSAndre Guedes __le16 interval_max; 17178e75b46aSAndre Guedes __le16 latency; 17188e75b46aSAndre Guedes __le16 timeout; 17198e75b46aSAndre Guedes __le16 min_ce_len; 17208e75b46aSAndre Guedes __le16 max_ce_len; 17218e75b46aSAndre Guedes } __packed; 17228e75b46aSAndre Guedes 17238e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 17248e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 17258e75b46aSAndre Guedes __le16 handle; 17268e75b46aSAndre Guedes __u8 reason; 17278e75b46aSAndre Guedes } __packed; 17288e75b46aSAndre Guedes 172994a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 173094a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 173194a3bd02SMarcel Holtmann __le16 handle; 173294a3bd02SMarcel Holtmann __le16 tx_len; 173394a3bd02SMarcel Holtmann __le16 tx_time; 173494a3bd02SMarcel Holtmann } __packed; 173594a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 173694a3bd02SMarcel Holtmann __u8 status; 173794a3bd02SMarcel Holtmann __le16 handle; 173894a3bd02SMarcel Holtmann } __packed; 173994a3bd02SMarcel Holtmann 174094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 174194a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 174294a3bd02SMarcel Holtmann __u8 status; 174394a3bd02SMarcel Holtmann __le16 tx_len; 174494a3bd02SMarcel Holtmann __le16 tx_time; 174594a3bd02SMarcel Holtmann } __packed; 174694a3bd02SMarcel Holtmann 174794a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 174894a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 174994a3bd02SMarcel Holtmann __le16 tx_len; 175094a3bd02SMarcel Holtmann __le16 tx_time; 175194a3bd02SMarcel Holtmann } __packed; 175294a3bd02SMarcel Holtmann 1753b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1754b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1755b950aa88SAnkit Navik __u8 bdaddr_type; 1756b950aa88SAnkit Navik bdaddr_t bdaddr; 1757b950aa88SAnkit Navik __u8 peer_irk[16]; 1758b950aa88SAnkit Navik __u8 local_irk[16]; 1759b950aa88SAnkit Navik } __packed; 1760b950aa88SAnkit Navik 1761b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1762b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1763b950aa88SAnkit Navik __u8 bdaddr_type; 1764b950aa88SAnkit Navik bdaddr_t bdaddr; 1765b950aa88SAnkit Navik } __packed; 1766b950aa88SAnkit Navik 1767545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1768545f2596SAnkit Navik 1769cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1770cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1771cfdb0c2dSAnkit Navik __u8 status; 1772cfdb0c2dSAnkit Navik __u8 size; 1773cfdb0c2dSAnkit Navik } __packed; 1774cfdb0c2dSAnkit Navik 1775aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1776aa12af77SAnkit Navik 1777b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e 1778b2cc2339SSathish Narasimman 177994a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 178094a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 178194a3bd02SMarcel Holtmann __u8 status; 178294a3bd02SMarcel Holtmann __le16 tx_len; 178394a3bd02SMarcel Holtmann __le16 tx_time; 178494a3bd02SMarcel Holtmann __le16 rx_len; 178594a3bd02SMarcel Holtmann __le16 rx_time; 178694a3bd02SMarcel Holtmann } __packed; 178794a3bd02SMarcel Holtmann 1788de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1789de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1790de2ba303SMarcel Holtmann __u8 all_phys; 1791de2ba303SMarcel Holtmann __u8 tx_phys; 1792de2ba303SMarcel Holtmann __u8 rx_phys; 1793de2ba303SMarcel Holtmann } __packed; 1794de2ba303SMarcel Holtmann 17956decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 17966decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 17976decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 17986decb5b4SJaganath Kanakkassery 1799a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1800a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1801a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1802a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1803a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1804a7e45454SGustavo A. R. Silva __u8 data[]; 1805a2344b9eSJaganath Kanakkassery } __packed; 1806a2344b9eSJaganath Kanakkassery 1807a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 180845bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 180945bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1810a2344b9eSJaganath Kanakkassery 1811a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1812a2344b9eSJaganath Kanakkassery __u8 type; 1813a2344b9eSJaganath Kanakkassery __le16 interval; 1814a2344b9eSJaganath Kanakkassery __le16 window; 1815a2344b9eSJaganath Kanakkassery } __packed; 1816a2344b9eSJaganath Kanakkassery 1817a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1818a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1819a2344b9eSJaganath Kanakkassery __u8 enable; 1820a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1821a2344b9eSJaganath Kanakkassery __le16 duration; 1822a2344b9eSJaganath Kanakkassery __le16 period; 1823a2344b9eSJaganath Kanakkassery } __packed; 1824a2344b9eSJaganath Kanakkassery 18254d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 18264d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 18274d94f95dSJaganath Kanakkassery __u8 filter_policy; 18284d94f95dSJaganath Kanakkassery __u8 own_addr_type; 18294d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 18304d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 18314d94f95dSJaganath Kanakkassery __u8 phys; 1832a7e45454SGustavo A. R. Silva __u8 data[]; 18334d94f95dSJaganath Kanakkassery } __packed; 18344d94f95dSJaganath Kanakkassery 18354d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 18364d94f95dSJaganath Kanakkassery __le16 scan_interval; 18374d94f95dSJaganath Kanakkassery __le16 scan_window; 18384d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 18394d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 18404d94f95dSJaganath Kanakkassery __le16 conn_latency; 18414d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 18424d94f95dSJaganath Kanakkassery __le16 min_ce_len; 18434d94f95dSJaganath Kanakkassery __le16 max_ce_len; 18444d94f95dSJaganath Kanakkassery } __packed; 18454d94f95dSJaganath Kanakkassery 18466b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 18476b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 18486b49bcb4SJaganath Kanakkassery __u8 status; 18496b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 18506b49bcb4SJaganath Kanakkassery } __packed; 18516b49bcb4SJaganath Kanakkassery 1852de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1853de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1854de181e88SJaganath Kanakkassery __u8 handle; 1855de181e88SJaganath Kanakkassery __le16 evt_properties; 1856de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1857de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1858de181e88SJaganath Kanakkassery __u8 channel_map; 1859de181e88SJaganath Kanakkassery __u8 own_addr_type; 1860de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1861de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1862de181e88SJaganath Kanakkassery __u8 filter_policy; 1863de181e88SJaganath Kanakkassery __u8 tx_power; 1864de181e88SJaganath Kanakkassery __u8 primary_phy; 1865de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1866de181e88SJaganath Kanakkassery __u8 secondary_phy; 1867de181e88SJaganath Kanakkassery __u8 sid; 1868de181e88SJaganath Kanakkassery __u8 notif_enable; 1869de181e88SJaganath Kanakkassery } __packed; 1870de181e88SJaganath Kanakkassery 1871de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 187285a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 187385a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1874de181e88SJaganath Kanakkassery 1875de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1876de181e88SJaganath Kanakkassery __u8 status; 1877de181e88SJaganath Kanakkassery __u8 tx_power; 1878de181e88SJaganath Kanakkassery } __packed; 1879de181e88SJaganath Kanakkassery 1880de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1881de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1882de181e88SJaganath Kanakkassery __u8 enable; 1883de181e88SJaganath Kanakkassery __u8 num_of_sets; 1884a7e45454SGustavo A. R. Silva __u8 data[]; 1885de181e88SJaganath Kanakkassery } __packed; 1886de181e88SJaganath Kanakkassery 1887de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1888de181e88SJaganath Kanakkassery __u8 handle; 1889de181e88SJaganath Kanakkassery __le16 duration; 1890de181e88SJaganath Kanakkassery __u8 max_events; 1891de181e88SJaganath Kanakkassery } __packed; 1892de181e88SJaganath Kanakkassery 1893c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH 251 1894c9ed0a70SLuiz Augusto von Dentz 1895a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1896a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1897a0fb3726SJaganath Kanakkassery __u8 handle; 1898a0fb3726SJaganath Kanakkassery __u8 operation; 1899a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1900a0fb3726SJaganath Kanakkassery __u8 length; 1901c9ed0a70SLuiz Augusto von Dentz __u8 data[]; 1902a0fb3726SJaganath Kanakkassery } __packed; 1903a0fb3726SJaganath Kanakkassery 1904a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1905a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1906a0fb3726SJaganath Kanakkassery __u8 handle; 1907a0fb3726SJaganath Kanakkassery __u8 operation; 1908a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1909a0fb3726SJaganath Kanakkassery __u8 length; 1910c9ed0a70SLuiz Augusto von Dentz __u8 data[]; 1911a0fb3726SJaganath Kanakkassery } __packed; 1912a0fb3726SJaganath Kanakkassery 1913a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1914a0fb3726SJaganath Kanakkassery 1915a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1916a0fb3726SJaganath Kanakkassery 1917a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET 0x203c 1918a9e45698SSathish Narsimman 191945b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 192045b7749fSJaganath Kanakkassery 1921a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1922a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1923a73c046aSJaganath Kanakkassery __u8 handle; 1924a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1925a73c046aSJaganath Kanakkassery } __packed; 1926a73c046aSJaganath Kanakkassery 19277c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 19287c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power { 19297c395ea5SDaniel Winkler __u8 status; 19307c395ea5SDaniel Winkler __s8 min_le_tx_power; 19317c395ea5SDaniel Winkler __s8 max_le_tx_power; 19327c395ea5SDaniel Winkler } __packed; 19337c395ea5SDaniel Winkler 19344de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 19354de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 { 19364de0fc59SLuiz Augusto von Dentz __u8 status; 19374de0fc59SLuiz Augusto von Dentz __le16 acl_mtu; 19384de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt; 19394de0fc59SLuiz Augusto von Dentz __le16 iso_mtu; 19404de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt; 19414de0fc59SLuiz Augusto von Dentz } __packed; 19424de0fc59SLuiz Augusto von Dentz 19434de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 19444de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync { 19454de0fc59SLuiz Augusto von Dentz __le16 handle; 19464de0fc59SLuiz Augusto von Dentz } __packed; 19474de0fc59SLuiz Augusto von Dentz 19484de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync { 19494de0fc59SLuiz Augusto von Dentz __u8 status; 19504de0fc59SLuiz Augusto von Dentz __le16 handle; 19514de0fc59SLuiz Augusto von Dentz __le16 seq; 19524de0fc59SLuiz Augusto von Dentz __le32 imestamp; 19534de0fc59SLuiz Augusto von Dentz __u8 offset[3]; 19544de0fc59SLuiz Augusto von Dentz } __packed; 19554de0fc59SLuiz Augusto von Dentz 19564de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062 19574de0fc59SLuiz Augusto von Dentz struct hci_cis_params { 19584de0fc59SLuiz Augusto von Dentz __u8 cis_id; 195976c185a5SArchie Pusaka __le16 c_sdu; 196076c185a5SArchie Pusaka __le16 p_pdu; 196176c185a5SArchie Pusaka __u8 c_phy; 196276c185a5SArchie Pusaka __u8 p_phy; 196376c185a5SArchie Pusaka __u8 c_rtn; 196476c185a5SArchie Pusaka __u8 p_rtn; 19654de0fc59SLuiz Augusto von Dentz } __packed; 19664de0fc59SLuiz Augusto von Dentz 19674de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params { 19684de0fc59SLuiz Augusto von Dentz __u8 cig_id; 196976c185a5SArchie Pusaka __u8 c_interval[3]; 197076c185a5SArchie Pusaka __u8 p_interval[3]; 197176c185a5SArchie Pusaka __u8 wc_sca; 19724de0fc59SLuiz Augusto von Dentz __u8 packing; 19734de0fc59SLuiz Augusto von Dentz __u8 framing; 197476c185a5SArchie Pusaka __le16 c_latency; 197576c185a5SArchie Pusaka __le16 p_latency; 19764de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1977a7e45454SGustavo A. R. Silva struct hci_cis_params cis[]; 19784de0fc59SLuiz Augusto von Dentz } __packed; 19794de0fc59SLuiz Augusto von Dentz 19804de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params { 19814de0fc59SLuiz Augusto von Dentz __u8 status; 19824de0fc59SLuiz Augusto von Dentz __u8 cig_id; 19834de0fc59SLuiz Augusto von Dentz __u8 num_handles; 1984a7e45454SGustavo A. R. Silva __le16 handle[]; 19854de0fc59SLuiz Augusto von Dentz } __packed; 19864de0fc59SLuiz Augusto von Dentz 19874de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064 19884de0fc59SLuiz Augusto von Dentz struct hci_cis { 19894de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 19904de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 19914de0fc59SLuiz Augusto von Dentz } __packed; 19924de0fc59SLuiz Augusto von Dentz 19934de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis { 19944de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1995a7e45454SGustavo A. R. Silva struct hci_cis cis[]; 19964de0fc59SLuiz Augusto von Dentz } __packed; 19974de0fc59SLuiz Augusto von Dentz 19984de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065 19994de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig { 20004de0fc59SLuiz Augusto von Dentz __u8 cig_id; 20014de0fc59SLuiz Augusto von Dentz } __packed; 20024de0fc59SLuiz Augusto von Dentz 20034de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066 20044de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis { 20054de0fc59SLuiz Augusto von Dentz __le16 handle; 20064de0fc59SLuiz Augusto von Dentz } __packed; 20074de0fc59SLuiz Augusto von Dentz 20084de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067 20094de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis { 20104de0fc59SLuiz Augusto von Dentz __le16 handle; 20114de0fc59SLuiz Augusto von Dentz __u8 reason; 20124de0fc59SLuiz Augusto von Dentz } __packed; 20134de0fc59SLuiz Augusto von Dentz 20141da177e4SLinus Torvalds /* ---- HCI Events ---- */ 20151da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 20161da177e4SLinus Torvalds 20171da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 20181da177e4SLinus Torvalds struct inquiry_info { 20191da177e4SLinus Torvalds bdaddr_t bdaddr; 20201da177e4SLinus Torvalds __u8 pscan_rep_mode; 20211da177e4SLinus Torvalds __u8 pscan_period_mode; 20221da177e4SLinus Torvalds __u8 pscan_mode; 20231da177e4SLinus Torvalds __u8 dev_class[3]; 20241ebb9252SMarcel Holtmann __le16 clock_offset; 202566c853ccSGustavo F. Padovan } __packed; 20261da177e4SLinus Torvalds 20271da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 20281da177e4SLinus Torvalds struct hci_ev_conn_complete { 20291da177e4SLinus Torvalds __u8 status; 20301ebb9252SMarcel Holtmann __le16 handle; 20311da177e4SLinus Torvalds bdaddr_t bdaddr; 20321da177e4SLinus Torvalds __u8 link_type; 20331da177e4SLinus Torvalds __u8 encr_mode; 203466c853ccSGustavo F. Padovan } __packed; 20351da177e4SLinus Torvalds 20361da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 20371da177e4SLinus Torvalds struct hci_ev_conn_request { 20381da177e4SLinus Torvalds bdaddr_t bdaddr; 20391da177e4SLinus Torvalds __u8 dev_class[3]; 20401da177e4SLinus Torvalds __u8 link_type; 204166c853ccSGustavo F. Padovan } __packed; 20421da177e4SLinus Torvalds 20431da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 20441da177e4SLinus Torvalds struct hci_ev_disconn_complete { 20451da177e4SLinus Torvalds __u8 status; 20461ebb9252SMarcel Holtmann __le16 handle; 20471da177e4SLinus Torvalds __u8 reason; 204866c853ccSGustavo F. Padovan } __packed; 20491da177e4SLinus Torvalds 20501da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 20511da177e4SLinus Torvalds struct hci_ev_auth_complete { 20521da177e4SLinus Torvalds __u8 status; 20531ebb9252SMarcel Holtmann __le16 handle; 205466c853ccSGustavo F. Padovan } __packed; 20551da177e4SLinus Torvalds 2056a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 2057a9de9248SMarcel Holtmann struct hci_ev_remote_name { 2058a9de9248SMarcel Holtmann __u8 status; 2059a9de9248SMarcel Holtmann bdaddr_t bdaddr; 20601f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 206166c853ccSGustavo F. Padovan } __packed; 2062a9de9248SMarcel Holtmann 20631da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 20641da177e4SLinus Torvalds struct hci_ev_encrypt_change { 20651da177e4SLinus Torvalds __u8 status; 20661ebb9252SMarcel Holtmann __le16 handle; 20671da177e4SLinus Torvalds __u8 encrypt; 206866c853ccSGustavo F. Padovan } __packed; 20691da177e4SLinus Torvalds 2070a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 2071a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 20721da177e4SLinus Torvalds __u8 status; 20731ebb9252SMarcel Holtmann __le16 handle; 207466c853ccSGustavo F. Padovan } __packed; 20751da177e4SLinus Torvalds 2076a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 2077a9de9248SMarcel Holtmann struct hci_ev_remote_features { 2078a9de9248SMarcel Holtmann __u8 status; 2079a9de9248SMarcel Holtmann __le16 handle; 2080a9de9248SMarcel Holtmann __u8 features[8]; 208166c853ccSGustavo F. Padovan } __packed; 2082a9de9248SMarcel Holtmann 2083a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 2084a9de9248SMarcel Holtmann struct hci_ev_remote_version { 2085a9de9248SMarcel Holtmann __u8 status; 2086a9de9248SMarcel Holtmann __le16 handle; 2087a9de9248SMarcel Holtmann __u8 lmp_ver; 2088a9de9248SMarcel Holtmann __le16 manufacturer; 2089a9de9248SMarcel Holtmann __le16 lmp_subver; 209066c853ccSGustavo F. Padovan } __packed; 2091a9de9248SMarcel Holtmann 2092a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 20931da177e4SLinus Torvalds struct hci_qos { 20941da177e4SLinus Torvalds __u8 service_type; 20951da177e4SLinus Torvalds __u32 token_rate; 20961da177e4SLinus Torvalds __u32 peak_bandwidth; 20971da177e4SLinus Torvalds __u32 latency; 20981da177e4SLinus Torvalds __u32 delay_variation; 209966c853ccSGustavo F. Padovan } __packed; 21001da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 21011da177e4SLinus Torvalds __u8 status; 21021ebb9252SMarcel Holtmann __le16 handle; 21031da177e4SLinus Torvalds struct hci_qos qos; 210466c853ccSGustavo F. Padovan } __packed; 21051da177e4SLinus Torvalds 2106a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 21071da177e4SLinus Torvalds struct hci_ev_cmd_complete { 21081da177e4SLinus Torvalds __u8 ncmd; 21091ebb9252SMarcel Holtmann __le16 opcode; 211066c853ccSGustavo F. Padovan } __packed; 21111da177e4SLinus Torvalds 2112a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 21131da177e4SLinus Torvalds struct hci_ev_cmd_status { 21141da177e4SLinus Torvalds __u8 status; 21151da177e4SLinus Torvalds __u8 ncmd; 21161ebb9252SMarcel Holtmann __le16 opcode; 211766c853ccSGustavo F. Padovan } __packed; 21181da177e4SLinus Torvalds 211924dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 212024dfa343SMarcel Holtmann struct hci_ev_hardware_error { 212124dfa343SMarcel Holtmann __u8 code; 212224dfa343SMarcel Holtmann } __packed; 212324dfa343SMarcel Holtmann 21241da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 21251da177e4SLinus Torvalds struct hci_ev_role_change { 21261da177e4SLinus Torvalds __u8 status; 21271da177e4SLinus Torvalds bdaddr_t bdaddr; 21281da177e4SLinus Torvalds __u8 role; 212966c853ccSGustavo F. Padovan } __packed; 21301da177e4SLinus Torvalds 2131a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 2132613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 2133613a1c0cSAndrei Emeltchenko __le16 handle; 2134613a1c0cSAndrei Emeltchenko __le16 count; 2135613a1c0cSAndrei Emeltchenko } __packed; 2136613a1c0cSAndrei Emeltchenko 2137a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 2138a9de9248SMarcel Holtmann __u8 num_hndl; 2139a7e45454SGustavo A. R. Silva struct hci_comp_pkts_info handles[]; 214066c853ccSGustavo F. Padovan } __packed; 2141a9de9248SMarcel Holtmann 21421da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 21431da177e4SLinus Torvalds struct hci_ev_mode_change { 21441da177e4SLinus Torvalds __u8 status; 21451ebb9252SMarcel Holtmann __le16 handle; 21461da177e4SLinus Torvalds __u8 mode; 21471ebb9252SMarcel Holtmann __le16 interval; 214866c853ccSGustavo F. Padovan } __packed; 21491da177e4SLinus Torvalds 21501da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 21511da177e4SLinus Torvalds struct hci_ev_pin_code_req { 21521da177e4SLinus Torvalds bdaddr_t bdaddr; 215366c853ccSGustavo F. Padovan } __packed; 21541da177e4SLinus Torvalds 21551da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 21561da177e4SLinus Torvalds struct hci_ev_link_key_req { 21571da177e4SLinus Torvalds bdaddr_t bdaddr; 215866c853ccSGustavo F. Padovan } __packed; 21591da177e4SLinus Torvalds 21601da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 21611da177e4SLinus Torvalds struct hci_ev_link_key_notify { 21621da177e4SLinus Torvalds bdaddr_t bdaddr; 21639b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 21641da177e4SLinus Torvalds __u8 key_type; 216566c853ccSGustavo F. Padovan } __packed; 21661da177e4SLinus Torvalds 2167a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 21681da177e4SLinus Torvalds struct hci_ev_clock_offset { 21691da177e4SLinus Torvalds __u8 status; 21701ebb9252SMarcel Holtmann __le16 handle; 21711ebb9252SMarcel Holtmann __le16 clock_offset; 217266c853ccSGustavo F. Padovan } __packed; 21731da177e4SLinus Torvalds 2174a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 2175a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 2176a8746417SMarcel Holtmann __u8 status; 2177a8746417SMarcel Holtmann __le16 handle; 2178a8746417SMarcel Holtmann __le16 pkt_type; 217966c853ccSGustavo F. Padovan } __packed; 2180a8746417SMarcel Holtmann 218185a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 218285a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 218385a1e930SMarcel Holtmann bdaddr_t bdaddr; 218485a1e930SMarcel Holtmann __u8 pscan_rep_mode; 218566c853ccSGustavo F. Padovan } __packed; 218685a1e930SMarcel Holtmann 2187a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 2188a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 2189a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2190a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2191a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2192a9de9248SMarcel Holtmann __u8 dev_class[3]; 2193a9de9248SMarcel Holtmann __le16 clock_offset; 2194a9de9248SMarcel Holtmann __s8 rssi; 219566c853ccSGustavo F. Padovan } __packed; 2196a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 2197a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2198a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2199a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2200a9de9248SMarcel Holtmann __u8 pscan_mode; 2201a9de9248SMarcel Holtmann __u8 dev_class[3]; 2202a9de9248SMarcel Holtmann __le16 clock_offset; 2203a9de9248SMarcel Holtmann __s8 rssi; 220466c853ccSGustavo F. Padovan } __packed; 2205a9de9248SMarcel Holtmann 2206a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 2207a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 2208a9de9248SMarcel Holtmann __u8 status; 2209a9de9248SMarcel Holtmann __le16 handle; 2210a9de9248SMarcel Holtmann __u8 page; 2211a9de9248SMarcel Holtmann __u8 max_page; 2212a9de9248SMarcel Holtmann __u8 features[8]; 221366c853ccSGustavo F. Padovan } __packed; 2214a9de9248SMarcel Holtmann 2215a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 2216a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 2217a9de9248SMarcel Holtmann __u8 status; 2218a9de9248SMarcel Holtmann __le16 handle; 2219a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2220a9de9248SMarcel Holtmann __u8 link_type; 2221a9de9248SMarcel Holtmann __u8 tx_interval; 2222a9de9248SMarcel Holtmann __u8 retrans_window; 2223a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2224a9de9248SMarcel Holtmann __le16 tx_pkt_len; 2225a9de9248SMarcel Holtmann __u8 air_mode; 222666c853ccSGustavo F. Padovan } __packed; 2227a9de9248SMarcel Holtmann 2228a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 2229a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 2230a9de9248SMarcel Holtmann __u8 status; 2231a9de9248SMarcel Holtmann __le16 handle; 2232a9de9248SMarcel Holtmann __u8 tx_interval; 2233a9de9248SMarcel Holtmann __u8 retrans_window; 2234a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2235a9de9248SMarcel Holtmann __le16 tx_pkt_len; 223666c853ccSGustavo F. Padovan } __packed; 2237a9de9248SMarcel Holtmann 2238a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 223904837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 224004837f64SMarcel Holtmann __u8 status; 224104837f64SMarcel Holtmann __le16 handle; 224204837f64SMarcel Holtmann __le16 max_tx_latency; 224304837f64SMarcel Holtmann __le16 max_rx_latency; 224404837f64SMarcel Holtmann __le16 max_remote_timeout; 224504837f64SMarcel Holtmann __le16 max_local_timeout; 224666c853ccSGustavo F. Padovan } __packed; 224704837f64SMarcel Holtmann 2248a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 2249a9de9248SMarcel Holtmann struct extended_inquiry_info { 2250a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2251a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2252a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2253a9de9248SMarcel Holtmann __u8 dev_class[3]; 2254a9de9248SMarcel Holtmann __le16 clock_offset; 2255a9de9248SMarcel Holtmann __s8 rssi; 2256a9de9248SMarcel Holtmann __u8 data[240]; 225766c853ccSGustavo F. Padovan } __packed; 2258a9de9248SMarcel Holtmann 22591c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 22601c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 22611c2e0041SJohan Hedberg __u8 status; 22621c2e0041SJohan Hedberg __le16 handle; 22631c2e0041SJohan Hedberg } __packed; 22641c2e0041SJohan Hedberg 22650493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 22660493684eSMarcel Holtmann struct hci_ev_io_capa_request { 22670493684eSMarcel Holtmann bdaddr_t bdaddr; 226866c853ccSGustavo F. Padovan } __packed; 22690493684eSMarcel Holtmann 227003b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 227103b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 227203b555e1SJohan Hedberg bdaddr_t bdaddr; 227303b555e1SJohan Hedberg __u8 capability; 227403b555e1SJohan Hedberg __u8 oob_data; 227503b555e1SJohan Hedberg __u8 authentication; 227603b555e1SJohan Hedberg } __packed; 227703b555e1SJohan Hedberg 2278a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 2279a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 2280a5c29683SJohan Hedberg bdaddr_t bdaddr; 2281a5c29683SJohan Hedberg __le32 passkey; 2282a5c29683SJohan Hedberg } __packed; 2283a5c29683SJohan Hedberg 22849ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 22859ad4019aSBrian Gix struct hci_ev_user_passkey_req { 22869ad4019aSBrian Gix bdaddr_t bdaddr; 22879ad4019aSBrian Gix } __packed; 22889ad4019aSBrian Gix 22892763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 22902763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 22912763eda6SSzymon Janc bdaddr_t bdaddr; 22922763eda6SSzymon Janc } __packed; 22932763eda6SSzymon Janc 22940493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 22950493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 22960493684eSMarcel Holtmann __u8 status; 22970493684eSMarcel Holtmann bdaddr_t bdaddr; 229866c853ccSGustavo F. Padovan } __packed; 22990493684eSMarcel Holtmann 230092a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 230192a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 230292a25256SJohan Hedberg bdaddr_t bdaddr; 230392a25256SJohan Hedberg __le32 passkey; 230492a25256SJohan Hedberg } __packed; 230592a25256SJohan Hedberg 230692a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 230792a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 230892a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 230992a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 231092a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 231192a25256SJohan Hedberg 231292a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 231392a25256SJohan Hedberg struct hci_ev_keypress_notify { 231492a25256SJohan Hedberg bdaddr_t bdaddr; 231592a25256SJohan Hedberg __u8 type; 231692a25256SJohan Hedberg } __packed; 231792a25256SJohan Hedberg 231841a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 231941a96212SMarcel Holtmann struct hci_ev_remote_host_features { 232041a96212SMarcel Holtmann bdaddr_t bdaddr; 232141a96212SMarcel Holtmann __u8 features[8]; 232266c853ccSGustavo F. Padovan } __packed; 232341a96212SMarcel Holtmann 232463185f64SVille Tervo #define HCI_EV_LE_META 0x3e 232563185f64SVille Tervo struct hci_ev_le_meta { 232663185f64SVille Tervo __u8 subevent; 232763185f64SVille Tervo } __packed; 232863185f64SVille Tervo 2329523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2330523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2331523e93cdSAndrei Emeltchenko __u8 status; 2332523e93cdSAndrei Emeltchenko __u8 phy_handle; 2333523e93cdSAndrei Emeltchenko } __packed; 2334523e93cdSAndrei Emeltchenko 2335523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2336523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2337523e93cdSAndrei Emeltchenko __u8 phy_handle; 2338523e93cdSAndrei Emeltchenko } __packed; 2339523e93cdSAndrei Emeltchenko 2340523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2341523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2342523e93cdSAndrei Emeltchenko __u8 status; 2343523e93cdSAndrei Emeltchenko __u8 phy_handle; 2344523e93cdSAndrei Emeltchenko __u8 reason; 2345523e93cdSAndrei Emeltchenko } __packed; 2346523e93cdSAndrei Emeltchenko 2347523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2348523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2349523e93cdSAndrei Emeltchenko __u8 status; 2350523e93cdSAndrei Emeltchenko __le16 handle; 2351523e93cdSAndrei Emeltchenko __u8 phy_handle; 2352523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2353523e93cdSAndrei Emeltchenko } __packed; 2354523e93cdSAndrei Emeltchenko 2355523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2356523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2357523e93cdSAndrei Emeltchenko __u8 status; 2358523e93cdSAndrei Emeltchenko __le16 handle; 2359523e93cdSAndrei Emeltchenko __u8 reason; 2360523e93cdSAndrei Emeltchenko } __packed; 2361523e93cdSAndrei Emeltchenko 236225e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 236325e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 236425e89e99SAndrei Emeltchenko __le16 handle; 236525e89e99SAndrei Emeltchenko __le16 pkts; 236625e89e99SAndrei Emeltchenko __le16 blocks; 236725e89e99SAndrei Emeltchenko } __packed; 236825e89e99SAndrei Emeltchenko 236925e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 237025e89e99SAndrei Emeltchenko __le16 num_blocks; 237125e89e99SAndrei Emeltchenko __u8 num_hndl; 2372a7e45454SGustavo A. R. Silva struct hci_comp_blocks_info handles[]; 237325e89e99SAndrei Emeltchenko } __packed; 237425e89e99SAndrei Emeltchenko 23752b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 23762b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 23772b359445SDoHyun Pyun __u8 status; 23782b359445SDoHyun Pyun } __packed; 23792b359445SDoHyun Pyun 238076c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT 0x54 23812ed01805SDoHyun Pyun 238263185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 238363185f64SVille Tervo struct hci_ev_le_conn_complete { 238463185f64SVille Tervo __u8 status; 238563185f64SVille Tervo __le16 handle; 238663185f64SVille Tervo __u8 role; 238763185f64SVille Tervo __u8 bdaddr_type; 238863185f64SVille Tervo bdaddr_t bdaddr; 238963185f64SVille Tervo __le16 interval; 239063185f64SVille Tervo __le16 latency; 239163185f64SVille Tervo __le16 supervision_timeout; 239263185f64SVille Tervo __u8 clk_accurancy; 239363185f64SVille Tervo } __packed; 239463185f64SVille Tervo 23952331fd46SMarcel Holtmann /* Advertising report event types */ 23962331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 23972331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 23982331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 23992331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 24002331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2401c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2402c215e939SJaganath Kanakkassery 2403c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2404c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2405c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2406c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2407c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2408c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2409c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 24102331fd46SMarcel Holtmann 2411b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2412b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2413b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2414b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2415b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2416b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2417b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2418b2cc9761SJaganath Kanakkassery 24192331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 24202331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 24216540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 24226540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 24232331fd46SMarcel Holtmann 24242331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 24252331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 24262331fd46SMarcel Holtmann __u8 evt_type; 24272331fd46SMarcel Holtmann __u8 bdaddr_type; 24282331fd46SMarcel Holtmann bdaddr_t bdaddr; 24292331fd46SMarcel Holtmann __u8 length; 2430a7e45454SGustavo A. R. Silva __u8 data[]; 24312331fd46SMarcel Holtmann } __packed; 24322331fd46SMarcel Holtmann 24331855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 24341855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 24351855d92dSMarcel Holtmann __u8 status; 24361855d92dSMarcel Holtmann __le16 handle; 24371855d92dSMarcel Holtmann __le16 interval; 24381855d92dSMarcel Holtmann __le16 latency; 24391855d92dSMarcel Holtmann __le16 supervision_timeout; 24401855d92dSMarcel Holtmann } __packed; 24411855d92dSMarcel Holtmann 24420fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 24430fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 24440fe29fd1SMarcel Holtmann __u8 status; 24450fe29fd1SMarcel Holtmann __le16 handle; 24460fe29fd1SMarcel Holtmann __u8 features[8]; 24470fe29fd1SMarcel Holtmann } __packed; 24480fe29fd1SMarcel Holtmann 2449a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2450a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2451a7a595f6SVinicius Costa Gomes __le16 handle; 2452fe39c7b2SMarcel Holtmann __le64 rand; 2453a7a595f6SVinicius Costa Gomes __le16 ediv; 2454a7a595f6SVinicius Costa Gomes } __packed; 2455a7a595f6SVinicius Costa Gomes 24568e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 24578e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 24588e75b46aSAndre Guedes __le16 handle; 24598e75b46aSAndre Guedes __le16 interval_min; 24608e75b46aSAndre Guedes __le16 interval_max; 24618e75b46aSAndre Guedes __le16 latency; 24628e75b46aSAndre Guedes __le16 timeout; 24638e75b46aSAndre Guedes } __packed; 24648e75b46aSAndre Guedes 246594a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 246694a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 246794a3bd02SMarcel Holtmann __le16 handle; 246894a3bd02SMarcel Holtmann __le16 tx_len; 246994a3bd02SMarcel Holtmann __le16 tx_time; 247094a3bd02SMarcel Holtmann __le16 rx_len; 247194a3bd02SMarcel Holtmann __le16 rx_time; 247294a3bd02SMarcel Holtmann } __packed; 247394a3bd02SMarcel Holtmann 247432c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 247532c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 247632c9d43fSMarcel Holtmann __u8 evt_type; 247732c9d43fSMarcel Holtmann __u8 bdaddr_type; 247832c9d43fSMarcel Holtmann bdaddr_t bdaddr; 247932c9d43fSMarcel Holtmann __u8 direct_addr_type; 248032c9d43fSMarcel Holtmann bdaddr_t direct_addr; 248132c9d43fSMarcel Holtmann __s8 rssi; 248232c9d43fSMarcel Holtmann } __packed; 248332c9d43fSMarcel Holtmann 24841efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 24851efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 24861efd927dSLuiz Augusto von Dentz __u8 status; 24874de0fc59SLuiz Augusto von Dentz __le16 handle; 24881efd927dSLuiz Augusto von Dentz __u8 tx_phy; 24891efd927dSLuiz Augusto von Dentz __u8 rx_phy; 24901efd927dSLuiz Augusto von Dentz } __packed; 24911efd927dSLuiz Augusto von Dentz 2492c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2493c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2494c215e939SJaganath Kanakkassery __le16 evt_type; 2495c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2496c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2497c215e939SJaganath Kanakkassery __u8 primary_phy; 2498c215e939SJaganath Kanakkassery __u8 secondary_phy; 2499c215e939SJaganath Kanakkassery __u8 sid; 2500c215e939SJaganath Kanakkassery __u8 tx_power; 2501c215e939SJaganath Kanakkassery __s8 rssi; 2502c215e939SJaganath Kanakkassery __le16 interval; 2503c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2504c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2505c215e939SJaganath Kanakkassery __u8 length; 2506a7e45454SGustavo A. R. Silva __u8 data[]; 2507c215e939SJaganath Kanakkassery } __packed; 2508c215e939SJaganath Kanakkassery 25094d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 25104d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 25114d94f95dSJaganath Kanakkassery __u8 status; 25124d94f95dSJaganath Kanakkassery __le16 handle; 25134d94f95dSJaganath Kanakkassery __u8 role; 25144d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 25154d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 25164d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 25174d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 25184d94f95dSJaganath Kanakkassery __le16 interval; 25194d94f95dSJaganath Kanakkassery __le16 latency; 25204d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 25214d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 25224d94f95dSJaganath Kanakkassery } __packed; 25234d94f95dSJaganath Kanakkassery 2524acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2525acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2526acf0aeaeSJaganath Kanakkassery __u8 status; 2527acf0aeaeSJaganath Kanakkassery __u8 handle; 2528acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2529acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2530acf0aeaeSJaganath Kanakkassery } __packed; 2531acf0aeaeSJaganath Kanakkassery 25324de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19 25334de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established { 25344de0fc59SLuiz Augusto von Dentz __u8 status; 25354de0fc59SLuiz Augusto von Dentz __le16 handle; 25364de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3]; 25374de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3]; 253876c185a5SArchie Pusaka __u8 c_latency[3]; 253976c185a5SArchie Pusaka __u8 p_latency[3]; 254076c185a5SArchie Pusaka __u8 c_phy; 254176c185a5SArchie Pusaka __u8 p_phy; 25424de0fc59SLuiz Augusto von Dentz __u8 nse; 254376c185a5SArchie Pusaka __u8 c_bn; 254476c185a5SArchie Pusaka __u8 p_bn; 254576c185a5SArchie Pusaka __u8 c_ft; 254676c185a5SArchie Pusaka __u8 p_ft; 254776c185a5SArchie Pusaka __le16 c_mtu; 254876c185a5SArchie Pusaka __le16 p_mtu; 25494de0fc59SLuiz Augusto von Dentz __le16 interval; 25504de0fc59SLuiz Augusto von Dentz } __packed; 25514de0fc59SLuiz Augusto von Dentz 25524de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a 25534de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req { 25544de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 25554de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 25564de0fc59SLuiz Augusto von Dentz __u8 cig_id; 25574de0fc59SLuiz Augusto von Dentz __u8 cis_id; 25584de0fc59SLuiz Augusto von Dentz } __packed; 25594de0fc59SLuiz Augusto von Dentz 2560e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2561e4cc5a18SMarcel Holtmann 25621da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2563a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 25641da177e4SLinus Torvalds struct hci_ev_stack_internal { 25651da177e4SLinus Torvalds __u16 type; 2566a7e45454SGustavo A. R. Silva __u8 data[]; 256766c853ccSGustavo F. Padovan } __packed; 25681da177e4SLinus Torvalds 25691da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 25701da177e4SLinus Torvalds struct hci_ev_si_device { 25711da177e4SLinus Torvalds __u16 event; 25721da177e4SLinus Torvalds __u16 dev_id; 257366c853ccSGustavo F. Padovan } __packed; 25741da177e4SLinus Torvalds 25751da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 25761da177e4SLinus Torvalds struct hci_ev_si_security { 25771da177e4SLinus Torvalds __u16 event; 25781da177e4SLinus Torvalds __u16 proto; 25791da177e4SLinus Torvalds __u16 subproto; 25801da177e4SLinus Torvalds __u8 incoming; 258166c853ccSGustavo F. Padovan } __packed; 25821da177e4SLinus Torvalds 25831da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 25841da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 25851da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 25861da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 25871da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 25884de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4 25891da177e4SLinus Torvalds 25901da177e4SLinus Torvalds struct hci_command_hdr { 25911ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 25921da177e4SLinus Torvalds __u8 plen; 259366c853ccSGustavo F. Padovan } __packed; 25941da177e4SLinus Torvalds 25951da177e4SLinus Torvalds struct hci_event_hdr { 25961da177e4SLinus Torvalds __u8 evt; 25971da177e4SLinus Torvalds __u8 plen; 259866c853ccSGustavo F. Padovan } __packed; 25991da177e4SLinus Torvalds 26001da177e4SLinus Torvalds struct hci_acl_hdr { 26011ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 26021ebb9252SMarcel Holtmann __le16 dlen; 260366c853ccSGustavo F. Padovan } __packed; 26041da177e4SLinus Torvalds 26051da177e4SLinus Torvalds struct hci_sco_hdr { 26061ebb9252SMarcel Holtmann __le16 handle; 26071da177e4SLinus Torvalds __u8 dlen; 260866c853ccSGustavo F. Padovan } __packed; 26091da177e4SLinus Torvalds 26104de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr { 26114de0fc59SLuiz Augusto von Dentz __le16 handle; 26124de0fc59SLuiz Augusto von Dentz __le16 dlen; 2613a7e45454SGustavo A. R. Silva __u8 data[]; 26144de0fc59SLuiz Augusto von Dentz } __packed; 26154de0fc59SLuiz Augusto von Dentz 26164de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */ 26174de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00 26184de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01 26194de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02 26204de0fc59SLuiz Augusto von Dentz 26214de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4 26224de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr { 26234de0fc59SLuiz Augusto von Dentz __le16 sn; 26244de0fc59SLuiz Augusto von Dentz __le16 slen; 26254de0fc59SLuiz Augusto von Dentz }; 26264de0fc59SLuiz Augusto von Dentz 26274de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8 26284de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr { 26294de0fc59SLuiz Augusto von Dentz __le32 ts; 26304de0fc59SLuiz Augusto von Dentz __le16 sn; 26314de0fc59SLuiz Augusto von Dentz __le16 slen; 26324de0fc59SLuiz Augusto von Dentz }; 26334de0fc59SLuiz Augusto von Dentz 26342a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 26352a123b86SArnaldo Carvalho de Melo { 26362a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 26372a123b86SArnaldo Carvalho de Melo } 26382a123b86SArnaldo Carvalho de Melo 26392a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 26402a123b86SArnaldo Carvalho de Melo { 26412a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 26422a123b86SArnaldo Carvalho de Melo } 26432a123b86SArnaldo Carvalho de Melo 26442a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 26452a123b86SArnaldo Carvalho de Melo { 26462a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 26472a123b86SArnaldo Carvalho de Melo } 26482a123b86SArnaldo Carvalho de Melo 26491da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2650c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 26511da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 26521da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 26531da177e4SLinus Torvalds 26541da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2655c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 26561da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 26571da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 26581da177e4SLinus Torvalds 26594de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */ 26604de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003) 26614de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) 26624de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) 26634de0fc59SLuiz Augusto von Dentz 26644de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */ 26654de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) 26664de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff) 26674de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14) 26684de0fc59SLuiz Augusto von Dentz 2669248733e8SKiran K /* codec transport types */ 2670248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO 0x01 2671248733e8SKiran K 26725cbd3ebdSAlain Michaud /* le24 support */ 26735cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) 26745cbd3ebdSAlain Michaud { 26755cbd3ebdSAlain Michaud dst[0] = val & 0xff; 26765cbd3ebdSAlain Michaud dst[1] = (val & 0xff00) >> 8; 26775cbd3ebdSAlain Michaud dst[2] = (val & 0xff0000) >> 16; 26785cbd3ebdSAlain Michaud } 26795cbd3ebdSAlain Michaud 26801da177e4SLinus Torvalds #endif /* __HCI_H */ 2681