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, 241219991e6SHans de Goede 242219991e6SHans de Goede /* 243219991e6SHans de Goede * When this quirk is set, then the hci_suspend_notifier is not 244219991e6SHans de Goede * registered. This is intended for devices which drop completely 245219991e6SHans de Goede * from the bus on system-suspend and which will show up as a new 246219991e6SHans de Goede * HCI after resume. 247219991e6SHans de Goede */ 248219991e6SHans de Goede HCI_QUIRK_NO_SUSPEND_NOTIFIER, 2491da177e4SLinus Torvalds }; 2501da177e4SLinus Torvalds 2511da177e4SLinus Torvalds /* HCI device flags */ 2521da177e4SLinus Torvalds enum { 2531da177e4SLinus Torvalds HCI_UP, 2541da177e4SLinus Torvalds HCI_INIT, 2551da177e4SLinus Torvalds HCI_RUNNING, 2561da177e4SLinus Torvalds 2571da177e4SLinus Torvalds HCI_PSCAN, 2581da177e4SLinus Torvalds HCI_ISCAN, 2591da177e4SLinus Torvalds HCI_AUTH, 2601da177e4SLinus Torvalds HCI_ENCRYPT, 2611da177e4SLinus Torvalds HCI_INQUIRY, 2621da177e4SLinus Torvalds 2631da177e4SLinus Torvalds HCI_RAW, 264ab81cbf9SJohan Hedberg 26510572132SGustavo F. Padovan HCI_RESET, 2661da177e4SLinus Torvalds }; 2671da177e4SLinus Torvalds 268f9207338SMarcel Holtmann /* HCI socket flags */ 269f9207338SMarcel Holtmann enum { 27050ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 271f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 272f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 273ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 274321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2755504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2765504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2775504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2785504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 27972000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 280a10c907cSMarcel Holtmann HCI_MGMT_EXP_FEATURE_EVENTS, 281f9207338SMarcel Holtmann }; 282f9207338SMarcel Holtmann 283d23264a8SAndre Guedes /* 284d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 285d23264a8SAndre Guedes * states from the controller. 286d23264a8SAndre Guedes */ 287d23264a8SAndre Guedes enum { 288a8b2d5c2SJohan Hedberg HCI_SETUP, 289d603b76bSMarcel Holtmann HCI_CONFIG, 290a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2915e130367SJohan Hedberg HCI_RFKILLED, 292a8b2d5c2SJohan Hedberg HCI_MGMT, 293b6ae8457SJohan Hedberg HCI_BONDABLE, 294a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2950663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2963769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 29794324962SJohan Hovold HCI_UNREGISTER, 2984a964404SMarcel Holtmann HCI_UNCONFIGURED, 2990736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 300dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 30166c417c1SJohan Hedberg HCI_LE_ADV, 302d23264a8SAndre Guedes HCI_LE_SCAN, 30384bde9d6SJohan Hedberg HCI_SSP_ENABLED, 304e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 305134c2a89SMarcel Holtmann HCI_SC_ONLY, 306863efaf2SJohan Hedberg HCI_PRIVACY, 30782a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 308d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 30941edf160SJohan Hedberg HCI_RPA_RESOLVING, 3106d80dfd0SJohan Hedberg HCI_HS_ENABLED, 31106199cf8SJohan Hedberg HCI_LE_ENABLED, 312f3d3444aSJohan Hedberg HCI_ADVERTISING, 313cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 3145e5282bbSJohan Hedberg HCI_CONNECTABLE, 3155e5282bbSJohan Hedberg HCI_DISCOVERABLE, 3166acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 31747990ea0SJohan Hedberg HCI_LINK_SECURITY, 31821693c15SAndre Guedes HCI_PERIODIC_INQ, 3191a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 32056f87901SJohan Hedberg HCI_BREDR_ENABLED, 32181ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 32200bce3fbSAlain Michaud HCI_WIDEBAND_SPEECH_ENABLED, 323e5b0ad69SAbhishek Pandit-Subedi HCI_EVENT_FILTER_CONFIGURED, 324b7cb93e5SMarcel Holtmann 325b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 3264b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 327b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 328b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 329aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 330cbbdfa6fSSathish Narasimman HCI_ENABLE_LL_PRIVACY, 331f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 332c2aa30dbSArchie Pusaka HCI_FORCE_NO_MITM, 333b7cb93e5SMarcel Holtmann 334eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 335d23264a8SAndre Guedes }; 336d23264a8SAndre Guedes 3371da177e4SLinus Torvalds /* HCI timeouts */ 3385f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 3395f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 3405f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 341d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 342*de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3435f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 3449345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 345a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 3469489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 3471f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3481da177e4SLinus Torvalds 3495b7f9909SMarcel Holtmann /* HCI data types */ 3501da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3511da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3521da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3531da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 3544de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05 355e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3561da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3571da177e4SLinus Torvalds 3585b7f9909SMarcel Holtmann /* HCI packet types */ 3591da177e4SLinus Torvalds #define HCI_DM1 0x0008 3601da177e4SLinus Torvalds #define HCI_DM3 0x0400 3611da177e4SLinus Torvalds #define HCI_DM5 0x4000 3621da177e4SLinus Torvalds #define HCI_DH1 0x0010 3631da177e4SLinus Torvalds #define HCI_DH3 0x0800 3641da177e4SLinus Torvalds #define HCI_DH5 0x8000 3651da177e4SLinus Torvalds 3665075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3675075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3685075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3695075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3705075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3715075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3725075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3735075b972SJaganath Kanakkassery 3741da177e4SLinus Torvalds #define HCI_HV1 0x0020 3751da177e4SLinus Torvalds #define HCI_HV2 0x0040 3761da177e4SLinus Torvalds #define HCI_HV3 0x0080 3771da177e4SLinus Torvalds 3781da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 3791da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 3801da177e4SLinus Torvalds 3815b7f9909SMarcel Holtmann /* eSCO packet types */ 3825b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 3835b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 3845b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 3855b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 3865b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3875b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 388efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 389efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 390efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 391efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3925b7f9909SMarcel Holtmann 393a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 394efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 395a8746417SMarcel Holtmann 3961da177e4SLinus Torvalds /* ACL flags */ 397e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3981da177e4SLinus Torvalds #define ACL_CONT 0x01 3991da177e4SLinus Torvalds #define ACL_START 0x02 400d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 4011da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 4021da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 4031da177e4SLinus Torvalds 4044de0fc59SLuiz Augusto von Dentz /* ISO PB flags */ 4054de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00 4064de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01 4074de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02 4084de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03 4094de0fc59SLuiz Augusto von Dentz 4104de0fc59SLuiz Augusto von Dentz /* ISO TS flags */ 4114de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01 4124de0fc59SLuiz Augusto von Dentz 4131da177e4SLinus Torvalds /* Baseband links */ 4141da177e4SLinus Torvalds #define SCO_LINK 0x00 4151da177e4SLinus Torvalds #define ACL_LINK 0x01 4165b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 417fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 418fcd89c09SVille Tervo #define LE_LINK 0x80 4193161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 4204de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82 421845472e8SMarcel Holtmann #define INVALID_LINK 0xff 4221da177e4SLinus Torvalds 4231da177e4SLinus Torvalds /* LMP features */ 4241da177e4SLinus Torvalds #define LMP_3SLOT 0x01 4251da177e4SLinus Torvalds #define LMP_5SLOT 0x02 4261da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 4271da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 4281da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 4291da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 4301da177e4SLinus Torvalds #define LMP_HOLD 0x40 43104837f64SMarcel Holtmann #define LMP_SNIFF 0x80 4321da177e4SLinus Torvalds 4331da177e4SLinus Torvalds #define LMP_PARK 0x01 4341da177e4SLinus Torvalds #define LMP_RSSI 0x02 4351da177e4SLinus Torvalds #define LMP_QUALITY 0x04 4361da177e4SLinus Torvalds #define LMP_SCO 0x08 4371da177e4SLinus Torvalds #define LMP_HV2 0x10 4381da177e4SLinus Torvalds #define LMP_HV3 0x20 4391da177e4SLinus Torvalds #define LMP_ULAW 0x40 4401da177e4SLinus Torvalds #define LMP_ALAW 0x80 4411da177e4SLinus Torvalds 4421da177e4SLinus Torvalds #define LMP_CVSD 0x01 4431da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 4441da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 44507a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 4461da177e4SLinus Torvalds 4475075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 4485075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 449d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 4505b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 4515b7f9909SMarcel Holtmann 4525b7f9909SMarcel Holtmann #define LMP_EV4 0x01 4535b7f9909SMarcel Holtmann #define LMP_EV5 0x02 45469ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 455d5859e22SJohan Hedberg #define LMP_LE 0x40 4565075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 4575b7f9909SMarcel Holtmann 4585075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 45904837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 460d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 461efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 462efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 463efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 46404837f64SMarcel Holtmann 465d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 466e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 467769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 468e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 469769be974SMarcel Holtmann 470d5859e22SJohan Hedberg #define LMP_LSTO 0x01 471d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 472971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 473d5859e22SJohan Hedberg 474eead27daSAndre Guedes /* Extended LMP features */ 47553b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 47653b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 47753b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 47853b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 47953b834d2SMarcel Holtmann 480d5991585SMarcel Holtmann #define LMP_SC 0x01 481d5991585SMarcel Holtmann #define LMP_PING 0x02 482d5991585SMarcel Holtmann 48353b834d2SMarcel Holtmann /* Host features */ 484cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 485eead27daSAndre Guedes #define LMP_HOST_LE 0x02 486cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 487d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 488eead27daSAndre Guedes 489662bc2e6SAndre Guedes /* LE features */ 4900da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 491662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 4920fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 493cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 49494a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 495ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY 0x40 4964b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 4975075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 4985075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 49955beec10SMarcel Holtmann #define HCI_LE_EXT_ADV 0x10 5009756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 5014de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_MASTER 0x10 5024de0fc59SLuiz Augusto von Dentz #define HCI_LE_CIS_SLAVE 0x20 503662bc2e6SAndre Guedes 50404837f64SMarcel Holtmann /* Connection modes */ 50504837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 50604837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 50704837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 50804837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 50904837f64SMarcel Holtmann 5101da177e4SLinus Torvalds /* Link policies */ 5111da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 5121da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 5131da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 5141da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 5151da177e4SLinus Torvalds 51604837f64SMarcel Holtmann /* Link modes */ 5171da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 5181da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 5191da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 5201da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 5211da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 5221da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 5231da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 5247b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 5251da177e4SLinus Torvalds 52640be492fSMarcel Holtmann /* Authentication types */ 52740be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 52840be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 52940be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 53040be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 53140be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 53240be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 53340be492fSMarcel Holtmann 534a77b15a6SMikel Astiz /* I/O capabilities */ 535a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 536a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 537a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 538a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 539a77b15a6SMikel Astiz 540b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 541b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 542b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 543b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 544b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 54511015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 54611015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 547b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 54811015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 54911015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 550b6020ba0SWaldemar Rymarkiewicz 5519f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 5528e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 5539f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 554160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 5552acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 556cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 557d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 5589f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 5599f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 560cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 561cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5629f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5639f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5644ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5654ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5663c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5679f5a0d7bSAndrei Emeltchenko 5682455a3eaSAndrei Emeltchenko /* Flow control modes */ 5692455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5702455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5712455a3eaSAndrei Emeltchenko 572bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 573bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 574a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 575bbaf444aSJohan Hedberg 576ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 577ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 578ba165a90SJohan Hedberg 57932748db0SJohan Hedberg /* Extended Inquiry Response field types */ 58032748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 58132748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 58232748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 58332748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 58432748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 58532748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 58632748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 58732748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 58832748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 58932748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 5909ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 591d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 592d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 59332748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 5944453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 5951471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 5961471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 597d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 598d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 599f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 600f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 60132748db0SJohan Hedberg 6023f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 6033f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 6043f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 6053f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 6063f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 6073f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 6083f0f524bSJohan Hedberg 6091da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 6106bd32326SVille Tervo #define HCI_OP_NOP 0x0000 6116bd32326SVille Tervo 612a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 613a9de9248SMarcel Holtmann struct hci_cp_inquiry { 614a9de9248SMarcel Holtmann __u8 lap[3]; 615a9de9248SMarcel Holtmann __u8 length; 616a9de9248SMarcel Holtmann __u8 num_rsp; 61766c853ccSGustavo F. Padovan } __packed; 6181da177e4SLinus Torvalds 619a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 620a9de9248SMarcel Holtmann 62179d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 62279d6e068SAndre Guedes 623a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 624a9de9248SMarcel Holtmann 625a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 626a9de9248SMarcel Holtmann struct hci_cp_create_conn { 627a9de9248SMarcel Holtmann bdaddr_t bdaddr; 628a9de9248SMarcel Holtmann __le16 pkt_type; 629a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 630a9de9248SMarcel Holtmann __u8 pscan_mode; 631a9de9248SMarcel Holtmann __le16 clock_offset; 632a9de9248SMarcel Holtmann __u8 role_switch; 63366c853ccSGustavo F. Padovan } __packed; 6341da177e4SLinus Torvalds 635a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 636a9de9248SMarcel Holtmann struct hci_cp_disconnect { 637a9de9248SMarcel Holtmann __le16 handle; 638a9de9248SMarcel Holtmann __u8 reason; 63966c853ccSGustavo F. Padovan } __packed; 6401da177e4SLinus Torvalds 641a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 642a9de9248SMarcel Holtmann struct hci_cp_add_sco { 643a9de9248SMarcel Holtmann __le16 handle; 644a9de9248SMarcel Holtmann __le16 pkt_type; 64566c853ccSGustavo F. Padovan } __packed; 646a9de9248SMarcel Holtmann 647a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 648a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 6491da177e4SLinus Torvalds bdaddr_t bdaddr; 65066c853ccSGustavo F. Padovan } __packed; 6511da177e4SLinus Torvalds 652a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 653a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 654a9de9248SMarcel Holtmann bdaddr_t bdaddr; 655a9de9248SMarcel Holtmann __u8 role; 65666c853ccSGustavo F. Padovan } __packed; 6571da177e4SLinus Torvalds 658a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 659a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 660a9de9248SMarcel Holtmann bdaddr_t bdaddr; 661a9de9248SMarcel Holtmann __u8 reason; 66266c853ccSGustavo F. Padovan } __packed; 6631da177e4SLinus Torvalds 664a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 665a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 666a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6679b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 66866c853ccSGustavo F. Padovan } __packed; 6691da177e4SLinus Torvalds 670a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 671a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 672a9de9248SMarcel Holtmann bdaddr_t bdaddr; 67366c853ccSGustavo F. Padovan } __packed; 6741da177e4SLinus Torvalds 675a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 676a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 677a9de9248SMarcel Holtmann bdaddr_t bdaddr; 678a9de9248SMarcel Holtmann __u8 pin_len; 679a9de9248SMarcel Holtmann __u8 pin_code[16]; 68066c853ccSGustavo F. Padovan } __packed; 681980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 682980e1a53SJohan Hedberg __u8 status; 683980e1a53SJohan Hedberg bdaddr_t bdaddr; 684980e1a53SJohan Hedberg } __packed; 685a9de9248SMarcel Holtmann 686a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 687a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 688a9de9248SMarcel Holtmann bdaddr_t bdaddr; 68966c853ccSGustavo F. Padovan } __packed; 690980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 691980e1a53SJohan Hedberg __u8 status; 692980e1a53SJohan Hedberg bdaddr_t bdaddr; 693980e1a53SJohan Hedberg } __packed; 694a9de9248SMarcel Holtmann 695a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 696a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 697a9de9248SMarcel Holtmann __le16 handle; 698a9de9248SMarcel Holtmann __le16 pkt_type; 69966c853ccSGustavo F. Padovan } __packed; 700a9de9248SMarcel Holtmann 701a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 702a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 703a9de9248SMarcel Holtmann __le16 handle; 70466c853ccSGustavo F. Padovan } __packed; 705a9de9248SMarcel Holtmann 706a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 707a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 708a9de9248SMarcel Holtmann __le16 handle; 709a9de9248SMarcel Holtmann __u8 encrypt; 71066c853ccSGustavo F. Padovan } __packed; 711a9de9248SMarcel Holtmann 712a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 713a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 714a9de9248SMarcel Holtmann __le16 handle; 71566c853ccSGustavo F. Padovan } __packed; 716a9de9248SMarcel Holtmann 717a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 718a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 719a9de9248SMarcel Holtmann bdaddr_t bdaddr; 720a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 721a9de9248SMarcel Holtmann __u8 pscan_mode; 722a9de9248SMarcel Holtmann __le16 clock_offset; 72366c853ccSGustavo F. Padovan } __packed; 724a9de9248SMarcel Holtmann 725a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 726a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 727a9de9248SMarcel Holtmann bdaddr_t bdaddr; 72866c853ccSGustavo F. Padovan } __packed; 729a9de9248SMarcel Holtmann 730a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 731a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 732a9de9248SMarcel Holtmann __le16 handle; 73366c853ccSGustavo F. Padovan } __packed; 734a9de9248SMarcel Holtmann 735a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 736a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 737a9de9248SMarcel Holtmann __le16 handle; 738a9de9248SMarcel Holtmann __u8 page; 73966c853ccSGustavo F. Padovan } __packed; 740a9de9248SMarcel Holtmann 741a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 742a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 743a9de9248SMarcel Holtmann __le16 handle; 74466c853ccSGustavo F. Padovan } __packed; 745a9de9248SMarcel Holtmann 746df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 747df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 748df935429SMarcel Holtmann __le16 handle; 749df935429SMarcel Holtmann } __packed; 750df935429SMarcel Holtmann 751a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 752a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 753a9de9248SMarcel Holtmann __le16 handle; 754a9de9248SMarcel Holtmann __le32 tx_bandwidth; 755a9de9248SMarcel Holtmann __le32 rx_bandwidth; 756a9de9248SMarcel Holtmann __le16 max_latency; 757a9de9248SMarcel Holtmann __le16 voice_setting; 758a9de9248SMarcel Holtmann __u8 retrans_effort; 759a9de9248SMarcel Holtmann __le16 pkt_type; 76066c853ccSGustavo F. Padovan } __packed; 761a9de9248SMarcel Holtmann 762a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 763a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 764a9de9248SMarcel Holtmann bdaddr_t bdaddr; 765a9de9248SMarcel Holtmann __le32 tx_bandwidth; 766a9de9248SMarcel Holtmann __le32 rx_bandwidth; 767a9de9248SMarcel Holtmann __le16 max_latency; 768a9de9248SMarcel Holtmann __le16 content_format; 769a9de9248SMarcel Holtmann __u8 retrans_effort; 770a9de9248SMarcel Holtmann __le16 pkt_type; 77166c853ccSGustavo F. Padovan } __packed; 772a9de9248SMarcel Holtmann 773a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 774a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 775a9de9248SMarcel Holtmann bdaddr_t bdaddr; 776a9de9248SMarcel Holtmann __u8 reason; 77766c853ccSGustavo F. Padovan } __packed; 778a9de9248SMarcel Holtmann 77917fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 78017fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 78117fa4b9dSJohan Hedberg bdaddr_t bdaddr; 78217fa4b9dSJohan Hedberg __u8 capability; 78317fa4b9dSJohan Hedberg __u8 oob_data; 78417fa4b9dSJohan Hedberg __u8 authentication; 78517fa4b9dSJohan Hedberg } __packed; 78617fa4b9dSJohan Hedberg 787a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 788a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 789a5c29683SJohan Hedberg bdaddr_t bdaddr; 790a5c29683SJohan Hedberg } __packed; 791a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 792a5c29683SJohan Hedberg __u8 status; 793a5c29683SJohan Hedberg bdaddr_t bdaddr; 794a5c29683SJohan Hedberg } __packed; 795a5c29683SJohan Hedberg 796a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 797a5c29683SJohan Hedberg 7989ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 7999ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 8009ad4019aSBrian Gix bdaddr_t bdaddr; 8019ad4019aSBrian Gix __le32 passkey; 8029ad4019aSBrian Gix } __packed; 8039ad4019aSBrian Gix 8049ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 8059ad4019aSBrian Gix 8062763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 8072763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 8082763eda6SSzymon Janc bdaddr_t bdaddr; 8092763eda6SSzymon Janc __u8 hash[16]; 81038da1703SJohan Hedberg __u8 rand[16]; 8112763eda6SSzymon Janc } __packed; 8122763eda6SSzymon Janc 8132763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 8142763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 8152763eda6SSzymon Janc bdaddr_t bdaddr; 8162763eda6SSzymon Janc } __packed; 8172763eda6SSzymon Janc 81803b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 81903b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 82003b555e1SJohan Hedberg bdaddr_t bdaddr; 82103b555e1SJohan Hedberg __u8 reason; 82203b555e1SJohan Hedberg } __packed; 82303b555e1SJohan Hedberg 824523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 825523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 826523e93cdSAndrei Emeltchenko __u8 phy_handle; 827523e93cdSAndrei Emeltchenko __u8 key_len; 828523e93cdSAndrei Emeltchenko __u8 key_type; 829523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 830523e93cdSAndrei Emeltchenko } __packed; 831523e93cdSAndrei Emeltchenko 832523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 833523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 834523e93cdSAndrei Emeltchenko __u8 phy_handle; 835523e93cdSAndrei Emeltchenko __u8 key_len; 836523e93cdSAndrei Emeltchenko __u8 key_type; 837523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 838523e93cdSAndrei Emeltchenko } __packed; 839523e93cdSAndrei Emeltchenko 840523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 841523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 842523e93cdSAndrei Emeltchenko __u8 phy_handle; 843523e93cdSAndrei Emeltchenko __u8 reason; 844b078b564SAndrei Emeltchenko } __packed; 845b078b564SAndrei Emeltchenko 846b078b564SAndrei Emeltchenko struct ext_flow_spec { 847b078b564SAndrei Emeltchenko __u8 id; 848b078b564SAndrei Emeltchenko __u8 stype; 849b078b564SAndrei Emeltchenko __le16 msdu; 850b078b564SAndrei Emeltchenko __le32 sdu_itime; 851b078b564SAndrei Emeltchenko __le32 acc_lat; 852b078b564SAndrei Emeltchenko __le32 flush_to; 853b078b564SAndrei Emeltchenko } __packed; 854b078b564SAndrei Emeltchenko 855b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 856b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 857b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 858b078b564SAndrei Emeltchenko __u8 phy_handle; 859b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 860b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 861b078b564SAndrei Emeltchenko } __packed; 862b078b564SAndrei Emeltchenko 863b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 864b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 865b078b564SAndrei Emeltchenko __le16 log_handle; 866b078b564SAndrei Emeltchenko } __packed; 867b078b564SAndrei Emeltchenko 868b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 869b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 870b078b564SAndrei Emeltchenko __u8 phy_handle; 871b078b564SAndrei Emeltchenko __u8 flow_spec_id; 872b078b564SAndrei Emeltchenko } __packed; 873b078b564SAndrei Emeltchenko 874b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 875b078b564SAndrei Emeltchenko __u8 status; 876b078b564SAndrei Emeltchenko __u8 phy_handle; 877b078b564SAndrei Emeltchenko __u8 flow_spec_id; 878523e93cdSAndrei Emeltchenko } __packed; 879523e93cdSAndrei Emeltchenko 8808c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 8818c9a041bSDoHyun Pyun struct hci_cp_set_csb { 8828c9a041bSDoHyun Pyun __u8 enable; 8838c9a041bSDoHyun Pyun __u8 lt_addr; 8848c9a041bSDoHyun Pyun __u8 lpo_allowed; 8858c9a041bSDoHyun Pyun __le16 packet_type; 8868c9a041bSDoHyun Pyun __le16 interval_min; 8878c9a041bSDoHyun Pyun __le16 interval_max; 8888c9a041bSDoHyun Pyun __le16 csb_sv_tout; 8898c9a041bSDoHyun Pyun } __packed; 8908c9a041bSDoHyun Pyun struct hci_rp_set_csb { 8918c9a041bSDoHyun Pyun __u8 status; 8928c9a041bSDoHyun Pyun __u8 lt_addr; 8938c9a041bSDoHyun Pyun __le16 interval; 8948c9a041bSDoHyun Pyun } __packed; 8958c9a041bSDoHyun Pyun 896cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 897cefded98SDoHyun Pyun 898e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 899e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 900e2f99131SMarcel Holtmann bdaddr_t bdaddr; 901e2f99131SMarcel Holtmann __u8 hash192[16]; 90238da1703SJohan Hedberg __u8 rand192[16]; 903e2f99131SMarcel Holtmann __u8 hash256[16]; 90438da1703SJohan Hedberg __u8 rand256[16]; 905e2f99131SMarcel Holtmann } __packed; 906e2f99131SMarcel Holtmann 907a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 908a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 909a9de9248SMarcel Holtmann __le16 handle; 910a9de9248SMarcel Holtmann __le16 max_interval; 911a9de9248SMarcel Holtmann __le16 min_interval; 912a9de9248SMarcel Holtmann __le16 attempt; 913a9de9248SMarcel Holtmann __le16 timeout; 91466c853ccSGustavo F. Padovan } __packed; 915a9de9248SMarcel Holtmann 916a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 917a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 918a9de9248SMarcel Holtmann __le16 handle; 91966c853ccSGustavo F. Padovan } __packed; 920a9de9248SMarcel Holtmann 921a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 922a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 923a9de9248SMarcel Holtmann __le16 handle; 92466c853ccSGustavo F. Padovan } __packed; 925a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 926a9de9248SMarcel Holtmann __u8 status; 927a9de9248SMarcel Holtmann __le16 handle; 928a9de9248SMarcel Holtmann __u8 role; 92966c853ccSGustavo F. Padovan } __packed; 930a9de9248SMarcel Holtmann 931a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 932a9de9248SMarcel Holtmann struct hci_cp_switch_role { 933a9de9248SMarcel Holtmann bdaddr_t bdaddr; 934a9de9248SMarcel Holtmann __u8 role; 93566c853ccSGustavo F. Padovan } __packed; 936a9de9248SMarcel Holtmann 937a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 938a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 939a9de9248SMarcel Holtmann __le16 handle; 94066c853ccSGustavo F. Padovan } __packed; 941a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 942a9de9248SMarcel Holtmann __u8 status; 943a9de9248SMarcel Holtmann __le16 handle; 944a9de9248SMarcel Holtmann __le16 policy; 94566c853ccSGustavo F. Padovan } __packed; 946a9de9248SMarcel Holtmann 947a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 948a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 949a9de9248SMarcel Holtmann __le16 handle; 950a9de9248SMarcel Holtmann __le16 policy; 95166c853ccSGustavo F. Padovan } __packed; 952a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 953a9de9248SMarcel Holtmann __u8 status; 954a9de9248SMarcel Holtmann __le16 handle; 95566c853ccSGustavo F. Padovan } __packed; 956a9de9248SMarcel Holtmann 957e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 958e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 959e4e8e37cSMarcel Holtmann __u8 status; 960e4e8e37cSMarcel Holtmann __le16 policy; 96166c853ccSGustavo F. Padovan } __packed; 962e4e8e37cSMarcel Holtmann 963e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 964e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 965e4e8e37cSMarcel Holtmann __le16 policy; 96666c853ccSGustavo F. Padovan } __packed; 967e4e8e37cSMarcel Holtmann 968a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 969a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 970a9de9248SMarcel Holtmann __le16 handle; 971a9de9248SMarcel Holtmann __le16 max_latency; 972a9de9248SMarcel Holtmann __le16 min_remote_timeout; 973a9de9248SMarcel Holtmann __le16 min_local_timeout; 97466c853ccSGustavo F. Padovan } __packed; 975a9de9248SMarcel Holtmann 976a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 977a9de9248SMarcel Holtmann 978a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 979a9de9248SMarcel Holtmann 980a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 9814f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE 9 9824f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter { 9831da177e4SLinus Torvalds __u8 flt_type; 9841da177e4SLinus Torvalds __u8 cond_type; 9854f40afc6SAbhishek Pandit-Subedi struct { 9864f40afc6SAbhishek Pandit-Subedi bdaddr_t bdaddr; 9874f40afc6SAbhishek Pandit-Subedi __u8 auto_accept; 9884f40afc6SAbhishek Pandit-Subedi } __packed addr_conn_flt; 98966c853ccSGustavo F. Padovan } __packed; 9901da177e4SLinus Torvalds 9911da177e4SLinus Torvalds /* Filter types */ 9921da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 9931da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 9941da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 9951da177e4SLinus Torvalds 9961da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 9971da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 9981da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 9991da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 10001da177e4SLinus Torvalds 10011da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 10021da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 10031da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 10044f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03 10051da177e4SLinus Torvalds 1006cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1007cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 1008cb962780SMarcel Holtmann bdaddr_t bdaddr; 1009cb962780SMarcel Holtmann __u8 read_all; 1010cb962780SMarcel Holtmann } __packed; 1011cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 1012cb962780SMarcel Holtmann __u8 status; 1013cb962780SMarcel Holtmann __u8 max_keys; 1014cb962780SMarcel Holtmann __u8 num_keys; 1015cb962780SMarcel Holtmann } __packed; 1016cb962780SMarcel Holtmann 1017b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1018b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 1019b0916ea0SJohan Hedberg bdaddr_t bdaddr; 1020b0916ea0SJohan Hedberg __u8 delete_all; 1021b0916ea0SJohan Hedberg } __packed; 1022039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 1023039d4e41SMarcel Holtmann __u8 status; 1024039d4e41SMarcel Holtmann __u8 num_keys; 1025039d4e41SMarcel Holtmann } __packed; 1026b0916ea0SJohan Hedberg 10271f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 10281f6c6378SJohan Hedberg 1029a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1030a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 10311f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 103266c853ccSGustavo F. Padovan } __packed; 1033a9de9248SMarcel Holtmann 1034a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 1035a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 1036a9de9248SMarcel Holtmann __u8 status; 10371f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 103866c853ccSGustavo F. Padovan } __packed; 1039a9de9248SMarcel Holtmann 1040a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 1041a9de9248SMarcel Holtmann 1042a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 1043a9de9248SMarcel Holtmann 1044a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 1045a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 1046a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 1047a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 1048a9de9248SMarcel Holtmann 1049a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 1050a9de9248SMarcel Holtmann 1051a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 1052a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 1053a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 1054a9de9248SMarcel Holtmann 1055a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 1056a9de9248SMarcel Holtmann 1057a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 1058a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 1059a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 1060a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 1061a9de9248SMarcel Holtmann 1062a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 1063a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 10641da177e4SLinus Torvalds __u8 status; 10651da177e4SLinus Torvalds __u8 dev_class[3]; 106666c853ccSGustavo F. Padovan } __packed; 10671da177e4SLinus Torvalds 1068a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1069a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 10701da177e4SLinus Torvalds __u8 dev_class[3]; 107166c853ccSGustavo F. Padovan } __packed; 10721da177e4SLinus Torvalds 1073a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 10741da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 10751da177e4SLinus Torvalds __u8 status; 10761ebb9252SMarcel Holtmann __le16 voice_setting; 107766c853ccSGustavo F. Padovan } __packed; 10781da177e4SLinus Torvalds 1079a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 10801da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 10811ebb9252SMarcel Holtmann __le16 voice_setting; 108266c853ccSGustavo F. Padovan } __packed; 10831da177e4SLinus Torvalds 1084a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 10851da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 10861ebb9252SMarcel Holtmann __le16 acl_mtu; 10871da177e4SLinus Torvalds __u8 sco_mtu; 10881ebb9252SMarcel Holtmann __le16 acl_max_pkt; 10891ebb9252SMarcel Holtmann __le16 sco_max_pkt; 109066c853ccSGustavo F. Padovan } __packed; 10911da177e4SLinus Torvalds 1092b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1093b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1094b4cb9fb2SMarcel Holtmann __u8 status; 1095b4cb9fb2SMarcel Holtmann __u8 num_iac; 1096b4cb9fb2SMarcel Holtmann } __packed; 1097b4cb9fb2SMarcel Holtmann 10984b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 10994b836f39SMarcel Holtmann 11003d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 11013d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 11023d505312SMarcel Holtmann __u8 num_iac; 11033d505312SMarcel Holtmann __u8 iac_lap[6]; 11043d505312SMarcel Holtmann } __packed; 11053d505312SMarcel Holtmann 1106d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1107d5859e22SJohan Hedberg 110880a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 110980a1e1dbSJohan Hedberg 111080a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 111180a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1112816a11d5SJohan Hedberg __u8 fec; 1113816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 111480a1e1dbSJohan Hedberg } __packed; 111580a1e1dbSJohan Hedberg 1116333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1117333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1118333140b5SMarcel Holtmann __u8 status; 1119333140b5SMarcel Holtmann __u8 mode; 112066c853ccSGustavo F. Padovan } __packed; 1121333140b5SMarcel Holtmann 1122333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1123333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1124333140b5SMarcel Holtmann __u8 mode; 112566c853ccSGustavo F. Padovan } __packed; 1126333140b5SMarcel Holtmann 1127c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1128c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1129c35938b2SSzymon Janc __u8 status; 1130c35938b2SSzymon Janc __u8 hash[16]; 113138da1703SJohan Hedberg __u8 rand[16]; 1132c35938b2SSzymon Janc } __packed; 1133c35938b2SSzymon Janc 1134d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 113591c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 113691c4e9b1SMarcel Holtmann __u8 status; 113791c4e9b1SMarcel Holtmann __s8 tx_power; 113891c4e9b1SMarcel Holtmann } __packed; 1139d5859e22SJohan Hedberg 114000bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a 114100bce3fbSAlain Michaud #define ERR_DATA_REPORTING_DISABLED 0x00 114200bce3fbSAlain Michaud #define ERR_DATA_REPORTING_ENABLED 0x01 114300bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting { 114400bce3fbSAlain Michaud __u8 status; 114500bce3fbSAlain Michaud __u8 err_data_reporting; 114600bce3fbSAlain Michaud } __packed; 114700bce3fbSAlain Michaud 114800bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b 114900bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting { 115000bce3fbSAlain Michaud __u8 err_data_reporting; 115100bce3fbSAlain Michaud } __packed; 115200bce3fbSAlain Michaud 1153d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1154d62e6d67SJohan Hedberg 11557528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 11567528ca1cSMarcel Holtmann 11571e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 11581e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 11591e89cffbSAndrei Emeltchenko __u8 status; 11601e89cffbSAndrei Emeltchenko __u8 mode; 11611e89cffbSAndrei Emeltchenko } __packed; 11621e89cffbSAndrei Emeltchenko 1163f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1164f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1165f9b49306SAndre Guedes __u8 le; 1166f9b49306SAndre Guedes __u8 simul; 1167f9b49306SAndre Guedes } __packed; 1168f9b49306SAndre Guedes 1169d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1170d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1171d0bf75a5SDoHyun Pyun __u8 lt_addr; 1172d0bf75a5SDoHyun Pyun } __packed; 1173d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1174d0bf75a5SDoHyun Pyun __u8 status; 1175d0bf75a5SDoHyun Pyun __u8 lt_addr; 1176d0bf75a5SDoHyun Pyun } __packed; 1177d0bf75a5SDoHyun Pyun 11786a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 11796a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 11806a20eaf4SDoHyun Pyun __u8 lt_addr; 11816a20eaf4SDoHyun Pyun } __packed; 11826a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 11836a20eaf4SDoHyun Pyun __u8 status; 11846a20eaf4SDoHyun Pyun __u8 lt_addr; 11856a20eaf4SDoHyun Pyun } __packed; 11866a20eaf4SDoHyun Pyun 11877d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 11887d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 11897d1dab49SDoHyun Pyun __u8 lt_addr; 11907d1dab49SDoHyun Pyun __u8 fragment; 11917d1dab49SDoHyun Pyun __u8 data_length; 11927d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 11937d1dab49SDoHyun Pyun } __packed; 11947d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 11957d1dab49SDoHyun Pyun __u8 status; 11967d1dab49SDoHyun Pyun __u8 lt_addr; 11977d1dab49SDoHyun Pyun } __packed; 11987d1dab49SDoHyun Pyun 11995d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 12005d4e7e8dSJohan Hedberg 1201a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1202a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1203a9b07a64SDoHyun Pyun __le16 interval_min; 1204a9b07a64SDoHyun Pyun __le16 interval_max; 1205a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1206a9b07a64SDoHyun Pyun __u8 service_data; 1207a9b07a64SDoHyun Pyun } __packed; 1208a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1209a9b07a64SDoHyun Pyun __u8 status; 1210a9b07a64SDoHyun Pyun __le16 sync_train_int; 1211a9b07a64SDoHyun Pyun } __packed; 1212a9b07a64SDoHyun Pyun 1213eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1214eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1215eb4b95c6SMarcel Holtmann __u8 status; 1216eb4b95c6SMarcel Holtmann __u8 support; 1217eb4b95c6SMarcel Holtmann } __packed; 1218eb4b95c6SMarcel Holtmann 1219eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1220eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1221eb4b95c6SMarcel Holtmann __u8 support; 1222eb4b95c6SMarcel Holtmann } __packed; 1223eb4b95c6SMarcel Holtmann 1224302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1225302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1226302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1227302975cbSSpoorthi Ravishankar Koppad } __packed; 1228302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1229302975cbSSpoorthi Ravishankar Koppad __u8 status; 1230302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1231302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1232302975cbSSpoorthi Ravishankar Koppad } __packed; 1233302975cbSSpoorthi Ravishankar Koppad 1234302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1235302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1236302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1237302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1238302975cbSSpoorthi Ravishankar Koppad } __packed; 1239302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1240302975cbSSpoorthi Ravishankar Koppad __u8 status; 1241302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1242302975cbSSpoorthi Ravishankar Koppad } __packed; 1243302975cbSSpoorthi Ravishankar Koppad 1244e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1245e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1246e2f99131SMarcel Holtmann __u8 status; 1247e2f99131SMarcel Holtmann __u8 hash192[16]; 124838da1703SJohan Hedberg __u8 rand192[16]; 1249e2f99131SMarcel Holtmann __u8 hash256[16]; 125038da1703SJohan Hedberg __u8 rand256[16]; 1251e2f99131SMarcel Holtmann } __packed; 1252e2f99131SMarcel Holtmann 1253a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1254a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 12551da177e4SLinus Torvalds __u8 status; 1256a9de9248SMarcel Holtmann __u8 hci_ver; 1257a9de9248SMarcel Holtmann __le16 hci_rev; 1258a9de9248SMarcel Holtmann __u8 lmp_ver; 1259a9de9248SMarcel Holtmann __le16 manufacturer; 1260a9de9248SMarcel Holtmann __le16 lmp_subver; 126166c853ccSGustavo F. Padovan } __packed; 12621da177e4SLinus Torvalds 1263a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1264a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 12651da177e4SLinus Torvalds __u8 status; 1266a9de9248SMarcel Holtmann __u8 commands[64]; 126766c853ccSGustavo F. Padovan } __packed; 12681da177e4SLinus Torvalds 1269a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1270a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1271a9de9248SMarcel Holtmann __u8 status; 1272a9de9248SMarcel Holtmann __u8 features[8]; 127366c853ccSGustavo F. Padovan } __packed; 1274a9de9248SMarcel Holtmann 1275a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1276971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1277971e3a4bSAndre Guedes __u8 page; 1278971e3a4bSAndre Guedes } __packed; 1279a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1280a9de9248SMarcel Holtmann __u8 status; 1281a9de9248SMarcel Holtmann __u8 page; 1282a9de9248SMarcel Holtmann __u8 max_page; 1283a9de9248SMarcel Holtmann __u8 features[8]; 128466c853ccSGustavo F. Padovan } __packed; 1285a9de9248SMarcel Holtmann 1286a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1287a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1288a9de9248SMarcel Holtmann __u8 status; 1289a9de9248SMarcel Holtmann __le16 acl_mtu; 1290a9de9248SMarcel Holtmann __u8 sco_mtu; 1291a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1292a9de9248SMarcel Holtmann __le16 sco_max_pkt; 129366c853ccSGustavo F. Padovan } __packed; 1294a9de9248SMarcel Holtmann 1295a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1296a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1297a9de9248SMarcel Holtmann __u8 status; 12981da177e4SLinus Torvalds bdaddr_t bdaddr; 129966c853ccSGustavo F. Padovan } __packed; 13001da177e4SLinus Torvalds 1301350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1302350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1303350ee4cfSAndrei Emeltchenko __u8 status; 1304350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1305350ee4cfSAndrei Emeltchenko __le16 block_len; 1306350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1307350ee4cfSAndrei Emeltchenko } __packed; 1308350ee4cfSAndrei Emeltchenko 1309109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1310109e3191SMarcel Holtmann 1311a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c 1312a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts { 1313a4790360SMarcel Holtmann __u8 status; 1314a4790360SMarcel Holtmann __u8 pairing_opts; 1315a4790360SMarcel Holtmann __u8 max_key_size; 1316a4790360SMarcel Holtmann } __packed; 1317a4790360SMarcel Holtmann 1318f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1319f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1320f332ec66SJohan Hedberg __u8 status; 1321f332ec66SJohan Hedberg __le16 interval; 1322f332ec66SJohan Hedberg __le16 window; 1323f332ec66SJohan Hedberg } __packed; 1324f332ec66SJohan Hedberg 1325f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1326f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1327f6422ec6SAntti Julku __le16 interval; 1328f6422ec6SAntti Julku __le16 window; 1329f6422ec6SAntti Julku } __packed; 1330f6422ec6SAntti Julku 13315a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 13325a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 13335a134faeSAndrzej Kaczmarek __le16 handle; 13345a134faeSAndrzej Kaczmarek __u8 type; 13355a134faeSAndrzej Kaczmarek } __packed; 13365a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 13375a134faeSAndrzej Kaczmarek __u8 status; 13385a134faeSAndrzej Kaczmarek __le16 handle; 13395a134faeSAndrzej Kaczmarek __s8 tx_power; 13405a134faeSAndrzej Kaczmarek } __packed; 13415a134faeSAndrzej Kaczmarek 1342f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1343f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1344f332ec66SJohan Hedberg __u8 status; 1345f332ec66SJohan Hedberg __u8 type; 1346f332ec66SJohan Hedberg } __packed; 1347f332ec66SJohan Hedberg 1348f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1349f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1350f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1351f6422ec6SAntti Julku 13525ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 13535ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 13545ae76a94SAndrzej Kaczmarek __le16 handle; 13555ae76a94SAndrzej Kaczmarek } __packed; 13565ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 13575ae76a94SAndrzej Kaczmarek __u8 status; 13585ae76a94SAndrzej Kaczmarek __le16 handle; 13595ae76a94SAndrzej Kaczmarek __s8 rssi; 13605ae76a94SAndrzej Kaczmarek } __packed; 13615ae76a94SAndrzej Kaczmarek 136233f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 136333f35721SJohan Hedberg struct hci_cp_read_clock { 136433f35721SJohan Hedberg __le16 handle; 136533f35721SJohan Hedberg __u8 which; 136633f35721SJohan Hedberg } __packed; 136733f35721SJohan Hedberg struct hci_rp_read_clock { 136833f35721SJohan Hedberg __u8 status; 136933f35721SJohan Hedberg __le16 handle; 137033f35721SJohan Hedberg __le32 clock; 137133f35721SJohan Hedberg __le16 accuracy; 137233f35721SJohan Hedberg } __packed; 137333f35721SJohan Hedberg 1374821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1375821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1376821f3766SJohan Hedberg __le16 handle; 1377821f3766SJohan Hedberg } __packed; 1378821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1379821f3766SJohan Hedberg __u8 status; 1380821f3766SJohan Hedberg __le16 handle; 1381821f3766SJohan Hedberg __u8 key_size; 1382821f3766SJohan Hedberg } __packed; 1383821f3766SJohan Hedberg 1384928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1385928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1386928abaa7SAndrei Emeltchenko __u8 status; 1387928abaa7SAndrei Emeltchenko __u8 amp_status; 1388928abaa7SAndrei Emeltchenko __le32 total_bw; 1389928abaa7SAndrei Emeltchenko __le32 max_bw; 1390928abaa7SAndrei Emeltchenko __le32 min_latency; 1391928abaa7SAndrei Emeltchenko __le32 max_pdu; 1392928abaa7SAndrei Emeltchenko __u8 amp_type; 1393928abaa7SAndrei Emeltchenko __le16 pal_cap; 1394928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1395928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1396928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1397928abaa7SAndrei Emeltchenko } __packed; 1398928abaa7SAndrei Emeltchenko 1399523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1400523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1401523e93cdSAndrei Emeltchenko __u8 phy_handle; 1402523e93cdSAndrei Emeltchenko __le16 len_so_far; 1403523e93cdSAndrei Emeltchenko __le16 max_len; 1404523e93cdSAndrei Emeltchenko } __packed; 1405523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1406523e93cdSAndrei Emeltchenko __u8 status; 1407523e93cdSAndrei Emeltchenko __u8 phy_handle; 1408523e93cdSAndrei Emeltchenko __le16 rem_len; 1409a7e45454SGustavo A. R. Silva __u8 frag[]; 1410523e93cdSAndrei Emeltchenko } __packed; 1411523e93cdSAndrei Emeltchenko 1412523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1413523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1414523e93cdSAndrei Emeltchenko __u8 phy_handle; 1415523e93cdSAndrei Emeltchenko __le16 len_so_far; 1416523e93cdSAndrei Emeltchenko __le16 rem_len; 1417a7e45454SGustavo A. R. Silva __u8 frag[]; 1418523e93cdSAndrei Emeltchenko } __packed; 1419523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1420523e93cdSAndrei Emeltchenko __u8 status; 1421523e93cdSAndrei Emeltchenko __u8 phy_handle; 1422523e93cdSAndrei Emeltchenko } __packed; 1423523e93cdSAndrei Emeltchenko 1424f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1425f4fe73edSMarcel Holtmann 14264b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 14274b4148e9SMarcel Holtmann 142806f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 142906f5b778SMarcel Holtmann 143063185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 143163185f64SVille Tervo struct hci_cp_le_set_event_mask { 143263185f64SVille Tervo __u8 mask[8]; 143363185f64SVille Tervo } __packed; 143463185f64SVille Tervo 143563185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 143663185f64SVille Tervo struct hci_rp_le_read_buffer_size { 143763185f64SVille Tervo __u8 status; 143863185f64SVille Tervo __le16 le_mtu; 143963185f64SVille Tervo __u8 le_max_pkt; 144063185f64SVille Tervo } __packed; 144163185f64SVille Tervo 144260e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 144360e77321SJohan Hedberg struct hci_rp_le_read_local_features { 144460e77321SJohan Hedberg __u8 status; 144560e77321SJohan Hedberg __u8 features[8]; 144660e77321SJohan Hedberg } __packed; 144760e77321SJohan Hedberg 1448d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1449d13eafceSMarcel Holtmann 14501e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 14511e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 14521e191893SMarcel Holtmann __le16 min_interval; 14531e191893SMarcel Holtmann __le16 max_interval; 14541e191893SMarcel Holtmann __u8 type; 14551e191893SMarcel Holtmann __u8 own_address_type; 14561e191893SMarcel Holtmann __u8 direct_addr_type; 14571e191893SMarcel Holtmann bdaddr_t direct_addr; 14581e191893SMarcel Holtmann __u8 channel_map; 14591e191893SMarcel Holtmann __u8 filter_policy; 14601e191893SMarcel Holtmann } __packed; 14611e191893SMarcel Holtmann 14628fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 14638fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 14648fa19098SJohan Hedberg __u8 status; 14658fa19098SJohan Hedberg __s8 tx_power; 14668fa19098SJohan Hedberg } __packed; 14678fa19098SJohan Hedberg 14683f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 14693f0f524bSJohan Hedberg 14703f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 14713f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 14723f0f524bSJohan Hedberg __u8 length; 14733f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 14743f0f524bSJohan Hedberg } __packed; 14753f0f524bSJohan Hedberg 1476f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1477f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1478f14d8f64SMarcel Holtmann __u8 length; 1479f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1480f14d8f64SMarcel Holtmann } __packed; 1481f14d8f64SMarcel Holtmann 1482c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1483c1d5dc4aSJohan Hedberg 14845df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 14855df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 14865df480b5SAndre Guedes 148707f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 148807f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 148907f7fa5dSAndre Guedes __u8 type; 149007f7fa5dSAndre Guedes __le16 interval; 149107f7fa5dSAndre Guedes __le16 window; 149207f7fa5dSAndre Guedes __u8 own_address_type; 149307f7fa5dSAndre Guedes __u8 filter_policy; 149407f7fa5dSAndre Guedes } __packed; 149507f7fa5dSAndre Guedes 149676a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 149776a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1498525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1499525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 150068a8aea4SAndrei Emeltchenko 1501eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1502eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1503eb9d91f5SAndre Guedes __u8 enable; 1504eb9d91f5SAndre Guedes __u8 filter_dup; 1505eb9d91f5SAndre Guedes } __packed; 1506eb9d91f5SAndre Guedes 1507a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1508a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1509a7139eddSJohan Hedberg 151063185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 151163185f64SVille Tervo struct hci_cp_le_create_conn { 151263185f64SVille Tervo __le16 scan_interval; 151363185f64SVille Tervo __le16 scan_window; 151463185f64SVille Tervo __u8 filter_policy; 151563185f64SVille Tervo __u8 peer_addr_type; 151663185f64SVille Tervo bdaddr_t peer_addr; 151763185f64SVille Tervo __u8 own_address_type; 151863185f64SVille Tervo __le16 conn_interval_min; 151963185f64SVille Tervo __le16 conn_interval_max; 152063185f64SVille Tervo __le16 conn_latency; 152163185f64SVille Tervo __le16 supervision_timeout; 152263185f64SVille Tervo __le16 min_ce_len; 152363185f64SVille Tervo __le16 max_ce_len; 152463185f64SVille Tervo } __packed; 152563185f64SVille Tervo 152663185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 152763185f64SVille Tervo 1528cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1529cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1530cf1d081fSJohan Hedberg __u8 status; 1531cf1d081fSJohan Hedberg __u8 size; 1532cf1d081fSJohan Hedberg } __packed; 1533cf1d081fSJohan Hedberg 1534d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1535d9a7b0a5SMarcel Holtmann 1536d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1537d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1538d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1539d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1540d9a7b0a5SMarcel Holtmann } __packed; 1541d9a7b0a5SMarcel Holtmann 1542d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1543d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1544d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1545d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1546d9a7b0a5SMarcel Holtmann } __packed; 1547d9a7b0a5SMarcel Holtmann 15482ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 15492ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 15502ce603ebSClaudio Takahasi __le16 handle; 15512ce603ebSClaudio Takahasi __le16 conn_interval_min; 15522ce603ebSClaudio Takahasi __le16 conn_interval_max; 15532ce603ebSClaudio Takahasi __le16 conn_latency; 15542ce603ebSClaudio Takahasi __le16 supervision_timeout; 15552ce603ebSClaudio Takahasi __le16 min_ce_len; 15562ce603ebSClaudio Takahasi __le16 max_ce_len; 15572ce603ebSClaudio Takahasi } __packed; 15582ce603ebSClaudio Takahasi 15590fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 15600fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 15610fe29fd1SMarcel Holtmann __le16 handle; 15620fe29fd1SMarcel Holtmann } __packed; 15630fe29fd1SMarcel Holtmann 1564a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1565a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1566a7a595f6SVinicius Costa Gomes __le16 handle; 1567fe39c7b2SMarcel Holtmann __le64 rand; 1568a7a595f6SVinicius Costa Gomes __le16 ediv; 1569a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1570a7a595f6SVinicius Costa Gomes } __packed; 1571a7a595f6SVinicius Costa Gomes 1572a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1573a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1574a7a595f6SVinicius Costa Gomes __le16 handle; 1575a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1576a7a595f6SVinicius Costa Gomes } __packed; 1577a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1578a7a595f6SVinicius Costa Gomes __u8 status; 1579a7a595f6SVinicius Costa Gomes __le16 handle; 1580a7a595f6SVinicius Costa Gomes } __packed; 1581a7a595f6SVinicius Costa Gomes 1582a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1583a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1584a7a595f6SVinicius Costa Gomes __le16 handle; 1585a7a595f6SVinicius Costa Gomes } __packed; 1586a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1587a7a595f6SVinicius Costa Gomes __u8 status; 1588a7a595f6SVinicius Costa Gomes __le16 handle; 1589a7a595f6SVinicius Costa Gomes } __packed; 1590a7a595f6SVinicius Costa Gomes 15919b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 15929b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 15939b008c04SJohan Hedberg __u8 status; 15949b008c04SJohan Hedberg __u8 le_states[8]; 15959b008c04SJohan Hedberg } __packed; 15969b008c04SJohan Hedberg 15978e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 15988e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 15998e75b46aSAndre Guedes __le16 handle; 16008e75b46aSAndre Guedes __le16 interval_min; 16018e75b46aSAndre Guedes __le16 interval_max; 16028e75b46aSAndre Guedes __le16 latency; 16038e75b46aSAndre Guedes __le16 timeout; 16048e75b46aSAndre Guedes __le16 min_ce_len; 16058e75b46aSAndre Guedes __le16 max_ce_len; 16068e75b46aSAndre Guedes } __packed; 16078e75b46aSAndre Guedes 16088e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 16098e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 16108e75b46aSAndre Guedes __le16 handle; 16118e75b46aSAndre Guedes __u8 reason; 16128e75b46aSAndre Guedes } __packed; 16138e75b46aSAndre Guedes 161494a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 161594a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 161694a3bd02SMarcel Holtmann __le16 handle; 161794a3bd02SMarcel Holtmann __le16 tx_len; 161894a3bd02SMarcel Holtmann __le16 tx_time; 161994a3bd02SMarcel Holtmann } __packed; 162094a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 162194a3bd02SMarcel Holtmann __u8 status; 162294a3bd02SMarcel Holtmann __le16 handle; 162394a3bd02SMarcel Holtmann } __packed; 162494a3bd02SMarcel Holtmann 162594a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 162694a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 162794a3bd02SMarcel Holtmann __u8 status; 162894a3bd02SMarcel Holtmann __le16 tx_len; 162994a3bd02SMarcel Holtmann __le16 tx_time; 163094a3bd02SMarcel Holtmann } __packed; 163194a3bd02SMarcel Holtmann 163294a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 163394a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 163494a3bd02SMarcel Holtmann __le16 tx_len; 163594a3bd02SMarcel Holtmann __le16 tx_time; 163694a3bd02SMarcel Holtmann } __packed; 163794a3bd02SMarcel Holtmann 1638b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1639b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1640b950aa88SAnkit Navik __u8 bdaddr_type; 1641b950aa88SAnkit Navik bdaddr_t bdaddr; 1642b950aa88SAnkit Navik __u8 peer_irk[16]; 1643b950aa88SAnkit Navik __u8 local_irk[16]; 1644b950aa88SAnkit Navik } __packed; 1645b950aa88SAnkit Navik 1646b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1647b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1648b950aa88SAnkit Navik __u8 bdaddr_type; 1649b950aa88SAnkit Navik bdaddr_t bdaddr; 1650b950aa88SAnkit Navik } __packed; 1651b950aa88SAnkit Navik 1652545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1653545f2596SAnkit Navik 1654cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1655cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1656cfdb0c2dSAnkit Navik __u8 status; 1657cfdb0c2dSAnkit Navik __u8 size; 1658cfdb0c2dSAnkit Navik } __packed; 1659cfdb0c2dSAnkit Navik 1660aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1661aa12af77SAnkit Navik 1662b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e 1663b2cc2339SSathish Narasimman 166494a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 166594a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 166694a3bd02SMarcel Holtmann __u8 status; 166794a3bd02SMarcel Holtmann __le16 tx_len; 166894a3bd02SMarcel Holtmann __le16 tx_time; 166994a3bd02SMarcel Holtmann __le16 rx_len; 167094a3bd02SMarcel Holtmann __le16 rx_time; 167194a3bd02SMarcel Holtmann } __packed; 167294a3bd02SMarcel Holtmann 1673de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1674de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1675de2ba303SMarcel Holtmann __u8 all_phys; 1676de2ba303SMarcel Holtmann __u8 tx_phys; 1677de2ba303SMarcel Holtmann __u8 rx_phys; 1678de2ba303SMarcel Holtmann } __packed; 1679de2ba303SMarcel Holtmann 16806decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 16816decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 16826decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 16836decb5b4SJaganath Kanakkassery 1684a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1685a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1686a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1687a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1688a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1689a7e45454SGustavo A. R. Silva __u8 data[]; 1690a2344b9eSJaganath Kanakkassery } __packed; 1691a2344b9eSJaganath Kanakkassery 1692a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 169345bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 169445bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1695a2344b9eSJaganath Kanakkassery 1696a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1697a2344b9eSJaganath Kanakkassery __u8 type; 1698a2344b9eSJaganath Kanakkassery __le16 interval; 1699a2344b9eSJaganath Kanakkassery __le16 window; 1700a2344b9eSJaganath Kanakkassery } __packed; 1701a2344b9eSJaganath Kanakkassery 1702a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1703a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1704a2344b9eSJaganath Kanakkassery __u8 enable; 1705a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1706a2344b9eSJaganath Kanakkassery __le16 duration; 1707a2344b9eSJaganath Kanakkassery __le16 period; 1708a2344b9eSJaganath Kanakkassery } __packed; 1709a2344b9eSJaganath Kanakkassery 17104d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 17114d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 17124d94f95dSJaganath Kanakkassery __u8 filter_policy; 17134d94f95dSJaganath Kanakkassery __u8 own_addr_type; 17144d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 17154d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 17164d94f95dSJaganath Kanakkassery __u8 phys; 1717a7e45454SGustavo A. R. Silva __u8 data[]; 17184d94f95dSJaganath Kanakkassery } __packed; 17194d94f95dSJaganath Kanakkassery 17204d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 17214d94f95dSJaganath Kanakkassery __le16 scan_interval; 17224d94f95dSJaganath Kanakkassery __le16 scan_window; 17234d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 17244d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 17254d94f95dSJaganath Kanakkassery __le16 conn_latency; 17264d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 17274d94f95dSJaganath Kanakkassery __le16 min_ce_len; 17284d94f95dSJaganath Kanakkassery __le16 max_ce_len; 17294d94f95dSJaganath Kanakkassery } __packed; 17304d94f95dSJaganath Kanakkassery 17316b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 17326b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 17336b49bcb4SJaganath Kanakkassery __u8 status; 17346b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 17356b49bcb4SJaganath Kanakkassery } __packed; 17366b49bcb4SJaganath Kanakkassery 1737de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1738de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1739de181e88SJaganath Kanakkassery __u8 handle; 1740de181e88SJaganath Kanakkassery __le16 evt_properties; 1741de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1742de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1743de181e88SJaganath Kanakkassery __u8 channel_map; 1744de181e88SJaganath Kanakkassery __u8 own_addr_type; 1745de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1746de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1747de181e88SJaganath Kanakkassery __u8 filter_policy; 1748de181e88SJaganath Kanakkassery __u8 tx_power; 1749de181e88SJaganath Kanakkassery __u8 primary_phy; 1750de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1751de181e88SJaganath Kanakkassery __u8 secondary_phy; 1752de181e88SJaganath Kanakkassery __u8 sid; 1753de181e88SJaganath Kanakkassery __u8 notif_enable; 1754de181e88SJaganath Kanakkassery } __packed; 1755de181e88SJaganath Kanakkassery 1756de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 175785a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 175885a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1759de181e88SJaganath Kanakkassery 1760de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1761de181e88SJaganath Kanakkassery __u8 status; 1762de181e88SJaganath Kanakkassery __u8 tx_power; 1763de181e88SJaganath Kanakkassery } __packed; 1764de181e88SJaganath Kanakkassery 1765de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1766de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1767de181e88SJaganath Kanakkassery __u8 enable; 1768de181e88SJaganath Kanakkassery __u8 num_of_sets; 1769a7e45454SGustavo A. R. Silva __u8 data[]; 1770de181e88SJaganath Kanakkassery } __packed; 1771de181e88SJaganath Kanakkassery 1772de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1773de181e88SJaganath Kanakkassery __u8 handle; 1774de181e88SJaganath Kanakkassery __le16 duration; 1775de181e88SJaganath Kanakkassery __u8 max_events; 1776de181e88SJaganath Kanakkassery } __packed; 1777de181e88SJaganath Kanakkassery 1778a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1779a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1780a0fb3726SJaganath Kanakkassery __u8 handle; 1781a0fb3726SJaganath Kanakkassery __u8 operation; 1782a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1783a0fb3726SJaganath Kanakkassery __u8 length; 1784a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1785a0fb3726SJaganath Kanakkassery } __packed; 1786a0fb3726SJaganath Kanakkassery 1787a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1788a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1789a0fb3726SJaganath Kanakkassery __u8 handle; 1790a0fb3726SJaganath Kanakkassery __u8 operation; 1791a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1792a0fb3726SJaganath Kanakkassery __u8 length; 1793a0fb3726SJaganath Kanakkassery __u8 data[HCI_MAX_AD_LENGTH]; 1794a0fb3726SJaganath Kanakkassery } __packed; 1795a0fb3726SJaganath Kanakkassery 1796a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1797a0fb3726SJaganath Kanakkassery 1798a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1799a0fb3726SJaganath Kanakkassery 1800a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET 0x203c 1801a9e45698SSathish Narsimman 180245b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 180345b7749fSJaganath Kanakkassery 1804a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1805a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1806a73c046aSJaganath Kanakkassery __u8 handle; 1807a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1808a73c046aSJaganath Kanakkassery } __packed; 1809a73c046aSJaganath Kanakkassery 18107c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 18117c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power { 18127c395ea5SDaniel Winkler __u8 status; 18137c395ea5SDaniel Winkler __s8 min_le_tx_power; 18147c395ea5SDaniel Winkler __s8 max_le_tx_power; 18157c395ea5SDaniel Winkler } __packed; 18167c395ea5SDaniel Winkler 18174de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 18184de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 { 18194de0fc59SLuiz Augusto von Dentz __u8 status; 18204de0fc59SLuiz Augusto von Dentz __le16 acl_mtu; 18214de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt; 18224de0fc59SLuiz Augusto von Dentz __le16 iso_mtu; 18234de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt; 18244de0fc59SLuiz Augusto von Dentz } __packed; 18254de0fc59SLuiz Augusto von Dentz 18264de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 18274de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync { 18284de0fc59SLuiz Augusto von Dentz __le16 handle; 18294de0fc59SLuiz Augusto von Dentz } __packed; 18304de0fc59SLuiz Augusto von Dentz 18314de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync { 18324de0fc59SLuiz Augusto von Dentz __u8 status; 18334de0fc59SLuiz Augusto von Dentz __le16 handle; 18344de0fc59SLuiz Augusto von Dentz __le16 seq; 18354de0fc59SLuiz Augusto von Dentz __le32 imestamp; 18364de0fc59SLuiz Augusto von Dentz __u8 offset[3]; 18374de0fc59SLuiz Augusto von Dentz } __packed; 18384de0fc59SLuiz Augusto von Dentz 18394de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062 18404de0fc59SLuiz Augusto von Dentz struct hci_cis_params { 18414de0fc59SLuiz Augusto von Dentz __u8 cis_id; 18424de0fc59SLuiz Augusto von Dentz __le16 m_sdu; 18434de0fc59SLuiz Augusto von Dentz __le16 s_sdu; 18444de0fc59SLuiz Augusto von Dentz __u8 m_phy; 18454de0fc59SLuiz Augusto von Dentz __u8 s_phy; 18464de0fc59SLuiz Augusto von Dentz __u8 m_rtn; 18474de0fc59SLuiz Augusto von Dentz __u8 s_rtn; 18484de0fc59SLuiz Augusto von Dentz } __packed; 18494de0fc59SLuiz Augusto von Dentz 18504de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params { 18514de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18524de0fc59SLuiz Augusto von Dentz __u8 m_interval[3]; 18534de0fc59SLuiz Augusto von Dentz __u8 s_interval[3]; 18544de0fc59SLuiz Augusto von Dentz __u8 sca; 18554de0fc59SLuiz Augusto von Dentz __u8 packing; 18564de0fc59SLuiz Augusto von Dentz __u8 framing; 18574de0fc59SLuiz Augusto von Dentz __le16 m_latency; 18584de0fc59SLuiz Augusto von Dentz __le16 s_latency; 18594de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1860a7e45454SGustavo A. R. Silva struct hci_cis_params cis[]; 18614de0fc59SLuiz Augusto von Dentz } __packed; 18624de0fc59SLuiz Augusto von Dentz 18634de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params { 18644de0fc59SLuiz Augusto von Dentz __u8 status; 18654de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18664de0fc59SLuiz Augusto von Dentz __u8 num_handles; 1867a7e45454SGustavo A. R. Silva __le16 handle[]; 18684de0fc59SLuiz Augusto von Dentz } __packed; 18694de0fc59SLuiz Augusto von Dentz 18704de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064 18714de0fc59SLuiz Augusto von Dentz struct hci_cis { 18724de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 18734de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 18744de0fc59SLuiz Augusto von Dentz } __packed; 18754de0fc59SLuiz Augusto von Dentz 18764de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis { 18774de0fc59SLuiz Augusto von Dentz __u8 num_cis; 1878a7e45454SGustavo A. R. Silva struct hci_cis cis[]; 18794de0fc59SLuiz Augusto von Dentz } __packed; 18804de0fc59SLuiz Augusto von Dentz 18814de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065 18824de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig { 18834de0fc59SLuiz Augusto von Dentz __u8 cig_id; 18844de0fc59SLuiz Augusto von Dentz } __packed; 18854de0fc59SLuiz Augusto von Dentz 18864de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066 18874de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis { 18884de0fc59SLuiz Augusto von Dentz __le16 handle; 18894de0fc59SLuiz Augusto von Dentz } __packed; 18904de0fc59SLuiz Augusto von Dentz 18914de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067 18924de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis { 18934de0fc59SLuiz Augusto von Dentz __le16 handle; 18944de0fc59SLuiz Augusto von Dentz __u8 reason; 18954de0fc59SLuiz Augusto von Dentz } __packed; 18964de0fc59SLuiz Augusto von Dentz 18971da177e4SLinus Torvalds /* ---- HCI Events ---- */ 18981da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 18991da177e4SLinus Torvalds 19001da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 19011da177e4SLinus Torvalds struct inquiry_info { 19021da177e4SLinus Torvalds bdaddr_t bdaddr; 19031da177e4SLinus Torvalds __u8 pscan_rep_mode; 19041da177e4SLinus Torvalds __u8 pscan_period_mode; 19051da177e4SLinus Torvalds __u8 pscan_mode; 19061da177e4SLinus Torvalds __u8 dev_class[3]; 19071ebb9252SMarcel Holtmann __le16 clock_offset; 190866c853ccSGustavo F. Padovan } __packed; 19091da177e4SLinus Torvalds 19101da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 19111da177e4SLinus Torvalds struct hci_ev_conn_complete { 19121da177e4SLinus Torvalds __u8 status; 19131ebb9252SMarcel Holtmann __le16 handle; 19141da177e4SLinus Torvalds bdaddr_t bdaddr; 19151da177e4SLinus Torvalds __u8 link_type; 19161da177e4SLinus Torvalds __u8 encr_mode; 191766c853ccSGustavo F. Padovan } __packed; 19181da177e4SLinus Torvalds 19191da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 19201da177e4SLinus Torvalds struct hci_ev_conn_request { 19211da177e4SLinus Torvalds bdaddr_t bdaddr; 19221da177e4SLinus Torvalds __u8 dev_class[3]; 19231da177e4SLinus Torvalds __u8 link_type; 192466c853ccSGustavo F. Padovan } __packed; 19251da177e4SLinus Torvalds 19261da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 19271da177e4SLinus Torvalds struct hci_ev_disconn_complete { 19281da177e4SLinus Torvalds __u8 status; 19291ebb9252SMarcel Holtmann __le16 handle; 19301da177e4SLinus Torvalds __u8 reason; 193166c853ccSGustavo F. Padovan } __packed; 19321da177e4SLinus Torvalds 19331da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 19341da177e4SLinus Torvalds struct hci_ev_auth_complete { 19351da177e4SLinus Torvalds __u8 status; 19361ebb9252SMarcel Holtmann __le16 handle; 193766c853ccSGustavo F. Padovan } __packed; 19381da177e4SLinus Torvalds 1939a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1940a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1941a9de9248SMarcel Holtmann __u8 status; 1942a9de9248SMarcel Holtmann bdaddr_t bdaddr; 19431f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 194466c853ccSGustavo F. Padovan } __packed; 1945a9de9248SMarcel Holtmann 19461da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 19471da177e4SLinus Torvalds struct hci_ev_encrypt_change { 19481da177e4SLinus Torvalds __u8 status; 19491ebb9252SMarcel Holtmann __le16 handle; 19501da177e4SLinus Torvalds __u8 encrypt; 195166c853ccSGustavo F. Padovan } __packed; 19521da177e4SLinus Torvalds 1953a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1954a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 19551da177e4SLinus Torvalds __u8 status; 19561ebb9252SMarcel Holtmann __le16 handle; 195766c853ccSGustavo F. Padovan } __packed; 19581da177e4SLinus Torvalds 1959a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1960a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1961a9de9248SMarcel Holtmann __u8 status; 1962a9de9248SMarcel Holtmann __le16 handle; 1963a9de9248SMarcel Holtmann __u8 features[8]; 196466c853ccSGustavo F. Padovan } __packed; 1965a9de9248SMarcel Holtmann 1966a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1967a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1968a9de9248SMarcel Holtmann __u8 status; 1969a9de9248SMarcel Holtmann __le16 handle; 1970a9de9248SMarcel Holtmann __u8 lmp_ver; 1971a9de9248SMarcel Holtmann __le16 manufacturer; 1972a9de9248SMarcel Holtmann __le16 lmp_subver; 197366c853ccSGustavo F. Padovan } __packed; 1974a9de9248SMarcel Holtmann 1975a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 19761da177e4SLinus Torvalds struct hci_qos { 19771da177e4SLinus Torvalds __u8 service_type; 19781da177e4SLinus Torvalds __u32 token_rate; 19791da177e4SLinus Torvalds __u32 peak_bandwidth; 19801da177e4SLinus Torvalds __u32 latency; 19811da177e4SLinus Torvalds __u32 delay_variation; 198266c853ccSGustavo F. Padovan } __packed; 19831da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 19841da177e4SLinus Torvalds __u8 status; 19851ebb9252SMarcel Holtmann __le16 handle; 19861da177e4SLinus Torvalds struct hci_qos qos; 198766c853ccSGustavo F. Padovan } __packed; 19881da177e4SLinus Torvalds 1989a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 19901da177e4SLinus Torvalds struct hci_ev_cmd_complete { 19911da177e4SLinus Torvalds __u8 ncmd; 19921ebb9252SMarcel Holtmann __le16 opcode; 199366c853ccSGustavo F. Padovan } __packed; 19941da177e4SLinus Torvalds 1995a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 19961da177e4SLinus Torvalds struct hci_ev_cmd_status { 19971da177e4SLinus Torvalds __u8 status; 19981da177e4SLinus Torvalds __u8 ncmd; 19991ebb9252SMarcel Holtmann __le16 opcode; 200066c853ccSGustavo F. Padovan } __packed; 20011da177e4SLinus Torvalds 200224dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 200324dfa343SMarcel Holtmann struct hci_ev_hardware_error { 200424dfa343SMarcel Holtmann __u8 code; 200524dfa343SMarcel Holtmann } __packed; 200624dfa343SMarcel Holtmann 20071da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 20081da177e4SLinus Torvalds struct hci_ev_role_change { 20091da177e4SLinus Torvalds __u8 status; 20101da177e4SLinus Torvalds bdaddr_t bdaddr; 20111da177e4SLinus Torvalds __u8 role; 201266c853ccSGustavo F. Padovan } __packed; 20131da177e4SLinus Torvalds 2014a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 2015613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 2016613a1c0cSAndrei Emeltchenko __le16 handle; 2017613a1c0cSAndrei Emeltchenko __le16 count; 2018613a1c0cSAndrei Emeltchenko } __packed; 2019613a1c0cSAndrei Emeltchenko 2020a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 2021a9de9248SMarcel Holtmann __u8 num_hndl; 2022a7e45454SGustavo A. R. Silva struct hci_comp_pkts_info handles[]; 202366c853ccSGustavo F. Padovan } __packed; 2024a9de9248SMarcel Holtmann 20251da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 20261da177e4SLinus Torvalds struct hci_ev_mode_change { 20271da177e4SLinus Torvalds __u8 status; 20281ebb9252SMarcel Holtmann __le16 handle; 20291da177e4SLinus Torvalds __u8 mode; 20301ebb9252SMarcel Holtmann __le16 interval; 203166c853ccSGustavo F. Padovan } __packed; 20321da177e4SLinus Torvalds 20331da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 20341da177e4SLinus Torvalds struct hci_ev_pin_code_req { 20351da177e4SLinus Torvalds bdaddr_t bdaddr; 203666c853ccSGustavo F. Padovan } __packed; 20371da177e4SLinus Torvalds 20381da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 20391da177e4SLinus Torvalds struct hci_ev_link_key_req { 20401da177e4SLinus Torvalds bdaddr_t bdaddr; 204166c853ccSGustavo F. Padovan } __packed; 20421da177e4SLinus Torvalds 20431da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 20441da177e4SLinus Torvalds struct hci_ev_link_key_notify { 20451da177e4SLinus Torvalds bdaddr_t bdaddr; 20469b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 20471da177e4SLinus Torvalds __u8 key_type; 204866c853ccSGustavo F. Padovan } __packed; 20491da177e4SLinus Torvalds 2050a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 20511da177e4SLinus Torvalds struct hci_ev_clock_offset { 20521da177e4SLinus Torvalds __u8 status; 20531ebb9252SMarcel Holtmann __le16 handle; 20541ebb9252SMarcel Holtmann __le16 clock_offset; 205566c853ccSGustavo F. Padovan } __packed; 20561da177e4SLinus Torvalds 2057a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 2058a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 2059a8746417SMarcel Holtmann __u8 status; 2060a8746417SMarcel Holtmann __le16 handle; 2061a8746417SMarcel Holtmann __le16 pkt_type; 206266c853ccSGustavo F. Padovan } __packed; 2063a8746417SMarcel Holtmann 206485a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 206585a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 206685a1e930SMarcel Holtmann bdaddr_t bdaddr; 206785a1e930SMarcel Holtmann __u8 pscan_rep_mode; 206866c853ccSGustavo F. Padovan } __packed; 206985a1e930SMarcel Holtmann 2070a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 2071a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 2072a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2073a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2074a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2075a9de9248SMarcel Holtmann __u8 dev_class[3]; 2076a9de9248SMarcel Holtmann __le16 clock_offset; 2077a9de9248SMarcel Holtmann __s8 rssi; 207866c853ccSGustavo F. Padovan } __packed; 2079a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 2080a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2081a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2082a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2083a9de9248SMarcel Holtmann __u8 pscan_mode; 2084a9de9248SMarcel Holtmann __u8 dev_class[3]; 2085a9de9248SMarcel Holtmann __le16 clock_offset; 2086a9de9248SMarcel Holtmann __s8 rssi; 208766c853ccSGustavo F. Padovan } __packed; 2088a9de9248SMarcel Holtmann 2089a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 2090a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 2091a9de9248SMarcel Holtmann __u8 status; 2092a9de9248SMarcel Holtmann __le16 handle; 2093a9de9248SMarcel Holtmann __u8 page; 2094a9de9248SMarcel Holtmann __u8 max_page; 2095a9de9248SMarcel Holtmann __u8 features[8]; 209666c853ccSGustavo F. Padovan } __packed; 2097a9de9248SMarcel Holtmann 2098a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 2099a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 2100a9de9248SMarcel Holtmann __u8 status; 2101a9de9248SMarcel Holtmann __le16 handle; 2102a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2103a9de9248SMarcel Holtmann __u8 link_type; 2104a9de9248SMarcel Holtmann __u8 tx_interval; 2105a9de9248SMarcel Holtmann __u8 retrans_window; 2106a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2107a9de9248SMarcel Holtmann __le16 tx_pkt_len; 2108a9de9248SMarcel Holtmann __u8 air_mode; 210966c853ccSGustavo F. Padovan } __packed; 2110a9de9248SMarcel Holtmann 2111a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 2112a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 2113a9de9248SMarcel Holtmann __u8 status; 2114a9de9248SMarcel Holtmann __le16 handle; 2115a9de9248SMarcel Holtmann __u8 tx_interval; 2116a9de9248SMarcel Holtmann __u8 retrans_window; 2117a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2118a9de9248SMarcel Holtmann __le16 tx_pkt_len; 211966c853ccSGustavo F. Padovan } __packed; 2120a9de9248SMarcel Holtmann 2121a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 212204837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 212304837f64SMarcel Holtmann __u8 status; 212404837f64SMarcel Holtmann __le16 handle; 212504837f64SMarcel Holtmann __le16 max_tx_latency; 212604837f64SMarcel Holtmann __le16 max_rx_latency; 212704837f64SMarcel Holtmann __le16 max_remote_timeout; 212804837f64SMarcel Holtmann __le16 max_local_timeout; 212966c853ccSGustavo F. Padovan } __packed; 213004837f64SMarcel Holtmann 2131a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 2132a9de9248SMarcel Holtmann struct extended_inquiry_info { 2133a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2134a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2135a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2136a9de9248SMarcel Holtmann __u8 dev_class[3]; 2137a9de9248SMarcel Holtmann __le16 clock_offset; 2138a9de9248SMarcel Holtmann __s8 rssi; 2139a9de9248SMarcel Holtmann __u8 data[240]; 214066c853ccSGustavo F. Padovan } __packed; 2141a9de9248SMarcel Holtmann 21421c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 21431c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 21441c2e0041SJohan Hedberg __u8 status; 21451c2e0041SJohan Hedberg __le16 handle; 21461c2e0041SJohan Hedberg } __packed; 21471c2e0041SJohan Hedberg 21480493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 21490493684eSMarcel Holtmann struct hci_ev_io_capa_request { 21500493684eSMarcel Holtmann bdaddr_t bdaddr; 215166c853ccSGustavo F. Padovan } __packed; 21520493684eSMarcel Holtmann 215303b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 215403b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 215503b555e1SJohan Hedberg bdaddr_t bdaddr; 215603b555e1SJohan Hedberg __u8 capability; 215703b555e1SJohan Hedberg __u8 oob_data; 215803b555e1SJohan Hedberg __u8 authentication; 215903b555e1SJohan Hedberg } __packed; 216003b555e1SJohan Hedberg 2161a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 2162a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 2163a5c29683SJohan Hedberg bdaddr_t bdaddr; 2164a5c29683SJohan Hedberg __le32 passkey; 2165a5c29683SJohan Hedberg } __packed; 2166a5c29683SJohan Hedberg 21679ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 21689ad4019aSBrian Gix struct hci_ev_user_passkey_req { 21699ad4019aSBrian Gix bdaddr_t bdaddr; 21709ad4019aSBrian Gix } __packed; 21719ad4019aSBrian Gix 21722763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 21732763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 21742763eda6SSzymon Janc bdaddr_t bdaddr; 21752763eda6SSzymon Janc } __packed; 21762763eda6SSzymon Janc 21770493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 21780493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 21790493684eSMarcel Holtmann __u8 status; 21800493684eSMarcel Holtmann bdaddr_t bdaddr; 218166c853ccSGustavo F. Padovan } __packed; 21820493684eSMarcel Holtmann 218392a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 218492a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 218592a25256SJohan Hedberg bdaddr_t bdaddr; 218692a25256SJohan Hedberg __le32 passkey; 218792a25256SJohan Hedberg } __packed; 218892a25256SJohan Hedberg 218992a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 219092a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 219192a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 219292a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 219392a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 219492a25256SJohan Hedberg 219592a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 219692a25256SJohan Hedberg struct hci_ev_keypress_notify { 219792a25256SJohan Hedberg bdaddr_t bdaddr; 219892a25256SJohan Hedberg __u8 type; 219992a25256SJohan Hedberg } __packed; 220092a25256SJohan Hedberg 220141a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 220241a96212SMarcel Holtmann struct hci_ev_remote_host_features { 220341a96212SMarcel Holtmann bdaddr_t bdaddr; 220441a96212SMarcel Holtmann __u8 features[8]; 220566c853ccSGustavo F. Padovan } __packed; 220641a96212SMarcel Holtmann 220763185f64SVille Tervo #define HCI_EV_LE_META 0x3e 220863185f64SVille Tervo struct hci_ev_le_meta { 220963185f64SVille Tervo __u8 subevent; 221063185f64SVille Tervo } __packed; 221163185f64SVille Tervo 2212523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2213523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2214523e93cdSAndrei Emeltchenko __u8 status; 2215523e93cdSAndrei Emeltchenko __u8 phy_handle; 2216523e93cdSAndrei Emeltchenko } __packed; 2217523e93cdSAndrei Emeltchenko 2218523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2219523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2220523e93cdSAndrei Emeltchenko __u8 phy_handle; 2221523e93cdSAndrei Emeltchenko } __packed; 2222523e93cdSAndrei Emeltchenko 2223523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2224523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2225523e93cdSAndrei Emeltchenko __u8 status; 2226523e93cdSAndrei Emeltchenko __u8 phy_handle; 2227523e93cdSAndrei Emeltchenko __u8 reason; 2228523e93cdSAndrei Emeltchenko } __packed; 2229523e93cdSAndrei Emeltchenko 2230523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2231523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2232523e93cdSAndrei Emeltchenko __u8 status; 2233523e93cdSAndrei Emeltchenko __le16 handle; 2234523e93cdSAndrei Emeltchenko __u8 phy_handle; 2235523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2236523e93cdSAndrei Emeltchenko } __packed; 2237523e93cdSAndrei Emeltchenko 2238523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2239523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2240523e93cdSAndrei Emeltchenko __u8 status; 2241523e93cdSAndrei Emeltchenko __le16 handle; 2242523e93cdSAndrei Emeltchenko __u8 reason; 2243523e93cdSAndrei Emeltchenko } __packed; 2244523e93cdSAndrei Emeltchenko 224525e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 224625e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 224725e89e99SAndrei Emeltchenko __le16 handle; 224825e89e99SAndrei Emeltchenko __le16 pkts; 224925e89e99SAndrei Emeltchenko __le16 blocks; 225025e89e99SAndrei Emeltchenko } __packed; 225125e89e99SAndrei Emeltchenko 225225e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 225325e89e99SAndrei Emeltchenko __le16 num_blocks; 225425e89e99SAndrei Emeltchenko __u8 num_hndl; 2255a7e45454SGustavo A. R. Silva struct hci_comp_blocks_info handles[]; 225625e89e99SAndrei Emeltchenko } __packed; 225725e89e99SAndrei Emeltchenko 22582b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 22592b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 22602b359445SDoHyun Pyun __u8 status; 22612b359445SDoHyun Pyun } __packed; 22622b359445SDoHyun Pyun 22632ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 22642ed01805SDoHyun Pyun 226563185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 226663185f64SVille Tervo struct hci_ev_le_conn_complete { 226763185f64SVille Tervo __u8 status; 226863185f64SVille Tervo __le16 handle; 226963185f64SVille Tervo __u8 role; 227063185f64SVille Tervo __u8 bdaddr_type; 227163185f64SVille Tervo bdaddr_t bdaddr; 227263185f64SVille Tervo __le16 interval; 227363185f64SVille Tervo __le16 latency; 227463185f64SVille Tervo __le16 supervision_timeout; 227563185f64SVille Tervo __u8 clk_accurancy; 227663185f64SVille Tervo } __packed; 227763185f64SVille Tervo 22782331fd46SMarcel Holtmann /* Advertising report event types */ 22792331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 22802331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 22812331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 22822331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 22832331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2284c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2285c215e939SJaganath Kanakkassery 2286c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2287c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2288c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2289c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2290c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2291c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2292c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 22932331fd46SMarcel Holtmann 2294b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2295b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2296b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2297b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2298b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2299b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2300b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2301b2cc9761SJaganath Kanakkassery 23022331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 23032331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 23046540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 23056540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 23062331fd46SMarcel Holtmann 23072331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 23082331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 23092331fd46SMarcel Holtmann __u8 evt_type; 23102331fd46SMarcel Holtmann __u8 bdaddr_type; 23112331fd46SMarcel Holtmann bdaddr_t bdaddr; 23122331fd46SMarcel Holtmann __u8 length; 2313a7e45454SGustavo A. R. Silva __u8 data[]; 23142331fd46SMarcel Holtmann } __packed; 23152331fd46SMarcel Holtmann 23161855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 23171855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 23181855d92dSMarcel Holtmann __u8 status; 23191855d92dSMarcel Holtmann __le16 handle; 23201855d92dSMarcel Holtmann __le16 interval; 23211855d92dSMarcel Holtmann __le16 latency; 23221855d92dSMarcel Holtmann __le16 supervision_timeout; 23231855d92dSMarcel Holtmann } __packed; 23241855d92dSMarcel Holtmann 23250fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 23260fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 23270fe29fd1SMarcel Holtmann __u8 status; 23280fe29fd1SMarcel Holtmann __le16 handle; 23290fe29fd1SMarcel Holtmann __u8 features[8]; 23300fe29fd1SMarcel Holtmann } __packed; 23310fe29fd1SMarcel Holtmann 2332a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2333a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2334a7a595f6SVinicius Costa Gomes __le16 handle; 2335fe39c7b2SMarcel Holtmann __le64 rand; 2336a7a595f6SVinicius Costa Gomes __le16 ediv; 2337a7a595f6SVinicius Costa Gomes } __packed; 2338a7a595f6SVinicius Costa Gomes 23398e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 23408e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 23418e75b46aSAndre Guedes __le16 handle; 23428e75b46aSAndre Guedes __le16 interval_min; 23438e75b46aSAndre Guedes __le16 interval_max; 23448e75b46aSAndre Guedes __le16 latency; 23458e75b46aSAndre Guedes __le16 timeout; 23468e75b46aSAndre Guedes } __packed; 23478e75b46aSAndre Guedes 234894a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 234994a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 235094a3bd02SMarcel Holtmann __le16 handle; 235194a3bd02SMarcel Holtmann __le16 tx_len; 235294a3bd02SMarcel Holtmann __le16 tx_time; 235394a3bd02SMarcel Holtmann __le16 rx_len; 235494a3bd02SMarcel Holtmann __le16 rx_time; 235594a3bd02SMarcel Holtmann } __packed; 235694a3bd02SMarcel Holtmann 235732c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 235832c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 235932c9d43fSMarcel Holtmann __u8 evt_type; 236032c9d43fSMarcel Holtmann __u8 bdaddr_type; 236132c9d43fSMarcel Holtmann bdaddr_t bdaddr; 236232c9d43fSMarcel Holtmann __u8 direct_addr_type; 236332c9d43fSMarcel Holtmann bdaddr_t direct_addr; 236432c9d43fSMarcel Holtmann __s8 rssi; 236532c9d43fSMarcel Holtmann } __packed; 236632c9d43fSMarcel Holtmann 23671efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 23681efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 23691efd927dSLuiz Augusto von Dentz __u8 status; 23704de0fc59SLuiz Augusto von Dentz __le16 handle; 23711efd927dSLuiz Augusto von Dentz __u8 tx_phy; 23721efd927dSLuiz Augusto von Dentz __u8 rx_phy; 23731efd927dSLuiz Augusto von Dentz } __packed; 23741efd927dSLuiz Augusto von Dentz 2375c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2376c215e939SJaganath Kanakkassery struct hci_ev_le_ext_adv_report { 2377c215e939SJaganath Kanakkassery __le16 evt_type; 2378c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2379c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2380c215e939SJaganath Kanakkassery __u8 primary_phy; 2381c215e939SJaganath Kanakkassery __u8 secondary_phy; 2382c215e939SJaganath Kanakkassery __u8 sid; 2383c215e939SJaganath Kanakkassery __u8 tx_power; 2384c215e939SJaganath Kanakkassery __s8 rssi; 2385c215e939SJaganath Kanakkassery __le16 interval; 2386c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2387c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2388c215e939SJaganath Kanakkassery __u8 length; 2389a7e45454SGustavo A. R. Silva __u8 data[]; 2390c215e939SJaganath Kanakkassery } __packed; 2391c215e939SJaganath Kanakkassery 23924d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 23934d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 23944d94f95dSJaganath Kanakkassery __u8 status; 23954d94f95dSJaganath Kanakkassery __le16 handle; 23964d94f95dSJaganath Kanakkassery __u8 role; 23974d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 23984d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 23994d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 24004d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 24014d94f95dSJaganath Kanakkassery __le16 interval; 24024d94f95dSJaganath Kanakkassery __le16 latency; 24034d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 24044d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 24054d94f95dSJaganath Kanakkassery } __packed; 24064d94f95dSJaganath Kanakkassery 2407acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2408acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2409acf0aeaeSJaganath Kanakkassery __u8 status; 2410acf0aeaeSJaganath Kanakkassery __u8 handle; 2411acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2412acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2413acf0aeaeSJaganath Kanakkassery } __packed; 2414acf0aeaeSJaganath Kanakkassery 24154de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19 24164de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established { 24174de0fc59SLuiz Augusto von Dentz __u8 status; 24184de0fc59SLuiz Augusto von Dentz __le16 handle; 24194de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3]; 24204de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3]; 24214de0fc59SLuiz Augusto von Dentz __u8 m_latency[3]; 24224de0fc59SLuiz Augusto von Dentz __u8 s_latency[3]; 24234de0fc59SLuiz Augusto von Dentz __u8 m_phy; 24244de0fc59SLuiz Augusto von Dentz __u8 s_phy; 24254de0fc59SLuiz Augusto von Dentz __u8 nse; 24264de0fc59SLuiz Augusto von Dentz __u8 m_bn; 24274de0fc59SLuiz Augusto von Dentz __u8 s_bn; 24284de0fc59SLuiz Augusto von Dentz __u8 m_ft; 24294de0fc59SLuiz Augusto von Dentz __u8 s_ft; 24304de0fc59SLuiz Augusto von Dentz __le16 m_mtu; 24314de0fc59SLuiz Augusto von Dentz __le16 s_mtu; 24324de0fc59SLuiz Augusto von Dentz __le16 interval; 24334de0fc59SLuiz Augusto von Dentz } __packed; 24344de0fc59SLuiz Augusto von Dentz 24354de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a 24364de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req { 24374de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 24384de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 24394de0fc59SLuiz Augusto von Dentz __u8 cig_id; 24404de0fc59SLuiz Augusto von Dentz __u8 cis_id; 24414de0fc59SLuiz Augusto von Dentz } __packed; 24424de0fc59SLuiz Augusto von Dentz 2443e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2444e4cc5a18SMarcel Holtmann 24451da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2446a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 24471da177e4SLinus Torvalds struct hci_ev_stack_internal { 24481da177e4SLinus Torvalds __u16 type; 2449a7e45454SGustavo A. R. Silva __u8 data[]; 245066c853ccSGustavo F. Padovan } __packed; 24511da177e4SLinus Torvalds 24521da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 24531da177e4SLinus Torvalds struct hci_ev_si_device { 24541da177e4SLinus Torvalds __u16 event; 24551da177e4SLinus Torvalds __u16 dev_id; 245666c853ccSGustavo F. Padovan } __packed; 24571da177e4SLinus Torvalds 24581da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 24591da177e4SLinus Torvalds struct hci_ev_si_security { 24601da177e4SLinus Torvalds __u16 event; 24611da177e4SLinus Torvalds __u16 proto; 24621da177e4SLinus Torvalds __u16 subproto; 24631da177e4SLinus Torvalds __u8 incoming; 246466c853ccSGustavo F. Padovan } __packed; 24651da177e4SLinus Torvalds 24661da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 24671da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 24681da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 24691da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 24701da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 24714de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4 24721da177e4SLinus Torvalds 24731da177e4SLinus Torvalds struct hci_command_hdr { 24741ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 24751da177e4SLinus Torvalds __u8 plen; 247666c853ccSGustavo F. Padovan } __packed; 24771da177e4SLinus Torvalds 24781da177e4SLinus Torvalds struct hci_event_hdr { 24791da177e4SLinus Torvalds __u8 evt; 24801da177e4SLinus Torvalds __u8 plen; 248166c853ccSGustavo F. Padovan } __packed; 24821da177e4SLinus Torvalds 24831da177e4SLinus Torvalds struct hci_acl_hdr { 24841ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 24851ebb9252SMarcel Holtmann __le16 dlen; 248666c853ccSGustavo F. Padovan } __packed; 24871da177e4SLinus Torvalds 24881da177e4SLinus Torvalds struct hci_sco_hdr { 24891ebb9252SMarcel Holtmann __le16 handle; 24901da177e4SLinus Torvalds __u8 dlen; 249166c853ccSGustavo F. Padovan } __packed; 24921da177e4SLinus Torvalds 24934de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr { 24944de0fc59SLuiz Augusto von Dentz __le16 handle; 24954de0fc59SLuiz Augusto von Dentz __le16 dlen; 2496a7e45454SGustavo A. R. Silva __u8 data[]; 24974de0fc59SLuiz Augusto von Dentz } __packed; 24984de0fc59SLuiz Augusto von Dentz 24994de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */ 25004de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00 25014de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01 25024de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02 25034de0fc59SLuiz Augusto von Dentz 25044de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4 25054de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr { 25064de0fc59SLuiz Augusto von Dentz __le16 sn; 25074de0fc59SLuiz Augusto von Dentz __le16 slen; 25084de0fc59SLuiz Augusto von Dentz }; 25094de0fc59SLuiz Augusto von Dentz 25104de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8 25114de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr { 25124de0fc59SLuiz Augusto von Dentz __le32 ts; 25134de0fc59SLuiz Augusto von Dentz __le16 sn; 25144de0fc59SLuiz Augusto von Dentz __le16 slen; 25154de0fc59SLuiz Augusto von Dentz }; 25164de0fc59SLuiz Augusto von Dentz 25172a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 25182a123b86SArnaldo Carvalho de Melo { 25192a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 25202a123b86SArnaldo Carvalho de Melo } 25212a123b86SArnaldo Carvalho de Melo 25222a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 25232a123b86SArnaldo Carvalho de Melo { 25242a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 25252a123b86SArnaldo Carvalho de Melo } 25262a123b86SArnaldo Carvalho de Melo 25272a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 25282a123b86SArnaldo Carvalho de Melo { 25292a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 25302a123b86SArnaldo Carvalho de Melo } 25312a123b86SArnaldo Carvalho de Melo 25321da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2533c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 25341da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 25351da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 25361da177e4SLinus Torvalds 25371da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2538c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 25391da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 25401da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 25411da177e4SLinus Torvalds 25424de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */ 25434de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003) 25444de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) 25454de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) 25464de0fc59SLuiz Augusto von Dentz 25474de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */ 25484de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) 25494de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff) 25504de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14) 25514de0fc59SLuiz Augusto von Dentz 25525cbd3ebdSAlain Michaud /* le24 support */ 25535cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) 25545cbd3ebdSAlain Michaud { 25555cbd3ebdSAlain Michaud dst[0] = val & 0xff; 25565cbd3ebdSAlain Michaud dst[1] = (val & 0xff00) >> 8; 25575cbd3ebdSAlain Michaud dst[2] = (val & 0xff0000) >> 16; 25585cbd3ebdSAlain Michaud } 25595cbd3ebdSAlain Michaud 25601da177e4SLinus Torvalds #endif /* __HCI_H */ 2561