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