11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux 31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 81da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 91da177e4SLinus Torvalds published by the Free Software Foundation; 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 121da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 131da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 141da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 151da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 161da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 171da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 181da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 191da177e4SLinus Torvalds 201da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 211da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 221da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #ifndef __HCI_H 261da177e4SLinus Torvalds #define __HCI_H 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024 291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255 304de0fc59SLuiz Augusto von Dentz #define HCI_MAX_ISO_SIZE 251 311da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260 321da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 331da177e4SLinus Torvalds 349b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16 35523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 369b3b4460SAndrei Emeltchenko 37903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE 672 38903e4541SAndrei Emeltchenko 396397729bSArchie Pusaka #define HCI_MAX_CPB_DATA_SIZE 252 407d1dab49SDoHyun Pyun 411da177e4SLinus Torvalds /* HCI dev events */ 421da177e4SLinus Torvalds #define HCI_DEV_REG 1 431da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 441da177e4SLinus Torvalds #define HCI_DEV_UP 3 451da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 461da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 471da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 484a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 494a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 50e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 511da177e4SLinus Torvalds 521da177e4SLinus Torvalds /* HCI notify events */ 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 541da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 551da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 561f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_CVSD 4 571f8330eaSSathish Narsimman #define HCI_NOTIFY_ENABLE_SCO_TRANSP 5 581f8330eaSSathish Narsimman #define HCI_NOTIFY_DISABLE_SCO 6 591da177e4SLinus Torvalds 60c13854ceSMarcel Holtmann /* HCI bus types */ 610ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 621da177e4SLinus Torvalds #define HCI_USB 1 631da177e4SLinus Torvalds #define HCI_PCCARD 2 641da177e4SLinus Torvalds #define HCI_UART 3 651da177e4SLinus Torvalds #define HCI_RS232 4 661da177e4SLinus Torvalds #define HCI_PCI 5 670ac53939SMarcel Holtmann #define HCI_SDIO 6 685c0e03cdSJohan Hedberg #define HCI_SPI 7 695c0e03cdSJohan Hedberg #define HCI_I2C 8 7065010e68SBjorn Andersson #define HCI_SMD 9 71d2a3f5f4SMarcel Holtmann #define HCI_VIRTIO 10 721da177e4SLinus Torvalds 73943da25dSMarcel Holtmann /* HCI controller types */ 74ca8bee5dSMarcel Holtmann #define HCI_PRIMARY 0x00 758f1e1742SDavid Vrabel #define HCI_AMP 0x01 76943da25dSMarcel Holtmann 778598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 786ed971caSMarcel Holtmann #define AMP_ID_BREDR 0x00 798598d064SAndrei Emeltchenko 807c13823dSMarcel Holtmann /* AMP controller types */ 817c13823dSMarcel Holtmann #define AMP_TYPE_BREDR 0x00 827c13823dSMarcel Holtmann #define AMP_TYPE_80211 0x01 837c13823dSMarcel Holtmann 84ab846ec4SAndrei Emeltchenko /* AMP controller status */ 85536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN 0x00 86536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY 0x01 87536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY 0x02 88536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY 0x03 89536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY 0x04 90536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY 0x05 91536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY 0x06 92ab846ec4SAndrei Emeltchenko 931da177e4SLinus Torvalds /* HCI device quirks */ 941da177e4SLinus Torvalds enum { 95118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when 96118305b5SMarcel Holtmann * closing the transport instead of when opening it. 97118305b5SMarcel Holtmann * 98118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 99118305b5SMarcel Holtmann */ 100a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 101118305b5SMarcel Holtmann 102118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only 103118305b5SMarcel Holtmann * device and it will stay in unconfigured state. 104118305b5SMarcel Holtmann * 105118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 106118305b5SMarcel Holtmann */ 107da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 108118305b5SMarcel Holtmann 109118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by 110118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid. 111118305b5SMarcel Holtmann * 112118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 113118305b5SMarcel Holtmann */ 114f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE, 115118305b5SMarcel Holtmann 116043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not 117043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to 118043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had 119043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing 120043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the 121043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better 122e37c57a8SAlain Michaud * user experience. 123043ec9bfSMarcel Holtmann * 124043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called. 125043ec9bfSMarcel Holtmann */ 126043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE, 127043ec9bfSMarcel Holtmann 128711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported 129711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2 130711ffa78SMarcel Holtmann * and later controllers should support this command. However 131711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do 132711ffa78SMarcel Holtmann * not support this command. 133711ffa78SMarcel Holtmann * 134711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 135711ffa78SMarcel Holtmann */ 136711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS, 137711ffa78SMarcel Holtmann 138118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling 139118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the 140118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but 141118305b5SMarcel Holtmann * not supported. 142118305b5SMarcel Holtmann * 143118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 144118305b5SMarcel Holtmann */ 145f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY, 14689bc22d2SMarcel Holtmann 147eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step 148eb1904f4SMarcel Holtmann * is required and will be indicated with the controller 149e37c57a8SAlain Michaud * configuration. 150eb1904f4SMarcel Holtmann * 151eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 152eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback. 153eb1904f4SMarcel Holtmann */ 154eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG, 155eb1904f4SMarcel Holtmann 15689bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address 15789bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command 15889bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is 15989bc22d2SMarcel Holtmann * required before this device can be used. 16089bc22d2SMarcel Holtmann * 16189bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 16289bc22d2SMarcel Holtmann * during the hdev->setup vendor callback. 16389bc22d2SMarcel Holtmann */ 16489bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR, 16543d6bc46SMarcel Holtmann 1667a0e5b15SMatthias Kaehlcke /* When this quirk is set, the public Bluetooth address 1677a0e5b15SMatthias Kaehlcke * initially reported by HCI Read BD Address command 1687a0e5b15SMatthias Kaehlcke * is considered invalid. The public BD Address can be 1697a0e5b15SMatthias Kaehlcke * specified in the fwnode property 'local-bd-address'. 1707a0e5b15SMatthias Kaehlcke * If this property does not exist or is invalid controller 1717a0e5b15SMatthias Kaehlcke * configuration is required before this device can be used. 1727a0e5b15SMatthias Kaehlcke * 1737a0e5b15SMatthias Kaehlcke * This quirk can be set before hci_register_dev is called or 1747a0e5b15SMatthias Kaehlcke * during the hdev->setup vendor callback. 1757a0e5b15SMatthias Kaehlcke */ 1767a0e5b15SMatthias Kaehlcke HCI_QUIRK_USE_BDADDR_PROPERTY, 1777a0e5b15SMatthias Kaehlcke 17843d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 17943d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 18043d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 18143d6bc46SMarcel Holtmann * 18243d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 18343d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 18443d6bc46SMarcel Holtmann */ 18543d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 186695c4cb6SJakub Pawlowski 187695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 188695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 189695c4cb6SJakub Pawlowski * 190695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 191695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 192695c4cb6SJakub Pawlowski */ 193695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1947e995b9eSMarcel Holtmann 1957e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1967e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1977e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1987e995b9eSMarcel Holtmann * 1997e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 2007e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 2017e995b9eSMarcel Holtmann */ 2027e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 203740011cfSSean Wang 204740011cfSSean Wang /* When this quirk is set, setup() would be run after every 205740011cfSSean Wang * open() and not just after the first open(). 206740011cfSSean Wang * 207740011cfSSean Wang * This quirk can be set before hci_register_dev is called or 208740011cfSSean Wang * during the hdev->setup vendor callback. 209740011cfSSean Wang * 210740011cfSSean Wang */ 211740011cfSSean Wang HCI_QUIRK_NON_PERSISTENT_SETUP, 2124b127bd5SAlain Michaud 2134b127bd5SAlain Michaud /* When this quirk is set, wide band speech is supported by 2144b127bd5SAlain Michaud * the driver since no reliable mechanism exist to report 2154b127bd5SAlain Michaud * this from the hardware, a driver flag is use to convey 2164b127bd5SAlain Michaud * this support 2174b127bd5SAlain Michaud * 2184b127bd5SAlain Michaud * This quirk must be set before hci_register_dev is called. 2194b127bd5SAlain Michaud */ 22000bce3fbSAlain Michaud HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, 22122091585SAlain Michaud 22222091585SAlain Michaud /* When this quirk is set, the controller has validated that 22322091585SAlain Michaud * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are 22422091585SAlain Michaud * valid. This mechanism is necessary as many controllers have 22522091585SAlain Michaud * been seen has having trouble initiating a connectable 22622091585SAlain Michaud * advertisement despite the state combination being reported as 22722091585SAlain Michaud * supported. 22822091585SAlain Michaud */ 22922091585SAlain Michaud HCI_QUIRK_VALID_LE_STATES, 230cde1a8a9SIsmael Ferreras Morezuelas 231cde1a8a9SIsmael Ferreras Morezuelas /* When this quirk is set, then erroneous data reporting 232cde1a8a9SIsmael Ferreras Morezuelas * is ignored. This is mainly due to the fact that the HCI 233cde1a8a9SIsmael Ferreras Morezuelas * Read Default Erroneous Data Reporting command is advertised, 234cde1a8a9SIsmael Ferreras Morezuelas * but not supported; these controllers often reply with unknown 235cde1a8a9SIsmael Ferreras Morezuelas * command and tend to lock up randomly. Needing a hard reset. 236cde1a8a9SIsmael Ferreras Morezuelas * 237cde1a8a9SIsmael Ferreras Morezuelas * This quirk can be set before hci_register_dev is called or 238cde1a8a9SIsmael Ferreras Morezuelas * during the hdev->setup vendor callback. 239cde1a8a9SIsmael Ferreras Morezuelas */ 240cde1a8a9SIsmael Ferreras Morezuelas HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, 241219991e6SHans de Goede 242219991e6SHans de Goede /* 243219991e6SHans de Goede * When this quirk is set, then the hci_suspend_notifier is not 244219991e6SHans de Goede * registered. This is intended for devices which drop completely 245219991e6SHans de Goede * from the bus on system-suspend and which will show up as a new 246219991e6SHans de Goede * HCI after resume. 247219991e6SHans de Goede */ 248219991e6SHans de Goede HCI_QUIRK_NO_SUSPEND_NOTIFIER, 249d2f8114fSAditya Garg 250d2f8114fSAditya Garg /* 251d2f8114fSAditya Garg * When this quirk is set, LE tx power is not queried on startup 252d2f8114fSAditya Garg * and the min/max tx power values default to HCI_TX_POWER_INVALID. 253d2f8114fSAditya Garg * 254d2f8114fSAditya Garg * This quirk can be set before hci_register_dev is called or 255d2f8114fSAditya Garg * during the hdev->setup vendor callback. 256d2f8114fSAditya Garg */ 257d2f8114fSAditya Garg HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, 258*0eaecfb2SIsmael Ferreras Morezuelas 259*0eaecfb2SIsmael Ferreras Morezuelas /* When this quirk is set, HCI_OP_SET_EVENT_FLT requests with 260*0eaecfb2SIsmael Ferreras Morezuelas * HCI_FLT_CLEAR_ALL are ignored and event filtering is 261*0eaecfb2SIsmael Ferreras Morezuelas * completely avoided. A subset of the CSR controller 262*0eaecfb2SIsmael Ferreras Morezuelas * clones struggle with this and instantly lock up. 263*0eaecfb2SIsmael Ferreras Morezuelas * 264*0eaecfb2SIsmael Ferreras Morezuelas * Note that devices using this must (separately) disable 265*0eaecfb2SIsmael Ferreras Morezuelas * runtime suspend, because event filtering takes place there. 266*0eaecfb2SIsmael Ferreras Morezuelas */ 267*0eaecfb2SIsmael Ferreras Morezuelas HCI_QUIRK_BROKEN_FILTER_CLEAR_ALL, 2681da177e4SLinus Torvalds }; 2691da177e4SLinus Torvalds 2701da177e4SLinus Torvalds /* HCI device flags */ 2711da177e4SLinus Torvalds enum { 2721da177e4SLinus Torvalds HCI_UP, 2731da177e4SLinus Torvalds HCI_INIT, 2741da177e4SLinus Torvalds HCI_RUNNING, 2751da177e4SLinus Torvalds 2761da177e4SLinus Torvalds HCI_PSCAN, 2771da177e4SLinus Torvalds HCI_ISCAN, 2781da177e4SLinus Torvalds HCI_AUTH, 2791da177e4SLinus Torvalds HCI_ENCRYPT, 2801da177e4SLinus Torvalds HCI_INQUIRY, 2811da177e4SLinus Torvalds 2821da177e4SLinus Torvalds HCI_RAW, 283ab81cbf9SJohan Hedberg 28410572132SGustavo F. Padovan HCI_RESET, 2851da177e4SLinus Torvalds }; 2861da177e4SLinus Torvalds 287f9207338SMarcel Holtmann /* HCI socket flags */ 288f9207338SMarcel Holtmann enum { 28950ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 290f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 291f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 292ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 293321c6feeSMarcel Holtmann HCI_MGMT_EXT_INFO_EVENTS, 2945504c3a3SMarcel Holtmann HCI_MGMT_OPTION_EVENTS, 2955504c3a3SMarcel Holtmann HCI_MGMT_SETTING_EVENTS, 2965504c3a3SMarcel Holtmann HCI_MGMT_DEV_CLASS_EVENTS, 2975504c3a3SMarcel Holtmann HCI_MGMT_LOCAL_NAME_EVENTS, 29872000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 299a10c907cSMarcel Holtmann HCI_MGMT_EXP_FEATURE_EVENTS, 300f9207338SMarcel Holtmann }; 301f9207338SMarcel Holtmann 302d23264a8SAndre Guedes /* 303d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 304d23264a8SAndre Guedes * states from the controller. 305d23264a8SAndre Guedes */ 306d23264a8SAndre Guedes enum { 307a8b2d5c2SJohan Hedberg HCI_SETUP, 308d603b76bSMarcel Holtmann HCI_CONFIG, 309a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 3105e130367SJohan Hedberg HCI_RFKILLED, 311a8b2d5c2SJohan Hedberg HCI_MGMT, 312b6ae8457SJohan Hedberg HCI_BONDABLE, 313a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 3140663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 3153769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 31694324962SJohan Hovold HCI_UNREGISTER, 3174a964404SMarcel Holtmann HCI_UNCONFIGURED, 3180736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 319dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 32066c417c1SJohan Hedberg HCI_LE_ADV, 321d23264a8SAndre Guedes HCI_LE_SCAN, 32284bde9d6SJohan Hedberg HCI_SSP_ENABLED, 323e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 324134c2a89SMarcel Holtmann HCI_SC_ONLY, 325863efaf2SJohan Hedberg HCI_PRIVACY, 32682a37adeSJohan Hedberg HCI_LIMITED_PRIVACY, 327d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 32841edf160SJohan Hedberg HCI_RPA_RESOLVING, 3296d80dfd0SJohan Hedberg HCI_HS_ENABLED, 33006199cf8SJohan Hedberg HCI_LE_ENABLED, 331f3d3444aSJohan Hedberg HCI_ADVERTISING, 332cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 3335e5282bbSJohan Hedberg HCI_CONNECTABLE, 3345e5282bbSJohan Hedberg HCI_DISCOVERABLE, 3356acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 33647990ea0SJohan Hedberg HCI_LINK_SECURITY, 33721693c15SAndre Guedes HCI_PERIODIC_INQ, 3381a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 33956f87901SJohan Hedberg HCI_BREDR_ENABLED, 34081ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 34100bce3fbSAlain Michaud HCI_WIDEBAND_SPEECH_ENABLED, 342e5b0ad69SAbhishek Pandit-Subedi HCI_EVENT_FILTER_CONFIGURED, 343b7cb93e5SMarcel Holtmann 344b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 3454b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 346b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 347b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 348aa12af77SAnkit Navik HCI_LL_RPA_RESOLUTION, 349cbbdfa6fSSathish Narasimman HCI_ENABLE_LL_PRIVACY, 350f80c5dadSJoão Paulo Rechi Vita HCI_CMD_PENDING, 351c2aa30dbSArchie Pusaka HCI_FORCE_NO_MITM, 352ae7d925bSJoseph Hwang HCI_QUALITY_REPORT, 353248733e8SKiran K HCI_OFFLOAD_CODECS_ENABLED, 35476d0685bSLuiz Augusto von Dentz HCI_LE_SIMULTANEOUS_ROLES, 355b7cb93e5SMarcel Holtmann 356eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 357d23264a8SAndre Guedes }; 358d23264a8SAndre Guedes 3591da177e4SLinus Torvalds /* HCI timeouts */ 3605f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 3615f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 3625f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 363d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 364de75cd0dSManish Mandlik #define HCI_NCMD_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3655f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 3669345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 367a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 3689489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 3691f01d8beSKonrad Zapałowicz #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(4000) /* 4 seconds */ 3701da177e4SLinus Torvalds 3715b7f9909SMarcel Holtmann /* HCI data types */ 3721da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 3731da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 3741da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 3751da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 3764de0fc59SLuiz Augusto von Dentz #define HCI_ISODATA_PKT 0x05 377e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 3781da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 3791da177e4SLinus Torvalds 3805b7f9909SMarcel Holtmann /* HCI packet types */ 3811da177e4SLinus Torvalds #define HCI_DM1 0x0008 3821da177e4SLinus Torvalds #define HCI_DM3 0x0400 3831da177e4SLinus Torvalds #define HCI_DM5 0x4000 3841da177e4SLinus Torvalds #define HCI_DH1 0x0010 3851da177e4SLinus Torvalds #define HCI_DH3 0x0800 3861da177e4SLinus Torvalds #define HCI_DH5 0x8000 3871da177e4SLinus Torvalds 3885075b972SJaganath Kanakkassery /* HCI packet types inverted masks */ 3895075b972SJaganath Kanakkassery #define HCI_2DH1 0x0002 3905075b972SJaganath Kanakkassery #define HCI_3DH1 0x0004 3915075b972SJaganath Kanakkassery #define HCI_2DH3 0x0100 3925075b972SJaganath Kanakkassery #define HCI_3DH3 0x0200 3935075b972SJaganath Kanakkassery #define HCI_2DH5 0x1000 3945075b972SJaganath Kanakkassery #define HCI_3DH5 0x2000 3955075b972SJaganath Kanakkassery 3961da177e4SLinus Torvalds #define HCI_HV1 0x0020 3971da177e4SLinus Torvalds #define HCI_HV2 0x0040 3981da177e4SLinus Torvalds #define HCI_HV3 0x0080 3991da177e4SLinus Torvalds 4001da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 4011da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 4021da177e4SLinus Torvalds 4035b7f9909SMarcel Holtmann /* eSCO packet types */ 4045b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 4055b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 4065b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 4075b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 4085b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 4095b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 410efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 411efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 412efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 413efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 4145b7f9909SMarcel Holtmann 415a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 416efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 417a8746417SMarcel Holtmann 4181da177e4SLinus Torvalds /* ACL flags */ 419e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 4201da177e4SLinus Torvalds #define ACL_CONT 0x01 4211da177e4SLinus Torvalds #define ACL_START 0x02 422d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 4231da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 4241da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 4251da177e4SLinus Torvalds 4264de0fc59SLuiz Augusto von Dentz /* ISO PB flags */ 4274de0fc59SLuiz Augusto von Dentz #define ISO_START 0x00 4284de0fc59SLuiz Augusto von Dentz #define ISO_CONT 0x01 4294de0fc59SLuiz Augusto von Dentz #define ISO_SINGLE 0x02 4304de0fc59SLuiz Augusto von Dentz #define ISO_END 0x03 4314de0fc59SLuiz Augusto von Dentz 4324de0fc59SLuiz Augusto von Dentz /* ISO TS flags */ 4334de0fc59SLuiz Augusto von Dentz #define ISO_TS 0x01 4344de0fc59SLuiz Augusto von Dentz 4351da177e4SLinus Torvalds /* Baseband links */ 4361da177e4SLinus Torvalds #define SCO_LINK 0x00 4371da177e4SLinus Torvalds #define ACL_LINK 0x01 4385b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 439fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 440fcd89c09SVille Tervo #define LE_LINK 0x80 4413161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 4424de0fc59SLuiz Augusto von Dentz #define ISO_LINK 0x82 443845472e8SMarcel Holtmann #define INVALID_LINK 0xff 4441da177e4SLinus Torvalds 4451da177e4SLinus Torvalds /* LMP features */ 4461da177e4SLinus Torvalds #define LMP_3SLOT 0x01 4471da177e4SLinus Torvalds #define LMP_5SLOT 0x02 4481da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 4491da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 4501da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 4511da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 4521da177e4SLinus Torvalds #define LMP_HOLD 0x40 45304837f64SMarcel Holtmann #define LMP_SNIFF 0x80 4541da177e4SLinus Torvalds 4551da177e4SLinus Torvalds #define LMP_PARK 0x01 4561da177e4SLinus Torvalds #define LMP_RSSI 0x02 4571da177e4SLinus Torvalds #define LMP_QUALITY 0x04 4581da177e4SLinus Torvalds #define LMP_SCO 0x08 4591da177e4SLinus Torvalds #define LMP_HV2 0x10 4601da177e4SLinus Torvalds #define LMP_HV3 0x20 4611da177e4SLinus Torvalds #define LMP_ULAW 0x40 4621da177e4SLinus Torvalds #define LMP_ALAW 0x80 4631da177e4SLinus Torvalds 4641da177e4SLinus Torvalds #define LMP_CVSD 0x01 4651da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 4661da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 46707a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 4681da177e4SLinus Torvalds 4695075b972SJaganath Kanakkassery #define LMP_EDR_2M 0x02 4705075b972SJaganath Kanakkassery #define LMP_EDR_3M 0x04 471d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 4725b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 4735b7f9909SMarcel Holtmann 4745b7f9909SMarcel Holtmann #define LMP_EV4 0x01 4755b7f9909SMarcel Holtmann #define LMP_EV5 0x02 47669ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 477d5859e22SJohan Hedberg #define LMP_LE 0x40 4785075b972SJaganath Kanakkassery #define LMP_EDR_3SLOT 0x80 4795b7f9909SMarcel Holtmann 4805075b972SJaganath Kanakkassery #define LMP_EDR_5SLOT 0x01 48104837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 482d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 483efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 484efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 485efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 48604837f64SMarcel Holtmann 487d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 488e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 489769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 490e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 491769be974SMarcel Holtmann 492d5859e22SJohan Hedberg #define LMP_LSTO 0x01 493d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 494971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 495d5859e22SJohan Hedberg 496eead27daSAndre Guedes /* Extended LMP features */ 4976397729bSArchie Pusaka #define LMP_CPB_CENTRAL 0x01 4986397729bSArchie Pusaka #define LMP_CPB_PERIPHERAL 0x02 49953b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 50053b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 50153b834d2SMarcel Holtmann 502d5991585SMarcel Holtmann #define LMP_SC 0x01 503d5991585SMarcel Holtmann #define LMP_PING 0x02 504d5991585SMarcel Holtmann 50553b834d2SMarcel Holtmann /* Host features */ 506cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 507eead27daSAndre Guedes #define LMP_HOST_LE 0x02 508cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 509d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 510eead27daSAndre Guedes 511662bc2e6SAndre Guedes /* LE features */ 5120da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 513662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 514ef365da1SArchie Pusaka #define HCI_LE_PERIPHERAL_FEATURES 0x08 515cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 51694a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 517ff3b8df2SMarcel Holtmann #define HCI_LE_LL_PRIVACY 0x40 5184b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 5195075b972SJaganath Kanakkassery #define HCI_LE_PHY_2M 0x01 5205075b972SJaganath Kanakkassery #define HCI_LE_PHY_CODED 0x08 52155beec10SMarcel Holtmann #define HCI_LE_EXT_ADV 0x10 5229756d33bSMarcel Holtmann #define HCI_LE_CHAN_SEL_ALG2 0x40 523ef365da1SArchie Pusaka #define HCI_LE_CIS_CENTRAL 0x10 524ef365da1SArchie Pusaka #define HCI_LE_CIS_PERIPHERAL 0x20 525662bc2e6SAndre Guedes 52604837f64SMarcel Holtmann /* Connection modes */ 52704837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 52804837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 52904837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 53004837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 53104837f64SMarcel Holtmann 5321da177e4SLinus Torvalds /* Link policies */ 5331da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 5341da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 5351da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 5361da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 5371da177e4SLinus Torvalds 53804837f64SMarcel Holtmann /* Link modes */ 5391da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 5401da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 5411da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 5421da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 5431da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 5441da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 5451da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 5467b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 5471da177e4SLinus Torvalds 54840be492fSMarcel Holtmann /* Authentication types */ 54940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 55040be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 55140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 55240be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 55340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 55440be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 55540be492fSMarcel Holtmann 556a77b15a6SMikel Astiz /* I/O capabilities */ 557a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 558a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 559a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 560a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 561a77b15a6SMikel Astiz 562b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 563b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 564b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 565b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 566b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 56711015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 56811015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 569b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 57011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 57111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 572b6020ba0SWaldemar Rymarkiewicz 5739f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 5748e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 5759f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 576160b9251SSzymon Janc #define HCI_ERROR_PIN_OR_KEY_MISSING 0x06 5772acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 578cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 579d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 5809f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 5819f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 582cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 583cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 5849f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 5859f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 5864ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 5874ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 5883c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 5890f281a5eSArchie Pusaka #define HCI_ERROR_CANCELLED_BY_HOST 0x44 5909f5a0d7bSAndrei Emeltchenko 5912455a3eaSAndrei Emeltchenko /* Flow control modes */ 5922455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 5932455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 5942455a3eaSAndrei Emeltchenko 595bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 596bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 597a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 598bbaf444aSJohan Hedberg 599ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 600ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 601ba165a90SJohan Hedberg 60232748db0SJohan Hedberg /* Extended Inquiry Response field types */ 60332748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 60432748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 60532748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 60632748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 60732748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 60832748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 60932748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 61032748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 61132748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 61232748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 6139ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 614d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 615d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 61632748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 6174453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 6181471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 6191471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 620d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 621d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 622f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 623f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 62432748db0SJohan Hedberg 6253f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 6263f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 6273f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 6283f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 6293f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 6303f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 6313f0f524bSJohan Hedberg 6321da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 6336bd32326SVille Tervo #define HCI_OP_NOP 0x0000 6346bd32326SVille Tervo 635a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 636a9de9248SMarcel Holtmann struct hci_cp_inquiry { 637a9de9248SMarcel Holtmann __u8 lap[3]; 638a9de9248SMarcel Holtmann __u8 length; 639a9de9248SMarcel Holtmann __u8 num_rsp; 64066c853ccSGustavo F. Padovan } __packed; 6411da177e4SLinus Torvalds 642a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 643a9de9248SMarcel Holtmann 64479d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 64579d6e068SAndre Guedes 646a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 647a9de9248SMarcel Holtmann 648a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 649a9de9248SMarcel Holtmann struct hci_cp_create_conn { 650a9de9248SMarcel Holtmann bdaddr_t bdaddr; 651a9de9248SMarcel Holtmann __le16 pkt_type; 652a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 653a9de9248SMarcel Holtmann __u8 pscan_mode; 654a9de9248SMarcel Holtmann __le16 clock_offset; 655a9de9248SMarcel Holtmann __u8 role_switch; 65666c853ccSGustavo F. Padovan } __packed; 6571da177e4SLinus Torvalds 658a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 659a9de9248SMarcel Holtmann struct hci_cp_disconnect { 660a9de9248SMarcel Holtmann __le16 handle; 661a9de9248SMarcel Holtmann __u8 reason; 66266c853ccSGustavo F. Padovan } __packed; 6631da177e4SLinus Torvalds 664a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 665a9de9248SMarcel Holtmann struct hci_cp_add_sco { 666a9de9248SMarcel Holtmann __le16 handle; 667a9de9248SMarcel Holtmann __le16 pkt_type; 66866c853ccSGustavo F. Padovan } __packed; 669a9de9248SMarcel Holtmann 670a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 671a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 6721da177e4SLinus Torvalds bdaddr_t bdaddr; 67366c853ccSGustavo F. Padovan } __packed; 6741da177e4SLinus Torvalds 675a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 676a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 677a9de9248SMarcel Holtmann bdaddr_t bdaddr; 678a9de9248SMarcel Holtmann __u8 role; 67966c853ccSGustavo F. Padovan } __packed; 6801da177e4SLinus Torvalds 681a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 682a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 683a9de9248SMarcel Holtmann bdaddr_t bdaddr; 684a9de9248SMarcel Holtmann __u8 reason; 68566c853ccSGustavo F. Padovan } __packed; 6861da177e4SLinus Torvalds 687a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 688a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 689a9de9248SMarcel Holtmann bdaddr_t bdaddr; 6909b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 69166c853ccSGustavo F. Padovan } __packed; 6921da177e4SLinus Torvalds 693a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 694a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 695a9de9248SMarcel Holtmann bdaddr_t bdaddr; 69666c853ccSGustavo F. Padovan } __packed; 6971da177e4SLinus Torvalds 698a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 699a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 700a9de9248SMarcel Holtmann bdaddr_t bdaddr; 701a9de9248SMarcel Holtmann __u8 pin_len; 702a9de9248SMarcel Holtmann __u8 pin_code[16]; 70366c853ccSGustavo F. Padovan } __packed; 704980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 705980e1a53SJohan Hedberg __u8 status; 706980e1a53SJohan Hedberg bdaddr_t bdaddr; 707980e1a53SJohan Hedberg } __packed; 708a9de9248SMarcel Holtmann 709a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 710a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 711a9de9248SMarcel Holtmann bdaddr_t bdaddr; 71266c853ccSGustavo F. Padovan } __packed; 713980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 714980e1a53SJohan Hedberg __u8 status; 715980e1a53SJohan Hedberg bdaddr_t bdaddr; 716980e1a53SJohan Hedberg } __packed; 717a9de9248SMarcel Holtmann 718a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 719a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 720a9de9248SMarcel Holtmann __le16 handle; 721a9de9248SMarcel Holtmann __le16 pkt_type; 72266c853ccSGustavo F. Padovan } __packed; 723a9de9248SMarcel Holtmann 724a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 725a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 726a9de9248SMarcel Holtmann __le16 handle; 72766c853ccSGustavo F. Padovan } __packed; 728a9de9248SMarcel Holtmann 729a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 730a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 731a9de9248SMarcel Holtmann __le16 handle; 732a9de9248SMarcel Holtmann __u8 encrypt; 73366c853ccSGustavo F. Padovan } __packed; 734a9de9248SMarcel Holtmann 735a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 736a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 737a9de9248SMarcel Holtmann __le16 handle; 73866c853ccSGustavo F. Padovan } __packed; 739a9de9248SMarcel Holtmann 740a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 741a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 742a9de9248SMarcel Holtmann bdaddr_t bdaddr; 743a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 744a9de9248SMarcel Holtmann __u8 pscan_mode; 745a9de9248SMarcel Holtmann __le16 clock_offset; 74666c853ccSGustavo F. Padovan } __packed; 747a9de9248SMarcel Holtmann 748a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 749a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 750a9de9248SMarcel Holtmann bdaddr_t bdaddr; 75166c853ccSGustavo F. Padovan } __packed; 752a9de9248SMarcel Holtmann 753a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 754a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 755a9de9248SMarcel Holtmann __le16 handle; 75666c853ccSGustavo F. Padovan } __packed; 757a9de9248SMarcel Holtmann 758a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 759a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 760a9de9248SMarcel Holtmann __le16 handle; 761a9de9248SMarcel Holtmann __u8 page; 76266c853ccSGustavo F. Padovan } __packed; 763a9de9248SMarcel Holtmann 764a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 765a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 766a9de9248SMarcel Holtmann __le16 handle; 76766c853ccSGustavo F. Padovan } __packed; 768a9de9248SMarcel Holtmann 769df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 770df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 771df935429SMarcel Holtmann __le16 handle; 772df935429SMarcel Holtmann } __packed; 773df935429SMarcel Holtmann 774a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 775a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 776a9de9248SMarcel Holtmann __le16 handle; 777a9de9248SMarcel Holtmann __le32 tx_bandwidth; 778a9de9248SMarcel Holtmann __le32 rx_bandwidth; 779a9de9248SMarcel Holtmann __le16 max_latency; 780a9de9248SMarcel Holtmann __le16 voice_setting; 781a9de9248SMarcel Holtmann __u8 retrans_effort; 782a9de9248SMarcel Holtmann __le16 pkt_type; 78366c853ccSGustavo F. Padovan } __packed; 784a9de9248SMarcel Holtmann 785a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 786a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 787a9de9248SMarcel Holtmann bdaddr_t bdaddr; 788a9de9248SMarcel Holtmann __le32 tx_bandwidth; 789a9de9248SMarcel Holtmann __le32 rx_bandwidth; 790a9de9248SMarcel Holtmann __le16 max_latency; 791a9de9248SMarcel Holtmann __le16 content_format; 792a9de9248SMarcel Holtmann __u8 retrans_effort; 793a9de9248SMarcel Holtmann __le16 pkt_type; 79466c853ccSGustavo F. Padovan } __packed; 795a9de9248SMarcel Holtmann 796a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 797a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 798a9de9248SMarcel Holtmann bdaddr_t bdaddr; 799a9de9248SMarcel Holtmann __u8 reason; 80066c853ccSGustavo F. Padovan } __packed; 801a9de9248SMarcel Holtmann 80217fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 80317fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 80417fa4b9dSJohan Hedberg bdaddr_t bdaddr; 80517fa4b9dSJohan Hedberg __u8 capability; 80617fa4b9dSJohan Hedberg __u8 oob_data; 80717fa4b9dSJohan Hedberg __u8 authentication; 80817fa4b9dSJohan Hedberg } __packed; 80917fa4b9dSJohan Hedberg 810a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 811a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 812a5c29683SJohan Hedberg bdaddr_t bdaddr; 813a5c29683SJohan Hedberg } __packed; 814a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 815a5c29683SJohan Hedberg __u8 status; 816a5c29683SJohan Hedberg bdaddr_t bdaddr; 817a5c29683SJohan Hedberg } __packed; 818a5c29683SJohan Hedberg 819a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 820a5c29683SJohan Hedberg 8219ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 8229ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 8239ad4019aSBrian Gix bdaddr_t bdaddr; 8249ad4019aSBrian Gix __le32 passkey; 8259ad4019aSBrian Gix } __packed; 8269ad4019aSBrian Gix 8279ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 8289ad4019aSBrian Gix 8292763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 8302763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 8312763eda6SSzymon Janc bdaddr_t bdaddr; 8322763eda6SSzymon Janc __u8 hash[16]; 83338da1703SJohan Hedberg __u8 rand[16]; 8342763eda6SSzymon Janc } __packed; 8352763eda6SSzymon Janc 8362763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 8372763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 8382763eda6SSzymon Janc bdaddr_t bdaddr; 8392763eda6SSzymon Janc } __packed; 8402763eda6SSzymon Janc 84103b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 84203b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 84303b555e1SJohan Hedberg bdaddr_t bdaddr; 84403b555e1SJohan Hedberg __u8 reason; 84503b555e1SJohan Hedberg } __packed; 84603b555e1SJohan Hedberg 847523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 848523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 849523e93cdSAndrei Emeltchenko __u8 phy_handle; 850523e93cdSAndrei Emeltchenko __u8 key_len; 851523e93cdSAndrei Emeltchenko __u8 key_type; 852523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 853523e93cdSAndrei Emeltchenko } __packed; 854523e93cdSAndrei Emeltchenko 855523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 856523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 857523e93cdSAndrei Emeltchenko __u8 phy_handle; 858523e93cdSAndrei Emeltchenko __u8 key_len; 859523e93cdSAndrei Emeltchenko __u8 key_type; 860523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 861523e93cdSAndrei Emeltchenko } __packed; 862523e93cdSAndrei Emeltchenko 863523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 864523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 865523e93cdSAndrei Emeltchenko __u8 phy_handle; 866523e93cdSAndrei Emeltchenko __u8 reason; 867b078b564SAndrei Emeltchenko } __packed; 868b078b564SAndrei Emeltchenko 869b078b564SAndrei Emeltchenko struct ext_flow_spec { 870b078b564SAndrei Emeltchenko __u8 id; 871b078b564SAndrei Emeltchenko __u8 stype; 872b078b564SAndrei Emeltchenko __le16 msdu; 873b078b564SAndrei Emeltchenko __le32 sdu_itime; 874b078b564SAndrei Emeltchenko __le32 acc_lat; 875b078b564SAndrei Emeltchenko __le32 flush_to; 876b078b564SAndrei Emeltchenko } __packed; 877b078b564SAndrei Emeltchenko 878b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 879b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 880b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 881b078b564SAndrei Emeltchenko __u8 phy_handle; 882b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 883b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 884b078b564SAndrei Emeltchenko } __packed; 885b078b564SAndrei Emeltchenko 886b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 887b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 888b078b564SAndrei Emeltchenko __le16 log_handle; 889b078b564SAndrei Emeltchenko } __packed; 890b078b564SAndrei Emeltchenko 891b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 892b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 893b078b564SAndrei Emeltchenko __u8 phy_handle; 894b078b564SAndrei Emeltchenko __u8 flow_spec_id; 895b078b564SAndrei Emeltchenko } __packed; 896b078b564SAndrei Emeltchenko 897b2af264aSKiran K #define HCI_OP_ENHANCED_SETUP_SYNC_CONN 0x043d 898b2af264aSKiran K struct hci_coding_format { 899b2af264aSKiran K __u8 id; 900b2af264aSKiran K __le16 cid; 901b2af264aSKiran K __le16 vid; 902b2af264aSKiran K } __packed; 903b2af264aSKiran K 904b2af264aSKiran K struct hci_cp_enhanced_setup_sync_conn { 905b2af264aSKiran K __le16 handle; 906b2af264aSKiran K __le32 tx_bandwidth; 907b2af264aSKiran K __le32 rx_bandwidth; 908b2af264aSKiran K struct hci_coding_format tx_coding_format; 909b2af264aSKiran K struct hci_coding_format rx_coding_format; 910b2af264aSKiran K __le16 tx_codec_frame_size; 911b2af264aSKiran K __le16 rx_codec_frame_size; 912b2af264aSKiran K __le32 in_bandwidth; 913b2af264aSKiran K __le32 out_bandwidth; 914b2af264aSKiran K struct hci_coding_format in_coding_format; 915b2af264aSKiran K struct hci_coding_format out_coding_format; 916b2af264aSKiran K __le16 in_coded_data_size; 917b2af264aSKiran K __le16 out_coded_data_size; 918b2af264aSKiran K __u8 in_pcm_data_format; 919b2af264aSKiran K __u8 out_pcm_data_format; 920b2af264aSKiran K __u8 in_pcm_sample_payload_msb_pos; 921b2af264aSKiran K __u8 out_pcm_sample_payload_msb_pos; 922b2af264aSKiran K __u8 in_data_path; 923b2af264aSKiran K __u8 out_data_path; 924b2af264aSKiran K __u8 in_transport_unit_size; 925b2af264aSKiran K __u8 out_transport_unit_size; 926b2af264aSKiran K __le16 max_latency; 927b2af264aSKiran K __le16 pkt_type; 928b2af264aSKiran K __u8 retrans_effort; 929b2af264aSKiran K } __packed; 930b2af264aSKiran K 931b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 932b078b564SAndrei Emeltchenko __u8 status; 933b078b564SAndrei Emeltchenko __u8 phy_handle; 934b078b564SAndrei Emeltchenko __u8 flow_spec_id; 935523e93cdSAndrei Emeltchenko } __packed; 936523e93cdSAndrei Emeltchenko 9376397729bSArchie Pusaka #define HCI_OP_SET_CPB 0x0441 9386397729bSArchie Pusaka struct hci_cp_set_cpb { 9398c9a041bSDoHyun Pyun __u8 enable; 9408c9a041bSDoHyun Pyun __u8 lt_addr; 9418c9a041bSDoHyun Pyun __u8 lpo_allowed; 9428c9a041bSDoHyun Pyun __le16 packet_type; 9438c9a041bSDoHyun Pyun __le16 interval_min; 9448c9a041bSDoHyun Pyun __le16 interval_max; 9456397729bSArchie Pusaka __le16 cpb_sv_tout; 9468c9a041bSDoHyun Pyun } __packed; 9476397729bSArchie Pusaka struct hci_rp_set_cpb { 9488c9a041bSDoHyun Pyun __u8 status; 9498c9a041bSDoHyun Pyun __u8 lt_addr; 9508c9a041bSDoHyun Pyun __le16 interval; 9518c9a041bSDoHyun Pyun } __packed; 9528c9a041bSDoHyun Pyun 953cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 954cefded98SDoHyun Pyun 955e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 956e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 957e2f99131SMarcel Holtmann bdaddr_t bdaddr; 958e2f99131SMarcel Holtmann __u8 hash192[16]; 95938da1703SJohan Hedberg __u8 rand192[16]; 960e2f99131SMarcel Holtmann __u8 hash256[16]; 96138da1703SJohan Hedberg __u8 rand256[16]; 962e2f99131SMarcel Holtmann } __packed; 963e2f99131SMarcel Holtmann 964a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 965a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 966a9de9248SMarcel Holtmann __le16 handle; 967a9de9248SMarcel Holtmann __le16 max_interval; 968a9de9248SMarcel Holtmann __le16 min_interval; 969a9de9248SMarcel Holtmann __le16 attempt; 970a9de9248SMarcel Holtmann __le16 timeout; 97166c853ccSGustavo F. Padovan } __packed; 972a9de9248SMarcel Holtmann 973a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 974a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 975a9de9248SMarcel Holtmann __le16 handle; 97666c853ccSGustavo F. Padovan } __packed; 977a9de9248SMarcel Holtmann 978a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 979a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 980a9de9248SMarcel Holtmann __le16 handle; 98166c853ccSGustavo F. Padovan } __packed; 982a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 983a9de9248SMarcel Holtmann __u8 status; 984a9de9248SMarcel Holtmann __le16 handle; 985a9de9248SMarcel Holtmann __u8 role; 98666c853ccSGustavo F. Padovan } __packed; 987a9de9248SMarcel Holtmann 988a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 989a9de9248SMarcel Holtmann struct hci_cp_switch_role { 990a9de9248SMarcel Holtmann bdaddr_t bdaddr; 991a9de9248SMarcel Holtmann __u8 role; 99266c853ccSGustavo F. Padovan } __packed; 993a9de9248SMarcel Holtmann 994a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 995a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 996a9de9248SMarcel Holtmann __le16 handle; 99766c853ccSGustavo F. Padovan } __packed; 998a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 999a9de9248SMarcel Holtmann __u8 status; 1000a9de9248SMarcel Holtmann __le16 handle; 1001a9de9248SMarcel Holtmann __le16 policy; 100266c853ccSGustavo F. Padovan } __packed; 1003a9de9248SMarcel Holtmann 1004a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 1005a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 1006a9de9248SMarcel Holtmann __le16 handle; 1007a9de9248SMarcel Holtmann __le16 policy; 100866c853ccSGustavo F. Padovan } __packed; 1009a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 1010a9de9248SMarcel Holtmann __u8 status; 1011a9de9248SMarcel Holtmann __le16 handle; 101266c853ccSGustavo F. Padovan } __packed; 1013a9de9248SMarcel Holtmann 1014e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 1015e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 1016e4e8e37cSMarcel Holtmann __u8 status; 1017e4e8e37cSMarcel Holtmann __le16 policy; 101866c853ccSGustavo F. Padovan } __packed; 1019e4e8e37cSMarcel Holtmann 1020e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 1021e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 1022e4e8e37cSMarcel Holtmann __le16 policy; 102366c853ccSGustavo F. Padovan } __packed; 1024e4e8e37cSMarcel Holtmann 1025a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 1026a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 1027a9de9248SMarcel Holtmann __le16 handle; 1028a9de9248SMarcel Holtmann __le16 max_latency; 1029a9de9248SMarcel Holtmann __le16 min_remote_timeout; 1030a9de9248SMarcel Holtmann __le16 min_local_timeout; 103166c853ccSGustavo F. Padovan } __packed; 1032a9de9248SMarcel Holtmann 1033a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 1034a9de9248SMarcel Holtmann 1035a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 1036a9de9248SMarcel Holtmann 1037a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 10384f40afc6SAbhishek Pandit-Subedi #define HCI_SET_EVENT_FLT_SIZE 9 10394f40afc6SAbhishek Pandit-Subedi struct hci_cp_set_event_filter { 10401da177e4SLinus Torvalds __u8 flt_type; 10411da177e4SLinus Torvalds __u8 cond_type; 10424f40afc6SAbhishek Pandit-Subedi struct { 10434f40afc6SAbhishek Pandit-Subedi bdaddr_t bdaddr; 10444f40afc6SAbhishek Pandit-Subedi __u8 auto_accept; 10454f40afc6SAbhishek Pandit-Subedi } __packed addr_conn_flt; 104666c853ccSGustavo F. Padovan } __packed; 10471da177e4SLinus Torvalds 10481da177e4SLinus Torvalds /* Filter types */ 10491da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 10501da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 10511da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 10521da177e4SLinus Torvalds 10531da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 10541da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 10551da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 10561da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 10571da177e4SLinus Torvalds 10581da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 10591da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 10601da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 10614f40afc6SAbhishek Pandit-Subedi #define HCI_CONN_SETUP_AUTO_ON_WITH_RS 0x03 10621da177e4SLinus Torvalds 1063cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 1064cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 1065cb962780SMarcel Holtmann bdaddr_t bdaddr; 1066cb962780SMarcel Holtmann __u8 read_all; 1067cb962780SMarcel Holtmann } __packed; 1068cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 1069cb962780SMarcel Holtmann __u8 status; 1070e88422bcSLuiz Augusto von Dentz __le16 max_keys; 1071e88422bcSLuiz Augusto von Dentz __le16 num_keys; 1072cb962780SMarcel Holtmann } __packed; 1073cb962780SMarcel Holtmann 1074b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 1075b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 1076b0916ea0SJohan Hedberg bdaddr_t bdaddr; 1077b0916ea0SJohan Hedberg __u8 delete_all; 1078b0916ea0SJohan Hedberg } __packed; 1079039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 1080039d4e41SMarcel Holtmann __u8 status; 10817978656cSLuiz Augusto von Dentz __le16 num_keys; 1082039d4e41SMarcel Holtmann } __packed; 1083b0916ea0SJohan Hedberg 10841f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 10851f6c6378SJohan Hedberg 1086a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 1087a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 10881f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 108966c853ccSGustavo F. Padovan } __packed; 1090a9de9248SMarcel Holtmann 1091a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 1092a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 1093a9de9248SMarcel Holtmann __u8 status; 10941f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 109566c853ccSGustavo F. Padovan } __packed; 1096a9de9248SMarcel Holtmann 1097a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 1098a9de9248SMarcel Holtmann 1099a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 1100a9de9248SMarcel Holtmann 1101a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 1102a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 1103a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 1104a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 1105a9de9248SMarcel Holtmann 1106a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 1107a9de9248SMarcel Holtmann 1108a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 1109a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 1110a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 1111a9de9248SMarcel Holtmann 1112a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 1113a9de9248SMarcel Holtmann 1114a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 1115a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 1116a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 1117a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 1118a9de9248SMarcel Holtmann 1119a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 1120a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 11211da177e4SLinus Torvalds __u8 status; 11221da177e4SLinus Torvalds __u8 dev_class[3]; 112366c853ccSGustavo F. Padovan } __packed; 11241da177e4SLinus Torvalds 1125a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 1126a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 11271da177e4SLinus Torvalds __u8 dev_class[3]; 112866c853ccSGustavo F. Padovan } __packed; 11291da177e4SLinus Torvalds 1130a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 11311da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 11321da177e4SLinus Torvalds __u8 status; 11331ebb9252SMarcel Holtmann __le16 voice_setting; 113466c853ccSGustavo F. Padovan } __packed; 11351da177e4SLinus Torvalds 1136a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 11371da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 11381ebb9252SMarcel Holtmann __le16 voice_setting; 113966c853ccSGustavo F. Padovan } __packed; 11401da177e4SLinus Torvalds 1141a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 11421da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 11431ebb9252SMarcel Holtmann __le16 acl_mtu; 11441da177e4SLinus Torvalds __u8 sco_mtu; 11451ebb9252SMarcel Holtmann __le16 acl_max_pkt; 11461ebb9252SMarcel Holtmann __le16 sco_max_pkt; 114766c853ccSGustavo F. Padovan } __packed; 11481da177e4SLinus Torvalds 1149b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 1150b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 1151b4cb9fb2SMarcel Holtmann __u8 status; 1152b4cb9fb2SMarcel Holtmann __u8 num_iac; 1153b4cb9fb2SMarcel Holtmann } __packed; 1154b4cb9fb2SMarcel Holtmann 11554b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 11564b836f39SMarcel Holtmann 11573d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 11583d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 11593d505312SMarcel Holtmann __u8 num_iac; 11603d505312SMarcel Holtmann __u8 iac_lap[6]; 11613d505312SMarcel Holtmann } __packed; 11623d505312SMarcel Holtmann 1163d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 1164d5859e22SJohan Hedberg 116580a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 116680a1e1dbSJohan Hedberg 116780a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 116880a1e1dbSJohan Hedberg struct hci_cp_write_eir { 1169816a11d5SJohan Hedberg __u8 fec; 1170816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 117180a1e1dbSJohan Hedberg } __packed; 117280a1e1dbSJohan Hedberg 1173333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1174333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1175333140b5SMarcel Holtmann __u8 status; 1176333140b5SMarcel Holtmann __u8 mode; 117766c853ccSGustavo F. Padovan } __packed; 1178333140b5SMarcel Holtmann 1179333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1180333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1181333140b5SMarcel Holtmann __u8 mode; 118266c853ccSGustavo F. Padovan } __packed; 1183333140b5SMarcel Holtmann 1184c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1185c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1186c35938b2SSzymon Janc __u8 status; 1187c35938b2SSzymon Janc __u8 hash[16]; 118838da1703SJohan Hedberg __u8 rand[16]; 1189c35938b2SSzymon Janc } __packed; 1190c35938b2SSzymon Janc 1191d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 119291c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 119391c4e9b1SMarcel Holtmann __u8 status; 119491c4e9b1SMarcel Holtmann __s8 tx_power; 119591c4e9b1SMarcel Holtmann } __packed; 1196d5859e22SJohan Hedberg 119700bce3fbSAlain Michaud #define HCI_OP_READ_DEF_ERR_DATA_REPORTING 0x0c5a 119800bce3fbSAlain Michaud #define ERR_DATA_REPORTING_DISABLED 0x00 119900bce3fbSAlain Michaud #define ERR_DATA_REPORTING_ENABLED 0x01 120000bce3fbSAlain Michaud struct hci_rp_read_def_err_data_reporting { 120100bce3fbSAlain Michaud __u8 status; 120200bce3fbSAlain Michaud __u8 err_data_reporting; 120300bce3fbSAlain Michaud } __packed; 120400bce3fbSAlain Michaud 120500bce3fbSAlain Michaud #define HCI_OP_WRITE_DEF_ERR_DATA_REPORTING 0x0c5b 120600bce3fbSAlain Michaud struct hci_cp_write_def_err_data_reporting { 120700bce3fbSAlain Michaud __u8 err_data_reporting; 120800bce3fbSAlain Michaud } __packed; 120900bce3fbSAlain Michaud 1210d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1211d62e6d67SJohan Hedberg 12127528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 12137528ca1cSMarcel Holtmann 12141e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 12151e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 12161e89cffbSAndrei Emeltchenko __u8 status; 12171e89cffbSAndrei Emeltchenko __u8 mode; 12181e89cffbSAndrei Emeltchenko } __packed; 12191e89cffbSAndrei Emeltchenko 1220f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1221f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1222f9b49306SAndre Guedes __u8 le; 1223f9b49306SAndre Guedes __u8 simul; 1224f9b49306SAndre Guedes } __packed; 1225f9b49306SAndre Guedes 1226d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1227d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1228d0bf75a5SDoHyun Pyun __u8 lt_addr; 1229d0bf75a5SDoHyun Pyun } __packed; 1230d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1231d0bf75a5SDoHyun Pyun __u8 status; 1232d0bf75a5SDoHyun Pyun __u8 lt_addr; 1233d0bf75a5SDoHyun Pyun } __packed; 1234d0bf75a5SDoHyun Pyun 12356a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 12366a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 12376a20eaf4SDoHyun Pyun __u8 lt_addr; 12386a20eaf4SDoHyun Pyun } __packed; 12396a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 12406a20eaf4SDoHyun Pyun __u8 status; 12416a20eaf4SDoHyun Pyun __u8 lt_addr; 12426a20eaf4SDoHyun Pyun } __packed; 12436a20eaf4SDoHyun Pyun 12446397729bSArchie Pusaka #define HCI_OP_SET_CPB_DATA 0x0c76 12456397729bSArchie Pusaka struct hci_cp_set_cpb_data { 12467d1dab49SDoHyun Pyun __u8 lt_addr; 12477d1dab49SDoHyun Pyun __u8 fragment; 12487d1dab49SDoHyun Pyun __u8 data_length; 12496397729bSArchie Pusaka __u8 data[HCI_MAX_CPB_DATA_SIZE]; 12507d1dab49SDoHyun Pyun } __packed; 12516397729bSArchie Pusaka struct hci_rp_set_cpb_data { 12527d1dab49SDoHyun Pyun __u8 status; 12537d1dab49SDoHyun Pyun __u8 lt_addr; 12547d1dab49SDoHyun Pyun } __packed; 12557d1dab49SDoHyun Pyun 12565d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 12575d4e7e8dSJohan Hedberg 1258a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1259a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1260a9b07a64SDoHyun Pyun __le16 interval_min; 1261a9b07a64SDoHyun Pyun __le16 interval_max; 1262a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1263a9b07a64SDoHyun Pyun __u8 service_data; 1264a9b07a64SDoHyun Pyun } __packed; 1265a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1266a9b07a64SDoHyun Pyun __u8 status; 1267a9b07a64SDoHyun Pyun __le16 sync_train_int; 1268a9b07a64SDoHyun Pyun } __packed; 1269a9b07a64SDoHyun Pyun 1270eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1271eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1272eb4b95c6SMarcel Holtmann __u8 status; 1273eb4b95c6SMarcel Holtmann __u8 support; 1274eb4b95c6SMarcel Holtmann } __packed; 1275eb4b95c6SMarcel Holtmann 1276eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1277eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1278eb4b95c6SMarcel Holtmann __u8 support; 1279eb4b95c6SMarcel Holtmann } __packed; 1280eb4b95c6SMarcel Holtmann 1281302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_READ_AUTH_PAYLOAD_TO 0x0c7b 1282302975cbSSpoorthi Ravishankar Koppad struct hci_cp_read_auth_payload_to { 1283302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1284302975cbSSpoorthi Ravishankar Koppad } __packed; 1285302975cbSSpoorthi Ravishankar Koppad struct hci_rp_read_auth_payload_to { 1286302975cbSSpoorthi Ravishankar Koppad __u8 status; 1287302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1288302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1289302975cbSSpoorthi Ravishankar Koppad } __packed; 1290302975cbSSpoorthi Ravishankar Koppad 1291302975cbSSpoorthi Ravishankar Koppad #define HCI_OP_WRITE_AUTH_PAYLOAD_TO 0x0c7c 1292302975cbSSpoorthi Ravishankar Koppad struct hci_cp_write_auth_payload_to { 1293302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1294302975cbSSpoorthi Ravishankar Koppad __le16 timeout; 1295302975cbSSpoorthi Ravishankar Koppad } __packed; 1296302975cbSSpoorthi Ravishankar Koppad struct hci_rp_write_auth_payload_to { 1297302975cbSSpoorthi Ravishankar Koppad __u8 status; 1298302975cbSSpoorthi Ravishankar Koppad __le16 handle; 1299302975cbSSpoorthi Ravishankar Koppad } __packed; 1300302975cbSSpoorthi Ravishankar Koppad 1301e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1302e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1303e2f99131SMarcel Holtmann __u8 status; 1304e2f99131SMarcel Holtmann __u8 hash192[16]; 130538da1703SJohan Hedberg __u8 rand192[16]; 1306e2f99131SMarcel Holtmann __u8 hash256[16]; 130738da1703SJohan Hedberg __u8 rand256[16]; 1308e2f99131SMarcel Holtmann } __packed; 1309e2f99131SMarcel Holtmann 13109798fbdeSKiran K #define HCI_CONFIGURE_DATA_PATH 0x0c83 13119798fbdeSKiran K struct hci_op_configure_data_path { 13129798fbdeSKiran K __u8 direction; 13139798fbdeSKiran K __u8 data_path_id; 13149798fbdeSKiran K __u8 vnd_len; 13159798fbdeSKiran K __u8 vnd_data[]; 13169798fbdeSKiran K } __packed; 13179798fbdeSKiran K 1318a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1319a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 13201da177e4SLinus Torvalds __u8 status; 1321a9de9248SMarcel Holtmann __u8 hci_ver; 1322a9de9248SMarcel Holtmann __le16 hci_rev; 1323a9de9248SMarcel Holtmann __u8 lmp_ver; 1324a9de9248SMarcel Holtmann __le16 manufacturer; 1325a9de9248SMarcel Holtmann __le16 lmp_subver; 132666c853ccSGustavo F. Padovan } __packed; 13271da177e4SLinus Torvalds 1328a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1329a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 13301da177e4SLinus Torvalds __u8 status; 1331a9de9248SMarcel Holtmann __u8 commands[64]; 133266c853ccSGustavo F. Padovan } __packed; 13331da177e4SLinus Torvalds 1334a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1335a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1336a9de9248SMarcel Holtmann __u8 status; 1337a9de9248SMarcel Holtmann __u8 features[8]; 133866c853ccSGustavo F. Padovan } __packed; 1339a9de9248SMarcel Holtmann 1340a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1341971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1342971e3a4bSAndre Guedes __u8 page; 1343971e3a4bSAndre Guedes } __packed; 1344a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1345a9de9248SMarcel Holtmann __u8 status; 1346a9de9248SMarcel Holtmann __u8 page; 1347a9de9248SMarcel Holtmann __u8 max_page; 1348a9de9248SMarcel Holtmann __u8 features[8]; 134966c853ccSGustavo F. Padovan } __packed; 1350a9de9248SMarcel Holtmann 1351a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1352a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1353a9de9248SMarcel Holtmann __u8 status; 1354a9de9248SMarcel Holtmann __le16 acl_mtu; 1355a9de9248SMarcel Holtmann __u8 sco_mtu; 1356a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1357a9de9248SMarcel Holtmann __le16 sco_max_pkt; 135866c853ccSGustavo F. Padovan } __packed; 1359a9de9248SMarcel Holtmann 1360a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1361a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1362a9de9248SMarcel Holtmann __u8 status; 13631da177e4SLinus Torvalds bdaddr_t bdaddr; 136466c853ccSGustavo F. Padovan } __packed; 13651da177e4SLinus Torvalds 1366350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1367350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1368350ee4cfSAndrei Emeltchenko __u8 status; 1369350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1370350ee4cfSAndrei Emeltchenko __le16 block_len; 1371350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1372350ee4cfSAndrei Emeltchenko } __packed; 1373350ee4cfSAndrei Emeltchenko 1374109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 13758961987fSKiran K struct hci_std_codecs { 13768961987fSKiran K __u8 num; 13778961987fSKiran K __u8 codec[]; 13788961987fSKiran K } __packed; 13798961987fSKiran K 13808961987fSKiran K struct hci_vnd_codec { 13818961987fSKiran K /* company id */ 13828961987fSKiran K __le16 cid; 13838961987fSKiran K /* vendor codec id */ 13848961987fSKiran K __le16 vid; 13858961987fSKiran K } __packed; 13868961987fSKiran K 13878961987fSKiran K struct hci_vnd_codecs { 13888961987fSKiran K __u8 num; 13898961987fSKiran K struct hci_vnd_codec codec[]; 13908961987fSKiran K } __packed; 13918961987fSKiran K 13928961987fSKiran K struct hci_rp_read_local_supported_codecs { 13938961987fSKiran K __u8 status; 13948961987fSKiran K struct hci_std_codecs std_codecs; 13958961987fSKiran K struct hci_vnd_codecs vnd_codecs; 13968961987fSKiran K } __packed; 1397109e3191SMarcel Holtmann 1398a4790360SMarcel Holtmann #define HCI_OP_READ_LOCAL_PAIRING_OPTS 0x100c 1399a4790360SMarcel Holtmann struct hci_rp_read_local_pairing_opts { 1400a4790360SMarcel Holtmann __u8 status; 1401a4790360SMarcel Holtmann __u8 pairing_opts; 1402a4790360SMarcel Holtmann __u8 max_key_size; 1403a4790360SMarcel Holtmann } __packed; 1404a4790360SMarcel Holtmann 14059ae66402SKiran K #define HCI_OP_READ_LOCAL_CODECS_V2 0x100d 14069ae66402SKiran K struct hci_std_codec_v2 { 14079ae66402SKiran K __u8 id; 14089ae66402SKiran K __u8 transport; 14099ae66402SKiran K } __packed; 14109ae66402SKiran K 14119ae66402SKiran K struct hci_std_codecs_v2 { 14129ae66402SKiran K __u8 num; 14139ae66402SKiran K struct hci_std_codec_v2 codec[]; 14149ae66402SKiran K } __packed; 14159ae66402SKiran K 14169ae66402SKiran K struct hci_vnd_codec_v2 { 14179ae66402SKiran K __u8 id; 14189ae66402SKiran K __le16 cid; 14199ae66402SKiran K __le16 vid; 14209ae66402SKiran K __u8 transport; 14219ae66402SKiran K } __packed; 14229ae66402SKiran K 14239ae66402SKiran K struct hci_vnd_codecs_v2 { 14249ae66402SKiran K __u8 num; 14259ae66402SKiran K struct hci_vnd_codec_v2 codec[]; 14269ae66402SKiran K } __packed; 14279ae66402SKiran K 14289ae66402SKiran K struct hci_rp_read_local_supported_codecs_v2 { 14299ae66402SKiran K __u8 status; 14309ae66402SKiran K struct hci_std_codecs_v2 std_codecs; 14319ae66402SKiran K struct hci_vnd_codecs_v2 vendor_codecs; 14329ae66402SKiran K } __packed; 14339ae66402SKiran K 14348961987fSKiran K #define HCI_OP_READ_LOCAL_CODEC_CAPS 0x100e 14358961987fSKiran K struct hci_op_read_local_codec_caps { 14368961987fSKiran K __u8 id; 14378961987fSKiran K __le16 cid; 14388961987fSKiran K __le16 vid; 14398961987fSKiran K __u8 transport; 14408961987fSKiran K __u8 direction; 14418961987fSKiran K } __packed; 14428961987fSKiran K 14438961987fSKiran K struct hci_codec_caps { 14448961987fSKiran K __u8 len; 14458961987fSKiran K __u8 data[]; 14468961987fSKiran K } __packed; 14478961987fSKiran K 14488961987fSKiran K struct hci_rp_read_local_codec_caps { 14498961987fSKiran K __u8 status; 14508961987fSKiran K __u8 num_caps; 14518961987fSKiran K } __packed; 14528961987fSKiran K 1453f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1454f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1455f332ec66SJohan Hedberg __u8 status; 1456f332ec66SJohan Hedberg __le16 interval; 1457f332ec66SJohan Hedberg __le16 window; 1458f332ec66SJohan Hedberg } __packed; 1459f332ec66SJohan Hedberg 1460f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1461f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1462f6422ec6SAntti Julku __le16 interval; 1463f6422ec6SAntti Julku __le16 window; 1464f6422ec6SAntti Julku } __packed; 1465f6422ec6SAntti Julku 14665a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 14675a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 14685a134faeSAndrzej Kaczmarek __le16 handle; 14695a134faeSAndrzej Kaczmarek __u8 type; 14705a134faeSAndrzej Kaczmarek } __packed; 14715a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 14725a134faeSAndrzej Kaczmarek __u8 status; 14735a134faeSAndrzej Kaczmarek __le16 handle; 14745a134faeSAndrzej Kaczmarek __s8 tx_power; 14755a134faeSAndrzej Kaczmarek } __packed; 14765a134faeSAndrzej Kaczmarek 1477f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1478f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1479f332ec66SJohan Hedberg __u8 status; 1480f332ec66SJohan Hedberg __u8 type; 1481f332ec66SJohan Hedberg } __packed; 1482f332ec66SJohan Hedberg 1483f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1484f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1485f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1486f6422ec6SAntti Julku 14875ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 14885ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 14895ae76a94SAndrzej Kaczmarek __le16 handle; 14905ae76a94SAndrzej Kaczmarek } __packed; 14915ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 14925ae76a94SAndrzej Kaczmarek __u8 status; 14935ae76a94SAndrzej Kaczmarek __le16 handle; 14945ae76a94SAndrzej Kaczmarek __s8 rssi; 14955ae76a94SAndrzej Kaczmarek } __packed; 14965ae76a94SAndrzej Kaczmarek 149733f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 149833f35721SJohan Hedberg struct hci_cp_read_clock { 149933f35721SJohan Hedberg __le16 handle; 150033f35721SJohan Hedberg __u8 which; 150133f35721SJohan Hedberg } __packed; 150233f35721SJohan Hedberg struct hci_rp_read_clock { 150333f35721SJohan Hedberg __u8 status; 150433f35721SJohan Hedberg __le16 handle; 150533f35721SJohan Hedberg __le32 clock; 150633f35721SJohan Hedberg __le16 accuracy; 150733f35721SJohan Hedberg } __packed; 150833f35721SJohan Hedberg 1509821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1510821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1511821f3766SJohan Hedberg __le16 handle; 1512821f3766SJohan Hedberg } __packed; 1513821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1514821f3766SJohan Hedberg __u8 status; 1515821f3766SJohan Hedberg __le16 handle; 1516821f3766SJohan Hedberg __u8 key_size; 1517821f3766SJohan Hedberg } __packed; 1518821f3766SJohan Hedberg 1519928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1520928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1521928abaa7SAndrei Emeltchenko __u8 status; 1522928abaa7SAndrei Emeltchenko __u8 amp_status; 1523928abaa7SAndrei Emeltchenko __le32 total_bw; 1524928abaa7SAndrei Emeltchenko __le32 max_bw; 1525928abaa7SAndrei Emeltchenko __le32 min_latency; 1526928abaa7SAndrei Emeltchenko __le32 max_pdu; 1527928abaa7SAndrei Emeltchenko __u8 amp_type; 1528928abaa7SAndrei Emeltchenko __le16 pal_cap; 1529928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1530928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1531928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1532928abaa7SAndrei Emeltchenko } __packed; 1533928abaa7SAndrei Emeltchenko 1534523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1535523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1536523e93cdSAndrei Emeltchenko __u8 phy_handle; 1537523e93cdSAndrei Emeltchenko __le16 len_so_far; 1538523e93cdSAndrei Emeltchenko __le16 max_len; 1539523e93cdSAndrei Emeltchenko } __packed; 1540523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1541523e93cdSAndrei Emeltchenko __u8 status; 1542523e93cdSAndrei Emeltchenko __u8 phy_handle; 1543523e93cdSAndrei Emeltchenko __le16 rem_len; 1544a7e45454SGustavo A. R. Silva __u8 frag[]; 1545523e93cdSAndrei Emeltchenko } __packed; 1546523e93cdSAndrei Emeltchenko 1547523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1548523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1549523e93cdSAndrei Emeltchenko __u8 phy_handle; 1550523e93cdSAndrei Emeltchenko __le16 len_so_far; 1551523e93cdSAndrei Emeltchenko __le16 rem_len; 1552a7e45454SGustavo A. R. Silva __u8 frag[]; 1553523e93cdSAndrei Emeltchenko } __packed; 1554523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1555523e93cdSAndrei Emeltchenko __u8 status; 1556523e93cdSAndrei Emeltchenko __u8 phy_handle; 1557523e93cdSAndrei Emeltchenko } __packed; 1558523e93cdSAndrei Emeltchenko 1559f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1560f4fe73edSMarcel Holtmann 15614b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 15624b4148e9SMarcel Holtmann 156306f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 156406f5b778SMarcel Holtmann 156563185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 156663185f64SVille Tervo struct hci_cp_le_set_event_mask { 156763185f64SVille Tervo __u8 mask[8]; 156863185f64SVille Tervo } __packed; 156963185f64SVille Tervo 157063185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 157163185f64SVille Tervo struct hci_rp_le_read_buffer_size { 157263185f64SVille Tervo __u8 status; 157363185f64SVille Tervo __le16 le_mtu; 157463185f64SVille Tervo __u8 le_max_pkt; 157563185f64SVille Tervo } __packed; 157663185f64SVille Tervo 157760e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 157860e77321SJohan Hedberg struct hci_rp_le_read_local_features { 157960e77321SJohan Hedberg __u8 status; 158060e77321SJohan Hedberg __u8 features[8]; 158160e77321SJohan Hedberg } __packed; 158260e77321SJohan Hedberg 1583d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1584d13eafceSMarcel Holtmann 15851e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 15861e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 15871e191893SMarcel Holtmann __le16 min_interval; 15881e191893SMarcel Holtmann __le16 max_interval; 15891e191893SMarcel Holtmann __u8 type; 15901e191893SMarcel Holtmann __u8 own_address_type; 15911e191893SMarcel Holtmann __u8 direct_addr_type; 15921e191893SMarcel Holtmann bdaddr_t direct_addr; 15931e191893SMarcel Holtmann __u8 channel_map; 15941e191893SMarcel Holtmann __u8 filter_policy; 15951e191893SMarcel Holtmann } __packed; 15961e191893SMarcel Holtmann 15978fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 15988fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 15998fa19098SJohan Hedberg __u8 status; 16008fa19098SJohan Hedberg __s8 tx_power; 16018fa19098SJohan Hedberg } __packed; 16028fa19098SJohan Hedberg 16033f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 16043f0f524bSJohan Hedberg 16053f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 16063f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 16073f0f524bSJohan Hedberg __u8 length; 16083f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 16093f0f524bSJohan Hedberg } __packed; 16103f0f524bSJohan Hedberg 1611f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1612f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1613f14d8f64SMarcel Holtmann __u8 length; 1614f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1615f14d8f64SMarcel Holtmann } __packed; 1616f14d8f64SMarcel Holtmann 1617c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1618c1d5dc4aSJohan Hedberg 16195df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 16205df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 16215df480b5SAndre Guedes 162207f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 162307f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 162407f7fa5dSAndre Guedes __u8 type; 162507f7fa5dSAndre Guedes __le16 interval; 162607f7fa5dSAndre Guedes __le16 window; 162707f7fa5dSAndre Guedes __u8 own_address_type; 162807f7fa5dSAndre Guedes __u8 filter_policy; 162907f7fa5dSAndre Guedes } __packed; 163007f7fa5dSAndre Guedes 163176a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 163276a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1633525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1634525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 163568a8aea4SAndrei Emeltchenko 1636eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1637eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1638eb9d91f5SAndre Guedes __u8 enable; 1639eb9d91f5SAndre Guedes __u8 filter_dup; 1640eb9d91f5SAndre Guedes } __packed; 1641eb9d91f5SAndre Guedes 1642a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 16433d4f9c00SArchie Pusaka #define HCI_LE_USE_ACCEPT_LIST 0x01 1644a7139eddSJohan Hedberg 164563185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 164663185f64SVille Tervo struct hci_cp_le_create_conn { 164763185f64SVille Tervo __le16 scan_interval; 164863185f64SVille Tervo __le16 scan_window; 164963185f64SVille Tervo __u8 filter_policy; 165063185f64SVille Tervo __u8 peer_addr_type; 165163185f64SVille Tervo bdaddr_t peer_addr; 165263185f64SVille Tervo __u8 own_address_type; 165363185f64SVille Tervo __le16 conn_interval_min; 165463185f64SVille Tervo __le16 conn_interval_max; 165563185f64SVille Tervo __le16 conn_latency; 165663185f64SVille Tervo __le16 supervision_timeout; 165763185f64SVille Tervo __le16 min_ce_len; 165863185f64SVille Tervo __le16 max_ce_len; 165963185f64SVille Tervo } __packed; 166063185f64SVille Tervo 166163185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 166263185f64SVille Tervo 16633d4f9c00SArchie Pusaka #define HCI_OP_LE_READ_ACCEPT_LIST_SIZE 0x200f 16643d4f9c00SArchie Pusaka struct hci_rp_le_read_accept_list_size { 1665cf1d081fSJohan Hedberg __u8 status; 1666cf1d081fSJohan Hedberg __u8 size; 1667cf1d081fSJohan Hedberg } __packed; 1668cf1d081fSJohan Hedberg 16693d4f9c00SArchie Pusaka #define HCI_OP_LE_CLEAR_ACCEPT_LIST 0x2010 1670d9a7b0a5SMarcel Holtmann 16713d4f9c00SArchie Pusaka #define HCI_OP_LE_ADD_TO_ACCEPT_LIST 0x2011 16723d4f9c00SArchie Pusaka struct hci_cp_le_add_to_accept_list { 1673d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1674d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1675d9a7b0a5SMarcel Holtmann } __packed; 1676d9a7b0a5SMarcel Holtmann 16773d4f9c00SArchie Pusaka #define HCI_OP_LE_DEL_FROM_ACCEPT_LIST 0x2012 16783d4f9c00SArchie Pusaka struct hci_cp_le_del_from_accept_list { 1679d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1680d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1681d9a7b0a5SMarcel Holtmann } __packed; 1682d9a7b0a5SMarcel Holtmann 16832ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 16842ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 16852ce603ebSClaudio Takahasi __le16 handle; 16862ce603ebSClaudio Takahasi __le16 conn_interval_min; 16872ce603ebSClaudio Takahasi __le16 conn_interval_max; 16882ce603ebSClaudio Takahasi __le16 conn_latency; 16892ce603ebSClaudio Takahasi __le16 supervision_timeout; 16902ce603ebSClaudio Takahasi __le16 min_ce_len; 16912ce603ebSClaudio Takahasi __le16 max_ce_len; 16922ce603ebSClaudio Takahasi } __packed; 16932ce603ebSClaudio Takahasi 16940fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 16950fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 16960fe29fd1SMarcel Holtmann __le16 handle; 16970fe29fd1SMarcel Holtmann } __packed; 16980fe29fd1SMarcel Holtmann 1699a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1700a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1701a7a595f6SVinicius Costa Gomes __le16 handle; 1702fe39c7b2SMarcel Holtmann __le64 rand; 1703a7a595f6SVinicius Costa Gomes __le16 ediv; 1704a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1705a7a595f6SVinicius Costa Gomes } __packed; 1706a7a595f6SVinicius Costa Gomes 1707a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1708a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1709a7a595f6SVinicius Costa Gomes __le16 handle; 1710a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1711a7a595f6SVinicius Costa Gomes } __packed; 1712a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1713a7a595f6SVinicius Costa Gomes __u8 status; 1714a7a595f6SVinicius Costa Gomes __le16 handle; 1715a7a595f6SVinicius Costa Gomes } __packed; 1716a7a595f6SVinicius Costa Gomes 1717a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1718a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1719a7a595f6SVinicius Costa Gomes __le16 handle; 1720a7a595f6SVinicius Costa Gomes } __packed; 1721a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1722a7a595f6SVinicius Costa Gomes __u8 status; 1723a7a595f6SVinicius Costa Gomes __le16 handle; 1724a7a595f6SVinicius Costa Gomes } __packed; 1725a7a595f6SVinicius Costa Gomes 17269b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 17279b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 17289b008c04SJohan Hedberg __u8 status; 17299b008c04SJohan Hedberg __u8 le_states[8]; 17309b008c04SJohan Hedberg } __packed; 17319b008c04SJohan Hedberg 17328e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 17338e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 17348e75b46aSAndre Guedes __le16 handle; 17358e75b46aSAndre Guedes __le16 interval_min; 17368e75b46aSAndre Guedes __le16 interval_max; 17378e75b46aSAndre Guedes __le16 latency; 17388e75b46aSAndre Guedes __le16 timeout; 17398e75b46aSAndre Guedes __le16 min_ce_len; 17408e75b46aSAndre Guedes __le16 max_ce_len; 17418e75b46aSAndre Guedes } __packed; 17428e75b46aSAndre Guedes 17438e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 17448e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 17458e75b46aSAndre Guedes __le16 handle; 17468e75b46aSAndre Guedes __u8 reason; 17478e75b46aSAndre Guedes } __packed; 17488e75b46aSAndre Guedes 174994a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 175094a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 175194a3bd02SMarcel Holtmann __le16 handle; 175294a3bd02SMarcel Holtmann __le16 tx_len; 175394a3bd02SMarcel Holtmann __le16 tx_time; 175494a3bd02SMarcel Holtmann } __packed; 175594a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 175694a3bd02SMarcel Holtmann __u8 status; 175794a3bd02SMarcel Holtmann __le16 handle; 175894a3bd02SMarcel Holtmann } __packed; 175994a3bd02SMarcel Holtmann 176094a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 176194a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 176294a3bd02SMarcel Holtmann __u8 status; 176394a3bd02SMarcel Holtmann __le16 tx_len; 176494a3bd02SMarcel Holtmann __le16 tx_time; 176594a3bd02SMarcel Holtmann } __packed; 176694a3bd02SMarcel Holtmann 176794a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 176894a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 176994a3bd02SMarcel Holtmann __le16 tx_len; 177094a3bd02SMarcel Holtmann __le16 tx_time; 177194a3bd02SMarcel Holtmann } __packed; 177294a3bd02SMarcel Holtmann 1773b950aa88SAnkit Navik #define HCI_OP_LE_ADD_TO_RESOLV_LIST 0x2027 1774b950aa88SAnkit Navik struct hci_cp_le_add_to_resolv_list { 1775b950aa88SAnkit Navik __u8 bdaddr_type; 1776b950aa88SAnkit Navik bdaddr_t bdaddr; 1777b950aa88SAnkit Navik __u8 peer_irk[16]; 1778b950aa88SAnkit Navik __u8 local_irk[16]; 1779b950aa88SAnkit Navik } __packed; 1780b950aa88SAnkit Navik 1781b950aa88SAnkit Navik #define HCI_OP_LE_DEL_FROM_RESOLV_LIST 0x2028 1782b950aa88SAnkit Navik struct hci_cp_le_del_from_resolv_list { 1783b950aa88SAnkit Navik __u8 bdaddr_type; 1784b950aa88SAnkit Navik bdaddr_t bdaddr; 1785b950aa88SAnkit Navik } __packed; 1786b950aa88SAnkit Navik 1787545f2596SAnkit Navik #define HCI_OP_LE_CLEAR_RESOLV_LIST 0x2029 1788545f2596SAnkit Navik 1789cfdb0c2dSAnkit Navik #define HCI_OP_LE_READ_RESOLV_LIST_SIZE 0x202a 1790cfdb0c2dSAnkit Navik struct hci_rp_le_read_resolv_list_size { 1791cfdb0c2dSAnkit Navik __u8 status; 1792cfdb0c2dSAnkit Navik __u8 size; 1793cfdb0c2dSAnkit Navik } __packed; 1794cfdb0c2dSAnkit Navik 1795aa12af77SAnkit Navik #define HCI_OP_LE_SET_ADDR_RESOLV_ENABLE 0x202d 1796aa12af77SAnkit Navik 1797b2cc2339SSathish Narasimman #define HCI_OP_LE_SET_RPA_TIMEOUT 0x202e 1798b2cc2339SSathish Narasimman 179994a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 180094a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 180194a3bd02SMarcel Holtmann __u8 status; 180294a3bd02SMarcel Holtmann __le16 tx_len; 180394a3bd02SMarcel Holtmann __le16 tx_time; 180494a3bd02SMarcel Holtmann __le16 rx_len; 180594a3bd02SMarcel Holtmann __le16 rx_time; 180694a3bd02SMarcel Holtmann } __packed; 180794a3bd02SMarcel Holtmann 1808de2ba303SMarcel Holtmann #define HCI_OP_LE_SET_DEFAULT_PHY 0x2031 1809de2ba303SMarcel Holtmann struct hci_cp_le_set_default_phy { 1810de2ba303SMarcel Holtmann __u8 all_phys; 1811de2ba303SMarcel Holtmann __u8 tx_phys; 1812de2ba303SMarcel Holtmann __u8 rx_phys; 1813de2ba303SMarcel Holtmann } __packed; 1814de2ba303SMarcel Holtmann 18156decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_1M 0x01 18166decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_2M 0x02 18176decb5b4SJaganath Kanakkassery #define HCI_LE_SET_PHY_CODED 0x04 18186decb5b4SJaganath Kanakkassery 1819a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_PARAMS 0x2041 1820a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_params { 1821a2344b9eSJaganath Kanakkassery __u8 own_addr_type; 1822a2344b9eSJaganath Kanakkassery __u8 filter_policy; 1823a2344b9eSJaganath Kanakkassery __u8 scanning_phys; 1824a7e45454SGustavo A. R. Silva __u8 data[]; 1825a2344b9eSJaganath Kanakkassery } __packed; 1826a2344b9eSJaganath Kanakkassery 1827a2344b9eSJaganath Kanakkassery #define LE_SCAN_PHY_1M 0x01 182845bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_2M 0x02 182945bdd86eSJaganath Kanakkassery #define LE_SCAN_PHY_CODED 0x04 1830a2344b9eSJaganath Kanakkassery 1831a2344b9eSJaganath Kanakkassery struct hci_cp_le_scan_phy_params { 1832a2344b9eSJaganath Kanakkassery __u8 type; 1833a2344b9eSJaganath Kanakkassery __le16 interval; 1834a2344b9eSJaganath Kanakkassery __le16 window; 1835a2344b9eSJaganath Kanakkassery } __packed; 1836a2344b9eSJaganath Kanakkassery 1837a2344b9eSJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_ENABLE 0x2042 1838a2344b9eSJaganath Kanakkassery struct hci_cp_le_set_ext_scan_enable { 1839a2344b9eSJaganath Kanakkassery __u8 enable; 1840a2344b9eSJaganath Kanakkassery __u8 filter_dup; 1841a2344b9eSJaganath Kanakkassery __le16 duration; 1842a2344b9eSJaganath Kanakkassery __le16 period; 1843a2344b9eSJaganath Kanakkassery } __packed; 1844a2344b9eSJaganath Kanakkassery 18454d94f95dSJaganath Kanakkassery #define HCI_OP_LE_EXT_CREATE_CONN 0x2043 18464d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_create_conn { 18474d94f95dSJaganath Kanakkassery __u8 filter_policy; 18484d94f95dSJaganath Kanakkassery __u8 own_addr_type; 18494d94f95dSJaganath Kanakkassery __u8 peer_addr_type; 18504d94f95dSJaganath Kanakkassery bdaddr_t peer_addr; 18514d94f95dSJaganath Kanakkassery __u8 phys; 1852a7e45454SGustavo A. R. Silva __u8 data[]; 18534d94f95dSJaganath Kanakkassery } __packed; 18544d94f95dSJaganath Kanakkassery 18554d94f95dSJaganath Kanakkassery struct hci_cp_le_ext_conn_param { 18564d94f95dSJaganath Kanakkassery __le16 scan_interval; 18574d94f95dSJaganath Kanakkassery __le16 scan_window; 18584d94f95dSJaganath Kanakkassery __le16 conn_interval_min; 18594d94f95dSJaganath Kanakkassery __le16 conn_interval_max; 18604d94f95dSJaganath Kanakkassery __le16 conn_latency; 18614d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 18624d94f95dSJaganath Kanakkassery __le16 min_ce_len; 18634d94f95dSJaganath Kanakkassery __le16 max_ce_len; 18644d94f95dSJaganath Kanakkassery } __packed; 18654d94f95dSJaganath Kanakkassery 18666b49bcb4SJaganath Kanakkassery #define HCI_OP_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b 18676b49bcb4SJaganath Kanakkassery struct hci_rp_le_read_num_supported_adv_sets { 18686b49bcb4SJaganath Kanakkassery __u8 status; 18696b49bcb4SJaganath Kanakkassery __u8 num_of_sets; 18706b49bcb4SJaganath Kanakkassery } __packed; 18716b49bcb4SJaganath Kanakkassery 1872de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_PARAMS 0x2036 1873de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_params { 1874de181e88SJaganath Kanakkassery __u8 handle; 1875de181e88SJaganath Kanakkassery __le16 evt_properties; 1876de181e88SJaganath Kanakkassery __u8 min_interval[3]; 1877de181e88SJaganath Kanakkassery __u8 max_interval[3]; 1878de181e88SJaganath Kanakkassery __u8 channel_map; 1879de181e88SJaganath Kanakkassery __u8 own_addr_type; 1880de181e88SJaganath Kanakkassery __u8 peer_addr_type; 1881de181e88SJaganath Kanakkassery bdaddr_t peer_addr; 1882de181e88SJaganath Kanakkassery __u8 filter_policy; 1883de181e88SJaganath Kanakkassery __u8 tx_power; 1884de181e88SJaganath Kanakkassery __u8 primary_phy; 1885de181e88SJaganath Kanakkassery __u8 secondary_max_skip; 1886de181e88SJaganath Kanakkassery __u8 secondary_phy; 1887de181e88SJaganath Kanakkassery __u8 sid; 1888de181e88SJaganath Kanakkassery __u8 notif_enable; 1889de181e88SJaganath Kanakkassery } __packed; 1890de181e88SJaganath Kanakkassery 1891de181e88SJaganath Kanakkassery #define HCI_ADV_PHY_1M 0X01 189285a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_2M 0x02 189385a721a8SJaganath Kanakkassery #define HCI_ADV_PHY_CODED 0x03 1894de181e88SJaganath Kanakkassery 1895de181e88SJaganath Kanakkassery struct hci_rp_le_set_ext_adv_params { 1896de181e88SJaganath Kanakkassery __u8 status; 1897de181e88SJaganath Kanakkassery __u8 tx_power; 1898de181e88SJaganath Kanakkassery } __packed; 1899de181e88SJaganath Kanakkassery 1900de181e88SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_ENABLE 0x2039 1901de181e88SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_enable { 1902de181e88SJaganath Kanakkassery __u8 enable; 1903de181e88SJaganath Kanakkassery __u8 num_of_sets; 1904a7e45454SGustavo A. R. Silva __u8 data[]; 1905de181e88SJaganath Kanakkassery } __packed; 1906de181e88SJaganath Kanakkassery 1907de181e88SJaganath Kanakkassery struct hci_cp_ext_adv_set { 1908de181e88SJaganath Kanakkassery __u8 handle; 1909de181e88SJaganath Kanakkassery __le16 duration; 1910de181e88SJaganath Kanakkassery __u8 max_events; 1911de181e88SJaganath Kanakkassery } __packed; 1912de181e88SJaganath Kanakkassery 1913c9ed0a70SLuiz Augusto von Dentz #define HCI_MAX_EXT_AD_LENGTH 251 1914c9ed0a70SLuiz Augusto von Dentz 1915a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_ADV_DATA 0x2037 1916a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_adv_data { 1917a0fb3726SJaganath Kanakkassery __u8 handle; 1918a0fb3726SJaganath Kanakkassery __u8 operation; 1919a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1920a0fb3726SJaganath Kanakkassery __u8 length; 1921c9ed0a70SLuiz Augusto von Dentz __u8 data[]; 1922a0fb3726SJaganath Kanakkassery } __packed; 1923a0fb3726SJaganath Kanakkassery 1924a0fb3726SJaganath Kanakkassery #define HCI_OP_LE_SET_EXT_SCAN_RSP_DATA 0x2038 1925a0fb3726SJaganath Kanakkassery struct hci_cp_le_set_ext_scan_rsp_data { 1926a0fb3726SJaganath Kanakkassery __u8 handle; 1927a0fb3726SJaganath Kanakkassery __u8 operation; 1928a0fb3726SJaganath Kanakkassery __u8 frag_pref; 1929a0fb3726SJaganath Kanakkassery __u8 length; 1930c9ed0a70SLuiz Augusto von Dentz __u8 data[]; 1931a0fb3726SJaganath Kanakkassery } __packed; 1932a0fb3726SJaganath Kanakkassery 1933a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_OP_COMPLETE 0x03 1934a0fb3726SJaganath Kanakkassery 1935a0fb3726SJaganath Kanakkassery #define LE_SET_ADV_DATA_NO_FRAG 0x01 1936a0fb3726SJaganath Kanakkassery 1937a9e45698SSathish Narsimman #define HCI_OP_LE_REMOVE_ADV_SET 0x203c 1938a9e45698SSathish Narsimman 193945b7749fSJaganath Kanakkassery #define HCI_OP_LE_CLEAR_ADV_SETS 0x203d 194045b7749fSJaganath Kanakkassery 1941a73c046aSJaganath Kanakkassery #define HCI_OP_LE_SET_ADV_SET_RAND_ADDR 0x2035 1942a73c046aSJaganath Kanakkassery struct hci_cp_le_set_adv_set_rand_addr { 1943a73c046aSJaganath Kanakkassery __u8 handle; 1944a73c046aSJaganath Kanakkassery bdaddr_t bdaddr; 1945a73c046aSJaganath Kanakkassery } __packed; 1946a73c046aSJaganath Kanakkassery 19477c395ea5SDaniel Winkler #define HCI_OP_LE_READ_TRANSMIT_POWER 0x204b 19487c395ea5SDaniel Winkler struct hci_rp_le_read_transmit_power { 19497c395ea5SDaniel Winkler __u8 status; 19507c395ea5SDaniel Winkler __s8 min_le_tx_power; 19517c395ea5SDaniel Winkler __s8 max_le_tx_power; 19527c395ea5SDaniel Winkler } __packed; 19537c395ea5SDaniel Winkler 1954853b70b5SLuiz Augusto von Dentz #define HCI_NETWORK_PRIVACY 0x00 1955853b70b5SLuiz Augusto von Dentz #define HCI_DEVICE_PRIVACY 0x01 1956853b70b5SLuiz Augusto von Dentz 1957853b70b5SLuiz Augusto von Dentz #define HCI_OP_LE_SET_PRIVACY_MODE 0x204e 1958853b70b5SLuiz Augusto von Dentz struct hci_cp_le_set_privacy_mode { 1959853b70b5SLuiz Augusto von Dentz __u8 bdaddr_type; 1960853b70b5SLuiz Augusto von Dentz bdaddr_t bdaddr; 1961853b70b5SLuiz Augusto von Dentz __u8 mode; 1962853b70b5SLuiz Augusto von Dentz } __packed; 1963853b70b5SLuiz Augusto von Dentz 19644de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_BUFFER_SIZE_V2 0x2060 19654de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_buffer_size_v2 { 19664de0fc59SLuiz Augusto von Dentz __u8 status; 19674de0fc59SLuiz Augusto von Dentz __le16 acl_mtu; 19684de0fc59SLuiz Augusto von Dentz __u8 acl_max_pkt; 19694de0fc59SLuiz Augusto von Dentz __le16 iso_mtu; 19704de0fc59SLuiz Augusto von Dentz __u8 iso_max_pkt; 19714de0fc59SLuiz Augusto von Dentz } __packed; 19724de0fc59SLuiz Augusto von Dentz 19734de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_READ_ISO_TX_SYNC 0x2061 19744de0fc59SLuiz Augusto von Dentz struct hci_cp_le_read_iso_tx_sync { 19754de0fc59SLuiz Augusto von Dentz __le16 handle; 19764de0fc59SLuiz Augusto von Dentz } __packed; 19774de0fc59SLuiz Augusto von Dentz 19784de0fc59SLuiz Augusto von Dentz struct hci_rp_le_read_iso_tx_sync { 19794de0fc59SLuiz Augusto von Dentz __u8 status; 19804de0fc59SLuiz Augusto von Dentz __le16 handle; 19814de0fc59SLuiz Augusto von Dentz __le16 seq; 19824de0fc59SLuiz Augusto von Dentz __le32 imestamp; 19834de0fc59SLuiz Augusto von Dentz __u8 offset[3]; 19844de0fc59SLuiz Augusto von Dentz } __packed; 19854de0fc59SLuiz Augusto von Dentz 19864de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_SET_CIG_PARAMS 0x2062 19874de0fc59SLuiz Augusto von Dentz struct hci_cis_params { 19884de0fc59SLuiz Augusto von Dentz __u8 cis_id; 198976c185a5SArchie Pusaka __le16 c_sdu; 199076c185a5SArchie Pusaka __le16 p_pdu; 199176c185a5SArchie Pusaka __u8 c_phy; 199276c185a5SArchie Pusaka __u8 p_phy; 199376c185a5SArchie Pusaka __u8 c_rtn; 199476c185a5SArchie Pusaka __u8 p_rtn; 19954de0fc59SLuiz Augusto von Dentz } __packed; 19964de0fc59SLuiz Augusto von Dentz 19974de0fc59SLuiz Augusto von Dentz struct hci_cp_le_set_cig_params { 19984de0fc59SLuiz Augusto von Dentz __u8 cig_id; 199976c185a5SArchie Pusaka __u8 c_interval[3]; 200076c185a5SArchie Pusaka __u8 p_interval[3]; 200176c185a5SArchie Pusaka __u8 wc_sca; 20024de0fc59SLuiz Augusto von Dentz __u8 packing; 20034de0fc59SLuiz Augusto von Dentz __u8 framing; 200476c185a5SArchie Pusaka __le16 c_latency; 200576c185a5SArchie Pusaka __le16 p_latency; 20064de0fc59SLuiz Augusto von Dentz __u8 num_cis; 2007a7e45454SGustavo A. R. Silva struct hci_cis_params cis[]; 20084de0fc59SLuiz Augusto von Dentz } __packed; 20094de0fc59SLuiz Augusto von Dentz 20104de0fc59SLuiz Augusto von Dentz struct hci_rp_le_set_cig_params { 20114de0fc59SLuiz Augusto von Dentz __u8 status; 20124de0fc59SLuiz Augusto von Dentz __u8 cig_id; 20134de0fc59SLuiz Augusto von Dentz __u8 num_handles; 2014a7e45454SGustavo A. R. Silva __le16 handle[]; 20154de0fc59SLuiz Augusto von Dentz } __packed; 20164de0fc59SLuiz Augusto von Dentz 20174de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_CREATE_CIS 0x2064 20184de0fc59SLuiz Augusto von Dentz struct hci_cis { 20194de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 20204de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 20214de0fc59SLuiz Augusto von Dentz } __packed; 20224de0fc59SLuiz Augusto von Dentz 20234de0fc59SLuiz Augusto von Dentz struct hci_cp_le_create_cis { 20244de0fc59SLuiz Augusto von Dentz __u8 num_cis; 2025a7e45454SGustavo A. R. Silva struct hci_cis cis[]; 20264de0fc59SLuiz Augusto von Dentz } __packed; 20274de0fc59SLuiz Augusto von Dentz 20284de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REMOVE_CIG 0x2065 20294de0fc59SLuiz Augusto von Dentz struct hci_cp_le_remove_cig { 20304de0fc59SLuiz Augusto von Dentz __u8 cig_id; 20314de0fc59SLuiz Augusto von Dentz } __packed; 20324de0fc59SLuiz Augusto von Dentz 20334de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_ACCEPT_CIS 0x2066 20344de0fc59SLuiz Augusto von Dentz struct hci_cp_le_accept_cis { 20354de0fc59SLuiz Augusto von Dentz __le16 handle; 20364de0fc59SLuiz Augusto von Dentz } __packed; 20374de0fc59SLuiz Augusto von Dentz 20384de0fc59SLuiz Augusto von Dentz #define HCI_OP_LE_REJECT_CIS 0x2067 20394de0fc59SLuiz Augusto von Dentz struct hci_cp_le_reject_cis { 20404de0fc59SLuiz Augusto von Dentz __le16 handle; 20414de0fc59SLuiz Augusto von Dentz __u8 reason; 20424de0fc59SLuiz Augusto von Dentz } __packed; 20434de0fc59SLuiz Augusto von Dentz 20441da177e4SLinus Torvalds /* ---- HCI Events ---- */ 2045ae61a10dSLuiz Augusto von Dentz struct hci_ev_status { 2046ae61a10dSLuiz Augusto von Dentz __u8 status; 2047ae61a10dSLuiz Augusto von Dentz } __packed; 2048ae61a10dSLuiz Augusto von Dentz 20491da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 20501da177e4SLinus Torvalds 20511da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 20521da177e4SLinus Torvalds struct inquiry_info { 20531da177e4SLinus Torvalds bdaddr_t bdaddr; 20541da177e4SLinus Torvalds __u8 pscan_rep_mode; 20551da177e4SLinus Torvalds __u8 pscan_period_mode; 20561da177e4SLinus Torvalds __u8 pscan_mode; 20571da177e4SLinus Torvalds __u8 dev_class[3]; 20581ebb9252SMarcel Holtmann __le16 clock_offset; 205966c853ccSGustavo F. Padovan } __packed; 20601da177e4SLinus Torvalds 206127d9eb4bSLuiz Augusto von Dentz struct hci_ev_inquiry_result { 206227d9eb4bSLuiz Augusto von Dentz __u8 num; 206327d9eb4bSLuiz Augusto von Dentz struct inquiry_info info[]; 206427d9eb4bSLuiz Augusto von Dentz }; 206527d9eb4bSLuiz Augusto von Dentz 20661da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 20671da177e4SLinus Torvalds struct hci_ev_conn_complete { 20681da177e4SLinus Torvalds __u8 status; 20691ebb9252SMarcel Holtmann __le16 handle; 20701da177e4SLinus Torvalds bdaddr_t bdaddr; 20711da177e4SLinus Torvalds __u8 link_type; 20721da177e4SLinus Torvalds __u8 encr_mode; 207366c853ccSGustavo F. Padovan } __packed; 20741da177e4SLinus Torvalds 20751da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 20761da177e4SLinus Torvalds struct hci_ev_conn_request { 20771da177e4SLinus Torvalds bdaddr_t bdaddr; 20781da177e4SLinus Torvalds __u8 dev_class[3]; 20791da177e4SLinus Torvalds __u8 link_type; 208066c853ccSGustavo F. Padovan } __packed; 20811da177e4SLinus Torvalds 20821da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 20831da177e4SLinus Torvalds struct hci_ev_disconn_complete { 20841da177e4SLinus Torvalds __u8 status; 20851ebb9252SMarcel Holtmann __le16 handle; 20861da177e4SLinus Torvalds __u8 reason; 208766c853ccSGustavo F. Padovan } __packed; 20881da177e4SLinus Torvalds 20891da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 20901da177e4SLinus Torvalds struct hci_ev_auth_complete { 20911da177e4SLinus Torvalds __u8 status; 20921ebb9252SMarcel Holtmann __le16 handle; 209366c853ccSGustavo F. Padovan } __packed; 20941da177e4SLinus Torvalds 2095a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 2096a9de9248SMarcel Holtmann struct hci_ev_remote_name { 2097a9de9248SMarcel Holtmann __u8 status; 2098a9de9248SMarcel Holtmann bdaddr_t bdaddr; 20991f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 210066c853ccSGustavo F. Padovan } __packed; 2101a9de9248SMarcel Holtmann 21021da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 21031da177e4SLinus Torvalds struct hci_ev_encrypt_change { 21041da177e4SLinus Torvalds __u8 status; 21051ebb9252SMarcel Holtmann __le16 handle; 21061da177e4SLinus Torvalds __u8 encrypt; 210766c853ccSGustavo F. Padovan } __packed; 21081da177e4SLinus Torvalds 2109a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 2110a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 21111da177e4SLinus Torvalds __u8 status; 21121ebb9252SMarcel Holtmann __le16 handle; 211366c853ccSGustavo F. Padovan } __packed; 21141da177e4SLinus Torvalds 2115a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 2116a9de9248SMarcel Holtmann struct hci_ev_remote_features { 2117a9de9248SMarcel Holtmann __u8 status; 2118a9de9248SMarcel Holtmann __le16 handle; 2119a9de9248SMarcel Holtmann __u8 features[8]; 212066c853ccSGustavo F. Padovan } __packed; 2121a9de9248SMarcel Holtmann 2122a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 2123a9de9248SMarcel Holtmann struct hci_ev_remote_version { 2124a9de9248SMarcel Holtmann __u8 status; 2125a9de9248SMarcel Holtmann __le16 handle; 2126a9de9248SMarcel Holtmann __u8 lmp_ver; 2127a9de9248SMarcel Holtmann __le16 manufacturer; 2128a9de9248SMarcel Holtmann __le16 lmp_subver; 212966c853ccSGustavo F. Padovan } __packed; 2130a9de9248SMarcel Holtmann 2131a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 21321da177e4SLinus Torvalds struct hci_qos { 21331da177e4SLinus Torvalds __u8 service_type; 21341da177e4SLinus Torvalds __u32 token_rate; 21351da177e4SLinus Torvalds __u32 peak_bandwidth; 21361da177e4SLinus Torvalds __u32 latency; 21371da177e4SLinus Torvalds __u32 delay_variation; 213866c853ccSGustavo F. Padovan } __packed; 21391da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 21401da177e4SLinus Torvalds __u8 status; 21411ebb9252SMarcel Holtmann __le16 handle; 21421da177e4SLinus Torvalds struct hci_qos qos; 214366c853ccSGustavo F. Padovan } __packed; 21441da177e4SLinus Torvalds 2145a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 21461da177e4SLinus Torvalds struct hci_ev_cmd_complete { 21471da177e4SLinus Torvalds __u8 ncmd; 21481ebb9252SMarcel Holtmann __le16 opcode; 214966c853ccSGustavo F. Padovan } __packed; 21501da177e4SLinus Torvalds 2151a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 21521da177e4SLinus Torvalds struct hci_ev_cmd_status { 21531da177e4SLinus Torvalds __u8 status; 21541da177e4SLinus Torvalds __u8 ncmd; 21551ebb9252SMarcel Holtmann __le16 opcode; 215666c853ccSGustavo F. Padovan } __packed; 21571da177e4SLinus Torvalds 215824dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 215924dfa343SMarcel Holtmann struct hci_ev_hardware_error { 216024dfa343SMarcel Holtmann __u8 code; 216124dfa343SMarcel Holtmann } __packed; 216224dfa343SMarcel Holtmann 21631da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 21641da177e4SLinus Torvalds struct hci_ev_role_change { 21651da177e4SLinus Torvalds __u8 status; 21661da177e4SLinus Torvalds bdaddr_t bdaddr; 21671da177e4SLinus Torvalds __u8 role; 216866c853ccSGustavo F. Padovan } __packed; 21691da177e4SLinus Torvalds 2170a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 2171613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 2172613a1c0cSAndrei Emeltchenko __le16 handle; 2173613a1c0cSAndrei Emeltchenko __le16 count; 2174613a1c0cSAndrei Emeltchenko } __packed; 2175613a1c0cSAndrei Emeltchenko 2176a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 2177aadc3d2fSLuiz Augusto von Dentz __u8 num; 2178a7e45454SGustavo A. R. Silva struct hci_comp_pkts_info handles[]; 217966c853ccSGustavo F. Padovan } __packed; 2180a9de9248SMarcel Holtmann 21811da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 21821da177e4SLinus Torvalds struct hci_ev_mode_change { 21831da177e4SLinus Torvalds __u8 status; 21841ebb9252SMarcel Holtmann __le16 handle; 21851da177e4SLinus Torvalds __u8 mode; 21861ebb9252SMarcel Holtmann __le16 interval; 218766c853ccSGustavo F. Padovan } __packed; 21881da177e4SLinus Torvalds 21891da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 21901da177e4SLinus Torvalds struct hci_ev_pin_code_req { 21911da177e4SLinus Torvalds bdaddr_t bdaddr; 219266c853ccSGustavo F. Padovan } __packed; 21931da177e4SLinus Torvalds 21941da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 21951da177e4SLinus Torvalds struct hci_ev_link_key_req { 21961da177e4SLinus Torvalds bdaddr_t bdaddr; 219766c853ccSGustavo F. Padovan } __packed; 21981da177e4SLinus Torvalds 21991da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 22001da177e4SLinus Torvalds struct hci_ev_link_key_notify { 22011da177e4SLinus Torvalds bdaddr_t bdaddr; 22029b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 22031da177e4SLinus Torvalds __u8 key_type; 220466c853ccSGustavo F. Padovan } __packed; 22051da177e4SLinus Torvalds 2206a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 22071da177e4SLinus Torvalds struct hci_ev_clock_offset { 22081da177e4SLinus Torvalds __u8 status; 22091ebb9252SMarcel Holtmann __le16 handle; 22101ebb9252SMarcel Holtmann __le16 clock_offset; 221166c853ccSGustavo F. Padovan } __packed; 22121da177e4SLinus Torvalds 2213a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 2214a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 2215a8746417SMarcel Holtmann __u8 status; 2216a8746417SMarcel Holtmann __le16 handle; 2217a8746417SMarcel Holtmann __le16 pkt_type; 221866c853ccSGustavo F. Padovan } __packed; 2219a8746417SMarcel Holtmann 222085a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 222185a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 222285a1e930SMarcel Holtmann bdaddr_t bdaddr; 222385a1e930SMarcel Holtmann __u8 pscan_rep_mode; 222466c853ccSGustavo F. Padovan } __packed; 222585a1e930SMarcel Holtmann 2226a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 22278d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi { 2228a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2229a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2230a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2231a9de9248SMarcel Holtmann __u8 dev_class[3]; 2232a9de9248SMarcel Holtmann __le16 clock_offset; 2233a9de9248SMarcel Holtmann __s8 rssi; 223466c853ccSGustavo F. Padovan } __packed; 22358d08d324SLuiz Augusto von Dentz struct inquiry_info_rssi_pscan { 2236a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2237a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2238a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2239a9de9248SMarcel Holtmann __u8 pscan_mode; 2240a9de9248SMarcel Holtmann __u8 dev_class[3]; 2241a9de9248SMarcel Holtmann __le16 clock_offset; 2242a9de9248SMarcel Holtmann __s8 rssi; 224366c853ccSGustavo F. Padovan } __packed; 22448d08d324SLuiz Augusto von Dentz struct hci_ev_inquiry_result_rssi { 22458d08d324SLuiz Augusto von Dentz __u8 num; 224672279d17SLuiz Augusto von Dentz __u8 data[]; 22478d08d324SLuiz Augusto von Dentz } __packed; 2248a9de9248SMarcel Holtmann 2249a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 2250a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 2251a9de9248SMarcel Holtmann __u8 status; 2252a9de9248SMarcel Holtmann __le16 handle; 2253a9de9248SMarcel Holtmann __u8 page; 2254a9de9248SMarcel Holtmann __u8 max_page; 2255a9de9248SMarcel Holtmann __u8 features[8]; 225666c853ccSGustavo F. Padovan } __packed; 2257a9de9248SMarcel Holtmann 2258a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 2259a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 2260a9de9248SMarcel Holtmann __u8 status; 2261a9de9248SMarcel Holtmann __le16 handle; 2262a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2263a9de9248SMarcel Holtmann __u8 link_type; 2264a9de9248SMarcel Holtmann __u8 tx_interval; 2265a9de9248SMarcel Holtmann __u8 retrans_window; 2266a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2267a9de9248SMarcel Holtmann __le16 tx_pkt_len; 2268a9de9248SMarcel Holtmann __u8 air_mode; 226966c853ccSGustavo F. Padovan } __packed; 2270a9de9248SMarcel Holtmann 2271a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 2272a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 2273a9de9248SMarcel Holtmann __u8 status; 2274a9de9248SMarcel Holtmann __le16 handle; 2275a9de9248SMarcel Holtmann __u8 tx_interval; 2276a9de9248SMarcel Holtmann __u8 retrans_window; 2277a9de9248SMarcel Holtmann __le16 rx_pkt_len; 2278a9de9248SMarcel Holtmann __le16 tx_pkt_len; 227966c853ccSGustavo F. Padovan } __packed; 2280a9de9248SMarcel Holtmann 2281a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 228204837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 228304837f64SMarcel Holtmann __u8 status; 228404837f64SMarcel Holtmann __le16 handle; 228504837f64SMarcel Holtmann __le16 max_tx_latency; 228604837f64SMarcel Holtmann __le16 max_rx_latency; 228704837f64SMarcel Holtmann __le16 max_remote_timeout; 228804837f64SMarcel Holtmann __le16 max_local_timeout; 228966c853ccSGustavo F. Padovan } __packed; 229004837f64SMarcel Holtmann 2291a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 2292a9de9248SMarcel Holtmann struct extended_inquiry_info { 2293a9de9248SMarcel Holtmann bdaddr_t bdaddr; 2294a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 2295a9de9248SMarcel Holtmann __u8 pscan_period_mode; 2296a9de9248SMarcel Holtmann __u8 dev_class[3]; 2297a9de9248SMarcel Holtmann __le16 clock_offset; 2298a9de9248SMarcel Holtmann __s8 rssi; 2299a9de9248SMarcel Holtmann __u8 data[240]; 230066c853ccSGustavo F. Padovan } __packed; 2301a9de9248SMarcel Holtmann 230270a6b8deSLuiz Augusto von Dentz struct hci_ev_ext_inquiry_result { 230370a6b8deSLuiz Augusto von Dentz __u8 num; 230470a6b8deSLuiz Augusto von Dentz struct extended_inquiry_info info[]; 230570a6b8deSLuiz Augusto von Dentz } __packed; 230670a6b8deSLuiz Augusto von Dentz 23071c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 23081c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 23091c2e0041SJohan Hedberg __u8 status; 23101c2e0041SJohan Hedberg __le16 handle; 23111c2e0041SJohan Hedberg } __packed; 23121c2e0041SJohan Hedberg 23130493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 23140493684eSMarcel Holtmann struct hci_ev_io_capa_request { 23150493684eSMarcel Holtmann bdaddr_t bdaddr; 231666c853ccSGustavo F. Padovan } __packed; 23170493684eSMarcel Holtmann 231803b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 231903b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 232003b555e1SJohan Hedberg bdaddr_t bdaddr; 232103b555e1SJohan Hedberg __u8 capability; 232203b555e1SJohan Hedberg __u8 oob_data; 232303b555e1SJohan Hedberg __u8 authentication; 232403b555e1SJohan Hedberg } __packed; 232503b555e1SJohan Hedberg 2326a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 2327a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 2328a5c29683SJohan Hedberg bdaddr_t bdaddr; 2329a5c29683SJohan Hedberg __le32 passkey; 2330a5c29683SJohan Hedberg } __packed; 2331a5c29683SJohan Hedberg 23329ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 23339ad4019aSBrian Gix struct hci_ev_user_passkey_req { 23349ad4019aSBrian Gix bdaddr_t bdaddr; 23359ad4019aSBrian Gix } __packed; 23369ad4019aSBrian Gix 23372763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 23382763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 23392763eda6SSzymon Janc bdaddr_t bdaddr; 23402763eda6SSzymon Janc } __packed; 23412763eda6SSzymon Janc 23420493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 23430493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 23440493684eSMarcel Holtmann __u8 status; 23450493684eSMarcel Holtmann bdaddr_t bdaddr; 234666c853ccSGustavo F. Padovan } __packed; 23470493684eSMarcel Holtmann 234892a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 234992a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 235092a25256SJohan Hedberg bdaddr_t bdaddr; 235192a25256SJohan Hedberg __le32 passkey; 235292a25256SJohan Hedberg } __packed; 235392a25256SJohan Hedberg 235492a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 235592a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 235692a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 235792a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 235892a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 235992a25256SJohan Hedberg 236092a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 236192a25256SJohan Hedberg struct hci_ev_keypress_notify { 236292a25256SJohan Hedberg bdaddr_t bdaddr; 236392a25256SJohan Hedberg __u8 type; 236492a25256SJohan Hedberg } __packed; 236592a25256SJohan Hedberg 236641a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 236741a96212SMarcel Holtmann struct hci_ev_remote_host_features { 236841a96212SMarcel Holtmann bdaddr_t bdaddr; 236941a96212SMarcel Holtmann __u8 features[8]; 237066c853ccSGustavo F. Padovan } __packed; 237141a96212SMarcel Holtmann 237263185f64SVille Tervo #define HCI_EV_LE_META 0x3e 237363185f64SVille Tervo struct hci_ev_le_meta { 237463185f64SVille Tervo __u8 subevent; 237563185f64SVille Tervo } __packed; 237663185f64SVille Tervo 2377523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 2378523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 2379523e93cdSAndrei Emeltchenko __u8 status; 2380523e93cdSAndrei Emeltchenko __u8 phy_handle; 2381523e93cdSAndrei Emeltchenko } __packed; 2382523e93cdSAndrei Emeltchenko 2383523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 2384523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 2385523e93cdSAndrei Emeltchenko __u8 phy_handle; 2386523e93cdSAndrei Emeltchenko } __packed; 2387523e93cdSAndrei Emeltchenko 2388523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 2389523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 2390523e93cdSAndrei Emeltchenko __u8 status; 2391523e93cdSAndrei Emeltchenko __u8 phy_handle; 2392523e93cdSAndrei Emeltchenko __u8 reason; 2393523e93cdSAndrei Emeltchenko } __packed; 2394523e93cdSAndrei Emeltchenko 2395523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 2396523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 2397523e93cdSAndrei Emeltchenko __u8 status; 2398523e93cdSAndrei Emeltchenko __le16 handle; 2399523e93cdSAndrei Emeltchenko __u8 phy_handle; 2400523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 2401523e93cdSAndrei Emeltchenko } __packed; 2402523e93cdSAndrei Emeltchenko 2403523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 2404523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 2405523e93cdSAndrei Emeltchenko __u8 status; 2406523e93cdSAndrei Emeltchenko __le16 handle; 2407523e93cdSAndrei Emeltchenko __u8 reason; 2408523e93cdSAndrei Emeltchenko } __packed; 2409523e93cdSAndrei Emeltchenko 241025e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 241125e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 241225e89e99SAndrei Emeltchenko __le16 handle; 241325e89e99SAndrei Emeltchenko __le16 pkts; 241425e89e99SAndrei Emeltchenko __le16 blocks; 241525e89e99SAndrei Emeltchenko } __packed; 241625e89e99SAndrei Emeltchenko 241725e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 241825e89e99SAndrei Emeltchenko __le16 num_blocks; 241925e89e99SAndrei Emeltchenko __u8 num_hndl; 2420a7e45454SGustavo A. R. Silva struct hci_comp_blocks_info handles[]; 242125e89e99SAndrei Emeltchenko } __packed; 242225e89e99SAndrei Emeltchenko 24232b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 24242b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 24252b359445SDoHyun Pyun __u8 status; 24262b359445SDoHyun Pyun } __packed; 24272b359445SDoHyun Pyun 242876c185a5SArchie Pusaka #define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT 0x54 24292ed01805SDoHyun Pyun 243063185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 243163185f64SVille Tervo struct hci_ev_le_conn_complete { 243263185f64SVille Tervo __u8 status; 243363185f64SVille Tervo __le16 handle; 243463185f64SVille Tervo __u8 role; 243563185f64SVille Tervo __u8 bdaddr_type; 243663185f64SVille Tervo bdaddr_t bdaddr; 243763185f64SVille Tervo __le16 interval; 243863185f64SVille Tervo __le16 latency; 243963185f64SVille Tervo __le16 supervision_timeout; 244063185f64SVille Tervo __u8 clk_accurancy; 244163185f64SVille Tervo } __packed; 244263185f64SVille Tervo 24432331fd46SMarcel Holtmann /* Advertising report event types */ 24442331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 24452331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 24462331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 24472331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 24482331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 2449c215e939SJaganath Kanakkassery #define LE_ADV_INVALID 0x05 2450c215e939SJaganath Kanakkassery 2451c215e939SJaganath Kanakkassery /* Legacy event types in extended adv report */ 2452c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_IND 0x0013 2453c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_DIRECT_IND 0x0015 2454c215e939SJaganath Kanakkassery #define LE_LEGACY_ADV_SCAN_IND 0x0012 2455c215e939SJaganath Kanakkassery #define LE_LEGACY_NONCONN_IND 0x0010 2456c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV 0x001b 2457c215e939SJaganath Kanakkassery #define LE_LEGACY_SCAN_RSP_ADV_SCAN 0x001a 24582331fd46SMarcel Holtmann 2459b2cc9761SJaganath Kanakkassery /* Extended Advertising event types */ 2460b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_NON_CONN_IND 0x0000 2461b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_CONN_IND 0x0001 2462b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_IND 0x0002 2463b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_DIRECT_IND 0x0004 2464b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_SCAN_RSP 0x0008 2465b2cc9761SJaganath Kanakkassery #define LE_EXT_ADV_LEGACY_PDU 0x0010 2466b2cc9761SJaganath Kanakkassery 24672331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 24682331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 24696540351eSMarcel Holtmann #define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 24706540351eSMarcel Holtmann #define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 24712331fd46SMarcel Holtmann 24722331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 24732331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 247447afe93cSLuiz Augusto von Dentz __u8 type; 24752331fd46SMarcel Holtmann __u8 bdaddr_type; 24762331fd46SMarcel Holtmann bdaddr_t bdaddr; 24772331fd46SMarcel Holtmann __u8 length; 2478a7e45454SGustavo A. R. Silva __u8 data[]; 24792331fd46SMarcel Holtmann } __packed; 24802331fd46SMarcel Holtmann 248147afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_report { 248247afe93cSLuiz Augusto von Dentz __u8 num; 248347afe93cSLuiz Augusto von Dentz struct hci_ev_le_advertising_info info[]; 248447afe93cSLuiz Augusto von Dentz } __packed; 248547afe93cSLuiz Augusto von Dentz 24861855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 24871855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 24881855d92dSMarcel Holtmann __u8 status; 24891855d92dSMarcel Holtmann __le16 handle; 24901855d92dSMarcel Holtmann __le16 interval; 24911855d92dSMarcel Holtmann __le16 latency; 24921855d92dSMarcel Holtmann __le16 supervision_timeout; 24931855d92dSMarcel Holtmann } __packed; 24941855d92dSMarcel Holtmann 24950fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 24960fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 24970fe29fd1SMarcel Holtmann __u8 status; 24980fe29fd1SMarcel Holtmann __le16 handle; 24990fe29fd1SMarcel Holtmann __u8 features[8]; 25000fe29fd1SMarcel Holtmann } __packed; 25010fe29fd1SMarcel Holtmann 2502a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 2503a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 2504a7a595f6SVinicius Costa Gomes __le16 handle; 2505fe39c7b2SMarcel Holtmann __le64 rand; 2506a7a595f6SVinicius Costa Gomes __le16 ediv; 2507a7a595f6SVinicius Costa Gomes } __packed; 2508a7a595f6SVinicius Costa Gomes 25098e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 25108e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 25118e75b46aSAndre Guedes __le16 handle; 25128e75b46aSAndre Guedes __le16 interval_min; 25138e75b46aSAndre Guedes __le16 interval_max; 25148e75b46aSAndre Guedes __le16 latency; 25158e75b46aSAndre Guedes __le16 timeout; 25168e75b46aSAndre Guedes } __packed; 25178e75b46aSAndre Guedes 251894a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 251994a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 252094a3bd02SMarcel Holtmann __le16 handle; 252194a3bd02SMarcel Holtmann __le16 tx_len; 252294a3bd02SMarcel Holtmann __le16 tx_time; 252394a3bd02SMarcel Holtmann __le16 rx_len; 252494a3bd02SMarcel Holtmann __le16 rx_time; 252594a3bd02SMarcel Holtmann } __packed; 252694a3bd02SMarcel Holtmann 252732c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 252832c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 2529a3679649SLuiz Augusto von Dentz __u8 type; 253032c9d43fSMarcel Holtmann __u8 bdaddr_type; 253132c9d43fSMarcel Holtmann bdaddr_t bdaddr; 253232c9d43fSMarcel Holtmann __u8 direct_addr_type; 253332c9d43fSMarcel Holtmann bdaddr_t direct_addr; 253432c9d43fSMarcel Holtmann __s8 rssi; 253532c9d43fSMarcel Holtmann } __packed; 253632c9d43fSMarcel Holtmann 2537a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_report { 2538a3679649SLuiz Augusto von Dentz __u8 num; 2539a3679649SLuiz Augusto von Dentz struct hci_ev_le_direct_adv_info info[]; 2540a3679649SLuiz Augusto von Dentz } __packed; 2541a3679649SLuiz Augusto von Dentz 25421efd927dSLuiz Augusto von Dentz #define HCI_EV_LE_PHY_UPDATE_COMPLETE 0x0c 25431efd927dSLuiz Augusto von Dentz struct hci_ev_le_phy_update_complete { 25441efd927dSLuiz Augusto von Dentz __u8 status; 25454de0fc59SLuiz Augusto von Dentz __le16 handle; 25461efd927dSLuiz Augusto von Dentz __u8 tx_phy; 25471efd927dSLuiz Augusto von Dentz __u8 rx_phy; 25481efd927dSLuiz Augusto von Dentz } __packed; 25491efd927dSLuiz Augusto von Dentz 2550c215e939SJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_REPORT 0x0d 2551b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info { 2552b48b833fSLuiz Augusto von Dentz __le16 type; 2553c215e939SJaganath Kanakkassery __u8 bdaddr_type; 2554c215e939SJaganath Kanakkassery bdaddr_t bdaddr; 2555c215e939SJaganath Kanakkassery __u8 primary_phy; 2556c215e939SJaganath Kanakkassery __u8 secondary_phy; 2557c215e939SJaganath Kanakkassery __u8 sid; 2558c215e939SJaganath Kanakkassery __u8 tx_power; 2559c215e939SJaganath Kanakkassery __s8 rssi; 2560c215e939SJaganath Kanakkassery __le16 interval; 2561c215e939SJaganath Kanakkassery __u8 direct_addr_type; 2562c215e939SJaganath Kanakkassery bdaddr_t direct_addr; 2563c215e939SJaganath Kanakkassery __u8 length; 2564a7e45454SGustavo A. R. Silva __u8 data[]; 2565c215e939SJaganath Kanakkassery } __packed; 2566c215e939SJaganath Kanakkassery 2567b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_report { 2568b48b833fSLuiz Augusto von Dentz __u8 num; 2569b48b833fSLuiz Augusto von Dentz struct hci_ev_le_ext_adv_info info[]; 2570b48b833fSLuiz Augusto von Dentz } __packed; 2571b48b833fSLuiz Augusto von Dentz 25724d94f95dSJaganath Kanakkassery #define HCI_EV_LE_ENHANCED_CONN_COMPLETE 0x0a 25734d94f95dSJaganath Kanakkassery struct hci_ev_le_enh_conn_complete { 25744d94f95dSJaganath Kanakkassery __u8 status; 25754d94f95dSJaganath Kanakkassery __le16 handle; 25764d94f95dSJaganath Kanakkassery __u8 role; 25774d94f95dSJaganath Kanakkassery __u8 bdaddr_type; 25784d94f95dSJaganath Kanakkassery bdaddr_t bdaddr; 25794d94f95dSJaganath Kanakkassery bdaddr_t local_rpa; 25804d94f95dSJaganath Kanakkassery bdaddr_t peer_rpa; 25814d94f95dSJaganath Kanakkassery __le16 interval; 25824d94f95dSJaganath Kanakkassery __le16 latency; 25834d94f95dSJaganath Kanakkassery __le16 supervision_timeout; 25844d94f95dSJaganath Kanakkassery __u8 clk_accurancy; 25854d94f95dSJaganath Kanakkassery } __packed; 25864d94f95dSJaganath Kanakkassery 2587acf0aeaeSJaganath Kanakkassery #define HCI_EV_LE_EXT_ADV_SET_TERM 0x12 2588acf0aeaeSJaganath Kanakkassery struct hci_evt_le_ext_adv_set_term { 2589acf0aeaeSJaganath Kanakkassery __u8 status; 2590acf0aeaeSJaganath Kanakkassery __u8 handle; 2591acf0aeaeSJaganath Kanakkassery __le16 conn_handle; 2592acf0aeaeSJaganath Kanakkassery __u8 num_evts; 2593acf0aeaeSJaganath Kanakkassery } __packed; 2594acf0aeaeSJaganath Kanakkassery 25954de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_ESTABLISHED 0x19 25964de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_established { 25974de0fc59SLuiz Augusto von Dentz __u8 status; 25984de0fc59SLuiz Augusto von Dentz __le16 handle; 25994de0fc59SLuiz Augusto von Dentz __u8 cig_sync_delay[3]; 26004de0fc59SLuiz Augusto von Dentz __u8 cis_sync_delay[3]; 260176c185a5SArchie Pusaka __u8 c_latency[3]; 260276c185a5SArchie Pusaka __u8 p_latency[3]; 260376c185a5SArchie Pusaka __u8 c_phy; 260476c185a5SArchie Pusaka __u8 p_phy; 26054de0fc59SLuiz Augusto von Dentz __u8 nse; 260676c185a5SArchie Pusaka __u8 c_bn; 260776c185a5SArchie Pusaka __u8 p_bn; 260876c185a5SArchie Pusaka __u8 c_ft; 260976c185a5SArchie Pusaka __u8 p_ft; 261076c185a5SArchie Pusaka __le16 c_mtu; 261176c185a5SArchie Pusaka __le16 p_mtu; 26124de0fc59SLuiz Augusto von Dentz __le16 interval; 26134de0fc59SLuiz Augusto von Dentz } __packed; 26144de0fc59SLuiz Augusto von Dentz 26154de0fc59SLuiz Augusto von Dentz #define HCI_EVT_LE_CIS_REQ 0x1a 26164de0fc59SLuiz Augusto von Dentz struct hci_evt_le_cis_req { 26174de0fc59SLuiz Augusto von Dentz __le16 acl_handle; 26184de0fc59SLuiz Augusto von Dentz __le16 cis_handle; 26194de0fc59SLuiz Augusto von Dentz __u8 cig_id; 26204de0fc59SLuiz Augusto von Dentz __u8 cis_id; 26214de0fc59SLuiz Augusto von Dentz } __packed; 26224de0fc59SLuiz Augusto von Dentz 2623e4cc5a18SMarcel Holtmann #define HCI_EV_VENDOR 0xff 2624e4cc5a18SMarcel Holtmann 26251da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 2626a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 26271da177e4SLinus Torvalds struct hci_ev_stack_internal { 26281da177e4SLinus Torvalds __u16 type; 2629a7e45454SGustavo A. R. Silva __u8 data[]; 263066c853ccSGustavo F. Padovan } __packed; 26311da177e4SLinus Torvalds 26321da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 26331da177e4SLinus Torvalds struct hci_ev_si_device { 26341da177e4SLinus Torvalds __u16 event; 26351da177e4SLinus Torvalds __u16 dev_id; 263666c853ccSGustavo F. Padovan } __packed; 26371da177e4SLinus Torvalds 26381da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 26391da177e4SLinus Torvalds struct hci_ev_si_security { 26401da177e4SLinus Torvalds __u16 event; 26411da177e4SLinus Torvalds __u16 proto; 26421da177e4SLinus Torvalds __u16 subproto; 26431da177e4SLinus Torvalds __u8 incoming; 264466c853ccSGustavo F. Padovan } __packed; 26451da177e4SLinus Torvalds 26461da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 26471da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 26481da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 26491da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 26501da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 26514de0fc59SLuiz Augusto von Dentz #define HCI_ISO_HDR_SIZE 4 26521da177e4SLinus Torvalds 26531da177e4SLinus Torvalds struct hci_command_hdr { 26541ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 26551da177e4SLinus Torvalds __u8 plen; 265666c853ccSGustavo F. Padovan } __packed; 26571da177e4SLinus Torvalds 26581da177e4SLinus Torvalds struct hci_event_hdr { 26591da177e4SLinus Torvalds __u8 evt; 26601da177e4SLinus Torvalds __u8 plen; 266166c853ccSGustavo F. Padovan } __packed; 26621da177e4SLinus Torvalds 26631da177e4SLinus Torvalds struct hci_acl_hdr { 26641ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 26651ebb9252SMarcel Holtmann __le16 dlen; 266666c853ccSGustavo F. Padovan } __packed; 26671da177e4SLinus Torvalds 26681da177e4SLinus Torvalds struct hci_sco_hdr { 26691ebb9252SMarcel Holtmann __le16 handle; 26701da177e4SLinus Torvalds __u8 dlen; 267166c853ccSGustavo F. Padovan } __packed; 26721da177e4SLinus Torvalds 26734de0fc59SLuiz Augusto von Dentz struct hci_iso_hdr { 26744de0fc59SLuiz Augusto von Dentz __le16 handle; 26754de0fc59SLuiz Augusto von Dentz __le16 dlen; 2676a7e45454SGustavo A. R. Silva __u8 data[]; 26774de0fc59SLuiz Augusto von Dentz } __packed; 26784de0fc59SLuiz Augusto von Dentz 26794de0fc59SLuiz Augusto von Dentz /* ISO data packet status flags */ 26804de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_VALID 0x00 26814de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_INVALID 0x01 26824de0fc59SLuiz Augusto von Dentz #define HCI_ISO_STATUS_NOP 0x02 26834de0fc59SLuiz Augusto von Dentz 26844de0fc59SLuiz Augusto von Dentz #define HCI_ISO_DATA_HDR_SIZE 4 26854de0fc59SLuiz Augusto von Dentz struct hci_iso_data_hdr { 26864de0fc59SLuiz Augusto von Dentz __le16 sn; 26874de0fc59SLuiz Augusto von Dentz __le16 slen; 26884de0fc59SLuiz Augusto von Dentz }; 26894de0fc59SLuiz Augusto von Dentz 26904de0fc59SLuiz Augusto von Dentz #define HCI_ISO_TS_DATA_HDR_SIZE 8 26914de0fc59SLuiz Augusto von Dentz struct hci_iso_ts_data_hdr { 26924de0fc59SLuiz Augusto von Dentz __le32 ts; 26934de0fc59SLuiz Augusto von Dentz __le16 sn; 26944de0fc59SLuiz Augusto von Dentz __le16 slen; 26954de0fc59SLuiz Augusto von Dentz }; 26964de0fc59SLuiz Augusto von Dentz 26972a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 26982a123b86SArnaldo Carvalho de Melo { 26992a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 27002a123b86SArnaldo Carvalho de Melo } 27012a123b86SArnaldo Carvalho de Melo 27022a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 27032a123b86SArnaldo Carvalho de Melo { 27042a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 27052a123b86SArnaldo Carvalho de Melo } 27062a123b86SArnaldo Carvalho de Melo 27072a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 27082a123b86SArnaldo Carvalho de Melo { 27092a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 27102a123b86SArnaldo Carvalho de Melo } 27112a123b86SArnaldo Carvalho de Melo 27121da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2713c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 27141da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 27151da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 27161da177e4SLinus Torvalds 27171da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2718c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 27191da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 27201da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 27211da177e4SLinus Torvalds 27224de0fc59SLuiz Augusto von Dentz /* ISO handle and flags pack/unpack */ 27234de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pb(f) (f & 0x0003) 27244de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) 27254de0fc59SLuiz Augusto von Dentz #define hci_iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2)) 27264de0fc59SLuiz Augusto von Dentz 27274de0fc59SLuiz Augusto von Dentz /* ISO data length and flags pack/unpack */ 27284de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len_pack(h, f) ((__u16) ((h) | ((f) << 14))) 27294de0fc59SLuiz Augusto von Dentz #define hci_iso_data_len(h) ((h) & 0x3fff) 27304de0fc59SLuiz Augusto von Dentz #define hci_iso_data_flags(h) ((h) >> 14) 27314de0fc59SLuiz Augusto von Dentz 2732248733e8SKiran K /* codec transport types */ 2733248733e8SKiran K #define HCI_TRANSPORT_SCO_ESCO 0x01 2734248733e8SKiran K 27355cbd3ebdSAlain Michaud /* le24 support */ 27365cbd3ebdSAlain Michaud static inline void hci_cpu_to_le24(__u32 val, __u8 dst[3]) 27375cbd3ebdSAlain Michaud { 27385cbd3ebdSAlain Michaud dst[0] = val & 0xff; 27395cbd3ebdSAlain Michaud dst[1] = (val & 0xff00) >> 8; 27405cbd3ebdSAlain Michaud dst[2] = (val & 0xff0000) >> 16; 27415cbd3ebdSAlain Michaud } 27425cbd3ebdSAlain Michaud 27431da177e4SLinus Torvalds #endif /* __HCI_H */ 2744