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 397d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE 252 407d1dab49SDoHyun Pyun 411da177e4SLinus Torvalds /* HCI dev events */ 421da177e4SLinus Torvalds #define HCI_DEV_REG 1 431da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 441da177e4SLinus Torvalds #define HCI_DEV_UP 3 451da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 471da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds /* HCI notify events */ 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 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, 241*219991e6SHans de Goede 242*219991e6SHans de Goede /* 243*219991e6SHans de Goede * When this quirk is set, then the hci_suspend_notifier is not 244*219991e6SHans de Goede * registered. This is intended for devices which drop completely 245*219991e6SHans de Goede * from the bus on system-suspend and which will show up as a new 246*219991e6SHans de Goede * HCI after resume. 247*219991e6SHans de Goede */ 248*219991e6SHans 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, 323b7cb93e5SMarcel Holtmann 324b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 3254b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 326b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 327b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 328aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 329cbbdfa6fSSathish Narasimman HCI_ENABLE_LL_PRIVACY, 330f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 331c2aa30dbSArchie Pusaka HCI_FORCE_NO_MITM, 332b7cb93e5SMarcel Holtmann 333eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 334d23264a8SAndre Guedes }; 335d23264a8SAndre Guedes 3361da177e4SLinus Torvalds /* HCI timeouts */ 3375f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 3385f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 3395f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 340d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 3415f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 3429345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 343a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 3449489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 3451f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3461da177e4SLinus Torvalds 3475b7f9909SMarcel Holtmann /* HCI data types */ 3481da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3491da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3501da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3511da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 3524de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05 353e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3541da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3551da177e4SLinus Torvalds 3565b7f9909SMarcel Holtmann /* HCI packet types */ 3571da177e4SLinus Torvalds #define HCI_DM1 0x0008 3581da177e4SLinus Torvalds #define HCI_DM3 0x0400 3591da177e4SLinus Torvalds #define HCI_DM5 0x4000 3601da177e4SLinus Torvalds #define HCI_DH1 0x0010 3611da177e4SLinus Torvalds #define HCI_DH3 0x0800 3621da177e4SLinus Torvalds #define HCI_DH5 0x8000 3631da177e4SLinus Torvalds 3645075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3655075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3665075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3675075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3685075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3695075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3705075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3715075b972SJaganath Kanakkassery 3721da177e4SLinus Torvalds #define HCI_HV1 0x0020 3731da177e4SLinus Torvalds #define HCI_HV2 0x0040 3741da177e4SLinus Torvalds #define HCI_HV3 0x0080 3751da177e4SLinus Torvalds 3761da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3771da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3781da177e4SLinus Torvalds 3795b7f9909SMarcel Holtmann /* eSCO packet types */ 3805b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3815b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3825b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3835b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3845b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3855b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 386efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 387efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 388efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 389efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3905b7f9909SMarcel Holtmann 391a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 392efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 393a8746417SMarcel Holtmann 3941da177e4SLinus Torvalds /* ACL flags */ 395e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3961da177e4SLinus Torvalds #define ACL_CONT 0x01 3971da177e4SLinus Torvalds #define ACL_START 0x02 398d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 3991da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 4001da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 4011da177e4SLinus Torvalds 4024de0fc59SLuiz Augusto von Dentz /* ISO PB flags */ 4034de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00 4044de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01 4054de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02 4064de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03 4074de0fc59SLuiz Augusto von Dentz 4084de0fc59SLuiz Augusto von Dentz /* ISO TS flags */ 4094de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01 4104de0fc59SLuiz Augusto von Dentz 4111da177e4SLinus Torvalds /* Baseband links */ 4121da177e4SLinus Torvalds #define SCO_LINK 0x00 4131da177e4SLinus Torvalds #define ACL_LINK 0x01 4145b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 415fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 416fcd89c09SVille Tervo #define LE_LINK 0x80 4173161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 4184de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82 419845472e8SMarcel Holtmann #define INVALID_LINK 0xff 4201da177e4SLinus Torvalds 4211da177e4SLinus Torvalds /* LMP features */ 4221da177e4SLinus Torvalds #define LMP_3SLOT 0x01 4231da177e4SLinus Torvalds #define LMP_5SLOT 0x02 4241da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 4251da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 4261da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 4271da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 4281da177e4SLinus Torvalds #define LMP_HOLD 0x40 42904837f64SMarcel Holtmann #define LMP_SNIFF 0x80 4301da177e4SLinus Torvalds 4311da177e4SLinus Torvalds #define LMP_PARK 0x01 4321da177e4SLinus Torvalds #define LMP_RSSI 0x02 4331da177e4SLinus Torvalds #define LMP_QUALITY 0x04 4341da177e4SLinus Torvalds #define LMP_SCO 0x08 4351da177e4SLinus Torvalds #define LMP_HV2 0x10 4361da177e4SLinus Torvalds #define LMP_HV3 0x20 4371da177e4SLinus Torvalds #define LMP_ULAW 0x40 4381da177e4SLinus Torvalds #define LMP_ALAW 0x80 4391da177e4SLinus Torvalds 4401da177e4SLinus Torvalds #define LMP_CVSD 0x01 4411da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 4421da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 44307a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 4441da177e4SLinus Torvalds 4455075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 4465075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 447d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 4485b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 4495b7f9909SMarcel Holtmann 4505b7f9909SMarcel Holtmann #define LMP_EV4 0x01 4515b7f9909SMarcel Holtmann #define LMP_EV5 0x02 45269ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 453d5859e22SJohan Hedberg #define LMP_LE 0x40 4545075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 4555b7f9909SMarcel Holtmann 4565075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 45704837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 458d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 459efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 460efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 461efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 46204837f64SMarcel Holtmann 463d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 464e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 465769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 466e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 467769be974SMarcel Holtmann 468d5859e22SJohan Hedberg #define LMP_LSTO 0x01 469d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 470971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 471d5859e22SJohan Hedberg 472eead27daSAndre Guedes /* Extended LMP features */ 47353b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 47453b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 47553b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 47653b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 47753b834d2SMarcel Holtmann 478d5991585SMarcel Holtmann #define LMP_SC 0x01 479d5991585SMarcel Holtmann #define LMP_PING 0x02 480d5991585SMarcel Holtmann 48153b834d2SMarcel Holtmann /* Host features */ 482cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 483eead27daSAndre Guedes #define LMP_HOST_LE 0x02 484cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 485d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 486eead27daSAndre Guedes 487662bc2e6SAndre Guedes /* LE features */ 4880da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 489662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 4900fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 491cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 49294a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 493ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY 0x40 4944b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4955075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 4965075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 49755beec10SMarcel Holtmann #define HCI_LE_EXT_ADV 0x10 4989756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 4994de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_MASTER 0x10 5004de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_SLAVE 0x20 501662bc2e6SAndre Guedes 50204837f64SMarcel Holtmann /* Connection modes */ 50304837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 50404837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 50504837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 50604837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 50704837f64SMarcel Holtmann 5081da177e4SLinus Torvalds /* Link policies */ 5091da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 5101da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 5111da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 5121da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 5131da177e4SLinus Torvalds 51404837f64SMarcel Holtmann /* Link modes */ 5151da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 5161da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 5171da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 5181da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 5191da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 5201da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 5211da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 5227b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 5231da177e4SLinus Torvalds 52440be492fSMarcel Holtmann /* Authentication types */ 52540be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 52640be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 52740be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 52840be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 52940be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 53040be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 53140be492fSMarcel Holtmann 532a77b15a6SMikel Astiz /* I/O capabilities */ 533a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 534a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 535a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 536a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 537a77b15a6SMikel Astiz 538b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 539b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 540b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 541b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 542b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 54311015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 54411015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 545b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 54611015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 54711015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 548b6020ba0SWaldemar Rymarkiewicz 5499f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 5508e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 5519f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 552160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 5532acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 554cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 555d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 5569f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 5579f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 558cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 559cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5609f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5619f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5624ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5634ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5643c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5659f5a0d7bSAndrei Emeltchenko 5662455a3eaSAndrei Emeltchenko /* Flow control modes */ 5672455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5682455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5692455a3eaSAndrei Emeltchenko 570bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 571bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 572a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 573bbaf444aSJohan Hedberg 574ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 575ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 576ba165a90SJohan Hedberg 57732748db0SJohan Hedberg /* Extended Inquiry Response field types */ 57832748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 57932748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 58032748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 58132748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 58232748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 58332748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 58432748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 58532748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 58632748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 58732748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5889ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 589d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 590d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 59132748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5924453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5931471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5941471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 595d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 596d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 597f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 598f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 59932748db0SJohan Hedberg 6003f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 6013f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 6023f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 6033f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 6043f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 6053f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 6063f0f524bSJohan Hedberg 6071da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 6086bd32326SVille Tervo #define HCI_OP_NOP 0x0000 6096bd32326SVille Tervo 610a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 611a9de9248SMarcel Holtmann struct hci_cp_inquiry { 612a9de9248SMarcel Holtmann __u8 lap[3]; 613a9de9248SMarcel Holtmann __u8 length; 614a9de9248SMarcel Holtmann __u8 num_rsp; 61566c853ccSGustavo F. Padovan } __packed; 6161da177e4SLinus Torvalds 617a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 618a9de9248SMarcel Holtmann 61979d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 62079d6e068SAndre Guedes 621a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 622a9de9248SMarcel Holtmann 623a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 624a9de9248SMarcel Holtmann struct hci_cp_create_conn { 625a9de9248SMarcel Holtmann bdaddr_t bdaddr; 626a9de9248SMarcel Holtmann __le16 pkt_type; 627a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 628a9de9248SMarcel Holtmann __u8 pscan_mode; 629a9de9248SMarcel Holtmann __le16 clock_offset; 630a9de9248SMarcel Holtmann __u8 role_switch; 63166c853ccSGustavo F. Padovan } __packed; 6321da177e4SLinus Torvalds 633a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 634a9de9248SMarcel Holtmann struct hci_cp_disconnect { 635a9de9248SMarcel Holtmann __le16 handle; 636a9de9248SMarcel Holtmann __u8 reason; 63766c853ccSGustavo F. Padovan } __packed; 6381da177e4SLinus Torvalds 639a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 640a9de9248SMarcel Holtmann struct hci_cp_add_sco { 641a9de9248SMarcel Holtmann __le16 handle; 642a9de9248SMarcel Holtmann __le16 pkt_type; 64366c853ccSGustavo F. Padovan } __packed; 644a9de9248SMarcel Holtmann 645a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 646a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 6471da177e4SLinus Torvalds bdaddr_t bdaddr; 64866c853ccSGustavo F. Padovan } __packed; 6491da177e4SLinus Torvalds 650a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 651a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 652a9de9248SMarcel Holtmann bdaddr_t bdaddr; 653a9de9248SMarcel Holtmann __u8 role; 65466c853ccSGustavo F. Padovan } __packed; 6551da177e4SLinus Torvalds 656a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 657a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 658a9de9248SMarcel Holtmann bdaddr_t bdaddr; 659a9de9248SMarcel Holtmann __u8 reason; 66066c853ccSGustavo F. Padovan } __packed; 6611da177e4SLinus Torvalds 662a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 663a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 664a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6659b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 66666c853ccSGustavo F. Padovan } __packed; 6671da177e4SLinus Torvalds 668a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 669a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 670a9de9248SMarcel Holtmann bdaddr_t bdaddr; 67166c853ccSGustavo F. Padovan } __packed; 6721da177e4SLinus Torvalds 673a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 674a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 675a9de9248SMarcel Holtmann bdaddr_t bdaddr; 676a9de9248SMarcel Holtmann __u8 pin_len; 677a9de9248SMarcel Holtmann __u8 pin_code[16]; 67866c853ccSGustavo F. Padovan } __packed; 679980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 680980e1a53SJohan Hedberg __u8 status; 681980e1a53SJohan Hedberg bdaddr_t bdaddr; 682980e1a53SJohan Hedberg } __packed; 683a9de9248SMarcel Holtmann 684a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 685a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 686a9de9248SMarcel Holtmann bdaddr_t bdaddr; 68766c853ccSGustavo F. Padovan } __packed; 688980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 689980e1a53SJohan Hedberg __u8 status; 690980e1a53SJohan Hedberg bdaddr_t bdaddr; 691980e1a53SJohan Hedberg } __packed; 692a9de9248SMarcel Holtmann 693a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 694a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 695a9de9248SMarcel Holtmann __le16 handle; 696a9de9248SMarcel Holtmann __le16 pkt_type; 69766c853ccSGustavo F. Padovan } __packed; 698a9de9248SMarcel Holtmann 699a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 700a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 701a9de9248SMarcel Holtmann __le16 handle; 70266c853ccSGustavo F. Padovan } __packed; 703a9de9248SMarcel Holtmann 704a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 705a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 706a9de9248SMarcel Holtmann __le16 handle; 707a9de9248SMarcel Holtmann __u8 encrypt; 70866c853ccSGustavo F. Padovan } __packed; 709a9de9248SMarcel Holtmann 710a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 711a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 712a9de9248SMarcel Holtmann __le16 handle; 71366c853ccSGustavo F. Padovan } __packed; 714a9de9248SMarcel Holtmann 715a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 716a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 717a9de9248SMarcel Holtmann bdaddr_t bdaddr; 718a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 719a9de9248SMarcel Holtmann __u8 pscan_mode; 720a9de9248SMarcel Holtmann __le16 clock_offset; 72166c853ccSGustavo F. Padovan } __packed; 722a9de9248SMarcel Holtmann 723a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 724a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 725a9de9248SMarcel Holtmann bdaddr_t bdaddr; 72666c853ccSGustavo F. Padovan } __packed; 727a9de9248SMarcel Holtmann 728a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 729a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 730a9de9248SMarcel Holtmann __le16 handle; 73166c853ccSGustavo F. Padovan } __packed; 732a9de9248SMarcel Holtmann 733a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 734a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 735a9de9248SMarcel Holtmann __le16 handle; 736a9de9248SMarcel Holtmann __u8 page; 73766c853ccSGustavo F. Padovan } __packed; 738a9de9248SMarcel Holtmann 739a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 740a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 741a9de9248SMarcel Holtmann __le16 handle; 74266c853ccSGustavo F. Padovan } __packed; 743a9de9248SMarcel Holtmann 744df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 745df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 746df935429SMarcel Holtmann __le16 handle; 747df935429SMarcel Holtmann } __packed; 748df935429SMarcel Holtmann 749a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 750a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 751a9de9248SMarcel Holtmann __le16 handle; 752a9de9248SMarcel Holtmann __le32 tx_bandwidth; 753a9de9248SMarcel Holtmann __le32 rx_bandwidth; 754a9de9248SMarcel Holtmann __le16 max_latency; 755a9de9248SMarcel Holtmann __le16 voice_setting; 756a9de9248SMarcel Holtmann __u8 retrans_effort; 757a9de9248SMarcel Holtmann __le16 pkt_type; 75866c853ccSGustavo F. Padovan } __packed; 759a9de9248SMarcel Holtmann 760a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 761a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 762a9de9248SMarcel Holtmann bdaddr_t bdaddr; 763a9de9248SMarcel Holtmann __le32 tx_bandwidth; 764a9de9248SMarcel Holtmann __le32 rx_bandwidth; 765a9de9248SMarcel Holtmann __le16 max_latency; 766a9de9248SMarcel Holtmann __le16 content_format; 767a9de9248SMarcel Holtmann __u8 retrans_effort; 768a9de9248SMarcel Holtmann __le16 pkt_type; 76966c853ccSGustavo F. Padovan } __packed; 770a9de9248SMarcel Holtmann 771a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 772a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 773a9de9248SMarcel Holtmann bdaddr_t bdaddr; 774a9de9248SMarcel Holtmann __u8 reason; 77566c853ccSGustavo F. Padovan } __packed; 776a9de9248SMarcel Holtmann 77717fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 77817fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 77917fa4b9dSJohan Hedberg bdaddr_t bdaddr; 78017fa4b9dSJohan Hedberg __u8 capability; 78117fa4b9dSJohan Hedberg __u8 oob_data; 78217fa4b9dSJohan Hedberg __u8 authentication; 78317fa4b9dSJohan Hedberg } __packed; 78417fa4b9dSJohan Hedberg 785a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 786a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 787a5c29683SJohan Hedberg bdaddr_t bdaddr; 788a5c29683SJohan Hedberg } __packed; 789a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 790a5c29683SJohan Hedberg __u8 status; 791a5c29683SJohan Hedberg bdaddr_t bdaddr; 792a5c29683SJohan Hedberg } __packed; 793a5c29683SJohan Hedberg 794a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 795a5c29683SJohan Hedberg 7969ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 7979ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 7989ad4019aSBrian Gix bdaddr_t bdaddr; 7999ad4019aSBrian Gix __le32 passkey; 8009ad4019aSBrian Gix } __packed; 8019ad4019aSBrian Gix 8029ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 8039ad4019aSBrian Gix 8042763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 8052763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 8062763eda6SSzymon Janc bdaddr_t bdaddr; 8072763eda6SSzymon Janc __u8 hash[16]; 80838da1703SJohan Hedberg __u8 rand[16]; 8092763eda6SSzymon Janc } __packed; 8102763eda6SSzymon Janc 8112763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 8122763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 8132763eda6SSzymon Janc bdaddr_t bdaddr; 8142763eda6SSzymon Janc } __packed; 8152763eda6SSzymon Janc 81603b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 81703b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 81803b555e1SJohan Hedberg bdaddr_t bdaddr; 81903b555e1SJohan Hedberg __u8 reason; 82003b555e1SJohan Hedberg } __packed; 82103b555e1SJohan Hedberg 822523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 823523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 824523e93cdSAndrei Emeltchenko __u8 phy_handle; 825523e93cdSAndrei Emeltchenko __u8 key_len; 826523e93cdSAndrei Emeltchenko __u8 key_type; 827523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 828523e93cdSAndrei Emeltchenko } __packed; 829523e93cdSAndrei Emeltchenko 830523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 831523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 832523e93cdSAndrei Emeltchenko __u8 phy_handle; 833523e93cdSAndrei Emeltchenko __u8 key_len; 834523e93cdSAndrei Emeltchenko __u8 key_type; 835523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 836523e93cdSAndrei Emeltchenko } __packed; 837523e93cdSAndrei Emeltchenko 838523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 839523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 840523e93cdSAndrei Emeltchenko __u8 phy_handle; 841523e93cdSAndrei Emeltchenko __u8 reason; 842b078b564SAndrei Emeltchenko } __packed; 843b078b564SAndrei Emeltchenko 844b078b564SAndrei Emeltchenko struct ext_flow_spec { 845b078b564SAndrei Emeltchenko __u8 id; 846b078b564SAndrei Emeltchenko __u8 stype; 847b078b564SAndrei Emeltchenko __le16 msdu; 848b078b564SAndrei Emeltchenko __le32 sdu_itime; 849b078b564SAndrei Emeltchenko __le32 acc_lat; 850b078b564SAndrei Emeltchenko __le32 flush_to; 851b078b564SAndrei Emeltchenko } __packed; 852b078b564SAndrei Emeltchenko 853b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 854b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 855b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 856b078b564SAndrei Emeltchenko __u8 phy_handle; 857b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 858b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 859b078b564SAndrei Emeltchenko } __packed; 860b078b564SAndrei Emeltchenko 861b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 862b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 863b078b564SAndrei Emeltchenko __le16 log_handle; 864b078b564SAndrei Emeltchenko } __packed; 865b078b564SAndrei Emeltchenko 866b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 867b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 868b078b564SAndrei Emeltchenko __u8 phy_handle; 869b078b564SAndrei Emeltchenko __u8 flow_spec_id; 870b078b564SAndrei Emeltchenko } __packed; 871b078b564SAndrei Emeltchenko 872b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 873b078b564SAndrei Emeltchenko __u8 status; 874b078b564SAndrei Emeltchenko __u8 phy_handle; 875b078b564SAndrei Emeltchenko __u8 flow_spec_id; 876523e93cdSAndrei Emeltchenko } __packed; 877523e93cdSAndrei Emeltchenko 8788c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 8798c9a041bSDoHyun Pyun struct hci_cp_set_csb { 8808c9a041bSDoHyun Pyun __u8 enable; 8818c9a041bSDoHyun Pyun __u8 lt_addr; 8828c9a041bSDoHyun Pyun __u8 lpo_allowed; 8838c9a041bSDoHyun Pyun __le16 packet_type; 8848c9a041bSDoHyun Pyun __le16 interval_min; 8858c9a041bSDoHyun Pyun __le16 interval_max; 8868c9a041bSDoHyun Pyun __le16 csb_sv_tout; 8878c9a041bSDoHyun Pyun } __packed; 8888c9a041bSDoHyun Pyun struct hci_rp_set_csb { 8898c9a041bSDoHyun Pyun __u8 status; 8908c9a041bSDoHyun Pyun __u8 lt_addr; 8918c9a041bSDoHyun Pyun __le16 interval; 8928c9a041bSDoHyun Pyun } __packed; 8938c9a041bSDoHyun Pyun 894cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 895cefded98SDoHyun Pyun 896e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 897e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 898e2f99131SMarcel Holtmann bdaddr_t bdaddr; 899e2f99131SMarcel Holtmann __u8 hash192[16]; 90038da1703SJohan Hedberg __u8 rand192[16]; 901e2f99131SMarcel Holtmann __u8 hash256[16]; 90238da1703SJohan Hedberg __u8 rand256[16]; 903e2f99131SMarcel Holtmann } __packed; 904e2f99131SMarcel Holtmann 905a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 906a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 907a9de9248SMarcel Holtmann __le16 handle; 908a9de9248SMarcel Holtmann __le16 max_interval; 909a9de9248SMarcel Holtmann __le16 min_interval; 910a9de9248SMarcel Holtmann __le16 attempt; 911a9de9248SMarcel Holtmann __le16 timeout; 91266c853ccSGustavo F. Padovan } __packed; 913a9de9248SMarcel Holtmann 914a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 915a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 916a9de9248SMarcel Holtmann __le16 handle; 91766c853ccSGustavo F. Padovan } __packed; 918a9de9248SMarcel Holtmann 919a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 920a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 921a9de9248SMarcel Holtmann __le16 handle; 92266c853ccSGustavo F. Padovan } __packed; 923a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 924a9de9248SMarcel Holtmann __u8 status; 925a9de9248SMarcel Holtmann __le16 handle; 926a9de9248SMarcel Holtmann __u8 role; 92766c853ccSGustavo F. Padovan } __packed; 928a9de9248SMarcel Holtmann 929a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 930a9de9248SMarcel Holtmann struct hci_cp_switch_role { 931a9de9248SMarcel Holtmann bdaddr_t bdaddr; 932a9de9248SMarcel Holtmann __u8 role; 93366c853ccSGustavo F. Padovan } __packed; 934a9de9248SMarcel Holtmann 935a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 936a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 937a9de9248SMarcel Holtmann __le16 handle; 93866c853ccSGustavo F. Padovan } __packed; 939a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 940a9de9248SMarcel Holtmann __u8 status; 941a9de9248SMarcel Holtmann __le16 handle; 942a9de9248SMarcel Holtmann __le16 policy; 94366c853ccSGustavo F. Padovan } __packed; 944a9de9248SMarcel Holtmann 945a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 946a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 947a9de9248SMarcel Holtmann __le16 handle; 948a9de9248SMarcel Holtmann __le16 policy; 94966c853ccSGustavo F. Padovan } __packed; 950a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 951a9de9248SMarcel Holtmann __u8 status; 952a9de9248SMarcel Holtmann __le16 handle; 95366c853ccSGustavo F. Padovan } __packed; 954a9de9248SMarcel Holtmann 955e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 956e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 957e4e8e37cSMarcel Holtmann __u8 status; 958e4e8e37cSMarcel Holtmann __le16 policy; 95966c853ccSGustavo F. Padovan } __packed; 960e4e8e37cSMarcel Holtmann 961e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 962e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 963e4e8e37cSMarcel Holtmann __le16 policy; 96466c853ccSGustavo F. Padovan } __packed; 965e4e8e37cSMarcel Holtmann 966a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 967a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 968a9de9248SMarcel Holtmann __le16 handle; 969a9de9248SMarcel Holtmann __le16 max_latency; 970a9de9248SMarcel Holtmann __le16 min_remote_timeout; 971a9de9248SMarcel Holtmann __le16 min_local_timeout; 97266c853ccSGustavo F. Padovan } __packed; 973a9de9248SMarcel Holtmann 974a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 975a9de9248SMarcel Holtmann 976a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 977a9de9248SMarcel Holtmann 978a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 9794f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE 9 9804f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter { 9811da177e4SLinus Torvalds __u8 flt_type; 9821da177e4SLinus Torvalds __u8 cond_type; 9834f40afc6SAbhishek Pandit-Subedi struct { 9844f40afc6SAbhishek Pandit-Subedi bdaddr_t bdaddr; 9854f40afc6SAbhishek Pandit-Subedi __u8 auto_accept; 9864f40afc6SAbhishek Pandit-Subedi } __packed addr_conn_flt; 98766c853ccSGustavo F. Padovan } __packed; 9881da177e4SLinus Torvalds 9891da177e4SLinus Torvalds /* Filter types */ 9901da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 9911da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 9921da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 9931da177e4SLinus Torvalds 9941da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 9951da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 9961da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 9971da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 9981da177e4SLinus Torvalds 9991da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 10001da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 10011da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 10024f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03 10031da177e4SLinus Torvalds 1004cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1005cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 1006cb962780SMarcel Holtmann bdaddr_t bdaddr; 1007cb962780SMarcel Holtmann __u8 read_all; 1008cb962780SMarcel Holtmann } __packed; 1009cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 1010cb962780SMarcel Holtmann __u8 status; 1011cb962780SMarcel Holtmann __u8 max_keys; 1012cb962780SMarcel Holtmann __u8 num_keys; 1013cb962780SMarcel Holtmann } __packed; 1014cb962780SMarcel Holtmann 1015b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1016b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 1017b0916ea0SJohan Hedberg bdaddr_t bdaddr; 1018b0916ea0SJohan Hedberg __u8 delete_all; 1019b0916ea0SJohan Hedberg } __packed; 1020039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 1021039d4e41SMarcel Holtmann __u8 status; 1022039d4e41SMarcel Holtmann __u8 num_keys; 1023039d4e41SMarcel Holtmann } __packed; 1024b0916ea0SJohan Hedberg 10251f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 10261f6c6378SJohan Hedberg 1027a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1028a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 10291f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 103066c853ccSGustavo F. Padovan } __packed; 1031a9de9248SMarcel Holtmann 1032a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 1033a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 1034a9de9248SMarcel Holtmann __u8 status; 10351f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 103666c853ccSGustavo F. Padovan } __packed; 1037a9de9248SMarcel Holtmann 1038a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 1039a9de9248SMarcel Holtmann 1040a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 1041a9de9248SMarcel Holtmann 1042a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 1043a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 1044a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 1045a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 1046a9de9248SMarcel Holtmann 1047a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 1048a9de9248SMarcel Holtmann 1049a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 1050a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 1051a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 1052a9de9248SMarcel Holtmann 1053a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 1054a9de9248SMarcel Holtmann 1055a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 1056a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 1057a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 1058a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 1059a9de9248SMarcel Holtmann 1060a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 1061a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 10621da177e4SLinus Torvalds __u8 status; 10631da177e4SLinus Torvalds __u8 dev_class[3]; 106466c853ccSGustavo F. Padovan } __packed; 10651da177e4SLinus Torvalds 1066a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1067a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 10681da177e4SLinus Torvalds __u8 dev_class[3]; 106966c853ccSGustavo F. Padovan } __packed; 10701da177e4SLinus Torvalds 1071a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 10721da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 10731da177e4SLinus Torvalds __u8 status; 10741ebb9252SMarcel Holtmann __le16 voice_setting; 107566c853ccSGustavo F. Padovan } __packed; 10761da177e4SLinus Torvalds 1077a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 10781da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 10791ebb9252SMarcel Holtmann __le16 voice_setting; 108066c853ccSGustavo F. Padovan } __packed; 10811da177e4SLinus Torvalds 1082a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 10831da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 10841ebb9252SMarcel Holtmann __le16 acl_mtu; 10851da177e4SLinus Torvalds __u8 sco_mtu; 10861ebb9252SMarcel Holtmann __le16 acl_max_pkt; 10871ebb9252SMarcel Holtmann __le16 sco_max_pkt; 108866c853ccSGustavo F. Padovan } __packed; 10891da177e4SLinus Torvalds 1090b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1091b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1092b4cb9fb2SMarcel Holtmann __u8 status; 1093b4cb9fb2SMarcel Holtmann __u8 num_iac; 1094b4cb9fb2SMarcel Holtmann } __packed; 1095b4cb9fb2SMarcel Holtmann 10964b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 10974b836f39SMarcel Holtmann 10983d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 10993d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 11003d505312SMarcel Holtmann __u8 num_iac; 11013d505312SMarcel Holtmann __u8 iac_lap[6]; 11023d505312SMarcel Holtmann } __packed; 11033d505312SMarcel Holtmann 1104d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1105d5859e22SJohan Hedberg 110680a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 110780a1e1dbSJohan Hedberg 110880a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 110980a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1110816a11d5SJohan Hedberg __u8 fec; 1111816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 111280a1e1dbSJohan Hedberg } __packed; 111380a1e1dbSJohan Hedberg 1114333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1115333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1116333140b5SMarcel Holtmann __u8 status; 1117333140b5SMarcel Holtmann __u8 mode; 111866c853ccSGustavo F. Padovan } __packed; 1119333140b5SMarcel Holtmann 1120333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1121333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1122333140b5SMarcel Holtmann __u8 mode; 112366c853ccSGustavo F. Padovan } __packed; 1124333140b5SMarcel Holtmann 1125c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1126c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1127c35938b2SSzymon Janc __u8 status; 1128c35938b2SSzymon Janc __u8 hash[16]; 112938da1703SJohan Hedberg __u8 rand[16]; 1130c35938b2SSzymon Janc } __packed; 1131c35938b2SSzymon Janc 1132d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 113391c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 113491c4e9b1SMarcel Holtmann __u8 status; 113591c4e9b1SMarcel Holtmann __s8 tx_power; 113691c4e9b1SMarcel Holtmann } __packed; 1137d5859e22SJohan Hedberg 113800bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a 113900bce3fbSAlain Michaud #define ERR_DATA_REPORTING_DISABLED 0x00 114000bce3fbSAlain Michaud #define ERR_DATA_REPORTING_ENABLED 0x01 114100bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting { 114200bce3fbSAlain Michaud __u8 status; 114300bce3fbSAlain Michaud __u8 err_data_reporting; 114400bce3fbSAlain Michaud } __packed; 114500bce3fbSAlain Michaud 114600bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b 114700bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting { 114800bce3fbSAlain Michaud __u8 err_data_reporting; 114900bce3fbSAlain Michaud } __packed; 115000bce3fbSAlain Michaud 1151d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1152d62e6d67SJohan Hedberg 11537528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 11547528ca1cSMarcel Holtmann 11551e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 11561e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 11571e89cffbSAndrei Emeltchenko __u8 status; 11581e89cffbSAndrei Emeltchenko __u8 mode; 11591e89cffbSAndrei Emeltchenko } __packed; 11601e89cffbSAndrei Emeltchenko 1161f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1162f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1163f9b49306SAndre Guedes __u8 le; 1164f9b49306SAndre Guedes __u8 simul; 1165f9b49306SAndre Guedes } __packed; 1166f9b49306SAndre Guedes 1167d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1168d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1169d0bf75a5SDoHyun Pyun __u8 lt_addr; 1170d0bf75a5SDoHyun Pyun } __packed; 1171d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1172d0bf75a5SDoHyun Pyun __u8 status; 1173d0bf75a5SDoHyun Pyun __u8 lt_addr; 1174d0bf75a5SDoHyun Pyun } __packed; 1175d0bf75a5SDoHyun Pyun 11766a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 11776a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 11786a20eaf4SDoHyun Pyun __u8 lt_addr; 11796a20eaf4SDoHyun Pyun } __packed; 11806a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 11816a20eaf4SDoHyun Pyun __u8 status; 11826a20eaf4SDoHyun Pyun __u8 lt_addr; 11836a20eaf4SDoHyun Pyun } __packed; 11846a20eaf4SDoHyun Pyun 11857d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 11867d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 11877d1dab49SDoHyun Pyun __u8 lt_addr; 11887d1dab49SDoHyun Pyun __u8 fragment; 11897d1dab49SDoHyun Pyun __u8 data_length; 11907d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 11917d1dab49SDoHyun Pyun } __packed; 11927d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 11937d1dab49SDoHyun Pyun __u8 status; 11947d1dab49SDoHyun Pyun __u8 lt_addr; 11957d1dab49SDoHyun Pyun } __packed; 11967d1dab49SDoHyun Pyun 11975d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 11985d4e7e8dSJohan Hedberg 1199a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1200a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1201a9b07a64SDoHyun Pyun __le16 interval_min; 1202a9b07a64SDoHyun Pyun __le16 interval_max; 1203a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1204a9b07a64SDoHyun Pyun __u8 service_data; 1205a9b07a64SDoHyun Pyun } __packed; 1206a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1207a9b07a64SDoHyun Pyun __u8 status; 1208a9b07a64SDoHyun Pyun __le16 sync_train_int; 1209a9b07a64SDoHyun Pyun } __packed; 1210a9b07a64SDoHyun Pyun 1211eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1212eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1213eb4b95c6SMarcel Holtmann __u8 status; 1214eb4b95c6SMarcel Holtmann __u8 support; 1215eb4b95c6SMarcel Holtmann } __packed; 1216eb4b95c6SMarcel Holtmann 1217eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1218eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1219eb4b95c6SMarcel Holtmann __u8 support; 1220eb4b95c6SMarcel Holtmann } __packed; 1221eb4b95c6SMarcel Holtmann 1222302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1223302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1224302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1225302975cbSSpoorthi Ravishankar Koppad } __packed; 1226302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1227302975cbSSpoorthi Ravishankar Koppad __u8 status; 1228302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1229302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1230302975cbSSpoorthi Ravishankar Koppad } __packed; 1231302975cbSSpoorthi Ravishankar Koppad 1232302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1233302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1234302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1235302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1236302975cbSSpoorthi Ravishankar Koppad } __packed; 1237302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1238302975cbSSpoorthi Ravishankar Koppad __u8 status; 1239302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1240302975cbSSpoorthi Ravishankar Koppad } __packed; 1241302975cbSSpoorthi Ravishankar Koppad 1242e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1243e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1244e2f99131SMarcel Holtmann __u8 status; 1245e2f99131SMarcel Holtmann __u8 hash192[16]; 124638da1703SJohan Hedberg __u8 rand192[16]; 1247e2f99131SMarcel Holtmann __u8 hash256[16]; 124838da1703SJohan Hedberg __u8 rand256[16]; 1249e2f99131SMarcel Holtmann } __packed; 1250e2f99131SMarcel Holtmann 1251a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1252a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 12531da177e4SLinus Torvalds __u8 status; 1254a9de9248SMarcel Holtmann __u8 hci_ver; 1255a9de9248SMarcel Holtmann __le16 hci_rev; 1256a9de9248SMarcel Holtmann __u8 lmp_ver; 1257a9de9248SMarcel Holtmann __le16 manufacturer; 1258a9de9248SMarcel Holtmann __le16 lmp_subver; 125966c853ccSGustavo F. Padovan } __packed; 12601da177e4SLinus Torvalds 1261a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1262a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 12631da177e4SLinus Torvalds __u8 status; 1264a9de9248SMarcel Holtmann __u8 commands[64]; 126566c853ccSGustavo F. Padovan } __packed; 12661da177e4SLinus Torvalds 1267a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1268a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1269a9de9248SMarcel Holtmann __u8 status; 1270a9de9248SMarcel Holtmann __u8 features[8]; 127166c853ccSGustavo F. Padovan } __packed; 1272a9de9248SMarcel Holtmann 1273a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1274971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1275971e3a4bSAndre Guedes __u8 page; 1276971e3a4bSAndre Guedes } __packed; 1277a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1278a9de9248SMarcel Holtmann __u8 status; 1279a9de9248SMarcel Holtmann __u8 page; 1280a9de9248SMarcel Holtmann __u8 max_page; 1281a9de9248SMarcel Holtmann __u8 features[8]; 128266c853ccSGustavo F. Padovan } __packed; 1283a9de9248SMarcel Holtmann 1284a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1285a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1286a9de9248SMarcel Holtmann __u8 status; 1287a9de9248SMarcel Holtmann __le16 acl_mtu; 1288a9de9248SMarcel Holtmann __u8 sco_mtu; 1289a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1290a9de9248SMarcel Holtmann __le16 sco_max_pkt; 129166c853ccSGustavo F. Padovan } __packed; 1292a9de9248SMarcel Holtmann 1293a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1294a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1295a9de9248SMarcel Holtmann __u8 status; 12961da177e4SLinus Torvalds bdaddr_t bdaddr; 129766c853ccSGustavo F. Padovan } __packed; 12981da177e4SLinus Torvalds 1299350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1300350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1301350ee4cfSAndrei Emeltchenko __u8 status; 1302350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1303350ee4cfSAndrei Emeltchenko __le16 block_len; 1304350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1305350ee4cfSAndrei Emeltchenko } __packed; 1306350ee4cfSAndrei Emeltchenko 1307109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1308109e3191SMarcel Holtmann 1309a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c 1310a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts { 1311a4790360SMarcel Holtmann __u8 status; 1312a4790360SMarcel Holtmann __u8 pairing_opts; 1313a4790360SMarcel Holtmann __u8 max_key_size; 1314a4790360SMarcel Holtmann } __packed; 1315a4790360SMarcel Holtmann 1316f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1317f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1318f332ec66SJohan Hedberg __u8 status; 1319f332ec66SJohan Hedberg __le16 interval; 1320f332ec66SJohan Hedberg __le16 window; 1321f332ec66SJohan Hedberg } __packed; 1322f332ec66SJohan Hedberg 1323f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1324f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1325f6422ec6SAntti Julku __le16 interval; 1326f6422ec6SAntti Julku __le16 window; 1327f6422ec6SAntti Julku } __packed; 1328f6422ec6SAntti Julku 13295a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 13305a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 13315a134faeSAndrzej Kaczmarek __le16 handle; 13325a134faeSAndrzej Kaczmarek __u8 type; 13335a134faeSAndrzej Kaczmarek } __packed; 13345a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 13355a134faeSAndrzej Kaczmarek __u8 status; 13365a134faeSAndrzej Kaczmarek __le16 handle; 13375a134faeSAndrzej Kaczmarek __s8 tx_power; 13385a134faeSAndrzej Kaczmarek } __packed; 13395a134faeSAndrzej Kaczmarek 1340f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1341f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1342f332ec66SJohan Hedberg __u8 status; 1343f332ec66SJohan Hedberg __u8 type; 1344f332ec66SJohan Hedberg } __packed; 1345f332ec66SJohan Hedberg 1346f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1347f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1348f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1349f6422ec6SAntti Julku 13505ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 13515ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 13525ae76a94SAndrzej Kaczmarek __le16 handle; 13535ae76a94SAndrzej Kaczmarek } __packed; 13545ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 13555ae76a94SAndrzej Kaczmarek __u8 status; 13565ae76a94SAndrzej Kaczmarek __le16 handle; 13575ae76a94SAndrzej Kaczmarek __s8 rssi; 13585ae76a94SAndrzej Kaczmarek } __packed; 13595ae76a94SAndrzej Kaczmarek 136033f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 136133f35721SJohan Hedberg struct hci_cp_read_clock { 136233f35721SJohan Hedberg __le16 handle; 136333f35721SJohan Hedberg __u8 which; 136433f35721SJohan Hedberg } __packed; 136533f35721SJohan Hedberg struct hci_rp_read_clock { 136633f35721SJohan Hedberg __u8 status; 136733f35721SJohan Hedberg __le16 handle; 136833f35721SJohan Hedberg __le32 clock; 136933f35721SJohan Hedberg __le16 accuracy; 137033f35721SJohan Hedberg } __packed; 137133f35721SJohan Hedberg 1372821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1373821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1374821f3766SJohan Hedberg __le16 handle; 1375821f3766SJohan Hedberg } __packed; 1376821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1377821f3766SJohan Hedberg __u8 status; 1378821f3766SJohan Hedberg __le16 handle; 1379821f3766SJohan Hedberg __u8 key_size; 1380821f3766SJohan Hedberg } __packed; 1381821f3766SJohan Hedberg 1382928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1383928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1384928abaa7SAndrei Emeltchenko __u8 status; 1385928abaa7SAndrei Emeltchenko __u8 amp_status; 1386928abaa7SAndrei Emeltchenko __le32 total_bw; 1387928abaa7SAndrei Emeltchenko __le32 max_bw; 1388928abaa7SAndrei Emeltchenko __le32 min_latency; 1389928abaa7SAndrei Emeltchenko __le32 max_pdu; 1390928abaa7SAndrei Emeltchenko __u8 amp_type; 1391928abaa7SAndrei Emeltchenko __le16 pal_cap; 1392928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1393928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1394928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1395928abaa7SAndrei Emeltchenko } __packed; 1396928abaa7SAndrei Emeltchenko 1397523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1398523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1399523e93cdSAndrei Emeltchenko __u8 phy_handle; 1400523e93cdSAndrei Emeltchenko __le16 len_so_far; 1401523e93cdSAndrei Emeltchenko __le16 max_len; 1402523e93cdSAndrei Emeltchenko } __packed; 1403523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1404523e93cdSAndrei Emeltchenko __u8 status; 1405523e93cdSAndrei Emeltchenko __u8 phy_handle; 1406523e93cdSAndrei Emeltchenko __le16 rem_len; 1407a7e45454SGustavo A. R. Silva __u8 frag[]; 1408523e93cdSAndrei Emeltchenko } __packed; 1409523e93cdSAndrei Emeltchenko 1410523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1411523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1412523e93cdSAndrei Emeltchenko __u8 phy_handle; 1413523e93cdSAndrei Emeltchenko __le16 len_so_far; 1414523e93cdSAndrei Emeltchenko __le16 rem_len; 1415a7e45454SGustavo A. R. Silva __u8 frag[]; 1416523e93cdSAndrei Emeltchenko } __packed; 1417523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1418523e93cdSAndrei Emeltchenko __u8 status; 1419523e93cdSAndrei Emeltchenko __u8 phy_handle; 1420523e93cdSAndrei Emeltchenko } __packed; 1421523e93cdSAndrei Emeltchenko 1422f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1423f4fe73edSMarcel Holtmann 14244b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 14254b4148e9SMarcel Holtmann 142606f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 142706f5b778SMarcel Holtmann 142863185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 142963185f64SVille Tervo struct hci_cp_le_set_event_mask { 143063185f64SVille Tervo __u8 mask[8]; 143163185f64SVille Tervo } __packed; 143263185f64SVille Tervo 143363185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 143463185f64SVille Tervo struct hci_rp_le_read_buffer_size { 143563185f64SVille Tervo __u8 status; 143663185f64SVille Tervo __le16 le_mtu; 143763185f64SVille Tervo __u8 le_max_pkt; 143863185f64SVille Tervo } __packed; 143963185f64SVille Tervo 144060e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 144160e77321SJohan Hedberg struct hci_rp_le_read_local_features { 144260e77321SJohan Hedberg __u8 status; 144360e77321SJohan Hedberg __u8 features[8]; 144460e77321SJohan Hedberg } __packed; 144560e77321SJohan Hedberg 1446d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1447d13eafceSMarcel Holtmann 14481e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 14491e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 14501e191893SMarcel Holtmann __le16 min_interval; 14511e191893SMarcel Holtmann __le16 max_interval; 14521e191893SMarcel Holtmann __u8 type; 14531e191893SMarcel Holtmann __u8 own_address_type; 14541e191893SMarcel Holtmann __u8 direct_addr_type; 14551e191893SMarcel Holtmann bdaddr_t direct_addr; 14561e191893SMarcel Holtmann __u8 channel_map; 14571e191893SMarcel Holtmann __u8 filter_policy; 14581e191893SMarcel Holtmann } __packed; 14591e191893SMarcel Holtmann 14608fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 14618fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 14628fa19098SJohan Hedberg __u8 status; 14638fa19098SJohan Hedberg __s8 tx_power; 14648fa19098SJohan Hedberg } __packed; 14658fa19098SJohan Hedberg 14663f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 14673f0f524bSJohan Hedberg 14683f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 14693f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 14703f0f524bSJohan Hedberg __u8 length; 14713f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 14723f0f524bSJohan Hedberg } __packed; 14733f0f524bSJohan Hedberg 1474f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1475f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1476f14d8f64SMarcel Holtmann __u8 length; 1477f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1478f14d8f64SMarcel Holtmann } __packed; 1479f14d8f64SMarcel Holtmann 1480c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1481c1d5dc4aSJohan Hedberg 14825df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 14835df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 14845df480b5SAndre Guedes 148507f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 148607f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 148707f7fa5dSAndre Guedes __u8 type; 148807f7fa5dSAndre Guedes __le16 interval; 148907f7fa5dSAndre Guedes __le16 window; 149007f7fa5dSAndre Guedes __u8 own_address_type; 149107f7fa5dSAndre Guedes __u8 filter_policy; 149207f7fa5dSAndre Guedes } __packed; 149307f7fa5dSAndre Guedes 149476a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 149576a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1496525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1497525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 149868a8aea4SAndrei Emeltchenko 1499eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1500eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1501eb9d91f5SAndre Guedes __u8 enable; 1502eb9d91f5SAndre Guedes __u8 filter_dup; 1503eb9d91f5SAndre Guedes } __packed; 1504eb9d91f5SAndre Guedes 1505a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1506a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1507a7139eddSJohan Hedberg 150863185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 150963185f64SVille Tervo struct hci_cp_le_create_conn { 151063185f64SVille Tervo __le16 scan_interval; 151163185f64SVille Tervo __le16 scan_window; 151263185f64SVille Tervo __u8 filter_policy; 151363185f64SVille Tervo __u8 peer_addr_type; 151463185f64SVille Tervo bdaddr_t peer_addr; 151563185f64SVille Tervo __u8 own_address_type; 151663185f64SVille Tervo __le16 conn_interval_min; 151763185f64SVille Tervo __le16 conn_interval_max; 151863185f64SVille Tervo __le16 conn_latency; 151963185f64SVille Tervo __le16 supervision_timeout; 152063185f64SVille Tervo __le16 min_ce_len; 152163185f64SVille Tervo __le16 max_ce_len; 152263185f64SVille Tervo } __packed; 152363185f64SVille Tervo 152463185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 152563185f64SVille Tervo 1526cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1527cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1528cf1d081fSJohan Hedberg __u8 status; 1529cf1d081fSJohan Hedberg __u8 size; 1530cf1d081fSJohan Hedberg } __packed; 1531cf1d081fSJohan Hedberg 1532d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1533d9a7b0a5SMarcel Holtmann 1534d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1535d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1536d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1537d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1538d9a7b0a5SMarcel Holtmann } __packed; 1539d9a7b0a5SMarcel Holtmann 1540d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1541d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1542d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1543d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1544d9a7b0a5SMarcel Holtmann } __packed; 1545d9a7b0a5SMarcel Holtmann 15462ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 15472ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 15482ce603ebSClaudio Takahasi __le16 handle; 15492ce603ebSClaudio Takahasi __le16 conn_interval_min; 15502ce603ebSClaudio Takahasi __le16 conn_interval_max; 15512ce603ebSClaudio Takahasi __le16 conn_latency; 15522ce603ebSClaudio Takahasi __le16 supervision_timeout; 15532ce603ebSClaudio Takahasi __le16 min_ce_len; 15542ce603ebSClaudio Takahasi __le16 max_ce_len; 15552ce603ebSClaudio Takahasi } __packed; 15562ce603ebSClaudio Takahasi 15570fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 15580fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 15590fe29fd1SMarcel Holtmann __le16 handle; 15600fe29fd1SMarcel Holtmann } __packed; 15610fe29fd1SMarcel Holtmann 1562a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1563a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1564a7a595f6SVinicius Costa Gomes __le16 handle; 1565fe39c7b2SMarcel Holtmann __le64 rand; 1566a7a595f6SVinicius Costa Gomes __le16 ediv; 1567a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1568a7a595f6SVinicius Costa Gomes } __packed; 1569a7a595f6SVinicius Costa Gomes 1570a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1571a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1572a7a595f6SVinicius Costa Gomes __le16 handle; 1573a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1574a7a595f6SVinicius Costa Gomes } __packed; 1575a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1576a7a595f6SVinicius Costa Gomes __u8 status; 1577a7a595f6SVinicius Costa Gomes __le16 handle; 1578a7a595f6SVinicius Costa Gomes } __packed; 1579a7a595f6SVinicius Costa Gomes 1580a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1581a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1582a7a595f6SVinicius Costa Gomes __le16 handle; 1583a7a595f6SVinicius Costa Gomes } __packed; 1584a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1585a7a595f6SVinicius Costa Gomes __u8 status; 1586a7a595f6SVinicius Costa Gomes __le16 handle; 1587a7a595f6SVinicius Costa Gomes } __packed; 1588a7a595f6SVinicius Costa Gomes 15899b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 15909b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 15919b008c04SJohan Hedberg __u8 status; 15929b008c04SJohan Hedberg __u8 le_states[8]; 15939b008c04SJohan Hedberg } __packed; 15949b008c04SJohan Hedberg 15958e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 15968e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 15978e75b46aSAndre Guedes __le16 handle; 15988e75b46aSAndre Guedes __le16 interval_min; 15998e75b46aSAndre Guedes __le16 interval_max; 16008e75b46aSAndre Guedes __le16 latency; 16018e75b46aSAndre Guedes __le16 timeout; 16028e75b46aSAndre Guedes __le16 min_ce_len; 16038e75b46aSAndre Guedes __le16 max_ce_len; 16048e75b46aSAndre Guedes } __packed; 16058e75b46aSAndre Guedes 16068e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 16078e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 16088e75b46aSAndre Guedes __le16 handle; 16098e75b46aSAndre Guedes __u8 reason; 16108e75b46aSAndre Guedes } __packed; 16118e75b46aSAndre Guedes 161294a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 161394a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 161494a3bd02SMarcel Holtmann __le16 handle; 161594a3bd02SMarcel Holtmann __le16 tx_len; 161694a3bd02SMarcel Holtmann __le16 tx_time; 161794a3bd02SMarcel Holtmann } __packed; 161894a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 161994a3bd02SMarcel Holtmann __u8 status; 162094a3bd02SMarcel Holtmann __le16 handle; 162194a3bd02SMarcel Holtmann } __packed; 162294a3bd02SMarcel Holtmann 162394a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 162494a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 162594a3bd02SMarcel Holtmann __u8 status; 162694a3bd02SMarcel Holtmann __le16 tx_len; 162794a3bd02SMarcel Holtmann __le16 tx_time; 162894a3bd02SMarcel Holtmann } __packed; 162994a3bd02SMarcel Holtmann 163094a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 163194a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 163294a3bd02SMarcel Holtmann __le16 tx_len; 163394a3bd02SMarcel Holtmann __le16 tx_time; 163494a3bd02SMarcel Holtmann } __packed; 163594a3bd02SMarcel Holtmann 1636b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1637b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1638b950aa88SAnkit Navik __u8 bdaddr_type; 1639b950aa88SAnkit Navik bdaddr_t bdaddr; 1640b950aa88SAnkit Navik __u8 peer_irk[16]; 1641b950aa88SAnkit Navik __u8 local_irk[16]; 1642b950aa88SAnkit Navik } __packed; 1643b950aa88SAnkit Navik 1644b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1645b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1646b950aa88SAnkit Navik __u8 bdaddr_type; 1647b950aa88SAnkit Navik bdaddr_t bdaddr; 1648b950aa88SAnkit Navik } __packed; 1649b950aa88SAnkit Navik 1650545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1651545f2596SAnkit Navik 1652cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1653cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1654cfdb0c2dSAnkit Navik __u8 status; 1655cfdb0c2dSAnkit Navik __u8 size; 1656cfdb0c2dSAnkit Navik } __packed; 1657cfdb0c2dSAnkit Navik 1658aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1659aa12af77SAnkit Navik 1660b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e 1661b2cc2339SSathish Narasimman 166294a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 166394a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 166494a3bd02SMarcel Holtmann __u8 status; 166594a3bd02SMarcel Holtmann __le16 tx_len; 166694a3bd02SMarcel Holtmann __le16 tx_time; 166794a3bd02SMarcel Holtmann __le16 rx_len; 166894a3bd02SMarcel Holtmann __le16 rx_time; 166994a3bd02SMarcel Holtmann } __packed; 167094a3bd02SMarcel Holtmann 1671de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1672de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1673de2ba303SMarcel Holtmann __u8 all_phys; 1674de2ba303SMarcel Holtmann __u8 tx_phys; 1675de2ba303SMarcel Holtmann __u8 rx_phys; 1676de2ba303SMarcel Holtmann } __packed; 1677de2ba303SMarcel Holtmann 16786decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 16796decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 16806decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 16816decb5b4SJaganath Kanakkassery 1682a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1683a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1684a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1685a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1686a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1687a7e45454SGustavo A. R. Silva __u8 data[]; 1688a2344b9eSJaganath Kanakkassery } __packed; 1689a2344b9eSJaganath Kanakkassery 1690a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 169145bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 169245bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1693a2344b9eSJaganath Kanakkassery 1694a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1695a2344b9eSJaganath Kanakkassery __u8 type; 1696a2344b9eSJaganath Kanakkassery __le16 interval; 1697a2344b9eSJaganath Kanakkassery __le16 window; 1698a2344b9eSJaganath Kanakkassery } __packed; 1699a2344b9eSJaganath Kanakkassery 1700a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1701a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1702a2344b9eSJaganath Kanakkassery __u8 enable; 1703a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1704a2344b9eSJaganath Kanakkassery __le16 duration; 1705a2344b9eSJaganath Kanakkassery __le16 period; 1706a2344b9eSJaganath Kanakkassery } __packed; 1707a2344b9eSJaganath Kanakkassery 17084d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 17094d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 17104d94f95dSJaganath Kanakkassery __u8 filter_policy; 17114d94f95dSJaganath Kanakkassery __u8 own_addr_type; 17124d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 17134d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 17144d94f95dSJaganath Kanakkassery __u8 phys; 1715a7e45454SGustavo A. R. Silva __u8 data[]; 17164d94f95dSJaganath Kanakkassery } __packed; 17174d94f95dSJaganath Kanakkassery 17184d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 17194d94f95dSJaganath Kanakkassery __le16 scan_interval; 17204d94f95dSJaganath Kanakkassery __le16 scan_window; 17214d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 17224d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 17234d94f95dSJaganath Kanakkassery __le16 conn_latency; 17244d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 17254d94f95dSJaganath Kanakkassery __le16 min_ce_len; 17264d94f95dSJaganath Kanakkassery __le16 max_ce_len; 17274d94f95dSJaganath Kanakkassery } __packed; 17284d94f95dSJaganath Kanakkassery 17296b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 17306b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 17316b49bcb4SJaganath Kanakkassery __u8 status; 17326b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 17336b49bcb4SJaganath Kanakkassery } __packed; 17346b49bcb4SJaganath Kanakkassery 1735de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1736de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1737de181e88SJaganath Kanakkassery __u8 handle; 1738de181e88SJaganath Kanakkassery __le16 evt_properties; 1739de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1740de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1741de181e88SJaganath Kanakkassery __u8 channel_map; 1742de181e88SJaganath Kanakkassery __u8 own_addr_type; 1743de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1744de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1745de181e88SJaganath Kanakkassery __u8 filter_policy; 1746de181e88SJaganath Kanakkassery __u8 tx_power; 1747de181e88SJaganath Kanakkassery __u8 primary_phy; 1748de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1749de181e88SJaganath Kanakkassery __u8 secondary_phy; 1750de181e88SJaganath Kanakkassery __u8 sid; 1751de181e88SJaganath Kanakkassery __u8 notif_enable; 1752de181e88SJaganath Kanakkassery } __packed; 1753de181e88SJaganath Kanakkassery 1754de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 175585a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 175685a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1757de181e88SJaganath Kanakkassery 1758de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1759de181e88SJaganath Kanakkassery __u8 status; 1760de181e88SJaganath Kanakkassery __u8 tx_power; 1761de181e88SJaganath Kanakkassery } __packed; 1762de181e88SJaganath Kanakkassery 1763de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1764de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1765de181e88SJaganath Kanakkassery __u8 enable; 1766de181e88SJaganath Kanakkassery __u8 num_of_sets; 1767a7e45454SGustavo A. R. Silva __u8 data[]; 1768de181e88SJaganath Kanakkassery } __packed; 1769de181e88SJaganath Kanakkassery 1770de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1771de181e88SJaganath Kanakkassery __u8 handle; 1772de181e88SJaganath Kanakkassery __le16 duration; 1773de181e88SJaganath Kanakkassery __u8 max_events; 1774de181e88SJaganath Kanakkassery } __packed; 1775de181e88SJaganath Kanakkassery 1776a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1777a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1778a0fb3726SJaganath Kanakkassery __u8 handle; 1779a0fb3726SJaganath Kanakkassery __u8 operation; 1780a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1781a0fb3726SJaganath Kanakkassery __u8 length; 1782a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1783a0fb3726SJaganath Kanakkassery } __packed; 1784a0fb3726SJaganath Kanakkassery 1785a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1786a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1787a0fb3726SJaganath Kanakkassery __u8 handle; 1788a0fb3726SJaganath Kanakkassery __u8 operation; 1789a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1790a0fb3726SJaganath Kanakkassery __u8 length; 1791a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1792a0fb3726SJaganath Kanakkassery } __packed; 1793a0fb3726SJaganath Kanakkassery 1794a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1795a0fb3726SJaganath Kanakkassery 1796a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1797a0fb3726SJaganath Kanakkassery 1798a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET 0x203c 1799a9e45698SSathish Narsimman 180045b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 180145b7749fSJaganath Kanakkassery 1802a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1803a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1804a73c046aSJaganath Kanakkassery __u8 handle; 1805a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1806a73c046aSJaganath Kanakkassery } __packed; 1807a73c046aSJaganath Kanakkassery 18087c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 18097c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power { 18107c395ea5SDaniel Winkler __u8 status; 18117c395ea5SDaniel Winkler __s8 min_le_tx_power; 18127c395ea5SDaniel Winkler __s8 max_le_tx_power; 18137c395ea5SDaniel Winkler } __packed; 18147c395ea5SDaniel Winkler 18154de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 18164de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 { 18174de0fc59SLuiz Augusto von Dentz __u8 status; 18184de0fc59SLuiz Augusto von Dentz __le16 acl_mtu; 18194de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt; 18204de0fc59SLuiz Augusto von Dentz __le16 iso_mtu; 18214de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt; 18224de0fc59SLuiz Augusto von Dentz } __packed; 18234de0fc59SLuiz Augusto von Dentz 18244de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 18254de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync { 18264de0fc59SLuiz Augusto von Dentz __le16 handle; 18274de0fc59SLuiz Augusto von Dentz } __packed; 18284de0fc59SLuiz Augusto von Dentz 18294de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync { 18304de0fc59SLuiz Augusto von Dentz __u8 status; 18314de0fc59SLuiz Augusto von Dentz __le16 handle; 18324de0fc59SLuiz Augusto von Dentz __le16 seq; 18334de0fc59SLuiz Augusto von Dentz __le32 imestamp; 18344de0fc59SLuiz Augusto von Dentz __u8 offset[3]; 18354de0fc59SLuiz Augusto von Dentz } __packed; 18364de0fc59SLuiz Augusto von Dentz 18374de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062 18384de0fc59SLuiz Augusto von Dentz struct hci_cis_params { 18394de0fc59SLuiz Augusto von Dentz __u8 cis_id; 18404de0fc59SLuiz Augusto von Dentz __le16 m_sdu; 18414de0fc59SLuiz Augusto von Dentz __le16 s_sdu; 18424de0fc59SLuiz Augusto von Dentz __u8 m_phy; 18434de0fc59SLuiz Augusto von Dentz __u8 s_phy; 18444de0fc59SLuiz Augusto von Dentz __u8 m_rtn; 18454de0fc59SLuiz Augusto von Dentz __u8 s_rtn; 18464de0fc59SLuiz Augusto von Dentz } __packed; 18474de0fc59SLuiz Augusto von Dentz 18484de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params { 18494de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18504de0fc59SLuiz Augusto von Dentz __u8 m_interval[3]; 18514de0fc59SLuiz Augusto von Dentz __u8 s_interval[3]; 18524de0fc59SLuiz Augusto von Dentz __u8 sca; 18534de0fc59SLuiz Augusto von Dentz __u8 packing; 18544de0fc59SLuiz Augusto von Dentz __u8 framing; 18554de0fc59SLuiz Augusto von Dentz __le16 m_latency; 18564de0fc59SLuiz Augusto von Dentz __le16 s_latency; 18574de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1858a7e45454SGustavo A. R. Silva struct hci_cis_params cis[]; 18594de0fc59SLuiz Augusto von Dentz } __packed; 18604de0fc59SLuiz Augusto von Dentz 18614de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params { 18624de0fc59SLuiz Augusto von Dentz __u8 status; 18634de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18644de0fc59SLuiz Augusto von Dentz __u8 num_handles; 1865a7e45454SGustavo A. R. Silva __le16 handle[]; 18664de0fc59SLuiz Augusto von Dentz } __packed; 18674de0fc59SLuiz Augusto von Dentz 18684de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064 18694de0fc59SLuiz Augusto von Dentz struct hci_cis { 18704de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 18714de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 18724de0fc59SLuiz Augusto von Dentz } __packed; 18734de0fc59SLuiz Augusto von Dentz 18744de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis { 18754de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1876a7e45454SGustavo A. R. Silva struct hci_cis cis[]; 18774de0fc59SLuiz Augusto von Dentz } __packed; 18784de0fc59SLuiz Augusto von Dentz 18794de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065 18804de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig { 18814de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18824de0fc59SLuiz Augusto von Dentz } __packed; 18834de0fc59SLuiz Augusto von Dentz 18844de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066 18854de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis { 18864de0fc59SLuiz Augusto von Dentz __le16 handle; 18874de0fc59SLuiz Augusto von Dentz } __packed; 18884de0fc59SLuiz Augusto von Dentz 18894de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067 18904de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis { 18914de0fc59SLuiz Augusto von Dentz __le16 handle; 18924de0fc59SLuiz Augusto von Dentz __u8 reason; 18934de0fc59SLuiz Augusto von Dentz } __packed; 18944de0fc59SLuiz Augusto von Dentz 18951da177e4SLinus Torvalds /* ---- HCI Events ---- */ 18961da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 18971da177e4SLinus Torvalds 18981da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 18991da177e4SLinus Torvalds struct inquiry_info { 19001da177e4SLinus Torvalds bdaddr_t bdaddr; 19011da177e4SLinus Torvalds __u8 pscan_rep_mode; 19021da177e4SLinus Torvalds __u8 pscan_period_mode; 19031da177e4SLinus Torvalds __u8 pscan_mode; 19041da177e4SLinus Torvalds __u8 dev_class[3]; 19051ebb9252SMarcel Holtmann __le16 clock_offset; 190666c853ccSGustavo F. Padovan } __packed; 19071da177e4SLinus Torvalds 19081da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 19091da177e4SLinus Torvalds struct hci_ev_conn_complete { 19101da177e4SLinus Torvalds __u8 status; 19111ebb9252SMarcel Holtmann __le16 handle; 19121da177e4SLinus Torvalds bdaddr_t bdaddr; 19131da177e4SLinus Torvalds __u8 link_type; 19141da177e4SLinus Torvalds __u8 encr_mode; 191566c853ccSGustavo F. Padovan } __packed; 19161da177e4SLinus Torvalds 19171da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 19181da177e4SLinus Torvalds struct hci_ev_conn_request { 19191da177e4SLinus Torvalds bdaddr_t bdaddr; 19201da177e4SLinus Torvalds __u8 dev_class[3]; 19211da177e4SLinus Torvalds __u8 link_type; 192266c853ccSGustavo F. Padovan } __packed; 19231da177e4SLinus Torvalds 19241da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 19251da177e4SLinus Torvalds struct hci_ev_disconn_complete { 19261da177e4SLinus Torvalds __u8 status; 19271ebb9252SMarcel Holtmann __le16 handle; 19281da177e4SLinus Torvalds __u8 reason; 192966c853ccSGustavo F. Padovan } __packed; 19301da177e4SLinus Torvalds 19311da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 19321da177e4SLinus Torvalds struct hci_ev_auth_complete { 19331da177e4SLinus Torvalds __u8 status; 19341ebb9252SMarcel Holtmann __le16 handle; 193566c853ccSGustavo F. Padovan } __packed; 19361da177e4SLinus Torvalds 1937a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1938a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1939a9de9248SMarcel Holtmann __u8 status; 1940a9de9248SMarcel Holtmann bdaddr_t bdaddr; 19411f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 194266c853ccSGustavo F. Padovan } __packed; 1943a9de9248SMarcel Holtmann 19441da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 19451da177e4SLinus Torvalds struct hci_ev_encrypt_change { 19461da177e4SLinus Torvalds __u8 status; 19471ebb9252SMarcel Holtmann __le16 handle; 19481da177e4SLinus Torvalds __u8 encrypt; 194966c853ccSGustavo F. Padovan } __packed; 19501da177e4SLinus Torvalds 1951a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1952a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 19531da177e4SLinus Torvalds __u8 status; 19541ebb9252SMarcel Holtmann __le16 handle; 195566c853ccSGustavo F. Padovan } __packed; 19561da177e4SLinus Torvalds 1957a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1958a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1959a9de9248SMarcel Holtmann __u8 status; 1960a9de9248SMarcel Holtmann __le16 handle; 1961a9de9248SMarcel Holtmann __u8 features[8]; 196266c853ccSGustavo F. Padovan } __packed; 1963a9de9248SMarcel Holtmann 1964a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1965a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1966a9de9248SMarcel Holtmann __u8 status; 1967a9de9248SMarcel Holtmann __le16 handle; 1968a9de9248SMarcel Holtmann __u8 lmp_ver; 1969a9de9248SMarcel Holtmann __le16 manufacturer; 1970a9de9248SMarcel Holtmann __le16 lmp_subver; 197166c853ccSGustavo F. Padovan } __packed; 1972a9de9248SMarcel Holtmann 1973a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 19741da177e4SLinus Torvalds struct hci_qos { 19751da177e4SLinus Torvalds __u8 service_type; 19761da177e4SLinus Torvalds __u32 token_rate; 19771da177e4SLinus Torvalds __u32 peak_bandwidth; 19781da177e4SLinus Torvalds __u32 latency; 19791da177e4SLinus Torvalds __u32 delay_variation; 198066c853ccSGustavo F. Padovan } __packed; 19811da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 19821da177e4SLinus Torvalds __u8 status; 19831ebb9252SMarcel Holtmann __le16 handle; 19841da177e4SLinus Torvalds struct hci_qos qos; 198566c853ccSGustavo F. Padovan } __packed; 19861da177e4SLinus Torvalds 1987a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 19881da177e4SLinus Torvalds struct hci_ev_cmd_complete { 19891da177e4SLinus Torvalds __u8 ncmd; 19901ebb9252SMarcel Holtmann __le16 opcode; 199166c853ccSGustavo F. Padovan } __packed; 19921da177e4SLinus Torvalds 1993a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 19941da177e4SLinus Torvalds struct hci_ev_cmd_status { 19951da177e4SLinus Torvalds __u8 status; 19961da177e4SLinus Torvalds __u8 ncmd; 19971ebb9252SMarcel Holtmann __le16 opcode; 199866c853ccSGustavo F. Padovan } __packed; 19991da177e4SLinus Torvalds 200024dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 200124dfa343SMarcel Holtmann struct hci_ev_hardware_error { 200224dfa343SMarcel Holtmann __u8 code; 200324dfa343SMarcel Holtmann } __packed; 200424dfa343SMarcel Holtmann 20051da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 20061da177e4SLinus Torvalds struct hci_ev_role_change { 20071da177e4SLinus Torvalds __u8 status; 20081da177e4SLinus Torvalds bdaddr_t bdaddr; 20091da177e4SLinus Torvalds __u8 role; 201066c853ccSGustavo F. Padovan } __packed; 20111da177e4SLinus Torvalds 2012a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 2013613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 2014613a1c0cSAndrei Emeltchenko __le16 handle; 2015613a1c0cSAndrei Emeltchenko __le16 count; 2016613a1c0cSAndrei Emeltchenko } __packed; 2017613a1c0cSAndrei Emeltchenko 2018a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 2019a9de9248SMarcel Holtmann __u8 num_hndl; 2020a7e45454SGustavo A. R. Silva struct hci_comp_pkts_info handles[]; 202166c853ccSGustavo F. Padovan } __packed; 2022a9de9248SMarcel Holtmann 20231da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 20241da177e4SLinus Torvalds struct hci_ev_mode_change { 20251da177e4SLinus Torvalds __u8 status; 20261ebb9252SMarcel Holtmann __le16 handle; 20271da177e4SLinus Torvalds __u8 mode; 20281ebb9252SMarcel Holtmann __le16 interval; 202966c853ccSGustavo F. Padovan } __packed; 20301da177e4SLinus Torvalds 20311da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 20321da177e4SLinus Torvalds struct hci_ev_pin_code_req { 20331da177e4SLinus Torvalds bdaddr_t bdaddr; 203466c853ccSGustavo F. Padovan } __packed; 20351da177e4SLinus Torvalds 20361da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 20371da177e4SLinus Torvalds struct hci_ev_link_key_req { 20381da177e4SLinus Torvalds bdaddr_t bdaddr; 203966c853ccSGustavo F. Padovan } __packed; 20401da177e4SLinus Torvalds 20411da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 20421da177e4SLinus Torvalds struct hci_ev_link_key_notify { 20431da177e4SLinus Torvalds bdaddr_t bdaddr; 20449b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 20451da177e4SLinus Torvalds __u8 key_type; 204666c853ccSGustavo F. Padovan } __packed; 20471da177e4SLinus Torvalds 2048a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 20491da177e4SLinus Torvalds struct hci_ev_clock_offset { 20501da177e4SLinus Torvalds __u8 status; 20511ebb9252SMarcel Holtmann __le16 handle; 20521ebb9252SMarcel Holtmann __le16 clock_offset; 205366c853ccSGustavo F. Padovan } __packed; 20541da177e4SLinus Torvalds 2055a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 2056a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 2057a8746417SMarcel Holtmann __u8 status; 2058a8746417SMarcel Holtmann __le16 handle; 2059a8746417SMarcel Holtmann __le16 pkt_type; 206066c853ccSGustavo F. Padovan } __packed; 2061a8746417SMarcel Holtmann 206285a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 206385a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 206485a1e930SMarcel Holtmann bdaddr_t bdaddr; 206585a1e930SMarcel Holtmann __u8 pscan_rep_mode; 206666c853ccSGustavo F. Padovan } __packed; 206785a1e930SMarcel Holtmann 2068a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 2069a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 2070a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2071a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2072a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2073a9de9248SMarcel Holtmann __u8 dev_class[3]; 2074a9de9248SMarcel Holtmann __le16 clock_offset; 2075a9de9248SMarcel Holtmann __s8 rssi; 207666c853ccSGustavo F. Padovan } __packed; 2077a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 2078a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2079a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2080a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2081a9de9248SMarcel Holtmann __u8 pscan_mode; 2082a9de9248SMarcel Holtmann __u8 dev_class[3]; 2083a9de9248SMarcel Holtmann __le16 clock_offset; 2084a9de9248SMarcel Holtmann __s8 rssi; 208566c853ccSGustavo F. Padovan } __packed; 2086a9de9248SMarcel Holtmann 2087a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 2088a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 2089a9de9248SMarcel Holtmann __u8 status; 2090a9de9248SMarcel Holtmann __le16 handle; 2091a9de9248SMarcel Holtmann __u8 page; 2092a9de9248SMarcel Holtmann __u8 max_page; 2093a9de9248SMarcel Holtmann __u8 features[8]; 209466c853ccSGustavo F. Padovan } __packed; 2095a9de9248SMarcel Holtmann 2096a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 2097a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 2098a9de9248SMarcel Holtmann __u8 status; 2099a9de9248SMarcel Holtmann __le16 handle; 2100a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2101a9de9248SMarcel Holtmann __u8 link_type; 2102a9de9248SMarcel Holtmann __u8 tx_interval; 2103a9de9248SMarcel Holtmann __u8 retrans_window; 2104a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2105a9de9248SMarcel Holtmann __le16 tx_pkt_len; 2106a9de9248SMarcel Holtmann __u8 air_mode; 210766c853ccSGustavo F. Padovan } __packed; 2108a9de9248SMarcel Holtmann 2109a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 2110a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 2111a9de9248SMarcel Holtmann __u8 status; 2112a9de9248SMarcel Holtmann __le16 handle; 2113a9de9248SMarcel Holtmann __u8 tx_interval; 2114a9de9248SMarcel Holtmann __u8 retrans_window; 2115a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2116a9de9248SMarcel Holtmann __le16 tx_pkt_len; 211766c853ccSGustavo F. Padovan } __packed; 2118a9de9248SMarcel Holtmann 2119a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 212004837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 212104837f64SMarcel Holtmann __u8 status; 212204837f64SMarcel Holtmann __le16 handle; 212304837f64SMarcel Holtmann __le16 max_tx_latency; 212404837f64SMarcel Holtmann __le16 max_rx_latency; 212504837f64SMarcel Holtmann __le16 max_remote_timeout; 212604837f64SMarcel Holtmann __le16 max_local_timeout; 212766c853ccSGustavo F. Padovan } __packed; 212804837f64SMarcel Holtmann 2129a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 2130a9de9248SMarcel Holtmann struct extended_inquiry_info { 2131a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2132a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2133a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2134a9de9248SMarcel Holtmann __u8 dev_class[3]; 2135a9de9248SMarcel Holtmann __le16 clock_offset; 2136a9de9248SMarcel Holtmann __s8 rssi; 2137a9de9248SMarcel Holtmann __u8 data[240]; 213866c853ccSGustavo F. Padovan } __packed; 2139a9de9248SMarcel Holtmann 21401c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 21411c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 21421c2e0041SJohan Hedberg __u8 status; 21431c2e0041SJohan Hedberg __le16 handle; 21441c2e0041SJohan Hedberg } __packed; 21451c2e0041SJohan Hedberg 21460493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 21470493684eSMarcel Holtmann struct hci_ev_io_capa_request { 21480493684eSMarcel Holtmann bdaddr_t bdaddr; 214966c853ccSGustavo F. Padovan } __packed; 21500493684eSMarcel Holtmann 215103b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 215203b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 215303b555e1SJohan Hedberg bdaddr_t bdaddr; 215403b555e1SJohan Hedberg __u8 capability; 215503b555e1SJohan Hedberg __u8 oob_data; 215603b555e1SJohan Hedberg __u8 authentication; 215703b555e1SJohan Hedberg } __packed; 215803b555e1SJohan Hedberg 2159a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 2160a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 2161a5c29683SJohan Hedberg bdaddr_t bdaddr; 2162a5c29683SJohan Hedberg __le32 passkey; 2163a5c29683SJohan Hedberg } __packed; 2164a5c29683SJohan Hedberg 21659ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 21669ad4019aSBrian Gix struct hci_ev_user_passkey_req { 21679ad4019aSBrian Gix bdaddr_t bdaddr; 21689ad4019aSBrian Gix } __packed; 21699ad4019aSBrian Gix 21702763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 21712763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 21722763eda6SSzymon Janc bdaddr_t bdaddr; 21732763eda6SSzymon Janc } __packed; 21742763eda6SSzymon Janc 21750493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 21760493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 21770493684eSMarcel Holtmann __u8 status; 21780493684eSMarcel Holtmann bdaddr_t bdaddr; 217966c853ccSGustavo F. Padovan } __packed; 21800493684eSMarcel Holtmann 218192a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 218292a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 218392a25256SJohan Hedberg bdaddr_t bdaddr; 218492a25256SJohan Hedberg __le32 passkey; 218592a25256SJohan Hedberg } __packed; 218692a25256SJohan Hedberg 218792a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 218892a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 218992a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 219092a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 219192a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 219292a25256SJohan Hedberg 219392a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 219492a25256SJohan Hedberg struct hci_ev_keypress_notify { 219592a25256SJohan Hedberg bdaddr_t bdaddr; 219692a25256SJohan Hedberg __u8 type; 219792a25256SJohan Hedberg } __packed; 219892a25256SJohan Hedberg 219941a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 220041a96212SMarcel Holtmann struct hci_ev_remote_host_features { 220141a96212SMarcel Holtmann bdaddr_t bdaddr; 220241a96212SMarcel Holtmann __u8 features[8]; 220366c853ccSGustavo F. Padovan } __packed; 220441a96212SMarcel Holtmann 220563185f64SVille Tervo #define HCI_EV_LE_META 0x3e 220663185f64SVille Tervo struct hci_ev_le_meta { 220763185f64SVille Tervo __u8 subevent; 220863185f64SVille Tervo } __packed; 220963185f64SVille Tervo 2210523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2211523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2212523e93cdSAndrei Emeltchenko __u8 status; 2213523e93cdSAndrei Emeltchenko __u8 phy_handle; 2214523e93cdSAndrei Emeltchenko } __packed; 2215523e93cdSAndrei Emeltchenko 2216523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2217523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2218523e93cdSAndrei Emeltchenko __u8 phy_handle; 2219523e93cdSAndrei Emeltchenko } __packed; 2220523e93cdSAndrei Emeltchenko 2221523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2222523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2223523e93cdSAndrei Emeltchenko __u8 status; 2224523e93cdSAndrei Emeltchenko __u8 phy_handle; 2225523e93cdSAndrei Emeltchenko __u8 reason; 2226523e93cdSAndrei Emeltchenko } __packed; 2227523e93cdSAndrei Emeltchenko 2228523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2229523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2230523e93cdSAndrei Emeltchenko __u8 status; 2231523e93cdSAndrei Emeltchenko __le16 handle; 2232523e93cdSAndrei Emeltchenko __u8 phy_handle; 2233523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2234523e93cdSAndrei Emeltchenko } __packed; 2235523e93cdSAndrei Emeltchenko 2236523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2237523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2238523e93cdSAndrei Emeltchenko __u8 status; 2239523e93cdSAndrei Emeltchenko __le16 handle; 2240523e93cdSAndrei Emeltchenko __u8 reason; 2241523e93cdSAndrei Emeltchenko } __packed; 2242523e93cdSAndrei Emeltchenko 224325e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 224425e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 224525e89e99SAndrei Emeltchenko __le16 handle; 224625e89e99SAndrei Emeltchenko __le16 pkts; 224725e89e99SAndrei Emeltchenko __le16 blocks; 224825e89e99SAndrei Emeltchenko } __packed; 224925e89e99SAndrei Emeltchenko 225025e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 225125e89e99SAndrei Emeltchenko __le16 num_blocks; 225225e89e99SAndrei Emeltchenko __u8 num_hndl; 2253a7e45454SGustavo A. R. Silva struct hci_comp_blocks_info handles[]; 225425e89e99SAndrei Emeltchenko } __packed; 225525e89e99SAndrei Emeltchenko 22562b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 22572b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 22582b359445SDoHyun Pyun __u8 status; 22592b359445SDoHyun Pyun } __packed; 22602b359445SDoHyun Pyun 22612ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 22622ed01805SDoHyun Pyun 226363185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 226463185f64SVille Tervo struct hci_ev_le_conn_complete { 226563185f64SVille Tervo __u8 status; 226663185f64SVille Tervo __le16 handle; 226763185f64SVille Tervo __u8 role; 226863185f64SVille Tervo __u8 bdaddr_type; 226963185f64SVille Tervo bdaddr_t bdaddr; 227063185f64SVille Tervo __le16 interval; 227163185f64SVille Tervo __le16 latency; 227263185f64SVille Tervo __le16 supervision_timeout; 227363185f64SVille Tervo __u8 clk_accurancy; 227463185f64SVille Tervo } __packed; 227563185f64SVille Tervo 22762331fd46SMarcel Holtmann /* Advertising report event types */ 22772331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 22782331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 22792331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 22802331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 22812331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2282c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2283c215e939SJaganath Kanakkassery 2284c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2285c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2286c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2287c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2288c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2289c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2290c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 22912331fd46SMarcel Holtmann 2292b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2293b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2294b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2295b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2296b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2297b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2298b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2299b2cc9761SJaganath Kanakkassery 23002331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 23012331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 23026540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 23036540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 23042331fd46SMarcel Holtmann 23052331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 23062331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 23072331fd46SMarcel Holtmann __u8 evt_type; 23082331fd46SMarcel Holtmann __u8 bdaddr_type; 23092331fd46SMarcel Holtmann bdaddr_t bdaddr; 23102331fd46SMarcel Holtmann __u8 length; 2311a7e45454SGustavo A. R. Silva __u8 data[]; 23122331fd46SMarcel Holtmann } __packed; 23132331fd46SMarcel Holtmann 23141855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 23151855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 23161855d92dSMarcel Holtmann __u8 status; 23171855d92dSMarcel Holtmann __le16 handle; 23181855d92dSMarcel Holtmann __le16 interval; 23191855d92dSMarcel Holtmann __le16 latency; 23201855d92dSMarcel Holtmann __le16 supervision_timeout; 23211855d92dSMarcel Holtmann } __packed; 23221855d92dSMarcel Holtmann 23230fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 23240fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 23250fe29fd1SMarcel Holtmann __u8 status; 23260fe29fd1SMarcel Holtmann __le16 handle; 23270fe29fd1SMarcel Holtmann __u8 features[8]; 23280fe29fd1SMarcel Holtmann } __packed; 23290fe29fd1SMarcel Holtmann 2330a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2331a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2332a7a595f6SVinicius Costa Gomes __le16 handle; 2333fe39c7b2SMarcel Holtmann __le64 rand; 2334a7a595f6SVinicius Costa Gomes __le16 ediv; 2335a7a595f6SVinicius Costa Gomes } __packed; 2336a7a595f6SVinicius Costa Gomes 23378e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 23388e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 23398e75b46aSAndre Guedes __le16 handle; 23408e75b46aSAndre Guedes __le16 interval_min; 23418e75b46aSAndre Guedes __le16 interval_max; 23428e75b46aSAndre Guedes __le16 latency; 23438e75b46aSAndre Guedes __le16 timeout; 23448e75b46aSAndre Guedes } __packed; 23458e75b46aSAndre Guedes 234694a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 234794a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 234894a3bd02SMarcel Holtmann __le16 handle; 234994a3bd02SMarcel Holtmann __le16 tx_len; 235094a3bd02SMarcel Holtmann __le16 tx_time; 235194a3bd02SMarcel Holtmann __le16 rx_len; 235294a3bd02SMarcel Holtmann __le16 rx_time; 235394a3bd02SMarcel Holtmann } __packed; 235494a3bd02SMarcel Holtmann 235532c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 235632c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 235732c9d43fSMarcel Holtmann __u8 evt_type; 235832c9d43fSMarcel Holtmann __u8 bdaddr_type; 235932c9d43fSMarcel Holtmann bdaddr_t bdaddr; 236032c9d43fSMarcel Holtmann __u8 direct_addr_type; 236132c9d43fSMarcel Holtmann bdaddr_t direct_addr; 236232c9d43fSMarcel Holtmann __s8 rssi; 236332c9d43fSMarcel Holtmann } __packed; 236432c9d43fSMarcel Holtmann 23651efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 23661efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 23671efd927dSLuiz Augusto von Dentz __u8 status; 23684de0fc59SLuiz Augusto von Dentz __le16 handle; 23691efd927dSLuiz Augusto von Dentz __u8 tx_phy; 23701efd927dSLuiz Augusto von Dentz __u8 rx_phy; 23711efd927dSLuiz Augusto von Dentz } __packed; 23721efd927dSLuiz Augusto von Dentz 2373c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2374c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2375c215e939SJaganath Kanakkassery __le16 evt_type; 2376c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2377c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2378c215e939SJaganath Kanakkassery __u8 primary_phy; 2379c215e939SJaganath Kanakkassery __u8 secondary_phy; 2380c215e939SJaganath Kanakkassery __u8 sid; 2381c215e939SJaganath Kanakkassery __u8 tx_power; 2382c215e939SJaganath Kanakkassery __s8 rssi; 2383c215e939SJaganath Kanakkassery __le16 interval; 2384c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2385c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2386c215e939SJaganath Kanakkassery __u8 length; 2387a7e45454SGustavo A. R. Silva __u8 data[]; 2388c215e939SJaganath Kanakkassery } __packed; 2389c215e939SJaganath Kanakkassery 23904d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 23914d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 23924d94f95dSJaganath Kanakkassery __u8 status; 23934d94f95dSJaganath Kanakkassery __le16 handle; 23944d94f95dSJaganath Kanakkassery __u8 role; 23954d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 23964d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 23974d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 23984d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 23994d94f95dSJaganath Kanakkassery __le16 interval; 24004d94f95dSJaganath Kanakkassery __le16 latency; 24014d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 24024d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 24034d94f95dSJaganath Kanakkassery } __packed; 24044d94f95dSJaganath Kanakkassery 2405acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2406acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2407acf0aeaeSJaganath Kanakkassery __u8 status; 2408acf0aeaeSJaganath Kanakkassery __u8 handle; 2409acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2410acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2411acf0aeaeSJaganath Kanakkassery } __packed; 2412acf0aeaeSJaganath Kanakkassery 24134de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19 24144de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established { 24154de0fc59SLuiz Augusto von Dentz __u8 status; 24164de0fc59SLuiz Augusto von Dentz __le16 handle; 24174de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3]; 24184de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3]; 24194de0fc59SLuiz Augusto von Dentz __u8 m_latency[3]; 24204de0fc59SLuiz Augusto von Dentz __u8 s_latency[3]; 24214de0fc59SLuiz Augusto von Dentz __u8 m_phy; 24224de0fc59SLuiz Augusto von Dentz __u8 s_phy; 24234de0fc59SLuiz Augusto von Dentz __u8 nse; 24244de0fc59SLuiz Augusto von Dentz __u8 m_bn; 24254de0fc59SLuiz Augusto von Dentz __u8 s_bn; 24264de0fc59SLuiz Augusto von Dentz __u8 m_ft; 24274de0fc59SLuiz Augusto von Dentz __u8 s_ft; 24284de0fc59SLuiz Augusto von Dentz __le16 m_mtu; 24294de0fc59SLuiz Augusto von Dentz __le16 s_mtu; 24304de0fc59SLuiz Augusto von Dentz __le16 interval; 24314de0fc59SLuiz Augusto von Dentz } __packed; 24324de0fc59SLuiz Augusto von Dentz 24334de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a 24344de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req { 24354de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 24364de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 24374de0fc59SLuiz Augusto von Dentz __u8 cig_id; 24384de0fc59SLuiz Augusto von Dentz __u8 cis_id; 24394de0fc59SLuiz Augusto von Dentz } __packed; 24404de0fc59SLuiz Augusto von Dentz 2441e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2442e4cc5a18SMarcel Holtmann 24431da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2444a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 24451da177e4SLinus Torvalds struct hci_ev_stack_internal { 24461da177e4SLinus Torvalds __u16 type; 2447a7e45454SGustavo A. R. Silva __u8 data[]; 244866c853ccSGustavo F. Padovan } __packed; 24491da177e4SLinus Torvalds 24501da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 24511da177e4SLinus Torvalds struct hci_ev_si_device { 24521da177e4SLinus Torvalds __u16 event; 24531da177e4SLinus Torvalds __u16 dev_id; 245466c853ccSGustavo F. Padovan } __packed; 24551da177e4SLinus Torvalds 24561da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 24571da177e4SLinus Torvalds struct hci_ev_si_security { 24581da177e4SLinus Torvalds __u16 event; 24591da177e4SLinus Torvalds __u16 proto; 24601da177e4SLinus Torvalds __u16 subproto; 24611da177e4SLinus Torvalds __u8 incoming; 246266c853ccSGustavo F. Padovan } __packed; 24631da177e4SLinus Torvalds 24641da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 24651da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 24661da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 24671da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 24681da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 24694de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4 24701da177e4SLinus Torvalds 24711da177e4SLinus Torvalds struct hci_command_hdr { 24721ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 24731da177e4SLinus Torvalds __u8 plen; 247466c853ccSGustavo F. Padovan } __packed; 24751da177e4SLinus Torvalds 24761da177e4SLinus Torvalds struct hci_event_hdr { 24771da177e4SLinus Torvalds __u8 evt; 24781da177e4SLinus Torvalds __u8 plen; 247966c853ccSGustavo F. Padovan } __packed; 24801da177e4SLinus Torvalds 24811da177e4SLinus Torvalds struct hci_acl_hdr { 24821ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 24831ebb9252SMarcel Holtmann __le16 dlen; 248466c853ccSGustavo F. Padovan } __packed; 24851da177e4SLinus Torvalds 24861da177e4SLinus Torvalds struct hci_sco_hdr { 24871ebb9252SMarcel Holtmann __le16 handle; 24881da177e4SLinus Torvalds __u8 dlen; 248966c853ccSGustavo F. Padovan } __packed; 24901da177e4SLinus Torvalds 24914de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr { 24924de0fc59SLuiz Augusto von Dentz __le16 handle; 24934de0fc59SLuiz Augusto von Dentz __le16 dlen; 2494a7e45454SGustavo A. R. Silva __u8 data[]; 24954de0fc59SLuiz Augusto von Dentz } __packed; 24964de0fc59SLuiz Augusto von Dentz 24974de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */ 24984de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00 24994de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01 25004de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02 25014de0fc59SLuiz Augusto von Dentz 25024de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4 25034de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr { 25044de0fc59SLuiz Augusto von Dentz __le16 sn; 25054de0fc59SLuiz Augusto von Dentz __le16 slen; 25064de0fc59SLuiz Augusto von Dentz }; 25074de0fc59SLuiz Augusto von Dentz 25084de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8 25094de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr { 25104de0fc59SLuiz Augusto von Dentz __le32 ts; 25114de0fc59SLuiz Augusto von Dentz __le16 sn; 25124de0fc59SLuiz Augusto von Dentz __le16 slen; 25134de0fc59SLuiz Augusto von Dentz }; 25144de0fc59SLuiz Augusto von Dentz 25152a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 25162a123b86SArnaldo Carvalho de Melo { 25172a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 25182a123b86SArnaldo Carvalho de Melo } 25192a123b86SArnaldo Carvalho de Melo 25202a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 25212a123b86SArnaldo Carvalho de Melo { 25222a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 25232a123b86SArnaldo Carvalho de Melo } 25242a123b86SArnaldo Carvalho de Melo 25252a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 25262a123b86SArnaldo Carvalho de Melo { 25272a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 25282a123b86SArnaldo Carvalho de Melo } 25292a123b86SArnaldo Carvalho de Melo 25301da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2531c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 25321da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 25331da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 25341da177e4SLinus Torvalds 25351da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2536c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 25371da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 25381da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 25391da177e4SLinus Torvalds 25404de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */ 25414de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003) 25424de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) 25434de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) 25444de0fc59SLuiz Augusto von Dentz 25454de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */ 25464de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) 25474de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff) 25484de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14) 25494de0fc59SLuiz Augusto von Dentz 25505cbd3ebdSAlain Michaud /* le24 support */ 25515cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) 25525cbd3ebdSAlain Michaud { 25535cbd3ebdSAlain Michaud dst[0] = val & 0xff; 25545cbd3ebdSAlain Michaud dst[1] = (val & 0xff00) >> 8; 25555cbd3ebdSAlain Michaud dst[2] = (val & 0xff0000) >> 16; 25565cbd3ebdSAlain Michaud } 25575cbd3ebdSAlain Michaud 25581da177e4SLinus Torvalds #endif /* __HCI_H */ 2559