Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | |
| 5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License version 2 as |
| 9 | published by the Free Software Foundation; |
| 10 | |
| 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | |
Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | SOFTWARE IS DISCLAIMED. |
| 23 | */ |
| 24 | |
| 25 | #ifndef __HCI_H |
| 26 | #define __HCI_H |
| 27 | |
| 28 | #define HCI_MAX_ACL_SIZE 1024 |
| 29 | #define HCI_MAX_SCO_SIZE 255 |
| 30 | #define HCI_MAX_EVENT_SIZE 260 |
| 31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) |
| 32 | |
Andrei Emeltchenko | 9b3b446 | 2012-05-23 11:31:20 +0300 | [diff] [blame] | 33 | #define HCI_LINK_KEY_SIZE 16 |
Andrei Emeltchenko | 523e93c | 2012-05-25 15:09:26 +0300 | [diff] [blame] | 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) |
Andrei Emeltchenko | 9b3b446 | 2012-05-23 11:31:20 +0300 | [diff] [blame] | 35 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | /* HCI dev events */ |
| 37 | #define HCI_DEV_REG 1 |
| 38 | #define HCI_DEV_UNREG 2 |
| 39 | #define HCI_DEV_UP 3 |
| 40 | #define HCI_DEV_DOWN 4 |
| 41 | #define HCI_DEV_SUSPEND 5 |
| 42 | #define HCI_DEV_RESUME 6 |
| 43 | |
| 44 | /* HCI notify events */ |
| 45 | #define HCI_NOTIFY_CONN_ADD 1 |
| 46 | #define HCI_NOTIFY_CONN_DEL 2 |
| 47 | #define HCI_NOTIFY_VOICE_SETTING 3 |
| 48 | |
Marcel Holtmann | c13854c | 2010-02-08 15:27:07 +0100 | [diff] [blame] | 49 | /* HCI bus types */ |
Marcel Holtmann | 0ac5393 | 2006-07-08 13:57:15 +0200 | [diff] [blame] | 50 | #define HCI_VIRTUAL 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #define HCI_USB 1 |
| 52 | #define HCI_PCCARD 2 |
| 53 | #define HCI_UART 3 |
| 54 | #define HCI_RS232 4 |
| 55 | #define HCI_PCI 5 |
Marcel Holtmann | 0ac5393 | 2006-07-08 13:57:15 +0200 | [diff] [blame] | 56 | #define HCI_SDIO 6 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Marcel Holtmann | 943da25 | 2010-02-13 02:28:41 +0100 | [diff] [blame] | 58 | /* HCI controller types */ |
| 59 | #define HCI_BREDR 0x00 |
David Vrabel | 8f1e174 | 2010-08-09 17:38:10 -0400 | [diff] [blame] | 60 | #define HCI_AMP 0x01 |
Marcel Holtmann | 943da25 | 2010-02-13 02:28:41 +0100 | [diff] [blame] | 61 | |
Andrei Emeltchenko | 8598d06 | 2012-05-29 13:59:09 +0300 | [diff] [blame] | 62 | /* First BR/EDR Controller shall have ID = 0 */ |
| 63 | #define HCI_BREDR_ID 0 |
| 64 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | /* HCI device quirks */ |
| 66 | enum { |
Szymon Janc | a6c511c | 2012-05-23 12:35:46 +0200 | [diff] [blame] | 67 | HCI_QUIRK_RESET_ON_CLOSE, |
Marcel Holtmann | da1f519 | 2006-07-03 10:02:29 +0200 | [diff] [blame] | 68 | HCI_QUIRK_RAW_DEVICE, |
| 69 | HCI_QUIRK_FIXUP_BUFFER_SIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | /* HCI device flags */ |
| 73 | enum { |
| 74 | HCI_UP, |
| 75 | HCI_INIT, |
| 76 | HCI_RUNNING, |
| 77 | |
| 78 | HCI_PSCAN, |
| 79 | HCI_ISCAN, |
| 80 | HCI_AUTH, |
| 81 | HCI_ENCRYPT, |
| 82 | HCI_INQUIRY, |
| 83 | |
| 84 | HCI_RAW, |
Johan Hedberg | ab81cbf | 2010-12-15 13:53:18 +0200 | [diff] [blame] | 85 | |
Gustavo F. Padovan | 1057213 | 2011-03-16 15:36:29 -0300 | [diff] [blame] | 86 | HCI_RESET, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | }; |
| 88 | |
Andre Guedes | d23264a | 2011-11-25 20:53:38 -0300 | [diff] [blame] | 89 | /* |
| 90 | * BR/EDR and/or LE controller flags: the flags defined here should represent |
| 91 | * states from the controller. |
| 92 | */ |
| 93 | enum { |
Johan Hedberg | a8b2d5c | 2012-01-08 23:11:15 +0200 | [diff] [blame] | 94 | HCI_SETUP, |
| 95 | HCI_AUTO_OFF, |
| 96 | HCI_MGMT, |
| 97 | HCI_PAIRABLE, |
| 98 | HCI_SERVICE_CACHE, |
| 99 | HCI_LINK_KEYS, |
| 100 | HCI_DEBUG_KEYS, |
Johan Hovold | 9432496 | 2012-03-15 14:48:41 +0100 | [diff] [blame] | 101 | HCI_UNREGISTER, |
Johan Hedberg | a8b2d5c | 2012-01-08 23:11:15 +0200 | [diff] [blame] | 102 | |
Andre Guedes | d23264a | 2011-11-25 20:53:38 -0300 | [diff] [blame] | 103 | HCI_LE_SCAN, |
Johan Hedberg | 84bde9d6c | 2012-01-25 14:21:06 +0200 | [diff] [blame] | 104 | HCI_SSP_ENABLED, |
Johan Hedberg | 6d80dfd | 2012-02-20 23:50:38 +0200 | [diff] [blame] | 105 | HCI_HS_ENABLED, |
Johan Hedberg | 06199cf | 2012-02-22 16:37:11 +0200 | [diff] [blame] | 106 | HCI_LE_ENABLED, |
Johan Hedberg | 5e5282b | 2012-02-21 16:01:30 +0200 | [diff] [blame] | 107 | HCI_CONNECTABLE, |
| 108 | HCI_DISCOVERABLE, |
Johan Hedberg | 47990ea | 2012-02-22 11:58:37 +0200 | [diff] [blame] | 109 | HCI_LINK_SECURITY, |
Johan Hedberg | c95f0ba | 2012-02-23 22:54:38 +0200 | [diff] [blame] | 110 | HCI_PENDING_CLASS, |
Andre Guedes | 21693c1 | 2012-03-21 00:03:36 -0300 | [diff] [blame] | 111 | HCI_PERIODIC_INQ, |
Andre Guedes | d23264a | 2011-11-25 20:53:38 -0300 | [diff] [blame] | 112 | }; |
| 113 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | /* HCI ioctl defines */ |
| 115 | #define HCIDEVUP _IOW('H', 201, int) |
| 116 | #define HCIDEVDOWN _IOW('H', 202, int) |
| 117 | #define HCIDEVRESET _IOW('H', 203, int) |
| 118 | #define HCIDEVRESTAT _IOW('H', 204, int) |
| 119 | |
| 120 | #define HCIGETDEVLIST _IOR('H', 210, int) |
| 121 | #define HCIGETDEVINFO _IOR('H', 211, int) |
| 122 | #define HCIGETCONNLIST _IOR('H', 212, int) |
| 123 | #define HCIGETCONNINFO _IOR('H', 213, int) |
Marcel Holtmann | 40be492 | 2008-07-14 20:13:50 +0200 | [diff] [blame] | 124 | #define HCIGETAUTHINFO _IOR('H', 215, int) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
| 126 | #define HCISETRAW _IOW('H', 220, int) |
| 127 | #define HCISETSCAN _IOW('H', 221, int) |
| 128 | #define HCISETAUTH _IOW('H', 222, int) |
| 129 | #define HCISETENCRYPT _IOW('H', 223, int) |
| 130 | #define HCISETPTYPE _IOW('H', 224, int) |
| 131 | #define HCISETLINKPOL _IOW('H', 225, int) |
| 132 | #define HCISETLINKMODE _IOW('H', 226, int) |
| 133 | #define HCISETACLMTU _IOW('H', 227, int) |
| 134 | #define HCISETSCOMTU _IOW('H', 228, int) |
| 135 | |
Johan Hedberg | f035856 | 2010-05-18 13:20:32 +0200 | [diff] [blame] | 136 | #define HCIBLOCKADDR _IOW('H', 230, int) |
| 137 | #define HCIUNBLOCKADDR _IOW('H', 231, int) |
| 138 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | #define HCIINQUIRY _IOR('H', 240, int) |
| 140 | |
| 141 | /* HCI timeouts */ |
Andrei Emeltchenko | 5f246e8 | 2012-06-11 11:13:07 +0300 | [diff] [blame] | 142 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| 143 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
| 144 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
Andrei Emeltchenko | 9345d40 | 2012-06-15 10:36:42 +0300 | [diff] [blame^] | 145 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ |
Andrei Emeltchenko | 5f246e8 | 2012-06-11 11:13:07 +0300 | [diff] [blame] | 146 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
Andrei Emeltchenko | 9345d40 | 2012-06-15 10:36:42 +0300 | [diff] [blame^] | 147 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 149 | /* HCI data types */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | #define HCI_COMMAND_PKT 0x01 |
| 151 | #define HCI_ACLDATA_PKT 0x02 |
| 152 | #define HCI_SCODATA_PKT 0x03 |
| 153 | #define HCI_EVENT_PKT 0x04 |
| 154 | #define HCI_VENDOR_PKT 0xff |
| 155 | |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 156 | /* HCI packet types */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | #define HCI_DM1 0x0008 |
| 158 | #define HCI_DM3 0x0400 |
| 159 | #define HCI_DM5 0x4000 |
| 160 | #define HCI_DH1 0x0010 |
| 161 | #define HCI_DH3 0x0800 |
| 162 | #define HCI_DH5 0x8000 |
| 163 | |
| 164 | #define HCI_HV1 0x0020 |
| 165 | #define HCI_HV2 0x0040 |
| 166 | #define HCI_HV3 0x0080 |
| 167 | |
| 168 | #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) |
| 169 | #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) |
| 170 | |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 171 | /* eSCO packet types */ |
| 172 | #define ESCO_HV1 0x0001 |
| 173 | #define ESCO_HV2 0x0002 |
| 174 | #define ESCO_HV3 0x0004 |
| 175 | #define ESCO_EV3 0x0008 |
| 176 | #define ESCO_EV4 0x0010 |
| 177 | #define ESCO_EV5 0x0020 |
Marcel Holtmann | efc7688 | 2009-02-06 09:13:37 +0100 | [diff] [blame] | 178 | #define ESCO_2EV3 0x0040 |
| 179 | #define ESCO_3EV3 0x0080 |
| 180 | #define ESCO_2EV5 0x0100 |
| 181 | #define ESCO_3EV5 0x0200 |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 182 | |
Marcel Holtmann | a874641 | 2008-07-14 20:13:46 +0200 | [diff] [blame] | 183 | #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) |
Marcel Holtmann | efc7688 | 2009-02-06 09:13:37 +0100 | [diff] [blame] | 184 | #define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) |
Marcel Holtmann | a874641 | 2008-07-14 20:13:46 +0200 | [diff] [blame] | 185 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | /* ACL flags */ |
Andrei Emeltchenko | e702112 | 2011-01-03 11:14:36 +0200 | [diff] [blame] | 187 | #define ACL_START_NO_FLUSH 0x00 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | #define ACL_CONT 0x01 |
| 189 | #define ACL_START 0x02 |
| 190 | #define ACL_ACTIVE_BCAST 0x04 |
| 191 | #define ACL_PICO_BCAST 0x08 |
| 192 | |
| 193 | /* Baseband links */ |
| 194 | #define SCO_LINK 0x00 |
| 195 | #define ACL_LINK 0x01 |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 196 | #define ESCO_LINK 0x02 |
Ville Tervo | fcd89c0 | 2011-02-10 22:38:47 -0300 | [diff] [blame] | 197 | /* Low Energy links do not have defined link type. Use invented one */ |
| 198 | #define LE_LINK 0x80 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | |
| 200 | /* LMP features */ |
| 201 | #define LMP_3SLOT 0x01 |
| 202 | #define LMP_5SLOT 0x02 |
| 203 | #define LMP_ENCRYPT 0x04 |
| 204 | #define LMP_SOFFSET 0x08 |
| 205 | #define LMP_TACCURACY 0x10 |
| 206 | #define LMP_RSWITCH 0x20 |
| 207 | #define LMP_HOLD 0x40 |
Marcel Holtmann | 04837f6 | 2006-07-03 10:02:33 +0200 | [diff] [blame] | 208 | #define LMP_SNIFF 0x80 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | |
| 210 | #define LMP_PARK 0x01 |
| 211 | #define LMP_RSSI 0x02 |
| 212 | #define LMP_QUALITY 0x04 |
| 213 | #define LMP_SCO 0x08 |
| 214 | #define LMP_HV2 0x10 |
| 215 | #define LMP_HV3 0x20 |
| 216 | #define LMP_ULAW 0x40 |
| 217 | #define LMP_ALAW 0x80 |
| 218 | |
| 219 | #define LMP_CVSD 0x01 |
| 220 | #define LMP_PSCHEME 0x02 |
| 221 | #define LMP_PCONTROL 0x04 |
| 222 | |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 223 | #define LMP_RSSI_INQ 0x40 |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 224 | #define LMP_ESCO 0x80 |
| 225 | |
| 226 | #define LMP_EV4 0x01 |
| 227 | #define LMP_EV5 0x02 |
Johan Hedberg | 69ab39e | 2011-12-15 00:47:35 +0200 | [diff] [blame] | 228 | #define LMP_NO_BREDR 0x20 |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 229 | #define LMP_LE 0x40 |
Marcel Holtmann | 5b7f990 | 2007-07-11 09:51:55 +0200 | [diff] [blame] | 230 | |
Marcel Holtmann | 04837f6 | 2006-07-03 10:02:33 +0200 | [diff] [blame] | 231 | #define LMP_SNIFF_SUBR 0x02 |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 232 | #define LMP_PAUSE_ENC 0x04 |
Marcel Holtmann | efc7688 | 2009-02-06 09:13:37 +0100 | [diff] [blame] | 233 | #define LMP_EDR_ESCO_2M 0x20 |
| 234 | #define LMP_EDR_ESCO_3M 0x40 |
| 235 | #define LMP_EDR_3S_ESCO 0x80 |
Marcel Holtmann | 04837f6 | 2006-07-03 10:02:33 +0200 | [diff] [blame] | 236 | |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 237 | #define LMP_EXT_INQ 0x01 |
Andre Guedes | e6100a2 | 2011-06-30 19:20:54 -0300 | [diff] [blame] | 238 | #define LMP_SIMUL_LE_BR 0x02 |
Marcel Holtmann | 769be97 | 2008-07-14 20:13:49 +0200 | [diff] [blame] | 239 | #define LMP_SIMPLE_PAIR 0x08 |
Andrei Emeltchenko | e702112 | 2011-01-03 11:14:36 +0200 | [diff] [blame] | 240 | #define LMP_NO_FLUSH 0x40 |
Marcel Holtmann | 769be97 | 2008-07-14 20:13:49 +0200 | [diff] [blame] | 241 | |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 242 | #define LMP_LSTO 0x01 |
| 243 | #define LMP_INQ_TX_PWR 0x02 |
Andre Guedes | 971e3a4 | 2011-06-30 19:20:52 -0300 | [diff] [blame] | 244 | #define LMP_EXTFEATURES 0x80 |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 245 | |
Andre Guedes | eead27d | 2011-06-30 19:20:55 -0300 | [diff] [blame] | 246 | /* Extended LMP features */ |
Johan Hedberg | cc2c04e | 2012-02-28 02:03:24 +0200 | [diff] [blame] | 247 | #define LMP_HOST_SSP 0x01 |
| 248 | #define LMP_HOST_LE 0x02 |
| 249 | #define LMP_HOST_LE_BREDR 0x04 |
Andre Guedes | eead27d | 2011-06-30 19:20:55 -0300 | [diff] [blame] | 250 | |
Marcel Holtmann | 04837f6 | 2006-07-03 10:02:33 +0200 | [diff] [blame] | 251 | /* Connection modes */ |
| 252 | #define HCI_CM_ACTIVE 0x0000 |
| 253 | #define HCI_CM_HOLD 0x0001 |
| 254 | #define HCI_CM_SNIFF 0x0002 |
| 255 | #define HCI_CM_PARK 0x0003 |
| 256 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | /* Link policies */ |
| 258 | #define HCI_LP_RSWITCH 0x0001 |
| 259 | #define HCI_LP_HOLD 0x0002 |
| 260 | #define HCI_LP_SNIFF 0x0004 |
| 261 | #define HCI_LP_PARK 0x0008 |
| 262 | |
Marcel Holtmann | 04837f6 | 2006-07-03 10:02:33 +0200 | [diff] [blame] | 263 | /* Link modes */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | #define HCI_LM_ACCEPT 0x8000 |
| 265 | #define HCI_LM_MASTER 0x0001 |
| 266 | #define HCI_LM_AUTH 0x0002 |
| 267 | #define HCI_LM_ENCRYPT 0x0004 |
| 268 | #define HCI_LM_TRUSTED 0x0008 |
| 269 | #define HCI_LM_RELIABLE 0x0010 |
| 270 | #define HCI_LM_SECURE 0x0020 |
| 271 | |
Marcel Holtmann | 40be492 | 2008-07-14 20:13:50 +0200 | [diff] [blame] | 272 | /* Authentication types */ |
| 273 | #define HCI_AT_NO_BONDING 0x00 |
| 274 | #define HCI_AT_NO_BONDING_MITM 0x01 |
| 275 | #define HCI_AT_DEDICATED_BONDING 0x02 |
| 276 | #define HCI_AT_DEDICATED_BONDING_MITM 0x03 |
| 277 | #define HCI_AT_GENERAL_BONDING 0x04 |
| 278 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
| 279 | |
Waldemar Rymarkiewicz | b6020ba | 2011-04-28 12:07:53 +0200 | [diff] [blame] | 280 | /* Link Key types */ |
| 281 | #define HCI_LK_COMBINATION 0x00 |
| 282 | #define HCI_LK_LOCAL_UNIT 0x01 |
| 283 | #define HCI_LK_REMOTE_UNIT 0x02 |
| 284 | #define HCI_LK_DEBUG_COMBINATION 0x03 |
| 285 | #define HCI_LK_UNAUTH_COMBINATION 0x04 |
| 286 | #define HCI_LK_AUTH_COMBINATION 0x05 |
| 287 | #define HCI_LK_CHANGED_COMBINATION 0x06 |
Vinicius Costa Gomes | b899efa | 2012-02-02 21:08:00 -0300 | [diff] [blame] | 288 | /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ |
| 289 | #define HCI_SMP_STK 0x80 |
| 290 | #define HCI_SMP_STK_SLAVE 0x81 |
| 291 | #define HCI_SMP_LTK 0x82 |
| 292 | #define HCI_SMP_LTK_SLAVE 0x83 |
Waldemar Rymarkiewicz | b6020ba | 2011-04-28 12:07:53 +0200 | [diff] [blame] | 293 | |
Andrei Emeltchenko | 9f5a0d7 | 2011-11-07 14:20:25 +0200 | [diff] [blame] | 294 | /* ---- HCI Error Codes ---- */ |
| 295 | #define HCI_ERROR_AUTH_FAILURE 0x05 |
| 296 | #define HCI_ERROR_REJ_BAD_ADDR 0x0f |
| 297 | #define HCI_ERROR_REMOTE_USER_TERM 0x13 |
| 298 | #define HCI_ERROR_LOCAL_HOST_TERM 0x16 |
| 299 | #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 |
| 300 | |
Andrei Emeltchenko | 2455a3e | 2011-12-19 16:31:28 +0200 | [diff] [blame] | 301 | /* Flow control modes */ |
| 302 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
| 303 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
| 304 | |
Johan Hedberg | 32748db | 2011-12-30 14:57:23 +0200 | [diff] [blame] | 305 | /* Extended Inquiry Response field types */ |
| 306 | #define EIR_FLAGS 0x01 /* flags */ |
| 307 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
| 308 | #define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */ |
| 309 | #define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */ |
| 310 | #define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */ |
| 311 | #define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */ |
| 312 | #define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */ |
| 313 | #define EIR_NAME_SHORT 0x08 /* shortened local name */ |
| 314 | #define EIR_NAME_COMPLETE 0x09 /* complete local name */ |
| 315 | #define EIR_TX_POWER 0x0A /* transmit power level */ |
Johan Hedberg | 9ec9fc8 | 2012-01-15 20:46:33 +0200 | [diff] [blame] | 316 | #define EIR_CLASS_OF_DEV 0x0D /* Class of Device */ |
| 317 | #define EIR_SSP_HASH_C 0x0E /* Simple Pairing Hash C */ |
| 318 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
Johan Hedberg | 32748db | 2011-12-30 14:57:23 +0200 | [diff] [blame] | 319 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
| 320 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | /* ----- HCI Commands ---- */ |
Ville Tervo | 6bd3232 | 2011-02-16 16:32:41 +0200 | [diff] [blame] | 322 | #define HCI_OP_NOP 0x0000 |
| 323 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 324 | #define HCI_OP_INQUIRY 0x0401 |
| 325 | struct hci_cp_inquiry { |
| 326 | __u8 lap[3]; |
| 327 | __u8 length; |
| 328 | __u8 num_rsp; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 329 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 330 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 331 | #define HCI_OP_INQUIRY_CANCEL 0x0402 |
| 332 | |
Andre Guedes | 79d6e06 | 2012-03-21 00:03:35 -0300 | [diff] [blame] | 333 | #define HCI_OP_PERIODIC_INQ 0x0403 |
| 334 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 335 | #define HCI_OP_EXIT_PERIODIC_INQ 0x0404 |
| 336 | |
| 337 | #define HCI_OP_CREATE_CONN 0x0405 |
| 338 | struct hci_cp_create_conn { |
| 339 | bdaddr_t bdaddr; |
| 340 | __le16 pkt_type; |
| 341 | __u8 pscan_rep_mode; |
| 342 | __u8 pscan_mode; |
| 343 | __le16 clock_offset; |
| 344 | __u8 role_switch; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 345 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 347 | #define HCI_OP_DISCONNECT 0x0406 |
| 348 | struct hci_cp_disconnect { |
| 349 | __le16 handle; |
| 350 | __u8 reason; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 351 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 353 | #define HCI_OP_ADD_SCO 0x0407 |
| 354 | struct hci_cp_add_sco { |
| 355 | __le16 handle; |
| 356 | __le16 pkt_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 357 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 358 | |
| 359 | #define HCI_OP_CREATE_CONN_CANCEL 0x0408 |
| 360 | struct hci_cp_create_conn_cancel { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 361 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 362 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 364 | #define HCI_OP_ACCEPT_CONN_REQ 0x0409 |
| 365 | struct hci_cp_accept_conn_req { |
| 366 | bdaddr_t bdaddr; |
| 367 | __u8 role; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 368 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 369 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 370 | #define HCI_OP_REJECT_CONN_REQ 0x040a |
| 371 | struct hci_cp_reject_conn_req { |
| 372 | bdaddr_t bdaddr; |
| 373 | __u8 reason; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 374 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 375 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 376 | #define HCI_OP_LINK_KEY_REPLY 0x040b |
| 377 | struct hci_cp_link_key_reply { |
| 378 | bdaddr_t bdaddr; |
Andrei Emeltchenko | 9b3b446 | 2012-05-23 11:31:20 +0300 | [diff] [blame] | 379 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 380 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 381 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 382 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c |
| 383 | struct hci_cp_link_key_neg_reply { |
| 384 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 385 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 386 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 387 | #define HCI_OP_PIN_CODE_REPLY 0x040d |
| 388 | struct hci_cp_pin_code_reply { |
| 389 | bdaddr_t bdaddr; |
| 390 | __u8 pin_len; |
| 391 | __u8 pin_code[16]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 392 | } __packed; |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 393 | struct hci_rp_pin_code_reply { |
| 394 | __u8 status; |
| 395 | bdaddr_t bdaddr; |
| 396 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 397 | |
| 398 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e |
| 399 | struct hci_cp_pin_code_neg_reply { |
| 400 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 401 | } __packed; |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 402 | struct hci_rp_pin_code_neg_reply { |
| 403 | __u8 status; |
| 404 | bdaddr_t bdaddr; |
| 405 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 406 | |
| 407 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f |
| 408 | struct hci_cp_change_conn_ptype { |
| 409 | __le16 handle; |
| 410 | __le16 pkt_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 411 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 412 | |
| 413 | #define HCI_OP_AUTH_REQUESTED 0x0411 |
| 414 | struct hci_cp_auth_requested { |
| 415 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 416 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 417 | |
| 418 | #define HCI_OP_SET_CONN_ENCRYPT 0x0413 |
| 419 | struct hci_cp_set_conn_encrypt { |
| 420 | __le16 handle; |
| 421 | __u8 encrypt; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 422 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 423 | |
| 424 | #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 |
| 425 | struct hci_cp_change_conn_link_key { |
| 426 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 427 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 428 | |
| 429 | #define HCI_OP_REMOTE_NAME_REQ 0x0419 |
| 430 | struct hci_cp_remote_name_req { |
| 431 | bdaddr_t bdaddr; |
| 432 | __u8 pscan_rep_mode; |
| 433 | __u8 pscan_mode; |
| 434 | __le16 clock_offset; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 435 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 436 | |
| 437 | #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a |
| 438 | struct hci_cp_remote_name_req_cancel { |
| 439 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 440 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 441 | |
| 442 | #define HCI_OP_READ_REMOTE_FEATURES 0x041b |
| 443 | struct hci_cp_read_remote_features { |
| 444 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 445 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 446 | |
| 447 | #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c |
| 448 | struct hci_cp_read_remote_ext_features { |
| 449 | __le16 handle; |
| 450 | __u8 page; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 451 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 452 | |
| 453 | #define HCI_OP_READ_REMOTE_VERSION 0x041d |
| 454 | struct hci_cp_read_remote_version { |
| 455 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 456 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 457 | |
| 458 | #define HCI_OP_SETUP_SYNC_CONN 0x0428 |
| 459 | struct hci_cp_setup_sync_conn { |
| 460 | __le16 handle; |
| 461 | __le32 tx_bandwidth; |
| 462 | __le32 rx_bandwidth; |
| 463 | __le16 max_latency; |
| 464 | __le16 voice_setting; |
| 465 | __u8 retrans_effort; |
| 466 | __le16 pkt_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 467 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 468 | |
| 469 | #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 |
| 470 | struct hci_cp_accept_sync_conn_req { |
| 471 | bdaddr_t bdaddr; |
| 472 | __le32 tx_bandwidth; |
| 473 | __le32 rx_bandwidth; |
| 474 | __le16 max_latency; |
| 475 | __le16 content_format; |
| 476 | __u8 retrans_effort; |
| 477 | __le16 pkt_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 478 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 479 | |
| 480 | #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a |
| 481 | struct hci_cp_reject_sync_conn_req { |
| 482 | bdaddr_t bdaddr; |
| 483 | __u8 reason; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 484 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 485 | |
Johan Hedberg | 17fa4b9 | 2011-01-25 13:28:33 +0200 | [diff] [blame] | 486 | #define HCI_OP_IO_CAPABILITY_REPLY 0x042b |
| 487 | struct hci_cp_io_capability_reply { |
| 488 | bdaddr_t bdaddr; |
| 489 | __u8 capability; |
| 490 | __u8 oob_data; |
| 491 | __u8 authentication; |
| 492 | } __packed; |
| 493 | |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 494 | #define HCI_OP_USER_CONFIRM_REPLY 0x042c |
| 495 | struct hci_cp_user_confirm_reply { |
| 496 | bdaddr_t bdaddr; |
| 497 | } __packed; |
| 498 | struct hci_rp_user_confirm_reply { |
| 499 | __u8 status; |
| 500 | bdaddr_t bdaddr; |
| 501 | } __packed; |
| 502 | |
| 503 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d |
| 504 | |
Brian Gix | 9ad4019 | 2011-11-12 22:01:11 -0800 | [diff] [blame] | 505 | #define HCI_OP_USER_PASSKEY_REPLY 0x042e |
| 506 | struct hci_cp_user_passkey_reply { |
| 507 | bdaddr_t bdaddr; |
| 508 | __le32 passkey; |
| 509 | } __packed; |
| 510 | |
| 511 | #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f |
| 512 | |
Szymon Janc | 2763eda | 2011-03-22 13:12:22 +0100 | [diff] [blame] | 513 | #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 |
| 514 | struct hci_cp_remote_oob_data_reply { |
| 515 | bdaddr_t bdaddr; |
| 516 | __u8 hash[16]; |
| 517 | __u8 randomizer[16]; |
| 518 | } __packed; |
| 519 | |
| 520 | #define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433 |
| 521 | struct hci_cp_remote_oob_data_neg_reply { |
| 522 | bdaddr_t bdaddr; |
| 523 | } __packed; |
| 524 | |
Johan Hedberg | 03b555e | 2011-01-04 15:40:05 +0200 | [diff] [blame] | 525 | #define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 |
| 526 | struct hci_cp_io_capability_neg_reply { |
| 527 | bdaddr_t bdaddr; |
| 528 | __u8 reason; |
| 529 | } __packed; |
| 530 | |
Andrei Emeltchenko | 523e93c | 2012-05-25 15:09:26 +0300 | [diff] [blame] | 531 | #define HCI_OP_CREATE_PHY_LINK 0x0435 |
| 532 | struct hci_cp_create_phy_link { |
| 533 | __u8 phy_handle; |
| 534 | __u8 key_len; |
| 535 | __u8 key_type; |
| 536 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
| 537 | } __packed; |
| 538 | |
| 539 | #define HCI_OP_ACCEPT_PHY_LINK 0x0436 |
| 540 | struct hci_cp_accept_phy_link { |
| 541 | __u8 phy_handle; |
| 542 | __u8 key_len; |
| 543 | __u8 key_type; |
| 544 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
| 545 | } __packed; |
| 546 | |
| 547 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 |
| 548 | struct hci_cp_disconn_phy_link { |
| 549 | __u8 phy_handle; |
| 550 | __u8 reason; |
| 551 | } __packed; |
| 552 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 553 | #define HCI_OP_SNIFF_MODE 0x0803 |
| 554 | struct hci_cp_sniff_mode { |
| 555 | __le16 handle; |
| 556 | __le16 max_interval; |
| 557 | __le16 min_interval; |
| 558 | __le16 attempt; |
| 559 | __le16 timeout; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 560 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 561 | |
| 562 | #define HCI_OP_EXIT_SNIFF_MODE 0x0804 |
| 563 | struct hci_cp_exit_sniff_mode { |
| 564 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 565 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 566 | |
| 567 | #define HCI_OP_ROLE_DISCOVERY 0x0809 |
| 568 | struct hci_cp_role_discovery { |
| 569 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 570 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 571 | struct hci_rp_role_discovery { |
| 572 | __u8 status; |
| 573 | __le16 handle; |
| 574 | __u8 role; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 575 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 576 | |
| 577 | #define HCI_OP_SWITCH_ROLE 0x080b |
| 578 | struct hci_cp_switch_role { |
| 579 | bdaddr_t bdaddr; |
| 580 | __u8 role; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 581 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 582 | |
| 583 | #define HCI_OP_READ_LINK_POLICY 0x080c |
| 584 | struct hci_cp_read_link_policy { |
| 585 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 586 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 587 | struct hci_rp_read_link_policy { |
| 588 | __u8 status; |
| 589 | __le16 handle; |
| 590 | __le16 policy; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 591 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 592 | |
| 593 | #define HCI_OP_WRITE_LINK_POLICY 0x080d |
| 594 | struct hci_cp_write_link_policy { |
| 595 | __le16 handle; |
| 596 | __le16 policy; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 597 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 598 | struct hci_rp_write_link_policy { |
| 599 | __u8 status; |
| 600 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 601 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 602 | |
Marcel Holtmann | e4e8e37 | 2008-07-14 20:13:47 +0200 | [diff] [blame] | 603 | #define HCI_OP_READ_DEF_LINK_POLICY 0x080e |
| 604 | struct hci_rp_read_def_link_policy { |
| 605 | __u8 status; |
| 606 | __le16 policy; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 607 | } __packed; |
Marcel Holtmann | e4e8e37 | 2008-07-14 20:13:47 +0200 | [diff] [blame] | 608 | |
| 609 | #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f |
| 610 | struct hci_cp_write_def_link_policy { |
| 611 | __le16 policy; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 612 | } __packed; |
Marcel Holtmann | e4e8e37 | 2008-07-14 20:13:47 +0200 | [diff] [blame] | 613 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 614 | #define HCI_OP_SNIFF_SUBRATE 0x0811 |
| 615 | struct hci_cp_sniff_subrate { |
| 616 | __le16 handle; |
| 617 | __le16 max_latency; |
| 618 | __le16 min_remote_timeout; |
| 619 | __le16 min_local_timeout; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 620 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 621 | |
| 622 | #define HCI_OP_SET_EVENT_MASK 0x0c01 |
| 623 | struct hci_cp_set_event_mask { |
| 624 | __u8 mask[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 625 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 626 | |
| 627 | #define HCI_OP_RESET 0x0c03 |
| 628 | |
| 629 | #define HCI_OP_SET_EVENT_FLT 0x0c05 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 630 | struct hci_cp_set_event_flt { |
| 631 | __u8 flt_type; |
| 632 | __u8 cond_type; |
| 633 | __u8 condition[0]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 634 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 635 | |
| 636 | /* Filter types */ |
| 637 | #define HCI_FLT_CLEAR_ALL 0x00 |
| 638 | #define HCI_FLT_INQ_RESULT 0x01 |
| 639 | #define HCI_FLT_CONN_SETUP 0x02 |
| 640 | |
| 641 | /* CONN_SETUP Condition types */ |
| 642 | #define HCI_CONN_SETUP_ALLOW_ALL 0x00 |
| 643 | #define HCI_CONN_SETUP_ALLOW_CLASS 0x01 |
| 644 | #define HCI_CONN_SETUP_ALLOW_BDADDR 0x02 |
| 645 | |
| 646 | /* CONN_SETUP Conditions */ |
| 647 | #define HCI_CONN_SETUP_AUTO_OFF 0x01 |
| 648 | #define HCI_CONN_SETUP_AUTO_ON 0x02 |
| 649 | |
Johan Hedberg | b0916ea | 2011-01-10 13:44:55 +0200 | [diff] [blame] | 650 | #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12 |
| 651 | struct hci_cp_delete_stored_link_key { |
| 652 | bdaddr_t bdaddr; |
| 653 | __u8 delete_all; |
| 654 | } __packed; |
| 655 | |
Johan Hedberg | 1f6c637 | 2011-03-16 14:29:35 +0200 | [diff] [blame] | 656 | #define HCI_MAX_NAME_LENGTH 248 |
| 657 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 658 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
| 659 | struct hci_cp_write_local_name { |
Johan Hedberg | 1f6c637 | 2011-03-16 14:29:35 +0200 | [diff] [blame] | 660 | __u8 name[HCI_MAX_NAME_LENGTH]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 661 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 662 | |
| 663 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 |
| 664 | struct hci_rp_read_local_name { |
| 665 | __u8 status; |
Johan Hedberg | 1f6c637 | 2011-03-16 14:29:35 +0200 | [diff] [blame] | 666 | __u8 name[HCI_MAX_NAME_LENGTH]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 667 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 668 | |
| 669 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 |
| 670 | |
| 671 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 |
| 672 | |
Andrei Emeltchenko | 70f23020 | 2010-12-01 16:58:25 +0200 | [diff] [blame] | 673 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 674 | #define SCAN_DISABLED 0x00 |
| 675 | #define SCAN_INQUIRY 0x01 |
| 676 | #define SCAN_PAGE 0x02 |
| 677 | |
| 678 | #define HCI_OP_READ_AUTH_ENABLE 0x0c1f |
| 679 | |
| 680 | #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20 |
| 681 | #define AUTH_DISABLED 0x00 |
| 682 | #define AUTH_ENABLED 0x01 |
| 683 | |
| 684 | #define HCI_OP_READ_ENCRYPT_MODE 0x0c21 |
| 685 | |
| 686 | #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22 |
| 687 | #define ENCRYPT_DISABLED 0x00 |
| 688 | #define ENCRYPT_P2P 0x01 |
| 689 | #define ENCRYPT_BOTH 0x02 |
| 690 | |
| 691 | #define HCI_OP_READ_CLASS_OF_DEV 0x0c23 |
| 692 | struct hci_rp_read_class_of_dev { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 693 | __u8 status; |
| 694 | __u8 dev_class[3]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 695 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 697 | #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 |
| 698 | struct hci_cp_write_class_of_dev { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 699 | __u8 dev_class[3]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 700 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 701 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 702 | #define HCI_OP_READ_VOICE_SETTING 0x0c25 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 703 | struct hci_rp_read_voice_setting { |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 704 | __u8 status; |
| 705 | __le16 voice_setting; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 706 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 707 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 708 | #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | struct hci_cp_write_voice_setting { |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 710 | __le16 voice_setting; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 711 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 712 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 713 | #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 714 | struct hci_cp_host_buffer_size { |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 715 | __le16 acl_mtu; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 716 | __u8 sco_mtu; |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 717 | __le16 acl_max_pkt; |
| 718 | __le16 sco_max_pkt; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 719 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 721 | #define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 |
| 722 | |
Johan Hedberg | 80a1e1d | 2011-03-28 14:07:23 +0300 | [diff] [blame] | 723 | #define HCI_MAX_EIR_LENGTH 240 |
| 724 | |
| 725 | #define HCI_OP_WRITE_EIR 0x0c52 |
| 726 | struct hci_cp_write_eir { |
Gustavo F. Padovan | f64b993 | 2012-03-06 23:48:33 -0300 | [diff] [blame] | 727 | __u8 fec; |
| 728 | __u8 data[HCI_MAX_EIR_LENGTH]; |
Johan Hedberg | 80a1e1d | 2011-03-28 14:07:23 +0300 | [diff] [blame] | 729 | } __packed; |
| 730 | |
Marcel Holtmann | 333140b | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 731 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
| 732 | struct hci_rp_read_ssp_mode { |
| 733 | __u8 status; |
| 734 | __u8 mode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 735 | } __packed; |
Marcel Holtmann | 333140b | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 736 | |
| 737 | #define HCI_OP_WRITE_SSP_MODE 0x0c56 |
| 738 | struct hci_cp_write_ssp_mode { |
| 739 | __u8 mode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 740 | } __packed; |
Marcel Holtmann | 333140b | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 741 | |
Szymon Janc | c35938b | 2011-03-22 13:12:21 +0100 | [diff] [blame] | 742 | #define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57 |
| 743 | struct hci_rp_read_local_oob_data { |
| 744 | __u8 status; |
| 745 | __u8 hash[16]; |
| 746 | __u8 randomizer[16]; |
| 747 | } __packed; |
| 748 | |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 749 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
Marcel Holtmann | 91c4e9b | 2012-03-11 19:27:21 -0700 | [diff] [blame] | 750 | struct hci_rp_read_inq_rsp_tx_power { |
| 751 | __u8 status; |
| 752 | __s8 tx_power; |
| 753 | } __packed; |
Johan Hedberg | d5859e2 | 2011-01-25 01:19:58 +0200 | [diff] [blame] | 754 | |
Andrei Emeltchenko | 1e89cff | 2011-11-24 14:52:02 +0200 | [diff] [blame] | 755 | #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 |
| 756 | struct hci_rp_read_flow_control_mode { |
| 757 | __u8 status; |
| 758 | __u8 mode; |
| 759 | } __packed; |
| 760 | |
Andre Guedes | f9b4930 | 2011-06-30 19:20:53 -0300 | [diff] [blame] | 761 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d |
| 762 | struct hci_cp_write_le_host_supported { |
Gustavo F. Padovan | f64b993 | 2012-03-06 23:48:33 -0300 | [diff] [blame] | 763 | __u8 le; |
| 764 | __u8 simul; |
Andre Guedes | f9b4930 | 2011-06-30 19:20:53 -0300 | [diff] [blame] | 765 | } __packed; |
| 766 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 767 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
| 768 | struct hci_rp_read_local_version { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 769 | __u8 status; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 770 | __u8 hci_ver; |
| 771 | __le16 hci_rev; |
| 772 | __u8 lmp_ver; |
| 773 | __le16 manufacturer; |
| 774 | __le16 lmp_subver; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 775 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 776 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 777 | #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 |
| 778 | struct hci_rp_read_local_commands { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 779 | __u8 status; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 780 | __u8 commands[64]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 781 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 782 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 783 | #define HCI_OP_READ_LOCAL_FEATURES 0x1003 |
| 784 | struct hci_rp_read_local_features { |
| 785 | __u8 status; |
| 786 | __u8 features[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 787 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 788 | |
| 789 | #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 |
Andre Guedes | 971e3a4 | 2011-06-30 19:20:52 -0300 | [diff] [blame] | 790 | struct hci_cp_read_local_ext_features { |
| 791 | __u8 page; |
| 792 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 793 | struct hci_rp_read_local_ext_features { |
| 794 | __u8 status; |
| 795 | __u8 page; |
| 796 | __u8 max_page; |
| 797 | __u8 features[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 798 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 799 | |
| 800 | #define HCI_OP_READ_BUFFER_SIZE 0x1005 |
| 801 | struct hci_rp_read_buffer_size { |
| 802 | __u8 status; |
| 803 | __le16 acl_mtu; |
| 804 | __u8 sco_mtu; |
| 805 | __le16 acl_max_pkt; |
| 806 | __le16 sco_max_pkt; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 807 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 808 | |
| 809 | #define HCI_OP_READ_BD_ADDR 0x1009 |
| 810 | struct hci_rp_read_bd_addr { |
| 811 | __u8 status; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 812 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 813 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 814 | |
Andrei Emeltchenko | 350ee4c | 2011-12-07 15:56:51 +0200 | [diff] [blame] | 815 | #define HCI_OP_READ_DATA_BLOCK_SIZE 0x100a |
| 816 | struct hci_rp_read_data_block_size { |
| 817 | __u8 status; |
| 818 | __le16 max_acl_len; |
| 819 | __le16 block_len; |
| 820 | __le16 num_blocks; |
| 821 | } __packed; |
| 822 | |
Antti Julku | f6422ec | 2011-06-22 13:11:56 +0300 | [diff] [blame] | 823 | #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c |
| 824 | struct hci_cp_write_page_scan_activity { |
| 825 | __le16 interval; |
| 826 | __le16 window; |
| 827 | } __packed; |
| 828 | |
| 829 | #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 |
| 830 | #define PAGE_SCAN_TYPE_STANDARD 0x00 |
| 831 | #define PAGE_SCAN_TYPE_INTERLACED 0x01 |
| 832 | |
Andrei Emeltchenko | 928abaa | 2011-10-12 10:53:57 +0300 | [diff] [blame] | 833 | #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 |
| 834 | struct hci_rp_read_local_amp_info { |
| 835 | __u8 status; |
| 836 | __u8 amp_status; |
| 837 | __le32 total_bw; |
| 838 | __le32 max_bw; |
| 839 | __le32 min_latency; |
| 840 | __le32 max_pdu; |
| 841 | __u8 amp_type; |
| 842 | __le16 pal_cap; |
| 843 | __le16 max_assoc_size; |
| 844 | __le32 max_flush_to; |
| 845 | __le32 be_flush_to; |
| 846 | } __packed; |
| 847 | |
Andrei Emeltchenko | 523e93c | 2012-05-25 15:09:26 +0300 | [diff] [blame] | 848 | #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a |
| 849 | struct hci_cp_read_local_amp_assoc { |
| 850 | __u8 phy_handle; |
| 851 | __le16 len_so_far; |
| 852 | __le16 max_len; |
| 853 | } __packed; |
| 854 | struct hci_rp_read_local_amp_assoc { |
| 855 | __u8 status; |
| 856 | __u8 phy_handle; |
| 857 | __le16 rem_len; |
| 858 | __u8 frag[0]; |
| 859 | } __packed; |
| 860 | |
| 861 | #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b |
| 862 | struct hci_cp_write_remote_amp_assoc { |
| 863 | __u8 phy_handle; |
| 864 | __le16 len_so_far; |
| 865 | __le16 rem_len; |
| 866 | __u8 frag[0]; |
| 867 | } __packed; |
| 868 | struct hci_rp_write_remote_amp_assoc { |
| 869 | __u8 status; |
| 870 | __u8 phy_handle; |
| 871 | } __packed; |
| 872 | |
Ville Tervo | 63185f6 | 2011-02-10 22:38:46 -0300 | [diff] [blame] | 873 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
| 874 | struct hci_cp_le_set_event_mask { |
| 875 | __u8 mask[8]; |
| 876 | } __packed; |
| 877 | |
| 878 | #define HCI_OP_LE_READ_BUFFER_SIZE 0x2002 |
| 879 | struct hci_rp_le_read_buffer_size { |
| 880 | __u8 status; |
| 881 | __le16 le_mtu; |
| 882 | __u8 le_max_pkt; |
| 883 | } __packed; |
| 884 | |
Andre Guedes | 07f7fa5 | 2011-12-02 21:13:31 +0900 | [diff] [blame] | 885 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
| 886 | struct hci_cp_le_set_scan_param { |
| 887 | __u8 type; |
| 888 | __le16 interval; |
| 889 | __le16 window; |
| 890 | __u8 own_address_type; |
| 891 | __u8 filter_policy; |
| 892 | } __packed; |
| 893 | |
Andrei Emeltchenko | 68a8aea | 2011-12-19 16:14:18 +0200 | [diff] [blame] | 894 | #define LE_SCANNING_DISABLED 0x00 |
| 895 | #define LE_SCANNING_ENABLED 0x01 |
| 896 | |
Andre Guedes | eb9d91f | 2011-05-26 16:23:52 -0300 | [diff] [blame] | 897 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c |
| 898 | struct hci_cp_le_set_scan_enable { |
| 899 | __u8 enable; |
| 900 | __u8 filter_dup; |
| 901 | } __packed; |
| 902 | |
Ville Tervo | 63185f6 | 2011-02-10 22:38:46 -0300 | [diff] [blame] | 903 | #define HCI_OP_LE_CREATE_CONN 0x200d |
| 904 | struct hci_cp_le_create_conn { |
| 905 | __le16 scan_interval; |
| 906 | __le16 scan_window; |
| 907 | __u8 filter_policy; |
| 908 | __u8 peer_addr_type; |
| 909 | bdaddr_t peer_addr; |
| 910 | __u8 own_address_type; |
| 911 | __le16 conn_interval_min; |
| 912 | __le16 conn_interval_max; |
| 913 | __le16 conn_latency; |
| 914 | __le16 supervision_timeout; |
| 915 | __le16 min_ce_len; |
| 916 | __le16 max_ce_len; |
| 917 | } __packed; |
| 918 | |
| 919 | #define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e |
| 920 | |
Claudio Takahasi | 2ce603e | 2011-02-16 20:44:53 -0200 | [diff] [blame] | 921 | #define HCI_OP_LE_CONN_UPDATE 0x2013 |
| 922 | struct hci_cp_le_conn_update { |
| 923 | __le16 handle; |
| 924 | __le16 conn_interval_min; |
| 925 | __le16 conn_interval_max; |
| 926 | __le16 conn_latency; |
| 927 | __le16 supervision_timeout; |
| 928 | __le16 min_ce_len; |
| 929 | __le16 max_ce_len; |
| 930 | } __packed; |
| 931 | |
Vinicius Costa Gomes | a7a595f | 2011-06-09 18:50:47 -0300 | [diff] [blame] | 932 | #define HCI_OP_LE_START_ENC 0x2019 |
| 933 | struct hci_cp_le_start_enc { |
| 934 | __le16 handle; |
| 935 | __u8 rand[8]; |
| 936 | __le16 ediv; |
| 937 | __u8 ltk[16]; |
| 938 | } __packed; |
| 939 | |
| 940 | #define HCI_OP_LE_LTK_REPLY 0x201a |
| 941 | struct hci_cp_le_ltk_reply { |
| 942 | __le16 handle; |
| 943 | __u8 ltk[16]; |
| 944 | } __packed; |
| 945 | struct hci_rp_le_ltk_reply { |
| 946 | __u8 status; |
| 947 | __le16 handle; |
| 948 | } __packed; |
| 949 | |
| 950 | #define HCI_OP_LE_LTK_NEG_REPLY 0x201b |
| 951 | struct hci_cp_le_ltk_neg_reply { |
| 952 | __le16 handle; |
| 953 | } __packed; |
| 954 | struct hci_rp_le_ltk_neg_reply { |
| 955 | __u8 status; |
| 956 | __le16 handle; |
| 957 | } __packed; |
| 958 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 959 | /* ---- HCI Events ---- */ |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 960 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 961 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 962 | #define HCI_EV_INQUIRY_RESULT 0x02 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 963 | struct inquiry_info { |
| 964 | bdaddr_t bdaddr; |
| 965 | __u8 pscan_rep_mode; |
| 966 | __u8 pscan_period_mode; |
| 967 | __u8 pscan_mode; |
| 968 | __u8 dev_class[3]; |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 969 | __le16 clock_offset; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 970 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 971 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 972 | #define HCI_EV_CONN_COMPLETE 0x03 |
| 973 | struct hci_ev_conn_complete { |
| 974 | __u8 status; |
| 975 | __le16 handle; |
| 976 | bdaddr_t bdaddr; |
| 977 | __u8 link_type; |
| 978 | __u8 encr_mode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 979 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 980 | |
| 981 | #define HCI_EV_CONN_REQUEST 0x04 |
| 982 | struct hci_ev_conn_request { |
| 983 | bdaddr_t bdaddr; |
| 984 | __u8 dev_class[3]; |
| 985 | __u8 link_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 986 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 987 | |
| 988 | #define HCI_EV_DISCONN_COMPLETE 0x05 |
| 989 | struct hci_ev_disconn_complete { |
| 990 | __u8 status; |
| 991 | __le16 handle; |
| 992 | __u8 reason; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 993 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 994 | |
| 995 | #define HCI_EV_AUTH_COMPLETE 0x06 |
| 996 | struct hci_ev_auth_complete { |
| 997 | __u8 status; |
| 998 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 999 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1000 | |
| 1001 | #define HCI_EV_REMOTE_NAME 0x07 |
| 1002 | struct hci_ev_remote_name { |
| 1003 | __u8 status; |
| 1004 | bdaddr_t bdaddr; |
Johan Hedberg | 1f6c637 | 2011-03-16 14:29:35 +0200 | [diff] [blame] | 1005 | __u8 name[HCI_MAX_NAME_LENGTH]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1006 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1007 | |
| 1008 | #define HCI_EV_ENCRYPT_CHANGE 0x08 |
| 1009 | struct hci_ev_encrypt_change { |
| 1010 | __u8 status; |
| 1011 | __le16 handle; |
| 1012 | __u8 encrypt; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1013 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1014 | |
| 1015 | #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 |
| 1016 | struct hci_ev_change_link_key_complete { |
| 1017 | __u8 status; |
| 1018 | __le16 handle; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1019 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1020 | |
| 1021 | #define HCI_EV_REMOTE_FEATURES 0x0b |
| 1022 | struct hci_ev_remote_features { |
| 1023 | __u8 status; |
| 1024 | __le16 handle; |
| 1025 | __u8 features[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1026 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1027 | |
| 1028 | #define HCI_EV_REMOTE_VERSION 0x0c |
| 1029 | struct hci_ev_remote_version { |
| 1030 | __u8 status; |
| 1031 | __le16 handle; |
| 1032 | __u8 lmp_ver; |
| 1033 | __le16 manufacturer; |
| 1034 | __le16 lmp_subver; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1035 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1036 | |
| 1037 | #define HCI_EV_QOS_SETUP_COMPLETE 0x0d |
| 1038 | struct hci_qos { |
| 1039 | __u8 service_type; |
| 1040 | __u32 token_rate; |
| 1041 | __u32 peak_bandwidth; |
| 1042 | __u32 latency; |
| 1043 | __u32 delay_variation; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1044 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1045 | struct hci_ev_qos_setup_complete { |
| 1046 | __u8 status; |
| 1047 | __le16 handle; |
| 1048 | struct hci_qos qos; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1049 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1050 | |
| 1051 | #define HCI_EV_CMD_COMPLETE 0x0e |
| 1052 | struct hci_ev_cmd_complete { |
| 1053 | __u8 ncmd; |
| 1054 | __le16 opcode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1055 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1056 | |
| 1057 | #define HCI_EV_CMD_STATUS 0x0f |
| 1058 | struct hci_ev_cmd_status { |
| 1059 | __u8 status; |
| 1060 | __u8 ncmd; |
| 1061 | __le16 opcode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1062 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1063 | |
| 1064 | #define HCI_EV_ROLE_CHANGE 0x12 |
| 1065 | struct hci_ev_role_change { |
| 1066 | __u8 status; |
| 1067 | bdaddr_t bdaddr; |
| 1068 | __u8 role; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1069 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1070 | |
| 1071 | #define HCI_EV_NUM_COMP_PKTS 0x13 |
Andrei Emeltchenko | 613a1c0 | 2011-12-19 16:31:30 +0200 | [diff] [blame] | 1072 | struct hci_comp_pkts_info { |
| 1073 | __le16 handle; |
| 1074 | __le16 count; |
| 1075 | } __packed; |
| 1076 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1077 | struct hci_ev_num_comp_pkts { |
| 1078 | __u8 num_hndl; |
Andrei Emeltchenko | 613a1c0 | 2011-12-19 16:31:30 +0200 | [diff] [blame] | 1079 | struct hci_comp_pkts_info handles[0]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1080 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1081 | |
| 1082 | #define HCI_EV_MODE_CHANGE 0x14 |
| 1083 | struct hci_ev_mode_change { |
| 1084 | __u8 status; |
| 1085 | __le16 handle; |
| 1086 | __u8 mode; |
| 1087 | __le16 interval; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1088 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1089 | |
| 1090 | #define HCI_EV_PIN_CODE_REQ 0x16 |
| 1091 | struct hci_ev_pin_code_req { |
| 1092 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1093 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1094 | |
| 1095 | #define HCI_EV_LINK_KEY_REQ 0x17 |
| 1096 | struct hci_ev_link_key_req { |
| 1097 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1098 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1099 | |
| 1100 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 |
| 1101 | struct hci_ev_link_key_notify { |
| 1102 | bdaddr_t bdaddr; |
Andrei Emeltchenko | 9b3b446 | 2012-05-23 11:31:20 +0300 | [diff] [blame] | 1103 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1104 | __u8 key_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1105 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1106 | |
| 1107 | #define HCI_EV_CLOCK_OFFSET 0x1c |
| 1108 | struct hci_ev_clock_offset { |
| 1109 | __u8 status; |
| 1110 | __le16 handle; |
| 1111 | __le16 clock_offset; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1112 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1113 | |
Marcel Holtmann | a874641 | 2008-07-14 20:13:46 +0200 | [diff] [blame] | 1114 | #define HCI_EV_PKT_TYPE_CHANGE 0x1d |
| 1115 | struct hci_ev_pkt_type_change { |
| 1116 | __u8 status; |
| 1117 | __le16 handle; |
| 1118 | __le16 pkt_type; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1119 | } __packed; |
Marcel Holtmann | a874641 | 2008-07-14 20:13:46 +0200 | [diff] [blame] | 1120 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1121 | #define HCI_EV_PSCAN_REP_MODE 0x20 |
| 1122 | struct hci_ev_pscan_rep_mode { |
| 1123 | bdaddr_t bdaddr; |
| 1124 | __u8 pscan_rep_mode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1125 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1126 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1127 | #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 |
| 1128 | struct inquiry_info_with_rssi { |
| 1129 | bdaddr_t bdaddr; |
| 1130 | __u8 pscan_rep_mode; |
| 1131 | __u8 pscan_period_mode; |
| 1132 | __u8 dev_class[3]; |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 1133 | __le16 clock_offset; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1134 | __s8 rssi; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1135 | } __packed; |
Marcel Holtmann | 45bb4bf | 2005-08-09 20:27:49 -0700 | [diff] [blame] | 1136 | struct inquiry_info_with_rssi_and_pscan_mode { |
| 1137 | bdaddr_t bdaddr; |
| 1138 | __u8 pscan_rep_mode; |
| 1139 | __u8 pscan_period_mode; |
| 1140 | __u8 pscan_mode; |
| 1141 | __u8 dev_class[3]; |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 1142 | __le16 clock_offset; |
Marcel Holtmann | 45bb4bf | 2005-08-09 20:27:49 -0700 | [diff] [blame] | 1143 | __s8 rssi; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1144 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1145 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1146 | #define HCI_EV_REMOTE_EXT_FEATURES 0x23 |
| 1147 | struct hci_ev_remote_ext_features { |
| 1148 | __u8 status; |
| 1149 | __le16 handle; |
| 1150 | __u8 page; |
| 1151 | __u8 max_page; |
| 1152 | __u8 features[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1153 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1154 | |
| 1155 | #define HCI_EV_SYNC_CONN_COMPLETE 0x2c |
| 1156 | struct hci_ev_sync_conn_complete { |
| 1157 | __u8 status; |
| 1158 | __le16 handle; |
| 1159 | bdaddr_t bdaddr; |
| 1160 | __u8 link_type; |
| 1161 | __u8 tx_interval; |
| 1162 | __u8 retrans_window; |
| 1163 | __le16 rx_pkt_len; |
| 1164 | __le16 tx_pkt_len; |
| 1165 | __u8 air_mode; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1166 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1167 | |
| 1168 | #define HCI_EV_SYNC_CONN_CHANGED 0x2d |
| 1169 | struct hci_ev_sync_conn_changed { |
| 1170 | __u8 status; |
| 1171 | __le16 handle; |
| 1172 | __u8 tx_interval; |
| 1173 | __u8 retrans_window; |
| 1174 | __le16 rx_pkt_len; |
| 1175 | __le16 tx_pkt_len; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1176 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1177 | |
| 1178 | #define HCI_EV_SNIFF_SUBRATE 0x2e |
| 1179 | struct hci_ev_sniff_subrate { |
| 1180 | __u8 status; |
| 1181 | __le16 handle; |
| 1182 | __le16 max_tx_latency; |
| 1183 | __le16 max_rx_latency; |
| 1184 | __le16 max_remote_timeout; |
| 1185 | __le16 max_local_timeout; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1186 | } __packed; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1187 | |
| 1188 | #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f |
Marcel Holtmann | 21d9e30 | 2005-09-13 01:32:25 +0200 | [diff] [blame] | 1189 | struct extended_inquiry_info { |
| 1190 | bdaddr_t bdaddr; |
| 1191 | __u8 pscan_rep_mode; |
| 1192 | __u8 pscan_period_mode; |
| 1193 | __u8 dev_class[3]; |
Marcel Holtmann | 1ebb925 | 2005-11-08 09:57:21 -0800 | [diff] [blame] | 1194 | __le16 clock_offset; |
Marcel Holtmann | 21d9e30 | 2005-09-13 01:32:25 +0200 | [diff] [blame] | 1195 | __s8 rssi; |
| 1196 | __u8 data[240]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1197 | } __packed; |
Marcel Holtmann | 21d9e30 | 2005-09-13 01:32:25 +0200 | [diff] [blame] | 1198 | |
Johan Hedberg | 1c2e004 | 2012-06-08 23:31:13 +0800 | [diff] [blame] | 1199 | #define HCI_EV_KEY_REFRESH_COMPLETE 0x30 |
| 1200 | struct hci_ev_key_refresh_complete { |
| 1201 | __u8 status; |
| 1202 | __le16 handle; |
| 1203 | } __packed; |
| 1204 | |
Marcel Holtmann | 0493684 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1205 | #define HCI_EV_IO_CAPA_REQUEST 0x31 |
| 1206 | struct hci_ev_io_capa_request { |
| 1207 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1208 | } __packed; |
Marcel Holtmann | 0493684 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1209 | |
Johan Hedberg | 03b555e | 2011-01-04 15:40:05 +0200 | [diff] [blame] | 1210 | #define HCI_EV_IO_CAPA_REPLY 0x32 |
| 1211 | struct hci_ev_io_capa_reply { |
| 1212 | bdaddr_t bdaddr; |
| 1213 | __u8 capability; |
| 1214 | __u8 oob_data; |
| 1215 | __u8 authentication; |
| 1216 | } __packed; |
| 1217 | |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 1218 | #define HCI_EV_USER_CONFIRM_REQUEST 0x33 |
| 1219 | struct hci_ev_user_confirm_req { |
| 1220 | bdaddr_t bdaddr; |
| 1221 | __le32 passkey; |
| 1222 | } __packed; |
| 1223 | |
Brian Gix | 9ad4019 | 2011-11-12 22:01:11 -0800 | [diff] [blame] | 1224 | #define HCI_EV_USER_PASSKEY_REQUEST 0x34 |
| 1225 | struct hci_ev_user_passkey_req { |
| 1226 | bdaddr_t bdaddr; |
| 1227 | } __packed; |
| 1228 | |
Szymon Janc | 2763eda | 2011-03-22 13:12:22 +0100 | [diff] [blame] | 1229 | #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 |
| 1230 | struct hci_ev_remote_oob_data_request { |
| 1231 | bdaddr_t bdaddr; |
| 1232 | } __packed; |
| 1233 | |
Marcel Holtmann | 0493684 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1234 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
| 1235 | struct hci_ev_simple_pair_complete { |
| 1236 | __u8 status; |
| 1237 | bdaddr_t bdaddr; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1238 | } __packed; |
Marcel Holtmann | 0493684 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1239 | |
Marcel Holtmann | 41a9621 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1240 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d |
| 1241 | struct hci_ev_remote_host_features { |
| 1242 | bdaddr_t bdaddr; |
| 1243 | __u8 features[8]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1244 | } __packed; |
Marcel Holtmann | 41a9621 | 2008-07-14 20:13:48 +0200 | [diff] [blame] | 1245 | |
Ville Tervo | 63185f6 | 2011-02-10 22:38:46 -0300 | [diff] [blame] | 1246 | #define HCI_EV_LE_META 0x3e |
| 1247 | struct hci_ev_le_meta { |
| 1248 | __u8 subevent; |
| 1249 | } __packed; |
| 1250 | |
Andrei Emeltchenko | 523e93c | 2012-05-25 15:09:26 +0300 | [diff] [blame] | 1251 | #define HCI_EV_PHY_LINK_COMPLETE 0x40 |
| 1252 | struct hci_ev_phy_link_complete { |
| 1253 | __u8 status; |
| 1254 | __u8 phy_handle; |
| 1255 | } __packed; |
| 1256 | |
| 1257 | #define HCI_EV_CHANNEL_SELECTED 0x41 |
| 1258 | struct hci_ev_channel_selected { |
| 1259 | __u8 phy_handle; |
| 1260 | } __packed; |
| 1261 | |
| 1262 | #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 |
| 1263 | struct hci_ev_disconn_phy_link_complete { |
| 1264 | __u8 status; |
| 1265 | __u8 phy_handle; |
| 1266 | __u8 reason; |
| 1267 | } __packed; |
| 1268 | |
| 1269 | #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 |
| 1270 | struct hci_ev_logical_link_complete { |
| 1271 | __u8 status; |
| 1272 | __le16 handle; |
| 1273 | __u8 phy_handle; |
| 1274 | __u8 flow_spec_id; |
| 1275 | } __packed; |
| 1276 | |
| 1277 | #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 |
| 1278 | struct hci_ev_disconn_logical_link_complete { |
| 1279 | __u8 status; |
| 1280 | __le16 handle; |
| 1281 | __u8 reason; |
| 1282 | } __packed; |
| 1283 | |
Andrei Emeltchenko | 25e89e9 | 2012-01-04 12:41:58 +0200 | [diff] [blame] | 1284 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 |
| 1285 | struct hci_comp_blocks_info { |
| 1286 | __le16 handle; |
| 1287 | __le16 pkts; |
| 1288 | __le16 blocks; |
| 1289 | } __packed; |
| 1290 | |
| 1291 | struct hci_ev_num_comp_blocks { |
| 1292 | __le16 num_blocks; |
| 1293 | __u8 num_hndl; |
| 1294 | struct hci_comp_blocks_info handles[0]; |
| 1295 | } __packed; |
| 1296 | |
Ville Tervo | 63185f6 | 2011-02-10 22:38:46 -0300 | [diff] [blame] | 1297 | /* Low energy meta events */ |
| 1298 | #define HCI_EV_LE_CONN_COMPLETE 0x01 |
| 1299 | struct hci_ev_le_conn_complete { |
| 1300 | __u8 status; |
| 1301 | __le16 handle; |
| 1302 | __u8 role; |
| 1303 | __u8 bdaddr_type; |
| 1304 | bdaddr_t bdaddr; |
| 1305 | __le16 interval; |
| 1306 | __le16 latency; |
| 1307 | __le16 supervision_timeout; |
| 1308 | __u8 clk_accurancy; |
| 1309 | } __packed; |
| 1310 | |
Vinicius Costa Gomes | a7a595f | 2011-06-09 18:50:47 -0300 | [diff] [blame] | 1311 | #define HCI_EV_LE_LTK_REQ 0x05 |
| 1312 | struct hci_ev_le_ltk_req { |
| 1313 | __le16 handle; |
| 1314 | __u8 random[8]; |
| 1315 | __le16 ediv; |
| 1316 | } __packed; |
| 1317 | |
Anderson Briglia | 57a56fd | 2011-05-26 16:23:49 -0300 | [diff] [blame] | 1318 | /* Advertising report event types */ |
| 1319 | #define ADV_IND 0x00 |
| 1320 | #define ADV_DIRECT_IND 0x01 |
| 1321 | #define ADV_SCAN_IND 0x02 |
| 1322 | #define ADV_NONCONN_IND 0x03 |
| 1323 | #define ADV_SCAN_RSP 0x04 |
| 1324 | |
| 1325 | #define ADDR_LE_DEV_PUBLIC 0x00 |
| 1326 | #define ADDR_LE_DEV_RANDOM 0x01 |
| 1327 | |
| 1328 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 |
| 1329 | struct hci_ev_le_advertising_info { |
| 1330 | __u8 evt_type; |
| 1331 | __u8 bdaddr_type; |
| 1332 | bdaddr_t bdaddr; |
| 1333 | __u8 length; |
| 1334 | __u8 data[0]; |
| 1335 | } __packed; |
| 1336 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1337 | /* Internal events generated by Bluetooth stack */ |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1338 | #define HCI_EV_STACK_INTERNAL 0xfd |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1339 | struct hci_ev_stack_internal { |
| 1340 | __u16 type; |
| 1341 | __u8 data[0]; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1342 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1343 | |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1344 | #define HCI_EV_SI_DEVICE 0x01 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1345 | struct hci_ev_si_device { |
| 1346 | __u16 event; |
| 1347 | __u16 dev_id; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1348 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1349 | |
| 1350 | #define HCI_EV_SI_SECURITY 0x02 |
| 1351 | struct hci_ev_si_security { |
| 1352 | __u16 event; |
| 1353 | __u16 proto; |
| 1354 | __u16 subproto; |
| 1355 | __u8 incoming; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1356 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1357 | |
| 1358 | /* ---- HCI Packet structures ---- */ |
| 1359 | #define HCI_COMMAND_HDR_SIZE 3 |
| 1360 | #define HCI_EVENT_HDR_SIZE 2 |
| 1361 | #define HCI_ACL_HDR_SIZE 4 |
| 1362 | #define HCI_SCO_HDR_SIZE 3 |
| 1363 | |
| 1364 | struct hci_command_hdr { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1365 | __le16 opcode; /* OCF & OGF */ |
Andrei Emeltchenko | 70f23020 | 2010-12-01 16:58:25 +0200 | [diff] [blame] | 1366 | __u8 plen; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1367 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1368 | |
| 1369 | struct hci_event_hdr { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1370 | __u8 evt; |
| 1371 | __u8 plen; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1372 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1373 | |
| 1374 | struct hci_acl_hdr { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1375 | __le16 handle; /* Handle & Flags(PB, BC) */ |
| 1376 | __le16 dlen; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1377 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1378 | |
| 1379 | struct hci_sco_hdr { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1380 | __le16 handle; |
| 1381 | __u8 dlen; |
Gustavo F. Padovan | 66c853c | 2010-07-19 02:00:13 -0300 | [diff] [blame] | 1382 | } __packed; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1383 | |
Arnaldo Carvalho de Melo | 2a123b86 | 2007-03-27 18:38:07 -0300 | [diff] [blame] | 1384 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
| 1385 | { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1386 | return (struct hci_event_hdr *) skb->data; |
Arnaldo Carvalho de Melo | 2a123b86 | 2007-03-27 18:38:07 -0300 | [diff] [blame] | 1387 | } |
| 1388 | |
| 1389 | static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) |
| 1390 | { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1391 | return (struct hci_acl_hdr *) skb->data; |
Arnaldo Carvalho de Melo | 2a123b86 | 2007-03-27 18:38:07 -0300 | [diff] [blame] | 1392 | } |
| 1393 | |
| 1394 | static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) |
| 1395 | { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1396 | return (struct hci_sco_hdr *) skb->data; |
Arnaldo Carvalho de Melo | 2a123b86 | 2007-03-27 18:38:07 -0300 | [diff] [blame] | 1397 | } |
Arnaldo Carvalho de Melo | 2a123b86 | 2007-03-27 18:38:07 -0300 | [diff] [blame] | 1398 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1399 | /* Command opcode pack/unpack */ |
Gustavo Padovan | c3c7ea6 | 2012-05-23 04:04:20 -0300 | [diff] [blame] | 1400 | #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1401 | #define hci_opcode_ogf(op) (op >> 10) |
| 1402 | #define hci_opcode_ocf(op) (op & 0x03ff) |
| 1403 | |
| 1404 | /* ACL handle and flags pack/unpack */ |
Gustavo Padovan | c3c7ea6 | 2012-05-23 04:04:20 -0300 | [diff] [blame] | 1405 | #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1406 | #define hci_handle(h) (h & 0x0fff) |
| 1407 | #define hci_flags(h) (h >> 12) |
| 1408 | |
| 1409 | /* ---- HCI Sockets ---- */ |
| 1410 | |
| 1411 | /* Socket options */ |
| 1412 | #define HCI_DATA_DIR 1 |
| 1413 | #define HCI_FILTER 2 |
| 1414 | #define HCI_TIME_STAMP 3 |
| 1415 | |
| 1416 | /* CMSG flags */ |
| 1417 | #define HCI_CMSG_DIR 0x0001 |
| 1418 | #define HCI_CMSG_TSTAMP 0x0002 |
| 1419 | |
| 1420 | struct sockaddr_hci { |
| 1421 | sa_family_t hci_family; |
| 1422 | unsigned short hci_dev; |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 1423 | unsigned short hci_channel; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1424 | }; |
| 1425 | #define HCI_DEV_NONE 0xffff |
| 1426 | |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 1427 | #define HCI_CHANNEL_RAW 0 |
Marcel Holtmann | cd82e61 | 2012-02-20 20:34:38 +0100 | [diff] [blame] | 1428 | #define HCI_CHANNEL_MONITOR 2 |
Gustavo Padovan | 66f3b91 | 2012-03-29 09:47:53 -0300 | [diff] [blame] | 1429 | #define HCI_CHANNEL_CONTROL 3 |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 1430 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1431 | struct hci_filter { |
| 1432 | unsigned long type_mask; |
| 1433 | unsigned long event_mask[2]; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1434 | __le16 opcode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1435 | }; |
| 1436 | |
| 1437 | struct hci_ufilter { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1438 | __u32 type_mask; |
| 1439 | __u32 event_mask[2]; |
| 1440 | __le16 opcode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1441 | }; |
| 1442 | |
| 1443 | #define HCI_FLT_TYPE_BITS 31 |
| 1444 | #define HCI_FLT_EVENT_BITS 63 |
| 1445 | #define HCI_FLT_OGF_BITS 63 |
| 1446 | #define HCI_FLT_OCF_BITS 127 |
| 1447 | |
| 1448 | /* ---- HCI Ioctl requests structures ---- */ |
| 1449 | struct hci_dev_stats { |
| 1450 | __u32 err_rx; |
| 1451 | __u32 err_tx; |
| 1452 | __u32 cmd_tx; |
| 1453 | __u32 evt_rx; |
| 1454 | __u32 acl_tx; |
| 1455 | __u32 acl_rx; |
| 1456 | __u32 sco_tx; |
| 1457 | __u32 sco_rx; |
| 1458 | __u32 byte_rx; |
| 1459 | __u32 byte_tx; |
| 1460 | }; |
| 1461 | |
| 1462 | struct hci_dev_info { |
| 1463 | __u16 dev_id; |
| 1464 | char name[8]; |
| 1465 | |
| 1466 | bdaddr_t bdaddr; |
| 1467 | |
| 1468 | __u32 flags; |
| 1469 | __u8 type; |
| 1470 | |
| 1471 | __u8 features[8]; |
| 1472 | |
| 1473 | __u32 pkt_type; |
| 1474 | __u32 link_policy; |
| 1475 | __u32 link_mode; |
| 1476 | |
| 1477 | __u16 acl_mtu; |
| 1478 | __u16 acl_pkts; |
| 1479 | __u16 sco_mtu; |
| 1480 | __u16 sco_pkts; |
| 1481 | |
| 1482 | struct hci_dev_stats stat; |
| 1483 | }; |
| 1484 | |
| 1485 | struct hci_conn_info { |
| 1486 | __u16 handle; |
| 1487 | bdaddr_t bdaddr; |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1488 | __u8 type; |
| 1489 | __u8 out; |
| 1490 | __u16 state; |
| 1491 | __u32 link_mode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1492 | }; |
| 1493 | |
| 1494 | struct hci_dev_req { |
Marcel Holtmann | a9de924 | 2007-10-20 13:33:56 +0200 | [diff] [blame] | 1495 | __u16 dev_id; |
| 1496 | __u32 dev_opt; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1497 | }; |
| 1498 | |
| 1499 | struct hci_dev_list_req { |
| 1500 | __u16 dev_num; |
| 1501 | struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ |
| 1502 | }; |
| 1503 | |
| 1504 | struct hci_conn_list_req { |
| 1505 | __u16 dev_id; |
| 1506 | __u16 conn_num; |
| 1507 | struct hci_conn_info conn_info[0]; |
| 1508 | }; |
| 1509 | |
| 1510 | struct hci_conn_info_req { |
| 1511 | bdaddr_t bdaddr; |
| 1512 | __u8 type; |
| 1513 | struct hci_conn_info conn_info[0]; |
| 1514 | }; |
| 1515 | |
Marcel Holtmann | 40be492 | 2008-07-14 20:13:50 +0200 | [diff] [blame] | 1516 | struct hci_auth_info_req { |
| 1517 | bdaddr_t bdaddr; |
| 1518 | __u8 type; |
| 1519 | }; |
| 1520 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1521 | struct hci_inquiry_req { |
| 1522 | __u16 dev_id; |
| 1523 | __u16 flags; |
| 1524 | __u8 lap[3]; |
| 1525 | __u8 length; |
| 1526 | __u8 num_rsp; |
| 1527 | }; |
| 1528 | #define IREQ_CACHE_FLUSH 0x0001 |
| 1529 | |
Fabio Estevam | 8b281b9 | 2012-01-10 18:33:50 -0200 | [diff] [blame] | 1530 | extern bool enable_hs; |
Andrei Emeltchenko | 8830f51 | 2011-11-11 17:02:14 +0200 | [diff] [blame] | 1531 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1532 | #endif /* __HCI_H */ |