11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds BlueZ - Bluetooth protocol stack for Linux 31da177e4SLinus Torvalds Copyright (C) 2000-2001 Qualcomm Incorporated 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 81da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 91da177e4SLinus Torvalds published by the Free Software Foundation; 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 121da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 131da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 141da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 151da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 161da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 171da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 181da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 191da177e4SLinus Torvalds 201da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 211da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 221da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 231da177e4SLinus Torvalds */ 241da177e4SLinus Torvalds 251da177e4SLinus Torvalds #ifndef __HCI_H 261da177e4SLinus Torvalds #define __HCI_H 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds #define HCI_MAX_ACL_SIZE 1024 291da177e4SLinus Torvalds #define HCI_MAX_SCO_SIZE 255 301da177e4SLinus Torvalds #define HCI_MAX_EVENT_SIZE 260 311da177e4SLinus Torvalds #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) 321da177e4SLinus Torvalds 339b3b4460SAndrei Emeltchenko #define HCI_LINK_KEY_SIZE 16 34523e93cdSAndrei Emeltchenko #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 359b3b4460SAndrei Emeltchenko 36903e4541SAndrei Emeltchenko #define HCI_MAX_AMP_ASSOC_SIZE 672 37903e4541SAndrei Emeltchenko 387d1dab49SDoHyun Pyun #define HCI_MAX_CSB_DATA_SIZE 252 397d1dab49SDoHyun Pyun 401da177e4SLinus Torvalds /* HCI dev events */ 411da177e4SLinus Torvalds #define HCI_DEV_REG 1 421da177e4SLinus Torvalds #define HCI_DEV_UNREG 2 431da177e4SLinus Torvalds #define HCI_DEV_UP 3 441da177e4SLinus Torvalds #define HCI_DEV_DOWN 4 451da177e4SLinus Torvalds #define HCI_DEV_SUSPEND 5 461da177e4SLinus Torvalds #define HCI_DEV_RESUME 6 474a3f95b7SMarcel Holtmann #define HCI_DEV_OPEN 7 484a3f95b7SMarcel Holtmann #define HCI_DEV_CLOSE 8 49e131d74aSMarcel Holtmann #define HCI_DEV_SETUP 9 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds /* HCI notify events */ 521da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 531da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 541da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 551da177e4SLinus Torvalds 56c13854ceSMarcel Holtmann /* HCI bus types */ 570ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 581da177e4SLinus Torvalds #define HCI_USB 1 591da177e4SLinus Torvalds #define HCI_PCCARD 2 601da177e4SLinus Torvalds #define HCI_UART 3 611da177e4SLinus Torvalds #define HCI_RS232 4 621da177e4SLinus Torvalds #define HCI_PCI 5 630ac53939SMarcel Holtmann #define HCI_SDIO 6 641da177e4SLinus Torvalds 65943da25dSMarcel Holtmann /* HCI controller types */ 66943da25dSMarcel Holtmann #define HCI_BREDR 0x00 678f1e1742SDavid Vrabel #define HCI_AMP 0x01 68943da25dSMarcel Holtmann 698598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 706ed971caSMarcel Holtmann #define AMP_ID_BREDR 0x00 718598d064SAndrei Emeltchenko 727c13823dSMarcel Holtmann /* AMP controller types */ 737c13823dSMarcel Holtmann #define AMP_TYPE_BREDR 0x00 747c13823dSMarcel Holtmann #define AMP_TYPE_80211 0x01 757c13823dSMarcel Holtmann 76ab846ec4SAndrei Emeltchenko /* AMP controller status */ 77536619e8SMarcel Holtmann #define AMP_STATUS_POWERED_DOWN 0x00 78536619e8SMarcel Holtmann #define AMP_STATUS_BLUETOOTH_ONLY 0x01 79536619e8SMarcel Holtmann #define AMP_STATUS_NO_CAPACITY 0x02 80536619e8SMarcel Holtmann #define AMP_STATUS_LOW_CAPACITY 0x03 81536619e8SMarcel Holtmann #define AMP_STATUS_MEDIUM_CAPACITY 0x04 82536619e8SMarcel Holtmann #define AMP_STATUS_HIGH_CAPACITY 0x05 83536619e8SMarcel Holtmann #define AMP_STATUS_FULL_CAPACITY 0x06 84ab846ec4SAndrei Emeltchenko 851da177e4SLinus Torvalds /* HCI device quirks */ 861da177e4SLinus Torvalds enum { 87118305b5SMarcel Holtmann /* When this quirk is set, the HCI Reset command is send when 88118305b5SMarcel Holtmann * closing the transport instead of when opening it. 89118305b5SMarcel Holtmann * 90118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 91118305b5SMarcel Holtmann */ 92a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 93118305b5SMarcel Holtmann 94118305b5SMarcel Holtmann /* When this quirk is set, the device is turned into a raw-only 95118305b5SMarcel Holtmann * device and it will stay in unconfigured state. 96118305b5SMarcel Holtmann * 97118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 98118305b5SMarcel Holtmann */ 99da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 100118305b5SMarcel Holtmann 101118305b5SMarcel Holtmann /* When this quirk is set, the buffer sizes reported by 102118305b5SMarcel Holtmann * HCI Read Buffer Size command are corrected if invalid. 103118305b5SMarcel Holtmann * 104118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 105118305b5SMarcel Holtmann */ 106f9f462faSMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE, 107118305b5SMarcel Holtmann 108043ec9bfSMarcel Holtmann /* When this quirk is set, then a controller that does not 109043ec9bfSMarcel Holtmann * indicate support for Inquiry Result with RSSI is assumed to 110043ec9bfSMarcel Holtmann * support it anyway. Some early Bluetooth 1.2 controllers had 111043ec9bfSMarcel Holtmann * wrongly configured local features that will require forcing 112043ec9bfSMarcel Holtmann * them to enable this mode. Getting RSSI information with the 113043ec9bfSMarcel Holtmann * inquiry responses is preferred since it allows for a better 114043ec9bfSMarcel Holtmann * user expierence. 115043ec9bfSMarcel Holtmann * 116043ec9bfSMarcel Holtmann * This quirk must be set before hci_register_dev is called. 117043ec9bfSMarcel Holtmann */ 118043ec9bfSMarcel Holtmann HCI_QUIRK_FIXUP_INQUIRY_MODE, 119043ec9bfSMarcel Holtmann 120711ffa78SMarcel Holtmann /* When this quirk is set, then the HCI Read Local Supported 121711ffa78SMarcel Holtmann * Commands command is not supported. In general Bluetooth 1.2 122711ffa78SMarcel Holtmann * and later controllers should support this command. However 123711ffa78SMarcel Holtmann * some controllers indicate Bluetooth 1.2 support, but do 124711ffa78SMarcel Holtmann * not support this command. 125711ffa78SMarcel Holtmann * 126711ffa78SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 127711ffa78SMarcel Holtmann */ 128711ffa78SMarcel Holtmann HCI_QUIRK_BROKEN_LOCAL_COMMANDS, 129711ffa78SMarcel Holtmann 130118305b5SMarcel Holtmann /* When this quirk is set, then no stored link key handling 131118305b5SMarcel Holtmann * is performed. This is mainly due to the fact that the 132118305b5SMarcel Holtmann * HCI Delete Stored Link Key command is advertised, but 133118305b5SMarcel Holtmann * not supported. 134118305b5SMarcel Holtmann * 135118305b5SMarcel Holtmann * This quirk must be set before hci_register_dev is called. 136118305b5SMarcel Holtmann */ 137f9f462faSMarcel Holtmann HCI_QUIRK_BROKEN_STORED_LINK_KEY, 13889bc22d2SMarcel Holtmann 139eb1904f4SMarcel Holtmann /* When this quirk is set, an external configuration step 140eb1904f4SMarcel Holtmann * is required and will be indicated with the controller 141eb1904f4SMarcel Holtmann * configuation. 142eb1904f4SMarcel Holtmann * 143eb1904f4SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 144eb1904f4SMarcel Holtmann * during the hdev->setup vendor callback. 145eb1904f4SMarcel Holtmann */ 146eb1904f4SMarcel Holtmann HCI_QUIRK_EXTERNAL_CONFIG, 147eb1904f4SMarcel Holtmann 14889bc22d2SMarcel Holtmann /* When this quirk is set, the public Bluetooth address 14989bc22d2SMarcel Holtmann * initially reported by HCI Read BD Address command 15089bc22d2SMarcel Holtmann * is considered invalid. Controller configuration is 15189bc22d2SMarcel Holtmann * required before this device can be used. 15289bc22d2SMarcel Holtmann * 15389bc22d2SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 15489bc22d2SMarcel Holtmann * during the hdev->setup vendor callback. 15589bc22d2SMarcel Holtmann */ 15689bc22d2SMarcel Holtmann HCI_QUIRK_INVALID_BDADDR, 15743d6bc46SMarcel Holtmann 15843d6bc46SMarcel Holtmann /* When this quirk is set, the duplicate filtering during 15943d6bc46SMarcel Holtmann * scanning is based on Bluetooth devices addresses. To allow 16043d6bc46SMarcel Holtmann * RSSI based updates, restart scanning if needed. 16143d6bc46SMarcel Holtmann * 16243d6bc46SMarcel Holtmann * This quirk can be set before hci_register_dev is called or 16343d6bc46SMarcel Holtmann * during the hdev->setup vendor callback. 16443d6bc46SMarcel Holtmann */ 16543d6bc46SMarcel Holtmann HCI_QUIRK_STRICT_DUPLICATE_FILTER, 166695c4cb6SJakub Pawlowski 167695c4cb6SJakub Pawlowski /* When this quirk is set, LE scan and BR/EDR inquiry is done 168695c4cb6SJakub Pawlowski * simultaneously, otherwise it's interleaved. 169695c4cb6SJakub Pawlowski * 170695c4cb6SJakub Pawlowski * This quirk can be set before hci_register_dev is called or 171695c4cb6SJakub Pawlowski * during the hdev->setup vendor callback. 172695c4cb6SJakub Pawlowski */ 173695c4cb6SJakub Pawlowski HCI_QUIRK_SIMULTANEOUS_DISCOVERY, 1747e995b9eSMarcel Holtmann 1757e995b9eSMarcel Holtmann /* When this quirk is set, the enabling of diagnostic mode is 1767e995b9eSMarcel Holtmann * not persistent over HCI Reset. Every time the controller 1777e995b9eSMarcel Holtmann * is brought up it needs to be reprogrammed. 1787e995b9eSMarcel Holtmann * 1797e995b9eSMarcel Holtmann * This quirk can be set before hci_register_dev is called or 1807e995b9eSMarcel Holtmann * during the hdev->setup vendor callback. 1817e995b9eSMarcel Holtmann */ 1827e995b9eSMarcel Holtmann HCI_QUIRK_NON_PERSISTENT_DIAG, 1831da177e4SLinus Torvalds }; 1841da177e4SLinus Torvalds 1851da177e4SLinus Torvalds /* HCI device flags */ 1861da177e4SLinus Torvalds enum { 1871da177e4SLinus Torvalds HCI_UP, 1881da177e4SLinus Torvalds HCI_INIT, 1891da177e4SLinus Torvalds HCI_RUNNING, 1901da177e4SLinus Torvalds 1911da177e4SLinus Torvalds HCI_PSCAN, 1921da177e4SLinus Torvalds HCI_ISCAN, 1931da177e4SLinus Torvalds HCI_AUTH, 1941da177e4SLinus Torvalds HCI_ENCRYPT, 1951da177e4SLinus Torvalds HCI_INQUIRY, 1961da177e4SLinus Torvalds 1971da177e4SLinus Torvalds HCI_RAW, 198ab81cbf9SJohan Hedberg 19910572132SGustavo F. Padovan HCI_RESET, 2001da177e4SLinus Torvalds }; 2011da177e4SLinus Torvalds 202f9207338SMarcel Holtmann /* HCI socket flags */ 203f9207338SMarcel Holtmann enum { 20450ebc055SMarcel Holtmann HCI_SOCK_TRUSTED, 205f9207338SMarcel Holtmann HCI_MGMT_INDEX_EVENTS, 206f9207338SMarcel Holtmann HCI_MGMT_UNCONF_INDEX_EVENTS, 207ced85549SMarcel Holtmann HCI_MGMT_EXT_INDEX_EVENTS, 208f6b7712eSMarcel Holtmann HCI_MGMT_GENERIC_EVENTS, 20972000df2SMarcel Holtmann HCI_MGMT_OOB_DATA_EVENTS, 210f9207338SMarcel Holtmann }; 211f9207338SMarcel Holtmann 212d23264a8SAndre Guedes /* 213d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 214d23264a8SAndre Guedes * states from the controller. 215d23264a8SAndre Guedes */ 216d23264a8SAndre Guedes enum { 217a8b2d5c2SJohan Hedberg HCI_SETUP, 218d603b76bSMarcel Holtmann HCI_CONFIG, 219a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 2205e130367SJohan Hedberg HCI_RFKILLED, 221a8b2d5c2SJohan Hedberg HCI_MGMT, 222b6ae8457SJohan Hedberg HCI_BONDABLE, 223a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 2240663b297SJohan Hedberg HCI_KEEP_DEBUG_KEYS, 2253769972bSJohan Hedberg HCI_USE_DEBUG_KEYS, 22694324962SJohan Hovold HCI_UNREGISTER, 2274a964404SMarcel Holtmann HCI_UNCONFIGURED, 2280736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 229dbece37aSMarcel Holtmann HCI_EXT_CONFIGURED, 23066c417c1SJohan Hedberg HCI_LE_ADV, 231d23264a8SAndre Guedes HCI_LE_SCAN, 23284bde9d6SJohan Hedberg HCI_SSP_ENABLED, 233e98d2ce2SMarcel Holtmann HCI_SC_ENABLED, 234134c2a89SMarcel Holtmann HCI_SC_ONLY, 235863efaf2SJohan Hedberg HCI_PRIVACY, 236d6bfd59cSJohan Hedberg HCI_RPA_EXPIRED, 23741edf160SJohan Hedberg HCI_RPA_RESOLVING, 2386d80dfd0SJohan Hedberg HCI_HS_ENABLED, 23906199cf8SJohan Hedberg HCI_LE_ENABLED, 240f3d3444aSJohan Hedberg HCI_ADVERTISING, 241cc91cb04SMarcel Holtmann HCI_ADVERTISING_CONNECTABLE, 2424453b006SArman Uguray HCI_ADVERTISING_INSTANCE, 2435e5282bbSJohan Hedberg HCI_CONNECTABLE, 2445e5282bbSJohan Hedberg HCI_DISCOVERABLE, 2456acd7db4SMarcel Holtmann HCI_LIMITED_DISCOVERABLE, 24647990ea0SJohan Hedberg HCI_LINK_SECURITY, 24721693c15SAndre Guedes HCI_PERIODIC_INQ, 2481a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 24956f87901SJohan Hedberg HCI_BREDR_ENABLED, 25081ad6fd9SJohan Hedberg HCI_LE_SCAN_INTERRUPTED, 251b7cb93e5SMarcel Holtmann 252b7cb93e5SMarcel Holtmann HCI_DUT_MODE, 2534b4113d6SMarcel Holtmann HCI_VENDOR_DIAG, 254b7cb93e5SMarcel Holtmann HCI_FORCE_BREDR_SMP, 255b7cb93e5SMarcel Holtmann HCI_FORCE_STATIC_ADDR, 256b7cb93e5SMarcel Holtmann 257eacb44dfSMarcel Holtmann __HCI_NUM_FLAGS, 258d23264a8SAndre Guedes }; 259d23264a8SAndre Guedes 2601da177e4SLinus Torvalds /* HCI timeouts */ 2615f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2625f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 2635f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 264d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2655f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 2669345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 267a3172b7eSJohan Hedberg #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ 2689489eca4SJohan Hedberg #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ 26909ae260bSJohan Hedberg #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 2701da177e4SLinus Torvalds 2715b7f9909SMarcel Holtmann /* HCI data types */ 2721da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 2731da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 2741da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 2751da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 276e875ff84SMarcel Holtmann #define HCI_DIAG_PKT 0xf0 2771da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 2781da177e4SLinus Torvalds 2795b7f9909SMarcel Holtmann /* HCI packet types */ 2801da177e4SLinus Torvalds #define HCI_DM1 0x0008 2811da177e4SLinus Torvalds #define HCI_DM3 0x0400 2821da177e4SLinus Torvalds #define HCI_DM5 0x4000 2831da177e4SLinus Torvalds #define HCI_DH1 0x0010 2841da177e4SLinus Torvalds #define HCI_DH3 0x0800 2851da177e4SLinus Torvalds #define HCI_DH5 0x8000 2861da177e4SLinus Torvalds 2871da177e4SLinus Torvalds #define HCI_HV1 0x0020 2881da177e4SLinus Torvalds #define HCI_HV2 0x0040 2891da177e4SLinus Torvalds #define HCI_HV3 0x0080 2901da177e4SLinus Torvalds 2911da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 2921da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 2931da177e4SLinus Torvalds 2945b7f9909SMarcel Holtmann /* eSCO packet types */ 2955b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 2965b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 2975b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 2985b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 2995b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 3005b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 301efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 302efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 303efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 304efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 3055b7f9909SMarcel Holtmann 306a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 307efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 308a8746417SMarcel Holtmann 3091da177e4SLinus Torvalds /* ACL flags */ 310e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 3111da177e4SLinus Torvalds #define ACL_CONT 0x01 3121da177e4SLinus Torvalds #define ACL_START 0x02 313d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 3141da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 3151da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 3161da177e4SLinus Torvalds 3171da177e4SLinus Torvalds /* Baseband links */ 3181da177e4SLinus Torvalds #define SCO_LINK 0x00 3191da177e4SLinus Torvalds #define ACL_LINK 0x01 3205b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 321fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 322fcd89c09SVille Tervo #define LE_LINK 0x80 3233161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 324845472e8SMarcel Holtmann #define INVALID_LINK 0xff 3251da177e4SLinus Torvalds 3261da177e4SLinus Torvalds /* LMP features */ 3271da177e4SLinus Torvalds #define LMP_3SLOT 0x01 3281da177e4SLinus Torvalds #define LMP_5SLOT 0x02 3291da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 3301da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 3311da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 3321da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 3331da177e4SLinus Torvalds #define LMP_HOLD 0x40 33404837f64SMarcel Holtmann #define LMP_SNIFF 0x80 3351da177e4SLinus Torvalds 3361da177e4SLinus Torvalds #define LMP_PARK 0x01 3371da177e4SLinus Torvalds #define LMP_RSSI 0x02 3381da177e4SLinus Torvalds #define LMP_QUALITY 0x04 3391da177e4SLinus Torvalds #define LMP_SCO 0x08 3401da177e4SLinus Torvalds #define LMP_HV2 0x10 3411da177e4SLinus Torvalds #define LMP_HV3 0x20 3421da177e4SLinus Torvalds #define LMP_ULAW 0x40 3431da177e4SLinus Torvalds #define LMP_ALAW 0x80 3441da177e4SLinus Torvalds 3451da177e4SLinus Torvalds #define LMP_CVSD 0x01 3461da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 3471da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 34807a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 3491da177e4SLinus Torvalds 350d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 3515b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 3525b7f9909SMarcel Holtmann 3535b7f9909SMarcel Holtmann #define LMP_EV4 0x01 3545b7f9909SMarcel Holtmann #define LMP_EV5 0x02 35569ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 356d5859e22SJohan Hedberg #define LMP_LE 0x40 3575b7f9909SMarcel Holtmann 35804837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 359d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 360efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 361efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 362efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 36304837f64SMarcel Holtmann 364d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 365e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 366769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 367e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 368769be974SMarcel Holtmann 369d5859e22SJohan Hedberg #define LMP_LSTO 0x01 370d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 371971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 372d5859e22SJohan Hedberg 373eead27daSAndre Guedes /* Extended LMP features */ 37453b834d2SMarcel Holtmann #define LMP_CSB_MASTER 0x01 37553b834d2SMarcel Holtmann #define LMP_CSB_SLAVE 0x02 37653b834d2SMarcel Holtmann #define LMP_SYNC_TRAIN 0x04 37753b834d2SMarcel Holtmann #define LMP_SYNC_SCAN 0x08 37853b834d2SMarcel Holtmann 379d5991585SMarcel Holtmann #define LMP_SC 0x01 380d5991585SMarcel Holtmann #define LMP_PING 0x02 381d5991585SMarcel Holtmann 38253b834d2SMarcel Holtmann /* Host features */ 383cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 384eead27daSAndre Guedes #define LMP_HOST_LE 0x02 385cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 386d5991585SMarcel Holtmann #define LMP_HOST_SC 0x08 387eead27daSAndre Guedes 388662bc2e6SAndre Guedes /* LE features */ 3890da71f1bSMarcel Holtmann #define HCI_LE_ENCRYPTION 0x01 390662bc2e6SAndre Guedes #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 3910fe29fd1SMarcel Holtmann #define HCI_LE_SLAVE_FEATURES 0x08 392cd7ca0ecSMarcel Holtmann #define HCI_LE_PING 0x10 39394a3bd02SMarcel Holtmann #define HCI_LE_DATA_LEN_EXT 0x20 3944b71bba4SMarcel Holtmann #define HCI_LE_EXT_SCAN_POLICY 0x80 395662bc2e6SAndre Guedes 39604837f64SMarcel Holtmann /* Connection modes */ 39704837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 39804837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 39904837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 40004837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 40104837f64SMarcel Holtmann 4021da177e4SLinus Torvalds /* Link policies */ 4031da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 4041da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 4051da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 4061da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 4071da177e4SLinus Torvalds 40804837f64SMarcel Holtmann /* Link modes */ 4091da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 4101da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 4111da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 4121da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 4131da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 4141da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 4151da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 4167b5a9241SMarcel Holtmann #define HCI_LM_FIPS 0x0040 4171da177e4SLinus Torvalds 41840be492fSMarcel Holtmann /* Authentication types */ 41940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 42040be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 42140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 42240be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 42340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 42440be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 42540be492fSMarcel Holtmann 426a77b15a6SMikel Astiz /* I/O capabilities */ 427a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 428a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 429a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 430a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 431a77b15a6SMikel Astiz 432b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 433b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 434b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 435b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 436b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 43711015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P192 0x04 43811015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P192 0x05 439b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 44011015c79SMarcel Holtmann #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 44111015c79SMarcel Holtmann #define HCI_LK_AUTH_COMBINATION_P256 0x08 442b6020ba0SWaldemar Rymarkiewicz 4439f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 4448e75b46aSAndre Guedes #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 4459f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 4462acf3d90SAndre Guedes #define HCI_ERROR_MEMORY_EXCEEDED 0x07 447cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 448d41c15cfSJohan Hedberg #define HCI_ERROR_REJ_LIMITED_RESOURCES 0x0d 4499f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 4509f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 451cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 452cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 4539f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 4549f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 455*4ebeee2dSJohan Hedberg #define HCI_ERROR_INVALID_LL_PARAMS 0x1e 456*4ebeee2dSJohan Hedberg #define HCI_ERROR_UNSPECIFIED 0x1f 4573c857757SJohan Hedberg #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c 4589f5a0d7bSAndrei Emeltchenko 4592455a3eaSAndrei Emeltchenko /* Flow control modes */ 4602455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 4612455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 4622455a3eaSAndrei Emeltchenko 463bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 464bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 465a89612aaSMarcel Holtmann #define HCI_RSSI_INVALID 127 466bbaf444aSJohan Hedberg 467ba165a90SJohan Hedberg #define HCI_ROLE_MASTER 0x00 468ba165a90SJohan Hedberg #define HCI_ROLE_SLAVE 0x01 469ba165a90SJohan Hedberg 47032748db0SJohan Hedberg /* Extended Inquiry Response field types */ 47132748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 47232748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 47332748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 47432748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 47532748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 47632748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 47732748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 47832748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 47932748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 48032748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 4819ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 482d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C192 0x0E /* Simple Pairing Hash C-192 */ 483d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R192 0x0F /* Simple Pairing Randomizer R-192 */ 48432748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 4854453b006SArman Uguray #define EIR_APPEARANCE 0x19 /* Device appearance */ 4861471aae0SMarcel Holtmann #define EIR_LE_BDADDR 0x1B /* LE Bluetooth device address */ 4871471aae0SMarcel Holtmann #define EIR_LE_ROLE 0x1C /* LE role */ 488d619ffcfSJohan Hedberg #define EIR_SSP_HASH_C256 0x1D /* Simple Pairing Hash C-256 */ 489d619ffcfSJohan Hedberg #define EIR_SSP_RAND_R256 0x1E /* Simple Pairing Rand R-256 */ 490f709bfcfSMarcel Holtmann #define EIR_LE_SC_CONFIRM 0x22 /* LE SC Confirmation Value */ 491f709bfcfSMarcel Holtmann #define EIR_LE_SC_RANDOM 0x23 /* LE SC Random Value */ 49232748db0SJohan Hedberg 4933f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 4943f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 4953f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 4963f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 4973f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 4983f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 4993f0f524bSJohan Hedberg 5001da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 5016bd32326SVille Tervo #define HCI_OP_NOP 0x0000 5026bd32326SVille Tervo 503a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 504a9de9248SMarcel Holtmann struct hci_cp_inquiry { 505a9de9248SMarcel Holtmann __u8 lap[3]; 506a9de9248SMarcel Holtmann __u8 length; 507a9de9248SMarcel Holtmann __u8 num_rsp; 50866c853ccSGustavo F. Padovan } __packed; 5091da177e4SLinus Torvalds 510a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 511a9de9248SMarcel Holtmann 51279d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 51379d6e068SAndre Guedes 514a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 515a9de9248SMarcel Holtmann 516a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 517a9de9248SMarcel Holtmann struct hci_cp_create_conn { 518a9de9248SMarcel Holtmann bdaddr_t bdaddr; 519a9de9248SMarcel Holtmann __le16 pkt_type; 520a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 521a9de9248SMarcel Holtmann __u8 pscan_mode; 522a9de9248SMarcel Holtmann __le16 clock_offset; 523a9de9248SMarcel Holtmann __u8 role_switch; 52466c853ccSGustavo F. Padovan } __packed; 5251da177e4SLinus Torvalds 526a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 527a9de9248SMarcel Holtmann struct hci_cp_disconnect { 528a9de9248SMarcel Holtmann __le16 handle; 529a9de9248SMarcel Holtmann __u8 reason; 53066c853ccSGustavo F. Padovan } __packed; 5311da177e4SLinus Torvalds 532a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 533a9de9248SMarcel Holtmann struct hci_cp_add_sco { 534a9de9248SMarcel Holtmann __le16 handle; 535a9de9248SMarcel Holtmann __le16 pkt_type; 53666c853ccSGustavo F. Padovan } __packed; 537a9de9248SMarcel Holtmann 538a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 539a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 5401da177e4SLinus Torvalds bdaddr_t bdaddr; 54166c853ccSGustavo F. Padovan } __packed; 5421da177e4SLinus Torvalds 543a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 544a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 545a9de9248SMarcel Holtmann bdaddr_t bdaddr; 546a9de9248SMarcel Holtmann __u8 role; 54766c853ccSGustavo F. Padovan } __packed; 5481da177e4SLinus Torvalds 549a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 550a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 551a9de9248SMarcel Holtmann bdaddr_t bdaddr; 552a9de9248SMarcel Holtmann __u8 reason; 55366c853ccSGustavo F. Padovan } __packed; 5541da177e4SLinus Torvalds 555a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 556a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 557a9de9248SMarcel Holtmann bdaddr_t bdaddr; 5589b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 55966c853ccSGustavo F. Padovan } __packed; 5601da177e4SLinus Torvalds 561a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 562a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 563a9de9248SMarcel Holtmann bdaddr_t bdaddr; 56466c853ccSGustavo F. Padovan } __packed; 5651da177e4SLinus Torvalds 566a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 567a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 568a9de9248SMarcel Holtmann bdaddr_t bdaddr; 569a9de9248SMarcel Holtmann __u8 pin_len; 570a9de9248SMarcel Holtmann __u8 pin_code[16]; 57166c853ccSGustavo F. Padovan } __packed; 572980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 573980e1a53SJohan Hedberg __u8 status; 574980e1a53SJohan Hedberg bdaddr_t bdaddr; 575980e1a53SJohan Hedberg } __packed; 576a9de9248SMarcel Holtmann 577a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 578a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 579a9de9248SMarcel Holtmann bdaddr_t bdaddr; 58066c853ccSGustavo F. Padovan } __packed; 581980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 582980e1a53SJohan Hedberg __u8 status; 583980e1a53SJohan Hedberg bdaddr_t bdaddr; 584980e1a53SJohan Hedberg } __packed; 585a9de9248SMarcel Holtmann 586a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 587a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 588a9de9248SMarcel Holtmann __le16 handle; 589a9de9248SMarcel Holtmann __le16 pkt_type; 59066c853ccSGustavo F. Padovan } __packed; 591a9de9248SMarcel Holtmann 592a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 593a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 594a9de9248SMarcel Holtmann __le16 handle; 59566c853ccSGustavo F. Padovan } __packed; 596a9de9248SMarcel Holtmann 597a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 598a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 599a9de9248SMarcel Holtmann __le16 handle; 600a9de9248SMarcel Holtmann __u8 encrypt; 60166c853ccSGustavo F. Padovan } __packed; 602a9de9248SMarcel Holtmann 603a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 604a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 605a9de9248SMarcel Holtmann __le16 handle; 60666c853ccSGustavo F. Padovan } __packed; 607a9de9248SMarcel Holtmann 608a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 609a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 610a9de9248SMarcel Holtmann bdaddr_t bdaddr; 611a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 612a9de9248SMarcel Holtmann __u8 pscan_mode; 613a9de9248SMarcel Holtmann __le16 clock_offset; 61466c853ccSGustavo F. Padovan } __packed; 615a9de9248SMarcel Holtmann 616a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 617a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 618a9de9248SMarcel Holtmann bdaddr_t bdaddr; 61966c853ccSGustavo F. Padovan } __packed; 620a9de9248SMarcel Holtmann 621a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 622a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 623a9de9248SMarcel Holtmann __le16 handle; 62466c853ccSGustavo F. Padovan } __packed; 625a9de9248SMarcel Holtmann 626a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 627a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 628a9de9248SMarcel Holtmann __le16 handle; 629a9de9248SMarcel Holtmann __u8 page; 63066c853ccSGustavo F. Padovan } __packed; 631a9de9248SMarcel Holtmann 632a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 633a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 634a9de9248SMarcel Holtmann __le16 handle; 63566c853ccSGustavo F. Padovan } __packed; 636a9de9248SMarcel Holtmann 637df935429SMarcel Holtmann #define HCI_OP_READ_CLOCK_OFFSET 0x041f 638df935429SMarcel Holtmann struct hci_cp_read_clock_offset { 639df935429SMarcel Holtmann __le16 handle; 640df935429SMarcel Holtmann } __packed; 641df935429SMarcel Holtmann 642a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 643a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 644a9de9248SMarcel Holtmann __le16 handle; 645a9de9248SMarcel Holtmann __le32 tx_bandwidth; 646a9de9248SMarcel Holtmann __le32 rx_bandwidth; 647a9de9248SMarcel Holtmann __le16 max_latency; 648a9de9248SMarcel Holtmann __le16 voice_setting; 649a9de9248SMarcel Holtmann __u8 retrans_effort; 650a9de9248SMarcel Holtmann __le16 pkt_type; 65166c853ccSGustavo F. Padovan } __packed; 652a9de9248SMarcel Holtmann 653a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 654a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 655a9de9248SMarcel Holtmann bdaddr_t bdaddr; 656a9de9248SMarcel Holtmann __le32 tx_bandwidth; 657a9de9248SMarcel Holtmann __le32 rx_bandwidth; 658a9de9248SMarcel Holtmann __le16 max_latency; 659a9de9248SMarcel Holtmann __le16 content_format; 660a9de9248SMarcel Holtmann __u8 retrans_effort; 661a9de9248SMarcel Holtmann __le16 pkt_type; 66266c853ccSGustavo F. Padovan } __packed; 663a9de9248SMarcel Holtmann 664a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 665a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 666a9de9248SMarcel Holtmann bdaddr_t bdaddr; 667a9de9248SMarcel Holtmann __u8 reason; 66866c853ccSGustavo F. Padovan } __packed; 669a9de9248SMarcel Holtmann 67017fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 67117fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 67217fa4b9dSJohan Hedberg bdaddr_t bdaddr; 67317fa4b9dSJohan Hedberg __u8 capability; 67417fa4b9dSJohan Hedberg __u8 oob_data; 67517fa4b9dSJohan Hedberg __u8 authentication; 67617fa4b9dSJohan Hedberg } __packed; 67717fa4b9dSJohan Hedberg 678a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 679a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 680a5c29683SJohan Hedberg bdaddr_t bdaddr; 681a5c29683SJohan Hedberg } __packed; 682a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 683a5c29683SJohan Hedberg __u8 status; 684a5c29683SJohan Hedberg bdaddr_t bdaddr; 685a5c29683SJohan Hedberg } __packed; 686a5c29683SJohan Hedberg 687a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 688a5c29683SJohan Hedberg 6899ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 6909ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 6919ad4019aSBrian Gix bdaddr_t bdaddr; 6929ad4019aSBrian Gix __le32 passkey; 6939ad4019aSBrian Gix } __packed; 6949ad4019aSBrian Gix 6959ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 6969ad4019aSBrian Gix 6972763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 6982763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 6992763eda6SSzymon Janc bdaddr_t bdaddr; 7002763eda6SSzymon Janc __u8 hash[16]; 70138da1703SJohan Hedberg __u8 rand[16]; 7022763eda6SSzymon Janc } __packed; 7032763eda6SSzymon Janc 7042763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 7052763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 7062763eda6SSzymon Janc bdaddr_t bdaddr; 7072763eda6SSzymon Janc } __packed; 7082763eda6SSzymon Janc 70903b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 71003b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 71103b555e1SJohan Hedberg bdaddr_t bdaddr; 71203b555e1SJohan Hedberg __u8 reason; 71303b555e1SJohan Hedberg } __packed; 71403b555e1SJohan Hedberg 715523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 716523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 717523e93cdSAndrei Emeltchenko __u8 phy_handle; 718523e93cdSAndrei Emeltchenko __u8 key_len; 719523e93cdSAndrei Emeltchenko __u8 key_type; 720523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 721523e93cdSAndrei Emeltchenko } __packed; 722523e93cdSAndrei Emeltchenko 723523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 724523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 725523e93cdSAndrei Emeltchenko __u8 phy_handle; 726523e93cdSAndrei Emeltchenko __u8 key_len; 727523e93cdSAndrei Emeltchenko __u8 key_type; 728523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 729523e93cdSAndrei Emeltchenko } __packed; 730523e93cdSAndrei Emeltchenko 731523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 732523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 733523e93cdSAndrei Emeltchenko __u8 phy_handle; 734523e93cdSAndrei Emeltchenko __u8 reason; 735b078b564SAndrei Emeltchenko } __packed; 736b078b564SAndrei Emeltchenko 737b078b564SAndrei Emeltchenko struct ext_flow_spec { 738b078b564SAndrei Emeltchenko __u8 id; 739b078b564SAndrei Emeltchenko __u8 stype; 740b078b564SAndrei Emeltchenko __le16 msdu; 741b078b564SAndrei Emeltchenko __le32 sdu_itime; 742b078b564SAndrei Emeltchenko __le32 acc_lat; 743b078b564SAndrei Emeltchenko __le32 flush_to; 744b078b564SAndrei Emeltchenko } __packed; 745b078b564SAndrei Emeltchenko 746b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 747b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 748b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 749b078b564SAndrei Emeltchenko __u8 phy_handle; 750b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 751b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 752b078b564SAndrei Emeltchenko } __packed; 753b078b564SAndrei Emeltchenko 754b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 755b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 756b078b564SAndrei Emeltchenko __le16 log_handle; 757b078b564SAndrei Emeltchenko } __packed; 758b078b564SAndrei Emeltchenko 759b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 760b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 761b078b564SAndrei Emeltchenko __u8 phy_handle; 762b078b564SAndrei Emeltchenko __u8 flow_spec_id; 763b078b564SAndrei Emeltchenko } __packed; 764b078b564SAndrei Emeltchenko 765b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 766b078b564SAndrei Emeltchenko __u8 status; 767b078b564SAndrei Emeltchenko __u8 phy_handle; 768b078b564SAndrei Emeltchenko __u8 flow_spec_id; 769523e93cdSAndrei Emeltchenko } __packed; 770523e93cdSAndrei Emeltchenko 7718c9a041bSDoHyun Pyun #define HCI_OP_SET_CSB 0x0441 7728c9a041bSDoHyun Pyun struct hci_cp_set_csb { 7738c9a041bSDoHyun Pyun __u8 enable; 7748c9a041bSDoHyun Pyun __u8 lt_addr; 7758c9a041bSDoHyun Pyun __u8 lpo_allowed; 7768c9a041bSDoHyun Pyun __le16 packet_type; 7778c9a041bSDoHyun Pyun __le16 interval_min; 7788c9a041bSDoHyun Pyun __le16 interval_max; 7798c9a041bSDoHyun Pyun __le16 csb_sv_tout; 7808c9a041bSDoHyun Pyun } __packed; 7818c9a041bSDoHyun Pyun struct hci_rp_set_csb { 7828c9a041bSDoHyun Pyun __u8 status; 7838c9a041bSDoHyun Pyun __u8 lt_addr; 7848c9a041bSDoHyun Pyun __le16 interval; 7858c9a041bSDoHyun Pyun } __packed; 7868c9a041bSDoHyun Pyun 787cefded98SDoHyun Pyun #define HCI_OP_START_SYNC_TRAIN 0x0443 788cefded98SDoHyun Pyun 789e2f99131SMarcel Holtmann #define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445 790e2f99131SMarcel Holtmann struct hci_cp_remote_oob_ext_data_reply { 791e2f99131SMarcel Holtmann bdaddr_t bdaddr; 792e2f99131SMarcel Holtmann __u8 hash192[16]; 79338da1703SJohan Hedberg __u8 rand192[16]; 794e2f99131SMarcel Holtmann __u8 hash256[16]; 79538da1703SJohan Hedberg __u8 rand256[16]; 796e2f99131SMarcel Holtmann } __packed; 797e2f99131SMarcel Holtmann 798a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 799a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 800a9de9248SMarcel Holtmann __le16 handle; 801a9de9248SMarcel Holtmann __le16 max_interval; 802a9de9248SMarcel Holtmann __le16 min_interval; 803a9de9248SMarcel Holtmann __le16 attempt; 804a9de9248SMarcel Holtmann __le16 timeout; 80566c853ccSGustavo F. Padovan } __packed; 806a9de9248SMarcel Holtmann 807a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 808a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 809a9de9248SMarcel Holtmann __le16 handle; 81066c853ccSGustavo F. Padovan } __packed; 811a9de9248SMarcel Holtmann 812a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 813a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 814a9de9248SMarcel Holtmann __le16 handle; 81566c853ccSGustavo F. Padovan } __packed; 816a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 817a9de9248SMarcel Holtmann __u8 status; 818a9de9248SMarcel Holtmann __le16 handle; 819a9de9248SMarcel Holtmann __u8 role; 82066c853ccSGustavo F. Padovan } __packed; 821a9de9248SMarcel Holtmann 822a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 823a9de9248SMarcel Holtmann struct hci_cp_switch_role { 824a9de9248SMarcel Holtmann bdaddr_t bdaddr; 825a9de9248SMarcel Holtmann __u8 role; 82666c853ccSGustavo F. Padovan } __packed; 827a9de9248SMarcel Holtmann 828a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 829a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 830a9de9248SMarcel Holtmann __le16 handle; 83166c853ccSGustavo F. Padovan } __packed; 832a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 833a9de9248SMarcel Holtmann __u8 status; 834a9de9248SMarcel Holtmann __le16 handle; 835a9de9248SMarcel Holtmann __le16 policy; 83666c853ccSGustavo F. Padovan } __packed; 837a9de9248SMarcel Holtmann 838a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 839a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 840a9de9248SMarcel Holtmann __le16 handle; 841a9de9248SMarcel Holtmann __le16 policy; 84266c853ccSGustavo F. Padovan } __packed; 843a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 844a9de9248SMarcel Holtmann __u8 status; 845a9de9248SMarcel Holtmann __le16 handle; 84666c853ccSGustavo F. Padovan } __packed; 847a9de9248SMarcel Holtmann 848e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 849e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 850e4e8e37cSMarcel Holtmann __u8 status; 851e4e8e37cSMarcel Holtmann __le16 policy; 85266c853ccSGustavo F. Padovan } __packed; 853e4e8e37cSMarcel Holtmann 854e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 855e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 856e4e8e37cSMarcel Holtmann __le16 policy; 85766c853ccSGustavo F. Padovan } __packed; 858e4e8e37cSMarcel Holtmann 859a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 860a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 861a9de9248SMarcel Holtmann __le16 handle; 862a9de9248SMarcel Holtmann __le16 max_latency; 863a9de9248SMarcel Holtmann __le16 min_remote_timeout; 864a9de9248SMarcel Holtmann __le16 min_local_timeout; 86566c853ccSGustavo F. Padovan } __packed; 866a9de9248SMarcel Holtmann 867a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 868a9de9248SMarcel Holtmann 869a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 870a9de9248SMarcel Holtmann 871a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 8721da177e4SLinus Torvalds struct hci_cp_set_event_flt { 8731da177e4SLinus Torvalds __u8 flt_type; 8741da177e4SLinus Torvalds __u8 cond_type; 8751da177e4SLinus Torvalds __u8 condition[0]; 87666c853ccSGustavo F. Padovan } __packed; 8771da177e4SLinus Torvalds 8781da177e4SLinus Torvalds /* Filter types */ 8791da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 8801da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 8811da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 8821da177e4SLinus Torvalds 8831da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 8841da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 8851da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 8861da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 8871da177e4SLinus Torvalds 8881da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 8891da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 8901da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 8911da177e4SLinus Torvalds 892cb962780SMarcel Holtmann #define HCI_OP_READ_STORED_LINK_KEY 0x0c0d 893cb962780SMarcel Holtmann struct hci_cp_read_stored_link_key { 894cb962780SMarcel Holtmann bdaddr_t bdaddr; 895cb962780SMarcel Holtmann __u8 read_all; 896cb962780SMarcel Holtmann } __packed; 897cb962780SMarcel Holtmann struct hci_rp_read_stored_link_key { 898cb962780SMarcel Holtmann __u8 status; 899cb962780SMarcel Holtmann __u8 max_keys; 900cb962780SMarcel Holtmann __u8 num_keys; 901cb962780SMarcel Holtmann } __packed; 902cb962780SMarcel Holtmann 903b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 904b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 905b0916ea0SJohan Hedberg bdaddr_t bdaddr; 906b0916ea0SJohan Hedberg __u8 delete_all; 907b0916ea0SJohan Hedberg } __packed; 908039d4e41SMarcel Holtmann struct hci_rp_delete_stored_link_key { 909039d4e41SMarcel Holtmann __u8 status; 910039d4e41SMarcel Holtmann __u8 num_keys; 911039d4e41SMarcel Holtmann } __packed; 912b0916ea0SJohan Hedberg 9131f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 9141f6c6378SJohan Hedberg 915a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 916a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 9171f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 91866c853ccSGustavo F. Padovan } __packed; 919a9de9248SMarcel Holtmann 920a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 921a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 922a9de9248SMarcel Holtmann __u8 status; 9231f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 92466c853ccSGustavo F. Padovan } __packed; 925a9de9248SMarcel Holtmann 926a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 927a9de9248SMarcel Holtmann 928a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 929a9de9248SMarcel Holtmann 930a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 931a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 932a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 933a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 934a9de9248SMarcel Holtmann 935a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 936a9de9248SMarcel Holtmann 937a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 938a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 939a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 940a9de9248SMarcel Holtmann 941a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 942a9de9248SMarcel Holtmann 943a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 944a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 945a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 946a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 947a9de9248SMarcel Holtmann 948a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 949a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 9501da177e4SLinus Torvalds __u8 status; 9511da177e4SLinus Torvalds __u8 dev_class[3]; 95266c853ccSGustavo F. Padovan } __packed; 9531da177e4SLinus Torvalds 954a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 955a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 9561da177e4SLinus Torvalds __u8 dev_class[3]; 95766c853ccSGustavo F. Padovan } __packed; 9581da177e4SLinus Torvalds 959a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 9601da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 9611da177e4SLinus Torvalds __u8 status; 9621ebb9252SMarcel Holtmann __le16 voice_setting; 96366c853ccSGustavo F. Padovan } __packed; 9641da177e4SLinus Torvalds 965a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 9661da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 9671ebb9252SMarcel Holtmann __le16 voice_setting; 96866c853ccSGustavo F. Padovan } __packed; 9691da177e4SLinus Torvalds 970a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 9711da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 9721ebb9252SMarcel Holtmann __le16 acl_mtu; 9731da177e4SLinus Torvalds __u8 sco_mtu; 9741ebb9252SMarcel Holtmann __le16 acl_max_pkt; 9751ebb9252SMarcel Holtmann __le16 sco_max_pkt; 97666c853ccSGustavo F. Padovan } __packed; 9771da177e4SLinus Torvalds 978b4cb9fb2SMarcel Holtmann #define HCI_OP_READ_NUM_SUPPORTED_IAC 0x0c38 979b4cb9fb2SMarcel Holtmann struct hci_rp_read_num_supported_iac { 980b4cb9fb2SMarcel Holtmann __u8 status; 981b4cb9fb2SMarcel Holtmann __u8 num_iac; 982b4cb9fb2SMarcel Holtmann } __packed; 983b4cb9fb2SMarcel Holtmann 9844b836f39SMarcel Holtmann #define HCI_OP_READ_CURRENT_IAC_LAP 0x0c39 9854b836f39SMarcel Holtmann 9863d505312SMarcel Holtmann #define HCI_OP_WRITE_CURRENT_IAC_LAP 0x0c3a 9873d505312SMarcel Holtmann struct hci_cp_write_current_iac_lap { 9883d505312SMarcel Holtmann __u8 num_iac; 9893d505312SMarcel Holtmann __u8 iac_lap[6]; 9903d505312SMarcel Holtmann } __packed; 9913d505312SMarcel Holtmann 992d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 993d5859e22SJohan Hedberg 99480a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 99580a1e1dbSJohan Hedberg 99680a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 99780a1e1dbSJohan Hedberg struct hci_cp_write_eir { 998816a11d5SJohan Hedberg __u8 fec; 999816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 100080a1e1dbSJohan Hedberg } __packed; 100180a1e1dbSJohan Hedberg 1002333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 1003333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 1004333140b5SMarcel Holtmann __u8 status; 1005333140b5SMarcel Holtmann __u8 mode; 100666c853ccSGustavo F. Padovan } __packed; 1007333140b5SMarcel Holtmann 1008333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 1009333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 1010333140b5SMarcel Holtmann __u8 mode; 101166c853ccSGustavo F. Padovan } __packed; 1012333140b5SMarcel Holtmann 1013c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 1014c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 1015c35938b2SSzymon Janc __u8 status; 1016c35938b2SSzymon Janc __u8 hash[16]; 101738da1703SJohan Hedberg __u8 rand[16]; 1018c35938b2SSzymon Janc } __packed; 1019c35938b2SSzymon Janc 1020d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 102191c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 102291c4e9b1SMarcel Holtmann __u8 status; 102391c4e9b1SMarcel Holtmann __s8 tx_power; 102491c4e9b1SMarcel Holtmann } __packed; 1025d5859e22SJohan Hedberg 1026d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 1027d62e6d67SJohan Hedberg 10287528ca1cSMarcel Holtmann #define HCI_OP_READ_LOCATION_DATA 0x0c64 10297528ca1cSMarcel Holtmann 10301e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 10311e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 10321e89cffbSAndrei Emeltchenko __u8 status; 10331e89cffbSAndrei Emeltchenko __u8 mode; 10341e89cffbSAndrei Emeltchenko } __packed; 10351e89cffbSAndrei Emeltchenko 1036f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 1037f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 1038f9b49306SAndre Guedes __u8 le; 1039f9b49306SAndre Guedes __u8 simul; 1040f9b49306SAndre Guedes } __packed; 1041f9b49306SAndre Guedes 1042d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 1043d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 1044d0bf75a5SDoHyun Pyun __u8 lt_addr; 1045d0bf75a5SDoHyun Pyun } __packed; 1046d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 1047d0bf75a5SDoHyun Pyun __u8 status; 1048d0bf75a5SDoHyun Pyun __u8 lt_addr; 1049d0bf75a5SDoHyun Pyun } __packed; 1050d0bf75a5SDoHyun Pyun 10516a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 10526a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 10536a20eaf4SDoHyun Pyun __u8 lt_addr; 10546a20eaf4SDoHyun Pyun } __packed; 10556a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 10566a20eaf4SDoHyun Pyun __u8 status; 10576a20eaf4SDoHyun Pyun __u8 lt_addr; 10586a20eaf4SDoHyun Pyun } __packed; 10596a20eaf4SDoHyun Pyun 10607d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 10617d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 10627d1dab49SDoHyun Pyun __u8 lt_addr; 10637d1dab49SDoHyun Pyun __u8 fragment; 10647d1dab49SDoHyun Pyun __u8 data_length; 10657d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 10667d1dab49SDoHyun Pyun } __packed; 10677d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 10687d1dab49SDoHyun Pyun __u8 status; 10697d1dab49SDoHyun Pyun __u8 lt_addr; 10707d1dab49SDoHyun Pyun } __packed; 10717d1dab49SDoHyun Pyun 10725d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 10735d4e7e8dSJohan Hedberg 1074a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 1075a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 1076a9b07a64SDoHyun Pyun __le16 interval_min; 1077a9b07a64SDoHyun Pyun __le16 interval_max; 1078a9b07a64SDoHyun Pyun __le32 sync_train_tout; 1079a9b07a64SDoHyun Pyun __u8 service_data; 1080a9b07a64SDoHyun Pyun } __packed; 1081a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 1082a9b07a64SDoHyun Pyun __u8 status; 1083a9b07a64SDoHyun Pyun __le16 sync_train_int; 1084a9b07a64SDoHyun Pyun } __packed; 1085a9b07a64SDoHyun Pyun 1086eb4b95c6SMarcel Holtmann #define HCI_OP_READ_SC_SUPPORT 0x0c79 1087eb4b95c6SMarcel Holtmann struct hci_rp_read_sc_support { 1088eb4b95c6SMarcel Holtmann __u8 status; 1089eb4b95c6SMarcel Holtmann __u8 support; 1090eb4b95c6SMarcel Holtmann } __packed; 1091eb4b95c6SMarcel Holtmann 1092eb4b95c6SMarcel Holtmann #define HCI_OP_WRITE_SC_SUPPORT 0x0c7a 1093eb4b95c6SMarcel Holtmann struct hci_cp_write_sc_support { 1094eb4b95c6SMarcel Holtmann __u8 support; 1095eb4b95c6SMarcel Holtmann } __packed; 1096eb4b95c6SMarcel Holtmann 1097e2f99131SMarcel Holtmann #define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d 1098e2f99131SMarcel Holtmann struct hci_rp_read_local_oob_ext_data { 1099e2f99131SMarcel Holtmann __u8 status; 1100e2f99131SMarcel Holtmann __u8 hash192[16]; 110138da1703SJohan Hedberg __u8 rand192[16]; 1102e2f99131SMarcel Holtmann __u8 hash256[16]; 110338da1703SJohan Hedberg __u8 rand256[16]; 1104e2f99131SMarcel Holtmann } __packed; 1105e2f99131SMarcel Holtmann 1106a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 1107a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 11081da177e4SLinus Torvalds __u8 status; 1109a9de9248SMarcel Holtmann __u8 hci_ver; 1110a9de9248SMarcel Holtmann __le16 hci_rev; 1111a9de9248SMarcel Holtmann __u8 lmp_ver; 1112a9de9248SMarcel Holtmann __le16 manufacturer; 1113a9de9248SMarcel Holtmann __le16 lmp_subver; 111466c853ccSGustavo F. Padovan } __packed; 11151da177e4SLinus Torvalds 1116a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 1117a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 11181da177e4SLinus Torvalds __u8 status; 1119a9de9248SMarcel Holtmann __u8 commands[64]; 112066c853ccSGustavo F. Padovan } __packed; 11211da177e4SLinus Torvalds 1122a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 1123a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 1124a9de9248SMarcel Holtmann __u8 status; 1125a9de9248SMarcel Holtmann __u8 features[8]; 112666c853ccSGustavo F. Padovan } __packed; 1127a9de9248SMarcel Holtmann 1128a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 1129971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 1130971e3a4bSAndre Guedes __u8 page; 1131971e3a4bSAndre Guedes } __packed; 1132a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 1133a9de9248SMarcel Holtmann __u8 status; 1134a9de9248SMarcel Holtmann __u8 page; 1135a9de9248SMarcel Holtmann __u8 max_page; 1136a9de9248SMarcel Holtmann __u8 features[8]; 113766c853ccSGustavo F. Padovan } __packed; 1138a9de9248SMarcel Holtmann 1139a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 1140a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 1141a9de9248SMarcel Holtmann __u8 status; 1142a9de9248SMarcel Holtmann __le16 acl_mtu; 1143a9de9248SMarcel Holtmann __u8 sco_mtu; 1144a9de9248SMarcel Holtmann __le16 acl_max_pkt; 1145a9de9248SMarcel Holtmann __le16 sco_max_pkt; 114666c853ccSGustavo F. Padovan } __packed; 1147a9de9248SMarcel Holtmann 1148a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 1149a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 1150a9de9248SMarcel Holtmann __u8 status; 11511da177e4SLinus Torvalds bdaddr_t bdaddr; 115266c853ccSGustavo F. Padovan } __packed; 11531da177e4SLinus Torvalds 1154350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 1155350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 1156350ee4cfSAndrei Emeltchenko __u8 status; 1157350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 1158350ee4cfSAndrei Emeltchenko __le16 block_len; 1159350ee4cfSAndrei Emeltchenko __le16 num_blocks; 1160350ee4cfSAndrei Emeltchenko } __packed; 1161350ee4cfSAndrei Emeltchenko 1162109e3191SMarcel Holtmann #define HCI_OP_READ_LOCAL_CODECS 0x100b 1163109e3191SMarcel Holtmann 1164f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 1165f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 1166f332ec66SJohan Hedberg __u8 status; 1167f332ec66SJohan Hedberg __le16 interval; 1168f332ec66SJohan Hedberg __le16 window; 1169f332ec66SJohan Hedberg } __packed; 1170f332ec66SJohan Hedberg 1171f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 1172f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 1173f6422ec6SAntti Julku __le16 interval; 1174f6422ec6SAntti Julku __le16 window; 1175f6422ec6SAntti Julku } __packed; 1176f6422ec6SAntti Julku 11775a134faeSAndrzej Kaczmarek #define HCI_OP_READ_TX_POWER 0x0c2d 11785a134faeSAndrzej Kaczmarek struct hci_cp_read_tx_power { 11795a134faeSAndrzej Kaczmarek __le16 handle; 11805a134faeSAndrzej Kaczmarek __u8 type; 11815a134faeSAndrzej Kaczmarek } __packed; 11825a134faeSAndrzej Kaczmarek struct hci_rp_read_tx_power { 11835a134faeSAndrzej Kaczmarek __u8 status; 11845a134faeSAndrzej Kaczmarek __le16 handle; 11855a134faeSAndrzej Kaczmarek __s8 tx_power; 11865a134faeSAndrzej Kaczmarek } __packed; 11875a134faeSAndrzej Kaczmarek 1188f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 1189f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 1190f332ec66SJohan Hedberg __u8 status; 1191f332ec66SJohan Hedberg __u8 type; 1192f332ec66SJohan Hedberg } __packed; 1193f332ec66SJohan Hedberg 1194f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 1195f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 1196f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 1197f6422ec6SAntti Julku 11985ae76a94SAndrzej Kaczmarek #define HCI_OP_READ_RSSI 0x1405 11995ae76a94SAndrzej Kaczmarek struct hci_cp_read_rssi { 12005ae76a94SAndrzej Kaczmarek __le16 handle; 12015ae76a94SAndrzej Kaczmarek } __packed; 12025ae76a94SAndrzej Kaczmarek struct hci_rp_read_rssi { 12035ae76a94SAndrzej Kaczmarek __u8 status; 12045ae76a94SAndrzej Kaczmarek __le16 handle; 12055ae76a94SAndrzej Kaczmarek __s8 rssi; 12065ae76a94SAndrzej Kaczmarek } __packed; 12075ae76a94SAndrzej Kaczmarek 120833f35721SJohan Hedberg #define HCI_OP_READ_CLOCK 0x1407 120933f35721SJohan Hedberg struct hci_cp_read_clock { 121033f35721SJohan Hedberg __le16 handle; 121133f35721SJohan Hedberg __u8 which; 121233f35721SJohan Hedberg } __packed; 121333f35721SJohan Hedberg struct hci_rp_read_clock { 121433f35721SJohan Hedberg __u8 status; 121533f35721SJohan Hedberg __le16 handle; 121633f35721SJohan Hedberg __le32 clock; 121733f35721SJohan Hedberg __le16 accuracy; 121833f35721SJohan Hedberg } __packed; 121933f35721SJohan Hedberg 1220821f3766SJohan Hedberg #define HCI_OP_READ_ENC_KEY_SIZE 0x1408 1221821f3766SJohan Hedberg struct hci_cp_read_enc_key_size { 1222821f3766SJohan Hedberg __le16 handle; 1223821f3766SJohan Hedberg } __packed; 1224821f3766SJohan Hedberg struct hci_rp_read_enc_key_size { 1225821f3766SJohan Hedberg __u8 status; 1226821f3766SJohan Hedberg __le16 handle; 1227821f3766SJohan Hedberg __u8 key_size; 1228821f3766SJohan Hedberg } __packed; 1229821f3766SJohan Hedberg 1230928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 1231928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 1232928abaa7SAndrei Emeltchenko __u8 status; 1233928abaa7SAndrei Emeltchenko __u8 amp_status; 1234928abaa7SAndrei Emeltchenko __le32 total_bw; 1235928abaa7SAndrei Emeltchenko __le32 max_bw; 1236928abaa7SAndrei Emeltchenko __le32 min_latency; 1237928abaa7SAndrei Emeltchenko __le32 max_pdu; 1238928abaa7SAndrei Emeltchenko __u8 amp_type; 1239928abaa7SAndrei Emeltchenko __le16 pal_cap; 1240928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 1241928abaa7SAndrei Emeltchenko __le32 max_flush_to; 1242928abaa7SAndrei Emeltchenko __le32 be_flush_to; 1243928abaa7SAndrei Emeltchenko } __packed; 1244928abaa7SAndrei Emeltchenko 1245523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 1246523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 1247523e93cdSAndrei Emeltchenko __u8 phy_handle; 1248523e93cdSAndrei Emeltchenko __le16 len_so_far; 1249523e93cdSAndrei Emeltchenko __le16 max_len; 1250523e93cdSAndrei Emeltchenko } __packed; 1251523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 1252523e93cdSAndrei Emeltchenko __u8 status; 1253523e93cdSAndrei Emeltchenko __u8 phy_handle; 1254523e93cdSAndrei Emeltchenko __le16 rem_len; 1255523e93cdSAndrei Emeltchenko __u8 frag[0]; 1256523e93cdSAndrei Emeltchenko } __packed; 1257523e93cdSAndrei Emeltchenko 1258523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 1259523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 1260523e93cdSAndrei Emeltchenko __u8 phy_handle; 1261523e93cdSAndrei Emeltchenko __le16 len_so_far; 1262523e93cdSAndrei Emeltchenko __le16 rem_len; 1263523e93cdSAndrei Emeltchenko __u8 frag[0]; 1264523e93cdSAndrei Emeltchenko } __packed; 1265523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1266523e93cdSAndrei Emeltchenko __u8 status; 1267523e93cdSAndrei Emeltchenko __u8 phy_handle; 1268523e93cdSAndrei Emeltchenko } __packed; 1269523e93cdSAndrei Emeltchenko 1270f4fe73edSMarcel Holtmann #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c 1271f4fe73edSMarcel Holtmann 12724b4148e9SMarcel Holtmann #define HCI_OP_ENABLE_DUT_MODE 0x1803 12734b4148e9SMarcel Holtmann 127406f5b778SMarcel Holtmann #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 127506f5b778SMarcel Holtmann 127663185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 127763185f64SVille Tervo struct hci_cp_le_set_event_mask { 127863185f64SVille Tervo __u8 mask[8]; 127963185f64SVille Tervo } __packed; 128063185f64SVille Tervo 128163185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 128263185f64SVille Tervo struct hci_rp_le_read_buffer_size { 128363185f64SVille Tervo __u8 status; 128463185f64SVille Tervo __le16 le_mtu; 128563185f64SVille Tervo __u8 le_max_pkt; 128663185f64SVille Tervo } __packed; 128763185f64SVille Tervo 128860e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 128960e77321SJohan Hedberg struct hci_rp_le_read_local_features { 129060e77321SJohan Hedberg __u8 status; 129160e77321SJohan Hedberg __u8 features[8]; 129260e77321SJohan Hedberg } __packed; 129360e77321SJohan Hedberg 1294d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1295d13eafceSMarcel Holtmann 12961e191893SMarcel Holtmann #define HCI_OP_LE_SET_ADV_PARAM 0x2006 12971e191893SMarcel Holtmann struct hci_cp_le_set_adv_param { 12981e191893SMarcel Holtmann __le16 min_interval; 12991e191893SMarcel Holtmann __le16 max_interval; 13001e191893SMarcel Holtmann __u8 type; 13011e191893SMarcel Holtmann __u8 own_address_type; 13021e191893SMarcel Holtmann __u8 direct_addr_type; 13031e191893SMarcel Holtmann bdaddr_t direct_addr; 13041e191893SMarcel Holtmann __u8 channel_map; 13051e191893SMarcel Holtmann __u8 filter_policy; 13061e191893SMarcel Holtmann } __packed; 13071e191893SMarcel Holtmann 13088fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 13098fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 13108fa19098SJohan Hedberg __u8 status; 13118fa19098SJohan Hedberg __s8 tx_power; 13128fa19098SJohan Hedberg } __packed; 13138fa19098SJohan Hedberg 13143f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 13153f0f524bSJohan Hedberg 13163f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 13173f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 13183f0f524bSJohan Hedberg __u8 length; 13193f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 13203f0f524bSJohan Hedberg } __packed; 13213f0f524bSJohan Hedberg 1322f14d8f64SMarcel Holtmann #define HCI_OP_LE_SET_SCAN_RSP_DATA 0x2009 1323f14d8f64SMarcel Holtmann struct hci_cp_le_set_scan_rsp_data { 1324f14d8f64SMarcel Holtmann __u8 length; 1325f14d8f64SMarcel Holtmann __u8 data[HCI_MAX_AD_LENGTH]; 1326f14d8f64SMarcel Holtmann } __packed; 1327f14d8f64SMarcel Holtmann 1328c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1329c1d5dc4aSJohan Hedberg 13305df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 13315df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 13325df480b5SAndre Guedes 133307f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 133407f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 133507f7fa5dSAndre Guedes __u8 type; 133607f7fa5dSAndre Guedes __le16 interval; 133707f7fa5dSAndre Guedes __le16 window; 133807f7fa5dSAndre Guedes __u8 own_address_type; 133907f7fa5dSAndre Guedes __u8 filter_policy; 134007f7fa5dSAndre Guedes } __packed; 134107f7fa5dSAndre Guedes 134276a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 134376a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1344525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1345525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 134668a8aea4SAndrei Emeltchenko 1347eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1348eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1349eb9d91f5SAndre Guedes __u8 enable; 1350eb9d91f5SAndre Guedes __u8 filter_dup; 1351eb9d91f5SAndre Guedes } __packed; 1352eb9d91f5SAndre Guedes 1353a7139eddSJohan Hedberg #define HCI_LE_USE_PEER_ADDR 0x00 1354a7139eddSJohan Hedberg #define HCI_LE_USE_WHITELIST 0x01 1355a7139eddSJohan Hedberg 135663185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 135763185f64SVille Tervo struct hci_cp_le_create_conn { 135863185f64SVille Tervo __le16 scan_interval; 135963185f64SVille Tervo __le16 scan_window; 136063185f64SVille Tervo __u8 filter_policy; 136163185f64SVille Tervo __u8 peer_addr_type; 136263185f64SVille Tervo bdaddr_t peer_addr; 136363185f64SVille Tervo __u8 own_address_type; 136463185f64SVille Tervo __le16 conn_interval_min; 136563185f64SVille Tervo __le16 conn_interval_max; 136663185f64SVille Tervo __le16 conn_latency; 136763185f64SVille Tervo __le16 supervision_timeout; 136863185f64SVille Tervo __le16 min_ce_len; 136963185f64SVille Tervo __le16 max_ce_len; 137063185f64SVille Tervo } __packed; 137163185f64SVille Tervo 137263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 137363185f64SVille Tervo 1374cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1375cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1376cf1d081fSJohan Hedberg __u8 status; 1377cf1d081fSJohan Hedberg __u8 size; 1378cf1d081fSJohan Hedberg } __packed; 1379cf1d081fSJohan Hedberg 1380d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010 1381d9a7b0a5SMarcel Holtmann 1382d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011 1383d9a7b0a5SMarcel Holtmann struct hci_cp_le_add_to_white_list { 1384d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1385d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1386d9a7b0a5SMarcel Holtmann } __packed; 1387d9a7b0a5SMarcel Holtmann 1388d9a7b0a5SMarcel Holtmann #define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012 1389d9a7b0a5SMarcel Holtmann struct hci_cp_le_del_from_white_list { 1390d9a7b0a5SMarcel Holtmann __u8 bdaddr_type; 1391d9a7b0a5SMarcel Holtmann bdaddr_t bdaddr; 1392d9a7b0a5SMarcel Holtmann } __packed; 1393d9a7b0a5SMarcel Holtmann 13942ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 13952ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 13962ce603ebSClaudio Takahasi __le16 handle; 13972ce603ebSClaudio Takahasi __le16 conn_interval_min; 13982ce603ebSClaudio Takahasi __le16 conn_interval_max; 13992ce603ebSClaudio Takahasi __le16 conn_latency; 14002ce603ebSClaudio Takahasi __le16 supervision_timeout; 14012ce603ebSClaudio Takahasi __le16 min_ce_len; 14022ce603ebSClaudio Takahasi __le16 max_ce_len; 14032ce603ebSClaudio Takahasi } __packed; 14042ce603ebSClaudio Takahasi 14050fe29fd1SMarcel Holtmann #define HCI_OP_LE_READ_REMOTE_FEATURES 0x2016 14060fe29fd1SMarcel Holtmann struct hci_cp_le_read_remote_features { 14070fe29fd1SMarcel Holtmann __le16 handle; 14080fe29fd1SMarcel Holtmann } __packed; 14090fe29fd1SMarcel Holtmann 1410a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1411a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1412a7a595f6SVinicius Costa Gomes __le16 handle; 1413fe39c7b2SMarcel Holtmann __le64 rand; 1414a7a595f6SVinicius Costa Gomes __le16 ediv; 1415a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1416a7a595f6SVinicius Costa Gomes } __packed; 1417a7a595f6SVinicius Costa Gomes 1418a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1419a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1420a7a595f6SVinicius Costa Gomes __le16 handle; 1421a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1422a7a595f6SVinicius Costa Gomes } __packed; 1423a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1424a7a595f6SVinicius Costa Gomes __u8 status; 1425a7a595f6SVinicius Costa Gomes __le16 handle; 1426a7a595f6SVinicius Costa Gomes } __packed; 1427a7a595f6SVinicius Costa Gomes 1428a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1429a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1430a7a595f6SVinicius Costa Gomes __le16 handle; 1431a7a595f6SVinicius Costa Gomes } __packed; 1432a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1433a7a595f6SVinicius Costa Gomes __u8 status; 1434a7a595f6SVinicius Costa Gomes __le16 handle; 1435a7a595f6SVinicius Costa Gomes } __packed; 1436a7a595f6SVinicius Costa Gomes 14379b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 14389b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 14399b008c04SJohan Hedberg __u8 status; 14409b008c04SJohan Hedberg __u8 le_states[8]; 14419b008c04SJohan Hedberg } __packed; 14429b008c04SJohan Hedberg 14438e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 14448e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_reply { 14458e75b46aSAndre Guedes __le16 handle; 14468e75b46aSAndre Guedes __le16 interval_min; 14478e75b46aSAndre Guedes __le16 interval_max; 14488e75b46aSAndre Guedes __le16 latency; 14498e75b46aSAndre Guedes __le16 timeout; 14508e75b46aSAndre Guedes __le16 min_ce_len; 14518e75b46aSAndre Guedes __le16 max_ce_len; 14528e75b46aSAndre Guedes } __packed; 14538e75b46aSAndre Guedes 14548e75b46aSAndre Guedes #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 14558e75b46aSAndre Guedes struct hci_cp_le_conn_param_req_neg_reply { 14568e75b46aSAndre Guedes __le16 handle; 14578e75b46aSAndre Guedes __u8 reason; 14588e75b46aSAndre Guedes } __packed; 14598e75b46aSAndre Guedes 146094a3bd02SMarcel Holtmann #define HCI_OP_LE_SET_DATA_LEN 0x2022 146194a3bd02SMarcel Holtmann struct hci_cp_le_set_data_len { 146294a3bd02SMarcel Holtmann __le16 handle; 146394a3bd02SMarcel Holtmann __le16 tx_len; 146494a3bd02SMarcel Holtmann __le16 tx_time; 146594a3bd02SMarcel Holtmann } __packed; 146694a3bd02SMarcel Holtmann struct hci_rp_le_set_data_len { 146794a3bd02SMarcel Holtmann __u8 status; 146894a3bd02SMarcel Holtmann __le16 handle; 146994a3bd02SMarcel Holtmann } __packed; 147094a3bd02SMarcel Holtmann 147194a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_DEF_DATA_LEN 0x2023 147294a3bd02SMarcel Holtmann struct hci_rp_le_read_def_data_len { 147394a3bd02SMarcel Holtmann __u8 status; 147494a3bd02SMarcel Holtmann __le16 tx_len; 147594a3bd02SMarcel Holtmann __le16 tx_time; 147694a3bd02SMarcel Holtmann } __packed; 147794a3bd02SMarcel Holtmann 147894a3bd02SMarcel Holtmann #define HCI_OP_LE_WRITE_DEF_DATA_LEN 0x2024 147994a3bd02SMarcel Holtmann struct hci_cp_le_write_def_data_len { 148094a3bd02SMarcel Holtmann __le16 tx_len; 148194a3bd02SMarcel Holtmann __le16 tx_time; 148294a3bd02SMarcel Holtmann } __packed; 148394a3bd02SMarcel Holtmann 148494a3bd02SMarcel Holtmann #define HCI_OP_LE_READ_MAX_DATA_LEN 0x202f 148594a3bd02SMarcel Holtmann struct hci_rp_le_read_max_data_len { 148694a3bd02SMarcel Holtmann __u8 status; 148794a3bd02SMarcel Holtmann __le16 tx_len; 148894a3bd02SMarcel Holtmann __le16 tx_time; 148994a3bd02SMarcel Holtmann __le16 rx_len; 149094a3bd02SMarcel Holtmann __le16 rx_time; 149194a3bd02SMarcel Holtmann } __packed; 149294a3bd02SMarcel Holtmann 14931da177e4SLinus Torvalds /* ---- HCI Events ---- */ 14941da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 14951da177e4SLinus Torvalds 14961da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 14971da177e4SLinus Torvalds struct inquiry_info { 14981da177e4SLinus Torvalds bdaddr_t bdaddr; 14991da177e4SLinus Torvalds __u8 pscan_rep_mode; 15001da177e4SLinus Torvalds __u8 pscan_period_mode; 15011da177e4SLinus Torvalds __u8 pscan_mode; 15021da177e4SLinus Torvalds __u8 dev_class[3]; 15031ebb9252SMarcel Holtmann __le16 clock_offset; 150466c853ccSGustavo F. Padovan } __packed; 15051da177e4SLinus Torvalds 15061da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 15071da177e4SLinus Torvalds struct hci_ev_conn_complete { 15081da177e4SLinus Torvalds __u8 status; 15091ebb9252SMarcel Holtmann __le16 handle; 15101da177e4SLinus Torvalds bdaddr_t bdaddr; 15111da177e4SLinus Torvalds __u8 link_type; 15121da177e4SLinus Torvalds __u8 encr_mode; 151366c853ccSGustavo F. Padovan } __packed; 15141da177e4SLinus Torvalds 15151da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 15161da177e4SLinus Torvalds struct hci_ev_conn_request { 15171da177e4SLinus Torvalds bdaddr_t bdaddr; 15181da177e4SLinus Torvalds __u8 dev_class[3]; 15191da177e4SLinus Torvalds __u8 link_type; 152066c853ccSGustavo F. Padovan } __packed; 15211da177e4SLinus Torvalds 15221da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 15231da177e4SLinus Torvalds struct hci_ev_disconn_complete { 15241da177e4SLinus Torvalds __u8 status; 15251ebb9252SMarcel Holtmann __le16 handle; 15261da177e4SLinus Torvalds __u8 reason; 152766c853ccSGustavo F. Padovan } __packed; 15281da177e4SLinus Torvalds 15291da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 15301da177e4SLinus Torvalds struct hci_ev_auth_complete { 15311da177e4SLinus Torvalds __u8 status; 15321ebb9252SMarcel Holtmann __le16 handle; 153366c853ccSGustavo F. Padovan } __packed; 15341da177e4SLinus Torvalds 1535a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1536a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1537a9de9248SMarcel Holtmann __u8 status; 1538a9de9248SMarcel Holtmann bdaddr_t bdaddr; 15391f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 154066c853ccSGustavo F. Padovan } __packed; 1541a9de9248SMarcel Holtmann 15421da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 15431da177e4SLinus Torvalds struct hci_ev_encrypt_change { 15441da177e4SLinus Torvalds __u8 status; 15451ebb9252SMarcel Holtmann __le16 handle; 15461da177e4SLinus Torvalds __u8 encrypt; 154766c853ccSGustavo F. Padovan } __packed; 15481da177e4SLinus Torvalds 1549a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1550a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 15511da177e4SLinus Torvalds __u8 status; 15521ebb9252SMarcel Holtmann __le16 handle; 155366c853ccSGustavo F. Padovan } __packed; 15541da177e4SLinus Torvalds 1555a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1556a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1557a9de9248SMarcel Holtmann __u8 status; 1558a9de9248SMarcel Holtmann __le16 handle; 1559a9de9248SMarcel Holtmann __u8 features[8]; 156066c853ccSGustavo F. Padovan } __packed; 1561a9de9248SMarcel Holtmann 1562a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1563a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1564a9de9248SMarcel Holtmann __u8 status; 1565a9de9248SMarcel Holtmann __le16 handle; 1566a9de9248SMarcel Holtmann __u8 lmp_ver; 1567a9de9248SMarcel Holtmann __le16 manufacturer; 1568a9de9248SMarcel Holtmann __le16 lmp_subver; 156966c853ccSGustavo F. Padovan } __packed; 1570a9de9248SMarcel Holtmann 1571a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 15721da177e4SLinus Torvalds struct hci_qos { 15731da177e4SLinus Torvalds __u8 service_type; 15741da177e4SLinus Torvalds __u32 token_rate; 15751da177e4SLinus Torvalds __u32 peak_bandwidth; 15761da177e4SLinus Torvalds __u32 latency; 15771da177e4SLinus Torvalds __u32 delay_variation; 157866c853ccSGustavo F. Padovan } __packed; 15791da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 15801da177e4SLinus Torvalds __u8 status; 15811ebb9252SMarcel Holtmann __le16 handle; 15821da177e4SLinus Torvalds struct hci_qos qos; 158366c853ccSGustavo F. Padovan } __packed; 15841da177e4SLinus Torvalds 1585a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 15861da177e4SLinus Torvalds struct hci_ev_cmd_complete { 15871da177e4SLinus Torvalds __u8 ncmd; 15881ebb9252SMarcel Holtmann __le16 opcode; 158966c853ccSGustavo F. Padovan } __packed; 15901da177e4SLinus Torvalds 1591a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 15921da177e4SLinus Torvalds struct hci_ev_cmd_status { 15931da177e4SLinus Torvalds __u8 status; 15941da177e4SLinus Torvalds __u8 ncmd; 15951ebb9252SMarcel Holtmann __le16 opcode; 159666c853ccSGustavo F. Padovan } __packed; 15971da177e4SLinus Torvalds 159824dfa343SMarcel Holtmann #define HCI_EV_HARDWARE_ERROR 0x10 159924dfa343SMarcel Holtmann struct hci_ev_hardware_error { 160024dfa343SMarcel Holtmann __u8 code; 160124dfa343SMarcel Holtmann } __packed; 160224dfa343SMarcel Holtmann 16031da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 16041da177e4SLinus Torvalds struct hci_ev_role_change { 16051da177e4SLinus Torvalds __u8 status; 16061da177e4SLinus Torvalds bdaddr_t bdaddr; 16071da177e4SLinus Torvalds __u8 role; 160866c853ccSGustavo F. Padovan } __packed; 16091da177e4SLinus Torvalds 1610a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 1611613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 1612613a1c0cSAndrei Emeltchenko __le16 handle; 1613613a1c0cSAndrei Emeltchenko __le16 count; 1614613a1c0cSAndrei Emeltchenko } __packed; 1615613a1c0cSAndrei Emeltchenko 1616a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 1617a9de9248SMarcel Holtmann __u8 num_hndl; 1618613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info handles[0]; 161966c853ccSGustavo F. Padovan } __packed; 1620a9de9248SMarcel Holtmann 16211da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 16221da177e4SLinus Torvalds struct hci_ev_mode_change { 16231da177e4SLinus Torvalds __u8 status; 16241ebb9252SMarcel Holtmann __le16 handle; 16251da177e4SLinus Torvalds __u8 mode; 16261ebb9252SMarcel Holtmann __le16 interval; 162766c853ccSGustavo F. Padovan } __packed; 16281da177e4SLinus Torvalds 16291da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 16301da177e4SLinus Torvalds struct hci_ev_pin_code_req { 16311da177e4SLinus Torvalds bdaddr_t bdaddr; 163266c853ccSGustavo F. Padovan } __packed; 16331da177e4SLinus Torvalds 16341da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 16351da177e4SLinus Torvalds struct hci_ev_link_key_req { 16361da177e4SLinus Torvalds bdaddr_t bdaddr; 163766c853ccSGustavo F. Padovan } __packed; 16381da177e4SLinus Torvalds 16391da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 16401da177e4SLinus Torvalds struct hci_ev_link_key_notify { 16411da177e4SLinus Torvalds bdaddr_t bdaddr; 16429b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 16431da177e4SLinus Torvalds __u8 key_type; 164466c853ccSGustavo F. Padovan } __packed; 16451da177e4SLinus Torvalds 1646a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 16471da177e4SLinus Torvalds struct hci_ev_clock_offset { 16481da177e4SLinus Torvalds __u8 status; 16491ebb9252SMarcel Holtmann __le16 handle; 16501ebb9252SMarcel Holtmann __le16 clock_offset; 165166c853ccSGustavo F. Padovan } __packed; 16521da177e4SLinus Torvalds 1653a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 1654a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 1655a8746417SMarcel Holtmann __u8 status; 1656a8746417SMarcel Holtmann __le16 handle; 1657a8746417SMarcel Holtmann __le16 pkt_type; 165866c853ccSGustavo F. Padovan } __packed; 1659a8746417SMarcel Holtmann 166085a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 166185a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 166285a1e930SMarcel Holtmann bdaddr_t bdaddr; 166385a1e930SMarcel Holtmann __u8 pscan_rep_mode; 166466c853ccSGustavo F. Padovan } __packed; 166585a1e930SMarcel Holtmann 1666a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 1667a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 1668a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1669a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1670a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1671a9de9248SMarcel Holtmann __u8 dev_class[3]; 1672a9de9248SMarcel Holtmann __le16 clock_offset; 1673a9de9248SMarcel Holtmann __s8 rssi; 167466c853ccSGustavo F. Padovan } __packed; 1675a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 1676a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1677a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1678a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1679a9de9248SMarcel Holtmann __u8 pscan_mode; 1680a9de9248SMarcel Holtmann __u8 dev_class[3]; 1681a9de9248SMarcel Holtmann __le16 clock_offset; 1682a9de9248SMarcel Holtmann __s8 rssi; 168366c853ccSGustavo F. Padovan } __packed; 1684a9de9248SMarcel Holtmann 1685a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 1686a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 1687a9de9248SMarcel Holtmann __u8 status; 1688a9de9248SMarcel Holtmann __le16 handle; 1689a9de9248SMarcel Holtmann __u8 page; 1690a9de9248SMarcel Holtmann __u8 max_page; 1691a9de9248SMarcel Holtmann __u8 features[8]; 169266c853ccSGustavo F. Padovan } __packed; 1693a9de9248SMarcel Holtmann 1694a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 1695a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 1696a9de9248SMarcel Holtmann __u8 status; 1697a9de9248SMarcel Holtmann __le16 handle; 1698a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1699a9de9248SMarcel Holtmann __u8 link_type; 1700a9de9248SMarcel Holtmann __u8 tx_interval; 1701a9de9248SMarcel Holtmann __u8 retrans_window; 1702a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1703a9de9248SMarcel Holtmann __le16 tx_pkt_len; 1704a9de9248SMarcel Holtmann __u8 air_mode; 170566c853ccSGustavo F. Padovan } __packed; 1706a9de9248SMarcel Holtmann 1707a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 1708a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 1709a9de9248SMarcel Holtmann __u8 status; 1710a9de9248SMarcel Holtmann __le16 handle; 1711a9de9248SMarcel Holtmann __u8 tx_interval; 1712a9de9248SMarcel Holtmann __u8 retrans_window; 1713a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1714a9de9248SMarcel Holtmann __le16 tx_pkt_len; 171566c853ccSGustavo F. Padovan } __packed; 1716a9de9248SMarcel Holtmann 1717a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 171804837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 171904837f64SMarcel Holtmann __u8 status; 172004837f64SMarcel Holtmann __le16 handle; 172104837f64SMarcel Holtmann __le16 max_tx_latency; 172204837f64SMarcel Holtmann __le16 max_rx_latency; 172304837f64SMarcel Holtmann __le16 max_remote_timeout; 172404837f64SMarcel Holtmann __le16 max_local_timeout; 172566c853ccSGustavo F. Padovan } __packed; 172604837f64SMarcel Holtmann 1727a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 1728a9de9248SMarcel Holtmann struct extended_inquiry_info { 1729a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1730a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1731a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1732a9de9248SMarcel Holtmann __u8 dev_class[3]; 1733a9de9248SMarcel Holtmann __le16 clock_offset; 1734a9de9248SMarcel Holtmann __s8 rssi; 1735a9de9248SMarcel Holtmann __u8 data[240]; 173666c853ccSGustavo F. Padovan } __packed; 1737a9de9248SMarcel Holtmann 17381c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 17391c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 17401c2e0041SJohan Hedberg __u8 status; 17411c2e0041SJohan Hedberg __le16 handle; 17421c2e0041SJohan Hedberg } __packed; 17431c2e0041SJohan Hedberg 17440493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 17450493684eSMarcel Holtmann struct hci_ev_io_capa_request { 17460493684eSMarcel Holtmann bdaddr_t bdaddr; 174766c853ccSGustavo F. Padovan } __packed; 17480493684eSMarcel Holtmann 174903b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 175003b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 175103b555e1SJohan Hedberg bdaddr_t bdaddr; 175203b555e1SJohan Hedberg __u8 capability; 175303b555e1SJohan Hedberg __u8 oob_data; 175403b555e1SJohan Hedberg __u8 authentication; 175503b555e1SJohan Hedberg } __packed; 175603b555e1SJohan Hedberg 1757a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 1758a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 1759a5c29683SJohan Hedberg bdaddr_t bdaddr; 1760a5c29683SJohan Hedberg __le32 passkey; 1761a5c29683SJohan Hedberg } __packed; 1762a5c29683SJohan Hedberg 17639ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 17649ad4019aSBrian Gix struct hci_ev_user_passkey_req { 17659ad4019aSBrian Gix bdaddr_t bdaddr; 17669ad4019aSBrian Gix } __packed; 17679ad4019aSBrian Gix 17682763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 17692763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 17702763eda6SSzymon Janc bdaddr_t bdaddr; 17712763eda6SSzymon Janc } __packed; 17722763eda6SSzymon Janc 17730493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 17740493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 17750493684eSMarcel Holtmann __u8 status; 17760493684eSMarcel Holtmann bdaddr_t bdaddr; 177766c853ccSGustavo F. Padovan } __packed; 17780493684eSMarcel Holtmann 177992a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 178092a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 178192a25256SJohan Hedberg bdaddr_t bdaddr; 178292a25256SJohan Hedberg __le32 passkey; 178392a25256SJohan Hedberg } __packed; 178492a25256SJohan Hedberg 178592a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 178692a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 178792a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 178892a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 178992a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 179092a25256SJohan Hedberg 179192a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 179292a25256SJohan Hedberg struct hci_ev_keypress_notify { 179392a25256SJohan Hedberg bdaddr_t bdaddr; 179492a25256SJohan Hedberg __u8 type; 179592a25256SJohan Hedberg } __packed; 179692a25256SJohan Hedberg 179741a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 179841a96212SMarcel Holtmann struct hci_ev_remote_host_features { 179941a96212SMarcel Holtmann bdaddr_t bdaddr; 180041a96212SMarcel Holtmann __u8 features[8]; 180166c853ccSGustavo F. Padovan } __packed; 180241a96212SMarcel Holtmann 180363185f64SVille Tervo #define HCI_EV_LE_META 0x3e 180463185f64SVille Tervo struct hci_ev_le_meta { 180563185f64SVille Tervo __u8 subevent; 180663185f64SVille Tervo } __packed; 180763185f64SVille Tervo 1808523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 1809523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 1810523e93cdSAndrei Emeltchenko __u8 status; 1811523e93cdSAndrei Emeltchenko __u8 phy_handle; 1812523e93cdSAndrei Emeltchenko } __packed; 1813523e93cdSAndrei Emeltchenko 1814523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 1815523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 1816523e93cdSAndrei Emeltchenko __u8 phy_handle; 1817523e93cdSAndrei Emeltchenko } __packed; 1818523e93cdSAndrei Emeltchenko 1819523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 1820523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 1821523e93cdSAndrei Emeltchenko __u8 status; 1822523e93cdSAndrei Emeltchenko __u8 phy_handle; 1823523e93cdSAndrei Emeltchenko __u8 reason; 1824523e93cdSAndrei Emeltchenko } __packed; 1825523e93cdSAndrei Emeltchenko 1826523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 1827523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 1828523e93cdSAndrei Emeltchenko __u8 status; 1829523e93cdSAndrei Emeltchenko __le16 handle; 1830523e93cdSAndrei Emeltchenko __u8 phy_handle; 1831523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 1832523e93cdSAndrei Emeltchenko } __packed; 1833523e93cdSAndrei Emeltchenko 1834523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 1835523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 1836523e93cdSAndrei Emeltchenko __u8 status; 1837523e93cdSAndrei Emeltchenko __le16 handle; 1838523e93cdSAndrei Emeltchenko __u8 reason; 1839523e93cdSAndrei Emeltchenko } __packed; 1840523e93cdSAndrei Emeltchenko 184125e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 184225e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 184325e89e99SAndrei Emeltchenko __le16 handle; 184425e89e99SAndrei Emeltchenko __le16 pkts; 184525e89e99SAndrei Emeltchenko __le16 blocks; 184625e89e99SAndrei Emeltchenko } __packed; 184725e89e99SAndrei Emeltchenko 184825e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 184925e89e99SAndrei Emeltchenko __le16 num_blocks; 185025e89e99SAndrei Emeltchenko __u8 num_hndl; 185125e89e99SAndrei Emeltchenko struct hci_comp_blocks_info handles[0]; 185225e89e99SAndrei Emeltchenko } __packed; 185325e89e99SAndrei Emeltchenko 18542b359445SDoHyun Pyun #define HCI_EV_SYNC_TRAIN_COMPLETE 0x4F 18552b359445SDoHyun Pyun struct hci_ev_sync_train_complete { 18562b359445SDoHyun Pyun __u8 status; 18572b359445SDoHyun Pyun } __packed; 18582b359445SDoHyun Pyun 18592ed01805SDoHyun Pyun #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 18602ed01805SDoHyun Pyun 186163185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 186263185f64SVille Tervo struct hci_ev_le_conn_complete { 186363185f64SVille Tervo __u8 status; 186463185f64SVille Tervo __le16 handle; 186563185f64SVille Tervo __u8 role; 186663185f64SVille Tervo __u8 bdaddr_type; 186763185f64SVille Tervo bdaddr_t bdaddr; 186863185f64SVille Tervo __le16 interval; 186963185f64SVille Tervo __le16 latency; 187063185f64SVille Tervo __le16 supervision_timeout; 187163185f64SVille Tervo __u8 clk_accurancy; 187263185f64SVille Tervo } __packed; 187363185f64SVille Tervo 18742331fd46SMarcel Holtmann /* Advertising report event types */ 18752331fd46SMarcel Holtmann #define LE_ADV_IND 0x00 18762331fd46SMarcel Holtmann #define LE_ADV_DIRECT_IND 0x01 18772331fd46SMarcel Holtmann #define LE_ADV_SCAN_IND 0x02 18782331fd46SMarcel Holtmann #define LE_ADV_NONCONN_IND 0x03 18792331fd46SMarcel Holtmann #define LE_ADV_SCAN_RSP 0x04 18802331fd46SMarcel Holtmann 18812331fd46SMarcel Holtmann #define ADDR_LE_DEV_PUBLIC 0x00 18822331fd46SMarcel Holtmann #define ADDR_LE_DEV_RANDOM 0x01 18832331fd46SMarcel Holtmann 18842331fd46SMarcel Holtmann #define HCI_EV_LE_ADVERTISING_REPORT 0x02 18852331fd46SMarcel Holtmann struct hci_ev_le_advertising_info { 18862331fd46SMarcel Holtmann __u8 evt_type; 18872331fd46SMarcel Holtmann __u8 bdaddr_type; 18882331fd46SMarcel Holtmann bdaddr_t bdaddr; 18892331fd46SMarcel Holtmann __u8 length; 18902331fd46SMarcel Holtmann __u8 data[0]; 18912331fd46SMarcel Holtmann } __packed; 18922331fd46SMarcel Holtmann 18931855d92dSMarcel Holtmann #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 18941855d92dSMarcel Holtmann struct hci_ev_le_conn_update_complete { 18951855d92dSMarcel Holtmann __u8 status; 18961855d92dSMarcel Holtmann __le16 handle; 18971855d92dSMarcel Holtmann __le16 interval; 18981855d92dSMarcel Holtmann __le16 latency; 18991855d92dSMarcel Holtmann __le16 supervision_timeout; 19001855d92dSMarcel Holtmann } __packed; 19011855d92dSMarcel Holtmann 19020fe29fd1SMarcel Holtmann #define HCI_EV_LE_REMOTE_FEAT_COMPLETE 0x04 19030fe29fd1SMarcel Holtmann struct hci_ev_le_remote_feat_complete { 19040fe29fd1SMarcel Holtmann __u8 status; 19050fe29fd1SMarcel Holtmann __le16 handle; 19060fe29fd1SMarcel Holtmann __u8 features[8]; 19070fe29fd1SMarcel Holtmann } __packed; 19080fe29fd1SMarcel Holtmann 1909a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 1910a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 1911a7a595f6SVinicius Costa Gomes __le16 handle; 1912fe39c7b2SMarcel Holtmann __le64 rand; 1913a7a595f6SVinicius Costa Gomes __le16 ediv; 1914a7a595f6SVinicius Costa Gomes } __packed; 1915a7a595f6SVinicius Costa Gomes 19168e75b46aSAndre Guedes #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 19178e75b46aSAndre Guedes struct hci_ev_le_remote_conn_param_req { 19188e75b46aSAndre Guedes __le16 handle; 19198e75b46aSAndre Guedes __le16 interval_min; 19208e75b46aSAndre Guedes __le16 interval_max; 19218e75b46aSAndre Guedes __le16 latency; 19228e75b46aSAndre Guedes __le16 timeout; 19238e75b46aSAndre Guedes } __packed; 19248e75b46aSAndre Guedes 192594a3bd02SMarcel Holtmann #define HCI_EV_LE_DATA_LEN_CHANGE 0x07 192694a3bd02SMarcel Holtmann struct hci_ev_le_data_len_change { 192794a3bd02SMarcel Holtmann __le16 handle; 192894a3bd02SMarcel Holtmann __le16 tx_len; 192994a3bd02SMarcel Holtmann __le16 tx_time; 193094a3bd02SMarcel Holtmann __le16 rx_len; 193194a3bd02SMarcel Holtmann __le16 rx_time; 193294a3bd02SMarcel Holtmann } __packed; 193394a3bd02SMarcel Holtmann 193432c9d43fSMarcel Holtmann #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B 193532c9d43fSMarcel Holtmann struct hci_ev_le_direct_adv_info { 193632c9d43fSMarcel Holtmann __u8 evt_type; 193732c9d43fSMarcel Holtmann __u8 bdaddr_type; 193832c9d43fSMarcel Holtmann bdaddr_t bdaddr; 193932c9d43fSMarcel Holtmann __u8 direct_addr_type; 194032c9d43fSMarcel Holtmann bdaddr_t direct_addr; 194132c9d43fSMarcel Holtmann __s8 rssi; 194232c9d43fSMarcel Holtmann } __packed; 194332c9d43fSMarcel Holtmann 19441da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 1945a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 19461da177e4SLinus Torvalds struct hci_ev_stack_internal { 19471da177e4SLinus Torvalds __u16 type; 19481da177e4SLinus Torvalds __u8 data[0]; 194966c853ccSGustavo F. Padovan } __packed; 19501da177e4SLinus Torvalds 19511da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 19521da177e4SLinus Torvalds struct hci_ev_si_device { 19531da177e4SLinus Torvalds __u16 event; 19541da177e4SLinus Torvalds __u16 dev_id; 195566c853ccSGustavo F. Padovan } __packed; 19561da177e4SLinus Torvalds 19571da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 19581da177e4SLinus Torvalds struct hci_ev_si_security { 19591da177e4SLinus Torvalds __u16 event; 19601da177e4SLinus Torvalds __u16 proto; 19611da177e4SLinus Torvalds __u16 subproto; 19621da177e4SLinus Torvalds __u8 incoming; 196366c853ccSGustavo F. Padovan } __packed; 19641da177e4SLinus Torvalds 19651da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 19661da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 19671da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 19681da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 19691da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 19701da177e4SLinus Torvalds 19711da177e4SLinus Torvalds struct hci_command_hdr { 19721ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 19731da177e4SLinus Torvalds __u8 plen; 197466c853ccSGustavo F. Padovan } __packed; 19751da177e4SLinus Torvalds 19761da177e4SLinus Torvalds struct hci_event_hdr { 19771da177e4SLinus Torvalds __u8 evt; 19781da177e4SLinus Torvalds __u8 plen; 197966c853ccSGustavo F. Padovan } __packed; 19801da177e4SLinus Torvalds 19811da177e4SLinus Torvalds struct hci_acl_hdr { 19821ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 19831ebb9252SMarcel Holtmann __le16 dlen; 198466c853ccSGustavo F. Padovan } __packed; 19851da177e4SLinus Torvalds 19861da177e4SLinus Torvalds struct hci_sco_hdr { 19871ebb9252SMarcel Holtmann __le16 handle; 19881da177e4SLinus Torvalds __u8 dlen; 198966c853ccSGustavo F. Padovan } __packed; 19901da177e4SLinus Torvalds 19912a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 19922a123b86SArnaldo Carvalho de Melo { 19932a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 19942a123b86SArnaldo Carvalho de Melo } 19952a123b86SArnaldo Carvalho de Melo 19962a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 19972a123b86SArnaldo Carvalho de Melo { 19982a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 19992a123b86SArnaldo Carvalho de Melo } 20002a123b86SArnaldo Carvalho de Melo 20012a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 20022a123b86SArnaldo Carvalho de Melo { 20032a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 20042a123b86SArnaldo Carvalho de Melo } 20052a123b86SArnaldo Carvalho de Melo 20061da177e4SLinus Torvalds /* Command opcode pack/unpack */ 2007c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 20081da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 20091da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 20101da177e4SLinus Torvalds 20111da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 2012c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 20131da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 20141da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 20151da177e4SLinus Torvalds 20161da177e4SLinus Torvalds #endif /* __HCI_H */ 2017