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 471da177e4SLinus Torvalds 481da177e4SLinus Torvalds /* HCI notify events */ 491da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_ADD 1 501da177e4SLinus Torvalds #define HCI_NOTIFY_CONN_DEL 2 511da177e4SLinus Torvalds #define HCI_NOTIFY_VOICE_SETTING 3 521da177e4SLinus Torvalds 53c13854ceSMarcel Holtmann /* HCI bus types */ 540ac53939SMarcel Holtmann #define HCI_VIRTUAL 0 551da177e4SLinus Torvalds #define HCI_USB 1 561da177e4SLinus Torvalds #define HCI_PCCARD 2 571da177e4SLinus Torvalds #define HCI_UART 3 581da177e4SLinus Torvalds #define HCI_RS232 4 591da177e4SLinus Torvalds #define HCI_PCI 5 600ac53939SMarcel Holtmann #define HCI_SDIO 6 611da177e4SLinus Torvalds 62943da25dSMarcel Holtmann /* HCI controller types */ 63943da25dSMarcel Holtmann #define HCI_BREDR 0x00 648f1e1742SDavid Vrabel #define HCI_AMP 0x01 65943da25dSMarcel Holtmann 668598d064SAndrei Emeltchenko /* First BR/EDR Controller shall have ID = 0 */ 678598d064SAndrei Emeltchenko #define HCI_BREDR_ID 0 688598d064SAndrei Emeltchenko 69ab846ec4SAndrei Emeltchenko /* AMP controller status */ 70ab846ec4SAndrei Emeltchenko #define AMP_CTRL_POWERED_DOWN 0x00 71ab846ec4SAndrei Emeltchenko #define AMP_CTRL_BLUETOOTH_ONLY 0x01 72ab846ec4SAndrei Emeltchenko #define AMP_CTRL_NO_CAPACITY 0x02 73ab846ec4SAndrei Emeltchenko #define AMP_CTRL_LOW_CAPACITY 0x03 74ab846ec4SAndrei Emeltchenko #define AMP_CTRL_MEDIUM_CAPACITY 0x04 75ab846ec4SAndrei Emeltchenko #define AMP_CTRL_HIGH_CAPACITY 0x05 76ab846ec4SAndrei Emeltchenko #define AMP_CTRL_FULL_CAPACITY 0x06 77ab846ec4SAndrei Emeltchenko 781da177e4SLinus Torvalds /* HCI device quirks */ 791da177e4SLinus Torvalds enum { 80a6c511c6SSzymon Janc HCI_QUIRK_RESET_ON_CLOSE, 81da1f5198SMarcel Holtmann HCI_QUIRK_RAW_DEVICE, 82da1f5198SMarcel Holtmann HCI_QUIRK_FIXUP_BUFFER_SIZE 831da177e4SLinus Torvalds }; 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds /* HCI device flags */ 861da177e4SLinus Torvalds enum { 871da177e4SLinus Torvalds HCI_UP, 881da177e4SLinus Torvalds HCI_INIT, 891da177e4SLinus Torvalds HCI_RUNNING, 901da177e4SLinus Torvalds 911da177e4SLinus Torvalds HCI_PSCAN, 921da177e4SLinus Torvalds HCI_ISCAN, 931da177e4SLinus Torvalds HCI_AUTH, 941da177e4SLinus Torvalds HCI_ENCRYPT, 951da177e4SLinus Torvalds HCI_INQUIRY, 961da177e4SLinus Torvalds 971da177e4SLinus Torvalds HCI_RAW, 98ab81cbf9SJohan Hedberg 9910572132SGustavo F. Padovan HCI_RESET, 1001da177e4SLinus Torvalds }; 1011da177e4SLinus Torvalds 102d23264a8SAndre Guedes /* 103d23264a8SAndre Guedes * BR/EDR and/or LE controller flags: the flags defined here should represent 104d23264a8SAndre Guedes * states from the controller. 105d23264a8SAndre Guedes */ 106d23264a8SAndre Guedes enum { 107a8b2d5c2SJohan Hedberg HCI_SETUP, 108a8b2d5c2SJohan Hedberg HCI_AUTO_OFF, 1095e130367SJohan Hedberg HCI_RFKILLED, 110a8b2d5c2SJohan Hedberg HCI_MGMT, 111a8b2d5c2SJohan Hedberg HCI_PAIRABLE, 112a8b2d5c2SJohan Hedberg HCI_SERVICE_CACHE, 113a8b2d5c2SJohan Hedberg HCI_DEBUG_KEYS, 11494324962SJohan Hovold HCI_UNREGISTER, 1150736cfa8SMarcel Holtmann HCI_USER_CHANNEL, 116a8b2d5c2SJohan Hedberg 117d23264a8SAndre Guedes HCI_LE_SCAN, 11884bde9d6SJohan Hedberg HCI_SSP_ENABLED, 1196d80dfd0SJohan Hedberg HCI_HS_ENABLED, 12006199cf8SJohan Hedberg HCI_LE_ENABLED, 12133f8f526SJohan Hedberg HCI_LE_PERIPHERAL, 1225e5282bbSJohan Hedberg HCI_CONNECTABLE, 1235e5282bbSJohan Hedberg HCI_DISCOVERABLE, 12447990ea0SJohan Hedberg HCI_LINK_SECURITY, 12521693c15SAndre Guedes HCI_PERIODIC_INQ, 1261a4d3c4bSJohan Hedberg HCI_FAST_CONNECTABLE, 12756f87901SJohan Hedberg HCI_BREDR_ENABLED, 128d23264a8SAndre Guedes }; 129d23264a8SAndre Guedes 1302cc6fb00SJohan Hedberg /* A mask for the flags that are supposed to remain when a reset happens 1312cc6fb00SJohan Hedberg * or the HCI device is closed. 1322cc6fb00SJohan Hedberg */ 1331a4d3c4bSJohan Hedberg #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ 1341a4d3c4bSJohan Hedberg BIT(HCI_FAST_CONNECTABLE)) 1352cc6fb00SJohan Hedberg 1361da177e4SLinus Torvalds /* HCI ioctl defines */ 1371da177e4SLinus Torvalds #define HCIDEVUP _IOW('H', 201, int) 1381da177e4SLinus Torvalds #define HCIDEVDOWN _IOW('H', 202, int) 1391da177e4SLinus Torvalds #define HCIDEVRESET _IOW('H', 203, int) 1401da177e4SLinus Torvalds #define HCIDEVRESTAT _IOW('H', 204, int) 1411da177e4SLinus Torvalds 1421da177e4SLinus Torvalds #define HCIGETDEVLIST _IOR('H', 210, int) 1431da177e4SLinus Torvalds #define HCIGETDEVINFO _IOR('H', 211, int) 1441da177e4SLinus Torvalds #define HCIGETCONNLIST _IOR('H', 212, int) 1451da177e4SLinus Torvalds #define HCIGETCONNINFO _IOR('H', 213, int) 14640be492fSMarcel Holtmann #define HCIGETAUTHINFO _IOR('H', 215, int) 1471da177e4SLinus Torvalds 1481da177e4SLinus Torvalds #define HCISETRAW _IOW('H', 220, int) 1491da177e4SLinus Torvalds #define HCISETSCAN _IOW('H', 221, int) 1501da177e4SLinus Torvalds #define HCISETAUTH _IOW('H', 222, int) 1511da177e4SLinus Torvalds #define HCISETENCRYPT _IOW('H', 223, int) 1521da177e4SLinus Torvalds #define HCISETPTYPE _IOW('H', 224, int) 1531da177e4SLinus Torvalds #define HCISETLINKPOL _IOW('H', 225, int) 1541da177e4SLinus Torvalds #define HCISETLINKMODE _IOW('H', 226, int) 1551da177e4SLinus Torvalds #define HCISETACLMTU _IOW('H', 227, int) 1561da177e4SLinus Torvalds #define HCISETSCOMTU _IOW('H', 228, int) 1571da177e4SLinus Torvalds 158f0358568SJohan Hedberg #define HCIBLOCKADDR _IOW('H', 230, int) 159f0358568SJohan Hedberg #define HCIUNBLOCKADDR _IOW('H', 231, int) 160f0358568SJohan Hedberg 1611da177e4SLinus Torvalds #define HCIINQUIRY _IOR('H', 240, int) 1621da177e4SLinus Torvalds 1631da177e4SLinus Torvalds /* HCI timeouts */ 1645f246e89SAndrei Emeltchenko #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 1655f246e89SAndrei Emeltchenko #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 1665f246e89SAndrei Emeltchenko #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 167d1244adcSSzymon Janc #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 1685f246e89SAndrei Emeltchenko #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 1699345d40cSAndrei Emeltchenko #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 1701da177e4SLinus Torvalds 1715b7f9909SMarcel Holtmann /* HCI data types */ 1721da177e4SLinus Torvalds #define HCI_COMMAND_PKT 0x01 1731da177e4SLinus Torvalds #define HCI_ACLDATA_PKT 0x02 1741da177e4SLinus Torvalds #define HCI_SCODATA_PKT 0x03 1751da177e4SLinus Torvalds #define HCI_EVENT_PKT 0x04 1761da177e4SLinus Torvalds #define HCI_VENDOR_PKT 0xff 1771da177e4SLinus Torvalds 1785b7f9909SMarcel Holtmann /* HCI packet types */ 1791da177e4SLinus Torvalds #define HCI_DM1 0x0008 1801da177e4SLinus Torvalds #define HCI_DM3 0x0400 1811da177e4SLinus Torvalds #define HCI_DM5 0x4000 1821da177e4SLinus Torvalds #define HCI_DH1 0x0010 1831da177e4SLinus Torvalds #define HCI_DH3 0x0800 1841da177e4SLinus Torvalds #define HCI_DH5 0x8000 1851da177e4SLinus Torvalds 1861da177e4SLinus Torvalds #define HCI_HV1 0x0020 1871da177e4SLinus Torvalds #define HCI_HV2 0x0040 1881da177e4SLinus Torvalds #define HCI_HV3 0x0080 1891da177e4SLinus Torvalds 1901da177e4SLinus Torvalds #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) 1911da177e4SLinus Torvalds #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) 1921da177e4SLinus Torvalds 1935b7f9909SMarcel Holtmann /* eSCO packet types */ 1945b7f9909SMarcel Holtmann #define ESCO_HV1 0x0001 1955b7f9909SMarcel Holtmann #define ESCO_HV2 0x0002 1965b7f9909SMarcel Holtmann #define ESCO_HV3 0x0004 1975b7f9909SMarcel Holtmann #define ESCO_EV3 0x0008 1985b7f9909SMarcel Holtmann #define ESCO_EV4 0x0010 1995b7f9909SMarcel Holtmann #define ESCO_EV5 0x0020 200efc7688bSMarcel Holtmann #define ESCO_2EV3 0x0040 201efc7688bSMarcel Holtmann #define ESCO_3EV3 0x0080 202efc7688bSMarcel Holtmann #define ESCO_2EV5 0x0100 203efc7688bSMarcel Holtmann #define ESCO_3EV5 0x0200 2045b7f9909SMarcel Holtmann 205a8746417SMarcel Holtmann #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) 206efc7688bSMarcel Holtmann #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) 207a8746417SMarcel Holtmann 2081da177e4SLinus Torvalds /* ACL flags */ 209e702112fSAndrei Emeltchenko #define ACL_START_NO_FLUSH 0x00 2101da177e4SLinus Torvalds #define ACL_CONT 0x01 2111da177e4SLinus Torvalds #define ACL_START 0x02 212d73a0988SAndrei Emeltchenko #define ACL_COMPLETE 0x03 2131da177e4SLinus Torvalds #define ACL_ACTIVE_BCAST 0x04 2141da177e4SLinus Torvalds #define ACL_PICO_BCAST 0x08 2151da177e4SLinus Torvalds 2161da177e4SLinus Torvalds /* Baseband links */ 2171da177e4SLinus Torvalds #define SCO_LINK 0x00 2181da177e4SLinus Torvalds #define ACL_LINK 0x01 2195b7f9909SMarcel Holtmann #define ESCO_LINK 0x02 220fcd89c09SVille Tervo /* Low Energy links do not have defined link type. Use invented one */ 221fcd89c09SVille Tervo #define LE_LINK 0x80 2223161ae1cSAndrei Emeltchenko #define AMP_LINK 0x81 2231da177e4SLinus Torvalds 2241da177e4SLinus Torvalds /* LMP features */ 2251da177e4SLinus Torvalds #define LMP_3SLOT 0x01 2261da177e4SLinus Torvalds #define LMP_5SLOT 0x02 2271da177e4SLinus Torvalds #define LMP_ENCRYPT 0x04 2281da177e4SLinus Torvalds #define LMP_SOFFSET 0x08 2291da177e4SLinus Torvalds #define LMP_TACCURACY 0x10 2301da177e4SLinus Torvalds #define LMP_RSWITCH 0x20 2311da177e4SLinus Torvalds #define LMP_HOLD 0x40 23204837f64SMarcel Holtmann #define LMP_SNIFF 0x80 2331da177e4SLinus Torvalds 2341da177e4SLinus Torvalds #define LMP_PARK 0x01 2351da177e4SLinus Torvalds #define LMP_RSSI 0x02 2361da177e4SLinus Torvalds #define LMP_QUALITY 0x04 2371da177e4SLinus Torvalds #define LMP_SCO 0x08 2381da177e4SLinus Torvalds #define LMP_HV2 0x10 2391da177e4SLinus Torvalds #define LMP_HV3 0x20 2401da177e4SLinus Torvalds #define LMP_ULAW 0x40 2411da177e4SLinus Torvalds #define LMP_ALAW 0x80 2421da177e4SLinus Torvalds 2431da177e4SLinus Torvalds #define LMP_CVSD 0x01 2441da177e4SLinus Torvalds #define LMP_PSCHEME 0x02 2451da177e4SLinus Torvalds #define LMP_PCONTROL 0x04 24607a5c61eSFrédéric Dalleau #define LMP_TRANSPARENT 0x08 2471da177e4SLinus Torvalds 248d5859e22SJohan Hedberg #define LMP_RSSI_INQ 0x40 2495b7f9909SMarcel Holtmann #define LMP_ESCO 0x80 2505b7f9909SMarcel Holtmann 2515b7f9909SMarcel Holtmann #define LMP_EV4 0x01 2525b7f9909SMarcel Holtmann #define LMP_EV5 0x02 25369ab39eaSJohan Hedberg #define LMP_NO_BREDR 0x20 254d5859e22SJohan Hedberg #define LMP_LE 0x40 2555b7f9909SMarcel Holtmann 25604837f64SMarcel Holtmann #define LMP_SNIFF_SUBR 0x02 257d5859e22SJohan Hedberg #define LMP_PAUSE_ENC 0x04 258efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_2M 0x20 259efc7688bSMarcel Holtmann #define LMP_EDR_ESCO_3M 0x40 260efc7688bSMarcel Holtmann #define LMP_EDR_3S_ESCO 0x80 26104837f64SMarcel Holtmann 262d5859e22SJohan Hedberg #define LMP_EXT_INQ 0x01 263e6100a25SAndre Guedes #define LMP_SIMUL_LE_BR 0x02 264769be974SMarcel Holtmann #define LMP_SIMPLE_PAIR 0x08 265e702112fSAndrei Emeltchenko #define LMP_NO_FLUSH 0x40 266769be974SMarcel Holtmann 267d5859e22SJohan Hedberg #define LMP_LSTO 0x01 268d5859e22SJohan Hedberg #define LMP_INQ_TX_PWR 0x02 269971e3a4bSAndre Guedes #define LMP_EXTFEATURES 0x80 270d5859e22SJohan Hedberg 271eead27daSAndre Guedes /* Extended LMP features */ 272cc2c04ecSJohan Hedberg #define LMP_HOST_SSP 0x01 273eead27daSAndre Guedes #define LMP_HOST_LE 0x02 274cc2c04ecSJohan Hedberg #define LMP_HOST_LE_BREDR 0x04 275eead27daSAndre Guedes 27604837f64SMarcel Holtmann /* Connection modes */ 27704837f64SMarcel Holtmann #define HCI_CM_ACTIVE 0x0000 27804837f64SMarcel Holtmann #define HCI_CM_HOLD 0x0001 27904837f64SMarcel Holtmann #define HCI_CM_SNIFF 0x0002 28004837f64SMarcel Holtmann #define HCI_CM_PARK 0x0003 28104837f64SMarcel Holtmann 2821da177e4SLinus Torvalds /* Link policies */ 2831da177e4SLinus Torvalds #define HCI_LP_RSWITCH 0x0001 2841da177e4SLinus Torvalds #define HCI_LP_HOLD 0x0002 2851da177e4SLinus Torvalds #define HCI_LP_SNIFF 0x0004 2861da177e4SLinus Torvalds #define HCI_LP_PARK 0x0008 2871da177e4SLinus Torvalds 28804837f64SMarcel Holtmann /* Link modes */ 2891da177e4SLinus Torvalds #define HCI_LM_ACCEPT 0x8000 2901da177e4SLinus Torvalds #define HCI_LM_MASTER 0x0001 2911da177e4SLinus Torvalds #define HCI_LM_AUTH 0x0002 2921da177e4SLinus Torvalds #define HCI_LM_ENCRYPT 0x0004 2931da177e4SLinus Torvalds #define HCI_LM_TRUSTED 0x0008 2941da177e4SLinus Torvalds #define HCI_LM_RELIABLE 0x0010 2951da177e4SLinus Torvalds #define HCI_LM_SECURE 0x0020 2961da177e4SLinus Torvalds 29740be492fSMarcel Holtmann /* Authentication types */ 29840be492fSMarcel Holtmann #define HCI_AT_NO_BONDING 0x00 29940be492fSMarcel Holtmann #define HCI_AT_NO_BONDING_MITM 0x01 30040be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING 0x02 30140be492fSMarcel Holtmann #define HCI_AT_DEDICATED_BONDING_MITM 0x03 30240be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING 0x04 30340be492fSMarcel Holtmann #define HCI_AT_GENERAL_BONDING_MITM 0x05 30440be492fSMarcel Holtmann 305a77b15a6SMikel Astiz /* I/O capabilities */ 306a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_ONLY 0x00 307a77b15a6SMikel Astiz #define HCI_IO_DISPLAY_YESNO 0x01 308a77b15a6SMikel Astiz #define HCI_IO_KEYBOARD_ONLY 0x02 309a77b15a6SMikel Astiz #define HCI_IO_NO_INPUT_OUTPUT 0x03 310a77b15a6SMikel Astiz 311b6020ba0SWaldemar Rymarkiewicz /* Link Key types */ 312b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_COMBINATION 0x00 313b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_LOCAL_UNIT 0x01 314b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_REMOTE_UNIT 0x02 315b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_DEBUG_COMBINATION 0x03 316b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_UNAUTH_COMBINATION 0x04 317b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_AUTH_COMBINATION 0x05 318b6020ba0SWaldemar Rymarkiewicz #define HCI_LK_CHANGED_COMBINATION 0x06 319b899efafSVinicius Costa Gomes /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ 320b899efafSVinicius Costa Gomes #define HCI_SMP_STK 0x80 321b899efafSVinicius Costa Gomes #define HCI_SMP_STK_SLAVE 0x81 322b899efafSVinicius Costa Gomes #define HCI_SMP_LTK 0x82 323b899efafSVinicius Costa Gomes #define HCI_SMP_LTK_SLAVE 0x83 324b6020ba0SWaldemar Rymarkiewicz 3259f5a0d7bSAndrei Emeltchenko /* ---- HCI Error Codes ---- */ 3269f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_AUTH_FAILURE 0x05 327cdcba7c6SMikel Astiz #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 3289f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REJ_BAD_ADDR 0x0f 3299f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_REMOTE_USER_TERM 0x13 330cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_LOW_RESOURCES 0x14 331cdcba7c6SMikel Astiz #define HCI_ERROR_REMOTE_POWER_OFF 0x15 3329f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_LOCAL_HOST_TERM 0x16 3339f5a0d7bSAndrei Emeltchenko #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 3349f5a0d7bSAndrei Emeltchenko 3352455a3eaSAndrei Emeltchenko /* Flow control modes */ 3362455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 3372455a3eaSAndrei Emeltchenko #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 3382455a3eaSAndrei Emeltchenko 339bbaf444aSJohan Hedberg /* The core spec defines 127 as the "not available" value */ 340bbaf444aSJohan Hedberg #define HCI_TX_POWER_INVALID 127 341bbaf444aSJohan Hedberg 34232748db0SJohan Hedberg /* Extended Inquiry Response field types */ 34332748db0SJohan Hedberg #define EIR_FLAGS 0x01 /* flags */ 34432748db0SJohan Hedberg #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 34532748db0SJohan Hedberg #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ 34632748db0SJohan Hedberg #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ 34732748db0SJohan Hedberg #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ 34832748db0SJohan Hedberg #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ 34932748db0SJohan Hedberg #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ 35032748db0SJohan Hedberg #define EIR_NAME_SHORT 0x08 /* shortened local name */ 35132748db0SJohan Hedberg #define EIR_NAME_COMPLETE 0x09 /* complete local name */ 35232748db0SJohan Hedberg #define EIR_TX_POWER 0x0A /* transmit power level */ 3539ec9fc8aSJohan Hedberg #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ 3549ec9fc8aSJohan Hedberg #define EIR_SSP_HASH_C 0x0E /* Simple Pairing Hash C */ 3559ec9fc8aSJohan Hedberg #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ 35632748db0SJohan Hedberg #define EIR_DEVICE_ID 0x10 /* device ID */ 35732748db0SJohan Hedberg 3583f0f524bSJohan Hedberg /* Low Energy Advertising Flags */ 3593f0f524bSJohan Hedberg #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ 3603f0f524bSJohan Hedberg #define LE_AD_GENERAL 0x02 /* General Discoverable */ 3613f0f524bSJohan Hedberg #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ 3623f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ 3633f0f524bSJohan Hedberg #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ 3643f0f524bSJohan Hedberg 3651da177e4SLinus Torvalds /* ----- HCI Commands ---- */ 3666bd32326SVille Tervo #define HCI_OP_NOP 0x0000 3676bd32326SVille Tervo 368a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY 0x0401 369a9de9248SMarcel Holtmann struct hci_cp_inquiry { 370a9de9248SMarcel Holtmann __u8 lap[3]; 371a9de9248SMarcel Holtmann __u8 length; 372a9de9248SMarcel Holtmann __u8 num_rsp; 37366c853ccSGustavo F. Padovan } __packed; 3741da177e4SLinus Torvalds 375a9de9248SMarcel Holtmann #define HCI_OP_INQUIRY_CANCEL 0x0402 376a9de9248SMarcel Holtmann 37779d6e068SAndre Guedes #define HCI_OP_PERIODIC_INQ 0x0403 37879d6e068SAndre Guedes 379a9de9248SMarcel Holtmann #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 380a9de9248SMarcel Holtmann 381a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN 0x0405 382a9de9248SMarcel Holtmann struct hci_cp_create_conn { 383a9de9248SMarcel Holtmann bdaddr_t bdaddr; 384a9de9248SMarcel Holtmann __le16 pkt_type; 385a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 386a9de9248SMarcel Holtmann __u8 pscan_mode; 387a9de9248SMarcel Holtmann __le16 clock_offset; 388a9de9248SMarcel Holtmann __u8 role_switch; 38966c853ccSGustavo F. Padovan } __packed; 3901da177e4SLinus Torvalds 391a9de9248SMarcel Holtmann #define HCI_OP_DISCONNECT 0x0406 392a9de9248SMarcel Holtmann struct hci_cp_disconnect { 393a9de9248SMarcel Holtmann __le16 handle; 394a9de9248SMarcel Holtmann __u8 reason; 39566c853ccSGustavo F. Padovan } __packed; 3961da177e4SLinus Torvalds 397a9de9248SMarcel Holtmann #define HCI_OP_ADD_SCO 0x0407 398a9de9248SMarcel Holtmann struct hci_cp_add_sco { 399a9de9248SMarcel Holtmann __le16 handle; 400a9de9248SMarcel Holtmann __le16 pkt_type; 40166c853ccSGustavo F. Padovan } __packed; 402a9de9248SMarcel Holtmann 403a9de9248SMarcel Holtmann #define HCI_OP_CREATE_CONN_CANCEL 0x0408 404a9de9248SMarcel Holtmann struct hci_cp_create_conn_cancel { 4051da177e4SLinus Torvalds bdaddr_t bdaddr; 40666c853ccSGustavo F. Padovan } __packed; 4071da177e4SLinus Torvalds 408a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_CONN_REQ 0x0409 409a9de9248SMarcel Holtmann struct hci_cp_accept_conn_req { 410a9de9248SMarcel Holtmann bdaddr_t bdaddr; 411a9de9248SMarcel Holtmann __u8 role; 41266c853ccSGustavo F. Padovan } __packed; 4131da177e4SLinus Torvalds 414a9de9248SMarcel Holtmann #define HCI_OP_REJECT_CONN_REQ 0x040a 415a9de9248SMarcel Holtmann struct hci_cp_reject_conn_req { 416a9de9248SMarcel Holtmann bdaddr_t bdaddr; 417a9de9248SMarcel Holtmann __u8 reason; 41866c853ccSGustavo F. Padovan } __packed; 4191da177e4SLinus Torvalds 420a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_REPLY 0x040b 421a9de9248SMarcel Holtmann struct hci_cp_link_key_reply { 422a9de9248SMarcel Holtmann bdaddr_t bdaddr; 4239b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 42466c853ccSGustavo F. Padovan } __packed; 4251da177e4SLinus Torvalds 426a9de9248SMarcel Holtmann #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c 427a9de9248SMarcel Holtmann struct hci_cp_link_key_neg_reply { 428a9de9248SMarcel Holtmann bdaddr_t bdaddr; 42966c853ccSGustavo F. Padovan } __packed; 4301da177e4SLinus Torvalds 431a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_REPLY 0x040d 432a9de9248SMarcel Holtmann struct hci_cp_pin_code_reply { 433a9de9248SMarcel Holtmann bdaddr_t bdaddr; 434a9de9248SMarcel Holtmann __u8 pin_len; 435a9de9248SMarcel Holtmann __u8 pin_code[16]; 43666c853ccSGustavo F. Padovan } __packed; 437980e1a53SJohan Hedberg struct hci_rp_pin_code_reply { 438980e1a53SJohan Hedberg __u8 status; 439980e1a53SJohan Hedberg bdaddr_t bdaddr; 440980e1a53SJohan Hedberg } __packed; 441a9de9248SMarcel Holtmann 442a9de9248SMarcel Holtmann #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 443a9de9248SMarcel Holtmann struct hci_cp_pin_code_neg_reply { 444a9de9248SMarcel Holtmann bdaddr_t bdaddr; 44566c853ccSGustavo F. Padovan } __packed; 446980e1a53SJohan Hedberg struct hci_rp_pin_code_neg_reply { 447980e1a53SJohan Hedberg __u8 status; 448980e1a53SJohan Hedberg bdaddr_t bdaddr; 449980e1a53SJohan Hedberg } __packed; 450a9de9248SMarcel Holtmann 451a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_PTYPE 0x040f 452a9de9248SMarcel Holtmann struct hci_cp_change_conn_ptype { 453a9de9248SMarcel Holtmann __le16 handle; 454a9de9248SMarcel Holtmann __le16 pkt_type; 45566c853ccSGustavo F. Padovan } __packed; 456a9de9248SMarcel Holtmann 457a9de9248SMarcel Holtmann #define HCI_OP_AUTH_REQUESTED 0x0411 458a9de9248SMarcel Holtmann struct hci_cp_auth_requested { 459a9de9248SMarcel Holtmann __le16 handle; 46066c853ccSGustavo F. Padovan } __packed; 461a9de9248SMarcel Holtmann 462a9de9248SMarcel Holtmann #define HCI_OP_SET_CONN_ENCRYPT 0x0413 463a9de9248SMarcel Holtmann struct hci_cp_set_conn_encrypt { 464a9de9248SMarcel Holtmann __le16 handle; 465a9de9248SMarcel Holtmann __u8 encrypt; 46666c853ccSGustavo F. Padovan } __packed; 467a9de9248SMarcel Holtmann 468a9de9248SMarcel Holtmann #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 469a9de9248SMarcel Holtmann struct hci_cp_change_conn_link_key { 470a9de9248SMarcel Holtmann __le16 handle; 47166c853ccSGustavo F. Padovan } __packed; 472a9de9248SMarcel Holtmann 473a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ 0x0419 474a9de9248SMarcel Holtmann struct hci_cp_remote_name_req { 475a9de9248SMarcel Holtmann bdaddr_t bdaddr; 476a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 477a9de9248SMarcel Holtmann __u8 pscan_mode; 478a9de9248SMarcel Holtmann __le16 clock_offset; 47966c853ccSGustavo F. Padovan } __packed; 480a9de9248SMarcel Holtmann 481a9de9248SMarcel Holtmann #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a 482a9de9248SMarcel Holtmann struct hci_cp_remote_name_req_cancel { 483a9de9248SMarcel Holtmann bdaddr_t bdaddr; 48466c853ccSGustavo F. Padovan } __packed; 485a9de9248SMarcel Holtmann 486a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_FEATURES 0x041b 487a9de9248SMarcel Holtmann struct hci_cp_read_remote_features { 488a9de9248SMarcel Holtmann __le16 handle; 48966c853ccSGustavo F. Padovan } __packed; 490a9de9248SMarcel Holtmann 491a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c 492a9de9248SMarcel Holtmann struct hci_cp_read_remote_ext_features { 493a9de9248SMarcel Holtmann __le16 handle; 494a9de9248SMarcel Holtmann __u8 page; 49566c853ccSGustavo F. Padovan } __packed; 496a9de9248SMarcel Holtmann 497a9de9248SMarcel Holtmann #define HCI_OP_READ_REMOTE_VERSION 0x041d 498a9de9248SMarcel Holtmann struct hci_cp_read_remote_version { 499a9de9248SMarcel Holtmann __le16 handle; 50066c853ccSGustavo F. Padovan } __packed; 501a9de9248SMarcel Holtmann 502a9de9248SMarcel Holtmann #define HCI_OP_SETUP_SYNC_CONN 0x0428 503a9de9248SMarcel Holtmann struct hci_cp_setup_sync_conn { 504a9de9248SMarcel Holtmann __le16 handle; 505a9de9248SMarcel Holtmann __le32 tx_bandwidth; 506a9de9248SMarcel Holtmann __le32 rx_bandwidth; 507a9de9248SMarcel Holtmann __le16 max_latency; 508a9de9248SMarcel Holtmann __le16 voice_setting; 509a9de9248SMarcel Holtmann __u8 retrans_effort; 510a9de9248SMarcel Holtmann __le16 pkt_type; 51166c853ccSGustavo F. Padovan } __packed; 512a9de9248SMarcel Holtmann 513a9de9248SMarcel Holtmann #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 514a9de9248SMarcel Holtmann struct hci_cp_accept_sync_conn_req { 515a9de9248SMarcel Holtmann bdaddr_t bdaddr; 516a9de9248SMarcel Holtmann __le32 tx_bandwidth; 517a9de9248SMarcel Holtmann __le32 rx_bandwidth; 518a9de9248SMarcel Holtmann __le16 max_latency; 519a9de9248SMarcel Holtmann __le16 content_format; 520a9de9248SMarcel Holtmann __u8 retrans_effort; 521a9de9248SMarcel Holtmann __le16 pkt_type; 52266c853ccSGustavo F. Padovan } __packed; 523a9de9248SMarcel Holtmann 524a9de9248SMarcel Holtmann #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a 525a9de9248SMarcel Holtmann struct hci_cp_reject_sync_conn_req { 526a9de9248SMarcel Holtmann bdaddr_t bdaddr; 527a9de9248SMarcel Holtmann __u8 reason; 52866c853ccSGustavo F. Padovan } __packed; 529a9de9248SMarcel Holtmann 53017fa4b9dSJohan Hedberg #define HCI_OP_IO_CAPABILITY_REPLY 0x042b 53117fa4b9dSJohan Hedberg struct hci_cp_io_capability_reply { 53217fa4b9dSJohan Hedberg bdaddr_t bdaddr; 53317fa4b9dSJohan Hedberg __u8 capability; 53417fa4b9dSJohan Hedberg __u8 oob_data; 53517fa4b9dSJohan Hedberg __u8 authentication; 53617fa4b9dSJohan Hedberg } __packed; 53717fa4b9dSJohan Hedberg 538a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_REPLY 0x042c 539a5c29683SJohan Hedberg struct hci_cp_user_confirm_reply { 540a5c29683SJohan Hedberg bdaddr_t bdaddr; 541a5c29683SJohan Hedberg } __packed; 542a5c29683SJohan Hedberg struct hci_rp_user_confirm_reply { 543a5c29683SJohan Hedberg __u8 status; 544a5c29683SJohan Hedberg bdaddr_t bdaddr; 545a5c29683SJohan Hedberg } __packed; 546a5c29683SJohan Hedberg 547a5c29683SJohan Hedberg #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 548a5c29683SJohan Hedberg 5499ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_REPLY 0x042e 5509ad4019aSBrian Gix struct hci_cp_user_passkey_reply { 5519ad4019aSBrian Gix bdaddr_t bdaddr; 5529ad4019aSBrian Gix __le32 passkey; 5539ad4019aSBrian Gix } __packed; 5549ad4019aSBrian Gix 5559ad4019aSBrian Gix #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f 5569ad4019aSBrian Gix 5572763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 5582763eda6SSzymon Janc struct hci_cp_remote_oob_data_reply { 5592763eda6SSzymon Janc bdaddr_t bdaddr; 5602763eda6SSzymon Janc __u8 hash[16]; 5612763eda6SSzymon Janc __u8 randomizer[16]; 5622763eda6SSzymon Janc } __packed; 5632763eda6SSzymon Janc 5642763eda6SSzymon Janc #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 5652763eda6SSzymon Janc struct hci_cp_remote_oob_data_neg_reply { 5662763eda6SSzymon Janc bdaddr_t bdaddr; 5672763eda6SSzymon Janc } __packed; 5682763eda6SSzymon Janc 56903b555e1SJohan Hedberg #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 57003b555e1SJohan Hedberg struct hci_cp_io_capability_neg_reply { 57103b555e1SJohan Hedberg bdaddr_t bdaddr; 57203b555e1SJohan Hedberg __u8 reason; 57303b555e1SJohan Hedberg } __packed; 57403b555e1SJohan Hedberg 575523e93cdSAndrei Emeltchenko #define HCI_OP_CREATE_PHY_LINK 0x0435 576523e93cdSAndrei Emeltchenko struct hci_cp_create_phy_link { 577523e93cdSAndrei Emeltchenko __u8 phy_handle; 578523e93cdSAndrei Emeltchenko __u8 key_len; 579523e93cdSAndrei Emeltchenko __u8 key_type; 580523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 581523e93cdSAndrei Emeltchenko } __packed; 582523e93cdSAndrei Emeltchenko 583523e93cdSAndrei Emeltchenko #define HCI_OP_ACCEPT_PHY_LINK 0x0436 584523e93cdSAndrei Emeltchenko struct hci_cp_accept_phy_link { 585523e93cdSAndrei Emeltchenko __u8 phy_handle; 586523e93cdSAndrei Emeltchenko __u8 key_len; 587523e93cdSAndrei Emeltchenko __u8 key_type; 588523e93cdSAndrei Emeltchenko __u8 key[HCI_AMP_LINK_KEY_SIZE]; 589523e93cdSAndrei Emeltchenko } __packed; 590523e93cdSAndrei Emeltchenko 591523e93cdSAndrei Emeltchenko #define HCI_OP_DISCONN_PHY_LINK 0x0437 592523e93cdSAndrei Emeltchenko struct hci_cp_disconn_phy_link { 593523e93cdSAndrei Emeltchenko __u8 phy_handle; 594523e93cdSAndrei Emeltchenko __u8 reason; 595b078b564SAndrei Emeltchenko } __packed; 596b078b564SAndrei Emeltchenko 597b078b564SAndrei Emeltchenko struct ext_flow_spec { 598b078b564SAndrei Emeltchenko __u8 id; 599b078b564SAndrei Emeltchenko __u8 stype; 600b078b564SAndrei Emeltchenko __le16 msdu; 601b078b564SAndrei Emeltchenko __le32 sdu_itime; 602b078b564SAndrei Emeltchenko __le32 acc_lat; 603b078b564SAndrei Emeltchenko __le32 flush_to; 604b078b564SAndrei Emeltchenko } __packed; 605b078b564SAndrei Emeltchenko 606b078b564SAndrei Emeltchenko #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 607b078b564SAndrei Emeltchenko #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 608b078b564SAndrei Emeltchenko struct hci_cp_create_accept_logical_link { 609b078b564SAndrei Emeltchenko __u8 phy_handle; 610b078b564SAndrei Emeltchenko struct ext_flow_spec tx_flow_spec; 611b078b564SAndrei Emeltchenko struct ext_flow_spec rx_flow_spec; 612b078b564SAndrei Emeltchenko } __packed; 613b078b564SAndrei Emeltchenko 614b078b564SAndrei Emeltchenko #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a 615b078b564SAndrei Emeltchenko struct hci_cp_disconn_logical_link { 616b078b564SAndrei Emeltchenko __le16 log_handle; 617b078b564SAndrei Emeltchenko } __packed; 618b078b564SAndrei Emeltchenko 619b078b564SAndrei Emeltchenko #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b 620b078b564SAndrei Emeltchenko struct hci_cp_logical_link_cancel { 621b078b564SAndrei Emeltchenko __u8 phy_handle; 622b078b564SAndrei Emeltchenko __u8 flow_spec_id; 623b078b564SAndrei Emeltchenko } __packed; 624b078b564SAndrei Emeltchenko 625b078b564SAndrei Emeltchenko struct hci_rp_logical_link_cancel { 626b078b564SAndrei Emeltchenko __u8 status; 627b078b564SAndrei Emeltchenko __u8 phy_handle; 628b078b564SAndrei Emeltchenko __u8 flow_spec_id; 629523e93cdSAndrei Emeltchenko } __packed; 630523e93cdSAndrei Emeltchenko 631a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_MODE 0x0803 632a9de9248SMarcel Holtmann struct hci_cp_sniff_mode { 633a9de9248SMarcel Holtmann __le16 handle; 634a9de9248SMarcel Holtmann __le16 max_interval; 635a9de9248SMarcel Holtmann __le16 min_interval; 636a9de9248SMarcel Holtmann __le16 attempt; 637a9de9248SMarcel Holtmann __le16 timeout; 63866c853ccSGustavo F. Padovan } __packed; 639a9de9248SMarcel Holtmann 640a9de9248SMarcel Holtmann #define HCI_OP_EXIT_SNIFF_MODE 0x0804 641a9de9248SMarcel Holtmann struct hci_cp_exit_sniff_mode { 642a9de9248SMarcel Holtmann __le16 handle; 64366c853ccSGustavo F. Padovan } __packed; 644a9de9248SMarcel Holtmann 645a9de9248SMarcel Holtmann #define HCI_OP_ROLE_DISCOVERY 0x0809 646a9de9248SMarcel Holtmann struct hci_cp_role_discovery { 647a9de9248SMarcel Holtmann __le16 handle; 64866c853ccSGustavo F. Padovan } __packed; 649a9de9248SMarcel Holtmann struct hci_rp_role_discovery { 650a9de9248SMarcel Holtmann __u8 status; 651a9de9248SMarcel Holtmann __le16 handle; 652a9de9248SMarcel Holtmann __u8 role; 65366c853ccSGustavo F. Padovan } __packed; 654a9de9248SMarcel Holtmann 655a9de9248SMarcel Holtmann #define HCI_OP_SWITCH_ROLE 0x080b 656a9de9248SMarcel Holtmann struct hci_cp_switch_role { 657a9de9248SMarcel Holtmann bdaddr_t bdaddr; 658a9de9248SMarcel Holtmann __u8 role; 65966c853ccSGustavo F. Padovan } __packed; 660a9de9248SMarcel Holtmann 661a9de9248SMarcel Holtmann #define HCI_OP_READ_LINK_POLICY 0x080c 662a9de9248SMarcel Holtmann struct hci_cp_read_link_policy { 663a9de9248SMarcel Holtmann __le16 handle; 66466c853ccSGustavo F. Padovan } __packed; 665a9de9248SMarcel Holtmann struct hci_rp_read_link_policy { 666a9de9248SMarcel Holtmann __u8 status; 667a9de9248SMarcel Holtmann __le16 handle; 668a9de9248SMarcel Holtmann __le16 policy; 66966c853ccSGustavo F. Padovan } __packed; 670a9de9248SMarcel Holtmann 671a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LINK_POLICY 0x080d 672a9de9248SMarcel Holtmann struct hci_cp_write_link_policy { 673a9de9248SMarcel Holtmann __le16 handle; 674a9de9248SMarcel Holtmann __le16 policy; 67566c853ccSGustavo F. Padovan } __packed; 676a9de9248SMarcel Holtmann struct hci_rp_write_link_policy { 677a9de9248SMarcel Holtmann __u8 status; 678a9de9248SMarcel Holtmann __le16 handle; 67966c853ccSGustavo F. Padovan } __packed; 680a9de9248SMarcel Holtmann 681e4e8e37cSMarcel Holtmann #define HCI_OP_READ_DEF_LINK_POLICY 0x080e 682e4e8e37cSMarcel Holtmann struct hci_rp_read_def_link_policy { 683e4e8e37cSMarcel Holtmann __u8 status; 684e4e8e37cSMarcel Holtmann __le16 policy; 68566c853ccSGustavo F. Padovan } __packed; 686e4e8e37cSMarcel Holtmann 687e4e8e37cSMarcel Holtmann #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f 688e4e8e37cSMarcel Holtmann struct hci_cp_write_def_link_policy { 689e4e8e37cSMarcel Holtmann __le16 policy; 69066c853ccSGustavo F. Padovan } __packed; 691e4e8e37cSMarcel Holtmann 692a9de9248SMarcel Holtmann #define HCI_OP_SNIFF_SUBRATE 0x0811 693a9de9248SMarcel Holtmann struct hci_cp_sniff_subrate { 694a9de9248SMarcel Holtmann __le16 handle; 695a9de9248SMarcel Holtmann __le16 max_latency; 696a9de9248SMarcel Holtmann __le16 min_remote_timeout; 697a9de9248SMarcel Holtmann __le16 min_local_timeout; 69866c853ccSGustavo F. Padovan } __packed; 699a9de9248SMarcel Holtmann 700a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_MASK 0x0c01 701a9de9248SMarcel Holtmann 702a9de9248SMarcel Holtmann #define HCI_OP_RESET 0x0c03 703a9de9248SMarcel Holtmann 704a9de9248SMarcel Holtmann #define HCI_OP_SET_EVENT_FLT 0x0c05 7051da177e4SLinus Torvalds struct hci_cp_set_event_flt { 7061da177e4SLinus Torvalds __u8 flt_type; 7071da177e4SLinus Torvalds __u8 cond_type; 7081da177e4SLinus Torvalds __u8 condition[0]; 70966c853ccSGustavo F. Padovan } __packed; 7101da177e4SLinus Torvalds 7111da177e4SLinus Torvalds /* Filter types */ 7121da177e4SLinus Torvalds #define HCI_FLT_CLEAR_ALL 0x00 7131da177e4SLinus Torvalds #define HCI_FLT_INQ_RESULT 0x01 7141da177e4SLinus Torvalds #define HCI_FLT_CONN_SETUP 0x02 7151da177e4SLinus Torvalds 7161da177e4SLinus Torvalds /* CONN_SETUP Condition types */ 7171da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_ALL 0x00 7181da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 7191da177e4SLinus Torvalds #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 7201da177e4SLinus Torvalds 7211da177e4SLinus Torvalds /* CONN_SETUP Conditions */ 7221da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_OFF 0x01 7231da177e4SLinus Torvalds #define HCI_CONN_SETUP_AUTO_ON 0x02 7241da177e4SLinus Torvalds 725b0916ea0SJohan Hedberg #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 726b0916ea0SJohan Hedberg struct hci_cp_delete_stored_link_key { 727b0916ea0SJohan Hedberg bdaddr_t bdaddr; 728b0916ea0SJohan Hedberg __u8 delete_all; 729b0916ea0SJohan Hedberg } __packed; 730b0916ea0SJohan Hedberg 7311f6c6378SJohan Hedberg #define HCI_MAX_NAME_LENGTH 248 7321f6c6378SJohan Hedberg 733a9de9248SMarcel Holtmann #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 734a9de9248SMarcel Holtmann struct hci_cp_write_local_name { 7351f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 73666c853ccSGustavo F. Padovan } __packed; 737a9de9248SMarcel Holtmann 738a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_NAME 0x0c14 739a9de9248SMarcel Holtmann struct hci_rp_read_local_name { 740a9de9248SMarcel Holtmann __u8 status; 7411f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 74266c853ccSGustavo F. Padovan } __packed; 743a9de9248SMarcel Holtmann 744a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 745a9de9248SMarcel Holtmann 746a9de9248SMarcel Holtmann #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 747a9de9248SMarcel Holtmann 748a9de9248SMarcel Holtmann #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a 749a9de9248SMarcel Holtmann #define SCAN_DISABLED 0x00 750a9de9248SMarcel Holtmann #define SCAN_INQUIRY 0x01 751a9de9248SMarcel Holtmann #define SCAN_PAGE 0x02 752a9de9248SMarcel Holtmann 753a9de9248SMarcel Holtmann #define HCI_OP_READ_AUTH_ENABLE 0x0c1f 754a9de9248SMarcel Holtmann 755a9de9248SMarcel Holtmann #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 756a9de9248SMarcel Holtmann #define AUTH_DISABLED 0x00 757a9de9248SMarcel Holtmann #define AUTH_ENABLED 0x01 758a9de9248SMarcel Holtmann 759a9de9248SMarcel Holtmann #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 760a9de9248SMarcel Holtmann 761a9de9248SMarcel Holtmann #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 762a9de9248SMarcel Holtmann #define ENCRYPT_DISABLED 0x00 763a9de9248SMarcel Holtmann #define ENCRYPT_P2P 0x01 764a9de9248SMarcel Holtmann #define ENCRYPT_BOTH 0x02 765a9de9248SMarcel Holtmann 766a9de9248SMarcel Holtmann #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 767a9de9248SMarcel Holtmann struct hci_rp_read_class_of_dev { 7681da177e4SLinus Torvalds __u8 status; 7691da177e4SLinus Torvalds __u8 dev_class[3]; 77066c853ccSGustavo F. Padovan } __packed; 7711da177e4SLinus Torvalds 772a9de9248SMarcel Holtmann #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 773a9de9248SMarcel Holtmann struct hci_cp_write_class_of_dev { 7741da177e4SLinus Torvalds __u8 dev_class[3]; 77566c853ccSGustavo F. Padovan } __packed; 7761da177e4SLinus Torvalds 777a9de9248SMarcel Holtmann #define HCI_OP_READ_VOICE_SETTING 0x0c25 7781da177e4SLinus Torvalds struct hci_rp_read_voice_setting { 7791da177e4SLinus Torvalds __u8 status; 7801ebb9252SMarcel Holtmann __le16 voice_setting; 78166c853ccSGustavo F. Padovan } __packed; 7821da177e4SLinus Torvalds 783a9de9248SMarcel Holtmann #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 7841da177e4SLinus Torvalds struct hci_cp_write_voice_setting { 7851ebb9252SMarcel Holtmann __le16 voice_setting; 78666c853ccSGustavo F. Padovan } __packed; 7871da177e4SLinus Torvalds 788a9de9248SMarcel Holtmann #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 7891da177e4SLinus Torvalds struct hci_cp_host_buffer_size { 7901ebb9252SMarcel Holtmann __le16 acl_mtu; 7911da177e4SLinus Torvalds __u8 sco_mtu; 7921ebb9252SMarcel Holtmann __le16 acl_max_pkt; 7931ebb9252SMarcel Holtmann __le16 sco_max_pkt; 79466c853ccSGustavo F. Padovan } __packed; 7951da177e4SLinus Torvalds 796d5859e22SJohan Hedberg #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 797d5859e22SJohan Hedberg 79880a1e1dbSJohan Hedberg #define HCI_MAX_EIR_LENGTH 240 79980a1e1dbSJohan Hedberg 80080a1e1dbSJohan Hedberg #define HCI_OP_WRITE_EIR 0x0c52 80180a1e1dbSJohan Hedberg struct hci_cp_write_eir { 802816a11d5SJohan Hedberg __u8 fec; 803816a11d5SJohan Hedberg __u8 data[HCI_MAX_EIR_LENGTH]; 80480a1e1dbSJohan Hedberg } __packed; 80580a1e1dbSJohan Hedberg 806333140b5SMarcel Holtmann #define HCI_OP_READ_SSP_MODE 0x0c55 807333140b5SMarcel Holtmann struct hci_rp_read_ssp_mode { 808333140b5SMarcel Holtmann __u8 status; 809333140b5SMarcel Holtmann __u8 mode; 81066c853ccSGustavo F. Padovan } __packed; 811333140b5SMarcel Holtmann 812333140b5SMarcel Holtmann #define HCI_OP_WRITE_SSP_MODE 0x0c56 813333140b5SMarcel Holtmann struct hci_cp_write_ssp_mode { 814333140b5SMarcel Holtmann __u8 mode; 81566c853ccSGustavo F. Padovan } __packed; 816333140b5SMarcel Holtmann 817c35938b2SSzymon Janc #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 818c35938b2SSzymon Janc struct hci_rp_read_local_oob_data { 819c35938b2SSzymon Janc __u8 status; 820c35938b2SSzymon Janc __u8 hash[16]; 821c35938b2SSzymon Janc __u8 randomizer[16]; 822c35938b2SSzymon Janc } __packed; 823c35938b2SSzymon Janc 824d5859e22SJohan Hedberg #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 82591c4e9b1SMarcel Holtmann struct hci_rp_read_inq_rsp_tx_power { 82691c4e9b1SMarcel Holtmann __u8 status; 82791c4e9b1SMarcel Holtmann __s8 tx_power; 82891c4e9b1SMarcel Holtmann } __packed; 829d5859e22SJohan Hedberg 830d62e6d67SJohan Hedberg #define HCI_OP_SET_EVENT_MASK_PAGE_2 0x0c63 831d62e6d67SJohan Hedberg 8321e89cffbSAndrei Emeltchenko #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 8331e89cffbSAndrei Emeltchenko struct hci_rp_read_flow_control_mode { 8341e89cffbSAndrei Emeltchenko __u8 status; 8351e89cffbSAndrei Emeltchenko __u8 mode; 8361e89cffbSAndrei Emeltchenko } __packed; 8371e89cffbSAndrei Emeltchenko 838f9b49306SAndre Guedes #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 839f9b49306SAndre Guedes struct hci_cp_write_le_host_supported { 840f9b49306SAndre Guedes __u8 le; 841f9b49306SAndre Guedes __u8 simul; 842f9b49306SAndre Guedes } __packed; 843f9b49306SAndre Guedes 844d0bf75a5SDoHyun Pyun #define HCI_OP_SET_RESERVED_LT_ADDR 0x0c74 845d0bf75a5SDoHyun Pyun struct hci_cp_set_reserved_lt_addr { 846d0bf75a5SDoHyun Pyun __u8 lt_addr; 847d0bf75a5SDoHyun Pyun } __packed; 848d0bf75a5SDoHyun Pyun struct hci_rp_set_reserved_lt_addr { 849d0bf75a5SDoHyun Pyun __u8 status; 850d0bf75a5SDoHyun Pyun __u8 lt_addr; 851d0bf75a5SDoHyun Pyun } __packed; 852d0bf75a5SDoHyun Pyun 8536a20eaf4SDoHyun Pyun #define HCI_OP_DELETE_RESERVED_LT_ADDR 0x0c75 8546a20eaf4SDoHyun Pyun struct hci_cp_delete_reserved_lt_addr { 8556a20eaf4SDoHyun Pyun __u8 lt_addr; 8566a20eaf4SDoHyun Pyun } __packed; 8576a20eaf4SDoHyun Pyun struct hci_rp_delete_reserved_lt_addr { 8586a20eaf4SDoHyun Pyun __u8 status; 8596a20eaf4SDoHyun Pyun __u8 lt_addr; 8606a20eaf4SDoHyun Pyun } __packed; 8616a20eaf4SDoHyun Pyun 8627d1dab49SDoHyun Pyun #define HCI_OP_SET_CSB_DATA 0x0c76 8637d1dab49SDoHyun Pyun struct hci_cp_set_csb_data { 8647d1dab49SDoHyun Pyun __u8 lt_addr; 8657d1dab49SDoHyun Pyun __u8 fragment; 8667d1dab49SDoHyun Pyun __u8 data_length; 8677d1dab49SDoHyun Pyun __u8 data[HCI_MAX_CSB_DATA_SIZE]; 8687d1dab49SDoHyun Pyun } __packed; 8697d1dab49SDoHyun Pyun struct hci_rp_set_csb_data { 8707d1dab49SDoHyun Pyun __u8 status; 8717d1dab49SDoHyun Pyun __u8 lt_addr; 8727d1dab49SDoHyun Pyun } __packed; 8737d1dab49SDoHyun Pyun 8745d4e7e8dSJohan Hedberg #define HCI_OP_READ_SYNC_TRAIN_PARAMS 0x0c77 8755d4e7e8dSJohan Hedberg 876*a9b07a64SDoHyun Pyun #define HCI_OP_WRITE_SYNC_TRAIN_PARAMS 0x0c78 877*a9b07a64SDoHyun Pyun struct hci_cp_write_sync_train_params { 878*a9b07a64SDoHyun Pyun __le16 interval_min; 879*a9b07a64SDoHyun Pyun __le16 interval_max; 880*a9b07a64SDoHyun Pyun __le32 sync_train_tout; 881*a9b07a64SDoHyun Pyun __u8 service_data; 882*a9b07a64SDoHyun Pyun } __packed; 883*a9b07a64SDoHyun Pyun struct hci_rp_write_sync_train_params { 884*a9b07a64SDoHyun Pyun __u8 status; 885*a9b07a64SDoHyun Pyun __le16 sync_train_int; 886*a9b07a64SDoHyun Pyun } __packed; 887*a9b07a64SDoHyun Pyun 888a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_VERSION 0x1001 889a9de9248SMarcel Holtmann struct hci_rp_read_local_version { 8901da177e4SLinus Torvalds __u8 status; 891a9de9248SMarcel Holtmann __u8 hci_ver; 892a9de9248SMarcel Holtmann __le16 hci_rev; 893a9de9248SMarcel Holtmann __u8 lmp_ver; 894a9de9248SMarcel Holtmann __le16 manufacturer; 895a9de9248SMarcel Holtmann __le16 lmp_subver; 89666c853ccSGustavo F. Padovan } __packed; 8971da177e4SLinus Torvalds 898a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 899a9de9248SMarcel Holtmann struct hci_rp_read_local_commands { 9001da177e4SLinus Torvalds __u8 status; 901a9de9248SMarcel Holtmann __u8 commands[64]; 90266c853ccSGustavo F. Padovan } __packed; 9031da177e4SLinus Torvalds 904a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_FEATURES 0x1003 905a9de9248SMarcel Holtmann struct hci_rp_read_local_features { 906a9de9248SMarcel Holtmann __u8 status; 907a9de9248SMarcel Holtmann __u8 features[8]; 90866c853ccSGustavo F. Padovan } __packed; 909a9de9248SMarcel Holtmann 910a9de9248SMarcel Holtmann #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 911971e3a4bSAndre Guedes struct hci_cp_read_local_ext_features { 912971e3a4bSAndre Guedes __u8 page; 913971e3a4bSAndre Guedes } __packed; 914a9de9248SMarcel Holtmann struct hci_rp_read_local_ext_features { 915a9de9248SMarcel Holtmann __u8 status; 916a9de9248SMarcel Holtmann __u8 page; 917a9de9248SMarcel Holtmann __u8 max_page; 918a9de9248SMarcel Holtmann __u8 features[8]; 91966c853ccSGustavo F. Padovan } __packed; 920a9de9248SMarcel Holtmann 921a9de9248SMarcel Holtmann #define HCI_OP_READ_BUFFER_SIZE 0x1005 922a9de9248SMarcel Holtmann struct hci_rp_read_buffer_size { 923a9de9248SMarcel Holtmann __u8 status; 924a9de9248SMarcel Holtmann __le16 acl_mtu; 925a9de9248SMarcel Holtmann __u8 sco_mtu; 926a9de9248SMarcel Holtmann __le16 acl_max_pkt; 927a9de9248SMarcel Holtmann __le16 sco_max_pkt; 92866c853ccSGustavo F. Padovan } __packed; 929a9de9248SMarcel Holtmann 930a9de9248SMarcel Holtmann #define HCI_OP_READ_BD_ADDR 0x1009 931a9de9248SMarcel Holtmann struct hci_rp_read_bd_addr { 932a9de9248SMarcel Holtmann __u8 status; 9331da177e4SLinus Torvalds bdaddr_t bdaddr; 93466c853ccSGustavo F. Padovan } __packed; 9351da177e4SLinus Torvalds 936350ee4cfSAndrei Emeltchenko #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a 937350ee4cfSAndrei Emeltchenko struct hci_rp_read_data_block_size { 938350ee4cfSAndrei Emeltchenko __u8 status; 939350ee4cfSAndrei Emeltchenko __le16 max_acl_len; 940350ee4cfSAndrei Emeltchenko __le16 block_len; 941350ee4cfSAndrei Emeltchenko __le16 num_blocks; 942350ee4cfSAndrei Emeltchenko } __packed; 943350ee4cfSAndrei Emeltchenko 944f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b 945f332ec66SJohan Hedberg struct hci_rp_read_page_scan_activity { 946f332ec66SJohan Hedberg __u8 status; 947f332ec66SJohan Hedberg __le16 interval; 948f332ec66SJohan Hedberg __le16 window; 949f332ec66SJohan Hedberg } __packed; 950f332ec66SJohan Hedberg 951f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c 952f6422ec6SAntti Julku struct hci_cp_write_page_scan_activity { 953f6422ec6SAntti Julku __le16 interval; 954f6422ec6SAntti Julku __le16 window; 955f6422ec6SAntti Julku } __packed; 956f6422ec6SAntti Julku 957f332ec66SJohan Hedberg #define HCI_OP_READ_PAGE_SCAN_TYPE 0x0c46 958f332ec66SJohan Hedberg struct hci_rp_read_page_scan_type { 959f332ec66SJohan Hedberg __u8 status; 960f332ec66SJohan Hedberg __u8 type; 961f332ec66SJohan Hedberg } __packed; 962f332ec66SJohan Hedberg 963f6422ec6SAntti Julku #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 964f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_STANDARD 0x00 965f6422ec6SAntti Julku #define PAGE_SCAN_TYPE_INTERLACED 0x01 966f6422ec6SAntti Julku 967928abaa7SAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 968928abaa7SAndrei Emeltchenko struct hci_rp_read_local_amp_info { 969928abaa7SAndrei Emeltchenko __u8 status; 970928abaa7SAndrei Emeltchenko __u8 amp_status; 971928abaa7SAndrei Emeltchenko __le32 total_bw; 972928abaa7SAndrei Emeltchenko __le32 max_bw; 973928abaa7SAndrei Emeltchenko __le32 min_latency; 974928abaa7SAndrei Emeltchenko __le32 max_pdu; 975928abaa7SAndrei Emeltchenko __u8 amp_type; 976928abaa7SAndrei Emeltchenko __le16 pal_cap; 977928abaa7SAndrei Emeltchenko __le16 max_assoc_size; 978928abaa7SAndrei Emeltchenko __le32 max_flush_to; 979928abaa7SAndrei Emeltchenko __le32 be_flush_to; 980928abaa7SAndrei Emeltchenko } __packed; 981928abaa7SAndrei Emeltchenko 982523e93cdSAndrei Emeltchenko #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a 983523e93cdSAndrei Emeltchenko struct hci_cp_read_local_amp_assoc { 984523e93cdSAndrei Emeltchenko __u8 phy_handle; 985523e93cdSAndrei Emeltchenko __le16 len_so_far; 986523e93cdSAndrei Emeltchenko __le16 max_len; 987523e93cdSAndrei Emeltchenko } __packed; 988523e93cdSAndrei Emeltchenko struct hci_rp_read_local_amp_assoc { 989523e93cdSAndrei Emeltchenko __u8 status; 990523e93cdSAndrei Emeltchenko __u8 phy_handle; 991523e93cdSAndrei Emeltchenko __le16 rem_len; 992523e93cdSAndrei Emeltchenko __u8 frag[0]; 993523e93cdSAndrei Emeltchenko } __packed; 994523e93cdSAndrei Emeltchenko 995523e93cdSAndrei Emeltchenko #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b 996523e93cdSAndrei Emeltchenko struct hci_cp_write_remote_amp_assoc { 997523e93cdSAndrei Emeltchenko __u8 phy_handle; 998523e93cdSAndrei Emeltchenko __le16 len_so_far; 999523e93cdSAndrei Emeltchenko __le16 rem_len; 1000523e93cdSAndrei Emeltchenko __u8 frag[0]; 1001523e93cdSAndrei Emeltchenko } __packed; 1002523e93cdSAndrei Emeltchenko struct hci_rp_write_remote_amp_assoc { 1003523e93cdSAndrei Emeltchenko __u8 status; 1004523e93cdSAndrei Emeltchenko __u8 phy_handle; 1005523e93cdSAndrei Emeltchenko } __packed; 1006523e93cdSAndrei Emeltchenko 100763185f64SVille Tervo #define HCI_OP_LE_SET_EVENT_MASK 0x2001 100863185f64SVille Tervo struct hci_cp_le_set_event_mask { 100963185f64SVille Tervo __u8 mask[8]; 101063185f64SVille Tervo } __packed; 101163185f64SVille Tervo 101263185f64SVille Tervo #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 101363185f64SVille Tervo struct hci_rp_le_read_buffer_size { 101463185f64SVille Tervo __u8 status; 101563185f64SVille Tervo __le16 le_mtu; 101663185f64SVille Tervo __u8 le_max_pkt; 101763185f64SVille Tervo } __packed; 101863185f64SVille Tervo 101960e77321SJohan Hedberg #define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003 102060e77321SJohan Hedberg struct hci_rp_le_read_local_features { 102160e77321SJohan Hedberg __u8 status; 102260e77321SJohan Hedberg __u8 features[8]; 102360e77321SJohan Hedberg } __packed; 102460e77321SJohan Hedberg 1025d13eafceSMarcel Holtmann #define HCI_OP_LE_SET_RANDOM_ADDR 0x2005 1026d13eafceSMarcel Holtmann 10278fa19098SJohan Hedberg #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 10288fa19098SJohan Hedberg struct hci_rp_le_read_adv_tx_power { 10298fa19098SJohan Hedberg __u8 status; 10308fa19098SJohan Hedberg __s8 tx_power; 10318fa19098SJohan Hedberg } __packed; 10328fa19098SJohan Hedberg 10333f0f524bSJohan Hedberg #define HCI_MAX_AD_LENGTH 31 10343f0f524bSJohan Hedberg 10353f0f524bSJohan Hedberg #define HCI_OP_LE_SET_ADV_DATA 0x2008 10363f0f524bSJohan Hedberg struct hci_cp_le_set_adv_data { 10373f0f524bSJohan Hedberg __u8 length; 10383f0f524bSJohan Hedberg __u8 data[HCI_MAX_AD_LENGTH]; 10393f0f524bSJohan Hedberg } __packed; 10403f0f524bSJohan Hedberg 1041c1d5dc4aSJohan Hedberg #define HCI_OP_LE_SET_ADV_ENABLE 0x200a 1042c1d5dc4aSJohan Hedberg 10435df480b5SAndre Guedes #define LE_SCAN_PASSIVE 0x00 10445df480b5SAndre Guedes #define LE_SCAN_ACTIVE 0x01 10455df480b5SAndre Guedes 104607f7fa5dSAndre Guedes #define HCI_OP_LE_SET_SCAN_PARAM 0x200b 104707f7fa5dSAndre Guedes struct hci_cp_le_set_scan_param { 104807f7fa5dSAndre Guedes __u8 type; 104907f7fa5dSAndre Guedes __le16 interval; 105007f7fa5dSAndre Guedes __le16 window; 105107f7fa5dSAndre Guedes __u8 own_address_type; 105207f7fa5dSAndre Guedes __u8 filter_policy; 105307f7fa5dSAndre Guedes } __packed; 105407f7fa5dSAndre Guedes 105576a388beSAndre Guedes #define LE_SCAN_DISABLE 0x00 105676a388beSAndre Guedes #define LE_SCAN_ENABLE 0x01 1057525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_DISABLE 0x00 1058525e296aSAndre Guedes #define LE_SCAN_FILTER_DUP_ENABLE 0x01 105968a8aea4SAndrei Emeltchenko 1060eb9d91f5SAndre Guedes #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c 1061eb9d91f5SAndre Guedes struct hci_cp_le_set_scan_enable { 1062eb9d91f5SAndre Guedes __u8 enable; 1063eb9d91f5SAndre Guedes __u8 filter_dup; 1064eb9d91f5SAndre Guedes } __packed; 1065eb9d91f5SAndre Guedes 106663185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN 0x200d 106763185f64SVille Tervo struct hci_cp_le_create_conn { 106863185f64SVille Tervo __le16 scan_interval; 106963185f64SVille Tervo __le16 scan_window; 107063185f64SVille Tervo __u8 filter_policy; 107163185f64SVille Tervo __u8 peer_addr_type; 107263185f64SVille Tervo bdaddr_t peer_addr; 107363185f64SVille Tervo __u8 own_address_type; 107463185f64SVille Tervo __le16 conn_interval_min; 107563185f64SVille Tervo __le16 conn_interval_max; 107663185f64SVille Tervo __le16 conn_latency; 107763185f64SVille Tervo __le16 supervision_timeout; 107863185f64SVille Tervo __le16 min_ce_len; 107963185f64SVille Tervo __le16 max_ce_len; 108063185f64SVille Tervo } __packed; 108163185f64SVille Tervo 108263185f64SVille Tervo #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 108363185f64SVille Tervo 1084cf1d081fSJohan Hedberg #define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f 1085cf1d081fSJohan Hedberg struct hci_rp_le_read_white_list_size { 1086cf1d081fSJohan Hedberg __u8 status; 1087cf1d081fSJohan Hedberg __u8 size; 1088cf1d081fSJohan Hedberg } __packed; 1089cf1d081fSJohan Hedberg 10902ce603ebSClaudio Takahasi #define HCI_OP_LE_CONN_UPDATE 0x2013 10912ce603ebSClaudio Takahasi struct hci_cp_le_conn_update { 10922ce603ebSClaudio Takahasi __le16 handle; 10932ce603ebSClaudio Takahasi __le16 conn_interval_min; 10942ce603ebSClaudio Takahasi __le16 conn_interval_max; 10952ce603ebSClaudio Takahasi __le16 conn_latency; 10962ce603ebSClaudio Takahasi __le16 supervision_timeout; 10972ce603ebSClaudio Takahasi __le16 min_ce_len; 10982ce603ebSClaudio Takahasi __le16 max_ce_len; 10992ce603ebSClaudio Takahasi } __packed; 11002ce603ebSClaudio Takahasi 1101a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_START_ENC 0x2019 1102a7a595f6SVinicius Costa Gomes struct hci_cp_le_start_enc { 1103a7a595f6SVinicius Costa Gomes __le16 handle; 1104a7a595f6SVinicius Costa Gomes __u8 rand[8]; 1105a7a595f6SVinicius Costa Gomes __le16 ediv; 1106a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1107a7a595f6SVinicius Costa Gomes } __packed; 1108a7a595f6SVinicius Costa Gomes 1109a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_REPLY 0x201a 1110a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_reply { 1111a7a595f6SVinicius Costa Gomes __le16 handle; 1112a7a595f6SVinicius Costa Gomes __u8 ltk[16]; 1113a7a595f6SVinicius Costa Gomes } __packed; 1114a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_reply { 1115a7a595f6SVinicius Costa Gomes __u8 status; 1116a7a595f6SVinicius Costa Gomes __le16 handle; 1117a7a595f6SVinicius Costa Gomes } __packed; 1118a7a595f6SVinicius Costa Gomes 1119a7a595f6SVinicius Costa Gomes #define HCI_OP_LE_LTK_NEG_REPLY 0x201b 1120a7a595f6SVinicius Costa Gomes struct hci_cp_le_ltk_neg_reply { 1121a7a595f6SVinicius Costa Gomes __le16 handle; 1122a7a595f6SVinicius Costa Gomes } __packed; 1123a7a595f6SVinicius Costa Gomes struct hci_rp_le_ltk_neg_reply { 1124a7a595f6SVinicius Costa Gomes __u8 status; 1125a7a595f6SVinicius Costa Gomes __le16 handle; 1126a7a595f6SVinicius Costa Gomes } __packed; 1127a7a595f6SVinicius Costa Gomes 11289b008c04SJohan Hedberg #define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c 11299b008c04SJohan Hedberg struct hci_rp_le_read_supported_states { 11309b008c04SJohan Hedberg __u8 status; 11319b008c04SJohan Hedberg __u8 le_states[8]; 11329b008c04SJohan Hedberg } __packed; 11339b008c04SJohan Hedberg 11341da177e4SLinus Torvalds /* ---- HCI Events ---- */ 11351da177e4SLinus Torvalds #define HCI_EV_INQUIRY_COMPLETE 0x01 11361da177e4SLinus Torvalds 11371da177e4SLinus Torvalds #define HCI_EV_INQUIRY_RESULT 0x02 11381da177e4SLinus Torvalds struct inquiry_info { 11391da177e4SLinus Torvalds bdaddr_t bdaddr; 11401da177e4SLinus Torvalds __u8 pscan_rep_mode; 11411da177e4SLinus Torvalds __u8 pscan_period_mode; 11421da177e4SLinus Torvalds __u8 pscan_mode; 11431da177e4SLinus Torvalds __u8 dev_class[3]; 11441ebb9252SMarcel Holtmann __le16 clock_offset; 114566c853ccSGustavo F. Padovan } __packed; 11461da177e4SLinus Torvalds 11471da177e4SLinus Torvalds #define HCI_EV_CONN_COMPLETE 0x03 11481da177e4SLinus Torvalds struct hci_ev_conn_complete { 11491da177e4SLinus Torvalds __u8 status; 11501ebb9252SMarcel Holtmann __le16 handle; 11511da177e4SLinus Torvalds bdaddr_t bdaddr; 11521da177e4SLinus Torvalds __u8 link_type; 11531da177e4SLinus Torvalds __u8 encr_mode; 115466c853ccSGustavo F. Padovan } __packed; 11551da177e4SLinus Torvalds 11561da177e4SLinus Torvalds #define HCI_EV_CONN_REQUEST 0x04 11571da177e4SLinus Torvalds struct hci_ev_conn_request { 11581da177e4SLinus Torvalds bdaddr_t bdaddr; 11591da177e4SLinus Torvalds __u8 dev_class[3]; 11601da177e4SLinus Torvalds __u8 link_type; 116166c853ccSGustavo F. Padovan } __packed; 11621da177e4SLinus Torvalds 11631da177e4SLinus Torvalds #define HCI_EV_DISCONN_COMPLETE 0x05 11641da177e4SLinus Torvalds struct hci_ev_disconn_complete { 11651da177e4SLinus Torvalds __u8 status; 11661ebb9252SMarcel Holtmann __le16 handle; 11671da177e4SLinus Torvalds __u8 reason; 116866c853ccSGustavo F. Padovan } __packed; 11691da177e4SLinus Torvalds 11701da177e4SLinus Torvalds #define HCI_EV_AUTH_COMPLETE 0x06 11711da177e4SLinus Torvalds struct hci_ev_auth_complete { 11721da177e4SLinus Torvalds __u8 status; 11731ebb9252SMarcel Holtmann __le16 handle; 117466c853ccSGustavo F. Padovan } __packed; 11751da177e4SLinus Torvalds 1176a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_NAME 0x07 1177a9de9248SMarcel Holtmann struct hci_ev_remote_name { 1178a9de9248SMarcel Holtmann __u8 status; 1179a9de9248SMarcel Holtmann bdaddr_t bdaddr; 11801f6c6378SJohan Hedberg __u8 name[HCI_MAX_NAME_LENGTH]; 118166c853ccSGustavo F. Padovan } __packed; 1182a9de9248SMarcel Holtmann 11831da177e4SLinus Torvalds #define HCI_EV_ENCRYPT_CHANGE 0x08 11841da177e4SLinus Torvalds struct hci_ev_encrypt_change { 11851da177e4SLinus Torvalds __u8 status; 11861ebb9252SMarcel Holtmann __le16 handle; 11871da177e4SLinus Torvalds __u8 encrypt; 118866c853ccSGustavo F. Padovan } __packed; 11891da177e4SLinus Torvalds 1190a9de9248SMarcel Holtmann #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 1191a9de9248SMarcel Holtmann struct hci_ev_change_link_key_complete { 11921da177e4SLinus Torvalds __u8 status; 11931ebb9252SMarcel Holtmann __le16 handle; 119466c853ccSGustavo F. Padovan } __packed; 11951da177e4SLinus Torvalds 1196a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_FEATURES 0x0b 1197a9de9248SMarcel Holtmann struct hci_ev_remote_features { 1198a9de9248SMarcel Holtmann __u8 status; 1199a9de9248SMarcel Holtmann __le16 handle; 1200a9de9248SMarcel Holtmann __u8 features[8]; 120166c853ccSGustavo F. Padovan } __packed; 1202a9de9248SMarcel Holtmann 1203a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_VERSION 0x0c 1204a9de9248SMarcel Holtmann struct hci_ev_remote_version { 1205a9de9248SMarcel Holtmann __u8 status; 1206a9de9248SMarcel Holtmann __le16 handle; 1207a9de9248SMarcel Holtmann __u8 lmp_ver; 1208a9de9248SMarcel Holtmann __le16 manufacturer; 1209a9de9248SMarcel Holtmann __le16 lmp_subver; 121066c853ccSGustavo F. Padovan } __packed; 1211a9de9248SMarcel Holtmann 1212a9de9248SMarcel Holtmann #define HCI_EV_QOS_SETUP_COMPLETE 0x0d 12131da177e4SLinus Torvalds struct hci_qos { 12141da177e4SLinus Torvalds __u8 service_type; 12151da177e4SLinus Torvalds __u32 token_rate; 12161da177e4SLinus Torvalds __u32 peak_bandwidth; 12171da177e4SLinus Torvalds __u32 latency; 12181da177e4SLinus Torvalds __u32 delay_variation; 121966c853ccSGustavo F. Padovan } __packed; 12201da177e4SLinus Torvalds struct hci_ev_qos_setup_complete { 12211da177e4SLinus Torvalds __u8 status; 12221ebb9252SMarcel Holtmann __le16 handle; 12231da177e4SLinus Torvalds struct hci_qos qos; 122466c853ccSGustavo F. Padovan } __packed; 12251da177e4SLinus Torvalds 1226a9de9248SMarcel Holtmann #define HCI_EV_CMD_COMPLETE 0x0e 12271da177e4SLinus Torvalds struct hci_ev_cmd_complete { 12281da177e4SLinus Torvalds __u8 ncmd; 12291ebb9252SMarcel Holtmann __le16 opcode; 123066c853ccSGustavo F. Padovan } __packed; 12311da177e4SLinus Torvalds 1232a9de9248SMarcel Holtmann #define HCI_EV_CMD_STATUS 0x0f 12331da177e4SLinus Torvalds struct hci_ev_cmd_status { 12341da177e4SLinus Torvalds __u8 status; 12351da177e4SLinus Torvalds __u8 ncmd; 12361ebb9252SMarcel Holtmann __le16 opcode; 123766c853ccSGustavo F. Padovan } __packed; 12381da177e4SLinus Torvalds 12391da177e4SLinus Torvalds #define HCI_EV_ROLE_CHANGE 0x12 12401da177e4SLinus Torvalds struct hci_ev_role_change { 12411da177e4SLinus Torvalds __u8 status; 12421da177e4SLinus Torvalds bdaddr_t bdaddr; 12431da177e4SLinus Torvalds __u8 role; 124466c853ccSGustavo F. Padovan } __packed; 12451da177e4SLinus Torvalds 1246a9de9248SMarcel Holtmann #define HCI_EV_NUM_COMP_PKTS 0x13 1247613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info { 1248613a1c0cSAndrei Emeltchenko __le16 handle; 1249613a1c0cSAndrei Emeltchenko __le16 count; 1250613a1c0cSAndrei Emeltchenko } __packed; 1251613a1c0cSAndrei Emeltchenko 1252a9de9248SMarcel Holtmann struct hci_ev_num_comp_pkts { 1253a9de9248SMarcel Holtmann __u8 num_hndl; 1254613a1c0cSAndrei Emeltchenko struct hci_comp_pkts_info handles[0]; 125566c853ccSGustavo F. Padovan } __packed; 1256a9de9248SMarcel Holtmann 12571da177e4SLinus Torvalds #define HCI_EV_MODE_CHANGE 0x14 12581da177e4SLinus Torvalds struct hci_ev_mode_change { 12591da177e4SLinus Torvalds __u8 status; 12601ebb9252SMarcel Holtmann __le16 handle; 12611da177e4SLinus Torvalds __u8 mode; 12621ebb9252SMarcel Holtmann __le16 interval; 126366c853ccSGustavo F. Padovan } __packed; 12641da177e4SLinus Torvalds 12651da177e4SLinus Torvalds #define HCI_EV_PIN_CODE_REQ 0x16 12661da177e4SLinus Torvalds struct hci_ev_pin_code_req { 12671da177e4SLinus Torvalds bdaddr_t bdaddr; 126866c853ccSGustavo F. Padovan } __packed; 12691da177e4SLinus Torvalds 12701da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_REQ 0x17 12711da177e4SLinus Torvalds struct hci_ev_link_key_req { 12721da177e4SLinus Torvalds bdaddr_t bdaddr; 127366c853ccSGustavo F. Padovan } __packed; 12741da177e4SLinus Torvalds 12751da177e4SLinus Torvalds #define HCI_EV_LINK_KEY_NOTIFY 0x18 12761da177e4SLinus Torvalds struct hci_ev_link_key_notify { 12771da177e4SLinus Torvalds bdaddr_t bdaddr; 12789b3b4460SAndrei Emeltchenko __u8 link_key[HCI_LINK_KEY_SIZE]; 12791da177e4SLinus Torvalds __u8 key_type; 128066c853ccSGustavo F. Padovan } __packed; 12811da177e4SLinus Torvalds 1282a9de9248SMarcel Holtmann #define HCI_EV_CLOCK_OFFSET 0x1c 12831da177e4SLinus Torvalds struct hci_ev_clock_offset { 12841da177e4SLinus Torvalds __u8 status; 12851ebb9252SMarcel Holtmann __le16 handle; 12861ebb9252SMarcel Holtmann __le16 clock_offset; 128766c853ccSGustavo F. Padovan } __packed; 12881da177e4SLinus Torvalds 1289a8746417SMarcel Holtmann #define HCI_EV_PKT_TYPE_CHANGE 0x1d 1290a8746417SMarcel Holtmann struct hci_ev_pkt_type_change { 1291a8746417SMarcel Holtmann __u8 status; 1292a8746417SMarcel Holtmann __le16 handle; 1293a8746417SMarcel Holtmann __le16 pkt_type; 129466c853ccSGustavo F. Padovan } __packed; 1295a8746417SMarcel Holtmann 129685a1e930SMarcel Holtmann #define HCI_EV_PSCAN_REP_MODE 0x20 129785a1e930SMarcel Holtmann struct hci_ev_pscan_rep_mode { 129885a1e930SMarcel Holtmann bdaddr_t bdaddr; 129985a1e930SMarcel Holtmann __u8 pscan_rep_mode; 130066c853ccSGustavo F. Padovan } __packed; 130185a1e930SMarcel Holtmann 1302a9de9248SMarcel Holtmann #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 1303a9de9248SMarcel Holtmann struct inquiry_info_with_rssi { 1304a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1305a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1306a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1307a9de9248SMarcel Holtmann __u8 dev_class[3]; 1308a9de9248SMarcel Holtmann __le16 clock_offset; 1309a9de9248SMarcel Holtmann __s8 rssi; 131066c853ccSGustavo F. Padovan } __packed; 1311a9de9248SMarcel Holtmann struct inquiry_info_with_rssi_and_pscan_mode { 1312a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1313a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1314a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1315a9de9248SMarcel Holtmann __u8 pscan_mode; 1316a9de9248SMarcel Holtmann __u8 dev_class[3]; 1317a9de9248SMarcel Holtmann __le16 clock_offset; 1318a9de9248SMarcel Holtmann __s8 rssi; 131966c853ccSGustavo F. Padovan } __packed; 1320a9de9248SMarcel Holtmann 1321a9de9248SMarcel Holtmann #define HCI_EV_REMOTE_EXT_FEATURES 0x23 1322a9de9248SMarcel Holtmann struct hci_ev_remote_ext_features { 1323a9de9248SMarcel Holtmann __u8 status; 1324a9de9248SMarcel Holtmann __le16 handle; 1325a9de9248SMarcel Holtmann __u8 page; 1326a9de9248SMarcel Holtmann __u8 max_page; 1327a9de9248SMarcel Holtmann __u8 features[8]; 132866c853ccSGustavo F. Padovan } __packed; 1329a9de9248SMarcel Holtmann 1330a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_COMPLETE 0x2c 1331a9de9248SMarcel Holtmann struct hci_ev_sync_conn_complete { 1332a9de9248SMarcel Holtmann __u8 status; 1333a9de9248SMarcel Holtmann __le16 handle; 1334a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1335a9de9248SMarcel Holtmann __u8 link_type; 1336a9de9248SMarcel Holtmann __u8 tx_interval; 1337a9de9248SMarcel Holtmann __u8 retrans_window; 1338a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1339a9de9248SMarcel Holtmann __le16 tx_pkt_len; 1340a9de9248SMarcel Holtmann __u8 air_mode; 134166c853ccSGustavo F. Padovan } __packed; 1342a9de9248SMarcel Holtmann 1343a9de9248SMarcel Holtmann #define HCI_EV_SYNC_CONN_CHANGED 0x2d 1344a9de9248SMarcel Holtmann struct hci_ev_sync_conn_changed { 1345a9de9248SMarcel Holtmann __u8 status; 1346a9de9248SMarcel Holtmann __le16 handle; 1347a9de9248SMarcel Holtmann __u8 tx_interval; 1348a9de9248SMarcel Holtmann __u8 retrans_window; 1349a9de9248SMarcel Holtmann __le16 rx_pkt_len; 1350a9de9248SMarcel Holtmann __le16 tx_pkt_len; 135166c853ccSGustavo F. Padovan } __packed; 1352a9de9248SMarcel Holtmann 1353a9de9248SMarcel Holtmann #define HCI_EV_SNIFF_SUBRATE 0x2e 135404837f64SMarcel Holtmann struct hci_ev_sniff_subrate { 135504837f64SMarcel Holtmann __u8 status; 135604837f64SMarcel Holtmann __le16 handle; 135704837f64SMarcel Holtmann __le16 max_tx_latency; 135804837f64SMarcel Holtmann __le16 max_rx_latency; 135904837f64SMarcel Holtmann __le16 max_remote_timeout; 136004837f64SMarcel Holtmann __le16 max_local_timeout; 136166c853ccSGustavo F. Padovan } __packed; 136204837f64SMarcel Holtmann 1363a9de9248SMarcel Holtmann #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f 1364a9de9248SMarcel Holtmann struct extended_inquiry_info { 1365a9de9248SMarcel Holtmann bdaddr_t bdaddr; 1366a9de9248SMarcel Holtmann __u8 pscan_rep_mode; 1367a9de9248SMarcel Holtmann __u8 pscan_period_mode; 1368a9de9248SMarcel Holtmann __u8 dev_class[3]; 1369a9de9248SMarcel Holtmann __le16 clock_offset; 1370a9de9248SMarcel Holtmann __s8 rssi; 1371a9de9248SMarcel Holtmann __u8 data[240]; 137266c853ccSGustavo F. Padovan } __packed; 1373a9de9248SMarcel Holtmann 13741c2e0041SJohan Hedberg #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 13751c2e0041SJohan Hedberg struct hci_ev_key_refresh_complete { 13761c2e0041SJohan Hedberg __u8 status; 13771c2e0041SJohan Hedberg __le16 handle; 13781c2e0041SJohan Hedberg } __packed; 13791c2e0041SJohan Hedberg 13800493684eSMarcel Holtmann #define HCI_EV_IO_CAPA_REQUEST 0x31 13810493684eSMarcel Holtmann struct hci_ev_io_capa_request { 13820493684eSMarcel Holtmann bdaddr_t bdaddr; 138366c853ccSGustavo F. Padovan } __packed; 13840493684eSMarcel Holtmann 138503b555e1SJohan Hedberg #define HCI_EV_IO_CAPA_REPLY 0x32 138603b555e1SJohan Hedberg struct hci_ev_io_capa_reply { 138703b555e1SJohan Hedberg bdaddr_t bdaddr; 138803b555e1SJohan Hedberg __u8 capability; 138903b555e1SJohan Hedberg __u8 oob_data; 139003b555e1SJohan Hedberg __u8 authentication; 139103b555e1SJohan Hedberg } __packed; 139203b555e1SJohan Hedberg 1393a5c29683SJohan Hedberg #define HCI_EV_USER_CONFIRM_REQUEST 0x33 1394a5c29683SJohan Hedberg struct hci_ev_user_confirm_req { 1395a5c29683SJohan Hedberg bdaddr_t bdaddr; 1396a5c29683SJohan Hedberg __le32 passkey; 1397a5c29683SJohan Hedberg } __packed; 1398a5c29683SJohan Hedberg 13999ad4019aSBrian Gix #define HCI_EV_USER_PASSKEY_REQUEST 0x34 14009ad4019aSBrian Gix struct hci_ev_user_passkey_req { 14019ad4019aSBrian Gix bdaddr_t bdaddr; 14029ad4019aSBrian Gix } __packed; 14039ad4019aSBrian Gix 14042763eda6SSzymon Janc #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 14052763eda6SSzymon Janc struct hci_ev_remote_oob_data_request { 14062763eda6SSzymon Janc bdaddr_t bdaddr; 14072763eda6SSzymon Janc } __packed; 14082763eda6SSzymon Janc 14090493684eSMarcel Holtmann #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 14100493684eSMarcel Holtmann struct hci_ev_simple_pair_complete { 14110493684eSMarcel Holtmann __u8 status; 14120493684eSMarcel Holtmann bdaddr_t bdaddr; 141366c853ccSGustavo F. Padovan } __packed; 14140493684eSMarcel Holtmann 141592a25256SJohan Hedberg #define HCI_EV_USER_PASSKEY_NOTIFY 0x3b 141692a25256SJohan Hedberg struct hci_ev_user_passkey_notify { 141792a25256SJohan Hedberg bdaddr_t bdaddr; 141892a25256SJohan Hedberg __le32 passkey; 141992a25256SJohan Hedberg } __packed; 142092a25256SJohan Hedberg 142192a25256SJohan Hedberg #define HCI_KEYPRESS_STARTED 0 142292a25256SJohan Hedberg #define HCI_KEYPRESS_ENTERED 1 142392a25256SJohan Hedberg #define HCI_KEYPRESS_ERASED 2 142492a25256SJohan Hedberg #define HCI_KEYPRESS_CLEARED 3 142592a25256SJohan Hedberg #define HCI_KEYPRESS_COMPLETED 4 142692a25256SJohan Hedberg 142792a25256SJohan Hedberg #define HCI_EV_KEYPRESS_NOTIFY 0x3c 142892a25256SJohan Hedberg struct hci_ev_keypress_notify { 142992a25256SJohan Hedberg bdaddr_t bdaddr; 143092a25256SJohan Hedberg __u8 type; 143192a25256SJohan Hedberg } __packed; 143292a25256SJohan Hedberg 143341a96212SMarcel Holtmann #define HCI_EV_REMOTE_HOST_FEATURES 0x3d 143441a96212SMarcel Holtmann struct hci_ev_remote_host_features { 143541a96212SMarcel Holtmann bdaddr_t bdaddr; 143641a96212SMarcel Holtmann __u8 features[8]; 143766c853ccSGustavo F. Padovan } __packed; 143841a96212SMarcel Holtmann 143963185f64SVille Tervo #define HCI_EV_LE_META 0x3e 144063185f64SVille Tervo struct hci_ev_le_meta { 144163185f64SVille Tervo __u8 subevent; 144263185f64SVille Tervo } __packed; 144363185f64SVille Tervo 1444523e93cdSAndrei Emeltchenko #define HCI_EV_PHY_LINK_COMPLETE 0x40 1445523e93cdSAndrei Emeltchenko struct hci_ev_phy_link_complete { 1446523e93cdSAndrei Emeltchenko __u8 status; 1447523e93cdSAndrei Emeltchenko __u8 phy_handle; 1448523e93cdSAndrei Emeltchenko } __packed; 1449523e93cdSAndrei Emeltchenko 1450523e93cdSAndrei Emeltchenko #define HCI_EV_CHANNEL_SELECTED 0x41 1451523e93cdSAndrei Emeltchenko struct hci_ev_channel_selected { 1452523e93cdSAndrei Emeltchenko __u8 phy_handle; 1453523e93cdSAndrei Emeltchenko } __packed; 1454523e93cdSAndrei Emeltchenko 1455523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 1456523e93cdSAndrei Emeltchenko struct hci_ev_disconn_phy_link_complete { 1457523e93cdSAndrei Emeltchenko __u8 status; 1458523e93cdSAndrei Emeltchenko __u8 phy_handle; 1459523e93cdSAndrei Emeltchenko __u8 reason; 1460523e93cdSAndrei Emeltchenko } __packed; 1461523e93cdSAndrei Emeltchenko 1462523e93cdSAndrei Emeltchenko #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 1463523e93cdSAndrei Emeltchenko struct hci_ev_logical_link_complete { 1464523e93cdSAndrei Emeltchenko __u8 status; 1465523e93cdSAndrei Emeltchenko __le16 handle; 1466523e93cdSAndrei Emeltchenko __u8 phy_handle; 1467523e93cdSAndrei Emeltchenko __u8 flow_spec_id; 1468523e93cdSAndrei Emeltchenko } __packed; 1469523e93cdSAndrei Emeltchenko 1470523e93cdSAndrei Emeltchenko #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 1471523e93cdSAndrei Emeltchenko struct hci_ev_disconn_logical_link_complete { 1472523e93cdSAndrei Emeltchenko __u8 status; 1473523e93cdSAndrei Emeltchenko __le16 handle; 1474523e93cdSAndrei Emeltchenko __u8 reason; 1475523e93cdSAndrei Emeltchenko } __packed; 1476523e93cdSAndrei Emeltchenko 147725e89e99SAndrei Emeltchenko #define HCI_EV_NUM_COMP_BLOCKS 0x48 147825e89e99SAndrei Emeltchenko struct hci_comp_blocks_info { 147925e89e99SAndrei Emeltchenko __le16 handle; 148025e89e99SAndrei Emeltchenko __le16 pkts; 148125e89e99SAndrei Emeltchenko __le16 blocks; 148225e89e99SAndrei Emeltchenko } __packed; 148325e89e99SAndrei Emeltchenko 148425e89e99SAndrei Emeltchenko struct hci_ev_num_comp_blocks { 148525e89e99SAndrei Emeltchenko __le16 num_blocks; 148625e89e99SAndrei Emeltchenko __u8 num_hndl; 148725e89e99SAndrei Emeltchenko struct hci_comp_blocks_info handles[0]; 148825e89e99SAndrei Emeltchenko } __packed; 148925e89e99SAndrei Emeltchenko 149063185f64SVille Tervo /* Low energy meta events */ 1491b9b343d2SAndre Guedes #define LE_CONN_ROLE_MASTER 0x00 1492b9b343d2SAndre Guedes 149363185f64SVille Tervo #define HCI_EV_LE_CONN_COMPLETE 0x01 149463185f64SVille Tervo struct hci_ev_le_conn_complete { 149563185f64SVille Tervo __u8 status; 149663185f64SVille Tervo __le16 handle; 149763185f64SVille Tervo __u8 role; 149863185f64SVille Tervo __u8 bdaddr_type; 149963185f64SVille Tervo bdaddr_t bdaddr; 150063185f64SVille Tervo __le16 interval; 150163185f64SVille Tervo __le16 latency; 150263185f64SVille Tervo __le16 supervision_timeout; 150363185f64SVille Tervo __u8 clk_accurancy; 150463185f64SVille Tervo } __packed; 150563185f64SVille Tervo 1506a7a595f6SVinicius Costa Gomes #define HCI_EV_LE_LTK_REQ 0x05 1507a7a595f6SVinicius Costa Gomes struct hci_ev_le_ltk_req { 1508a7a595f6SVinicius Costa Gomes __le16 handle; 1509a7a595f6SVinicius Costa Gomes __u8 random[8]; 1510a7a595f6SVinicius Costa Gomes __le16 ediv; 1511a7a595f6SVinicius Costa Gomes } __packed; 1512a7a595f6SVinicius Costa Gomes 151357a56fd4SAnderson Briglia /* Advertising report event types */ 151457a56fd4SAnderson Briglia #define ADV_IND 0x00 151557a56fd4SAnderson Briglia #define ADV_DIRECT_IND 0x01 151657a56fd4SAnderson Briglia #define ADV_SCAN_IND 0x02 151757a56fd4SAnderson Briglia #define ADV_NONCONN_IND 0x03 151857a56fd4SAnderson Briglia #define ADV_SCAN_RSP 0x04 151957a56fd4SAnderson Briglia 152057a56fd4SAnderson Briglia #define ADDR_LE_DEV_PUBLIC 0x00 152157a56fd4SAnderson Briglia #define ADDR_LE_DEV_RANDOM 0x01 152257a56fd4SAnderson Briglia 152357a56fd4SAnderson Briglia #define HCI_EV_LE_ADVERTISING_REPORT 0x02 152457a56fd4SAnderson Briglia struct hci_ev_le_advertising_info { 152557a56fd4SAnderson Briglia __u8 evt_type; 152657a56fd4SAnderson Briglia __u8 bdaddr_type; 152757a56fd4SAnderson Briglia bdaddr_t bdaddr; 152857a56fd4SAnderson Briglia __u8 length; 152957a56fd4SAnderson Briglia __u8 data[0]; 153057a56fd4SAnderson Briglia } __packed; 153157a56fd4SAnderson Briglia 15321da177e4SLinus Torvalds /* Internal events generated by Bluetooth stack */ 1533a9de9248SMarcel Holtmann #define HCI_EV_STACK_INTERNAL 0xfd 15341da177e4SLinus Torvalds struct hci_ev_stack_internal { 15351da177e4SLinus Torvalds __u16 type; 15361da177e4SLinus Torvalds __u8 data[0]; 153766c853ccSGustavo F. Padovan } __packed; 15381da177e4SLinus Torvalds 15391da177e4SLinus Torvalds #define HCI_EV_SI_DEVICE 0x01 15401da177e4SLinus Torvalds struct hci_ev_si_device { 15411da177e4SLinus Torvalds __u16 event; 15421da177e4SLinus Torvalds __u16 dev_id; 154366c853ccSGustavo F. Padovan } __packed; 15441da177e4SLinus Torvalds 15451da177e4SLinus Torvalds #define HCI_EV_SI_SECURITY 0x02 15461da177e4SLinus Torvalds struct hci_ev_si_security { 15471da177e4SLinus Torvalds __u16 event; 15481da177e4SLinus Torvalds __u16 proto; 15491da177e4SLinus Torvalds __u16 subproto; 15501da177e4SLinus Torvalds __u8 incoming; 155166c853ccSGustavo F. Padovan } __packed; 15521da177e4SLinus Torvalds 15531da177e4SLinus Torvalds /* ---- HCI Packet structures ---- */ 15541da177e4SLinus Torvalds #define HCI_COMMAND_HDR_SIZE 3 15551da177e4SLinus Torvalds #define HCI_EVENT_HDR_SIZE 2 15561da177e4SLinus Torvalds #define HCI_ACL_HDR_SIZE 4 15571da177e4SLinus Torvalds #define HCI_SCO_HDR_SIZE 3 15581da177e4SLinus Torvalds 15591da177e4SLinus Torvalds struct hci_command_hdr { 15601ebb9252SMarcel Holtmann __le16 opcode; /* OCF & OGF */ 15611da177e4SLinus Torvalds __u8 plen; 156266c853ccSGustavo F. Padovan } __packed; 15631da177e4SLinus Torvalds 15641da177e4SLinus Torvalds struct hci_event_hdr { 15651da177e4SLinus Torvalds __u8 evt; 15661da177e4SLinus Torvalds __u8 plen; 156766c853ccSGustavo F. Padovan } __packed; 15681da177e4SLinus Torvalds 15691da177e4SLinus Torvalds struct hci_acl_hdr { 15701ebb9252SMarcel Holtmann __le16 handle; /* Handle & Flags(PB, BC) */ 15711ebb9252SMarcel Holtmann __le16 dlen; 157266c853ccSGustavo F. Padovan } __packed; 15731da177e4SLinus Torvalds 15741da177e4SLinus Torvalds struct hci_sco_hdr { 15751ebb9252SMarcel Holtmann __le16 handle; 15761da177e4SLinus Torvalds __u8 dlen; 157766c853ccSGustavo F. Padovan } __packed; 15781da177e4SLinus Torvalds 15792a123b86SArnaldo Carvalho de Melo static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) 15802a123b86SArnaldo Carvalho de Melo { 15812a123b86SArnaldo Carvalho de Melo return (struct hci_event_hdr *) skb->data; 15822a123b86SArnaldo Carvalho de Melo } 15832a123b86SArnaldo Carvalho de Melo 15842a123b86SArnaldo Carvalho de Melo static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) 15852a123b86SArnaldo Carvalho de Melo { 15862a123b86SArnaldo Carvalho de Melo return (struct hci_acl_hdr *) skb->data; 15872a123b86SArnaldo Carvalho de Melo } 15882a123b86SArnaldo Carvalho de Melo 15892a123b86SArnaldo Carvalho de Melo static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) 15902a123b86SArnaldo Carvalho de Melo { 15912a123b86SArnaldo Carvalho de Melo return (struct hci_sco_hdr *) skb->data; 15922a123b86SArnaldo Carvalho de Melo } 15932a123b86SArnaldo Carvalho de Melo 15941da177e4SLinus Torvalds /* Command opcode pack/unpack */ 1595c3c7ea65SGustavo Padovan #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) 15961da177e4SLinus Torvalds #define hci_opcode_ogf(op) (op >> 10) 15971da177e4SLinus Torvalds #define hci_opcode_ocf(op) (op & 0x03ff) 15981da177e4SLinus Torvalds 15991da177e4SLinus Torvalds /* ACL handle and flags pack/unpack */ 1600c3c7ea65SGustavo Padovan #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) 16011da177e4SLinus Torvalds #define hci_handle(h) (h & 0x0fff) 16021da177e4SLinus Torvalds #define hci_flags(h) (h >> 12) 16031da177e4SLinus Torvalds 16041da177e4SLinus Torvalds /* ---- HCI Sockets ---- */ 16051da177e4SLinus Torvalds 16061da177e4SLinus Torvalds /* Socket options */ 16071da177e4SLinus Torvalds #define HCI_DATA_DIR 1 16081da177e4SLinus Torvalds #define HCI_FILTER 2 16091da177e4SLinus Torvalds #define HCI_TIME_STAMP 3 16101da177e4SLinus Torvalds 16111da177e4SLinus Torvalds /* CMSG flags */ 16121da177e4SLinus Torvalds #define HCI_CMSG_DIR 0x0001 16131da177e4SLinus Torvalds #define HCI_CMSG_TSTAMP 0x0002 16141da177e4SLinus Torvalds 16151da177e4SLinus Torvalds struct sockaddr_hci { 16161da177e4SLinus Torvalds sa_family_t hci_family; 16171da177e4SLinus Torvalds unsigned short hci_dev; 1618c02178d2SJohan Hedberg unsigned short hci_channel; 16191da177e4SLinus Torvalds }; 16201da177e4SLinus Torvalds #define HCI_DEV_NONE 0xffff 16211da177e4SLinus Torvalds 1622c02178d2SJohan Hedberg #define HCI_CHANNEL_RAW 0 162323500189SMarcel Holtmann #define HCI_CHANNEL_USER 1 1624cd82e61cSMarcel Holtmann #define HCI_CHANNEL_MONITOR 2 162566f3b913SGustavo Padovan #define HCI_CHANNEL_CONTROL 3 1626c02178d2SJohan Hedberg 16271da177e4SLinus Torvalds struct hci_filter { 16281da177e4SLinus Torvalds unsigned long type_mask; 16291da177e4SLinus Torvalds unsigned long event_mask[2]; 1630905f3ed6SAl Viro __le16 opcode; 16311da177e4SLinus Torvalds }; 16321da177e4SLinus Torvalds 16331da177e4SLinus Torvalds struct hci_ufilter { 16341da177e4SLinus Torvalds __u32 type_mask; 16351da177e4SLinus Torvalds __u32 event_mask[2]; 1636905f3ed6SAl Viro __le16 opcode; 16371da177e4SLinus Torvalds }; 16381da177e4SLinus Torvalds 16391da177e4SLinus Torvalds #define HCI_FLT_TYPE_BITS 31 16401da177e4SLinus Torvalds #define HCI_FLT_EVENT_BITS 63 16411da177e4SLinus Torvalds #define HCI_FLT_OGF_BITS 63 16421da177e4SLinus Torvalds #define HCI_FLT_OCF_BITS 127 16431da177e4SLinus Torvalds 16441da177e4SLinus Torvalds /* ---- HCI Ioctl requests structures ---- */ 16451da177e4SLinus Torvalds struct hci_dev_stats { 16461da177e4SLinus Torvalds __u32 err_rx; 16471da177e4SLinus Torvalds __u32 err_tx; 16481da177e4SLinus Torvalds __u32 cmd_tx; 16491da177e4SLinus Torvalds __u32 evt_rx; 16501da177e4SLinus Torvalds __u32 acl_tx; 16511da177e4SLinus Torvalds __u32 acl_rx; 16521da177e4SLinus Torvalds __u32 sco_tx; 16531da177e4SLinus Torvalds __u32 sco_rx; 16541da177e4SLinus Torvalds __u32 byte_rx; 16551da177e4SLinus Torvalds __u32 byte_tx; 16561da177e4SLinus Torvalds }; 16571da177e4SLinus Torvalds 16581da177e4SLinus Torvalds struct hci_dev_info { 16591da177e4SLinus Torvalds __u16 dev_id; 16601da177e4SLinus Torvalds char name[8]; 16611da177e4SLinus Torvalds 16621da177e4SLinus Torvalds bdaddr_t bdaddr; 16631da177e4SLinus Torvalds 16641da177e4SLinus Torvalds __u32 flags; 16651da177e4SLinus Torvalds __u8 type; 16661da177e4SLinus Torvalds 16671da177e4SLinus Torvalds __u8 features[8]; 16681da177e4SLinus Torvalds 16691da177e4SLinus Torvalds __u32 pkt_type; 16701da177e4SLinus Torvalds __u32 link_policy; 16711da177e4SLinus Torvalds __u32 link_mode; 16721da177e4SLinus Torvalds 16731da177e4SLinus Torvalds __u16 acl_mtu; 16741da177e4SLinus Torvalds __u16 acl_pkts; 16751da177e4SLinus Torvalds __u16 sco_mtu; 16761da177e4SLinus Torvalds __u16 sco_pkts; 16771da177e4SLinus Torvalds 16781da177e4SLinus Torvalds struct hci_dev_stats stat; 16791da177e4SLinus Torvalds }; 16801da177e4SLinus Torvalds 16811da177e4SLinus Torvalds struct hci_conn_info { 16821da177e4SLinus Torvalds __u16 handle; 16831da177e4SLinus Torvalds bdaddr_t bdaddr; 16841da177e4SLinus Torvalds __u8 type; 16851da177e4SLinus Torvalds __u8 out; 16861da177e4SLinus Torvalds __u16 state; 16871da177e4SLinus Torvalds __u32 link_mode; 16881da177e4SLinus Torvalds }; 16891da177e4SLinus Torvalds 16901da177e4SLinus Torvalds struct hci_dev_req { 16911da177e4SLinus Torvalds __u16 dev_id; 16921da177e4SLinus Torvalds __u32 dev_opt; 16931da177e4SLinus Torvalds }; 16941da177e4SLinus Torvalds 16951da177e4SLinus Torvalds struct hci_dev_list_req { 16961da177e4SLinus Torvalds __u16 dev_num; 16971da177e4SLinus Torvalds struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ 16981da177e4SLinus Torvalds }; 16991da177e4SLinus Torvalds 17001da177e4SLinus Torvalds struct hci_conn_list_req { 17011da177e4SLinus Torvalds __u16 dev_id; 17021da177e4SLinus Torvalds __u16 conn_num; 17031da177e4SLinus Torvalds struct hci_conn_info conn_info[0]; 17041da177e4SLinus Torvalds }; 17051da177e4SLinus Torvalds 17061da177e4SLinus Torvalds struct hci_conn_info_req { 17071da177e4SLinus Torvalds bdaddr_t bdaddr; 17081da177e4SLinus Torvalds __u8 type; 17091da177e4SLinus Torvalds struct hci_conn_info conn_info[0]; 17101da177e4SLinus Torvalds }; 17111da177e4SLinus Torvalds 171240be492fSMarcel Holtmann struct hci_auth_info_req { 171340be492fSMarcel Holtmann bdaddr_t bdaddr; 171440be492fSMarcel Holtmann __u8 type; 171540be492fSMarcel Holtmann }; 171640be492fSMarcel Holtmann 17171da177e4SLinus Torvalds struct hci_inquiry_req { 17181da177e4SLinus Torvalds __u16 dev_id; 17191da177e4SLinus Torvalds __u16 flags; 17201da177e4SLinus Torvalds __u8 lap[3]; 17211da177e4SLinus Torvalds __u8 length; 17221da177e4SLinus Torvalds __u8 num_rsp; 17231da177e4SLinus Torvalds }; 17241da177e4SLinus Torvalds #define IREQ_CACHE_FLUSH 0x0001 17251da177e4SLinus Torvalds 17268b281b9cSFabio Estevam extern bool enable_hs; 17278830f514SAndrei Emeltchenko 17281da177e4SLinus Torvalds #endif /* __HCI_H */ 1729