103 |
103 |
/* bt.c */
|
104 |
104 |
void bt_device_init(struct bt_device_s *dev, struct bt_scatternet_s *net);
|
105 |
105 |
void bt_device_done(struct bt_device_s *dev);
|
|
106 |
|
|
107 |
/* bt-hci-csr.c */
|
|
108 |
enum {
|
|
109 |
csrhci_pin_reset,
|
|
110 |
csrhci_pin_wakeup,
|
|
111 |
__csrhci_pins,
|
|
112 |
};
|
|
113 |
qemu_irq *csrhci_pins_get(CharDriverState *chr);
|
|
114 |
CharDriverState *uart_hci_init(qemu_irq wakeup);
|
|
115 |
|
|
116 |
/* Link Management Protocol layer defines */
|
|
117 |
|
|
118 |
#define LLID_ACLU_CONT 0x1
|
|
119 |
#define LLID_ACLU_START 0x2
|
|
120 |
#define LLID_ACLC 0x3
|
|
121 |
|
|
122 |
enum lmp_pdu_type {
|
|
123 |
LMP_NAME_REQ = 0x0001,
|
|
124 |
LMP_NAME_RES = 0x0002,
|
|
125 |
LMP_ACCEPTED = 0x0003,
|
|
126 |
LMP_NOT_ACCEPTED = 0x0004,
|
|
127 |
LMP_CLKOFFSET_REQ = 0x0005,
|
|
128 |
LMP_CLKOFFSET_RES = 0x0006,
|
|
129 |
LMP_DETACH = 0x0007,
|
|
130 |
LMP_IN_RAND = 0x0008,
|
|
131 |
LMP_COMB_KEY = 0x0009,
|
|
132 |
LMP_UNIT_KEY = 0x000a,
|
|
133 |
LMP_AU_RAND = 0x000b,
|
|
134 |
LMP_SRES = 0x000c,
|
|
135 |
LMP_TEMP_RAND = 0x000d,
|
|
136 |
LMP_TEMP_KEY = 0x000e,
|
|
137 |
LMP_CRYPT_MODE_REQ = 0x000f,
|
|
138 |
LMP_CRYPT_KEY_SIZE_REQ = 0x0010,
|
|
139 |
LMP_START_ENCRYPT_REQ = 0x0011,
|
|
140 |
LMP_STOP_ENCRYPT_REQ = 0x0012,
|
|
141 |
LMP_SWITCH_REQ = 0x0013,
|
|
142 |
LMP_HOLD = 0x0014,
|
|
143 |
LMP_HOLD_REQ = 0x0015,
|
|
144 |
LMP_SNIFF_REQ = 0x0017,
|
|
145 |
LMP_UNSNIFF_REQ = 0x0018,
|
|
146 |
LMP_LMP_PARK_REQ = 0x0019,
|
|
147 |
LMP_SET_BCAST_SCAN_WND = 0x001b,
|
|
148 |
LMP_MODIFY_BEACON = 0x001c,
|
|
149 |
LMP_UNPARK_BD_ADDR_REQ = 0x001d,
|
|
150 |
LMP_UNPARK_PM_ADDR_REQ = 0x001e,
|
|
151 |
LMP_INCR_POWER_REQ = 0x001f,
|
|
152 |
LMP_DECR_POWER_REQ = 0x0020,
|
|
153 |
LMP_MAX_POWER = 0x0021,
|
|
154 |
LMP_MIN_POWER = 0x0022,
|
|
155 |
LMP_AUTO_RATE = 0x0023,
|
|
156 |
LMP_PREFERRED_RATE = 0x0024,
|
|
157 |
LMP_VERSION_REQ = 0x0025,
|
|
158 |
LMP_VERSION_RES = 0x0026,
|
|
159 |
LMP_FEATURES_REQ = 0x0027,
|
|
160 |
LMP_FEATURES_RES = 0x0028,
|
|
161 |
LMP_QUALITY_OF_SERVICE = 0x0029,
|
|
162 |
LMP_QOS_REQ = 0x002a,
|
|
163 |
LMP_RM_SCO_LINK_REQ = 0x002b,
|
|
164 |
LMP_SCO_LINK_REQ = 0x002c,
|
|
165 |
LMP_MAX_SLOT = 0x002d,
|
|
166 |
LMP_MAX_SLOT_REQ = 0x002e,
|
|
167 |
LMP_TIMING_ACCURACY_REQ = 0x002f,
|
|
168 |
LMP_TIMING_ACCURACY_RES = 0x0030,
|
|
169 |
LMP_SETUP_COMPLETE = 0x0031,
|
|
170 |
LMP_USE_SEMIPERM_KEY = 0x0032,
|
|
171 |
LMP_HOST_CONNECTION_REQ = 0x0033,
|
|
172 |
LMP_SLOT_OFFSET = 0x0034,
|
|
173 |
LMP_PAGE_MODE_REQ = 0x0035,
|
|
174 |
LMP_PAGE_SCAN_MODE_REQ = 0x0036,
|
|
175 |
LMP_SUPERVISION_TIMEOUT = 0x0037,
|
|
176 |
LMP_TEST_ACTIVATE = 0x0038,
|
|
177 |
LMP_TEST_CONTROL = 0x0039,
|
|
178 |
LMP_CRYPT_KEY_MASK_REQ = 0x003a,
|
|
179 |
LMP_CRYPT_KEY_MASK_RES = 0x003b,
|
|
180 |
LMP_SET_AFH = 0x003c,
|
|
181 |
LMP_ACCEPTED_EXT = 0x7f01,
|
|
182 |
LMP_NOT_ACCEPTED_EXT = 0x7f02,
|
|
183 |
LMP_FEATURES_REQ_EXT = 0x7f03,
|
|
184 |
LMP_FEATURES_RES_EXT = 0x7f04,
|
|
185 |
LMP_PACKET_TYPE_TBL_REQ = 0x7f0b,
|
|
186 |
LMP_ESCO_LINK_REQ = 0x7f0c,
|
|
187 |
LMP_RM_ESCO_LINK_REQ = 0x7f0d,
|
|
188 |
LMP_CHANNEL_CLASS_REQ = 0x7f10,
|
|
189 |
LMP_CHANNEL_CLASS = 0x7f11,
|
|
190 |
};
|
|
191 |
|
|
192 |
/* Host Controller Interface layer defines */
|
|
193 |
|
|
194 |
enum hci_packet_type {
|
|
195 |
HCI_COMMAND_PKT = 0x01,
|
|
196 |
HCI_ACLDATA_PKT = 0x02,
|
|
197 |
HCI_SCODATA_PKT = 0x03,
|
|
198 |
HCI_EVENT_PKT = 0x04,
|
|
199 |
HCI_VENDOR_PKT = 0xff,
|
|
200 |
};
|
|
201 |
|
|
202 |
enum bt_packet_type {
|
|
203 |
HCI_2DH1 = 1 << 1,
|
|
204 |
HCI_3DH1 = 1 << 2,
|
|
205 |
HCI_DM1 = 1 << 3,
|
|
206 |
HCI_DH1 = 1 << 4,
|
|
207 |
HCI_2DH3 = 1 << 8,
|
|
208 |
HCI_3DH3 = 1 << 9,
|
|
209 |
HCI_DM3 = 1 << 10,
|
|
210 |
HCI_DH3 = 1 << 11,
|
|
211 |
HCI_2DH5 = 1 << 12,
|
|
212 |
HCI_3DH5 = 1 << 13,
|
|
213 |
HCI_DM5 = 1 << 14,
|
|
214 |
HCI_DH5 = 1 << 15,
|
|
215 |
};
|
|
216 |
|
|
217 |
enum sco_packet_type {
|
|
218 |
HCI_HV1 = 1 << 5,
|
|
219 |
HCI_HV2 = 1 << 6,
|
|
220 |
HCI_HV3 = 1 << 7,
|
|
221 |
};
|
|
222 |
|
|
223 |
enum ev_packet_type {
|
|
224 |
HCI_EV3 = 1 << 3,
|
|
225 |
HCI_EV4 = 1 << 4,
|
|
226 |
HCI_EV5 = 1 << 5,
|
|
227 |
HCI_2EV3 = 1 << 6,
|
|
228 |
HCI_3EV3 = 1 << 7,
|
|
229 |
HCI_2EV5 = 1 << 8,
|
|
230 |
HCI_3EV5 = 1 << 9,
|
|
231 |
};
|
|
232 |
|
|
233 |
enum hci_error_code {
|
|
234 |
HCI_SUCCESS = 0x00,
|
|
235 |
HCI_UNKNOWN_COMMAND = 0x01,
|
|
236 |
HCI_NO_CONNECTION = 0x02,
|
|
237 |
HCI_HARDWARE_FAILURE = 0x03,
|
|
238 |
HCI_PAGE_TIMEOUT = 0x04,
|
|
239 |
HCI_AUTHENTICATION_FAILURE = 0x05,
|
|
240 |
HCI_PIN_OR_KEY_MISSING = 0x06,
|
|
241 |
HCI_MEMORY_FULL = 0x07,
|
|
242 |
HCI_CONNECTION_TIMEOUT = 0x08,
|
|
243 |
HCI_MAX_NUMBER_OF_CONNECTIONS = 0x09,
|
|
244 |
HCI_MAX_NUMBER_OF_SCO_CONNECTIONS = 0x0a,
|
|
245 |
HCI_ACL_CONNECTION_EXISTS = 0x0b,
|
|
246 |
HCI_COMMAND_DISALLOWED = 0x0c,
|
|
247 |
HCI_REJECTED_LIMITED_RESOURCES = 0x0d,
|
|
248 |
HCI_REJECTED_SECURITY = 0x0e,
|
|
249 |
HCI_REJECTED_PERSONAL = 0x0f,
|
|
250 |
HCI_HOST_TIMEOUT = 0x10,
|
|
251 |
HCI_UNSUPPORTED_FEATURE = 0x11,
|
|
252 |
HCI_INVALID_PARAMETERS = 0x12,
|
|
253 |
HCI_OE_USER_ENDED_CONNECTION = 0x13,
|
|
254 |
HCI_OE_LOW_RESOURCES = 0x14,
|
|
255 |
HCI_OE_POWER_OFF = 0x15,
|
|
256 |
HCI_CONNECTION_TERMINATED = 0x16,
|
|
257 |
HCI_REPEATED_ATTEMPTS = 0x17,
|
|
258 |
HCI_PAIRING_NOT_ALLOWED = 0x18,
|
|
259 |
HCI_UNKNOWN_LMP_PDU = 0x19,
|
|
260 |
HCI_UNSUPPORTED_REMOTE_FEATURE = 0x1a,
|
|
261 |
HCI_SCO_OFFSET_REJECTED = 0x1b,
|
|
262 |
HCI_SCO_INTERVAL_REJECTED = 0x1c,
|
|
263 |
HCI_AIR_MODE_REJECTED = 0x1d,
|
|
264 |
HCI_INVALID_LMP_PARAMETERS = 0x1e,
|
|
265 |
HCI_UNSPECIFIED_ERROR = 0x1f,
|
|
266 |
HCI_UNSUPPORTED_LMP_PARAMETER_VALUE = 0x20,
|
|
267 |
HCI_ROLE_CHANGE_NOT_ALLOWED = 0x21,
|
|
268 |
HCI_LMP_RESPONSE_TIMEOUT = 0x22,
|
|
269 |
HCI_LMP_ERROR_TRANSACTION_COLLISION = 0x23,
|
|
270 |
HCI_LMP_PDU_NOT_ALLOWED = 0x24,
|
|
271 |
HCI_ENCRYPTION_MODE_NOT_ACCEPTED = 0x25,
|
|
272 |
HCI_UNIT_LINK_KEY_USED = 0x26,
|
|
273 |
HCI_QOS_NOT_SUPPORTED = 0x27,
|
|
274 |
HCI_INSTANT_PASSED = 0x28,
|
|
275 |
HCI_PAIRING_NOT_SUPPORTED = 0x29,
|
|
276 |
HCI_TRANSACTION_COLLISION = 0x2a,
|
|
277 |
HCI_QOS_UNACCEPTABLE_PARAMETER = 0x2c,
|
|
278 |
HCI_QOS_REJECTED = 0x2d,
|
|
279 |
HCI_CLASSIFICATION_NOT_SUPPORTED = 0x2e,
|
|
280 |
HCI_INSUFFICIENT_SECURITY = 0x2f,
|
|
281 |
HCI_PARAMETER_OUT_OF_RANGE = 0x30,
|
|
282 |
HCI_ROLE_SWITCH_PENDING = 0x32,
|
|
283 |
HCI_SLOT_VIOLATION = 0x34,
|
|
284 |
HCI_ROLE_SWITCH_FAILED = 0x35,
|
|
285 |
};
|
|
286 |
|
|
287 |
enum acl_flag_bits {
|
|
288 |
ACL_CONT = 1 << 0,
|
|
289 |
ACL_START = 1 << 1,
|
|
290 |
ACL_ACTIVE_BCAST = 1 << 2,
|
|
291 |
ACL_PICO_BCAST = 1 << 3,
|
|
292 |
};
|
|
293 |
|
|
294 |
enum baseband_link_type {
|
|
295 |
SCO_LINK = 0x00,
|
|
296 |
ACL_LINK = 0x01,
|
|
297 |
};
|
|
298 |
|
|
299 |
enum lmp_feature_bits0 {
|
|
300 |
LMP_3SLOT = 1 << 0,
|
|
301 |
LMP_5SLOT = 1 << 1,
|
|
302 |
LMP_ENCRYPT = 1 << 2,
|
|
303 |
LMP_SOFFSET = 1 << 3,
|
|
304 |
LMP_TACCURACY = 1 << 4,
|
|
305 |
LMP_RSWITCH = 1 << 5,
|
|
306 |
LMP_HOLD_MODE = 1 << 6,
|
|
307 |
LMP_SNIFF_MODE = 1 << 7,
|
|
308 |
};
|
|
309 |
|
|
310 |
enum lmp_feature_bits1 {
|
|
311 |
LMP_PARK = 1 << 0,
|
|
312 |
LMP_RSSI = 1 << 1,
|
|
313 |
LMP_QUALITY = 1 << 2,
|
|
314 |
LMP_SCO = 1 << 3,
|
|
315 |
LMP_HV2 = 1 << 4,
|
|
316 |
LMP_HV3 = 1 << 5,
|
|
317 |
LMP_ULAW = 1 << 6,
|
|
318 |
LMP_ALAW = 1 << 7,
|
|
319 |
};
|
|
320 |
|
|
321 |
enum lmp_feature_bits2 {
|
|
322 |
LMP_CVSD = 1 << 0,
|
|
323 |
LMP_PSCHEME = 1 << 1,
|
|
324 |
LMP_PCONTROL = 1 << 2,
|
|
325 |
LMP_TRSP_SCO = 1 << 3,
|
|
326 |
LMP_BCAST_ENC = 1 << 7,
|
|
327 |
};
|
|
328 |
|
|
329 |
enum lmp_feature_bits3 {
|
|
330 |
LMP_EDR_ACL_2M = 1 << 1,
|
|
331 |
LMP_EDR_ACL_3M = 1 << 2,
|
|
332 |
LMP_ENH_ISCAN = 1 << 3,
|
|
333 |
LMP_ILACE_ISCAN = 1 << 4,
|
|
334 |
LMP_ILACE_PSCAN = 1 << 5,
|
|
335 |
LMP_RSSI_INQ = 1 << 6,
|
|
336 |
LMP_ESCO = 1 << 7,
|
|
337 |
};
|
|
338 |
|
|
339 |
enum lmp_feature_bits4 {
|
|
340 |
LMP_EV4 = 1 << 0,
|
|
341 |
LMP_EV5 = 1 << 1,
|
|
342 |
LMP_AFH_CAP_SLV = 1 << 3,
|
|
343 |
LMP_AFH_CLS_SLV = 1 << 4,
|
|
344 |
LMP_EDR_3SLOT = 1 << 7,
|
|
345 |
};
|
|
346 |
|
|
347 |
enum lmp_feature_bits5 {
|
|
348 |
LMP_EDR_5SLOT = 1 << 0,
|
|
349 |
LMP_SNIFF_SUBR = 1 << 1,
|
|
350 |
LMP_AFH_CAP_MST = 1 << 3,
|
|
351 |
LMP_AFH_CLS_MST = 1 << 4,
|
|
352 |
LMP_EDR_ESCO_2M = 1 << 5,
|
|
353 |
LMP_EDR_ESCO_3M = 1 << 6,
|
|
354 |
LMP_EDR_3S_ESCO = 1 << 7,
|
|
355 |
};
|
|
356 |
|
|
357 |
enum lmp_feature_bits6 {
|
|
358 |
LMP_EXT_INQ = 1 << 0,
|
|
359 |
};
|
|
360 |
|
|
361 |
enum lmp_feature_bits7 {
|
|
362 |
LMP_EXT_FEAT = 1 << 7,
|
|
363 |
};
|
|
364 |
|
|
365 |
enum hci_link_policy {
|
|
366 |
HCI_LP_RSWITCH = 1 << 0,
|
|
367 |
HCI_LP_HOLD = 1 << 1,
|
|
368 |
HCI_LP_SNIFF = 1 << 2,
|
|
369 |
HCI_LP_PARK = 1 << 3,
|
|
370 |
};
|
|
371 |
|
|
372 |
enum hci_link_mode {
|
|
373 |
HCI_LM_ACCEPT = 1 << 15,
|
|
374 |
HCI_LM_MASTER = 1 << 0,
|
|
375 |
HCI_LM_AUTH = 1 << 1,
|
|
376 |
HCI_LM_ENCRYPT = 1 << 2,
|
|
377 |
HCI_LM_TRUSTED = 1 << 3,
|
|
378 |
HCI_LM_RELIABLE = 1 << 4,
|
|
379 |
HCI_LM_SECURE = 1 << 5,
|
|
380 |
};
|
|
381 |
|
|
382 |
/* HCI Commands */
|
|
383 |
|
|
384 |
/* Link Control */
|
|
385 |
#define OGF_LINK_CTL 0x01
|
|
386 |
|
|
387 |
#define OCF_INQUIRY 0x0001
|
|
388 |
typedef struct {
|
|
389 |
uint8_t lap[3];
|
|
390 |
uint8_t length; /* 1.28s units */
|
|
391 |
uint8_t num_rsp;
|
|
392 |
} __attribute__ ((packed)) inquiry_cp;
|
|
393 |
#define INQUIRY_CP_SIZE 5
|
|
394 |
|
|
395 |
typedef struct {
|
|
396 |
uint8_t status;
|
|
397 |
bdaddr_t bdaddr;
|
|
398 |
} __attribute__ ((packed)) status_bdaddr_rp;
|
|
399 |
#define STATUS_BDADDR_RP_SIZE 7
|
|
400 |
|
|
401 |
#define OCF_INQUIRY_CANCEL 0x0002
|
|
402 |
|
|
403 |
#define OCF_PERIODIC_INQUIRY 0x0003
|
|
404 |
typedef struct {
|
|
405 |
uint16_t max_period; /* 1.28s units */
|
|
406 |
uint16_t min_period; /* 1.28s units */
|
|
407 |
uint8_t lap[3];
|
|
408 |
uint8_t length; /* 1.28s units */
|
|
409 |
uint8_t num_rsp;
|
|
410 |
} __attribute__ ((packed)) periodic_inquiry_cp;
|
|
411 |
#define PERIODIC_INQUIRY_CP_SIZE 9
|
|
412 |
|
|
413 |
#define OCF_EXIT_PERIODIC_INQUIRY 0x0004
|
|
414 |
|
|
415 |
#define OCF_CREATE_CONN 0x0005
|
|
416 |
typedef struct {
|
|
417 |
bdaddr_t bdaddr;
|
|
418 |
uint16_t pkt_type;
|
|
419 |
uint8_t pscan_rep_mode;
|
|
420 |
uint8_t pscan_mode;
|
|
421 |
uint16_t clock_offset;
|
|
422 |
uint8_t role_switch;
|
|
423 |
} __attribute__ ((packed)) create_conn_cp;
|
|
424 |
#define CREATE_CONN_CP_SIZE 13
|
|
425 |
|
|
426 |
#define OCF_DISCONNECT 0x0006
|
|
427 |
typedef struct {
|
|
428 |
uint16_t handle;
|
|
429 |
uint8_t reason;
|
|
430 |
} __attribute__ ((packed)) disconnect_cp;
|
|
431 |
#define DISCONNECT_CP_SIZE 3
|
|
432 |
|
|
433 |
#define OCF_ADD_SCO 0x0007
|
|
434 |
typedef struct {
|
|
435 |
uint16_t handle;
|
|
436 |
uint16_t pkt_type;
|
|
437 |
} __attribute__ ((packed)) add_sco_cp;
|
|
438 |
#define ADD_SCO_CP_SIZE 4
|
|
439 |
|
|
440 |
#define OCF_CREATE_CONN_CANCEL 0x0008
|
|
441 |
typedef struct {
|
|
442 |
uint8_t status;
|
|
443 |
bdaddr_t bdaddr;
|
|
444 |
} __attribute__ ((packed)) create_conn_cancel_cp;
|
|
445 |
#define CREATE_CONN_CANCEL_CP_SIZE 6
|
|
446 |
|
|
447 |
typedef struct {
|
|
448 |
uint8_t status;
|
|
449 |
bdaddr_t bdaddr;
|
|
450 |
} __attribute__ ((packed)) create_conn_cancel_rp;
|
|
451 |
#define CREATE_CONN_CANCEL_RP_SIZE 7
|
|
452 |
|
|
453 |
#define OCF_ACCEPT_CONN_REQ 0x0009
|
|
454 |
typedef struct {
|
|
455 |
bdaddr_t bdaddr;
|
|
456 |
uint8_t role;
|
|
457 |
} __attribute__ ((packed)) accept_conn_req_cp;
|
|
458 |
#define ACCEPT_CONN_REQ_CP_SIZE 7
|
|
459 |
|
|
460 |
#define OCF_REJECT_CONN_REQ 0x000A
|
|
461 |
typedef struct {
|
|
462 |
bdaddr_t bdaddr;
|
|
463 |
uint8_t reason;
|
|
464 |
} __attribute__ ((packed)) reject_conn_req_cp;
|
|
465 |
#define REJECT_CONN_REQ_CP_SIZE 7
|
|
466 |
|
|
467 |
#define OCF_LINK_KEY_REPLY 0x000B
|
|
468 |
typedef struct {
|
|
469 |
bdaddr_t bdaddr;
|
|
470 |
uint8_t link_key[16];
|
|
471 |
} __attribute__ ((packed)) link_key_reply_cp;
|
|
472 |
#define LINK_KEY_REPLY_CP_SIZE 22
|
|
473 |
|
|
474 |
#define OCF_LINK_KEY_NEG_REPLY 0x000C
|
|
475 |
|
|
476 |
#define OCF_PIN_CODE_REPLY 0x000D
|
|
477 |
typedef struct {
|
|
478 |
bdaddr_t bdaddr;
|
|
479 |
uint8_t pin_len;
|
|
480 |
uint8_t pin_code[16];
|
|
481 |
} __attribute__ ((packed)) pin_code_reply_cp;
|
|
482 |
#define PIN_CODE_REPLY_CP_SIZE 23
|
|
483 |
|
|
484 |
#define OCF_PIN_CODE_NEG_REPLY 0x000E
|
|
485 |
|
|
486 |
#define OCF_SET_CONN_PTYPE 0x000F
|
|
487 |
typedef struct {
|
|
488 |
uint16_t handle;
|
|
489 |
uint16_t pkt_type;
|
|
490 |
} __attribute__ ((packed)) set_conn_ptype_cp;
|
|
491 |
#define SET_CONN_PTYPE_CP_SIZE 4
|
|
492 |
|
|
493 |
#define OCF_AUTH_REQUESTED 0x0011
|
|
494 |
typedef struct {
|
|
495 |
uint16_t handle;
|
|
496 |
} __attribute__ ((packed)) auth_requested_cp;
|
|
497 |
#define AUTH_REQUESTED_CP_SIZE 2
|
|
498 |
|
|
499 |
#define OCF_SET_CONN_ENCRYPT 0x0013
|
|
500 |
typedef struct {
|
|
501 |
uint16_t handle;
|
|
502 |
uint8_t encrypt;
|
|
503 |
} __attribute__ ((packed)) set_conn_encrypt_cp;
|
|
504 |
#define SET_CONN_ENCRYPT_CP_SIZE 3
|
|
505 |
|
|
506 |
#define OCF_CHANGE_CONN_LINK_KEY 0x0015
|
|
507 |
typedef struct {
|
|
508 |
uint16_t handle;
|
|
509 |
} __attribute__ ((packed)) change_conn_link_key_cp;
|
|
510 |
#define CHANGE_CONN_LINK_KEY_CP_SIZE 2
|
|
511 |
|
|
512 |
#define OCF_MASTER_LINK_KEY 0x0017
|
|
513 |
typedef struct {
|
|
514 |
uint8_t key_flag;
|
|
515 |
} __attribute__ ((packed)) master_link_key_cp;
|
|
516 |
#define MASTER_LINK_KEY_CP_SIZE 1
|
|
517 |
|
|
518 |
#define OCF_REMOTE_NAME_REQ 0x0019
|
|
519 |
typedef struct {
|
|
520 |
bdaddr_t bdaddr;
|
|
521 |
uint8_t pscan_rep_mode;
|
|
522 |
uint8_t pscan_mode;
|
|
523 |
uint16_t clock_offset;
|
|
524 |
} __attribute__ ((packed)) remote_name_req_cp;
|
|
525 |
#define REMOTE_NAME_REQ_CP_SIZE 10
|
|
526 |
|
|
527 |
#define OCF_REMOTE_NAME_REQ_CANCEL 0x001A
|
|
528 |
typedef struct {
|
|
529 |
bdaddr_t bdaddr;
|
|
530 |
} __attribute__ ((packed)) remote_name_req_cancel_cp;
|
|
531 |
#define REMOTE_NAME_REQ_CANCEL_CP_SIZE 6
|
|
532 |
|
|
533 |
typedef struct {
|
|
534 |
uint8_t status;
|
|
535 |
bdaddr_t bdaddr;
|
|
536 |
} __attribute__ ((packed)) remote_name_req_cancel_rp;
|
|
537 |
#define REMOTE_NAME_REQ_CANCEL_RP_SIZE 7
|
|
538 |
|
|
539 |
#define OCF_READ_REMOTE_FEATURES 0x001B
|
|
540 |
typedef struct {
|
|
541 |
uint16_t handle;
|
|
542 |
} __attribute__ ((packed)) read_remote_features_cp;
|
|
543 |
#define READ_REMOTE_FEATURES_CP_SIZE 2
|
|
544 |
|
|
545 |
#define OCF_READ_REMOTE_EXT_FEATURES 0x001C
|
|
546 |
typedef struct {
|
|
547 |
uint16_t handle;
|
|
548 |
uint8_t page_num;
|
|
549 |
} __attribute__ ((packed)) read_remote_ext_features_cp;
|
|
550 |
#define READ_REMOTE_EXT_FEATURES_CP_SIZE 3
|
|
551 |
|
|
552 |
#define OCF_READ_REMOTE_VERSION 0x001D
|
|
553 |
typedef struct {
|
|
554 |
uint16_t handle;
|
|
555 |
} __attribute__ ((packed)) read_remote_version_cp;
|
|
556 |
#define READ_REMOTE_VERSION_CP_SIZE 2
|
|
557 |
|
|
558 |
#define OCF_READ_CLOCK_OFFSET 0x001F
|
|
559 |
typedef struct {
|
|
560 |
uint16_t handle;
|
|
561 |
} __attribute__ ((packed)) read_clock_offset_cp;
|
|
562 |
#define READ_CLOCK_OFFSET_CP_SIZE 2
|
|
563 |
|
|
564 |
#define OCF_READ_LMP_HANDLE 0x0020
|
|
565 |
typedef struct {
|
|
566 |
uint16_t handle;
|
|
567 |
} __attribute__ ((packed)) read_lmp_handle_cp;
|
|
568 |
#define READ_LMP_HANDLE_CP_SIZE 2
|
|
569 |
|
|
570 |
typedef struct {
|
|
571 |
uint8_t status;
|
|
572 |
uint16_t handle;
|
|
573 |
uint8_t lmp_handle;
|
|
574 |
uint32_t reserved;
|
|
575 |
} __attribute__ ((packed)) read_lmp_handle_rp;
|
|
576 |
#define READ_LMP_HANDLE_RP_SIZE 8
|
|
577 |
|
|
578 |
#define OCF_SETUP_SYNC_CONN 0x0028
|
|
579 |
typedef struct {
|
|
580 |
uint16_t handle;
|
|
581 |
uint32_t tx_bandwith;
|
|
582 |
uint32_t rx_bandwith;
|
|
583 |
uint16_t max_latency;
|
|
584 |
uint16_t voice_setting;
|
|
585 |
uint8_t retrans_effort;
|
|
586 |
uint16_t pkt_type;
|
|
587 |
} __attribute__ ((packed)) setup_sync_conn_cp;
|
|
588 |
#define SETUP_SYNC_CONN_CP_SIZE 17
|
|
589 |
|
|
590 |
#define OCF_ACCEPT_SYNC_CONN_REQ 0x0029
|
|
591 |
typedef struct {
|
|
592 |
bdaddr_t bdaddr;
|
|
593 |
uint32_t tx_bandwith;
|
|
594 |
uint32_t rx_bandwith;
|
|
595 |
uint16_t max_latency;
|
|
596 |
uint16_t voice_setting;
|
|
597 |
uint8_t retrans_effort;
|
|
598 |
uint16_t pkt_type;
|
|
599 |
} __attribute__ ((packed)) accept_sync_conn_req_cp;
|
|
600 |
#define ACCEPT_SYNC_CONN_REQ_CP_SIZE 21
|
|
601 |
|
|
602 |
#define OCF_REJECT_SYNC_CONN_REQ 0x002A
|
|
603 |
typedef struct {
|
|
604 |
bdaddr_t bdaddr;
|
|
605 |
uint8_t reason;
|
|
606 |
} __attribute__ ((packed)) reject_sync_conn_req_cp;
|
|
607 |
#define REJECT_SYNC_CONN_REQ_CP_SIZE 7
|
|
608 |
|
|
609 |
/* Link Policy */
|
|
610 |
#define OGF_LINK_POLICY 0x02
|
|
611 |
|
|
612 |
#define OCF_HOLD_MODE 0x0001
|
|
613 |
typedef struct {
|
|
614 |
uint16_t handle;
|
|
615 |
uint16_t max_interval;
|
|
616 |
uint16_t min_interval;
|
|
617 |
} __attribute__ ((packed)) hold_mode_cp;
|
|
618 |
#define HOLD_MODE_CP_SIZE 6
|
|
619 |
|
|
620 |
#define OCF_SNIFF_MODE 0x0003
|
|
621 |
typedef struct {
|
|
622 |
uint16_t handle;
|
|
623 |
uint16_t max_interval;
|
|
624 |
uint16_t min_interval;
|
|
625 |
uint16_t attempt;
|
|
626 |
uint16_t timeout;
|
|
627 |
} __attribute__ ((packed)) sniff_mode_cp;
|
|
628 |
#define SNIFF_MODE_CP_SIZE 10
|
|
629 |
|
|
630 |
#define OCF_EXIT_SNIFF_MODE 0x0004
|
|
631 |
typedef struct {
|
|
632 |
uint16_t handle;
|
|
633 |
} __attribute__ ((packed)) exit_sniff_mode_cp;
|
|
634 |
#define EXIT_SNIFF_MODE_CP_SIZE 2
|
|
635 |
|
|
636 |
#define OCF_PARK_MODE 0x0005
|
|
637 |
typedef struct {
|
|
638 |
uint16_t handle;
|
|
639 |
uint16_t max_interval;
|
|
640 |
uint16_t min_interval;
|
|
641 |
} __attribute__ ((packed)) park_mode_cp;
|
|
642 |
#define PARK_MODE_CP_SIZE 6
|
|
643 |
|
|
644 |
#define OCF_EXIT_PARK_MODE 0x0006
|
|
645 |
typedef struct {
|
|
646 |
uint16_t handle;
|
|
647 |
} __attribute__ ((packed)) exit_park_mode_cp;
|
|
648 |
#define EXIT_PARK_MODE_CP_SIZE 2
|
|
649 |
|
|
650 |
#define OCF_QOS_SETUP 0x0007
|
|
651 |
typedef struct {
|
|
652 |
uint8_t service_type; /* 1 = best effort */
|
|
653 |
uint32_t token_rate; /* Byte per seconds */
|
|
654 |
uint32_t peak_bandwidth; /* Byte per seconds */
|
|
655 |
uint32_t latency; /* Microseconds */
|
|
656 |
uint32_t delay_variation; /* Microseconds */
|
|
657 |
} __attribute__ ((packed)) hci_qos;
|
|
658 |
#define HCI_QOS_CP_SIZE 17
|
|
659 |
typedef struct {
|
|
660 |
uint16_t handle;
|
|
661 |
uint8_t flags; /* Reserved */
|
|
662 |
hci_qos qos;
|
|
663 |
} __attribute__ ((packed)) qos_setup_cp;
|
|
664 |
#define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE)
|
|
665 |
|
|
666 |
#define OCF_ROLE_DISCOVERY 0x0009
|
|
667 |
typedef struct {
|
|
668 |
uint16_t handle;
|
|
669 |
} __attribute__ ((packed)) role_discovery_cp;
|
|
670 |
#define ROLE_DISCOVERY_CP_SIZE 2
|
|
671 |
typedef struct {
|
|
672 |
uint8_t status;
|
|
673 |
uint16_t handle;
|
|
674 |
uint8_t role;
|
|
675 |
} __attribute__ ((packed)) role_discovery_rp;
|
|
676 |
#define ROLE_DISCOVERY_RP_SIZE 4
|
|
677 |
|
|
678 |
#define OCF_SWITCH_ROLE 0x000B
|
|
679 |
typedef struct {
|
|
680 |
bdaddr_t bdaddr;
|
|
681 |
uint8_t role;
|
|
682 |
} __attribute__ ((packed)) switch_role_cp;
|
|
683 |
#define SWITCH_ROLE_CP_SIZE 7
|
|
684 |
|
|
685 |
#define OCF_READ_LINK_POLICY 0x000C
|
|
686 |
typedef struct {
|
|
687 |
uint16_t handle;
|
|
688 |
} __attribute__ ((packed)) read_link_policy_cp;
|
|
689 |
#define READ_LINK_POLICY_CP_SIZE 2
|
|
690 |
typedef struct {
|
|
691 |
uint8_t status;
|
|
692 |
uint16_t handle;
|
|
693 |
uint16_t policy;
|
|
694 |
} __attribute__ ((packed)) read_link_policy_rp;
|
|
695 |
#define READ_LINK_POLICY_RP_SIZE 5
|
|
696 |
|
|
697 |
#define OCF_WRITE_LINK_POLICY 0x000D
|
|
698 |
typedef struct {
|
|
699 |
uint16_t handle;
|
|
700 |
uint16_t policy;
|
|
701 |
} __attribute__ ((packed)) write_link_policy_cp;
|
|
702 |
#define WRITE_LINK_POLICY_CP_SIZE 4
|
|
703 |
typedef struct {
|
|
704 |
uint8_t status;
|
|
705 |
uint16_t handle;
|
|
706 |
} __attribute__ ((packed)) write_link_policy_rp;
|
|
707 |
#define WRITE_LINK_POLICY_RP_SIZE 3
|
|
708 |
|
|
709 |
#define OCF_READ_DEFAULT_LINK_POLICY 0x000E
|
|
710 |
|
|
711 |
#define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F
|
|
712 |
|
|
713 |
#define OCF_FLOW_SPECIFICATION 0x0010
|
|
714 |
|
|
715 |
#define OCF_SNIFF_SUBRATE 0x0011
|
|
716 |
typedef struct {
|
|
717 |
uint16_t handle;
|
|
718 |
uint16_t max_remote_latency;
|
|
719 |
uint16_t max_local_latency;
|
|
720 |
uint16_t min_remote_timeout;
|
|
721 |
uint16_t min_local_timeout;
|
|
722 |
} __attribute__ ((packed)) sniff_subrate_cp;
|
|
723 |
#define SNIFF_SUBRATE_CP_SIZE 10
|
|
724 |
|
|
725 |
/* Host Controller and Baseband */
|
|
726 |
#define OGF_HOST_CTL 0x03
|
|
727 |
|
|
728 |
#define OCF_SET_EVENT_MASK 0x0001
|
|
729 |
typedef struct {
|
|
730 |
uint8_t mask[8];
|
|
731 |
} __attribute__ ((packed)) set_event_mask_cp;
|
|
732 |
#define SET_EVENT_MASK_CP_SIZE 8
|
|
733 |
|
|
734 |
#define OCF_RESET 0x0003
|
|
735 |
|
|
736 |
#define OCF_SET_EVENT_FLT 0x0005
|
|
737 |
typedef struct {
|
|
738 |
uint8_t flt_type;
|
|
739 |
uint8_t cond_type;
|
|
740 |
uint8_t condition[0];
|
|
741 |
} __attribute__ ((packed)) set_event_flt_cp;
|
|
742 |
#define SET_EVENT_FLT_CP_SIZE 2
|
|
743 |
|
|
744 |
enum bt_filter_type {
|
|
745 |
FLT_CLEAR_ALL = 0x00,
|
|
746 |
FLT_INQ_RESULT = 0x01,
|
|
747 |
FLT_CONN_SETUP = 0x02,
|
|
748 |
};
|
|
749 |
enum inq_result_cond_type {
|
|
750 |
INQ_RESULT_RETURN_ALL = 0x00,
|
|
751 |
INQ_RESULT_RETURN_CLASS = 0x01,
|
|
752 |
INQ_RESULT_RETURN_BDADDR = 0x02,
|
|
753 |
};
|
|
754 |
enum conn_setup_cond_type {
|
|
755 |
CONN_SETUP_ALLOW_ALL = 0x00,
|
|
756 |
CONN_SETUP_ALLOW_CLASS = 0x01,
|
|
757 |
CONN_SETUP_ALLOW_BDADDR = 0x02,
|
|
758 |
};
|
|
759 |
enum conn_setup_cond {
|
|
760 |
CONN_SETUP_AUTO_OFF = 0x01,
|
|
761 |
CONN_SETUP_AUTO_ON = 0x02,
|
|
762 |
};
|
|
763 |
|
|
764 |
#define OCF_FLUSH 0x0008
|
|
765 |
typedef struct {
|
|
766 |
uint16_t handle;
|
|
767 |
} __attribute__ ((packed)) flush_cp;
|
|
768 |
#define FLUSH_CP_SIZE 2
|
|
769 |
|
|
770 |
typedef struct {
|
|
771 |
uint8_t status;
|
|
772 |
uint16_t handle;
|
|
773 |
} __attribute__ ((packed)) flush_rp;
|
|
774 |
#define FLUSH_RP_SIZE 3
|
|
775 |
|
|
776 |
#define OCF_READ_PIN_TYPE 0x0009
|
|
777 |
typedef struct {
|
|
778 |
uint8_t status;
|
|
779 |
uint8_t pin_type;
|
|
780 |
} __attribute__ ((packed)) read_pin_type_rp;
|
|
781 |
#define READ_PIN_TYPE_RP_SIZE 2
|
|
782 |
|
|
783 |
#define OCF_WRITE_PIN_TYPE 0x000A
|
|
784 |
typedef struct {
|
|
785 |
uint8_t pin_type;
|
|
786 |
} __attribute__ ((packed)) write_pin_type_cp;
|
|
787 |
#define WRITE_PIN_TYPE_CP_SIZE 1
|
|
788 |
|
|
789 |
#define OCF_CREATE_NEW_UNIT_KEY 0x000B
|
|
790 |
|
|
791 |
#define OCF_READ_STORED_LINK_KEY 0x000D
|
|
792 |
typedef struct {
|
|
793 |
bdaddr_t bdaddr;
|
|
794 |
uint8_t read_all;
|
|
795 |
} __attribute__ ((packed)) read_stored_link_key_cp;
|
|
796 |
#define READ_STORED_LINK_KEY_CP_SIZE 7
|
|
797 |
typedef struct {
|
|
798 |
uint8_t status;
|
|
799 |
uint16_t max_keys;
|
|
800 |
uint16_t num_keys;
|
|
801 |
} __attribute__ ((packed)) read_stored_link_key_rp;
|
|
802 |
#define READ_STORED_LINK_KEY_RP_SIZE 5
|
|
803 |
|
|
804 |
#define OCF_WRITE_STORED_LINK_KEY 0x0011
|
|
805 |
typedef struct {
|
|
806 |
uint8_t num_keys;
|
|
807 |
/* variable length part */
|
|
808 |
} __attribute__ ((packed)) write_stored_link_key_cp;
|
|
809 |
#define WRITE_STORED_LINK_KEY_CP_SIZE 1
|
|
810 |
typedef struct {
|
|
811 |
uint8_t status;
|
|
812 |
uint8_t num_keys;
|
|
813 |
} __attribute__ ((packed)) write_stored_link_key_rp;
|
|
814 |
#define READ_WRITE_LINK_KEY_RP_SIZE 2
|
|
815 |
|
|
816 |
#define OCF_DELETE_STORED_LINK_KEY 0x0012
|
|
817 |
typedef struct {
|
|
818 |
bdaddr_t bdaddr;
|
|
819 |
uint8_t delete_all;
|
|
820 |
} __attribute__ ((packed)) delete_stored_link_key_cp;
|
|
821 |
#define DELETE_STORED_LINK_KEY_CP_SIZE 7
|
|
822 |
typedef struct {
|
|
823 |
uint8_t status;
|
|
824 |
uint16_t num_keys;
|
|
825 |
} __attribute__ ((packed)) delete_stored_link_key_rp;
|
|
826 |
#define DELETE_STORED_LINK_KEY_RP_SIZE 3
|
|
827 |
|
|
828 |
#define OCF_CHANGE_LOCAL_NAME 0x0013
|
|
829 |
typedef struct {
|
|
830 |
char name[248];
|
|
831 |
} __attribute__ ((packed)) change_local_name_cp;
|
|
832 |
#define CHANGE_LOCAL_NAME_CP_SIZE 248
|
|
833 |
|
|
834 |
#define OCF_READ_LOCAL_NAME 0x0014
|
|
835 |
typedef struct {
|
|
836 |
uint8_t status;
|
|
837 |
char name[248];
|
|
838 |
} __attribute__ ((packed)) read_local_name_rp;
|
|
839 |
#define READ_LOCAL_NAME_RP_SIZE 249
|
|
840 |
|
|
841 |
#define OCF_READ_CONN_ACCEPT_TIMEOUT 0x0015
|
|
842 |
typedef struct {
|
|
843 |
uint8_t status;
|
|
844 |
uint16_t timeout;
|
|
845 |
} __attribute__ ((packed)) read_conn_accept_timeout_rp;
|
|
846 |
#define READ_CONN_ACCEPT_TIMEOUT_RP_SIZE 3
|
|
847 |
|
|
848 |
#define OCF_WRITE_CONN_ACCEPT_TIMEOUT 0x0016
|
|
849 |
typedef struct {
|
|
850 |
uint16_t timeout;
|
|
851 |
} __attribute__ ((packed)) write_conn_accept_timeout_cp;
|
|
852 |
#define WRITE_CONN_ACCEPT_TIMEOUT_CP_SIZE 2
|
|
853 |
|
|
854 |
#define OCF_READ_PAGE_TIMEOUT 0x0017
|
|
855 |
typedef struct {
|
|
856 |
uint8_t status;
|
|
857 |
uint16_t timeout;
|
|
858 |
} __attribute__ ((packed)) read_page_timeout_rp;
|
|
859 |
#define READ_PAGE_TIMEOUT_RP_SIZE 3
|
|
860 |
|
|
861 |
#define OCF_WRITE_PAGE_TIMEOUT 0x0018
|
|
862 |
typedef struct {
|
|
863 |
uint16_t timeout;
|
|
864 |
} __attribute__ ((packed)) write_page_timeout_cp;
|
|
865 |
#define WRITE_PAGE_TIMEOUT_CP_SIZE 2
|
|
866 |
|
|
867 |
#define OCF_READ_SCAN_ENABLE 0x0019
|
|
868 |
typedef struct {
|
|
869 |
uint8_t status;
|
|
870 |
uint8_t enable;
|
|
871 |
} __attribute__ ((packed)) read_scan_enable_rp;
|
|
872 |
#define READ_SCAN_ENABLE_RP_SIZE 2
|
|
873 |
|
|
874 |
#define OCF_WRITE_SCAN_ENABLE 0x001A
|
|
875 |
typedef struct {
|
|
876 |
uint8_t scan_enable;
|
|
877 |
} __attribute__ ((packed)) write_scan_enable_cp;
|
|
878 |
#define WRITE_SCAN_ENABLE_CP_SIZE 1
|
|
879 |
|
|
880 |
enum scan_enable_bits {
|
|
881 |
SCAN_DISABLED = 0,
|
|
882 |
SCAN_INQUIRY = 1 << 0,
|
|
883 |
SCAN_PAGE = 1 << 1,
|
|
884 |
};
|
|
885 |
|
|
886 |
#define OCF_READ_PAGE_ACTIVITY 0x001B
|
|
887 |
typedef struct {
|
|
888 |
uint8_t status;
|
|
889 |
uint16_t interval;
|
|
890 |
uint16_t window;
|
|
891 |
} __attribute__ ((packed)) read_page_activity_rp;
|
|
892 |
#define READ_PAGE_ACTIVITY_RP_SIZE 5
|
|
893 |
|
|
894 |
#define OCF_WRITE_PAGE_ACTIVITY 0x001C
|
|
895 |
typedef struct {
|
|
896 |
uint16_t interval;
|
|
897 |
uint16_t window;
|
|
898 |
} __attribute__ ((packed)) write_page_activity_cp;
|
|
899 |
#define WRITE_PAGE_ACTIVITY_CP_SIZE 4
|
|
900 |
|
|
901 |
#define OCF_READ_INQ_ACTIVITY 0x001D
|
|
902 |
typedef struct {
|
|
903 |
uint8_t status;
|
|
904 |
uint16_t interval;
|
|
905 |
uint16_t window;
|
|
906 |
} __attribute__ ((packed)) read_inq_activity_rp;
|
|
907 |
#define READ_INQ_ACTIVITY_RP_SIZE 5
|
|
908 |
|
|
909 |
#define OCF_WRITE_INQ_ACTIVITY 0x001E
|
|
910 |
typedef struct {
|
|
911 |
uint16_t interval;
|
|
912 |
uint16_t window;
|
|
913 |
} __attribute__ ((packed)) write_inq_activity_cp;
|
|
914 |
#define WRITE_INQ_ACTIVITY_CP_SIZE 4
|
|
915 |
|
|
916 |
#define OCF_READ_AUTH_ENABLE 0x001F
|
|
917 |
|
|
918 |
#define OCF_WRITE_AUTH_ENABLE 0x0020
|
|
919 |
|
|
920 |
#define AUTH_DISABLED 0x00
|
|
921 |
#define AUTH_ENABLED 0x01
|
|
922 |
|
|
923 |
#define OCF_READ_ENCRYPT_MODE 0x0021
|
|
924 |
|
|
925 |
#define OCF_WRITE_ENCRYPT_MODE 0x0022
|
|
926 |
|
|
927 |
#define ENCRYPT_DISABLED 0x00
|
|
928 |
#define ENCRYPT_P2P 0x01
|
|
929 |
#define ENCRYPT_BOTH 0x02
|
|
930 |
|
|
931 |
#define OCF_READ_CLASS_OF_DEV 0x0023
|
|
932 |
typedef struct {
|
|
933 |
uint8_t status;
|
|
934 |
uint8_t dev_class[3];
|
|
935 |
} __attribute__ ((packed)) read_class_of_dev_rp;
|
|
936 |
#define READ_CLASS_OF_DEV_RP_SIZE 4
|
|
937 |
|
|
938 |
#define OCF_WRITE_CLASS_OF_DEV 0x0024
|
|
939 |
typedef struct {
|
|
940 |
uint8_t dev_class[3];
|
|
941 |
} __attribute__ ((packed)) write_class_of_dev_cp;
|
|
942 |
#define WRITE_CLASS_OF_DEV_CP_SIZE 3
|
|
943 |
|
|
944 |
#define OCF_READ_VOICE_SETTING 0x0025
|
|
945 |
typedef struct {
|
|
946 |
uint8_t status;
|
|
947 |
uint16_t voice_setting;
|
|
948 |
} __attribute__ ((packed)) read_voice_setting_rp;
|
|
949 |
#define READ_VOICE_SETTING_RP_SIZE 3
|
|
950 |
|
|
951 |
#define OCF_WRITE_VOICE_SETTING 0x0026
|
|
952 |
typedef struct {
|
|
953 |
uint16_t voice_setting;
|
|
954 |
} __attribute__ ((packed)) write_voice_setting_cp;
|
|
955 |
#define WRITE_VOICE_SETTING_CP_SIZE 2
|
|
956 |
|
|
957 |
#define OCF_READ_AUTOMATIC_FLUSH_TIMEOUT 0x0027
|
|
958 |
|
|
959 |
#define OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT 0x0028
|
|
960 |
|
|
961 |
#define OCF_READ_NUM_BROADCAST_RETRANS 0x0029
|
|
962 |
|
|
963 |
#define OCF_WRITE_NUM_BROADCAST_RETRANS 0x002A
|
|
964 |
|
|
965 |
#define OCF_READ_HOLD_MODE_ACTIVITY 0x002B
|
|
966 |
|
|
967 |
#define OCF_WRITE_HOLD_MODE_ACTIVITY 0x002C
|
|
968 |
|
|
969 |
#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D
|
|
970 |
typedef struct {
|
|
971 |
uint16_t handle;
|
|
972 |
uint8_t type;
|
|
973 |
} __attribute__ ((packed)) read_transmit_power_level_cp;
|
|
974 |
#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3
|
|
975 |
typedef struct {
|
|
976 |
uint8_t status;
|
|
977 |
uint16_t handle;
|
|
978 |
int8_t level;
|
|
979 |
} __attribute__ ((packed)) read_transmit_power_level_rp;
|
|
980 |
#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4
|
|
981 |
|
|
982 |
#define OCF_HOST_BUFFER_SIZE 0x0033
|
|
983 |
typedef struct {
|
|
984 |
uint16_t acl_mtu;
|
|
985 |
uint8_t sco_mtu;
|
|
986 |
uint16_t acl_max_pkt;
|
|
987 |
uint16_t sco_max_pkt;
|
|
988 |
} __attribute__ ((packed)) host_buffer_size_cp;
|
|
989 |
#define HOST_BUFFER_SIZE_CP_SIZE 7
|
|
990 |
|
|
991 |
#define OCF_HOST_NUMBER_OF_COMPLETED_PACKETS 0x0035
|
|
992 |
|
|
993 |
#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036
|
|
994 |
typedef struct {
|
|
995 |
uint8_t status;
|
|
996 |
uint16_t handle;
|
|
997 |
uint16_t link_sup_to;
|
|
998 |
} __attribute__ ((packed)) read_link_supervision_timeout_rp;
|
|
999 |
#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5
|
|
1000 |
|
|
1001 |
#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037
|
|
1002 |
typedef struct {
|
|
1003 |
uint16_t handle;
|
|
1004 |
uint16_t link_sup_to;
|
|
1005 |
} __attribute__ ((packed)) write_link_supervision_timeout_cp;
|
|
1006 |
#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4
|
|
1007 |
typedef struct {
|
|
1008 |
uint8_t status;
|
|
1009 |
uint16_t handle;
|
|
1010 |
} __attribute__ ((packed)) write_link_supervision_timeout_rp;
|
|
1011 |
#define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3
|
|
1012 |
|
|
1013 |
#define OCF_READ_NUM_SUPPORTED_IAC 0x0038
|
|
1014 |
|
|
1015 |
#define MAX_IAC_LAP 0x40
|
|
1016 |
#define OCF_READ_CURRENT_IAC_LAP 0x0039
|
|
1017 |
typedef struct {
|
|
1018 |
uint8_t status;
|
|
1019 |
uint8_t num_current_iac;
|
|
1020 |
uint8_t lap[MAX_IAC_LAP][3];
|
|
1021 |
} __attribute__ ((packed)) read_current_iac_lap_rp;
|
|
1022 |
#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP
|
|
1023 |
|
|
1024 |
#define OCF_WRITE_CURRENT_IAC_LAP 0x003A
|
|
1025 |
typedef struct {
|
|
1026 |
uint8_t num_current_iac;
|
|
1027 |
uint8_t lap[MAX_IAC_LAP][3];
|
|
1028 |
} __attribute__ ((packed)) write_current_iac_lap_cp;
|
|
1029 |
#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP
|
|
1030 |
|
|
1031 |
#define OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003B
|
|
1032 |
|
|
1033 |
#define OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003C
|
|
1034 |
|
|
1035 |
#define OCF_READ_PAGE_SCAN_MODE 0x003D
|
|
1036 |
|
|
1037 |
#define OCF_WRITE_PAGE_SCAN_MODE 0x003E
|
|
1038 |
|
|
1039 |
#define OCF_SET_AFH_CLASSIFICATION 0x003F
|
|
1040 |
typedef struct {
|
|
1041 |
uint8_t map[10];
|
|
1042 |
} __attribute__ ((packed)) set_afh_classification_cp;
|
|
1043 |
#define SET_AFH_CLASSIFICATION_CP_SIZE 10
|
|
1044 |
typedef struct {
|
|
1045 |
uint8_t status;
|
|
1046 |
} __attribute__ ((packed)) set_afh_classification_rp;
|
|
1047 |
#define SET_AFH_CLASSIFICATION_RP_SIZE 1
|
|
1048 |
|
|
1049 |
#define OCF_READ_INQUIRY_SCAN_TYPE 0x0042
|
|
1050 |
typedef struct {
|
|
1051 |
uint8_t status;
|
|
1052 |
uint8_t type;
|
|
1053 |
} __attribute__ ((packed)) read_inquiry_scan_type_rp;
|
|
1054 |
#define READ_INQUIRY_SCAN_TYPE_RP_SIZE 2
|
|
1055 |
|
|
1056 |
#define OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043
|
|
1057 |
typedef struct {
|
|
1058 |
uint8_t type;
|
|
1059 |
} __attribute__ ((packed)) write_inquiry_scan_type_cp;
|
|
1060 |
#define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE 1
|
|
1061 |
typedef struct {
|
|
1062 |
uint8_t status;
|
|
1063 |
} __attribute__ ((packed)) write_inquiry_scan_type_rp;
|
|
1064 |
#define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE 1
|
|
1065 |
|
|
1066 |
#define OCF_READ_INQUIRY_MODE 0x0044
|
|
1067 |
typedef struct {
|
|
1068 |
uint8_t status;
|
|
1069 |
uint8_t mode;
|
|
1070 |
} __attribute__ ((packed)) read_inquiry_mode_rp;
|
|
1071 |
#define READ_INQUIRY_MODE_RP_SIZE 2
|
|
1072 |
|
|
1073 |
#define OCF_WRITE_INQUIRY_MODE 0x0045
|
|
1074 |
typedef struct {
|
|
1075 |
uint8_t mode;
|
|
1076 |
} __attribute__ ((packed)) write_inquiry_mode_cp;
|
|
1077 |
#define WRITE_INQUIRY_MODE_CP_SIZE 1
|
|
1078 |
typedef struct {
|
|
1079 |
uint8_t status;
|
|
1080 |
} __attribute__ ((packed)) write_inquiry_mode_rp;
|
|
1081 |
#define WRITE_INQUIRY_MODE_RP_SIZE 1
|
|
1082 |
|
|
1083 |
#define OCF_READ_PAGE_SCAN_TYPE 0x0046
|
|
1084 |
|
|
1085 |
#define OCF_WRITE_PAGE_SCAN_TYPE 0x0047
|
|
1086 |
|
|
1087 |
#define OCF_READ_AFH_MODE 0x0048
|
|
1088 |
typedef struct {
|
|
1089 |
uint8_t status;
|
|
1090 |
uint8_t mode;
|
|
1091 |
} __attribute__ ((packed)) read_afh_mode_rp;
|
|
1092 |
#define READ_AFH_MODE_RP_SIZE 2
|
|
1093 |
|
|
1094 |
#define OCF_WRITE_AFH_MODE 0x0049
|
|
1095 |
typedef struct {
|
|
1096 |
uint8_t mode;
|
|
1097 |
} __attribute__ ((packed)) write_afh_mode_cp;
|
|
1098 |
#define WRITE_AFH_MODE_CP_SIZE 1
|
|
1099 |
typedef struct {
|
|
1100 |
uint8_t status;
|
|
1101 |
} __attribute__ ((packed)) write_afh_mode_rp;
|
|
1102 |
#define WRITE_AFH_MODE_RP_SIZE 1
|
|
1103 |
|
|
1104 |
#define OCF_READ_EXT_INQUIRY_RESPONSE 0x0051
|
|
1105 |
typedef struct {
|
|
1106 |
uint8_t status;
|
|
1107 |
uint8_t fec;
|
|
1108 |
uint8_t data[240];
|
|
1109 |
} __attribute__ ((packed)) read_ext_inquiry_response_rp;
|
|
1110 |
#define READ_EXT_INQUIRY_RESPONSE_RP_SIZE 242
|
|
1111 |
|
|
1112 |
#define OCF_WRITE_EXT_INQUIRY_RESPONSE 0x0052
|
|
1113 |
typedef struct {
|
|
1114 |
uint8_t fec;
|