1 /******************************************************************************
2  *
3  *  Copyright (C) 1999-2014 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 #ifndef HCIDEFS_H
20 #define HCIDEFS_H
21 
22 #define HCI_PROTO_VERSION     0x01      /* Version for BT spec 1.1          */
23 #define HCI_PROTO_VERSION_1_2 0x02      /* Version for BT spec 1.2          */
24 #define HCI_PROTO_VERSION_2_0 0x03      /* Version for BT spec 2.0          */
25 #define HCI_PROTO_VERSION_2_1 0x04      /* Version for BT spec 2.1 [Lisbon] */
26 #define HCI_PROTO_VERSION_3_0 0x05      /* Version for BT spec 3.0          */
27 #define HCI_PROTO_REVISION    0x000C    /* Current implementation version   */
28 /*
29 **  Definitions for HCI groups
30 */
31 #define HCI_GRP_LINK_CONTROL_CMDS       (0x01 << 10)            /* 0x0400 */
32 #define HCI_GRP_LINK_POLICY_CMDS        (0x02 << 10)            /* 0x0800 */
33 #define HCI_GRP_HOST_CONT_BASEBAND_CMDS (0x03 << 10)            /* 0x0C00 */
34 #define HCI_GRP_INFORMATIONAL_PARAMS    (0x04 << 10)            /* 0x1000 */
35 #define HCI_GRP_STATUS_PARAMS           (0x05 << 10)            /* 0x1400 */
36 #define HCI_GRP_TESTING_CMDS            (0x06 << 10)            /* 0x1800 */
37 
38 #define HCI_GRP_VENDOR_SPECIFIC         (0x3F << 10)            /* 0xFC00 */
39 
40 /* Group occupies high 6 bits of the HCI command rest is opcode itself */
41 #define HCI_OGF(p)  (UINT8)((0xFC00 & (p)) >> 10)
42 #define HCI_OCF(p)  ( 0x3FF & (p))
43 
44 /*
45 **  Definitions for Link Control Commands
46 */
47 /* Following opcode is used only in command complete event for flow control */
48 #define HCI_COMMAND_NONE                0x0000
49 
50 /* Commands of HCI_GRP_LINK_CONTROL_CMDS group */
51 #define HCI_INQUIRY                     (0x0001 | HCI_GRP_LINK_CONTROL_CMDS)
52 #define HCI_INQUIRY_CANCEL              (0x0002 | HCI_GRP_LINK_CONTROL_CMDS)
53 #define HCI_PERIODIC_INQUIRY_MODE       (0x0003 | HCI_GRP_LINK_CONTROL_CMDS)
54 #define HCI_EXIT_PERIODIC_INQUIRY_MODE  (0x0004 | HCI_GRP_LINK_CONTROL_CMDS)
55 #define HCI_CREATE_CONNECTION           (0x0005 | HCI_GRP_LINK_CONTROL_CMDS)
56 #define HCI_DISCONNECT                  (0x0006 | HCI_GRP_LINK_CONTROL_CMDS)
57 #define HCI_ADD_SCO_CONNECTION          (0x0007 | HCI_GRP_LINK_CONTROL_CMDS)
58 #define HCI_CREATE_CONNECTION_CANCEL    (0x0008 | HCI_GRP_LINK_CONTROL_CMDS)
59 #define HCI_ACCEPT_CONNECTION_REQUEST   (0x0009 | HCI_GRP_LINK_CONTROL_CMDS)
60 #define HCI_REJECT_CONNECTION_REQUEST   (0x000A | HCI_GRP_LINK_CONTROL_CMDS)
61 #define HCI_LINK_KEY_REQUEST_REPLY      (0x000B | HCI_GRP_LINK_CONTROL_CMDS)
62 #define HCI_LINK_KEY_REQUEST_NEG_REPLY  (0x000C | HCI_GRP_LINK_CONTROL_CMDS)
63 #define HCI_PIN_CODE_REQUEST_REPLY      (0x000D | HCI_GRP_LINK_CONTROL_CMDS)
64 #define HCI_PIN_CODE_REQUEST_NEG_REPLY  (0x000E | HCI_GRP_LINK_CONTROL_CMDS)
65 #define HCI_CHANGE_CONN_PACKET_TYPE     (0x000F | HCI_GRP_LINK_CONTROL_CMDS)
66 #define HCI_AUTHENTICATION_REQUESTED    (0x0011 | HCI_GRP_LINK_CONTROL_CMDS)
67 #define HCI_SET_CONN_ENCRYPTION         (0x0013 | HCI_GRP_LINK_CONTROL_CMDS)
68 #define HCI_CHANGE_CONN_LINK_KEY        (0x0015 | HCI_GRP_LINK_CONTROL_CMDS)
69 #define HCI_MASTER_LINK_KEY             (0x0017 | HCI_GRP_LINK_CONTROL_CMDS)
70 #define HCI_RMT_NAME_REQUEST            (0x0019 | HCI_GRP_LINK_CONTROL_CMDS)
71 #define HCI_RMT_NAME_REQUEST_CANCEL     (0x001A | HCI_GRP_LINK_CONTROL_CMDS)
72 #define HCI_READ_RMT_FEATURES           (0x001B | HCI_GRP_LINK_CONTROL_CMDS)
73 #define HCI_READ_RMT_EXT_FEATURES       (0x001C | HCI_GRP_LINK_CONTROL_CMDS)
74 #define HCI_READ_RMT_VERSION_INFO       (0x001D | HCI_GRP_LINK_CONTROL_CMDS)
75 #define HCI_READ_RMT_CLOCK_OFFSET       (0x001F | HCI_GRP_LINK_CONTROL_CMDS)
76 #define HCI_READ_LMP_HANDLE             (0x0020 | HCI_GRP_LINK_CONTROL_CMDS)
77 #define HCI_SETUP_ESCO_CONNECTION       (0x0028 | HCI_GRP_LINK_CONTROL_CMDS)
78 #define HCI_ACCEPT_ESCO_CONNECTION      (0x0029 | HCI_GRP_LINK_CONTROL_CMDS)
79 #define HCI_REJECT_ESCO_CONNECTION      (0x002A | HCI_GRP_LINK_CONTROL_CMDS)
80 #define HCI_IO_CAPABILITY_REQUEST_REPLY (0x002B | HCI_GRP_LINK_CONTROL_CMDS)
81 #define HCI_USER_CONF_REQUEST_REPLY     (0x002C | HCI_GRP_LINK_CONTROL_CMDS)
82 #define HCI_USER_CONF_VALUE_NEG_REPLY   (0x002D | HCI_GRP_LINK_CONTROL_CMDS)
83 #define HCI_USER_PASSKEY_REQ_REPLY      (0x002E | HCI_GRP_LINK_CONTROL_CMDS)
84 #define HCI_USER_PASSKEY_REQ_NEG_REPLY  (0x002F | HCI_GRP_LINK_CONTROL_CMDS)
85 #define HCI_REM_OOB_DATA_REQ_REPLY      (0x0030 | HCI_GRP_LINK_CONTROL_CMDS)
86 #define HCI_REM_OOB_DATA_REQ_NEG_REPLY  (0x0033 | HCI_GRP_LINK_CONTROL_CMDS)
87 #define HCI_IO_CAP_REQ_NEG_REPLY        (0x0034 | HCI_GRP_LINK_CONTROL_CMDS)
88 
89 /* AMP HCI */
90 #define HCI_CREATE_PHYSICAL_LINK        (0x0035 | HCI_GRP_LINK_CONTROL_CMDS)
91 #define HCI_ACCEPT_PHYSICAL_LINK        (0x0036 | HCI_GRP_LINK_CONTROL_CMDS)
92 #define HCI_DISCONNECT_PHYSICAL_LINK    (0x0037 | HCI_GRP_LINK_CONTROL_CMDS)
93 #define HCI_CREATE_LOGICAL_LINK         (0x0038 | HCI_GRP_LINK_CONTROL_CMDS)
94 #define HCI_ACCEPT_LOGICAL_LINK         (0x0039 | HCI_GRP_LINK_CONTROL_CMDS)
95 #define HCI_DISCONNECT_LOGICAL_LINK     (0x003A | HCI_GRP_LINK_CONTROL_CMDS)
96 #define HCI_LOGICAL_LINK_CANCEL         (0x003B | HCI_GRP_LINK_CONTROL_CMDS)
97 #define HCI_FLOW_SPEC_MODIFY            (0x003C | HCI_GRP_LINK_CONTROL_CMDS)
98 
99 #define HCI_ENH_SETUP_ESCO_CONNECTION   (0x003D | HCI_GRP_LINK_CONTROL_CMDS)
100 #define HCI_ENH_ACCEPT_ESCO_CONNECTION  (0x003E | HCI_GRP_LINK_CONTROL_CMDS)
101 
102 /* ConnectionLess Broadcast */
103 #define HCI_TRUNCATED_PAGE              (0x003F | HCI_GRP_LINK_CONTROL_CMDS)
104 #define HCI_TRUNCATED_PAGE_CANCEL       (0x0040 | HCI_GRP_LINK_CONTROL_CMDS)
105 #define HCI_SET_CLB                     (0x0041 | HCI_GRP_LINK_CONTROL_CMDS)
106 #define HCI_RECEIVE_CLB                 (0x0042 | HCI_GRP_LINK_CONTROL_CMDS)
107 #define HCI_START_SYNC_TRAIN            (0x0043 | HCI_GRP_LINK_CONTROL_CMDS)
108 #define HCI_RECEIVE_SYNC_TRAIN          (0x0044 | HCI_GRP_LINK_CONTROL_CMDS)
109 
110 #define HCI_LINK_CTRL_CMDS_FIRST        HCI_INQUIRY
111 #define HCI_LINK_CTRL_CMDS_LAST         HCI_RECEIVE_SYNC_TRAIN
112 
113 /* Commands of HCI_GRP_LINK_POLICY_CMDS */
114 #define HCI_HOLD_MODE                   (0x0001 | HCI_GRP_LINK_POLICY_CMDS)
115 #define HCI_SNIFF_MODE                  (0x0003 | HCI_GRP_LINK_POLICY_CMDS)
116 #define HCI_EXIT_SNIFF_MODE             (0x0004 | HCI_GRP_LINK_POLICY_CMDS)
117 #define HCI_PARK_MODE                   (0x0005 | HCI_GRP_LINK_POLICY_CMDS)
118 #define HCI_EXIT_PARK_MODE              (0x0006 | HCI_GRP_LINK_POLICY_CMDS)
119 #define HCI_QOS_SETUP                   (0x0007 | HCI_GRP_LINK_POLICY_CMDS)
120 #define HCI_ROLE_DISCOVERY              (0x0009 | HCI_GRP_LINK_POLICY_CMDS)
121 #define HCI_SWITCH_ROLE                 (0x000B | HCI_GRP_LINK_POLICY_CMDS)
122 #define HCI_READ_POLICY_SETTINGS        (0x000C | HCI_GRP_LINK_POLICY_CMDS)
123 #define HCI_WRITE_POLICY_SETTINGS       (0x000D | HCI_GRP_LINK_POLICY_CMDS)
124 #define HCI_READ_DEF_POLICY_SETTINGS    (0x000E | HCI_GRP_LINK_POLICY_CMDS)
125 #define HCI_WRITE_DEF_POLICY_SETTINGS   (0x000F | HCI_GRP_LINK_POLICY_CMDS)
126 #define HCI_FLOW_SPECIFICATION          (0x0010 | HCI_GRP_LINK_POLICY_CMDS)
127 #define HCI_SNIFF_SUB_RATE              (0x0011 | HCI_GRP_LINK_POLICY_CMDS)
128 
129 #define HCI_LINK_POLICY_CMDS_FIRST      HCI_HOLD_MODE
130 #define HCI_LINK_POLICY_CMDS_LAST       HCI_SNIFF_SUB_RATE
131 
132 
133 /* Commands of HCI_GRP_HOST_CONT_BASEBAND_CMDS */
134 #define HCI_SET_EVENT_MASK              (0x0001 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
135 #define HCI_RESET                       (0x0003 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
136 #define HCI_SET_EVENT_FILTER            (0x0005 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
137 #define HCI_FLUSH                       (0x0008 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
138 #define HCI_READ_PIN_TYPE               (0x0009 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
139 #define HCI_WRITE_PIN_TYPE              (0x000A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
140 #define HCI_CREATE_NEW_UNIT_KEY         (0x000B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
141 #define HCI_GET_MWS_TRANS_LAYER_CFG     (0x000C | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
142 #define HCI_READ_STORED_LINK_KEY        (0x000D | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
143 #define HCI_WRITE_STORED_LINK_KEY       (0x0011 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
144 #define HCI_DELETE_STORED_LINK_KEY      (0x0012 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
145 #define HCI_CHANGE_LOCAL_NAME           (0x0013 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
146 #define HCI_READ_LOCAL_NAME             (0x0014 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
147 #define HCI_READ_CONN_ACCEPT_TOUT       (0x0015 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
148 #define HCI_WRITE_CONN_ACCEPT_TOUT      (0x0016 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
149 #define HCI_READ_PAGE_TOUT              (0x0017 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
150 #define HCI_WRITE_PAGE_TOUT             (0x0018 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
151 #define HCI_READ_SCAN_ENABLE            (0x0019 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
152 #define HCI_WRITE_SCAN_ENABLE           (0x001A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
153 #define HCI_READ_PAGESCAN_CFG           (0x001B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
154 #define HCI_WRITE_PAGESCAN_CFG          (0x001C | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
155 #define HCI_READ_INQUIRYSCAN_CFG        (0x001D | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
156 #define HCI_WRITE_INQUIRYSCAN_CFG       (0x001E | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
157 #define HCI_READ_AUTHENTICATION_ENABLE  (0x001F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
158 #define HCI_WRITE_AUTHENTICATION_ENABLE (0x0020 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
159 #define HCI_READ_ENCRYPTION_MODE        (0x0021 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
160 #define HCI_WRITE_ENCRYPTION_MODE       (0x0022 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
161 #define HCI_READ_CLASS_OF_DEVICE        (0x0023 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
162 #define HCI_WRITE_CLASS_OF_DEVICE       (0x0024 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
163 #define HCI_READ_VOICE_SETTINGS         (0x0025 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
164 #define HCI_WRITE_VOICE_SETTINGS        (0x0026 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
165 #define HCI_READ_AUTO_FLUSH_TOUT        (0x0027 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
166 #define HCI_WRITE_AUTO_FLUSH_TOUT       (0x0028 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
167 #define HCI_READ_NUM_BCAST_REXMITS      (0x0029 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
168 #define HCI_WRITE_NUM_BCAST_REXMITS     (0x002A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
169 #define HCI_READ_HOLD_MODE_ACTIVITY     (0x002B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
170 #define HCI_WRITE_HOLD_MODE_ACTIVITY    (0x002C | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
171 #define HCI_READ_TRANSMIT_POWER_LEVEL   (0x002D | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
172 #define HCI_READ_SCO_FLOW_CTRL_ENABLE   (0x002E | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
173 #define HCI_WRITE_SCO_FLOW_CTRL_ENABLE  (0x002F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
174 #define HCI_SET_HC_TO_HOST_FLOW_CTRL    (0x0031 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
175 #define HCI_HOST_BUFFER_SIZE            (0x0033 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
176 #define HCI_HOST_NUM_PACKETS_DONE       (0x0035 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
177 #define HCI_READ_LINK_SUPER_TOUT        (0x0036 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
178 #define HCI_WRITE_LINK_SUPER_TOUT       (0x0037 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
179 #define HCI_READ_NUM_SUPPORTED_IAC      (0x0038 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
180 #define HCI_READ_CURRENT_IAC_LAP        (0x0039 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
181 #define HCI_WRITE_CURRENT_IAC_LAP       (0x003A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
182 #define HCI_READ_PAGESCAN_PERIOD_MODE   (0x003B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
183 #define HCI_WRITE_PAGESCAN_PERIOD_MODE  (0x003C | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
184 #define HCI_READ_PAGESCAN_MODE          (0x003D | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
185 #define HCI_WRITE_PAGESCAN_MODE         (0x003E | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
186 #define HCI_SET_AFH_CHANNELS            (0x003F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
187 
188 #define HCI_READ_INQSCAN_TYPE           (0x0042 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
189 #define HCI_WRITE_INQSCAN_TYPE          (0x0043 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
190 #define HCI_READ_INQUIRY_MODE           (0x0044 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
191 #define HCI_WRITE_INQUIRY_MODE          (0x0045 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
192 #define HCI_READ_PAGESCAN_TYPE          (0x0046 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
193 #define HCI_WRITE_PAGESCAN_TYPE         (0x0047 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
194 #define HCI_READ_AFH_ASSESSMENT_MODE    (0x0048 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
195 #define HCI_WRITE_AFH_ASSESSMENT_MODE   (0x0049 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
196 #define HCI_READ_EXT_INQ_RESPONSE       (0x0051 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
197 #define HCI_WRITE_EXT_INQ_RESPONSE      (0x0052 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
198 #define HCI_REFRESH_ENCRYPTION_KEY      (0x0053 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
199 #define HCI_READ_SIMPLE_PAIRING_MODE    (0x0055 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
200 #define HCI_WRITE_SIMPLE_PAIRING_MODE   (0x0056 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
201 #define HCI_READ_LOCAL_OOB_DATA         (0x0057 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
202 #define HCI_READ_INQ_TX_POWER_LEVEL     (0x0058 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
203 #define HCI_WRITE_INQ_TX_POWER_LEVEL    (0x0059 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
204 #define HCI_READ_ERRONEOUS_DATA_RPT     (0x005A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
205 #define HCI_WRITE_ERRONEOUS_DATA_RPT    (0x005B | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
206 #define HCI_ENHANCED_FLUSH              (0x005F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
207 #define HCI_SEND_KEYPRESS_NOTIF         (0x0060 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
208 
209 
210 /* AMP HCI */
211 #define HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT  (0x0061 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
212 #define HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT (0x0062 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
213 #define HCI_SET_EVENT_MASK_PAGE_2             (0x0063 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
214 #define HCI_READ_LOCATION_DATA                (0x0064 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
215 #define HCI_WRITE_LOCATION_DATA               (0x0065 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
216 #define HCI_READ_FLOW_CONTROL_MODE            (0x0066 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
217 #define HCI_WRITE_FLOW_CONTROL_MODE           (0x0067 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
218 #define HCI_READ_BE_FLUSH_TOUT                (0x0069 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
219 #define HCI_WRITE_BE_FLUSH_TOUT               (0x006A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
220 #define HCI_SHORT_RANGE_MODE                  (0x006B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) /* 802.11 only */
221 #define HCI_READ_LE_HOST_SUPPORT              (0x006C | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
222 #define HCI_WRITE_LE_HOST_SUPPORT             (0x006D | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
223 
224 
225 /* MWS coexistence */
226 #define HCI_SET_MWS_CHANNEL_PARAMETERS          (0x006E | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
227 #define HCI_SET_EXTERNAL_FRAME_CONFIGURATION    (0x006F | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
228 #define HCI_SET_MWS_SIGNALING                   (0x0070 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
229 #define HCI_SET_MWS_TRANSPORT_LAYER             (0x0071 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
230 #define HCI_SET_MWS_SCAN_FREQUENCY_TABLE        (0x0072 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
231 #define HCI_SET_MWS_PATTERN_CONFIGURATION       (0x0073 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
232 
233 /* Connectionless Broadcast */
234 #define HCI_SET_RESERVED_LT_ADDR                (0x0074 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
235 #define HCI_DELETE_RESERVED_LT_ADDR             (0x0075 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
236 #define HCI_WRITE_CLB_DATA                      (0x0076 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
237 #define HCI_READ_SYNC_TRAIN_PARAM               (0x0077 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
238 #define HCI_WRITE_SYNC_TRAIN_PARAM              (0x0078 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
239 
240 #define HCI_READ_SECURE_CONNS_SUPPORT           (0x0079 | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
241 #define HCI_WRITE_SECURE_CONNS_SUPPORT          (0x007A | HCI_GRP_HOST_CONT_BASEBAND_CMDS)
242 #define HCI_CONT_BASEBAND_CMDS_FIRST    HCI_SET_EVENT_MASK
243 #define HCI_CONT_BASEBAND_CMDS_LAST     HCI_READ_SYNC_TRAIN_PARAM
244 
245 
246 /* Commands of HCI_GRP_INFORMATIONAL_PARAMS group */
247 #define HCI_READ_LOCAL_VERSION_INFO     (0x0001 | HCI_GRP_INFORMATIONAL_PARAMS)
248 #define HCI_READ_LOCAL_SUPPORTED_CMDS   (0x0002 | HCI_GRP_INFORMATIONAL_PARAMS)
249 #define HCI_READ_LOCAL_FEATURES         (0x0003 | HCI_GRP_INFORMATIONAL_PARAMS)
250 #define HCI_READ_LOCAL_EXT_FEATURES     (0x0004 | HCI_GRP_INFORMATIONAL_PARAMS)
251 #define HCI_READ_BUFFER_SIZE            (0x0005 | HCI_GRP_INFORMATIONAL_PARAMS)
252 #define HCI_READ_COUNTRY_CODE           (0x0007 | HCI_GRP_INFORMATIONAL_PARAMS)
253 #define HCI_READ_BD_ADDR                (0x0009 | HCI_GRP_INFORMATIONAL_PARAMS)
254 #define HCI_READ_DATA_BLOCK_SIZE        (0x000A | HCI_GRP_INFORMATIONAL_PARAMS)
255 #define HCI_READ_LOCAL_SUPPORTED_CODECS (0x000B | HCI_GRP_INFORMATIONAL_PARAMS)
256 
257 #define HCI_INFORMATIONAL_CMDS_FIRST    HCI_READ_LOCAL_VERSION_INFO
258 #define HCI_INFORMATIONAL_CMDS_LAST     HCI_READ_LOCAL_SUPPORTED_CODECS
259 
260 
261 /* Commands of HCI_GRP_STATUS_PARAMS group */
262 #define HCI_READ_FAILED_CONTACT_COUNT   (0x0001 | HCI_GRP_STATUS_PARAMS)
263 #define HCI_RESET_FAILED_CONTACT_COUNT  (0x0002 | HCI_GRP_STATUS_PARAMS)
264 #define HCI_GET_LINK_QUALITY            (0x0003 | HCI_GRP_STATUS_PARAMS)
265 #define HCI_READ_RSSI                   (0x0005 | HCI_GRP_STATUS_PARAMS)
266 #define HCI_READ_AFH_CH_MAP             (0x0006 | HCI_GRP_STATUS_PARAMS)
267 #define HCI_READ_CLOCK                  (0x0007 | HCI_GRP_STATUS_PARAMS)
268 #define HCI_READ_ENCR_KEY_SIZE          (0x0008 | HCI_GRP_STATUS_PARAMS)
269 
270 /* AMP HCI */
271 #define HCI_READ_LOCAL_AMP_INFO         (0x0009 | HCI_GRP_STATUS_PARAMS)
272 #define HCI_READ_LOCAL_AMP_ASSOC        (0x000A | HCI_GRP_STATUS_PARAMS)
273 #define HCI_WRITE_REMOTE_AMP_ASSOC      (0x000B | HCI_GRP_STATUS_PARAMS)
274 
275 #define HCI_STATUS_PARAMS_CMDS_FIRST    HCI_READ_FAILED_CONTACT_COUNT
276 #define HCI_STATUS_PARAMS_CMDS_LAST     HCI_WRITE_REMOTE_AMP_ASSOC
277 
278 /* Commands of HCI_GRP_TESTING_CMDS group */
279 #define HCI_READ_LOOPBACK_MODE          (0x0001 | HCI_GRP_TESTING_CMDS)
280 #define HCI_WRITE_LOOPBACK_MODE         (0x0002 | HCI_GRP_TESTING_CMDS)
281 #define HCI_ENABLE_DEV_UNDER_TEST_MODE  (0x0003 | HCI_GRP_TESTING_CMDS)
282 #define HCI_WRITE_SIMP_PAIR_DEBUG_MODE  (0x0004 | HCI_GRP_TESTING_CMDS)
283 
284 /* AMP HCI */
285 #define HCI_ENABLE_AMP_RCVR_REPORTS     (0x0007 | HCI_GRP_TESTING_CMDS)
286 #define HCI_AMP_TEST_END                (0x0008 | HCI_GRP_TESTING_CMDS)
287 #define HCI_AMP_TEST                    (0x0009 | HCI_GRP_TESTING_CMDS)
288 
289 #define HCI_TESTING_CMDS_FIRST          HCI_READ_LOOPBACK_MODE
290 #define HCI_TESTING_CMDS_LAST           HCI_AMP_TEST
291 
292 #define HCI_VENDOR_CMDS_FIRST           0x0001
293 #define HCI_VENDOR_CMDS_LAST            0xFFFF
294 #define HCI_VSC_MULTI_AV_HANDLE         0x0AAA
295 #define HCI_VSC_BURST_MODE_HANDLE       0x0BBB
296 
297 /* BLE HCI */
298 #define HCI_GRP_BLE_CMDS                (0x08 << 10)
299 /* Commands of BLE Controller setup and configuration */
300 #define HCI_BLE_SET_EVENT_MASK          (0x0001 | HCI_GRP_BLE_CMDS)
301 #define HCI_BLE_READ_BUFFER_SIZE        (0x0002 | HCI_GRP_BLE_CMDS)
302 #define HCI_BLE_READ_LOCAL_SPT_FEAT     (0x0003 | HCI_GRP_BLE_CMDS)
303 #define HCI_BLE_WRITE_LOCAL_SPT_FEAT    (0x0004 | HCI_GRP_BLE_CMDS)
304 #define HCI_BLE_WRITE_RANDOM_ADDR       (0x0005 | HCI_GRP_BLE_CMDS)
305 #define HCI_BLE_WRITE_ADV_PARAMS        (0x0006 | HCI_GRP_BLE_CMDS)
306 #define HCI_BLE_READ_ADV_CHNL_TX_POWER  (0x0007 | HCI_GRP_BLE_CMDS)
307 #define HCI_BLE_WRITE_ADV_DATA          (0x0008 | HCI_GRP_BLE_CMDS)
308 #define HCI_BLE_WRITE_SCAN_RSP_DATA     (0x0009 | HCI_GRP_BLE_CMDS)
309 #define HCI_BLE_WRITE_ADV_ENABLE        (0x000A | HCI_GRP_BLE_CMDS)
310 #define HCI_BLE_WRITE_SCAN_PARAMS       (0x000B | HCI_GRP_BLE_CMDS)
311 #define HCI_BLE_WRITE_SCAN_ENABLE       (0x000C | HCI_GRP_BLE_CMDS)
312 #define HCI_BLE_CREATE_LL_CONN          (0x000D | HCI_GRP_BLE_CMDS)
313 #define HCI_BLE_CREATE_CONN_CANCEL      (0x000E | HCI_GRP_BLE_CMDS)
314 #define HCI_BLE_READ_WHITE_LIST_SIZE    (0x000F | HCI_GRP_BLE_CMDS)
315 #define HCI_BLE_CLEAR_WHITE_LIST        (0x0010 | HCI_GRP_BLE_CMDS)
316 #define HCI_BLE_ADD_WHITE_LIST          (0x0011 | HCI_GRP_BLE_CMDS)
317 #define HCI_BLE_REMOVE_WHITE_LIST       (0x0012 | HCI_GRP_BLE_CMDS)
318 #define HCI_BLE_UPD_LL_CONN_PARAMS      (0x0013 | HCI_GRP_BLE_CMDS)
319 #define HCI_BLE_SET_HOST_CHNL_CLASS     (0x0014 | HCI_GRP_BLE_CMDS)
320 #define HCI_BLE_READ_CHNL_MAP           (0x0015 | HCI_GRP_BLE_CMDS)
321 #define HCI_BLE_READ_REMOTE_FEAT        (0x0016 | HCI_GRP_BLE_CMDS)
322 #define HCI_BLE_ENCRYPT                 (0x0017 | HCI_GRP_BLE_CMDS)
323 #define HCI_BLE_RAND                    (0x0018 | HCI_GRP_BLE_CMDS)
324 #define HCI_BLE_START_ENC               (0x0019 | HCI_GRP_BLE_CMDS)
325 #define HCI_BLE_LTK_REQ_REPLY           (0x001A | HCI_GRP_BLE_CMDS)
326 #define HCI_BLE_LTK_REQ_NEG_REPLY       (0x001B | HCI_GRP_BLE_CMDS)
327 #define HCI_BLE_READ_SUPPORTED_STATES   (0x001C | HCI_GRP_BLE_CMDS)
328                             /*0x001D, 0x001E and 0x001F are reserved*/
329 #define HCI_BLE_RECEIVER_TEST           (0x001D | HCI_GRP_BLE_CMDS)
330 #define HCI_BLE_TRANSMITTER_TEST        (0x001E | HCI_GRP_BLE_CMDS)
331 /* BLE TEST COMMANDS */
332 #define HCI_BLE_TEST_END                (0x001F | HCI_GRP_BLE_CMDS)
333 #define HCI_BLE_RC_PARAM_REQ_REPLY      (0x0020 | HCI_GRP_BLE_CMDS)
334 #define HCI_BLE_RC_PARAM_REQ_NEG_REPLY  (0x0021 | HCI_GRP_BLE_CMDS)
335 
336 #define HCI_BLE_SET_DATA_LENGTH             (0x0022 | HCI_GRP_BLE_CMDS)
337 #define HCI_BLE_READ_DEFAULT_DATA_LENGTH    (0x0023 | HCI_GRP_BLE_CMDS)
338 #define HCI_BLE_WRITE_DEFAULT_DATA_LENGTH   (0x0024 | HCI_GRP_BLE_CMDS)
339 
340 #define HCI_BLE_ADD_DEV_RESOLVING_LIST      (0x0027 | HCI_GRP_BLE_CMDS)
341 #define HCI_BLE_RM_DEV_RESOLVING_LIST       (0x0028 | HCI_GRP_BLE_CMDS)
342 #define HCI_BLE_CLEAR_RESOLVING_LIST        (0x0029 | HCI_GRP_BLE_CMDS)
343 #define HCI_BLE_READ_RESOLVING_LIST_SIZE    (0x002A | HCI_GRP_BLE_CMDS)
344 #define HCI_BLE_READ_RESOLVABLE_ADDR_PEER   (0x002B | HCI_GRP_BLE_CMDS)
345 #define HCI_BLE_READ_RESOLVABLE_ADDR_LOCAL  (0x002C | HCI_GRP_BLE_CMDS)
346 #define HCI_BLE_SET_ADDR_RESOLUTION_ENABLE  (0x002D | HCI_GRP_BLE_CMDS)
347 #define HCI_BLE_SET_RAND_PRIV_ADDR_TIMOUT   (0x002E | HCI_GRP_BLE_CMDS)
348 
349 /* LE Get Vendor Capabilities Command OCF */
350 #define HCI_BLE_VENDOR_CAP_OCF    (0x0153 | HCI_GRP_VENDOR_SPECIFIC)
351 
352 /* Multi adv OCF */
353 #define HCI_BLE_MULTI_ADV_OCF     (0x0154 | HCI_GRP_VENDOR_SPECIFIC)
354 
355 /* Batch scan OCF */
356 #define HCI_BLE_BATCH_SCAN_OCF    (0x0156 | HCI_GRP_VENDOR_SPECIFIC)
357 
358 /* ADV filter OCF */
359 #define HCI_BLE_ADV_FILTER_OCF    (0x0157 | HCI_GRP_VENDOR_SPECIFIC)
360 
361 /* Tracking OCF */
362 #define HCI_BLE_TRACK_ADV_OCF     (0x0158 | HCI_GRP_VENDOR_SPECIFIC)
363 
364 /* Energy info OCF */
365 #define HCI_BLE_ENERGY_INFO_OCF   (0x0159 | HCI_GRP_VENDOR_SPECIFIC)
366 
367 /* Extended BLE Scan parameters OCF */
368 #define HCI_BLE_EXTENDED_SCAN_PARAMS_OCF  (0x0160 | HCI_GRP_VENDOR_SPECIFIC)
369 
370 /* subcode for multi adv feature */
371 #define BTM_BLE_MULTI_ADV_SET_PARAM                     0x01
372 #define BTM_BLE_MULTI_ADV_WRITE_ADV_DATA                0x02
373 #define BTM_BLE_MULTI_ADV_WRITE_SCAN_RSP_DATA           0x03
374 #define BTM_BLE_MULTI_ADV_SET_RANDOM_ADDR               0x04
375 #define BTM_BLE_MULTI_ADV_ENB                           0x05
376 
377 /* multi adv VSE subcode */
378 #define HCI_VSE_SUBCODE_BLE_MULTI_ADV_ST_CHG       0x55 /* multi adv instance state change */
379 
380 /* subcode for batch scan feature */
381 #define BTM_BLE_BATCH_SCAN_ENB_DISAB_CUST_FEATURE      0x01
382 #define BTM_BLE_BATCH_SCAN_SET_STORAGE_PARAM           0x02
383 #define BTM_BLE_BATCH_SCAN_SET_PARAMS                  0x03
384 #define BTM_BLE_BATCH_SCAN_READ_RESULTS                0x04
385 
386 /* batch scan VSE subcode */
387 #define HCI_VSE_SUBCODE_BLE_THRESHOLD_SUB_EVT      0x54 /* Threshold event */
388 
389 /* tracking sub event */
390 #define HCI_VSE_SUBCODE_BLE_TRACKING_SUB_EVT       0x56 /* Tracking event */
391 
392 /* LE supported states definition */
393 #define HCI_LE_ADV_STATE          0x00000001
394 #define HCI_LE_SCAN_STATE         0x00000002
395 #define HCI_LE_INIT_STATE         0x00000004
396 #define HCI_LE_CONN_SL_STATE      0x00000008
397 #define HCI_LE_ADV_SCAN_STATE     0x00000010
398 #define HCI_LE_ADV_INIT_STATE     0x00000020
399 #define HCI_LE_ADV_MA_STATE       0x00000040
400 #define HCI_LE_ADV_SL_STATE       0x00000080
401 #define HCI_LE_SCAN_INIT_STATE    0x00000100
402 #define HCI_LE_SCAN_MA_STATE      0x00000200
403 #define HCI_LE_SCAN_SL_STATE      0x00000400
404 #define HCI_LE_INIT_MA_STATE      0x00000800
405 
406 /* LE Supported States */
407 /* Non Connectable Adv state is supported. 0x0000000000000001 */
408 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_MASK          0x01
409 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_OFF           0
410 #define HCI_LE_STATES_NON_CONN_ADV_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_ADV_OFF] & HCI_SUPP_LE_STATES_NON_CONN_ADV_MASK)
411 
412 /*Scanneable Connectable Adv state  is supported. 0x0000000000000002 */
413 #define HCI_SUPP_LE_STATES_SCAN_ADV_MASK          0x02
414 #define HCI_SUPP_LE_STATESSCAN_ADV_OFF           0
415 #define HCI_LE_STATES_SCAN_ADV_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATESSCAN_ADV_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_MASK)
416 
417 /* Connectable Adv state is supported. 0x0000000000000004 */
418 #define HCI_SUPP_LE_STATES_CONN_ADV_MASK          0x04
419 #define HCI_SUPP_LE_STATES_CONN_ADV_OFF           0
420 #define HCI_LE_STATES_CONN_ADV_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_MASK)
421 
422 /* Hi duty Cycle Directed Adv state is supported. 0x0000000000000008 */
423 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASK          0x08
424 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_OFF           0
425 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_OFF] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASK)
426 
427 /* Passive Scan state is supported. 0x0000000000000010 */
428 #define HCI_SUPP_LE_STATES_PASS_SCAN_MASK          0x10
429 #define HCI_SUPP_LE_STATES_PASS_SCAN_OFF           0
430 #define HCI_LE_STATES_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_PASS_SCAN_OFF] & HCI_SUPP_LE_STATES_PASS_SCAN_MASK)
431 
432 /* Active Scan state is supported. 0x0000000000000020 */
433 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASK          0x20
434 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_OFF           0
435 #define HCI_LE_STATES_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_ACTIVE_SCAN_OFF] & HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASK)
436 
437 /* Initiating state is supported. 0x0000000000000040 (or connection state in master role is also supported) */
438 #define HCI_SUPP_LE_STATES_INIT_MASK          0x40
439 #define HCI_SUPP_LE_STATES_INIT_OFF           0
440 #define HCI_LE_STATES_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_INIT_OFF] & HCI_SUPP_LE_STATES_INIT_MASK)
441 
442 /*connection state in slave  role is also supported. 0x0000000000000080 */
443 #define HCI_SUPP_LE_STATES_SLAVE_MASK          0x80
444 #define HCI_SUPP_LE_STATES_SLAVE_OFF           0
445 #define HCI_LE_STATES_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SLAVE_OFF] & HCI_SUPP_LE_STATES_SLAVE_MASK)
446 
447 /* Non Connectable Adv state and Passive Scanning State combination is supported. 0x0000000000000100 */
448 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_PASS_SCAN_MASK          0x01
449 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_PASS_SCAN_OFF           1
450 #define HCI_LE_STATES_NON_CONN_ADV_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_ADV_PASS_SCAN_OFF] & HCI_SUPP_LE_STATES_NON_CONN_ADV_PASS_SCAN_MASK)
451 
452 /*Scannable Adv state and Passive Scanning State combination is supported. 0x0000000000000200 */
453 #define HCI_SUPP_LE_STATES_SCAN_ADV_PASS_SCAN_MASK          0x02
454 #define HCI_SUPP_LE_STATES_SCAN_ADV_PASS_SCAN_OFF           1
455 #define HCI_LE_STATES_SCAN_ADV_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SCAN_ADV_PASS_SCAN_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_PASS_SCAN_MASK)
456 
457 /*Connectable Adv state and Passive Scanning State combination is supported. 0x0000000000000400 */
458 #define HCI_SUPP_LE_STATES_CONN_ADV_PASS_SCAN_MASK          0x04
459 #define HCI_SUPP_LE_STATES_CONN_ADV_PASS_SCAN_OFF           1
460 #define HCI_LE_STATES_CONN_ADV_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_PASS_SCAN_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_PASS_SCAN_MASK)
461 
462 /*High Duty Cycl Directed ADv and Passive Scanning State combination is supported. 0x0000000000000800 */
463 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_MASK          0x08
464 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_OFF           1
465 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_MASK] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_OFF)
466 
467 /*Non Connectable Adv state and Passive Scanning State combination is supported. 0x0000000000001000 */
468 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_MASK          0x10
469 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_OFF           1
470 #define HCI_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_OFF] & HCI_SUPP_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_MASK)
471 
472 /*Scannable Adv state and Active Scanning State combination is supported. 0x0000000000002000 */
473 #define HCI_SUPP_LE_STATES_SCAN_ADV_ACTIVE_SCAN_MASK          0x20
474 #define HCI_SUPP_LE_STATES_SCAN_ADV_ACTIVE_SCAN_OFF           1
475 #define HCI_LE_STATES_SCAN_ADV_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SCAN_ADV_ACTIVE_SCAN_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_ACTIVE_SCAN_MASK)
476 
477 /*Connectable Adv state and Active Scanning State combination is supported. 0x0000000000004000 */
478 #define HCI_SUPP_LE_STATES_CONN_ADV_ACTIVE_SCAN_MASK          0x40
479 #define HCI_SUPP_LE_STATES_CONN_ADV_ACTIVE_SCAN_OFF           1
480 #define HCI_LE_STATES_CONN_ADV_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_ACTIVE_SCAN_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_ACTIVE_SCAN_MASK)
481 
482 /*High Duty Cycl Directed ADv and ACtive Scanning State combination is supported. 0x0000000000008000 */
483 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_MASK          0x80
484 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_OFF           1
485 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_MASK] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_OFF)
486 
487 /*Non-Connectable Adv state and Initiating State combination is supported. 0x0000000000010000 */
488 #define HCI_SUPP_LE_STATES_NON_CONN_INIT_MASK          0x01
489 #define HCI_SUPP_LE_STATES_NON_CONN_INIT_OFF           2
490 #define HCI_LE_STATES_NON_CONN_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_INIT_OFF] & HCI_SUPP_LE_STATES_NON_CONN_INIT_MASK)
491 
492 /* Scannable Adv state and Initiating State combination is supported. 0x0000000000020000 */
493 #define HCI_SUPP_LE_STATES_SCAN_ADV_INIT_MASK          0x02
494 #define HCI_SUPP_LE_STATES_SCAN_ADV_INIT_OFF           2
495 #define HCI_LE_STATES_SCAN_ADV_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SCAN_ADV_INIT_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_INIT_MASK)
496 
497 /* Non-Connectable Adv state and Master Role combination is supported. 0x0000000000040000 */
498 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_MASTER_MASK          0x04
499 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_MASTER_OFF           2
500 #define HCI_LE_STATES_NON_CONN_ADV_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_ADV_MASTER_OFF] & HCI_SUPP_LE_STATES_NON_CONN_ADV_MASTER_MASK)
501 
502 /*Scannable Adv state and Master Role combination is supported. 0x0000000000040000 */
503 #define HCI_SUPP_LE_STATES_SCAN_ADV_MASTER_MASK          0x08
504 #define HCI_SUPP_LE_STATES_SCAN_ADV_MASTER_OFF           2
505 #define HCI_LE_STATES_SCAN_ADV_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SCAN_ADV_MASTER_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_MASTER_MASK)
506 
507 /* Non-Connectable Adv and Slave Role combination is supported. 0x000000000100000 */
508 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_SLAVE_MASK          0x10
509 #define HCI_SUPP_LE_STATES_NON_CONN_ADV_SLAVE_OFF           2
510 #define HCI_LE_STATES_NON_CONN_ADV_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_NON_CONN_ADV_SLAVE_OFF] & HCI_SUPP_LE_STATES_NON_CONN_ADV_SLAVE_MASK)
511 
512 /*Scannable Adv and Slave Role combination is supported. 0x000000000200000 */
513 #define HCI_SUPP_LE_STATES_SCAN_ADV_SLAVE_MASK          0x20
514 #define HCI_SUPP_LE_STATES_SCAN_ADV_SLAVE_OFF           2
515 #define HCI_LE_STATES_SCAN_ADV_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_SCAN_ADV_SLAVE_OFF] & HCI_SUPP_LE_STATES_SCAN_ADV_SLAVE_MASK)
516 
517 /*Passive Scan and Initiating State combination is supported. 0x000000000400000 */
518 #define HCI_SUPP_LE_STATES_PASS_SCAN_INIT_MASK          0x40
519 #define HCI_SUPP_LE_STATES_PASS_SCAN_INIT_OFF           2
520 #define HCI_LE_STATES_PASS_SCAN_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_PASS_SCAN_INIT_OFF] & HCI_SUPP_LE_STATES_PASS_SCAN_INIT_MASK)
521 
522 /*Active Scan and Initiating State combination is supported. 0x000000000800000 */
523 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_INIT_MASK          0x80
524 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_INIT_OFF           2
525 #define HCI_LE_STATES_ACTIVE_SCAN_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_ACTIVE_SCAN_INIT_OFF] & HCI_SUPP_LE_STATES_ACTIVE_SCAN_INIT_MASK)
526 
527 /*Passive Scan and Master Role combination is supported. 0x000000001000000 */
528 #define HCI_SUPP_LE_STATES_PASS_SCAN_MASTER_MASK          0x01
529 #define HCI_SUPP_LE_STATES_PASS_SCAN_MASTER_OFF           3
530 #define HCI_LE_STATES_PASS_SCAN_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_PASS_SCAN_MASTER_OFF] & HCI_SUPP_LE_STATES_PASS_SCAN_MASTER_MASK)
531 
532 /*Active Scan and Master Role combination is supported. 0x000000002000000 */
533 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASTER_MASK          0x02
534 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASTER_OFF           3
535 #define HCI_LE_STATES_ACTIVE_SCAN_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASTER_OFF] & HCI_SUPP_LE_STATES_ACTIVE_SCAN_MASTER_MASK)
536 
537 /*Passive Scan and Slave Role combination is supported. 0x000000004000000 */
538 #define HCI_SUPP_LE_STATES_PASS_SCAN_SLAVE_MASK          0x04
539 #define HCI_SUPP_LE_STATES_PASS_SCAN_SLAVE_OFF           3
540 #define HCI_LE_STATES_PASS_SCAN_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_PASS_SCAN_SLAVE_OFF] & HCI_SUPP_LE_STATES_PASS_SCAN_SLAVE_MASK)
541 
542 /*Active Scan and Slave Role combination is supported. 0x000000008000000 */
543 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_SLAVE_MASK          0x08
544 #define HCI_SUPP_LE_STATES_ACTIVE_SCAN_SLAVE_OFF           3
545 #define HCI_LE_STATES_ACTIVE_SCAN_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_ACTIVE_SCAN_SLAVE_OFF] & HCI_SUPP_LE_STATES_ACTIVE_SCAN_SLAVE_MASK)
546 
547 /*Link Layer Topology Added States Combo */
548 /*Initiating State and Master Role combination supported.
549   Master Role and Master Role combination is also supported. 0x0000000010000000 */
550 #define HCI_SUPP_LE_STATES_INIT_MASTER_MASK          0x10
551 #define HCI_SUPP_LE_STATES_INIT_MASTER_OFF           3
552 #define HCI_LE_STATES_INIT_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_INIT_MASTER_OFF] & HCI_SUPP_LE_STATES_INIT_MASTER_MASK)
553 
554 /*Low Duty Cycle Directed Advertising State . 0x0000000020000000 */
555 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_MASK          0x20
556 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_OFF           3
557 #define HCI_LE_STATES_LOW_DUTY_DIR_ADV_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LOW_DUTY_DIR_ADV_OFF] & HCI_SUPP_LE_STATES_LOW_DUTY_DIR_ADV_MASK)
558 
559 /*Low Duty Cycle Directed Advertising State and Passive scan combination. 0x0000000040000000 */
560 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_MASK          0x40
561 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_OFF           3
562 #define HCI_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_OFF] & HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_MASK)
563 
564 /*Low Duty Cycle Directed Advertising State and Active scan combination . 0x0000000080000000 */
565 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_MASK          0x80
566 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_OFF           3
567 #define HCI_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_OFF] & HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_MASK)
568 
569 /* Connectable Advertising State and Initiating State combination supported. 0x0000000100000000 */
570 #define HCI_SUPP_LE_STATES_CONN_ADV_INIT_MASK          0x01
571 #define HCI_SUPP_LE_STATES_CONN_ADV_INIT_OFF           4
572 #define HCI_LE_STATES_CONN_ADV_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_INIT_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_INIT_MASK)
573 
574 /* High Duty Cycle Directed Advertising State and Initiating State combination supported. */
575 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_INIT_MASK          0x02
576 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_INIT_OFF           4
577 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_INIT_OFF] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_INIT_MASK)
578 
579 /* Low Duty Cycle Directed Advertising State and Initiating State combination supported.*/
580 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_INIT_MASK          0x04
581 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_INIT_OFF           4
582 #define HCI_LE_STATES_LO_DUTY_DIR_ADV_INIT_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_INIT_OFF] & HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_INIT_MASK)
583 
584 /* Connectable Advertising State and Master Role combination supported.*/
585 #define HCI_SUPP_LE_STATES_CONN_ADV_MASTER_MASK          0x08
586 #define HCI_SUPP_LE_STATES_CONN_ADV_MASTER_OFF           4
587 #define HCI_LE_STATES_CONN_ADV_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_MASTER_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_MASTER_MASK)
588 
589 /* High Duty Cycle Directed Advertising State and Master Role combination supported.*/
590 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASTER_MASK          0x10
591 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASTER_OFF           4
592 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASTER_OFF] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_MASTER_MASK)
593 
594 /* Low Duty Cycle Directed Advertising State and Master Role combination supported.*/
595 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_MASTER_MASK          0x20
596 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_MASTER_OFF           4
597 #define HCI_LE_STATES_LO_DUTY_DIR_ADV_MASTER_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_MASTER_OFF] & HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_MASTER_MASK)
598 
599 /* Connectable Advertising State and Slave Role combination supported. */
600 #define HCI_SUPP_LE_STATES_CONN_ADV_SLAVE_MASK          0x40
601 #define HCI_SUPP_LE_STATES_CONN_ADV_SLAVE_OFF           4
602 #define HCI_LE_STATES_CONN_ADV_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_CONN_ADV_SLAVE_OFF] & HCI_SUPP_LE_STATES_CONN_ADV_SLAVE_MASK)
603 
604 /* High Duty Cycle Directed Advertising State and slave Role combination supported.*/
605 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_SLAVE_MASK          0x80
606 #define HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_SLAVE_OFF           4
607 #define HCI_LE_STATES_HI_DUTY_DIR_ADV_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_SLAVE_OFF] & HCI_SUPP_LE_STATES_HI_DUTY_DIR_ADV_SLAVE_MASK)
608 
609 /* Low Duty Cycle Directed Advertising State and slave Role combination supported.*/
610 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_SLAVE_MASK          0x01
611 #define HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_SLAVE_OFF           5
612 #define HCI_LE_STATES_LO_DUTY_DIR_ADV_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_SLAVE_OFF] & HCI_SUPP_LE_STATES_LO_DUTY_DIR_ADV_SLAVE_MASK)
613 
614 /* Initiating State and Slave Role combination supported.
615    Master Role and Slave Role combination also supported.
616  */
617 #define HCI_SUPP_LE_STATES_INIT_MASTER_SLAVE_MASK          0x02
618 #define HCI_SUPP_LE_STATES_INIT_MASTER_SLAVE_OFF           5
619 #define HCI_LE_STATES_INIT_MASTER_SLAVE_SUPPORTED(x)      ((x)[HCI_SUPP_LE_STATES_INIT_MASTER_SLAVE_OFF] & HCI_SUPP_LE_STATES_INIT_MASTER_SLAVE_MASK)
620 
621 /*
622 **  Definitions for HCI Events
623 */
624 #define HCI_INQUIRY_COMP_EVT                0x01
625 #define HCI_INQUIRY_RESULT_EVT              0x02
626 #define HCI_CONNECTION_COMP_EVT             0x03
627 #define HCI_CONNECTION_REQUEST_EVT          0x04
628 #define HCI_DISCONNECTION_COMP_EVT          0x05
629 #define HCI_AUTHENTICATION_COMP_EVT         0x06
630 #define HCI_RMT_NAME_REQUEST_COMP_EVT       0x07
631 #define HCI_ENCRYPTION_CHANGE_EVT           0x08
632 #define HCI_CHANGE_CONN_LINK_KEY_EVT        0x09
633 #define HCI_MASTER_LINK_KEY_COMP_EVT        0x0A
634 #define HCI_READ_RMT_FEATURES_COMP_EVT      0x0B
635 #define HCI_READ_RMT_VERSION_COMP_EVT       0x0C
636 #define HCI_QOS_SETUP_COMP_EVT              0x0D
637 #define HCI_COMMAND_COMPLETE_EVT            0x0E
638 #define HCI_COMMAND_STATUS_EVT              0x0F
639 #define HCI_HARDWARE_ERROR_EVT              0x10
640 #define HCI_FLUSH_OCCURED_EVT               0x11
641 #define HCI_ROLE_CHANGE_EVT                 0x12
642 #define HCI_NUM_COMPL_DATA_PKTS_EVT         0x13
643 #define HCI_MODE_CHANGE_EVT                 0x14
644 #define HCI_RETURN_LINK_KEYS_EVT            0x15
645 #define HCI_PIN_CODE_REQUEST_EVT            0x16
646 #define HCI_LINK_KEY_REQUEST_EVT            0x17
647 #define HCI_LINK_KEY_NOTIFICATION_EVT       0x18
648 #define HCI_LOOPBACK_COMMAND_EVT            0x19
649 #define HCI_DATA_BUF_OVERFLOW_EVT           0x1A
650 #define HCI_MAX_SLOTS_CHANGED_EVT           0x1B
651 #define HCI_READ_CLOCK_OFF_COMP_EVT         0x1C
652 #define HCI_CONN_PKT_TYPE_CHANGE_EVT        0x1D
653 #define HCI_QOS_VIOLATION_EVT               0x1E
654 #define HCI_PAGE_SCAN_MODE_CHANGE_EVT       0x1F
655 #define HCI_PAGE_SCAN_REP_MODE_CHNG_EVT     0x20
656 #define HCI_FLOW_SPECIFICATION_COMP_EVT     0x21
657 #define HCI_INQUIRY_RSSI_RESULT_EVT         0x22
658 #define HCI_READ_RMT_EXT_FEATURES_COMP_EVT  0x23
659 #define HCI_ESCO_CONNECTION_COMP_EVT        0x2C
660 #define HCI_ESCO_CONNECTION_CHANGED_EVT     0x2D
661 #define HCI_SNIFF_SUB_RATE_EVT              0x2E
662 #define HCI_EXTENDED_INQUIRY_RESULT_EVT     0x2F
663 #define HCI_ENCRYPTION_KEY_REFRESH_COMP_EVT 0x30
664 #define HCI_IO_CAPABILITY_REQUEST_EVT       0x31
665 #define HCI_IO_CAPABILITY_RESPONSE_EVT      0x32
666 #define HCI_USER_CONFIRMATION_REQUEST_EVT   0x33
667 #define HCI_USER_PASSKEY_REQUEST_EVT        0x34
668 #define HCI_REMOTE_OOB_DATA_REQUEST_EVT     0x35
669 #define HCI_SIMPLE_PAIRING_COMPLETE_EVT     0x36
670 #define HCI_LINK_SUPER_TOUT_CHANGED_EVT     0x38
671 #define HCI_ENHANCED_FLUSH_COMPLETE_EVT     0x39
672 #define HCI_USER_PASSKEY_NOTIFY_EVT         0x3B
673 #define HCI_KEYPRESS_NOTIFY_EVT             0x3C
674 #define HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT    0x3D
675 
676 /*#define HCI_GENERIC_AMP_LINK_KEY_NOTIF_EVT  0x3E Removed from spec */
677 #define HCI_PHYSICAL_LINK_COMP_EVT          0x40
678 #define HCI_CHANNEL_SELECTED_EVT            0x41
679 #define HCI_DISC_PHYSICAL_LINK_COMP_EVT     0x42
680 #define HCI_PHY_LINK_LOSS_EARLY_WARNING_EVT 0x43
681 #define HCI_PHY_LINK_RECOVERY_EVT           0x44
682 #define HCI_LOGICAL_LINK_COMP_EVT           0x45
683 #define HCI_DISC_LOGICAL_LINK_COMP_EVT      0x46
684 #define HCI_FLOW_SPEC_MODIFY_COMP_EVT       0x47
685 #define HCI_NUM_COMPL_DATA_BLOCKS_EVT       0x48
686 #define HCI_SHORT_RANGE_MODE_COMPLETE_EVT   0x4C
687 #define HCI_AMP_STATUS_CHANGE_EVT           0x4D
688 #define HCI_SET_TRIGGERED_CLOCK_CAPTURE_EVT 0x4E
689 
690 /* ULP HCI Event */
691 #define HCI_BLE_EVENT                       0x3e
692 /* ULP Event sub code */
693 #define HCI_BLE_CONN_COMPLETE_EVT           0x01
694 #define HCI_BLE_ADV_PKT_RPT_EVT             0x02
695 #define HCI_BLE_LL_CONN_PARAM_UPD_EVT       0x03
696 #define HCI_BLE_READ_REMOTE_FEAT_CMPL_EVT   0x04
697 #define HCI_BLE_LTK_REQ_EVT                 0x05
698 #define HCI_BLE_RC_PARAM_REQ_EVT            0x06
699 #define HCI_BLE_DATA_LENGTH_CHANGE_EVT      0x07
700 #define HCI_BLE_ENHANCED_CONN_COMPLETE_EVT  0x0a
701 #define HCI_BLE_DIRECT_ADV_EVT              0x0b
702 
703 /* Definitions for LE Channel Map */
704 #define HCI_BLE_CHNL_MAP_SIZE               5
705 
706 #define HCI_VENDOR_SPECIFIC_EVT         0xFF  /* Vendor specific events */
707 #define HCI_NAP_TRACE_EVT               0xFF  /* was define 0xFE, 0xFD, change to 0xFF
708                                                  because conflict w/ TCI_EVT and per
709                                                  specification compliant */
710 
711 /*
712 **  Defentions for HCI Error Codes that are past in the events
713 */
714 #define HCI_SUCCESS                                     0x00
715 #define HCI_PENDING                                     0x00
716 #define HCI_ERR_ILLEGAL_COMMAND                         0x01
717 #define HCI_ERR_NO_CONNECTION                           0x02
718 #define HCI_ERR_HW_FAILURE                              0x03
719 #define HCI_ERR_PAGE_TIMEOUT                            0x04
720 #define HCI_ERR_AUTH_FAILURE                            0x05
721 #define HCI_ERR_KEY_MISSING                             0x06
722 #define HCI_ERR_MEMORY_FULL                             0x07
723 #define HCI_ERR_CONNECTION_TOUT                         0x08
724 #define HCI_ERR_MAX_NUM_OF_CONNECTIONS                  0x09
725 #define HCI_ERR_MAX_NUM_OF_SCOS                         0x0A
726 #define HCI_ERR_CONNECTION_EXISTS                       0x0B
727 #define HCI_ERR_COMMAND_DISALLOWED                      0x0C
728 #define HCI_ERR_HOST_REJECT_RESOURCES                   0x0D
729 #define HCI_ERR_HOST_REJECT_SECURITY                    0x0E
730 #define HCI_ERR_HOST_REJECT_DEVICE                      0x0F
731 #define HCI_ERR_HOST_TIMEOUT                            0x10
732 #define HCI_ERR_UNSUPPORTED_VALUE                       0x11
733 #define HCI_ERR_ILLEGAL_PARAMETER_FMT                   0x12
734 #define HCI_ERR_PEER_USER                               0x13
735 #define HCI_ERR_PEER_LOW_RESOURCES                      0x14
736 #define HCI_ERR_PEER_POWER_OFF                          0x15
737 #define HCI_ERR_CONN_CAUSE_LOCAL_HOST                   0x16
738 #define HCI_ERR_REPEATED_ATTEMPTS                       0x17
739 #define HCI_ERR_PAIRING_NOT_ALLOWED                     0x18
740 #define HCI_ERR_UNKNOWN_LMP_PDU                         0x19
741 #define HCI_ERR_UNSUPPORTED_REM_FEATURE                 0x1A
742 #define HCI_ERR_SCO_OFFSET_REJECTED                     0x1B
743 #define HCI_ERR_SCO_INTERVAL_REJECTED                   0x1C
744 #define HCI_ERR_SCO_AIR_MODE                            0x1D
745 #define HCI_ERR_INVALID_LMP_PARAM                       0x1E
746 #define HCI_ERR_UNSPECIFIED                             0x1F
747 #define HCI_ERR_UNSUPPORTED_LMP_FEATURE                 0x20
748 #define HCI_ERR_ROLE_CHANGE_NOT_ALLOWED                 0x21
749 #define HCI_ERR_LMP_RESPONSE_TIMEOUT                    0x22
750 #define HCI_ERR_LMP_ERR_TRANS_COLLISION                 0x23
751 #define HCI_ERR_LMP_PDU_NOT_ALLOWED                     0x24
752 #define HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE               0x25
753 #define HCI_ERR_UNIT_KEY_USED                           0x26
754 #define HCI_ERR_QOS_NOT_SUPPORTED                       0x27
755 #define HCI_ERR_INSTANT_PASSED                          0x28
756 #define HCI_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED     0x29
757 #define HCI_ERR_DIFF_TRANSACTION_COLLISION              0x2A
758 #define HCI_ERR_UNDEFINED_0x2B                          0x2B
759 #define HCI_ERR_QOS_UNACCEPTABLE_PARAM                  0x2C
760 #define HCI_ERR_QOS_REJECTED                            0x2D
761 #define HCI_ERR_CHAN_CLASSIF_NOT_SUPPORTED              0x2E
762 #define HCI_ERR_INSUFFCIENT_SECURITY                    0x2F
763 #define HCI_ERR_PARAM_OUT_OF_RANGE                      0x30
764 #define HCI_ERR_UNDEFINED_0x31                          0x31
765 #define HCI_ERR_ROLE_SWITCH_PENDING                     0x32
766 #define HCI_ERR_UNDEFINED_0x33                          0x33
767 #define HCI_ERR_RESERVED_SLOT_VIOLATION                 0x34
768 #define HCI_ERR_ROLE_SWITCH_FAILED                      0x35
769 #define HCI_ERR_INQ_RSP_DATA_TOO_LARGE                  0x36
770 #define HCI_ERR_SIMPLE_PAIRING_NOT_SUPPORTED            0x37
771 #define HCI_ERR_HOST_BUSY_PAIRING                       0x38
772 #define HCI_ERR_REJ_NO_SUITABLE_CHANNEL                 0x39
773 #define HCI_ERR_CONTROLLER_BUSY                         0x3A
774 #define HCI_ERR_UNACCEPT_CONN_INTERVAL                  0x3B
775 #define HCI_ERR_DIRECTED_ADVERTISING_TIMEOUT            0x3C
776 #define HCI_ERR_CONN_TOUT_DUE_TO_MIC_FAILURE            0x3D
777 #define HCI_ERR_CONN_FAILED_ESTABLISHMENT               0x3E
778 #define HCI_ERR_MAC_CONNECTION_FAILED                   0x3F
779 
780 /* ConnectionLess Broadcast errors */
781 #define HCI_ERR_LT_ADDR_ALREADY_IN_USE                  0x40
782 #define HCI_ERR_LT_ADDR_NOT_ALLOCATED                   0x41
783 #define HCI_ERR_CLB_NOT_ENABLED                         0x42
784 #define HCI_ERR_CLB_DATA_TOO_BIG                        0x43
785 
786 #define HCI_ERR_MAX_ERR                                 0x43
787 
788 #define HCI_HINT_TO_RECREATE_AMP_PHYS_LINK              0xFF
789 
790 /*
791 ** Definitions for HCI enable event
792 */
793 #define HCI_INQUIRY_COMPLETE_EV(p)          (*((UINT32 *)(p)) & 0x00000001)
794 #define HCI_INQUIRY_RESULT_EV(p)            (*((UINT32 *)(p)) & 0x00000002)
795 #define HCI_CONNECTION_COMPLETE_EV(p)       (*((UINT32 *)(p)) & 0x00000004)
796 #define HCI_CONNECTION_REQUEST_EV(p)        (*((UINT32 *)(p)) & 0x00000008)
797 #define HCI_DISCONNECTION_COMPLETE_EV(p)    (*((UINT32 *)(p)) & 0x00000010)
798 #define HCI_AUTHENTICATION_COMPLETE_EV(p)   (*((UINT32 *)(p)) & 0x00000020)
799 #define HCI_RMT_NAME_REQUEST_COMPL_EV(p)    (*((UINT32 *)(p)) & 0x00000040)
800 #define HCI_CHANGE_CONN_ENCRPT_ENABLE_EV(p) (*((UINT32 *)(p)) & 0x00000080)
801 #define HCI_CHANGE_CONN_LINK_KEY_EV(p)      (*((UINT32 *)(p)) & 0x00000100)
802 #define HCI_MASTER_LINK_KEY_COMPLETE_EV(p)  (*((UINT32 *)(p)) & 0x00000200)
803 #define HCI_READ_RMT_FEATURES_COMPL_EV(p)   (*((UINT32 *)(p)) & 0x00000400)
804 #define HCI_READ_RMT_VERSION_COMPL_EV(p)    (*((UINT32 *)(p)) & 0x00000800)
805 #define HCI_QOS_SETUP_COMPLETE_EV(p)        (*((UINT32 *)(p)) & 0x00001000)
806 #define HCI_COMMAND_COMPLETE_EV(p)          (*((UINT32 *)(p)) & 0x00002000)
807 #define HCI_COMMAND_STATUS_EV(p)            (*((UINT32 *)(p)) & 0x00004000)
808 #define HCI_HARDWARE_ERROR_EV(p)            (*((UINT32 *)(p)) & 0x00008000)
809 #define HCI_FLASH_OCCURED_EV(p)             (*((UINT32 *)(p)) & 0x00010000)
810 #define HCI_ROLE_CHANGE_EV(p)               (*((UINT32 *)(p)) & 0x00020000)
811 #define HCI_NUM_COMPLETED_PKTS_EV(p)        (*((UINT32 *)(p)) & 0x00040000)
812 #define HCI_MODE_CHANGE_EV(p)               (*((UINT32 *)(p)) & 0x00080000)
813 #define HCI_RETURN_LINK_KEYS_EV(p)          (*((UINT32 *)(p)) & 0x00100000)
814 #define HCI_PIN_CODE_REQUEST_EV(p)          (*((UINT32 *)(p)) & 0x00200000)
815 #define HCI_LINK_KEY_REQUEST_EV(p)          (*((UINT32 *)(p)) & 0x00400000)
816 #define HCI_LINK_KEY_NOTIFICATION_EV(p)     (*((UINT32 *)(p)) & 0x00800000)
817 #define HCI_LOOPBACK_COMMAND_EV(p)          (*((UINT32 *)(p)) & 0x01000000)
818 #define HCI_DATA_BUF_OVERFLOW_EV(p)         (*((UINT32 *)(p)) & 0x02000000)
819 #define HCI_MAX_SLOTS_CHANGE_EV(p)          (*((UINT32 *)(p)) & 0x04000000)
820 #define HCI_READ_CLOCK_OFFSET_COMP_EV(p)    (*((UINT32 *)(p)) & 0x08000000)
821 #define HCI_CONN_PKT_TYPE_CHANGED_EV(p)     (*((UINT32 *)(p)) & 0x10000000)
822 #define HCI_QOS_VIOLATION_EV(p)             (*((UINT32 *)(p)) & 0x20000000)
823 #define HCI_PAGE_SCAN_MODE_CHANGED_EV(p)    (*((UINT32 *)(p)) & 0x40000000)
824 #define HCI_PAGE_SCAN_REP_MODE_CHNG_EV(p)   (*((UINT32 *)(p)) & 0x80000000)
825 
826 /* the default event mask for 2.1+EDR (Lisbon) does not include Lisbon events */
827 #define HCI_DEFAULT_EVENT_MASK_0            0xFFFFFFFF
828 #define HCI_DEFAULT_EVENT_MASK_1            0x00001FFF
829 
830 /* the event mask for 2.0 + EDR and later (includes Lisbon events) */
831 #define HCI_LISBON_EVENT_MASK_0             0xFFFFFFFF
832 #define HCI_LISBON_EVENT_MASK_1             0x1DBFFFFF
833 #define HCI_LISBON_EVENT_MASK               "\x0D\xBF\xFF\xFF\xFF\xFF\xFF\xFF"
834 #define HCI_LISBON_EVENT_MASK_EXT           "\x1D\xBF\xFF\xFF\xFF\xFF\xFF\xFF"
835 #define HCI_DUMO_EVENT_MASK_EXT             "\x3D\xBF\xFF\xFF\xFF\xFF\xFF\xFF"
836 /*  0x00001FFF FFFFFFFF Default - no Lisbon events
837     0x00000800 00000000 Synchronous Connection Complete Event
838     0x00001000 00000000 Synchronous Connection Changed Event
839     0x00002000 00000000 Sniff Subrate Event
840     0x00004000 00000000 Extended Inquiry Result Event
841     0x00008000 00000000 Encryption Key Refresh Complete Event
842     0x00010000 00000000 IO Capability Request Event
843     0x00020000 00000000 IO Capability Response Event
844     0x00040000 00000000 User Confirmation Request Event
845     0x00080000 00000000 User Passkey Request Event
846     0x00100000 00000000 Remote OOB Data Request Event
847     0x00200000 00000000 Simple Pairing Complete Event
848     0x00400000 00000000 Generic AMP Link Key Notification Event
849     0x00800000 00000000 Link Supervision Timeout Changed Event
850     0x01000000 00000000 Enhanced Flush Complete Event
851     0x04000000 00000000 User Passkey Notification Event
852     0x08000000 00000000 Keypress Notification Event
853     0x10000000 00000000 Remote Host Supported Features Notification Event
854     0x20000000 00000000 LE Meta Event
855  */
856 
857 
858 /* the event mask for AMP controllers */
859 #define HCI_AMP_EVENT_MASK_3_0               "\x00\x00\x00\x00\x00\x00\x3F\xFF"
860 
861 /*  0x0000000000000000 No events specified (default)
862     0x0000000000000001 Physical Link Complete Event
863     0x0000000000000002 Channel Selected Event
864     0x0000000000000004 Disconnection Physical Link Event
865     0x0000000000000008 Physical Link Loss Early Warning Event
866     0x0000000000000010 Physical Link Recovery Event
867     0x0000000000000020 Logical Link Complete Event
868     0x0000000000000040 Disconnection Logical Link Complete Event
869     0x0000000000000080 Flow Spec Modify Complete Event
870     0x0000000000000100 Number of Completed Data Blocks Event
871     0x0000000000000200 AMP Start Test Event
872     0x0000000000000400 AMP Test End Event
873     0x0000000000000800 AMP Receiver Report Event
874     0x0000000000001000 Short Range Mode Change Complete Event
875     0x0000000000002000 AMP Status Change Event
876 */
877 
878 /* the event mask page 2 (CLB + CSA4) for BR/EDR controller */
879 #define HCI_PAGE_2_EVENT_MASK                  "\x00\x00\x00\x00\x00\x7F\xC0\x00"
880 /*  0x0000000000004000 Triggered Clock Capture Event
881     0x0000000000008000 Sync Train Complete Event
882     0x0000000000010000 Sync Train Received Event
883     0x0000000000020000 Connectionless Broadcast Receive Event
884     0x0000000000040000 Connectionless Broadcast Timeout Event
885     0x0000000000080000 Truncated Page Complete Event
886     0x0000000000100000 Salve Page Response Timeout Event
887     0x0000000000200000 Connectionless Broadcast Channel Map Change Event
888     0x0000000000400000 Inquiry Response Notification Event
889 */
890 #if BLE_PRIVACY_SPT == TRUE
891 /* BLE event mask */
892 #define HCI_BLE_EVENT_MASK_DEF               "\x00\x00\x00\x00\x00\x00\x07\xff"
893 #else
894 #define HCI_BLE_EVENT_MASK_DEF              "\x00\x00\x00\x00\x00\x00\x00\x7f"
895 #endif
896 /*
897 ** Definitions for packet type masks (BT1.2 and BT2.0 definitions)
898 */
899 #define HCI_PKT_TYPES_MASK_NO_2_DH1         0x0002
900 #define HCI_PKT_TYPES_MASK_NO_3_DH1         0x0004
901 #define HCI_PKT_TYPES_MASK_DM1              0x0008
902 #define HCI_PKT_TYPES_MASK_DH1              0x0010
903 #define HCI_PKT_TYPES_MASK_HV1              0x0020
904 #define HCI_PKT_TYPES_MASK_HV2              0x0040
905 #define HCI_PKT_TYPES_MASK_HV3              0x0080
906 #define HCI_PKT_TYPES_MASK_NO_2_DH3         0x0100
907 #define HCI_PKT_TYPES_MASK_NO_3_DH3         0x0200
908 #define HCI_PKT_TYPES_MASK_DM3              0x0400
909 #define HCI_PKT_TYPES_MASK_DH3              0x0800
910 #define HCI_PKT_TYPES_MASK_NO_2_DH5         0x1000
911 #define HCI_PKT_TYPES_MASK_NO_3_DH5         0x2000
912 #define HCI_PKT_TYPES_MASK_DM5              0x4000
913 #define HCI_PKT_TYPES_MASK_DH5              0x8000
914 
915 /* Packet type should be one of valid but at least one should be specified */
916 #define HCI_VALID_SCO_PKT_TYPE(t) (((((t) & ~(HCI_PKT_TYPES_MASK_HV1       \
917                                            |  HCI_PKT_TYPES_MASK_HV2       \
918                                            |  HCI_PKT_TYPES_MASK_HV3)) == 0)) \
919                                     && ((t) != 0))
920 
921 
922 
923 
924 
925 /* Packet type should not be invalid and at least one should be specified */
926 #define HCI_VALID_ACL_PKT_TYPE(t) (((((t) & ~(HCI_PKT_TYPES_MASK_DM1        \
927                                            |  HCI_PKT_TYPES_MASK_DH1        \
928                                            |  HCI_PKT_TYPES_MASK_DM3        \
929                                            |  HCI_PKT_TYPES_MASK_DH3        \
930                                            |  HCI_PKT_TYPES_MASK_DM5        \
931                                            |  HCI_PKT_TYPES_MASK_DH5        \
932                                            |  HCI_PKT_TYPES_MASK_NO_2_DH1   \
933                                            |  HCI_PKT_TYPES_MASK_NO_3_DH1   \
934                                            |  HCI_PKT_TYPES_MASK_NO_2_DH3   \
935                                            |  HCI_PKT_TYPES_MASK_NO_3_DH3   \
936                                            |  HCI_PKT_TYPES_MASK_NO_2_DH5   \
937                                            |  HCI_PKT_TYPES_MASK_NO_3_DH5  )) == 0)) \
938                                     && (((t) &  (HCI_PKT_TYPES_MASK_DM1        \
939                                               |  HCI_PKT_TYPES_MASK_DH1        \
940                                               |  HCI_PKT_TYPES_MASK_DM3        \
941                                               |  HCI_PKT_TYPES_MASK_DH3        \
942                                               |  HCI_PKT_TYPES_MASK_DM5        \
943                                               |  HCI_PKT_TYPES_MASK_DH5)) != 0))
944 
945 /*
946 ** Definitions for eSCO packet type masks (BT1.2 and BT2.0 definitions)
947 */
948 #define HCI_ESCO_PKT_TYPES_MASK_HV1         0x0001
949 #define HCI_ESCO_PKT_TYPES_MASK_HV2         0x0002
950 #define HCI_ESCO_PKT_TYPES_MASK_HV3         0x0004
951 #define HCI_ESCO_PKT_TYPES_MASK_EV3         0x0008
952 #define HCI_ESCO_PKT_TYPES_MASK_EV4         0x0010
953 #define HCI_ESCO_PKT_TYPES_MASK_EV5         0x0020
954 #define HCI_ESCO_PKT_TYPES_MASK_NO_2_EV3    0x0040
955 #define HCI_ESCO_PKT_TYPES_MASK_NO_3_EV3    0x0080
956 #define HCI_ESCO_PKT_TYPES_MASK_NO_2_EV5    0x0100
957 #define HCI_ESCO_PKT_TYPES_MASK_NO_3_EV5    0x0200
958 
959 /* Packet type should be one of valid but at least one should be specified for 1.2 */
960 #define HCI_VALID_ESCO_PKT_TYPE(t) (((((t) & ~(HCI_ESCO_PKT_TYPES_MASK_EV3       \
961                                            |   HCI_ESCO_PKT_TYPES_MASK_EV4       \
962                                            |   HCI_ESCO_PKT_TYPES_MASK_EV5)) == 0)) \
963                                     && ((t) != 0))/* Packet type should be one of valid but at least one should be specified */
964 
965 #define HCI_VALID_ESCO_SCOPKT_TYPE(t) (((((t) & ~(HCI_ESCO_PKT_TYPES_MASK_HV1       \
966                                            |      HCI_ESCO_PKT_TYPES_MASK_HV2       \
967                                            |      HCI_ESCO_PKT_TYPES_MASK_HV3)) == 0)) \
968                                     && ((t) != 0))
969 
970 #define HCI_VALID_SCO_ALL_PKT_TYPE(t) (((((t) & ~(HCI_ESCO_PKT_TYPES_MASK_HV1       \
971                                            |      HCI_ESCO_PKT_TYPES_MASK_HV2       \
972                                            |      HCI_ESCO_PKT_TYPES_MASK_HV3       \
973                                            |      HCI_ESCO_PKT_TYPES_MASK_EV3       \
974                                            |      HCI_ESCO_PKT_TYPES_MASK_EV4       \
975                                            |      HCI_ESCO_PKT_TYPES_MASK_EV5)) == 0)) \
976                                     && ((t) != 0))
977 
978 /*
979 ** Define parameters to allow role switch during create connection
980 */
981 #define HCI_CR_CONN_NOT_ALLOW_SWITCH    0x00
982 #define HCI_CR_CONN_ALLOW_SWITCH        0x01
983 
984 /*
985 ** Hold Mode command destination
986 */
987 #define HOLD_MODE_DEST_LOCAL_DEVICE     0x00
988 #define HOLD_MODE_DEST_RMT_DEVICE       0x01
989 
990 /*
991 **  Definitions for different HCI parameters
992 */
993 #define HCI_PER_INQ_MIN_MAX_PERIOD      0x0003
994 #define HCI_PER_INQ_MAX_MAX_PERIOD      0xFFFF
995 #define HCI_PER_INQ_MIN_MIN_PERIOD      0x0002
996 #define HCI_PER_INQ_MAX_MIN_PERIOD      0xFFFE
997 
998 #define HCI_MAX_INQUIRY_LENGTH          0x30
999 
1000 #define HCI_MIN_INQ_LAP                 0x9E8B00
1001 #define HCI_MAX_INQ_LAP                 0x9E8B3F
1002 
1003 /* HCI role defenitions */
1004 #define HCI_ROLE_MASTER                 0x00
1005 #define HCI_ROLE_SLAVE                  0x01
1006 #define HCI_ROLE_UNKNOWN                0xff
1007 
1008 /* HCI mode defenitions */
1009 #define HCI_MODE_ACTIVE                 0x00
1010 #define HCI_MODE_HOLD                   0x01
1011 #define HCI_MODE_SNIFF                  0x02
1012 #define HCI_MODE_PARK                   0x03
1013 
1014 /* HCI Flow Control Mode defenitions */
1015 #define HCI_PACKET_BASED_FC_MODE        0x00
1016 #define HCI_BLOCK_BASED_FC_MODE         0x01
1017 
1018 /* Define Packet types as requested by the Host */
1019 #define HCI_ACL_PKT_TYPE_NONE           0x0000
1020 #define HCI_ACL_PKT_TYPE_DM1            0x0008
1021 #define HCI_ACL_PKT_TYPE_DH1            0x0010
1022 #define HCI_ACL_PKT_TYPE_AUX1           0x0200
1023 #define HCI_ACL_PKT_TYPE_DM3            0x0400
1024 #define HCI_ACL_PKT_TYPE_DH3            0x0800
1025 #define HCI_ACL_PKT_TYPE_DM5            0x4000
1026 #define HCI_ACL_PKT_TYPE_DH5            0x8000
1027 
1028 /* Define key type in the Master Link Key command */
1029 #define HCI_USE_SEMI_PERMANENT_KEY      0x00
1030 #define HCI_USE_TEMPORARY_KEY           0x01
1031 
1032 /* Page scan period modes */
1033 #define HCI_PAGE_SCAN_REP_MODE_R0       0x00
1034 #define HCI_PAGE_SCAN_REP_MODE_R1       0x01
1035 #define HCI_PAGE_SCAN_REP_MODE_R2       0x02
1036 
1037 /* Define limits for page scan repetition modes */
1038 #define HCI_PAGE_SCAN_R1_LIMIT          0x0800
1039 #define HCI_PAGE_SCAN_R2_LIMIT          0x1000
1040 
1041 /* Page scan period modes */
1042 #define HCI_PAGE_SCAN_PER_MODE_P0       0x00
1043 #define HCI_PAGE_SCAN_PER_MODE_P1       0x01
1044 #define HCI_PAGE_SCAN_PER_MODE_P2       0x02
1045 
1046 /* Page scan modes */
1047 #define HCI_MANDATARY_PAGE_SCAN_MODE    0x00
1048 #define HCI_OPTIONAL_PAGE_SCAN_MODE1    0x01
1049 #define HCI_OPTIONAL_PAGE_SCAN_MODE2    0x02
1050 #define HCI_OPTIONAL_PAGE_SCAN_MODE3    0x03
1051 
1052 /* Page and inquiry scan types */
1053 #define HCI_SCAN_TYPE_STANDARD          0x00
1054 #define HCI_SCAN_TYPE_INTERLACED        0x01       /* 1.2 devices or later */
1055 #define HCI_DEF_SCAN_TYPE               HCI_SCAN_TYPE_STANDARD
1056 
1057 /* Definitions for quality of service service types */
1058 #define HCI_SERVICE_NO_TRAFFIC          0x00
1059 #define HCI_SERVICE_BEST_EFFORT         0x01
1060 #define HCI_SERVICE_GUARANTEED          0x02
1061 
1062 #define HCI_QOS_LATENCY_DO_NOT_CARE     0xFFFFFFFF
1063 #define HCI_QOS_DELAY_DO_NOT_CARE       0xFFFFFFFF
1064 
1065 /* Definitions for Flow Specification */
1066 #define HCI_FLOW_SPEC_LATENCY_DO_NOT_CARE 0xFFFFFFFF
1067 
1068 /* Definitions for AFH Channel Map */
1069 #define HCI_AFH_CHANNEL_MAP_LEN         10
1070 
1071 /* Definitions for Extended Inquiry Response */
1072 #define HCI_EXT_INQ_RESPONSE_LEN        240
1073 #define HCI_EIR_FLAGS_TYPE                   BT_EIR_FLAGS_TYPE
1074 #define HCI_EIR_MORE_16BITS_UUID_TYPE        BT_EIR_MORE_16BITS_UUID_TYPE
1075 #define HCI_EIR_COMPLETE_16BITS_UUID_TYPE    BT_EIR_COMPLETE_16BITS_UUID_TYPE
1076 #define HCI_EIR_MORE_32BITS_UUID_TYPE        BT_EIR_MORE_32BITS_UUID_TYPE
1077 #define HCI_EIR_COMPLETE_32BITS_UUID_TYPE    BT_EIR_COMPLETE_32BITS_UUID_TYPE
1078 #define HCI_EIR_MORE_128BITS_UUID_TYPE       BT_EIR_MORE_128BITS_UUID_TYPE
1079 #define HCI_EIR_COMPLETE_128BITS_UUID_TYPE   BT_EIR_COMPLETE_128BITS_UUID_TYPE
1080 #define HCI_EIR_SHORTENED_LOCAL_NAME_TYPE    BT_EIR_SHORTENED_LOCAL_NAME_TYPE
1081 #define HCI_EIR_COMPLETE_LOCAL_NAME_TYPE     BT_EIR_COMPLETE_LOCAL_NAME_TYPE
1082 #define HCI_EIR_TX_POWER_LEVEL_TYPE          BT_EIR_TX_POWER_LEVEL_TYPE
1083 #define HCI_EIR_MANUFACTURER_SPECIFIC_TYPE   BT_EIR_MANUFACTURER_SPECIFIC_TYPE
1084 #define HCI_EIR_OOB_BD_ADDR_TYPE             BT_EIR_OOB_BD_ADDR_TYPE
1085 #define HCI_EIR_OOB_COD_TYPE                 BT_EIR_OOB_COD_TYPE
1086 #define HCI_EIR_OOB_SSP_HASH_C_TYPE          BT_EIR_OOB_SSP_HASH_C_TYPE
1087 #define HCI_EIR_OOB_SSP_RAND_R_TYPE          BT_EIR_OOB_SSP_RAND_R_TYPE
1088 
1089 /* Definitions for Write Simple Pairing Mode */
1090 #define HCI_SP_MODE_UNDEFINED           0x00
1091 #define HCI_SP_MODE_ENABLED             0x01
1092 
1093 /* Definitions for Write Simple Pairing Debug Mode */
1094 #define HCI_SPD_MODE_DISABLED           0x00
1095 #define HCI_SPD_MODE_ENABLED            0x01
1096 
1097 /* Definitions for Write Secure Connections Host Support */
1098 #define HCI_SC_MODE_DISABLED            0x00
1099 #define HCI_SC_MODE_ENABLED             0x01
1100 
1101 /* Definitions for IO Capability Response/Command */
1102 #define HCI_IO_CAP_DISPLAY_ONLY         0x00
1103 #define HCI_IO_CAP_DISPLAY_YESNO        0x01
1104 #define HCI_IO_CAP_KEYBOARD_ONLY        0x02
1105 #define HCI_IO_CAP_NO_IO                0x03
1106 
1107 #define HCI_OOB_AUTH_DATA_NOT_PRESENT   0x00
1108 #define HCI_OOB_REM_AUTH_DATA_PRESENT   0x01
1109 
1110 #define HCI_MITM_PROTECT_NOT_REQUIRED  0x00
1111 #define HCI_MITM_PROTECT_REQUIRED      0x01
1112 
1113 
1114 /* Policy settings status */
1115 #define HCI_DISABLE_ALL_LM_MODES        0x0000
1116 #define HCI_ENABLE_MASTER_SLAVE_SWITCH  0x0001
1117 #define HCI_ENABLE_HOLD_MODE            0x0002
1118 #define HCI_ENABLE_SNIFF_MODE           0x0004
1119 #define HCI_ENABLE_PARK_MODE            0x0008
1120 
1121 /* By default allow switch, because host can not allow that */
1122 /* that until he created the connection */
1123 #define HCI_DEFAULT_POLICY_SETTINGS     HCI_DISABLE_ALL_LM_MODES
1124 
1125 /* Filters that are sent in set filter command */
1126 #define HCI_FILTER_TYPE_CLEAR_ALL       0x00
1127 #define HCI_FILTER_INQUIRY_RESULT       0x01
1128 #define HCI_FILTER_CONNECTION_SETUP     0x02
1129 
1130 #define HCI_FILTER_COND_NEW_DEVICE      0x00
1131 #define HCI_FILTER_COND_DEVICE_CLASS    0x01
1132 #define HCI_FILTER_COND_BD_ADDR         0x02
1133 
1134 #define HCI_DO_NOT_AUTO_ACCEPT_CONNECT  1
1135 #define HCI_DO_AUTO_ACCEPT_CONNECT      2   /* role switch disabled */
1136 #define HCI_DO_AUTO_ACCEPT_CONNECT_RS   3   /* role switch enabled (1.1 errata 1115) */
1137 
1138 /* Auto accept flags */
1139 #define HCI_AUTO_ACCEPT_OFF             0x00
1140 #define HCI_AUTO_ACCEPT_ACL_CONNECTIONS 0x01
1141 #define HCI_AUTO_ACCEPT_SCO_CONNECTIONS 0x02
1142 
1143 /* PIN type */
1144 #define HCI_PIN_TYPE_VARIABLE           0
1145 #define HCI_PIN_TYPE_FIXED              1
1146 
1147 /* Loopback Modes */
1148 #define HCI_LOOPBACK_MODE_DISABLED      0
1149 #define HCI_LOOPBACK_MODE_LOCAL         1
1150 #define HCI_LOOPBACK_MODE_REMOTE        2
1151 
1152 #define SLOTS_PER_10MS                  16      /* 0.625 ms slots in a 10 ms tick */
1153 
1154 /* Maximum connection accept timeout in 0.625msec */
1155 #define HCI_MAX_CONN_ACCEPT_TOUT        0xB540  /* 29 sec */
1156 #define HCI_DEF_CONN_ACCEPT_TOUT        0x1F40  /* 5 sec */
1157 
1158 /* Page timeout is used in LC only and LC is counting down slots not using OS */
1159 #define HCI_DEFAULT_PAGE_TOUT           0x2000  /* 5.12 sec (in slots) */
1160 
1161 /* Scan enable flags */
1162 #define HCI_NO_SCAN_ENABLED             0x00
1163 #define HCI_INQUIRY_SCAN_ENABLED        0x01
1164 #define HCI_PAGE_SCAN_ENABLED           0x02
1165 
1166 /* Pagescan timer definitions in 0.625 ms */
1167 #define HCI_MIN_PAGESCAN_INTERVAL       0x12    /* 11.25 ms */
1168 #define HCI_MAX_PAGESCAN_INTERVAL       0x1000  /* 2.56 sec */
1169 #define HCI_DEF_PAGESCAN_INTERVAL       0x0800  /* 1.28 sec */
1170 
1171 /* Parameter for pagescan window is passed to LC and is kept in slots */
1172 #define HCI_MIN_PAGESCAN_WINDOW         0x11    /* 10.625 ms */
1173 #define HCI_MAX_PAGESCAN_WINDOW         0x1000  /* 2.56  sec */
1174 #define HCI_DEF_PAGESCAN_WINDOW         0x12    /* 11.25 ms  */
1175 
1176 /* Inquiryscan timer definitions in 0.625 ms */
1177 #define HCI_MIN_INQUIRYSCAN_INTERVAL    0x12    /* 11.25 ms */
1178 #define HCI_MAX_INQUIRYSCAN_INTERVAL    0x1000  /* 2.56 sec */
1179 #define HCI_DEF_INQUIRYSCAN_INTERVAL    0x1000  /* 2.56 sec */
1180 
1181 /* Parameter for inquiryscan window is passed to LC and is kept in slots */
1182 #define HCI_MIN_INQUIRYSCAN_WINDOW      0x11    /* 10.625 ms */
1183 #define HCI_MAX_INQUIRYSCAN_WINDOW      0x1000  /* 2.56 sec */
1184 #define HCI_DEF_INQUIRYSCAN_WINDOW      0x12    /* 11.25 ms */
1185 
1186 /* Encryption modes */
1187 #define HCI_ENCRYPT_MODE_DISABLED       0x00
1188 #define HCI_ENCRYPT_MODE_POINT_TO_POINT 0x01
1189 #define HCI_ENCRYPT_MODE_ALL            0x02
1190 
1191 /* Voice settings */
1192 #define HCI_INP_CODING_LINEAR           0x0000 /* 0000000000 */
1193 #define HCI_INP_CODING_U_LAW            0x0100 /* 0100000000 */
1194 #define HCI_INP_CODING_A_LAW            0x0200 /* 1000000000 */
1195 #define HCI_INP_CODING_MASK             0x0300 /* 1100000000 */
1196 
1197 #define HCI_INP_DATA_FMT_1S_COMPLEMENT  0x0000 /* 0000000000 */
1198 #define HCI_INP_DATA_FMT_2S_COMPLEMENT  0x0040 /* 0001000000 */
1199 #define HCI_INP_DATA_FMT_SIGN_MAGNITUDE 0x0080 /* 0010000000 */
1200 #define HCI_INP_DATA_FMT_UNSIGNED       0x00c0 /* 0011000000 */
1201 #define HCI_INP_DATA_FMT_MASK           0x00c0 /* 0011000000 */
1202 
1203 #define HCI_INP_SAMPLE_SIZE_8BIT        0x0000 /* 0000000000 */
1204 #define HCI_INP_SAMPLE_SIZE_16BIT       0x0020 /* 0000100000 */
1205 #define HCI_INP_SAMPLE_SIZE_MASK        0x0020 /* 0000100000 */
1206 
1207 #define HCI_INP_LINEAR_PCM_BIT_POS_MASK 0x001c /* 0000011100 */
1208 #define HCI_INP_LINEAR_PCM_BIT_POS_OFFS 2
1209 
1210 #define HCI_AIR_CODING_FORMAT_CVSD      0x0000 /* 0000000000 */
1211 #define HCI_AIR_CODING_FORMAT_U_LAW     0x0001 /* 0000000001 */
1212 #define HCI_AIR_CODING_FORMAT_A_LAW     0x0002 /* 0000000010 */
1213 #define HCI_AIR_CODING_FORMAT_TRANSPNT  0x0003 /* 0000000011 */
1214 #define HCI_AIR_CODING_FORMAT_MASK      0x0003 /* 0000000011 */
1215 
1216 /* default                                        0001100000 */
1217 #define HCI_DEFAULT_VOICE_SETTINGS    (HCI_INP_CODING_LINEAR \
1218                                      | HCI_INP_DATA_FMT_2S_COMPLEMENT \
1219                                      | HCI_INP_SAMPLE_SIZE_16BIT \
1220                                      | HCI_AIR_CODING_FORMAT_CVSD)
1221 
1222 #define HCI_CVSD_SUPPORTED(x)       (((x) & HCI_AIR_CODING_FORMAT_MASK) == HCI_AIR_CODING_FORMAT_CVSD)
1223 #define HCI_U_LAW_SUPPORTED(x)      (((x) & HCI_AIR_CODING_FORMAT_MASK) == HCI_AIR_CODING_FORMAT_U_LAW)
1224 #define HCI_A_LAW_SUPPORTED(x)      (((x) & HCI_AIR_CODING_FORMAT_MASK) == HCI_AIR_CODING_FORMAT_A_LAW)
1225 #define HCI_TRANSPNT_SUPPORTED(x)   (((x) & HCI_AIR_CODING_FORMAT_MASK) == HCI_AIR_CODING_FORMAT_TRANSPNT)
1226 
1227 /* Retransmit timer definitions in 0.625 */
1228 #define HCI_MAX_AUTO_FLUSH_TOUT         0x07FF
1229 #define HCI_DEFAULT_AUTO_FLUSH_TOUT     0       /* No auto flush */
1230 
1231 /* Broadcast retransmitions */
1232 #define HCI_DEFAULT_NUM_BCAST_RETRAN    1
1233 
1234 /* Define broadcast data types as passed in the hci data packet */
1235 #define HCI_DATA_POINT_TO_POINT         0x00
1236 #define HCI_DATA_ACTIVE_BCAST           0x01
1237 #define HCI_DATA_PICONET_BCAST          0x02
1238 
1239 /* Hold mode activity */
1240 #define HCI_MAINTAIN_CUR_POWER_STATE    0x00
1241 #define HCI_SUSPEND_PAGE_SCAN           0x01
1242 #define HCI_SUSPEND_INQUIRY_SCAN        0x02
1243 #define HCI_SUSPEND_PERIODIC_INQUIRIES  0x04
1244 
1245 /* Default Link Supervision timeoout */
1246 #define HCI_DEFAULT_INACT_TOUT          0x7D00  /* BR/EDR (20 seconds) */
1247 #define HCI_DEFAULT_AMP_INACT_TOUT      0x3E80  /* AMP    (10 seconds) */
1248 
1249 /* Read transmit power level parameter */
1250 #define HCI_READ_CURRENT                0x00
1251 #define HCI_READ_MAXIMUM                0x01
1252 
1253 /* Link types for connection complete event */
1254 #define HCI_LINK_TYPE_SCO               0x00
1255 #define HCI_LINK_TYPE_ACL               0x01
1256 #define HCI_LINK_TYPE_ESCO              0x02
1257 
1258 /* Link Key Notification Event (Key Type) definitions */
1259 #define HCI_LKEY_TYPE_COMBINATION       0x00
1260 #define HCI_LKEY_TYPE_LOCAL_UNIT        0x01
1261 #define HCI_LKEY_TYPE_REMOTE_UNIT       0x02
1262 #define HCI_LKEY_TYPE_DEBUG_COMB        0x03
1263 #define HCI_LKEY_TYPE_UNAUTH_COMB       0x04
1264 #define HCI_LKEY_TYPE_AUTH_COMB         0x05
1265 #define HCI_LKEY_TYPE_CHANGED_COMB      0x06
1266 #define HCI_LKEY_TYPE_UNAUTH_COMB_P_256 0x07
1267 #define HCI_LKEY_TYPE_AUTH_COMB_P_256   0x08
1268 
1269 /* Internal definitions - not used over HCI */
1270 #define HCI_LKEY_TYPE_AMP_WIFI          0x80
1271 #define HCI_LKEY_TYPE_AMP_UWB           0x81
1272 #define HCI_LKEY_TYPE_UNKNOWN           0xff
1273 
1274 /* Read Local Version HCI Version return values (Command Complete Event) */
1275 #define HCI_VERSION_1_0B                0x00
1276 #define HCI_VERSION_1_1                 0x01
1277 
1278 /* Define an invalid value for a handle */
1279 #define HCI_INVALID_HANDLE              0xFFFF
1280 
1281 /* Define max ammount of data in the HCI command */
1282 #define HCI_COMMAND_SIZE        255
1283 
1284 /* Define the preamble length for all HCI Commands.
1285 ** This is 2-bytes for opcode and 1 byte for length
1286 */
1287 #define HCIC_PREAMBLE_SIZE      3
1288 
1289 /* Define the preamble length for all HCI Events
1290 ** This is 1-byte for opcode and 1 byte for length
1291 */
1292 #define HCIE_PREAMBLE_SIZE      2
1293 #define HCI_SCO_PREAMBLE_SIZE   3
1294 #define HCI_DATA_PREAMBLE_SIZE  4
1295 
1296 /* local Bluetooth controller id for AMP HCI */
1297 #define LOCAL_BR_EDR_CONTROLLER_ID      0
1298 
1299 /* controller id types for AMP HCI */
1300 #define HCI_CONTROLLER_TYPE_BR_EDR      0
1301 #define HCI_CONTROLLER_TYPE_802_11      1
1302 #define HCI_CONTROLLER_TYPE_ECMA        2
1303 #define HCI_MAX_CONTROLLER_TYPES        3
1304 
1305 /*  ConnectionLess Broadcast */
1306 #define HCI_CLB_DISABLE                 0x00
1307 #define HCI_CLB_ENABLE                  0x01
1308 
1309 /* ConnectionLess Broadcast Data fragment */
1310 #define HCI_CLB_FRAGMENT_CONT           0x00
1311 #define HCI_CLB_FRAGMENT_START          0x01
1312 #define HCI_CLB_FRAGMENT_END            0x02
1313 #define HCI_CLB_FRAGMENT_SINGLE         0x03
1314 
1315 /* AMP Controller Status codes
1316 */
1317 #define HCI_AMP_CTRLR_PHYSICALLY_DOWN   0
1318 #define HCI_AMP_CTRLR_USABLE_BY_BT      1
1319 #define HCI_AMP_CTRLR_UNUSABLE_FOR_BT   2
1320 #define HCI_AMP_CTRLR_LOW_CAP_FOR_BT    3
1321 #define HCI_AMP_CTRLR_MED_CAP_FOR_BT    4
1322 #define HCI_AMP_CTRLR_HIGH_CAP_FOR_BT   5
1323 #define HCI_AMP_CTRLR_FULL_CAP_FOR_BT   6
1324 
1325 #define HCI_MAX_AMP_STATUS_TYPES        7
1326 
1327 
1328 /* Define the extended flow specification fields used by AMP */
1329 typedef struct
1330 {
1331     UINT8       id;
1332     UINT8       stype;
1333     UINT16      max_sdu_size;
1334     UINT32      sdu_inter_time;
1335     UINT32      access_latency;
1336     UINT32      flush_timeout;
1337 } tHCI_EXT_FLOW_SPEC;
1338 
1339 
1340 /* HCI message type definitions (for H4 messages) */
1341 #define HCIT_TYPE_COMMAND   1
1342 #define HCIT_TYPE_ACL_DATA  2
1343 #define HCIT_TYPE_SCO_DATA  3
1344 #define HCIT_TYPE_EVENT     4
1345 #define HCIT_TYPE_LM_DIAG   7
1346 #define HCIT_TYPE_NFC       16
1347 
1348 #define HCIT_LM_DIAG_LENGTH 63
1349 
1350 /* Parameter information for HCI_BRCM_SET_ACL_PRIORITY */
1351 #define HCI_BRCM_ACL_PRIORITY_PARAM_SIZE    3
1352 #define HCI_BRCM_ACL_PRIORITY_LOW           0x00
1353 #define HCI_BRCM_ACL_PRIORITY_HIGH          0xFF
1354 #define HCI_BRCM_SET_ACL_PRIORITY           (0x0057 | HCI_GRP_VENDOR_SPECIFIC)
1355 
1356 /* Define values for LMP Test Control parameters
1357 ** Test Scenario, Hopping Mode, Power Control Mode
1358 */
1359 #define LMP_TESTCTL_TESTSC_PAUSE        0
1360 #define LMP_TESTCTL_TESTSC_TXTEST_0     1
1361 #define LMP_TESTCTL_TESTSC_TXTEST_1     2
1362 #define LMP_TESTCTL_TESTSC_TXTEST_1010  3
1363 #define LMP_TESTCTL_TESTSC_PSRND_BITSEQ 4
1364 #define LMP_TESTCTL_TESTSC_CLOSEDLB_ACL 5
1365 #define LMP_TESTCTL_TESTSC_CLOSEDLB_SCO 6
1366 #define LMP_TESTCTL_TESTSC_ACL_NOWHIT   7
1367 #define LMP_TESTCTL_TESTSC_SCO_NOWHIT   8
1368 #define LMP_TESTCTL_TESTSC_TXTEST_11110000  9
1369 #define LMP_TESTCTL_TESTSC_EXITTESTMODE 255
1370 
1371 #define LMP_TESTCTL_HOPMOD_RXTX1FREQ    0
1372 #define LMP_TESTCTL_HOPMOD_HOP_EURUSA   1
1373 #define LMP_TESTCTL_HOPMOD_HOP_JAPAN    2
1374 #define LMP_TESTCTL_HOPMOD_HOP_FRANCE   3
1375 #define LMP_TESTCTL_HOPMOD_HOP_SPAIN    4
1376 #define LMP_TESTCTL_HOPMOD_REDUCED_HOP  5
1377 
1378 #define LMP_TESTCTL_POWCTL_FIXEDTX_OP   0
1379 #define LMP_TESTCTL_POWCTL_ADAPTIVE     1
1380 
1381 // TODO(zachoverflow): remove this once broadcom specific hacks are removed
1382 #define LMP_COMPID_BROADCOM             15
1383 
1384 /*
1385 ** Define the packet types in the packet header, and a couple extra
1386 */
1387 #define PKT_TYPE_NULL   0x00
1388 #define PKT_TYPE_POLL   0x01
1389 #define PKT_TYPE_FHS    0x02
1390 #define PKT_TYPE_DM1    0x03
1391 
1392 #define PKT_TYPE_DH1    0x04
1393 #define PKT_TYPE_HV1    0x05
1394 #define PKT_TYPE_HV2    0x06
1395 #define PKT_TYPE_HV3    0x07
1396 #define PKT_TYPE_DV     0x08
1397 #define PKT_TYPE_AUX1   0x09
1398 
1399 #define PKT_TYPE_DM3    0x0a
1400 #define PKT_TYPE_DH3    0x0b
1401 
1402 #define PKT_TYPE_DM5    0x0e
1403 #define PKT_TYPE_DH5    0x0f
1404 
1405 
1406 #define PKT_TYPE_ID     0x10        /* Internally used packet types */
1407 #define PKT_TYPE_BAD    0x11
1408 #define PKT_TYPE_NONE   0x12
1409 
1410 /*
1411 ** Define packet size
1412 */
1413 #define HCI_DM1_PACKET_SIZE         17
1414 #define HCI_DH1_PACKET_SIZE         27
1415 #define HCI_DM3_PACKET_SIZE         121
1416 #define HCI_DH3_PACKET_SIZE         183
1417 #define HCI_DM5_PACKET_SIZE         224
1418 #define HCI_DH5_PACKET_SIZE         339
1419 #define HCI_AUX1_PACKET_SIZE        29
1420 #define HCI_HV1_PACKET_SIZE         10
1421 #define HCI_HV2_PACKET_SIZE         20
1422 #define HCI_HV3_PACKET_SIZE         30
1423 #define HCI_DV_PACKET_SIZE          9
1424 #define HCI_EDR2_DH1_PACKET_SIZE    54
1425 #define HCI_EDR2_DH3_PACKET_SIZE    367
1426 #define HCI_EDR2_DH5_PACKET_SIZE    679
1427 #define HCI_EDR3_DH1_PACKET_SIZE    83
1428 #define HCI_EDR3_DH3_PACKET_SIZE    552
1429 #define HCI_EDR3_DH5_PACKET_SIZE    1021
1430 
1431 /* Feature Pages */
1432 #define HCI_EXT_FEATURES_PAGE_0     0       /* Extended Feature Page 0 (regular features) */
1433 #define HCI_EXT_FEATURES_PAGE_1     1       /* Extended Feature Page 1 */
1434 #define HCI_EXT_FEATURES_PAGE_2     2       /* Extended Feature Page 2 */
1435 #define HCI_EXT_FEATURES_PAGE_MAX   HCI_EXT_FEATURES_PAGE_2
1436 
1437 #define HCI_FEATURE_BYTES_PER_PAGE      8
1438 
1439 #define HCI_FEATURES_KNOWN(x) ((x[0] | x[1] | x[2] | x[3] | x[4] | x[5] | x[6] | x[7]) != 0)
1440 
1441 /*
1442 **   LMP features encoding - page 0
1443 */
1444 #define HCI_FEATURE_3_SLOT_PACKETS_MASK 0x01
1445 #define HCI_FEATURE_3_SLOT_PACKETS_OFF  0
1446 #define HCI_3_SLOT_PACKETS_SUPPORTED(x) ((x)[HCI_FEATURE_3_SLOT_PACKETS_OFF] & HCI_FEATURE_3_SLOT_PACKETS_MASK)
1447 
1448 #define HCI_FEATURE_5_SLOT_PACKETS_MASK 0x02
1449 #define HCI_FEATURE_5_SLOT_PACKETS_OFF  0
1450 #define HCI_5_SLOT_PACKETS_SUPPORTED(x) ((x)[HCI_FEATURE_5_SLOT_PACKETS_OFF] & HCI_FEATURE_5_SLOT_PACKETS_MASK)
1451 
1452 #define HCI_FEATURE_ENCRYPTION_MASK     0x04
1453 #define HCI_FEATURE_ENCRYPTION_OFF      0
1454 #define HCI_ENCRYPTION_SUPPORTED(x)     ((x)[HCI_FEATURE_ENCRYPTION_OFF] & HCI_FEATURE_ENCRYPTION_MASK)
1455 
1456 #define HCI_FEATURE_SLOT_OFFSET_MASK    0x08
1457 #define HCI_FEATURE_SLOT_OFFSET_OFF     0
1458 #define HCI_SLOT_OFFSET_SUPPORTED(x)    ((x)[HCI_FEATURE_SLOT_OFFSET_OFF] & HCI_FEATURE_SLOT_OFFSET_MASK)
1459 
1460 #define HCI_FEATURE_TIMING_ACC_MASK     0x10
1461 #define HCI_FEATURE_TIMING_ACC_OFF      0
1462 #define HCI_TIMING_ACC_SUPPORTED(x)     ((x)[HCI_FEATURE_TIMING_ACC_OFF] & HCI_FEATURE_TIMING_ACC_MASK)
1463 
1464 #define HCI_FEATURE_SWITCH_MASK         0x20
1465 #define HCI_FEATURE_SWITCH_OFF          0
1466 #define HCI_SWITCH_SUPPORTED(x)         ((x)[HCI_FEATURE_SWITCH_OFF] & HCI_FEATURE_SWITCH_MASK)
1467 
1468 #define HCI_FEATURE_HOLD_MODE_MASK      0x40
1469 #define HCI_FEATURE_HOLD_MODE_OFF       0
1470 #define HCI_HOLD_MODE_SUPPORTED(x)      ((x)[HCI_FEATURE_HOLD_MODE_OFF] & HCI_FEATURE_HOLD_MODE_MASK)
1471 
1472 #define HCI_FEATURE_SNIFF_MODE_MASK     0x80
1473 #define HCI_FEATURE_SNIFF_MODE_OFF      0
1474 #define HCI_SNIFF_MODE_SUPPORTED(x)      ((x)[HCI_FEATURE_SNIFF_MODE_OFF] & HCI_FEATURE_SNIFF_MODE_MASK)
1475 
1476 #define HCI_FEATURE_PARK_MODE_MASK      0x01
1477 #define HCI_FEATURE_PARK_MODE_OFF       1
1478 #define HCI_PARK_MODE_SUPPORTED(x)      ((x)[HCI_FEATURE_PARK_MODE_OFF] & HCI_FEATURE_PARK_MODE_MASK)
1479 
1480 #define HCI_FEATURE_RSSI_MASK           0x02
1481 #define HCI_FEATURE_RSSI_OFF            1
1482 #define HCI_RSSI_SUPPORTED(x)           ((x)[HCI_FEATURE_RSSI_OFF] & HCI_FEATURE_RSSI_MASK)
1483 
1484 #define HCI_FEATURE_CQM_DATA_RATE_MASK  0x04
1485 #define HCI_FEATURE_CQM_DATA_RATE_OFF   1
1486 #define HCI_CQM_DATA_RATE_SUPPORTED(x)  ((x)[HCI_FEATURE_CQM_DATA_RATE_OFF] & HCI_FEATURE_CQM_DATA_RATE_MASK)
1487 
1488 #define HCI_FEATURE_SCO_LINK_MASK       0x08
1489 #define HCI_FEATURE_SCO_LINK_OFF        1
1490 #define HCI_SCO_LINK_SUPPORTED(x)       ((x)[HCI_FEATURE_SCO_LINK_OFF] & HCI_FEATURE_SCO_LINK_MASK)
1491 
1492 #define HCI_FEATURE_HV2_PACKETS_MASK    0x10
1493 #define HCI_FEATURE_HV2_PACKETS_OFF     1
1494 #define HCI_HV2_PACKETS_SUPPORTED(x)    ((x)[HCI_FEATURE_HV2_PACKETS_OFF] & HCI_FEATURE_HV2_PACKETS_MASK)
1495 
1496 #define HCI_FEATURE_HV3_PACKETS_MASK    0x20
1497 #define HCI_FEATURE_HV3_PACKETS_OFF     1
1498 #define HCI_HV3_PACKETS_SUPPORTED(x)    ((x)[HCI_FEATURE_HV3_PACKETS_OFF] & HCI_FEATURE_HV3_PACKETS_MASK)
1499 
1500 #define HCI_FEATURE_U_LAW_MASK          0x40
1501 #define HCI_FEATURE_U_LAW_OFF           1
1502 #define HCI_LMP_U_LAW_SUPPORTED(x)      ((x)[HCI_FEATURE_U_LAW_OFF] & HCI_FEATURE_U_LAW_MASK)
1503 
1504 #define HCI_FEATURE_A_LAW_MASK          0x80
1505 #define HCI_FEATURE_A_LAW_OFF           1
1506 #define HCI_LMP_A_LAW_SUPPORTED(x)      ((x)[HCI_FEATURE_A_LAW_OFF] & HCI_FEATURE_A_LAW_MASK)
1507 
1508 #define HCI_FEATURE_CVSD_MASK           0x01
1509 #define HCI_FEATURE_CVSD_OFF            2
1510 #define HCI_LMP_CVSD_SUPPORTED(x)       ((x)[HCI_FEATURE_CVSD_OFF] & HCI_FEATURE_CVSD_MASK)
1511 
1512 #define HCI_FEATURE_PAGING_SCHEME_MASK  0x02
1513 #define HCI_FEATURE_PAGING_SCHEME_OFF   2
1514 #define HCI_PAGING_SCHEME_SUPPORTED(x) ((x)[HCI_FEATURE_PAGING_SCHEME_OFF] & HCI_FEATURE_PAGING_SCHEME_MASK)
1515 
1516 #define HCI_FEATURE_POWER_CTRL_MASK     0x04
1517 #define HCI_FEATURE_POWER_CTRL_OFF      2
1518 #define HCI_POWER_CTRL_SUPPORTED(x)     ((x)[HCI_FEATURE_POWER_CTRL_OFF] & HCI_FEATURE_POWER_CTRL_MASK)
1519 
1520 #define HCI_FEATURE_TRANSPNT_MASK       0x08
1521 #define HCI_FEATURE_TRANSPNT_OFF        2
1522 #define HCI_LMP_TRANSPNT_SUPPORTED(x)   ((x)[HCI_FEATURE_TRANSPNT_OFF] & HCI_FEATURE_TRANSPNT_MASK)
1523 
1524 #define HCI_FEATURE_FLOW_CTRL_LAG_MASK  0x70
1525 #define HCI_FEATURE_FLOW_CTRL_LAG_OFF   2
1526 #define HCI_FLOW_CTRL_LAG_VALUE(x)      (((x)[HCI_FEATURE_FLOW_CTRL_LAG_OFF] & HCI_FEATURE_FLOW_CTRL_LAG_MASK) >> 4)
1527 
1528 #define HCI_FEATURE_BROADCAST_ENC_MASK  0x80
1529 #define HCI_FEATURE_BROADCAST_ENC_OFF   2
1530 #define HCI_LMP_BCAST_ENC_SUPPORTED(x)  ((x)[HCI_FEATURE_BROADCAST_ENC_OFF] & HCI_FEATURE_BROADCAST_ENC_MASK)
1531 
1532 #define HCI_FEATURE_SCATTER_MODE_MASK   0x01
1533 #define HCI_FEATURE_SCATTER_MODE_OFF    3
1534 #define HCI_LMP_SCATTER_MODE_SUPPORTED(x) ((x)[HCI_FEATURE_SCATTER_MODE_OFF] & HCI_FEATURE_SCATTER_MODE_MASK)
1535 
1536 #define HCI_FEATURE_EDR_ACL_2MPS_MASK   0x02
1537 #define HCI_FEATURE_EDR_ACL_2MPS_OFF    3
1538 #define HCI_EDR_ACL_2MPS_SUPPORTED(x)   ((x)[HCI_FEATURE_EDR_ACL_2MPS_OFF] & HCI_FEATURE_EDR_ACL_2MPS_MASK)
1539 
1540 #define HCI_FEATURE_EDR_ACL_3MPS_MASK   0x04
1541 #define HCI_FEATURE_EDR_ACL_3MPS_OFF    3
1542 #define HCI_EDR_ACL_3MPS_SUPPORTED(x)   ((x)[HCI_FEATURE_EDR_ACL_3MPS_OFF] & HCI_FEATURE_EDR_ACL_3MPS_MASK)
1543 
1544 #define HCI_FEATURE_ENHANCED_INQ_MASK   0x08
1545 #define HCI_FEATURE_ENHANCED_INQ_OFF    3
1546 #define HCI_ENHANCED_INQ_SUPPORTED(x)   ((x)[HCI_FEATURE_ENHANCED_INQ_OFF] & HCI_FEATURE_ENHANCED_INQ_MASK)
1547 
1548 #define HCI_FEATURE_INTERLACED_INQ_SCAN_MASK   0x10
1549 #define HCI_FEATURE_INTERLACED_INQ_SCAN_OFF    3
1550 #define HCI_LMP_INTERLACED_INQ_SCAN_SUPPORTED(x) ((x)[HCI_FEATURE_INTERLACED_INQ_SCAN_OFF] & HCI_FEATURE_INTERLACED_INQ_SCAN_MASK)
1551 
1552 #define HCI_FEATURE_INTERLACED_PAGE_SCAN_MASK  0x20
1553 #define HCI_FEATURE_INTERLACED_PAGE_SCAN_OFF   3
1554 #define HCI_LMP_INTERLACED_PAGE_SCAN_SUPPORTED(x) ((x)[HCI_FEATURE_INTERLACED_PAGE_SCAN_OFF] & HCI_FEATURE_INTERLACED_PAGE_SCAN_MASK)
1555 
1556 #define HCI_FEATURE_INQ_RSSI_MASK       0x40
1557 #define HCI_FEATURE_INQ_RSSI_OFF        3
1558 #define HCI_LMP_INQ_RSSI_SUPPORTED(x)   ((x)[HCI_FEATURE_INQ_RSSI_OFF] & HCI_FEATURE_INQ_RSSI_MASK)
1559 
1560 #define HCI_FEATURE_ESCO_EV3_MASK       0x80
1561 #define HCI_FEATURE_ESCO_EV3_OFF        3
1562 #define HCI_ESCO_EV3_SUPPORTED(x)       ((x)[HCI_FEATURE_ESCO_EV3_OFF] & HCI_FEATURE_ESCO_EV3_MASK)
1563 
1564 #define HCI_FEATURE_ESCO_EV4_MASK       0x01
1565 #define HCI_FEATURE_ESCO_EV4_OFF        4
1566 #define HCI_ESCO_EV4_SUPPORTED(x)       ((x)[HCI_FEATURE_ESCO_EV4_OFF] & HCI_FEATURE_ESCO_EV4_MASK)
1567 
1568 #define HCI_FEATURE_ESCO_EV5_MASK       0x02
1569 #define HCI_FEATURE_ESCO_EV5_OFF        4
1570 #define HCI_ESCO_EV5_SUPPORTED(x)       ((x)[HCI_FEATURE_ESCO_EV5_OFF] & HCI_FEATURE_ESCO_EV5_MASK)
1571 
1572 #define HCI_FEATURE_ABSENCE_MASKS_MASK  0x04
1573 #define HCI_FEATURE_ABSENCE_MASKS_OFF   4
1574 #define HCI_LMP_ABSENCE_MASKS_SUPPORTED(x) ((x)[HCI_FEATURE_ABSENCE_MASKS_OFF] & HCI_FEATURE_ABSENCE_MASKS_MASK)
1575 
1576 #define HCI_FEATURE_AFH_CAP_SLAVE_MASK  0x08
1577 #define HCI_FEATURE_AFH_CAP_SLAVE_OFF   4
1578 #define HCI_LMP_AFH_CAP_SLAVE_SUPPORTED(x) ((x)[HCI_FEATURE_AFH_CAP_SLAVE_OFF] & HCI_FEATURE_AFH_CAP_SLAVE_MASK)
1579 
1580 #define HCI_FEATURE_AFH_CLASS_SLAVE_MASK 0x10
1581 #define HCI_FEATURE_AFH_CLASS_SLAVE_OFF  4
1582 #define HCI_LMP_AFH_CLASS_SLAVE_SUPPORTED(x) ((x)[HCI_FEATURE_AFH_CLASS_SLAVE_OFF] & HCI_FEATURE_AFH_CLASS_SLAVE_MASK)
1583 
1584 #if 1
1585 #define HCI_FEATURE_BREDR_NOT_SPT_MASK     0x20
1586 #define HCI_FEATURE_BREDR_NOT_SPT_OFF      4
1587 #define HCI_BREDR_NOT_SPT_SUPPORTED(x) ((x)[HCI_FEATURE_BREDR_NOT_SPT_OFF] & HCI_FEATURE_BREDR_NOT_SPT_MASK)
1588 
1589 #define HCI_FEATURE_LE_SPT_MASK      0x40
1590 #define HCI_FEATURE_LE_SPT_OFF       4
1591 #define HCI_LE_SPT_SUPPORTED(x)  ((x)[HCI_FEATURE_LE_SPT_OFF] & HCI_FEATURE_LE_SPT_MASK)
1592 #else
1593 
1594 #define HCI_FEATURE_ALIAS_AUTH_MASK     0x20
1595 #define HCI_FEATURE_ALIAS_AUTH_OFF      4
1596 #define HCI_LMP_ALIAS_AUTH_SUPPORTED(x) ((x)[HCI_FEATURE_ALIAS_AUTH_OFF] & HCI_FEATURE_ALIAS_AUTH_MASK)
1597 
1598 #define HCI_FEATURE_ANON_MODE_MASK      0x40
1599 #define HCI_FEATURE_ANON_MODE_OFF       4
1600 #define HCI_LMP_ANON_MODE_SUPPORTED(x)  ((x)[HCI_FEATURE_ANON_MODE_OFF] & HCI_FEATURE_ANON_MODE_MASK)
1601 #endif
1602 
1603 #define HCI_FEATURE_3_SLOT_EDR_ACL_MASK 0x80
1604 #define HCI_FEATURE_3_SLOT_EDR_ACL_OFF  4
1605 #define HCI_3_SLOT_EDR_ACL_SUPPORTED(x) ((x)[HCI_FEATURE_3_SLOT_EDR_ACL_OFF] & HCI_FEATURE_3_SLOT_EDR_ACL_MASK)
1606 
1607 #define HCI_FEATURE_5_SLOT_EDR_ACL_MASK 0x01
1608 #define HCI_FEATURE_5_SLOT_EDR_ACL_OFF  5
1609 #define HCI_5_SLOT_EDR_ACL_SUPPORTED(x) ((x)[HCI_FEATURE_5_SLOT_EDR_ACL_OFF] & HCI_FEATURE_5_SLOT_EDR_ACL_MASK)
1610 
1611 #define HCI_FEATURE_SNIFF_SUB_RATE_MASK 0x02
1612 #define HCI_FEATURE_SNIFF_SUB_RATE_OFF  5
1613 #define HCI_SNIFF_SUB_RATE_SUPPORTED(x) ((x)[HCI_FEATURE_SNIFF_SUB_RATE_OFF] & HCI_FEATURE_SNIFF_SUB_RATE_MASK)
1614 
1615 #define HCI_FEATURE_ATOMIC_ENCRYPT_MASK 0x04
1616 #define HCI_FEATURE_ATOMIC_ENCRYPT_OFF  5
1617 #define HCI_ATOMIC_ENCRYPT_SUPPORTED(x) ((x)[HCI_FEATURE_ATOMIC_ENCRYPT_OFF] & HCI_FEATURE_ATOMIC_ENCRYPT_MASK)
1618 
1619 #define HCI_FEATURE_AFH_CAP_MASTR_MASK  0x08
1620 #define HCI_FEATURE_AFH_CAP_MASTR_OFF   5
1621 #define HCI_LMP_AFH_CAP_MASTR_SUPPORTED(x) ((x)[HCI_FEATURE_AFH_CAP_MASTR_OFF] & HCI_FEATURE_AFH_CAP_MASTR_MASK)
1622 
1623 #define HCI_FEATURE_AFH_CLASS_MASTR_MASK 0x10
1624 #define HCI_FEATURE_AFH_CLASS_MASTR_OFF  5
1625 #define HCI_LMP_AFH_CLASS_MASTR_SUPPORTED(x) ((x)[HCI_FEATURE_AFH_CLASS_MASTR_OFF] & HCI_FEATURE_AFH_CLASS_MASTR_MASK)
1626 
1627 #define HCI_FEATURE_EDR_ESCO_2MPS_MASK  0x20
1628 #define HCI_FEATURE_EDR_ESCO_2MPS_OFF   5
1629 #define HCI_EDR_ESCO_2MPS_SUPPORTED(x)  ((x)[HCI_FEATURE_EDR_ESCO_2MPS_OFF] & HCI_FEATURE_EDR_ESCO_2MPS_MASK)
1630 
1631 #define HCI_FEATURE_EDR_ESCO_3MPS_MASK  0x40
1632 #define HCI_FEATURE_EDR_ESCO_3MPS_OFF   5
1633 #define HCI_EDR_ESCO_3MPS_SUPPORTED(x)  ((x)[HCI_FEATURE_EDR_ESCO_3MPS_OFF] & HCI_FEATURE_EDR_ESCO_3MPS_MASK)
1634 
1635 #define HCI_FEATURE_3_SLOT_EDR_ESCO_MASK 0x80
1636 #define HCI_FEATURE_3_SLOT_EDR_ESCO_OFF  5
1637 #define HCI_3_SLOT_EDR_ESCO_SUPPORTED(x) ((x)[HCI_FEATURE_3_SLOT_EDR_ESCO_OFF] & HCI_FEATURE_3_SLOT_EDR_ESCO_MASK)
1638 
1639 #define HCI_FEATURE_EXT_INQ_RSP_MASK    0x01
1640 #define HCI_FEATURE_EXT_INQ_RSP_OFF     6
1641 #define HCI_EXT_INQ_RSP_SUPPORTED(x)    ((x)[HCI_FEATURE_EXT_INQ_RSP_OFF] & HCI_FEATURE_EXT_INQ_RSP_MASK)
1642 
1643 #if 1 /* TOKYO spec definition */
1644 #define HCI_FEATURE_SIMUL_LE_BREDR_MASK 0x02
1645 #define HCI_FEATURE_SIMUL_LE_BREDR_OFF  6
1646 #define HCI_SIMUL_LE_BREDR_SUPPORTED(x) ((x)[HCI_FEATURE_SIMUL_LE_BREDR_OFF] & HCI_FEATURE_SIMUL_LE_BREDR_MASK)
1647 
1648 #else
1649 #define HCI_FEATURE_ANUM_PIN_AWARE_MASK 0x02
1650 #define HCI_FEATURE_ANUM_PIN_AWARE_OFF  6
1651 #define HCI_ANUM_PIN_AWARE_SUPPORTED(x) ((x)[HCI_FEATURE_ANUM_PIN_AWARE_OFF] & HCI_FEATURE_ANUM_PIN_AWARE_MASK)
1652 #endif
1653 
1654 #define HCI_FEATURE_ANUM_PIN_CAP_MASK   0x04
1655 #define HCI_FEATURE_ANUM_PIN_CAP_OFF    6
1656 #define HCI_ANUM_PIN_CAP_SUPPORTED(x)   ((x)[HCI_FEATURE_ANUM_PIN_CAP_OFF] & HCI_FEATURE_ANUM_PIN_CAP_MASK)
1657 
1658 #define HCI_FEATURE_SIMPLE_PAIRING_MASK 0x08
1659 #define HCI_FEATURE_SIMPLE_PAIRING_OFF  6
1660 #define HCI_SIMPLE_PAIRING_SUPPORTED(x) ((x)[HCI_FEATURE_SIMPLE_PAIRING_OFF] & HCI_FEATURE_SIMPLE_PAIRING_MASK)
1661 
1662 #define HCI_FEATURE_ENCAP_PDU_MASK      0x10
1663 #define HCI_FEATURE_ENCAP_PDU_OFF       6
1664 #define HCI_ENCAP_PDU_SUPPORTED(x)      ((x)[HCI_FEATURE_ENCAP_PDU_OFF] & HCI_FEATURE_ENCAP_PDU_MASK)
1665 
1666 #define HCI_FEATURE_ERROR_DATA_MASK     0x20
1667 #define HCI_FEATURE_ERROR_DATA_OFF      6
1668 #define HCI_ERROR_DATA_SUPPORTED(x)     ((x)[HCI_FEATURE_ERROR_DATA_OFF] & HCI_FEATURE_ERROR_DATA_MASK)
1669 
1670 #define HCI_FEATURE_NON_FLUSHABLE_PB_MASK      0x40
1671 #define HCI_FEATURE_NON_FLUSHABLE_PB_OFF       6
1672 
1673 /* This feature is causing frequent link drops when doing call switch with certain av/hfp headsets */
1674 #define HCI_NON_FLUSHABLE_PB_SUPPORTED(x)      (0)//((x)[HCI_FEATURE_NON_FLUSHABLE_PB_OFF] & HCI_FEATURE_NON_FLUSHABLE_PB_MASK)
1675 
1676 #define HCI_FEATURE_LINK_SUP_TO_EVT_MASK 0x01
1677 #define HCI_FEATURE_LINK_SUP_TO_EVT_OFF  7
1678 #define HCI_LINK_SUP_TO_EVT_SUPPORTED(x) ((x)[HCI_FEATURE_LINK_SUP_TO_EVT_OFF] & HCI_FEATURE_LINK_SUP_TO_EVT_MASK)
1679 
1680 #define HCI_FEATURE_INQ_RESP_TX_MASK     0x02
1681 #define HCI_FEATURE_INQ_RESP_TX_OFF      7
1682 #define HCI_INQ_RESP_TX_SUPPORTED(x)     ((x)[HCI_FEATURE_INQ_RESP_TX_OFF] & HCI_FEATURE_INQ_RESP_TX_MASK)
1683 
1684 #define HCI_FEATURE_EXTENDED_MASK       0x80
1685 #define HCI_FEATURE_EXTENDED_OFF        7
1686 #define HCI_LMP_EXTENDED_SUPPORTED(x)   ((x)[HCI_FEATURE_EXTENDED_OFF] & HCI_FEATURE_EXTENDED_MASK)
1687 
1688 /*
1689 **   LMP features encoding - page 1
1690 */
1691 #define HCI_EXT_FEATURE_SSP_HOST_MASK 0x01
1692 #define HCI_EXT_FEATURE_SSP_HOST_OFF  0
1693 #define HCI_SSP_HOST_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SSP_HOST_OFF] & HCI_EXT_FEATURE_SSP_HOST_MASK)
1694 
1695 #define HCI_EXT_FEATURE_LE_HOST_MASK 0x02
1696 #define HCI_EXT_FEATURE_LE_HOST_OFF  0
1697 #define HCI_LE_HOST_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_LE_HOST_OFF] & HCI_EXT_FEATURE_LE_HOST_MASK)
1698 
1699 #define HCI_EXT_FEATURE_SIMUL_DUMO_HOST_MASK 0x04
1700 #define HCI_EXT_FEATURE_SIMUL_DUMO_HOST_OFF  0
1701 #define HCI_SIMUL_DUMO_HOST_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SIMUL_DUMO_HOST_OFF] & HCI_EXT_FEATURE_SIMUL_DUMO_HOST_MASK)
1702 
1703 #define HCI_EXT_FEATURE_SC_HOST_MASK 0x08
1704 #define HCI_EXT_FEATURE_SC_HOST_OFF  0
1705 #define HCI_SC_HOST_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SC_HOST_OFF] & HCI_EXT_FEATURE_SC_HOST_MASK)
1706 
1707 /*
1708 **   LMP features encoding - page 2
1709 */
1710 #define HCI_EXT_FEATURE_CSB_MASTER_MASK         0x01
1711 #define HCI_EXT_FEATURE_CSB_MASTER_OFF          0
1712 #define HCI_CSB_MASTER_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_CSB_MASTER_OFF] & HCI_EXT_FEATURE_CSB_MASTER_MASK)
1713 
1714 #define HCI_EXT_FEATURE_CSB_SLAVE_MASK          0x02
1715 #define HCI_EXT_FEATURE_CSB_SLAVE_OFF           0
1716 #define HCI_CSB_SLAVE_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_CSB_SLAVE_OFF] & HCI_EXT_FEATURE_CSB_SLAVE_MASK)
1717 
1718 #define HCI_EXT_FEATURE_SYNC_TRAIN_MASTER_MASK  0x04
1719 #define HCI_EXT_FEATURE_SYNC_TRAIN_MASTER_OFF   0
1720 #define HCI_SYNC_TRAIN_MASTER_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SYNC_TRAIN_MASTER_OFF] & HCI_EXT_FEATURE_SYNC_TRAIN_MASTER_MASK)
1721 
1722 #define HCI_EXT_FEATURE_SYNC_SCAN_SLAVE_MASK    0x08
1723 #define HCI_EXT_FEATURE_SYNC_SCAN_SLAVE_OFF     0
1724 #define HCI_SYNC_SCAN_SLAVE_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SYNC_SCAN_SLAVE_OFF] & HCI_EXT_FEATURE_SYNC_SCAN_SLAVE_MASK)
1725 
1726 #define HCI_EXT_FEATURE_INQ_RESP_NOTIF_MASK     0x10
1727 #define HCI_EXT_FEATURE_INQ_RESP_NOTIF_OFF      0
1728 #define HCI_INQ_RESP_NOTIF_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_INQ_RESP_NOTIF_OFF] & HCI_EXT_FEATURE_INQ_RESP_NOTIF_MASK)
1729 
1730 #define HCI_EXT_FEATURE_SC_CTRLR_MASK           0x01
1731 #define HCI_EXT_FEATURE_SC_CTRLR_OFF            1
1732 #define HCI_SC_CTRLR_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_SC_CTRLR_OFF] & HCI_EXT_FEATURE_SC_CTRLR_MASK)
1733 
1734 #define HCI_EXT_FEATURE_PING_MASK               0x02
1735 #define HCI_EXT_FEATURE_PING_OFF                1
1736 #define HCI_PING_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_PING_OFF] & HCI_EXT_FEATURE_PING_MASK)
1737 
1738 /*
1739 **   LE features encoding - page 0 (the only page for now)
1740 */
1741 /* LE Encryption */
1742 #define HCI_LE_FEATURE_LE_ENCRYPTION_MASK       0x01
1743 #define HCI_LE_FEATURE_LE_ENCRYPTION_OFF        0
1744 #define HCI_LE_ENCRYPTION_SUPPORTED(x) ((x)[HCI_LE_FEATURE_LE_ENCRYPTION_OFF] & HCI_LE_FEATURE_LE_ENCRYPTION_MASK)
1745 
1746 /* Connection Parameters Request Procedure */
1747 #define HCI_LE_FEATURE_CONN_PARAM_REQ_MASK       0x02
1748 #define HCI_LE_FEATURE_CONN_PARAM_REQ_OFF        0
1749 #define HCI_LE_CONN_PARAM_REQ_SUPPORTED(x) ((x)[HCI_LE_FEATURE_CONN_PARAM_REQ_OFF] & HCI_LE_FEATURE_CONN_PARAM_REQ_MASK)
1750 
1751 /* Extended Reject Indication */
1752 #define HCI_LE_FEATURE_EXT_REJ_IND_MASK       0x04
1753 #define HCI_LE_FEATURE_EXT_REJ_IND_OFF        0
1754 #define HCI_LE_EXT_REJ_IND_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_REJ_IND_OFF] & HCI_LE_FEATURE_EXT_REJ_IND_MASK)
1755 
1756 /* Slave-initiated Features Exchange */
1757 #define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK       0x08
1758 #define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF        0
1759 #define HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(x) ((x)[HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF] & HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK)
1760 
1761 /* Enhanced privacy Feature: bit 6 */
1762 #define HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK       0x40
1763 #define HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF        0
1764 #define HCI_LE_ENHANCED_PRIVACY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF] & HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK)
1765 
1766 /* Extended scanner filter policy : 7 */
1767 #define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK       0x80
1768 #define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF        0
1769 #define HCI_LE_EXT_SCAN_FILTER_POLICY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF] & HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK)
1770 
1771 /* Slave-initiated Features Exchange */
1772 #define HCI_LE_FEATURE_DATA_LEN_EXT_MASK       0x20
1773 #define HCI_LE_FEATURE_DATA_LEN_EXT_OFF        0
1774 #define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[HCI_LE_FEATURE_DATA_LEN_EXT_OFF] & HCI_LE_FEATURE_DATA_LEN_EXT_MASK)
1775 
1776 /*
1777 **   Local Supported Commands encoding
1778 */
1779 #define HCI_NUM_SUPP_COMMANDS_BYTES           64
1780 
1781 /* Supported Commands Byte 0 */
1782 #define HCI_SUPP_COMMANDS_INQUIRY_MASK 0x01
1783 #define HCI_SUPP_COMMANDS_INQUIRY_OFF  0
1784 #define HCI_INQUIRY_SUPPORTED(x) ((x)[HCI_SUPP_COMMANDS_INQUIRY_OFF] & HCI_SUPP_COMMANDS_INQUIRY_MASK)
1785 
1786 #define HCI_SUPP_COMMANDS_INQUIRY_CANCEL_MASK 0x02
1787 #define HCI_SUPP_COMMANDS_INQUIRY_CANCEL_OFF  0
1788 #define HCI_INQUIRY_CANCEL_SUPPORTED(x) ((x)[HCI_SUPP_COMMANDS_INQUIRY_CANCEL_OFF] & HCI_SUPP_COMMANDS_INQUIRY_CANCEL_MASK)
1789 
1790 #define HCI_SUPP_COMMANDS_PERIODIC_INQUIRY_MASK     0x04
1791 #define HCI_SUPP_COMMANDS_PERIODIC_INQUIRY_OFF      0
1792 #define HCI_PERIODIC_INQUIRY_SUPPORTED(x)     ((x)[HCI_SUPP_COMMANDS_PERIODIC_INQUIRY_OFF] & HCI_SUPP_COMMANDS_PERIODIC_INQUIRY_MASK)
1793 
1794 #define HCI_SUPP_COMMANDS_EXIT_PERIODIC_INQUIRY_MASK    0x08
1795 #define HCI_SUPP_COMMANDS_EXIT_PERIODIC_INQUIRY_OFF     0
1796 #define HCI_EXIT_PERIODIC_INQUIRY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_EXIT_PERIODIC_INQUIRY_OFF] & HCI_SUPP_COMMANDS_EXIT_PERIODIC_INQUIRY_MASK)
1797 
1798 #define HCI_SUPP_COMMANDS_CREATE_CONN_MASK     0x10
1799 #define HCI_SUPP_COMMANDS_CREATE_CONN_OFF      0
1800 #define HCI_CREATE_CONN_SUPPORTED(x)     ((x)[HCI_SUPP_COMMANDS_CREATE_CONN_OFF] & HCI_SUPP_COMMANDS_CREATE_CONN_MASK)
1801 
1802 #define HCI_SUPP_COMMANDS_DISCONNECT_MASK         0x20
1803 #define HCI_SUPP_COMMANDS_DISCONNECT_OFF          0
1804 #define HCI_DISCONNECT_SUPPORTED(x)         ((x)[HCI_SUPP_COMMANDS_DISCONNECT_OFF] & HCI_SUPP_COMMANDS_DISCONNECT_MASK)
1805 
1806 #define HCI_SUPP_COMMANDS_ADD_SCO_CONN_MASK      0x40
1807 #define HCI_SUPP_COMMANDS_ADD_SCO_CONN_OFF       0
1808 #define HCI_ADD_SCO_CONN_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_ADD_SCO_CONN_OFF] & HCI_SUPP_COMMANDS_ADD_SCO_CONN_MASK)
1809 
1810 #define HCI_SUPP_COMMANDS_CANCEL_CREATE_CONN_MASK     0x80
1811 #define HCI_SUPP_COMMANDS_CANCEL_CREATE_CONN_OFF      0
1812 #define HCI_CANCEL_CREATE_CONN_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_CANCEL_CREATE_CONN_OFF] & HCI_SUPP_COMMANDS_CANCEL_CREATE_CONN_MASK)
1813 
1814 #define HCI_SUPP_COMMANDS_ACCEPT_CONN_REQUEST_MASK      0x01
1815 #define HCI_SUPP_COMMANDS_ACCEPT_CONN_REQUEST_OFF       1
1816 #define HCI_ACCEPT_CONN_REQUEST_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_ACCEPT_CONN_REQUEST_OFF] & HCI_SUPP_COMMANDS_ACCEPT_CONN_REQUEST_MASK)
1817 
1818 #define HCI_SUPP_COMMANDS_REJECT_CONN_REQUEST_MASK           0x02
1819 #define HCI_SUPP_COMMANDS_REJECT_CONN_REQUEST_OFF            1
1820 #define HCI_REJECT_CONN_REQUEST_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_REJECT_CONN_REQUEST_OFF] & HCI_SUPP_COMMANDS_REJECT_CONN_REQUEST_MASK)
1821 
1822 #define HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_REPLY_MASK  0x04
1823 #define HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_REPLY_OFF   1
1824 #define HCI_LINK_KEY_REQUEST_REPLY_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_REPLY_MASK)
1825 
1826 #define HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_NEG_REPLY_MASK       0x08
1827 #define HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_NEG_REPLY_OFF        1
1828 #define HCI_LINK_KEY_REQUEST_NEG_REPLY_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_LINK_KEY_REQUEST_NEG_REPLY_MASK)
1829 
1830 #define HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_REPLY_MASK    0x10
1831 #define HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_REPLY_OFF     1
1832 #define HCI_PIN_CODE_REQUEST_REPLY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_REPLY_MASK)
1833 
1834 #define HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_NEG_REPLY_MASK    0x20
1835 #define HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_NEG_REPLY_OFF     1
1836 #define HCI_PIN_CODE_REQUEST_NEG_REPLY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_PIN_CODE_REQUEST_NEG_REPLY_MASK)
1837 
1838 #define HCI_SUPP_COMMANDS_CHANGE_CONN_PKT_TYPE_MASK          0x40
1839 #define HCI_SUPP_COMMANDS_CHANGE_CONN_PKT_TYPE_OFF           1
1840 #define HCI_CHANGE_CONN_PKT_TYPE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_CHANGE_CONN_PKT_TYPE_OFF] & HCI_SUPP_COMMANDS_CHANGE_CONN_PKT_TYPE_MASK)
1841 
1842 #define HCI_SUPP_COMMANDS_AUTH_REQUEST_MASK          0x80
1843 #define HCI_SUPP_COMMANDS_AUTH_REQUEST_OFF           1
1844 #define HCI_AUTH_REQUEST_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_AUTH_REQUEST_OFF] & HCI_SUPP_COMMANDS_AUTH_REQUEST_MASK)
1845 
1846 #define HCI_SUPP_COMMANDS_SET_CONN_ENCRYPTION_MASK      0x01
1847 #define HCI_SUPP_COMMANDS_SET_CONN_ENCRYPTION_OFF       2
1848 #define HCI_SET_CONN_ENCRYPTION_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_SET_CONN_ENCRYPTION_OFF] & HCI_SUPP_COMMANDS_SET_CONN_ENCRYPTION_MASK)
1849 
1850 #define HCI_SUPP_COMMANDS_CHANGE_CONN_LINK_KEY_MASK           0x02
1851 #define HCI_SUPP_COMMANDS_CHANGE_CONN_LINK_KEY_OFF            2
1852 #define HCI_CHANGE_CONN_LINK_KEY_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_CHANGE_CONN_LINK_KEY_OFF] & HCI_SUPP_COMMANDS_CHANGE_CONN_LINK_KEY_MASK)
1853 
1854 #define HCI_SUPP_COMMANDS_MASTER_LINK_KEY_MASK  0x04
1855 #define HCI_SUPP_COMMANDS_MASTER_LINK_KEY_OFF   2
1856 #define HCI_MASTER_LINK_KEY_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_MASTER_LINK_KEY_OFF] & HCI_SUPP_COMMANDS_MASTER_LINK_KEY_MASK)
1857 
1858 #define HCI_SUPP_COMMANDS_REMOTE_NAME_REQUEST_MASK       0x08
1859 #define HCI_SUPP_COMMANDS_REMOTE_NAME_REQUEST_OFF        2
1860 #define HCI_REMOTE_NAME_REQUEST_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_REMOTE_NAME_REQUEST_OFF] & HCI_SUPP_COMMANDS_REMOTE_NAME_REQUEST_MASK)
1861 
1862 #define HCI_SUPP_COMMANDS_CANCEL_REMOTE_NAME_REQUEST_MASK    0x10
1863 #define HCI_SUPP_COMMANDS_CANCEL_REMOTE_NAME_REQUEST_OFF     2
1864 #define HCI_CANCEL_REMOTE_NAME_REQUEST_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_CANCEL_REMOTE_NAME_REQUEST_OFF] & HCI_SUPP_COMMANDS_CANCEL_REMOTE_NAME_REQUEST_MASK)
1865 
1866 #define HCI_SUPP_COMMANDS_READ_REMOTE_SUPP_FEATURES_MASK    0x20
1867 #define HCI_SUPP_COMMANDS_READ_REMOTE_SUPP_FEATURES_OFF     2
1868 #define HCI_READ_REMOTE_SUPP_FEATURES_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_REMOTE_SUPP_FEATURES_OFF] & HCI_SUPP_COMMANDS_READ_REMOTE_SUPP_FEATURES_MASK)
1869 
1870 #define HCI_SUPP_COMMANDS_READ_REMOTE_EXT_FEATURES_MASK          0x40
1871 #define HCI_SUPP_COMMANDS_READ_REMOTE_EXT_FEATURES_OFF           2
1872 #define HCI_READ_REMOTE_EXT_FEATURES_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_REMOTE_EXT_FEATURES_OFF] & HCI_SUPP_COMMANDS_READ_REMOTE_EXT_FEATURES_MASK)
1873 
1874 #define HCI_SUPP_COMMANDS_READ_REMOTE_VER_INFO_MASK          0x80
1875 #define HCI_SUPP_COMMANDS_READ_REMOTE_VER_INFO_OFF           2
1876 #define HCI_READ_REMOTE_VER_INFO_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_REMOTE_VER_INFO_OFF] & HCI_SUPP_COMMANDS_READ_REMOTE_VER_INFO_MASK)
1877 
1878 #define HCI_SUPP_COMMANDS_READ_CLOCK_OFFSET_MASK           0x01
1879 #define HCI_SUPP_COMMANDS_READ_CLOCK_OFFSET_OFF            3
1880 #define HCI_READ_CLOCK_OFFSET_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_CLOCK_OFFSET_OFF] & HCI_SUPP_COMMANDS_READ_CLOCK_OFFSET_MASK)
1881 
1882 #define HCI_SUPP_COMMANDS_READ_LMP_HANDLE_MASK  0x02
1883 #define HCI_SUPP_COMMANDS_READ_LMP_HANDLE_OFF   3
1884 #define HCI_READ_LMP_HANDLE_SUPPORTED(x) ((x)[HCI_SUPP_COMMANDS_READ_LMP_HANDLE_OFF] & HCI_SUPP_COMMANDS_READ_LMP_HANDLE_MASK)
1885 
1886 #define HCI_SUPP_COMMANDS_HOLD_MODE_CMD_MASK           0x02
1887 #define HCI_SUPP_COMMANDS_HOLD_MODE_CMD_OFF            4
1888 #define HCI_HOLD_MODE_CMD_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_HOLD_MODE_CMD_OFF] & HCI_SUPP_COMMANDS_HOLD_MODE_CMD_MASK)
1889 
1890 #define HCI_SUPP_COMMANDS_SNIFF_MODE_CMD_MASK  0x04
1891 #define HCI_SUPP_COMMANDS_SNIFF_MODE_CMD_OFF   4
1892 #define HCI_SNIFF_MODE_CMD_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_SNIFF_MODE_CMD_OFF] & HCI_SUPP_COMMANDS_SNIFF_MODE_CMD_MASK)
1893 
1894 #define HCI_SUPP_COMMANDS_EXIT_SNIFF_MODE_MASK       0x08
1895 #define HCI_SUPP_COMMANDS_EXIT_SNIFF_MODE_OFF        4
1896 #define HCI_EXIT_SNIFF_MODE_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_EXIT_SNIFF_MODE_OFF] & HCI_SUPP_COMMANDS_EXIT_SNIFF_MODE_MASK)
1897 
1898 #define HCI_SUPP_COMMANDS_PARK_STATE_MASK    0x10
1899 #define HCI_SUPP_COMMANDS_PARK_STATE_OFF     4
1900 #define HCI_PARK_STATE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_PARK_STATE_OFF] & HCI_SUPP_COMMANDS_PARK_STATE_MASK)
1901 
1902 #define HCI_SUPP_COMMANDS_EXIT_PARK_STATE_MASK    0x20
1903 #define HCI_SUPP_COMMANDS_EXIT_PARK_STATE_OFF     4
1904 #define HCI_EXIT_PARK_STATE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_EXIT_PARK_STATE_OFF] & HCI_SUPP_COMMANDS_EXIT_PARK_STATE_MASK)
1905 
1906 #define HCI_SUPP_COMMANDS_QOS_SETUP_MASK          0x40
1907 #define HCI_SUPP_COMMANDS_QOS_SETUP_OFF           4
1908 #define HCI_QOS_SETUP_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_QOS_SETUP_OFF] & HCI_SUPP_COMMANDS_QOS_SETUP_MASK)
1909 
1910 #define HCI_SUPP_COMMANDS_ROLE_DISCOVERY_MASK          0x80
1911 #define HCI_SUPP_COMMANDS_ROLE_DISCOVERY_OFF           4
1912 #define HCI_ROLE_DISCOVERY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_ROLE_DISCOVERY_OFF] & HCI_SUPP_COMMANDS_ROLE_DISCOVERY_MASK)
1913 
1914 #define HCI_SUPP_COMMANDS_SWITCH_ROLE_MASK      0x01
1915 #define HCI_SUPP_COMMANDS_SWITCH_ROLE_OFF       5
1916 #define HCI_SWITCH_ROLE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_SWITCH_ROLE_OFF] & HCI_SUPP_COMMANDS_SWITCH_ROLE_MASK)
1917 
1918 #define HCI_SUPP_COMMANDS_READ_LINK_POLICY_SET_MASK           0x02
1919 #define HCI_SUPP_COMMANDS_READ_LINK_POLICY_SET_OFF            5
1920 #define HCI_READ_LINK_POLICY_SET_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_READ_LINK_POLICY_SET_OFF] & HCI_SUPP_COMMANDS_READ_LINK_POLICY_SET_MASK)
1921 
1922 #define HCI_SUPP_COMMANDS_WRITE_LINK_POLICY_SET_MASK  0x04
1923 #define HCI_SUPP_COMMANDS_WRITE_LINK_POLICY_SET_OFF   5
1924 #define HCI_WRITE_LINK_POLICY_SET_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_WRITE_LINK_POLICY_SET_OFF] & HCI_SUPP_COMMANDS_WRITE_LINK_POLICY_SET_MASK)
1925 
1926 #define HCI_SUPP_COMMANDS_READ_DEF_LINK_POLICY_SET_MASK       0x08
1927 #define HCI_SUPP_COMMANDS_READ_DEF_LINK_POLICY_SET_OFF        5
1928 #define HCI_READ_DEF_LINK_POLICY_SET_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_DEF_LINK_POLICY_SET_OFF] & HCI_SUPP_COMMANDS_READ_DEF_LINK_POLICY_SET_MASK)
1929 
1930 #define HCI_SUPP_COMMANDS_WRITE_DEF_LINK_POLICY_SET_MASK    0x10
1931 #define HCI_SUPP_COMMANDS_WRITE_DEF_LINK_POLICY_SET_OFF     5
1932 #define HCI_WRITE_DEF_LINK_POLICY_SET_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_DEF_LINK_POLICY_SET_OFF] & HCI_SUPP_COMMANDS_WRITE_DEF_LINK_POLICY_SET_MASK)
1933 
1934 #define HCI_SUPP_COMMANDS_FLOW_SPECIFICATION_MASK    0x20
1935 #define HCI_SUPP_COMMANDS_FLOW_SPECIFICATION_OFF     5
1936 #define HCI_FLOW_SPECIFICATION_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_FLOW_SPECIFICATION_OFF] & HCI_SUPP_COMMANDS_FLOW_SPECIFICATION_MASK)
1937 
1938 #define HCI_SUPP_COMMANDS_SET_EVENT_MASK_MASK          0x40
1939 #define HCI_SUPP_COMMANDS_SET_EVENT_MASK_OFF           5
1940 #define HCI_SET_EVENT_MASK_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_SET_EVENT_MASK_OFF] & HCI_SUPP_COMMANDS_SET_EVENT_MASK_MASK)
1941 
1942 #define HCI_SUPP_COMMANDS_RESET_MASK          0x80
1943 #define HCI_SUPP_COMMANDS_RESET_OFF           5
1944 #define HCI_RESET_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_RESET_OFF] & HCI_SUPP_COMMANDS_RESET_MASK)
1945 
1946 #define HCI_SUPP_COMMANDS_SET_EVENT_FILTER_MASK      0x01
1947 #define HCI_SUPP_COMMANDS_SET_EVENT_FILTER_OFF       6
1948 #define HCI_SET_EVENT_FILTER_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_SET_EVENT_FILTER_OFF] & HCI_SUPP_COMMANDS_SET_EVENT_FILTER_MASK)
1949 
1950 #define HCI_SUPP_COMMANDS_FLUSH_MASK           0x02
1951 #define HCI_SUPP_COMMANDS_FLUSH_OFF            6
1952 #define HCI_FLUSH_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_FLUSH_OFF] & HCI_SUPP_COMMANDS_FLUSH_MASK)
1953 
1954 #define HCI_SUPP_COMMANDS_READ_PIN_TYPE_MASK  0x04
1955 #define HCI_SUPP_COMMANDS_READ_PIN_TYPE_OFF   6
1956 #define HCI_READ_PIN_TYPE_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_PIN_TYPE_OFF] & HCI_SUPP_COMMANDS_READ_PIN_TYPE_MASK)
1957 
1958 #define HCI_SUPP_COMMANDS_WRITE_PIN_TYPE_MASK       0x08
1959 #define HCI_SUPP_COMMANDS_WRITE_PIN_TYPE_OFF        6
1960 #define HCI_WRITE_PIN_TYPE_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_WRITE_PIN_TYPE_OFF] & HCI_SUPP_COMMANDS_WRITE_PIN_TYPE_MASK)
1961 
1962 #define HCI_SUPP_COMMANDS_CREATE_NEW_UNIT_KEY_MASK    0x10
1963 #define HCI_SUPP_COMMANDS_CREATE_NEW_UNIT_KEY_OFF     6
1964 #define HCI_CREATE_NEW_UNIT_KEY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_CREATE_NEW_UNIT_KEY_OFF] & HCI_SUPP_COMMANDS_CREATE_NEW_UNIT_KEY_MASK)
1965 
1966 #define HCI_SUPP_COMMANDS_READ_STORED_LINK_KEY_MASK    0x20
1967 #define HCI_SUPP_COMMANDS_READ_STORED_LINK_KEY_OFF     6
1968 #define HCI_READ_STORED_LINK_KEY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_STORED_LINK_KEY_OFF] & HCI_SUPP_COMMANDS_READ_STORED_LINK_KEY_MASK)
1969 
1970 #define HCI_SUPP_COMMANDS_WRITE_STORED_LINK_KEY_MASK          0x40
1971 #define HCI_SUPP_COMMANDS_WRITE_STORED_LINK_KEY_OFF           6
1972 #define HCI_WRITE_STORED_LINK_KEY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_STORED_LINK_KEY_OFF] & HCI_SUPP_COMMANDS_WRITE_STORED_LINK_KEY_MASK)
1973 
1974 #define HCI_SUPP_COMMANDS_DELETE_STORED_LINK_KEY_MASK          0x80
1975 #define HCI_SUPP_COMMANDS_DELETE_STORED_LINK_KEY_OFF           6
1976 #define HCI_DELETE_STORED_LINK_KEY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_DELETE_STORED_LINK_KEY_OFF] & HCI_SUPP_COMMANDS_DELETE_STORED_LINK_KEY_MASK)
1977 
1978 #define HCI_SUPP_COMMANDS_WRITE_LOCAL_NAME_MASK      0x01
1979 #define HCI_SUPP_COMMANDS_WRITE_LOCAL_NAME_OFF       7
1980 #define HCI_WRITE_LOCAL_NAME_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_LOCAL_NAME_OFF] & HCI_SUPP_COMMANDS_WRITE_LOCAL_NAME_MASK)
1981 
1982 #define HCI_SUPP_COMMANDS_READ_LOCAL_NAME_MASK           0x02
1983 #define HCI_SUPP_COMMANDS_READ_LOCAL_NAME_OFF            7
1984 #define HCI_READ_LOCAL_NAME_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_NAME_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_NAME_MASK)
1985 
1986 #define HCI_SUPP_COMMANDS_READ_CONN_ACCEPT_TOUT_MASK  0x04
1987 #define HCI_SUPP_COMMANDS_READ_CONN_ACCEPT_TOUT_OFF   7
1988 #define HCI_READ_CONN_ACCEPT_TOUT_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_CONN_ACCEPT_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_CONN_ACCEPT_TOUT_MASK)
1989 
1990 #define HCI_SUPP_COMMANDS_WRITE_CONN_ACCEPT_TOUT_MASK       0x08
1991 #define HCI_SUPP_COMMANDS_WRITE_CONN_ACCEPT_TOUT_OFF        7
1992 #define HCI_WRITE_CONN_ACCEPT_TOUT_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_WRITE_CONN_ACCEPT_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_CONN_ACCEPT_TOUT_MASK)
1993 
1994 #define HCI_SUPP_COMMANDS_READ_PAGE_TOUT_MASK    0x10
1995 #define HCI_SUPP_COMMANDS_READ_PAGE_TOUT_OFF     7
1996 #define HCI_READ_PAGE_TOUT_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_PAGE_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_PAGE_TOUT_MASK)
1997 
1998 #define HCI_SUPP_COMMANDS_WRITE_PAGE_TOUT_MASK    0x20
1999 #define HCI_SUPP_COMMANDS_WRITE_PAGE_TOUT_OFF     7
2000 #define HCI_WRITE_PAGE_TOUT_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_PAGE_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_PAGE_TOUT_MASK)
2001 
2002 #define HCI_SUPP_COMMANDS_READ_SCAN_ENABLE_MASK          0x40
2003 #define HCI_SUPP_COMMANDS_READ_SCAN_ENABLE_OFF           7
2004 #define HCI_READ_SCAN_ENABLE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_SCAN_ENABLE_OFF] & HCI_SUPP_COMMANDS_READ_SCAN_ENABLE_MASK)
2005 
2006 #define HCI_SUPP_COMMANDS_WRITE_SCAN_ENABLE_MASK          0x80
2007 #define HCI_SUPP_COMMANDS_WRITE_SCAN_ENABLE_OFF           7
2008 #define HCI_WRITE_SCAN_ENABLE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_SCAN_ENABLE_OFF] & HCI_SUPP_COMMANDS_WRITE_SCAN_ENABLE_MASK)
2009 
2010 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_ACTIVITY_MASK      0x01
2011 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_ACTIVITY_OFF       8
2012 #define HCI_READ_PAGE_SCAN_ACTIVITY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_PAGE_SCAN_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_READ_PAGE_SCAN_ACTIVITY_MASK)
2013 
2014 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_ACTIVITY_MASK           0x02
2015 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_ACTIVITY_OFF            8
2016 #define HCI_WRITE_PAGE_SCAN_ACTIVITY_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_ACTIVITY_MASK)
2017 
2018 #define HCI_SUPP_COMMANDS_READ_INQURIY_SCAN_ACTIVITY_MASK  0x04
2019 #define HCI_SUPP_COMMANDS_READ_INQURIY_SCAN_ACTIVITY_OFF   8
2020 #define HCI_READ_INQURIY_SCAN_ACTIVITY_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_INQURIY_SCAN_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_READ_INQURIY_SCAN_ACTIVITY_MASK)
2021 
2022 #define HCI_SUPP_COMMANDS_WRITE_INQURIY_SCAN_ACTIVITY_MASK       0x08
2023 #define HCI_SUPP_COMMANDS_WRITE_INQURIY_SCAN_ACTIVITY_OFF        8
2024 #define HCI_WRITE_INQURIY_SCAN_ACTIVITY_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_WRITE_INQURIY_SCAN_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_WRITE_INQURIY_SCAN_ACTIVITY_MASK)
2025 
2026 #define HCI_SUPP_COMMANDS_READ_AUTH_ENABLE_MASK    0x10
2027 #define HCI_SUPP_COMMANDS_READ_AUTH_ENABLE_OFF     8
2028 #define HCI_READ_AUTH_ENABLE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_AUTH_ENABLE_OFF] & HCI_SUPP_COMMANDS_READ_AUTH_ENABLE_MASK)
2029 
2030 #define HCI_SUPP_COMMANDS_WRITE_AUTH_ENABLE_MASK    0x20
2031 #define HCI_SUPP_COMMANDS_WRITE_AUTH_ENABLE_OFF     8
2032 #define HCI_WRITE_AUTH_ENABLE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_AUTH_ENABLE_OFF] & HCI_SUPP_COMMANDS_WRITE_AUTH_ENABLE_MASK)
2033 
2034 #define HCI_SUPP_COMMANDS_READ_ENCRYPT_ENABLE_MASK          0x40
2035 #define HCI_SUPP_COMMANDS_READ_ENCRYPT_ENABLE_OFF           8
2036 #define HCI_READ_ENCRYPT_ENABLE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_ENCRYPT_ENABLE_OFF] & HCI_SUPP_COMMANDS_READ_ENCRYPT_ENABLE_MASK)
2037 
2038 #define HCI_SUPP_COMMANDS_WRITE_ENCRYPT_ENABLE_MASK          0x80
2039 #define HCI_SUPP_COMMANDS_WRITE_ENCRYPT_ENABLE_OFF           8
2040 #define HCI_WRITE_ENCRYPT_ENABLE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_ENCRYPT_ENABLE_OFF] & HCI_SUPP_COMMANDS_WRITE_ENCRYPT_ENABLE_MASK)
2041 
2042 #define HCI_SUPP_COMMANDS_READ_CLASS_DEVICE_MASK      0x01
2043 #define HCI_SUPP_COMMANDS_READ_CLASS_DEVICE_OFF       9
2044 #define HCI_READ_CLASS_DEVICE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_CLASS_DEVICE_OFF] & HCI_SUPP_COMMANDS_READ_CLASS_DEVICE_MASK)
2045 
2046 #define HCI_SUPP_COMMANDS_WRITE_CLASS_DEVICE_MASK           0x02
2047 #define HCI_SUPP_COMMANDS_WRITE_CLASS_DEVICE_OFF            9
2048 #define HCI_WRITE_CLASS_DEVICE_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_CLASS_DEVICE_OFF] & HCI_SUPP_COMMANDS_WRITE_CLASS_DEVICE_MASK)
2049 
2050 #define HCI_SUPP_COMMANDS_READ_VOICE_SETTING_MASK  0x04
2051 #define HCI_SUPP_COMMANDS_READ_VOICE_SETTING_OFF   9
2052 #define HCI_READ_VOICE_SETTING_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_VOICE_SETTING_OFF] & HCI_SUPP_COMMANDS_READ_VOICE_SETTING_MASK)
2053 
2054 #define HCI_SUPP_COMMANDS_WRITE_VOICE_SETTING_MASK       0x08
2055 #define HCI_SUPP_COMMANDS_WRITE_VOICE_SETTING_OFF        9
2056 #define HCI_WRITE_VOICE_SETTING_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_WRITE_VOICE_SETTING_OFF] & HCI_SUPP_COMMANDS_WRITE_VOICE_SETTING_MASK)
2057 
2058 #define HCI_SUPP_COMMANDS_READ_AUTO_FLUSH_TOUT_MASK    0x10
2059 #define HCI_SUPP_COMMANDS_READ_AUTO_FLUSH_TOUT_OFF     9
2060 #define HCI_READ_AUTO_FLUSH_TOUT_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_AUTO_FLUSH_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_AUTO_FLUSH_TOUT_MASK)
2061 
2062 #define HCI_SUPP_COMMANDS_WRITE_AUTO_FLUSH_TOUT_MASK    0x20
2063 #define HCI_SUPP_COMMANDS_WRITE_AUTO_FLUSH_TOUT_OFF     9
2064 #define HCI_WRITE_AUTO_FLUSH_TOUT_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_AUTO_FLUSH_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_AUTO_FLUSH_TOUT_MASK)
2065 
2066 #define HCI_SUPP_COMMANDS_READ_NUM_BROAD_RETRANS_MASK          0x40
2067 #define HCI_SUPP_COMMANDS_READ_NUM_BROAD_RETRANS_OFF           9
2068 #define HCI_READ_NUM_BROAD_RETRANS_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_NUM_BROAD_RETRANS_OFF] & HCI_SUPP_COMMANDS_READ_NUM_BROAD_RETRANS_MASK)
2069 
2070 #define HCI_SUPP_COMMANDS_WRITE_NUM_BROAD_RETRANS_MASK          0x80
2071 #define HCI_SUPP_COMMANDS_WRITE_NUM_BROAD_RETRANS_OFF           9
2072 #define HCI_WRITE_NUM_BROAD_RETRANS_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_NUM_BROAD_RETRANS_OFF] & HCI_SUPP_COMMANDS_WRITE_NUM_BROAD_RETRANS_MASK)
2073 
2074 #define HCI_SUPP_COMMANDS_READ_HOLD_MODE_ACTIVITY_MASK      0x01
2075 #define HCI_SUPP_COMMANDS_READ_HOLD_MODE_ACTIVITY_OFF       10
2076 #define HCI_READ_HOLD_MODE_ACTIVITY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_HOLD_MODE_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_READ_HOLD_MODE_ACTIVITY_MASK)
2077 
2078 #define HCI_SUPP_COMMANDS_WRITE_HOLD_MODE_ACTIVITY_MASK           0x02
2079 #define HCI_SUPP_COMMANDS_WRITE_HOLD_MODE_ACTIVITY_OFF            10
2080 #define HCI_WRITE_HOLD_MODE_ACTIVITY_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_HOLD_MODE_ACTIVITY_OFF] & HCI_SUPP_COMMANDS_WRITE_HOLD_MODE_ACTIVITY_MASK)
2081 
2082 #define HCI_SUPP_COMMANDS_READ_TRANS_PWR_LEVEL_MASK  0x04
2083 #define HCI_SUPP_COMMANDS_READ_TRANS_PWR_LEVEL_OFF   10
2084 #define HCI_READ_TRANS_PWR_LEVEL_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_TRANS_PWR_LEVEL_OFF] & HCI_SUPP_COMMANDS_READ_TRANS_PWR_LEVEL_MASK)
2085 
2086 #define HCI_SUPP_COMMANDS_READ_SYNCH_FLOW_CTRL_ENABLE_MASK       0x08
2087 #define HCI_SUPP_COMMANDS_READ_SYNCH_FLOW_CTRL_ENABLE_OFF        10
2088 #define HCI_READ_SYNCH_FLOW_CTRL_ENABLE_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_SYNCH_FLOW_CTRL_ENABLE_OFF] & HCI_SUPP_COMMANDS_READ_SYNCH_FLOW_CTRL_ENABLE_MASK)
2089 
2090 #define HCI_SUPP_COMMANDS_WRITE_SYNCH_FLOW_CTRL_ENABLE_MASK    0x10
2091 #define HCI_SUPP_COMMANDS_WRITE_SYNCH_FLOW_CTRL_ENABLE_OFF     10
2092 #define HCI_WRITE_SYNCH_FLOW_CTRL_ENABLE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_SYNCH_FLOW_CTRL_ENABLE_OFF] & HCI_SUPP_COMMANDS_WRITE_SYNCH_FLOW_CTRL_ENABLE_MASK)
2093 
2094 #define HCI_SUPP_COMMANDS_SET_HOST_CTRLR_TO_HOST_FC_MASK    0x20
2095 #define HCI_SUPP_COMMANDS_SET_HOST_CTRLR_TO_HOST_FC_OFF     10
2096 #define HCI_SET_HOST_CTRLR_TO_HOST_FC_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_SET_HOST_CTRLR_TO_HOST_FC_OFF] & HCI_SUPP_COMMANDS_SET_HOST_CTRLR_TO_HOST_FC_MASK)
2097 
2098 #define HCI_SUPP_COMMANDS_HOST_BUFFER_SIZE_MASK          0x40
2099 #define HCI_SUPP_COMMANDS_HOST_BUFFER_SIZE_OFF           10
2100 #define HCI_HOST_BUFFER_SIZE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_HOST_BUFFER_SIZE_OFF] & HCI_SUPP_COMMANDS_HOST_BUFFER_SIZE_MASK)
2101 
2102 #define HCI_SUPP_COMMANDS_HOST_NUM_COMPLETED_PKTS_MASK          0x80
2103 #define HCI_SUPP_COMMANDS_HOST_NUM_COMPLETED_PKTS_OFF           10
2104 #define HCI_HOST_NUM_COMPLETED_PKTS_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_HOST_NUM_COMPLETED_PKTS_OFF] & HCI_SUPP_COMMANDS_HOST_NUM_COMPLETED_PKTS_MASK)
2105 
2106 #define HCI_SUPP_COMMANDS_READ_LINK_SUP_TOUT_MASK      0x01
2107 #define HCI_SUPP_COMMANDS_READ_LINK_SUP_TOUT_OFF       11
2108 #define HCI_READ_LINK_SUP_TOUT_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_LINK_SUP_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_LINK_SUP_TOUT_MASK)
2109 
2110 #define HCI_SUPP_COMMANDS_WRITE_LINK_SUP_TOUT_MASK           0x02
2111 #define HCI_SUPP_COMMANDS_WRITE_LINK_SUP_TOUT_OFF            11
2112 #define HCI_WRITE_LINK_SUP_TOUT_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_LINK_SUP_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_LINK_SUP_TOUT_MASK)
2113 
2114 #define HCI_SUPP_COMMANDS_READ_NUM_SUPP_IAC_MASK  0x04
2115 #define HCI_SUPP_COMMANDS_READ_NUM_SUPP_IAC_OFF   11
2116 #define HCI_READ_NUM_SUPP_IAC_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_NUM_SUPP_IAC_OFF] & HCI_SUPP_COMMANDS_READ_NUM_SUPP_IAC_MASK)
2117 
2118 #define HCI_SUPP_COMMANDS_READ_CURRENT_IAC_LAP_MASK       0x08
2119 #define HCI_SUPP_COMMANDS_READ_CURRENT_IAC_LAP_OFF        11
2120 #define HCI_READ_CURRENT_IAC_LAP_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_CURRENT_IAC_LAP_OFF] & HCI_SUPP_COMMANDS_READ_CURRENT_IAC_LAP_MASK)
2121 
2122 #define HCI_SUPP_COMMANDS_WRITE_CURRENT_IAC_LAP_MASK    0x10
2123 #define HCI_SUPP_COMMANDS_WRITE_CURRENT_IAC_LAP_OFF     11
2124 #define HCI_WRITE_CURRENT_IAC_LAP_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_CURRENT_IAC_LAP_OFF] & HCI_SUPP_COMMANDS_WRITE_CURRENT_IAC_LAP_MASK)
2125 
2126 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_PER_MODE_MASK    0x20
2127 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_PER_MODE_OFF     11
2128 #define HCI_READ_PAGE_SCAN_PER_MODE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_PAGE_SCAN_PER_MODE_OFF] & HCI_SUPP_COMMANDS_READ_PAGE_SCAN_PER_MODE_MASK)
2129 
2130 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_PER_MODE_MASK          0x40
2131 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_PER_MODE_OFF           11
2132 #define HCI_WRITE_PAGE_SCAN_PER_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_PER_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_PER_MODE_MASK)
2133 
2134 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_MODE_MASK          0x80
2135 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_MODE_OFF           11
2136 #define HCI_READ_PAGE_SCAN_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_PAGE_SCAN_MODE_OFF] & HCI_SUPP_COMMANDS_READ_PAGE_SCAN_MODE_MASK)
2137 
2138 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_MODE_MASK      0x01
2139 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_MODE_OFF       12
2140 #define HCI_WRITE_PAGE_SCAN_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_MODE_MASK)
2141 
2142 #define HCI_SUPP_COMMANDS_SET_AFH_CHNL_CLASS_MASK           0x02
2143 #define HCI_SUPP_COMMANDS_SET_AFH_CHNL_CLASS_OFF            12
2144 #define HCI_SET_AFH_CHNL_CLASS_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_SET_AFH_CHNL_CLASS_OFF] & HCI_SUPP_COMMANDS_SET_AFH_CHNL_CLASS_MASK)
2145 
2146 #define HCI_SUPP_COMMANDS_READ_INQUIRY_SCAN_TYPE_MASK    0x10
2147 #define HCI_SUPP_COMMANDS_READ_INQUIRY_SCAN_TYPE_OFF     12
2148 #define HCI_READ_INQUIRY_SCAN_TYPE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_INQUIRY_SCAN_TYPE_OFF] & HCI_SUPP_COMMANDS_READ_INQUIRY_SCAN_TYPE_MASK)
2149 
2150 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_SCAN_TYPE_MASK    0x20
2151 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_SCAN_TYPE_OFF     12
2152 #define HCI_WRITE_INQUIRY_SCAN_TYPE_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_WRITE_INQUIRY_SCAN_TYPE_OFF] & HCI_SUPP_COMMANDS_WRITE_INQUIRY_SCAN_TYPE_MASK)
2153 
2154 #define HCI_SUPP_COMMANDS_READ_INQUIRY_MODE_MASK          0x40
2155 #define HCI_SUPP_COMMANDS_READ_INQUIRY_MODE_OFF           12
2156 #define HCI_READ_INQUIRY_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_INQUIRY_MODE_OFF] & HCI_SUPP_COMMANDS_READ_INQUIRY_MODE_MASK)
2157 
2158 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_MODE_MASK          0x80
2159 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_MODE_OFF           12
2160 #define HCI_WRITE_INQUIRY_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_WRITE_INQUIRY_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_INQUIRY_MODE_MASK)
2161 
2162 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_TYPE_MASK      0x01
2163 #define HCI_SUPP_COMMANDS_READ_PAGE_SCAN_TYPE_OFF       13
2164 #define HCI_READ_PAGE_SCAN_TYPE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_PAGE_SCAN_TYPE_OFF] & HCI_SUPP_COMMANDS_READ_PAGE_SCAN_TYPE_MASK)
2165 
2166 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_TYPE_MASK           0x02
2167 #define HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_TYPE_OFF            13
2168 #define HCI_WRITE_PAGE_SCAN_TYPE_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_TYPE_OFF] & HCI_SUPP_COMMANDS_WRITE_PAGE_SCAN_TYPE_MASK)
2169 
2170 #define HCI_SUPP_COMMANDS_READ_AFH_CHNL_ASSESS_MODE_MASK  0x04
2171 #define HCI_SUPP_COMMANDS_READ_AFH_CHNL_ASSESS_MODE_OFF   13
2172 #define HCI_READ_AFH_CHNL_ASSESS_MODE_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_AFH_CHNL_ASSESS_MODE_OFF] & HCI_SUPP_COMMANDS_READ_AFH_CHNL_ASSESS_MODE_MASK)
2173 
2174 #define HCI_SUPP_COMMANDS_WRITE_AFH_CHNL_ASSESS_MODE_MASK       0x08
2175 #define HCI_SUPP_COMMANDS_WRITE_AFH_CHNL_ASSESS_MODE_OFF        13
2176 #define HCI_WRITE_AFH_CHNL_ASSESS_MODE_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_WRITE_AFH_CHNL_ASSESS_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_AFH_CHNL_ASSESS_MODE_MASK)
2177 
2178 #define HCI_SUPP_COMMANDS_READ_LOCAL_VER_INFO_MASK       0x08
2179 #define HCI_SUPP_COMMANDS_READ_LOCAL_VER_INFO_OFF        14
2180 #define HCI_READ_LOCAL_VER_INFO_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_VER_INFO_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_VER_INFO_MASK)
2181 
2182 #define HCI_SUPP_COMMANDS_READ_LOCAL_SUP_CMDS_MASK       0x10
2183 #define HCI_SUPP_COMMANDS_READ_LOCAL_SUP_CMDS_OFF        14
2184 #define HCI_READ_LOCAL_SUP_CMDS_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_SUP_CMDS_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_SUP_CMDS_MASK)
2185 
2186 #define HCI_SUPP_COMMANDS_READ_LOCAL_SUPP_FEATURES_MASK    0x20
2187 #define HCI_SUPP_COMMANDS_READ_LOCAL_SUPP_FEATURES_OFF     14
2188 #define HCI_READ_LOCAL_SUPP_FEATURES_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_SUPP_FEATURES_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_SUPP_FEATURES_MASK)
2189 
2190 #define HCI_SUPP_COMMANDS_READ_LOCAL_EXT_FEATURES_MASK          0x40
2191 #define HCI_SUPP_COMMANDS_READ_LOCAL_EXT_FEATURES_OFF           14
2192 #define HCI_READ_LOCAL_EXT_FEATURES_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_EXT_FEATURES_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_EXT_FEATURES_MASK)
2193 
2194 #define HCI_SUPP_COMMANDS_READ_BUFFER_SIZE_MASK          0x80
2195 #define HCI_SUPP_COMMANDS_READ_BUFFER_SIZE_OFF           14
2196 #define HCI_READ_BUFFER_SIZE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_BUFFER_SIZE_OFF] & HCI_SUPP_COMMANDS_READ_BUFFER_SIZE_MASK)
2197 
2198 #define HCI_SUPP_COMMANDS_READ_COUNTRY_CODE_MASK      0x01
2199 #define HCI_SUPP_COMMANDS_READ_COUNTRY_CODE_OFF       15
2200 #define HCI_READ_COUNTRY_CODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_COUNTRY_CODE_OFF] & HCI_SUPP_COMMANDS_READ_COUNTRY_CODE_MASK)
2201 
2202 #define HCI_SUPP_COMMANDS_READ_BD_ADDR_MASK           0x02
2203 #define HCI_SUPP_COMMANDS_READ_BD_ADDR_OFF            15
2204 #define HCI_READ_BD_ADDR_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_READ_BD_ADDR_OFF] & HCI_SUPP_COMMANDS_READ_BD_ADDR_MASK)
2205 
2206 #define HCI_SUPP_COMMANDS_READ_FAIL_CONTACT_CNTR_MASK  0x04
2207 #define HCI_SUPP_COMMANDS_READ_FAIL_CONTACT_CNTR_OFF   15
2208 #define HCI_READ_FAIL_CONTACT_CNTR_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_READ_FAIL_CONTACT_CNTR_OFF] & HCI_SUPP_COMMANDS_READ_FAIL_CONTACT_CNTR_MASK)
2209 
2210 #define HCI_SUPP_COMMANDS_RESET_FAIL_CONTACT_CNTR_MASK       0x08
2211 #define HCI_SUPP_COMMANDS_RESET_FAIL_CONTACT_CNTR_OFF        15
2212 #define HCI_RESET_FAIL_CONTACT_CNTR_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_RESET_FAIL_CONTACT_CNTR_OFF] & HCI_SUPP_COMMANDS_RESET_FAIL_CONTACT_CNTR_MASK)
2213 
2214 #define HCI_SUPP_COMMANDS_GET_LINK_QUALITY_MASK    0x10
2215 #define HCI_SUPP_COMMANDS_GET_LINK_QUALITY_OFF     15
2216 #define HCI_GET_LINK_QUALITY_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_GET_LINK_QUALITY_OFF] & HCI_SUPP_COMMANDS_GET_LINK_QUALITY_MASK)
2217 
2218 #define HCI_SUPP_COMMANDS_READ_RSSI_MASK    0x20
2219 #define HCI_SUPP_COMMANDS_READ_RSSI_OFF     15
2220 #define HCI_READ_RSSI_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_READ_RSSI_OFF] & HCI_SUPP_COMMANDS_READ_RSSI_MASK)
2221 
2222 #define HCI_SUPP_COMMANDS_READ_AFH_CH_MAP_MASK          0x40
2223 #define HCI_SUPP_COMMANDS_READ_AFH_CH_MAP_OFF           15
2224 #define HCI_READ_AFH_CH_MAP_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_AFH_CH_MAP_OFF] & HCI_SUPP_COMMANDS_READ_AFH_CH_MAP_MASK)
2225 
2226 #define HCI_SUPP_COMMANDS_READ_BD_CLOCK_MASK          0x80
2227 #define HCI_SUPP_COMMANDS_READ_BD_CLOCK_OFF           15
2228 #define HCI_READ_BD_CLOCK_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_BD_CLOCK_OFF] & HCI_SUPP_COMMANDS_READ_BD_CLOCK_MASK)
2229 
2230 #define HCI_SUPP_COMMANDS_READ_LOOPBACK_MODE_MASK      0x01
2231 #define HCI_SUPP_COMMANDS_READ_LOOPBACK_MODE_OFF       16
2232 #define HCI_READ_LOOPBACK_MODE_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_READ_LOOPBACK_MODE_OFF] & HCI_SUPP_COMMANDS_READ_LOOPBACK_MODE_MASK)
2233 
2234 #define HCI_SUPP_COMMANDS_WRITE_LOOPBACK_MODE_MASK           0x02
2235 #define HCI_SUPP_COMMANDS_WRITE_LOOPBACK_MODE_OFF            16
2236 #define HCI_WRITE_LOOPBACK_MODE_SUPPORTED(x)           ((x)[HCI_SUPP_COMMANDS_WRITE_LOOPBACK_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_LOOPBACK_MODE_MASK)
2237 
2238 #define HCI_SUPP_COMMANDS_ENABLE_DEV_UNDER_TEST_MASK  0x04
2239 #define HCI_SUPP_COMMANDS_ENABLE_DEV_UNDER_TEST_OFF   16
2240 #define HCI_ENABLE_DEV_UNDER_TEST_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_ENABLE_DEV_UNDER_TEST_OFF] & HCI_SUPP_COMMANDS_ENABLE_DEV_UNDER_TEST_MASK)
2241 
2242 #define HCI_SUPP_COMMANDS_SETUP_SYNCH_CONN_MASK       0x08
2243 #define HCI_SUPP_COMMANDS_SETUP_SYNCH_CONN_OFF        16
2244 #define HCI_SETUP_SYNCH_CONN_SUPPORTED(x)       ((x)[HCI_SUPP_COMMANDS_SETUP_SYNCH_CONN_OFF] & HCI_SUPP_COMMANDS_SETUP_SYNCH_CONN_MASK)
2245 
2246 #define HCI_SUPP_COMMANDS_ACCEPT_SYNCH_CONN_MASK    0x10
2247 #define HCI_SUPP_COMMANDS_ACCEPT_SYNCH_CONN_OFF     16
2248 #define HCI_ACCEPT_SYNCH_CONN_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_ACCEPT_SYNCH_CONN_OFF] & HCI_SUPP_COMMANDS_ACCEPT_SYNCH_CONN_MASK)
2249 
2250 #define HCI_SUPP_COMMANDS_REJECT_SYNCH_CONN_MASK    0x20
2251 #define HCI_SUPP_COMMANDS_REJECT_SYNCH_CONN_OFF     16
2252 #define HCI_REJECT_SYNCH_CONN_SUPPORTED(x)    ((x)[HCI_SUPP_COMMANDS_REJECT_SYNCH_CONN_OFF] & HCI_SUPP_COMMANDS_REJECT_SYNCH_CONN_MASK)
2253 
2254 #define HCI_SUPP_COMMANDS_READ_EXT_INQUIRY_RESP_MASK   0x01
2255 #define HCI_SUPP_COMMANDS_READ_EXT_INQUIRY_RESP_OFF    17
2256 #define HCI_READ_EXT_INQUIRY_RESP_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_EXT_INQUIRY_RESP_OFF] & HCI_SUPP_COMMANDS_READ_EXT_INQUIRY_RESP_MASK)
2257 
2258 #define HCI_SUPP_COMMANDS_WRITE_EXT_INQUIRY_RESP_MASK  0x02
2259 #define HCI_SUPP_COMMANDS_WRITE_EXT_INQUIRY_RESP_OFF   17
2260 #define HCI_WRITE_EXT_INQUIRY_RESP_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_WRITE_EXT_INQUIRY_RESP_OFF] & HCI_SUPP_COMMANDS_WRITE_EXT_INQUIRY_RESP_MASK)
2261 
2262 #define HCI_SUPP_COMMANDS_REFRESH_ENCRYPTION_KEY_MASK   0x04
2263 #define HCI_SUPP_COMMANDS_REFRESH_ENCRYPTION_KEY_OFF    17
2264 #define HCI_REFRESH_ENCRYPTION_KEY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_REFRESH_ENCRYPTION_KEY_OFF] & HCI_SUPP_COMMANDS_REFRESH_ENCRYPTION_KEY_MASK)
2265 
2266 /* Octet 17, bit 3 is reserved */
2267 
2268 #define HCI_SUPP_COMMANDS_SNIFF_SUB_RATE_MASK       0x10
2269 #define HCI_SUPP_COMMANDS_SNIFF_SUB_RATE_OFF        17
2270 #define HCI_SNIFF_SUB_RATE_CMD_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SNIFF_SUB_RATE_OFF] & HCI_SUPP_COMMANDS_SNIFF_SUB_RATE_MASK)
2271 
2272 #define HCI_SUPP_COMMANDS_READ_SIMPLE_PAIRING_MODE_MASK   0x20
2273 #define HCI_SUPP_COMMANDS_READ_SIMPLE_PAIRING_MODE_OFF    17
2274 #define HCI_READ_SIMPLE_PAIRING_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_SIMPLE_PAIRING_MODE_OFF] & HCI_SUPP_COMMANDS_READ_SIMPLE_PAIRING_MODE_MASK)
2275 
2276 #define HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_MODE_MASK   0x40
2277 #define HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_MODE_OFF    17
2278 #define HCI_WRITE_SIMPLE_PAIRING_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_MODE_MASK)
2279 
2280 #define HCI_SUPP_COMMANDS_READ_LOCAL_OOB_DATA_MASK   0x80
2281 #define HCI_SUPP_COMMANDS_READ_LOCAL_OOB_DATA_OFF    17
2282 #define HCI_READ_LOCAL_OOB_DATA_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_OOB_DATA_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_OOB_DATA_MASK)
2283 
2284 #define HCI_SUPP_COMMANDS_READ_INQUIRY_RESPONSE_TX_POWER_MASK   0x01
2285 #define HCI_SUPP_COMMANDS_READ_INQUIRY_RESPONSE_TX_POWER_OFF    18
2286 #define HCI_READ_INQUIRY_RESPONSE_TX_POWER_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_INQUIRY_RESPONSE_TX_POWER_OFF] & HCI_SUPP_COMMANDS_READ_INQUIRY_RESPONSE_TX_POWER_MASK)
2287 
2288 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_RESPONSE_TX_POWER_MASK   0x02
2289 #define HCI_SUPP_COMMANDS_WRITE_INQUIRY_RESPONSE_TX_POWER_OFF    18
2290 #define HCI_WRITE_INQUIRY_RESPONSE_TX_POWER_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_INQUIRY_RESPONSE_TX_POWER_OFF] & HCI_SUPP_COMMANDS_WRITE_INQUIRY_RESPONSE_TX_POWER_MASK)
2291 
2292 #define HCI_SUPP_COMMANDS_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_MASK   0x04
2293 #define HCI_SUPP_COMMANDS_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_OFF    18
2294 #define HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_OFF] & HCI_SUPP_COMMANDS_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_MASK)
2295 
2296 #define HCI_SUPP_COMMANDS_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_MASK   0x08
2297 #define HCI_SUPP_COMMANDS_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_OFF    18
2298 #define HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_OFF] & HCI_SUPP_COMMANDS_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_MASK)
2299 
2300 #define HCI_SUPP_COMMANDS_IO_CAPABILITY_REQUEST_REPLY_MASK   0x80
2301 #define HCI_SUPP_COMMANDS_IO_CAPABILITY_REQUEST_REPLY_OFF    18
2302 #define HCI_IO_CAPABILITY_REQUEST_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_IO_CAPABILITY_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_IO_CAPABILITY_REQUEST_REPLY_MASK)
2303 
2304 #define HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_REPLY_MASK   0x01
2305 #define HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_REPLY_OFF    19
2306 #define HCI_USER_CONFIRMATION_REQUEST_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_REPLY_MASK)
2307 
2308 #define HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_NEG_REPLY_MASK   0x02
2309 #define HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_NEG_REPLY_OFF    19
2310 #define HCI_USER_CONFIRMATION_REQUEST_NEG_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_USER_CONFIRMATION_REQUEST_NEG_REPLY_MASK)
2311 
2312 #define HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_REPLY_MASK   0x04
2313 #define HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_REPLY_OFF    19
2314 #define HCI_USER_PASSKEY_REQUEST_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_REPLY_MASK)
2315 
2316 #define HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_NEG_REPLY_MASK   0x08
2317 #define HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_NEG_REPLY_OFF    19
2318 #define HCI_USER_PASSKEY_REQUEST_NEG_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_USER_PASSKEY_REQUEST_NEG_REPLY_MASK)
2319 
2320 #define HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_REPLY_MASK   0x10
2321 #define HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_REPLY_OFF    19
2322 #define HCI_REMOTE_OOB_DATA_REQUEST_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_REPLY_MASK)
2323 
2324 #define HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_DBG_MODE_MASK       0x20
2325 #define HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_DBG_MODE_OFF        19
2326 #define HCI_WRITE_SIMPLE_PAIRING_DBG_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_DBG_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_SIMPLE_PAIRING_DBG_MODE_MASK)
2327 
2328 #define HCI_SUPP_COMMANDS_ENHANCED_FLUSH_MASK   0x40
2329 #define HCI_SUPP_COMMANDS_ENHANCED_FLUSH_OFF    19
2330 #define HCI_ENHANCED_FLUSH_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_ENHANCED_FLUSH_OFF] & HCI_SUPP_COMMANDS_ENHANCED_FLUSH_MASK)
2331 
2332 #define HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_MASK       0x80
2333 #define HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_OFF        19
2334 #define HCI_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_MASK)
2335 
2336 /* Supported Commands (Byte 20) */
2337 #define HCI_SUPP_COMMANDS_SEND_KEYPRESS_NOTIF_MASK       0x04
2338 #define HCI_SUPP_COMMANDS_SEND_KEYPRESS_NOTIF_OFF        20
2339 #define HCI_SEND_NOTIF_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SEND_KEYPRESS_NOTIF_OFF] & HCI_SUPP_COMMANDS_SEND_KEYPRESS_NOTIF_MASK)
2340 
2341 #define HCI_SUPP_COMMANDS_IO_CAP_REQ_NEG_REPLY_MASK      0x08
2342 #define HCI_SUPP_COMMANDS_IO_CAP_REQ_NEG_REPLY_OFF       20
2343 #define HCI_IO_CAP_REQ_NEG_REPLY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_IO_CAP_REQ_NEG_REPLY_OFF] & HCI_SUPP_COMMANDS_IO_CAP_REQ_NEG_REPLY_MASK)
2344 
2345 #define HCI_SUPP_COMMANDS_READ_ENCR_KEY_SIZE_MASK      0x10
2346 #define HCI_SUPP_COMMANDS_READ_ENCR_KEY_SIZE_OFF       20
2347 #define HCI_READ_ENCR_KEY_SIZE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_ENCR_KEY_SIZE_OFF] & HCI_SUPP_COMMANDS_READ_ENCR_KEY_SIZE_MASK)
2348 
2349 /* Supported Commands (Byte 21) */
2350 #define HCI_SUPP_COMMANDS_CREATE_PHYSICAL_LINK_MASK   0x01
2351 #define HCI_SUPP_COMMANDS_CREATE_PHYSICAL_LINK_OFF    21
2352 #define HCI_CREATE_PHYSICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_CREATE_PHYSICAL_LINK_OFF] & HCI_SUPP_COMMANDS_CREATE_PHYSICAL_LINK_MASK)
2353 
2354 #define HCI_SUPP_COMMANDS_ACCEPT_PHYSICAL_LINK_MASK   0x02
2355 #define HCI_SUPP_COMMANDS_ACCEPT_PHYSICAL_LINK_OFF    21
2356 #define HCI_ACCEPT_PHYSICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_ACCEPT_PHYSICAL_LINK_OFF] & HCI_SUPP_COMMANDS_ACCEPT_PHYSICAL_LINK_MASK)
2357 
2358 #define HCI_SUPP_COMMANDS_DISCONNECT_PHYSICAL_LINK_MASK   0x04
2359 #define HCI_SUPP_COMMANDS_DISCONNECT_PHYSICAL_LINK_OFF    21
2360 #define HCI_DISCONNECT_PHYSICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_DISCONNECT_PHYSICAL_LINK_OFF] & HCI_SUPP_COMMANDS_DISCONNECT_PHYSICAL_LINK_MASK)
2361 
2362 #define HCI_SUPP_COMMANDS_CREATE_LOGICAL_LINK_MASK   0x08
2363 #define HCI_SUPP_COMMANDS_CREATE_LOGICAL_LINK_OFF    21
2364 #define HCI_CREATE_LOGICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_CREATE_LOGICAL_LINK_OFF] & HCI_SUPP_COMMANDS_CREATE_LOGICAL_LINK_MASK)
2365 
2366 #define HCI_SUPP_COMMANDS_ACCEPT_LOGICAL_LINK_MASK   0x10
2367 #define HCI_SUPP_COMMANDS_ACCEPT_LOGICAL_LINK_OFF    21
2368 #define HCI_ACCEPT_LOGICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_ACCEPT_LOGICAL_LINK_OFF] & HCI_SUPP_COMMANDS_ACCEPT_LOGICAL_LINK_MASK)
2369 
2370 #define HCI_SUPP_COMMANDS_DISCONNECT_LOGICAL_LINK_MASK   0x20
2371 #define HCI_SUPP_COMMANDS_DISCONNECT_LOGICAL_LINK_OFF    21
2372 #define HCI_DISCONNECT_LOGICAL_LINK_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_DISCONNECT_LOGICAL_LINK_OFF] & HCI_SUPP_COMMANDS_DISCONNECT_LOGICAL_LINK_MASK)
2373 
2374 #define HCI_SUPP_COMMANDS_LOGICAL_LINK_CANCEL_MASK   0x40
2375 #define HCI_SUPP_COMMANDS_LOGICAL_LINK_CANCEL_OFF    21
2376 #define HCI_LOGICAL_LINK_CANCEL_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_LOGICAL_LINK_CANCEL_OFF] & HCI_SUPP_COMMANDS_LOGICAL_LINK_CANCEL_MASK)
2377 
2378 #define HCI_SUPP_COMMANDS_FLOW_SPEC_MODIFY_MASK       0x80
2379 #define HCI_SUPP_COMMANDS_FLOW_SPEC_MODIFY_OFF        21
2380 #define HCI_FLOW_SPEC_MODIFY_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_FLOW_SPEC_MODIFY_OFF] & HCI_SUPP_COMMANDS_FLOW_SPEC_MODIFY_MASK)
2381 
2382 /* Supported Commands (Byte 22) */
2383 #define HCI_SUPP_COMMANDS_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_MASK   0x01
2384 #define HCI_SUPP_COMMANDS_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_OFF    22
2385 #define HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_OFF] & HCI_SUPP_COMMANDS_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_MASK)
2386 
2387 #define HCI_SUPP_COMMANDS_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_MASK   0x02
2388 #define HCI_SUPP_COMMANDS_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_OFF    22
2389 #define HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_MASK)
2390 
2391 #define HCI_SUPP_COMMANDS_SET_EVENT_MASK_PAGE_2_MASK   0x04
2392 #define HCI_SUPP_COMMANDS_SET_EVENT_MASK_PAGE_2_OFF    22
2393 #define HCI_SET_EVENT_MASK_PAGE_2_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_EVENT_MASK_PAGE_2_OFF] & HCI_SUPP_COMMANDS_SET_EVENT_MASK_PAGE_2_MASK)
2394 
2395 #define HCI_SUPP_COMMANDS_READ_LOCATION_DATA_MASK   0x08
2396 #define HCI_SUPP_COMMANDS_READ_LOCATION_DATA_OFF    22
2397 #define HCI_READ_LOCATION_DATA_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOCATION_DATA_OFF] & HCI_SUPP_COMMANDS_READ_LOCATION_DATA_MASK)
2398 
2399 #define HCI_SUPP_COMMANDS_WRITE_LOCATION_DATA_MASK   0x10
2400 #define HCI_SUPP_COMMANDS_WRITE_LOCATION_DATA_OFF    22
2401 #define HCI_WRITE_LOCATION_DATA_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_LOCATION_DATA_OFF] & HCI_SUPP_COMMANDS_WRITE_LOCATION_DATA_MASK)
2402 
2403 #define HCI_SUPP_COMMANDS_READ_LOCAL_AMP_INFO_MASK   0x20
2404 #define HCI_SUPP_COMMANDS_READ_LOCAL_AMP_INFO_OFF    22
2405 #define HCI_READ_LOCAL_AMP_INFO_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_AMP_INFO_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_AMP_INFO_MASK)
2406 
2407 #define HCI_SUPP_COMMANDS_READ_LOCAL_AMP_ASSOC_MASK   0x40
2408 #define HCI_SUPP_COMMANDS_READ_LOCAL_AMP_ASSOC_OFF    22
2409 #define HCI_READ_LOCAL_AMP_ASSOC_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_AMP_ASSOC_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_AMP_ASSOC_MASK)
2410 
2411 #define HCI_SUPP_COMMANDS_WRITE_REMOTE_AMP_ASSOC_MASK   0x80
2412 #define HCI_SUPP_COMMANDS_WRITE_REMOTE_AMP_ASSOC_OFF    22
2413 #define HCI_WRITE_REMOTE_AMP_ASSOC_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_REMOTE_AMP_ASSOC_OFF] & HCI_SUPP_COMMANDS_WRITE_REMOTE_AMP_ASSOC_MASK)
2414 
2415 /* Supported Commands (Byte 23) */
2416 #define HCI_SUPP_COMMANDS_READ_FLOW_CONTROL_MODE_MASK   0x01
2417 #define HCI_SUPP_COMMANDS_READ_FLOW_CONTROL_MODE_OFF    23
2418 #define HCI_READ_FLOW_CONTROL_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_FLOW_CONTROL_MODE_OFF] & HCI_SUPP_COMMANDS_READ_FLOW_CONTROL_MODE_MASK)
2419 
2420 #define HCI_SUPP_COMMANDS_WRITE_FLOW_CONTROL_MODE_MASK   0x02
2421 #define HCI_SUPP_COMMANDS_WRITE_FLOW_CONTROL_MODE_OFF    23
2422 #define HCI_WRITE_FLOW_CONTROL_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_FLOW_CONTROL_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_FLOW_CONTROL_MODE_MASK)
2423 
2424 #define HCI_SUPP_COMMANDS_READ_DATA_BLOCK_SIZE_MASK   0x04
2425 #define HCI_SUPP_COMMANDS_READ_DATA_BLOCK_SIZE_OFF    23
2426 #define HCI_READ_DATA_BLOCK_SIZE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_DATA_BLOCK_SIZE_OFF] & HCI_SUPP_COMMANDS_READ_DATA_BLOCK_SIZE_MASK)
2427 
2428 #define HCI_SUPP_COMMANDS_ENABLE_AMP_RCVR_REPORTS_MASK   0x20
2429 #define HCI_SUPP_COMMANDS_ENABLE_AMP_RCVR_REPORTS_OFF    23
2430 #define HCI_ENABLE_AMP_RCVR_REPORTS_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_ENABLE_AMP_RCVR_REPORTS_OFF] & HCI_SUPP_COMMANDS_ENABLE_AMP_RCVR_REPORTS_MASK)
2431 
2432 #define HCI_SUPP_COMMANDS_AMP_TEST_END_MASK   0x40
2433 #define HCI_SUPP_COMMANDS_AMP_TEST_END_OFF    23
2434 #define HCI_AMP_TEST_END_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_AMP_TEST_END_OFF] & HCI_SUPP_COMMANDS_AMP_TEST_END_MASK)
2435 
2436 #define HCI_SUPP_COMMANDS_AMP_TEST_MASK   0x80
2437 #define HCI_SUPP_COMMANDS_AMP_TEST_OFF    23
2438 #define HCI_AMP_TEST_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_AMP_TEST_OFF] & HCI_SUPP_COMMANDS_AMP_TEST_MASK)
2439 
2440 /* Supported Commands (Byte 24) */
2441 #define HCI_SUPP_COMMANDS_READ_TRANSMIT_POWER_LEVEL_MASK   0x01
2442 #define HCI_SUPP_COMMANDS_READ_TRANSMIT_POWER_LEVEL_OFF    24
2443 #define HCI_READ_TRANSMIT_POWER_LEVEL_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_TRANSMIT_POWER_LEVEL_OFF] & HCI_SUPP_COMMANDS_READ_TRANSMIT_POWER_LEVEL_MASK)
2444 
2445 #define HCI_SUPP_COMMANDS_READ_BE_FLUSH_TOUT_MASK   0x04
2446 #define HCI_SUPP_COMMANDS_READ_BE_FLUSH_TOUT_OFF    24
2447 #define HCI_READ_BE_FLUSH_TOUT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_BE_FLUSH_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_BE_FLUSH_TOUT_MASK)
2448 
2449 #define HCI_SUPP_COMMANDS_WRITE_BE_FLUSH_TOUT_MASK   0x08
2450 #define HCI_SUPP_COMMANDS_WRITE_BE_FLUSH_TOUT_OFF    24
2451 #define HCI_WRITE_BE_FLUSH_TOUT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_BE_FLUSH_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_BE_FLUSH_TOUT_MASK)
2452 
2453 #define HCI_SUPP_COMMANDS_SHORT_RANGE_MODE_MASK   0x10
2454 #define HCI_SUPP_COMMANDS_SHORT_RANGE_MODE_OFF    24
2455 #define HCI_SHORT_RANGE_MODE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SHORT_RANGE_MODE_OFF] & HCI_SUPP_COMMANDS_SHORT_RANGE_MODE_MASK)
2456 
2457 /* LE commands TBD
2458 ** Supported Commands (Byte 24 continued)
2459 ** Supported Commands (Byte 25)
2460 ** Supported Commands (Byte 26)
2461 ** Supported Commands (Byte 27)
2462 ** Supported Commands (Byte 28)
2463 */
2464 
2465 /* Supported Commands (Byte 29) */
2466 #define HCI_SUPP_COMMANDS_ENH_SETUP_SYNCH_CONN_MASK     0x08
2467 #define HCI_SUPP_COMMANDS_ENH_SETUP_SYNCH_CONN_OFF      29
2468 #define HCI_READ_ENH_SETUP_SYNCH_CONN_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_ENH_SETUP_SYNCH_CONN_OFF] & HCI_SUPP_COMMANDS_ENH_SETUP_SYNCH_CONN_MASK)
2469 
2470 #define HCI_SUPP_COMMANDS_ENH_ACCEPT_SYNCH_CONN_MASK    0x10
2471 #define HCI_SUPP_COMMANDS_ENH_ACCEPT_SYNCH_CONN_OFF     29
2472 #define HCI_READ_ENH_ACCEPT_SYNCH_CONN_SUPPORTED(x)     ((x)[HCI_SUPP_COMMANDS_ENH_ACCEPT_SYNCH_CONN_OFF] & HCI_SUPP_COMMANDS_ENH_ACCEPT_SYNCH_CONN_MASK)
2473 
2474 #define HCI_SUPP_COMMANDS_READ_LOCAL_CODECS_MASK        0x20
2475 #define HCI_SUPP_COMMANDS_READ_LOCAL_CODECS_OFF         29
2476 #define HCI_READ_LOCAL_CODECS_SUPPORTED(x)              ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_CODECS_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_CODECS_MASK)
2477 
2478 #define HCI_SUPP_COMMANDS_SET_MWS_CHANN_PARAM_MASK      0x40
2479 #define HCI_SUPP_COMMANDS_SET_MWS_CHANN_PARAM_OFF       29
2480 #define HCI_SET_MWS_CHANNEL_PARAMETERS_SUPPORTED(x)     ((x)[HCI_SUPP_COMMANDS_SET_MWS_CHANN_PARAM_OFF] & HCI_SUPP_COMMANDS_SET_MWS_CHANN_PARAM_MASK)
2481 
2482 #define HCI_SUPP_COMMANDS_SET_EXT_FRAME_CONF_MASK       0x80
2483 #define HCI_SUPP_COMMANDS_SET_EXT_FRAME_CONF_OFF        29
2484 #define HCI_SET_EXTERNAL_FRAME_CONFIGURATION_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_EXT_FRAME_CONF_OFF] & HCI_SUPP_COMMANDS_SET_EXT_FRAME_CONF_MASK)
2485 
2486 
2487 /* Supported Commands (Byte 30) */
2488 #define HCI_SUPP_COMMANDS_SET_MWS_SIGNALING_MASK     0x01
2489 #define HCI_SUPP_COMMANDS_SET_MWS_SIGNALING_OFF      30
2490 #define HCI_SET_MWS_SIGNALING_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_MWS_SIGNALING_OFF] & HCI_SUPP_COMMANDS_SET_MWS_SIGNALING_MASK)
2491 
2492 #define HCI_SUPP_COMMANDS_SET_MWS_TRANS_LAYER_MASK   0x02
2493 #define HCI_SUPP_COMMANDS_SET_MWS_TRANS_LAYER_OFF    30
2494 #define HCI_SET_MWS_TRANSPORT_LAYER_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_MWS_TRANS_LAYER_OFF] & HCI_SUPP_COMMANDS_SET_MWS_TRANS_LAYER_MASK)
2495 
2496 #define HCI_SUPP_COMMANDS_SET_MWS_SCAN_FREQ_TABLE_MASK   0x04
2497 #define HCI_SUPP_COMMANDS_SET_MWS_SCAN_FREQ_TABLE_OFF    30
2498 #define HCI_SET_MWS_SCAN_FREQUENCY_TABLE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_MWS_SCAN_FREQ_TABLE_OFF] & HCI_SUPP_COMMANDS_SET_MWS_SCAN_FREQ_TABLE_MASK)
2499 
2500 #define HCI_SUPP_COMMANDS_GET_TRANS_LAYER_CONF_MASK      0x08
2501 #define HCI_SUPP_COMMANDS_GET_TRANS_LAYER_CONF_OFF    30
2502 #define HCI_GET_MWS_TRANS_LAYER_CFG_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_GET_TRANS_LAYER_CONF_OFF] & HCI_SUPP_COMMANDS_GET_TRANS_LAYER_CONF_MASK)
2503 
2504 #define HCI_SUPP_COMMANDS_SET_MWS_PATTERN_CONF_MASK      0x10
2505 #define HCI_SUPP_COMMANDS_SET_MWS_PATTERN_CONF_OFF       30
2506 #define HCI_SET_MWS_PATTERN_CONFIGURATION_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_MWS_PATTERN_CONF_OFF] & HCI_SUPP_COMMANDS_SET_MWS_PATTERN_CONF_MASK)
2507 
2508 /* Supported Commands (Byte 30 bit 5) */
2509 #define HCI_SUPP_COMMANDS_SET_TRIG_CLK_CAP_MASK         0x20
2510 #define HCI_SUPP_COMMANDS_SET_TRIG_CLK_CAP_OFF          30
2511 #define HCI_SET_TRIG_CLK_CAP_SUPPORTED(x)               ((x)[HCI_SUPP_COMMANDS_SET_TRIG_CLK_CAP_OFF] & HCI_SUPP_COMMANDS_SET_TRIG_CLK_CAP_MASK)
2512 
2513 
2514 /* Supported Commands (Byte 30 bit 6-7) */
2515 #define HCI_SUPP_COMMANDS_TRUNCATED_PAGE             0x06
2516 #define HCI_SUPP_COMMANDS_TRUNCATED_PAGE_OFF         30
2517 #define HCI_TRUNCATED_PAGE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_TRUNCATED_PAGE_OFF] & HCI_SUPP_COMMANDS_TRUNCATED_PAGE)
2518 
2519 #define HCI_SUPP_COMMANDS_TRUNCATED_PAGE_CANCEL             0x07
2520 #define HCI_SUPP_COMMANDS_TRUNCATED_PAGE_CANCEL_OFF         30
2521 #define HCI_TRUNCATED_PAGE_CANCEL_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_TRUNCATED_PAGE_CANCEL_OFF] & HCI_SUPP_COMMANDS_TRUNCATED_PAGE_CANCEL)
2522 
2523 /* Supported Commands (Byte 31 bit 6-7) */
2524 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST             0x00
2525 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_OFF         31
2526 #define HCI_SET_CONLESS_SLAVE_BRCST_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_OFF] & HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST)
2527 
2528 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_RECEIVE             0x01
2529 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_RECEIVE_OFF         31
2530 #define HCI_SET_CONLESS_SLAVE_BRCST_RECEIVE_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_RECEIVE_OFF] & HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_RECEIVE)
2531 
2532 #define HCI_SUPP_COMMANDS_START_SYNC_TRAIN             0x02
2533 #define HCI_SUPP_COMMANDS_START_SYNC_TRAIN_OFF         31
2534 #define HCI_START_SYNC_TRAIN_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_START_SYNC_TRAIN_OFF] & HCI_SUPP_COMMANDS_START_SYNC_TRAIN)
2535 
2536 #define HCI_SUPP_COMMANDS_RECEIVE_SYNC_TRAIN             0x03
2537 #define HCI_SUPP_COMMANDS_RECEIVE_SYNC_TRAIN_OFF         31
2538 #define HCI_RECEIVE_SYNC_TRAIN_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_RECEIVE_SYNC_TRAIN_OFF] & HCI_SUPP_COMMANDS_RECEIVE_SYNC_TRAIN)
2539 
2540 #define HCI_SUPP_COMMANDS_SET_RESERVED_LT_ADDR             0x04
2541 #define HCI_SUPP_COMMANDS_SET_RESERVED_LT_ADDR_OFF         31
2542 #define HCI_SET_RESERVED_LT_ADDR_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_RESERVED_LT_ADDR_OFF] & HCI_SUPP_COMMANDS_SET_RESERVED_LT_ADDR)
2543 
2544 #define HCI_SUPP_COMMANDS_DELETE_RESERVED_LT_ADDR             0x05
2545 #define HCI_SUPP_COMMANDS_DELETE_RESERVED_LT_ADDR_OFF         31
2546 #define HCI_DELETE_RESERVED_LT_ADDR_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_DELETE_RESERVED_LT_ADDR_OFF] & HCI_SUPP_COMMANDS_DELETE_RESERVED_LT_ADDR)
2547 
2548 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_DATA             0x06
2549 #define HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_DATA_OFF         31
2550 #define HCI_SET_CONLESS_SLAVE_BRCST_DATA_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_DATA_OFF] & HCI_SUPP_COMMANDS_SET_CONLESS_SLAVE_BRCST_DATA)
2551 
2552 #define HCI_SUPP_COMMANDS_READ_SYNC_TRAIN_PARAM             0x07
2553 #define HCI_SUPP_COMMANDS_READ_SYNC_TRAIN_PARAM_OFF         31
2554 #define HCI_READ_SYNC_TRAIN_PARAM_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_SYNC_TRAIN_PARAM_OFF] & HCI_SUPP_COMMANDS_READ_SYNC_TRAIN_PARAM)
2555 
2556 /* Supported Commands (Byte 32 bit 0) */
2557 #define HCI_SUPP_COMMANDS_WRITE_SYNC_TRAIN_PARAM             0x00
2558 #define HCI_SUPP_COMMANDS_WRITE_SYNC_TRAIN_PARAM_OFF         32
2559 #define HCI_WRITE_SYNC_TRAIN_PARAM_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_WRITE_SYNC_TRAIN_PARAM_OFF] & HCI_SUPP_COMMANDS_WRITE_SYNC_TRAIN_PARAM)
2560 
2561 #define HCI_SUPP_COMMANDS_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_MASK   0x02
2562 #define HCI_SUPP_COMMANDS_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_OFF    32
2563 #define HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_SUPPORTED(x) ((x)[HCI_SUPP_COMMANDS_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_OFF] & HCI_SUPP_COMMANDS_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_MASK)
2564 
2565 #define HCI_SUPP_COMMANDS_READ_SECURE_CONNS_SUPPORT_MASK    0x04
2566 #define HCI_SUPP_COMMANDS_READ_SECURE_CONNS_SUPPORT_OFF     32
2567 #define HCI_READ_SECURE_CONNS_SUPPORT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_SECURE_CONNS_SUPPORT_OFF] & HCI_SUPP_COMMANDS_READ_SECURE_CONNS_SUPPORT_MASK)
2568 
2569 #define HCI_SUPP_COMMANDS_WRITE_SECURE_CONNS_SUPPORT_MASK   0x08
2570 #define HCI_SUPP_COMMANDS_WRITE_SECURE_CONNS_SUPPORT_OFF    32
2571 #define HCI_WRITE_SECURE_CONNS_SUPPORT_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_WRITE_SECURE_CONNS_SUPPORT_OFF] & HCI_SUPP_COMMANDS_WRITE_SECURE_CONNS_SUPPORT_MASK)
2572 
2573 #define HCI_SUPP_COMMANDS_READ_AUTHENT_PAYLOAD_TOUT_MASK    0x10
2574 #define HCI_SUPP_COMMANDS_READ_AUTHENT_PAYLOAD_TOUT_OFF     32
2575 #define HCI_READ_AUTHENT_PAYLOAD_TOUT_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_AUTHENT_PAYLOAD_TOUT_OFF] & HCI_SUPP_COMMANDS_READ_AUTHENT_PAYLOAD_TOUT_MASK)
2576 
2577 #define HCI_SUPP_COMMANDS_WRITE_AUTHENT_PAYLOAD_TOUT_MASK   0x20
2578 #define HCI_SUPP_COMMANDS_WRITE_AUTHENT_PAYLOAD_TOUT_OFF    32
2579 #define HCI_WRITE_AUTHENT_PAYLOAD_TOUT_SUPPORTED(x)  ((x)[HCI_SUPP_COMMANDS_WRITE_AUTHENT_PAYLOAD_TOUT_OFF] & HCI_SUPP_COMMANDS_WRITE_AUTHENT_PAYLOAD_TOUT_MASK)
2580 
2581 #define HCI_SUPP_COMMANDS_READ_LOCAL_OOB_EXTENDED_DATA_MASK 0x40
2582 #define HCI_SUPP_COMMANDS_READ_LOCAL_OOB_EXTENDED_DATA_OFF  32
2583 #define HCI_READ_LOCAL_OOB_EXTENDED_DATA_SUPPORTED(x)   ((x)[HCI_SUPP_COMMANDS_READ_LOCAL_OOB_EXTENDED_DATA_OFF] & HCI_SUPP_COMMANDS_READ_LOCAL_OOB_EXTENDED_DATA_MASK)
2584 
2585 #define HCI_SUPP_COMMANDS_WRITE_SECURE_CONNECTIONS_TEST_MODE_MASK   0x80
2586 #define HCI_SUPP_COMMANDS_WRITE_SECURE_CONNECTIONS_TEST_MODE_OFF    32
2587 #define HCI_WRITE_SECURE_CONNECTIONS_TEST_MODE_SUPPORTED(x) ((x)[HCI_SUPP_COMMANDS_WRITE_SECURE_CONNECTIONS_TEST_MODE_OFF] & HCI_SUPP_COMMANDS_WRITE_SECURE_CONNECTIONS_TEST_MODE_MASK)
2588 
2589 /* supported LE remote control connection parameter request reply */
2590 #define HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_RPY_MASK          0x10
2591 #define HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_RPY_OFF           33
2592 #define HCI_LE_RC_CONN_PARAM_UPD_RPY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_RPY_OFF] & HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_RPY_MASK)
2593 
2594 #define HCI_SUPP_COMMANDS_RLE_RC_CONN_PARAM_UPD_NEG_RPY_MASK          0x20
2595 #define HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_NEG_RPY_OFF           33
2596 #define HCI_LE_RC_CONN_PARAM_UPD_NEG_RPY_SUPPORTED(x)      ((x)[HCI_SUPP_COMMANDS_LE_RC_CONN_PARAM_UPD_NEG_RPY_OFF] & HCI_SUPP_COMMANDS_RLE_RC_CONN_PARAM_UPD_NEG_RPY_MASK)
2597 
2598 #endif
2599 
2600