device: Set disconnect timer to zero for fast disconnection
[platform/upstream/bluez.git] / monitor / bt.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  *
4  *  BlueZ - Bluetooth protocol stack for Linux
5  *
6  *  Copyright (C) 2011-2014  Intel Corporation
7  *  Copyright (C) 2002-2010  Marcel Holtmann <marcel@holtmann.org>
8  *  Copyright 2023 NXP
9  *
10  *
11  */
12
13 #include <stdint.h>
14
15 #define BT_HCI_CMD_BIT(_byte, _bit) ((8 * _byte) + _bit)
16
17 struct bt_ll_hdr {
18         uint8_t  preamble;
19         uint32_t access_addr;
20 } __attribute__ ((packed));
21
22 #define BT_LL_CONN_UPDATE_REQ   0x00
23 struct bt_ll_conn_update_req {
24         uint8_t  win_size;
25         uint16_t win_offset;
26         uint16_t interval;
27         uint16_t latency;
28         uint16_t timeout;
29         uint16_t instant;
30 } __attribute__ ((packed));
31
32 #define BT_LL_CHANNEL_MAP_REQ   0x01
33 struct bt_ll_channel_map_req {
34         uint8_t  map[5];
35         uint16_t instant;
36 } __attribute__ ((packed));
37
38 #define BT_LL_TERMINATE_IND     0x02
39 struct bt_ll_terminate_ind {
40         uint8_t  error;
41 } __attribute__ ((packed));
42
43 #define BT_LL_ENC_REQ           0x03
44 struct bt_ll_enc_req {
45         uint64_t rand;
46         uint16_t ediv;
47         uint64_t skd;
48         uint32_t iv;
49 } __attribute__ ((packed));
50
51 #define BT_LL_ENC_RSP           0x04
52 struct bt_ll_enc_rsp {
53         uint64_t skd;
54         uint32_t iv;
55 } __attribute__ ((packed));
56
57 #define BT_LL_START_ENC_REQ     0x05
58
59 #define BT_LL_START_ENC_RSP     0x06
60
61 #define BT_LL_UNKNOWN_RSP       0x07
62 struct bt_ll_unknown_rsp {
63         uint8_t  type;
64 } __attribute__ ((packed));
65
66 #define BT_LL_FEATURE_REQ       0x08
67 struct bt_ll_feature_req {
68         uint8_t  features[8];
69 } __attribute__ ((packed));
70
71 #define BT_LL_FEATURE_RSP       0x09
72 struct bt_ll_feature_rsp {
73         uint8_t  features[8];
74 } __attribute__ ((packed));
75
76 #define BT_LL_PAUSE_ENC_REQ     0x0a
77
78 #define BT_LL_PAUSE_ENC_RSP     0x0b
79
80 #define BT_LL_VERSION_IND       0x0c
81 struct bt_ll_version_ind {
82         uint8_t  version;
83         uint16_t company;
84         uint16_t subversion;
85 } __attribute__ ((packed));
86
87 #define BT_LL_REJECT_IND        0x0d
88 struct bt_ll_reject_ind {
89         uint8_t  error;
90 } __attribute__ ((packed));
91
92 #define BT_LL_PERIPHERAL_FEATURE_REQ    0x0e
93 struct bt_ll_peripheral_feature_req {
94         uint8_t  features[8];
95 } __attribute__ ((packed));
96
97 #define BT_LL_CONN_PARAM_REQ    0x0f
98 struct bt_ll_conn_param_req {
99         uint16_t interval_min;
100         uint16_t interval_max;
101         uint16_t latency;
102         uint16_t timeout;
103         uint8_t pref_period;
104         uint16_t pref_conn_evt_count;
105         uint8_t offset_0;
106         uint8_t offset_1;
107         uint8_t offset_2;
108         uint8_t offset_3;
109         uint8_t offset_4;
110         uint8_t offset_5;
111 } __attribute__ ((packed));
112
113 #define BT_LL_CONN_PARAM_RSP    0x10
114 struct bt_ll_conn_param_rsp {
115         uint16_t interval_min;
116         uint16_t interval_max;
117         uint16_t latency;
118         uint16_t timeout;
119         uint8_t pref_period;
120         uint16_t pref_conn_evt_count;
121         uint8_t offset_0;
122         uint8_t offset_1;
123         uint8_t offset_2;
124         uint8_t offset_3;
125         uint8_t offset_4;
126         uint8_t offset_5;
127 } __attribute__ ((packed));
128
129 #define BT_LL_REJECT_IND_EXT    0x11
130 struct bt_ll_reject_ind_ext {
131         uint8_t  opcode;
132         uint8_t  error;
133 } __attribute__ ((packed));
134
135 #define BT_LL_PING_REQ          0x12
136
137 #define BT_LL_PING_RSP          0x13
138
139 #define BT_LL_LENGTH_REQ        0x14
140 struct bt_ll_length {
141         uint16_t rx_len;
142         uint16_t rx_time;
143         uint16_t tx_len;
144         uint16_t tx_time;
145 } __attribute__ ((packed));
146
147 #define BT_LL_LENGTH_RSP        0x15
148
149 #define BT_LL_PHY_REQ           0x16
150 struct bt_ll_phy {
151         uint8_t  tx_phys;
152         uint8_t  rx_phys;
153 } __attribute__ ((packed));
154
155 #define BT_LL_PHY_RSP           0x17
156
157 #define BT_LL_PHY_UPDATE_IND    0x18
158 struct bt_ll_phy_update_ind {
159         uint8_t  c_phy;
160         uint8_t  p_phy;
161         uint16_t instant;
162 } __attribute__ ((packed));
163
164 #define BT_LL_MIN_USED_CHANNELS 0x19
165 struct bt_ll_min_used_channels {
166         uint8_t  phys;
167         uint8_t  min_channels;
168 } __attribute__ ((packed));
169
170 #define BT_LL_CTE_REQ           0x1a
171 struct bt_ll_cte_req {
172         uint8_t  cte;
173 } __attribute__ ((packed));
174
175 #define BT_LL_CTE_RSP           0x1b
176
177 #define BT_LL_PERIODIC_SYNC_IND 0x1c
178 struct bt_ll_periodic_sync_ind {
179         uint16_t id;
180         uint8_t  info[18];
181         uint16_t event_count;
182         uint16_t last_counter;
183         uint8_t  adv_info;
184         uint8_t  phy;
185         uint8_t  adv_addr[6];
186         uint16_t sync_counter;
187 } __attribute__ ((packed));
188
189 #define BT_LL_CLOCK_ACCURACY_REQ 0x1d
190 struct bt_ll_clock_acc {
191         uint8_t  sca;
192 } __attribute__ ((packed));
193
194 #define BT_LL_CLOCK_ACCURACY_RSP 0x1e
195
196 #define BT_LL_CIS_REQ           0x1f
197 struct bt_ll_cis_req {
198         uint8_t  cig;
199         uint8_t  cis;
200         uint8_t  c_phy;
201         uint8_t  p_phy;
202         uint16_t c_sdu;
203         uint16_t p_sdu;
204         uint8_t  c_interval[3];
205         uint8_t  p_interval[3];
206         uint8_t  c_pdu;
207         uint8_t  p_pdu;
208         uint8_t  nse;
209         uint8_t  sub_interval[3];
210         uint8_t  bn;
211         uint8_t  c_ft;
212         uint8_t  p_ft;
213         uint16_t iso_interval;
214         uint8_t  offset_min[3];
215         uint8_t  offset_max[3];
216         uint16_t conn_event_count;
217 } __attribute__ ((packed));
218
219 #define BT_LL_CIS_RSP           0x20
220 struct bt_ll_cis_rsp {
221         uint8_t  offset_min[3];
222         uint8_t  offset_max[3];
223         uint16_t conn_event_count;
224 } __attribute__ ((packed));
225
226 #define BT_LL_CIS_IND           0x21
227 struct bt_ll_cis_ind {
228         uint32_t addr;
229         uint8_t  cis_offset[3];
230         uint8_t  cig_sync_delay[3];
231         uint8_t  cis_sync_delay[3];
232         uint16_t conn_event_count;
233 } __attribute__ ((packed));
234
235 #define BT_LL_CIS_TERMINATE_IND         0x22
236 struct bt_ll_cis_term_ind {
237         uint8_t  cig;
238         uint8_t  cis;
239         uint8_t  reason;
240 } __attribute__ ((packed));
241
242 #define LMP_ESC4(x) ((127 << 8) | (x))
243
244 #define BT_LMP_NAME_REQ                 1
245 struct bt_lmp_name_req {
246         uint8_t  offset;
247 } __attribute__ ((packed));
248
249 #define BT_LMP_NAME_RSP                 2
250 struct bt_lmp_name_rsp {
251         uint8_t  offset;
252         uint8_t  length;
253         uint8_t  fragment[14];
254 } __attribute__ ((packed));
255
256 #define BT_LMP_ACCEPTED                 3
257 struct bt_lmp_accepted {
258         uint8_t  opcode;
259 } __attribute__ ((packed));
260
261 #define BT_LMP_NOT_ACCEPTED             4
262 struct bt_lmp_not_accepted {
263         uint8_t  opcode;
264         uint8_t  error;
265 } __attribute__ ((packed));
266
267 #define BT_LMP_CLKOFFSET_REQ            5
268
269 #define BT_LMP_CLKOFFSET_RSP            6
270 struct bt_lmp_clkoffset_rsp {
271         uint16_t offset;
272 } __attribute__ ((packed));
273
274 #define BT_LMP_DETACH                   7
275 struct bt_lmp_detach {
276         uint8_t  error;
277 } __attribute__ ((packed));
278
279 #define BT_LMP_AU_RAND                  11
280 struct bt_lmp_au_rand {
281         uint8_t  number[16];
282 } __attribute__ ((packed));
283
284 #define BT_LMP_SRES                     12
285 struct bt_lmp_sres {
286         uint8_t  response[4];
287 } __attribute__ ((packed));
288
289 #define BT_LMP_ENCRYPTION_MODE_REQ      15
290 struct bt_lmp_encryption_mode_req {
291         uint8_t  mode;
292 } __attribute__ ((packed));
293
294 #define BT_LMP_ENCRYPTION_KEY_SIZE_REQ  16
295 struct bt_lmp_encryption_key_size_req {
296         uint8_t  key_size;
297 } __attribute__ ((packed));
298
299 #define BT_LMP_START_ENCRYPTION_REQ     17
300 struct bt_lmp_start_encryption_req {
301         uint8_t  number[16];
302 } __attribute__ ((packed));
303
304 #define BT_LMP_STOP_ENCRYPTION_REQ      18
305
306 #define BT_LMP_SWITCH_REQ               19
307 struct bt_lmp_switch_req {
308         uint32_t instant;
309 } __attribute__ ((packed));
310
311 #define BT_LMP_UNSNIFF_REQ              24
312
313 #define BT_LMP_MAX_POWER                33
314
315 #define BT_LMP_MIN_POWER                34
316
317 #define BT_LMP_AUTO_RATE                35
318
319 #define BT_LMP_PREFERRED_RATE           36
320 struct bt_lmp_preferred_rate {
321         uint8_t  rate;
322 } __attribute__ ((packed));
323
324 #define BT_LMP_VERSION_REQ              37
325 struct bt_lmp_version_req {
326         uint8_t  version;
327         uint16_t company;
328         uint16_t subversion;
329 } __attribute__ ((packed));
330
331 #define BT_LMP_VERSION_RES              38
332 struct bt_lmp_version_res {
333         uint8_t  version;
334         uint16_t company;
335         uint16_t subversion;
336 } __attribute__ ((packed));
337
338 #define BT_LMP_FEATURES_REQ             39
339 struct bt_lmp_features_req {
340         uint8_t  features[8];
341 } __attribute__ ((packed));
342
343 #define BT_LMP_FEATURES_RES             40
344 struct bt_lmp_features_res {
345         uint8_t  features[8];
346 } __attribute__ ((packed));
347
348 #define BT_LMP_MAX_SLOT                 45
349 struct bt_lmp_max_slot {
350         uint8_t  slots;
351 } __attribute__ ((packed));
352
353 #define BT_LMP_MAX_SLOT_REQ             46
354 struct bt_lmp_max_slot_req {
355         uint8_t  slots;
356 } __attribute__ ((packed));
357
358 #define BT_LMP_TIMING_ACCURACY_REQ      47
359
360 #define BT_LMP_TIMING_ACCURACY_RES      48
361 struct bt_lmp_timing_accuracy_res {
362         uint8_t  drift;
363         uint8_t  jitter;
364 } __attribute__ ((packed));
365
366 #define BT_LMP_SETUP_COMPLETE           49
367
368 #define BT_LMP_USE_SEMI_PERMANENT_KEY   50
369
370 #define BT_LMP_HOST_CONNECTION_REQ      51
371
372 #define BT_LMP_SLOT_OFFSET              52
373 struct bt_lmp_slot_offset {
374         uint16_t offset;
375         uint8_t  bdaddr[6];
376 } __attribute__ ((packed));
377
378 #define BT_LMP_PAGE_SCAN_MODE_REQ       54
379 struct bt_lmp_page_scan_mode_req {
380         uint8_t  scheme;
381         uint8_t  settings;
382 } __attribute__ ((packed));
383
384 #define BT_LMP_TEST_ACTIVATE            56
385
386 #define BT_LMP_ENCRYPTION_KEY_SIZE_MASK_REQ     58
387
388 #define BT_LMP_SET_AFH                  60
389 struct bt_lmp_set_afh {
390         uint32_t instant;
391         uint8_t  mode;
392         uint8_t  map[10];
393 } __attribute__ ((packed));
394
395 #define BT_LMP_ENCAPSULATED_HEADER      61
396 struct bt_lmp_encapsulated_header {
397         uint8_t  major;
398         uint8_t  minor;
399         uint8_t  length;
400 } __attribute__ ((packed));
401
402 #define BT_LMP_ENCAPSULATED_PAYLOAD     62
403 struct bt_lmp_encapsulated_payload {
404         uint8_t  data[16];
405 } __attribute__ ((packed));
406
407 #define BT_LMP_SIMPLE_PAIRING_CONFIRM   63
408 struct bt_lmp_simple_pairing_confirm {
409         uint8_t  value[16];
410 } __attribute__ ((packed));
411
412 #define BT_LMP_SIMPLE_PAIRING_NUMBER    64
413 struct bt_lmp_simple_pairing_number {
414         uint8_t  value[16];
415 } __attribute__ ((packed));
416
417 #define BT_LMP_DHKEY_CHECK              65
418 struct bt_lmp_dhkey_check {
419         uint8_t  value[16];
420 } __attribute__ ((packed));
421
422 #define BT_LMP_PAUSE_ENCRYPTION_AES_REQ 66
423
424 #define BT_LMP_ACCEPTED_EXT             LMP_ESC4(1)
425 struct bt_lmp_accepted_ext {
426         uint8_t  escape;
427         uint8_t  opcode;
428 } __attribute__ ((packed));
429
430 #define BT_LMP_NOT_ACCEPTED_EXT         LMP_ESC4(2)
431 struct bt_lmp_not_accepted_ext {
432         uint8_t  escape;
433         uint8_t  opcode;
434         uint8_t  error;
435 } __attribute__ ((packed));
436
437 #define BT_LMP_FEATURES_REQ_EXT         LMP_ESC4(3)
438 struct bt_lmp_features_req_ext {
439         uint8_t  page;
440         uint8_t  max_page;
441         uint8_t  features[8];
442 } __attribute__ ((packed));
443
444 #define BT_LMP_FEATURES_RES_EXT         LMP_ESC4(4)
445 struct bt_lmp_features_res_ext {
446         uint8_t  page;
447         uint8_t  max_page;
448         uint8_t  features[8];
449 } __attribute__ ((packed));
450
451 #define BT_LMP_PACKET_TYPE_TABLE_REQ    LMP_ESC4(11)
452 struct bt_lmp_packet_type_table_req {
453         uint8_t  table;
454 } __attribute__ ((packed));
455
456 #define BT_LMP_CHANNEL_CLASSIFICATION_REQ       LMP_ESC4(16)
457 struct bt_lmp_channel_classification_req {
458         uint8_t  mode;
459         uint16_t min_interval;
460         uint16_t max_interval;
461 } __attribute__ ((packed));
462
463 #define BT_LMP_CHANNEL_CLASSIFICATION   LMP_ESC4(17)
464 struct bt_lmp_channel_classification {
465         uint8_t  classification[10];
466 } __attribute__ ((packed));
467
468 #define BT_LMP_PAUSE_ENCRYPTION_REQ     LMP_ESC4(23)
469
470 #define BT_LMP_RESUME_ENCRYPTION_REQ    LMP_ESC4(24)
471
472 #define BT_LMP_IO_CAPABILITY_REQ        LMP_ESC4(25)
473 struct bt_lmp_io_capability_req {
474         uint8_t  capability;
475         uint8_t  oob_data;
476         uint8_t  authentication;
477 } __attribute__ ((packed));
478
479 #define BT_LMP_IO_CAPABILITY_RES        LMP_ESC4(26)
480 struct bt_lmp_io_capability_res {
481         uint8_t  capability;
482         uint8_t  oob_data;
483         uint8_t  authentication;
484 } __attribute__ ((packed));
485
486 #define BT_LMP_NUMERIC_COMPARISON_FAILED        LMP_ESC(27)
487
488 #define BT_LMP_PASSKEY_FAILED           LMP_ESC4(28)
489
490 #define BT_LMP_OOB_FAILED               LMP_ESC(29)
491
492 #define BT_LMP_POWER_CONTROL_REQ        LMP_ESC4(31)
493 struct bt_lmp_power_control_req {
494         uint8_t  request;
495 } __attribute__ ((packed));
496
497 #define BT_LMP_POWER_CONTROL_RES        LMP_ESC4(32)
498 struct bt_lmp_power_control_res {
499         uint8_t  response;
500 } __attribute__ ((packed));
501
502 #define BT_LMP_PING_REQ                 LMP_ESC4(33)
503
504 #define BT_LMP_PING_RES                 LMP_ESC4(34)
505
506 #define BT_H4_CMD_PKT   0x01
507 #define BT_H4_ACL_PKT   0x02
508 #define BT_H4_SCO_PKT   0x03
509 #define BT_H4_EVT_PKT   0x04
510 #define BT_H4_ISO_PKT   0x05
511
512 struct bt_hci_cmd_hdr {
513         uint16_t opcode;
514         uint8_t  plen;
515 } __attribute__ ((packed));
516
517 struct bt_hci_acl_hdr {
518         uint16_t handle;
519         uint16_t dlen;
520         uint8_t  data[];
521 } __attribute__ ((packed));
522
523 struct bt_hci_sco_hdr {
524         uint16_t handle;
525         uint8_t  dlen;
526 } __attribute__ ((packed));
527
528 struct bt_hci_iso_hdr {
529         uint16_t handle;
530         uint16_t dlen;
531         uint8_t  data[];
532 } __attribute__ ((packed));
533
534 struct bt_hci_iso_data_start {
535         uint16_t sn;
536         uint16_t slen;
537         uint8_t  data[];
538 } __attribute__ ((packed));
539
540 struct bt_hci_evt_hdr {
541         uint8_t  evt;
542         uint8_t  plen;
543 } __attribute__ ((packed));
544
545 #define BT_HCI_CMD_NOP                          0x0000
546
547 #define BT_HCI_CMD_INQUIRY                      0x0401
548 struct bt_hci_cmd_inquiry {
549         uint8_t  lap[3];
550         uint8_t  length;
551         uint8_t  num_resp;
552 } __attribute__ ((packed));
553
554 #define BT_HCI_CMD_INQUIRY_CANCEL               0x0402
555
556 #define BT_HCI_CMD_PERIODIC_INQUIRY             0x0403
557 struct bt_hci_cmd_periodic_inquiry {
558         uint16_t max_period;
559         uint16_t min_period;
560         uint8_t  lap[3];
561         uint8_t  length;
562         uint8_t  num_resp;
563 } __attribute__ ((packed));
564
565 #define BT_HCI_CMD_EXIT_PERIODIC_INQUIRY        0x0404
566
567 #define BT_HCI_CMD_CREATE_CONN                  0x0405
568 struct bt_hci_cmd_create_conn {
569         uint8_t  bdaddr[6];
570         uint16_t pkt_type;
571         uint8_t  pscan_rep_mode;
572         uint8_t  pscan_mode;
573         uint16_t clock_offset;
574         uint8_t  role_switch;
575 } __attribute__ ((packed));
576
577 #define BT_HCI_CMD_DISCONNECT                   0x0406
578 struct bt_hci_cmd_disconnect {
579         uint16_t handle;
580         uint8_t  reason;
581 } __attribute__ ((packed));
582
583 #define BT_HCI_CMD_ADD_SCO_CONN                 0x0407
584 struct bt_hci_cmd_add_sco_conn {
585         uint16_t handle;
586         uint16_t pkt_type;
587 } __attribute__ ((packed));
588
589 #define BT_HCI_CMD_CREATE_CONN_CANCEL           0x0408
590 struct bt_hci_cmd_create_conn_cancel {
591         uint8_t  bdaddr[6];
592 } __attribute__ ((packed));
593 struct bt_hci_rsp_create_conn_cancel {
594         uint8_t  status;
595         uint8_t  bdaddr[6];
596 } __attribute__ ((packed));
597
598 #define BT_HCI_CMD_ACCEPT_CONN_REQUEST          0x0409
599 struct bt_hci_cmd_accept_conn_request {
600         uint8_t  bdaddr[6];
601         uint8_t  role;
602 } __attribute__ ((packed));
603
604 #define BT_HCI_CMD_REJECT_CONN_REQUEST          0x040a
605 struct bt_hci_cmd_reject_conn_request {
606         uint8_t  bdaddr[6];
607         uint8_t  reason;
608 } __attribute__ ((packed));
609
610 #define BT_HCI_CMD_LINK_KEY_REQUEST_REPLY       0x040b
611 struct bt_hci_cmd_link_key_request_reply {
612         uint8_t  bdaddr[6];
613         uint8_t  link_key[16];
614 } __attribute__ ((packed));
615 struct bt_hci_rsp_link_key_request_reply {
616         uint8_t  status;
617         uint8_t  bdaddr[6];
618 } __attribute__ ((packed));
619
620 #define BT_HCI_CMD_LINK_KEY_REQUEST_NEG_REPLY   0x040c
621 struct bt_hci_cmd_link_key_request_neg_reply {
622         uint8_t  bdaddr[6];
623 } __attribute__ ((packed));
624 struct bt_hci_rsp_link_key_request_neg_reply {
625         uint8_t  status;
626         uint8_t  bdaddr[6];
627 } __attribute__ ((packed));
628
629 #define BT_HCI_CMD_PIN_CODE_REQUEST_REPLY       0x040d
630 struct bt_hci_cmd_pin_code_request_reply {
631         uint8_t  bdaddr[6];
632         uint8_t  pin_len;
633         uint8_t  pin_code[16];
634 } __attribute__ ((packed));
635
636 #define BT_HCI_CMD_PIN_CODE_REQUEST_NEG_REPLY   0x040e
637 struct bt_hci_cmd_pin_code_request_neg_reply {
638         uint8_t  bdaddr[6];
639 } __attribute__ ((packed));
640 struct bt_hci_rsp_pin_code_request_neg_reply {
641         uint8_t  status;
642         uint8_t  bdaddr[6];
643 } __attribute__ ((packed));
644
645 #define BT_HCI_CMD_CHANGE_CONN_PKT_TYPE         0x040f
646 struct bt_hci_cmd_change_conn_pkt_type {
647         uint16_t handle;
648         uint16_t pkt_type;
649 } __attribute__ ((packed));
650
651 #define BT_HCI_CMD_AUTH_REQUESTED               0x0411
652 struct bt_hci_cmd_auth_requested {
653         uint16_t handle;
654 } __attribute__ ((packed));
655
656 #define BT_HCI_CMD_SET_CONN_ENCRYPT             0x0413
657 struct bt_hci_cmd_set_conn_encrypt {
658         uint16_t handle;
659         uint8_t  encr_mode;
660 } __attribute__ ((packed));
661
662 #define BT_HCI_CMD_CHANGE_CONN_LINK_KEY         0x0415
663 struct bt_hci_cmd_change_conn_link_key {
664         uint16_t handle;
665 } __attribute__ ((packed));
666
667 #define BT_HCI_CMD_LINK_KEY_SELECTION           0x0417
668 struct bt_hci_cmd_link_key_selection {
669         uint8_t  key_flag;
670 } __attribute__ ((packed));
671
672 #define BT_HCI_CMD_REMOTE_NAME_REQUEST          0x0419
673 struct bt_hci_cmd_remote_name_request {
674         uint8_t  bdaddr[6];
675         uint8_t  pscan_rep_mode;
676         uint8_t  pscan_mode;
677         uint16_t clock_offset;
678 } __attribute__ ((packed));
679
680 #define BT_HCI_CMD_REMOTE_NAME_REQUEST_CANCEL   0x041a
681 struct bt_hci_cmd_remote_name_request_cancel {
682         uint8_t  bdaddr[6];
683 } __attribute__ ((packed));
684 struct bt_hci_rsp_remote_name_request_cancel {
685         uint8_t  status;
686         uint8_t  bdaddr[6];
687 } __attribute__ ((packed));
688
689 #define BT_HCI_CMD_READ_REMOTE_FEATURES         0x041b
690 struct bt_hci_cmd_read_remote_features {
691         uint16_t handle;
692 } __attribute__ ((packed));
693
694 #define BT_HCI_CMD_READ_REMOTE_EXT_FEATURES     0x041c
695 struct bt_hci_cmd_read_remote_ext_features {
696         uint16_t handle;
697         uint8_t  page;
698 } __attribute__ ((packed));
699
700 #define BT_HCI_CMD_READ_REMOTE_VERSION          0x041d
701 struct bt_hci_cmd_read_remote_version {
702         uint16_t handle;
703 } __attribute__ ((packed));
704
705 #define BT_HCI_CMD_READ_CLOCK_OFFSET            0x041f
706 struct bt_hci_cmd_read_clock_offset {
707         uint16_t handle;
708 } __attribute__ ((packed));
709
710 #define BT_HCI_CMD_READ_LMP_HANDLE              0x0420
711 struct bt_hci_cmd_read_lmp_handle {
712         uint16_t  handle;
713 } __attribute__ ((packed));
714 struct bt_hci_rsp_read_lmp_handle {
715         uint8_t  status;
716         uint16_t handle;
717         uint8_t  lmp_handle;
718         uint32_t reserved;
719 } __attribute__ ((packed));
720
721 #define BT_HCI_CMD_SETUP_SYNC_CONN              0x0428
722 struct bt_hci_cmd_setup_sync_conn {
723         uint16_t handle;
724         uint32_t tx_bandwidth;
725         uint32_t rx_bandwidth;
726         uint16_t max_latency;
727         uint16_t voice_setting;
728         uint8_t  retrans_effort;
729         uint16_t pkt_type;
730 } __attribute__ ((packed));
731
732 #define BT_HCI_CMD_ACCEPT_SYNC_CONN_REQUEST     0x0429
733 struct bt_hci_cmd_accept_sync_conn_request {
734         uint8_t  bdaddr[6];
735         uint32_t tx_bandwidth;
736         uint32_t rx_bandwidth;
737         uint16_t max_latency;
738         uint16_t voice_setting;
739         uint8_t  retrans_effort;
740         uint16_t pkt_type;
741 } __attribute__ ((packed));
742
743 #define BT_HCI_CMD_REJECT_SYNC_CONN_REQUEST     0x042a
744 struct bt_hci_cmd_reject_sync_conn_request {
745         uint8_t  bdaddr[6];
746         uint8_t  reason;
747 } __attribute__ ((packed));
748
749 #define BT_HCI_CMD_IO_CAPABILITY_REQUEST_REPLY          0x042b
750 struct bt_hci_cmd_io_capability_request_reply {
751         uint8_t  bdaddr[6];
752         uint8_t  capability;
753         uint8_t  oob_data;
754         uint8_t  authentication;
755 } __attribute__ ((packed));
756 struct bt_hci_rsp_io_capability_request_reply {
757         uint8_t  status;
758         uint8_t  bdaddr[6];
759 } __attribute__ ((packed));
760
761 #define BT_HCI_CMD_USER_CONFIRM_REQUEST_REPLY           0x042c
762 struct bt_hci_cmd_user_confirm_request_reply {
763         uint8_t  bdaddr[6];
764 } __attribute__ ((packed));
765 struct bt_hci_rsp_user_confirm_request_reply {
766         uint8_t  status;
767         uint8_t  bdaddr[6];
768 } __attribute__ ((packed));
769
770 #define BT_HCI_CMD_USER_CONFIRM_REQUEST_NEG_REPLY       0x042d
771 struct bt_hci_cmd_user_confirm_request_neg_reply {
772         uint8_t  bdaddr[6];
773 } __attribute__ ((packed));
774 struct bt_hci_rsp_user_confirm_request_neg_reply {
775         uint8_t  status;
776         uint8_t  bdaddr[6];
777 } __attribute__ ((packed));
778
779 #define BT_HCI_CMD_USER_PASSKEY_REQUEST_REPLY           0x042e
780 struct bt_hci_cmd_user_passkey_request_reply {
781         uint8_t  bdaddr[6];
782         uint32_t passkey;
783 } __attribute__ ((packed));
784
785 #define BT_HCI_CMD_USER_PASSKEY_REQUEST_NEG_REPLY       0x042f
786 struct bt_hci_cmd_user_passkey_request_neg_reply {
787         uint8_t  bdaddr[6];
788 } __attribute__ ((packed));
789
790 #define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_REPLY        0x0430
791 struct bt_hci_cmd_remote_oob_data_request_reply {
792         uint8_t  bdaddr[6];
793         uint8_t  hash[16];
794         uint8_t  randomizer[16];
795 } __attribute__ ((packed));
796
797 #define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_NEG_REPLY    0x0433
798 struct bt_hci_cmd_remote_oob_data_request_neg_reply {
799         uint8_t  bdaddr[6];
800 } __attribute__ ((packed));
801
802 #define BT_HCI_CMD_IO_CAPABILITY_REQUEST_NEG_REPLY      0x0434
803 struct bt_hci_cmd_io_capability_request_neg_reply {
804         uint8_t  bdaddr[6];
805         uint8_t  reason;
806 } __attribute__ ((packed));
807 struct bt_hci_rsp_io_capability_request_neg_reply {
808         uint8_t  status;
809         uint8_t  bdaddr[6];
810 } __attribute__ ((packed));
811
812 #define BT_HCI_CMD_CREATE_PHY_LINK              0x0435
813 struct bt_hci_cmd_create_phy_link {
814         uint8_t  phy_handle;
815         uint8_t  key_len;
816         uint8_t  key_type;
817 } __attribute__ ((packed));
818
819 #define BT_HCI_CMD_ACCEPT_PHY_LINK              0x0436
820 struct bt_hci_cmd_accept_phy_link {
821         uint8_t  phy_handle;
822         uint8_t  key_len;
823         uint8_t  key_type;
824 } __attribute__ ((packed));
825
826 #define BT_HCI_CMD_DISCONN_PHY_LINK             0x0437
827 struct bt_hci_cmd_disconn_phy_link {
828         uint8_t  phy_handle;
829         uint8_t  reason;
830 } __attribute__ ((packed));
831
832 #define BT_HCI_CMD_CREATE_LOGIC_LINK            0x0438
833 struct bt_hci_cmd_create_logic_link {
834         uint8_t  phy_handle;
835         uint8_t  tx_flow_spec[16];
836         uint8_t  rx_flow_spec[16];
837 } __attribute__ ((packed));
838
839 #define BT_HCI_CMD_ACCEPT_LOGIC_LINK            0x0439
840 struct bt_hci_cmd_accept_logic_link {
841         uint8_t  phy_handle;
842         uint8_t  tx_flow_spec[16];
843         uint8_t  rx_flow_spec[16];
844 } __attribute__ ((packed));
845
846 #define BT_HCI_CMD_DISCONN_LOGIC_LINK           0x043a
847 struct bt_hci_cmd_disconn_logic_link {
848         uint16_t handle;
849 } __attribute__ ((packed));
850
851 #define BT_HCI_CMD_LOGIC_LINK_CANCEL            0x043b
852 struct bt_hci_cmd_logic_link_cancel {
853         uint8_t  phy_handle;
854         uint8_t  flow_spec;
855 } __attribute__ ((packed));
856 struct bt_hci_rsp_logic_link_cancel {
857         uint8_t  status;
858         uint8_t  phy_handle;
859         uint8_t  flow_spec;
860 } __attribute__ ((packed));
861
862 #define BT_HCI_CMD_FLOW_SPEC_MODIFY             0x043c
863 struct bt_hci_cmd_flow_spec_modify {
864         uint16_t handle;
865         uint8_t  tx_flow_spec[16];
866         uint8_t  rx_flow_spec[16];
867 } __attribute__ ((packed));
868
869 #define BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN     0x043d
870 struct bt_hci_cmd_enhanced_setup_sync_conn {
871         uint16_t handle;
872         uint32_t tx_bandwidth;
873         uint32_t rx_bandwidth;
874         uint8_t  tx_coding_format[5];
875         uint8_t  rx_coding_format[5];
876         uint16_t tx_codec_frame_size;
877         uint16_t rx_codec_frame_size;
878         uint32_t input_bandwidth;
879         uint32_t output_bandwidth;
880         uint8_t  input_coding_format[5];
881         uint8_t  output_coding_format[5];
882         uint16_t input_coded_data_size;
883         uint16_t output_coded_data_size;
884         uint8_t  input_pcm_data_format;
885         uint8_t  output_pcm_data_format;
886         uint8_t  input_pcm_msb_position;
887         uint8_t  output_pcm_msb_position;
888         uint8_t  input_data_path;
889         uint8_t  output_data_path;
890         uint8_t  input_unit_size;
891         uint8_t  output_unit_size;
892         uint16_t max_latency;
893         uint16_t pkt_type;
894         uint8_t  retrans_effort;
895 } __attribute__ ((packed));
896
897 #define BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST    0x043e
898 struct bt_hci_cmd_enhanced_accept_sync_conn_request {
899         uint8_t  bdaddr[6];
900         uint32_t tx_bandwidth;
901         uint32_t rx_bandwidth;
902         uint8_t  tx_coding_format[5];
903         uint8_t  rx_coding_format[5];
904         uint16_t tx_codec_frame_size;
905         uint16_t rx_codec_frame_size;
906         uint32_t input_bandwidth;
907         uint32_t output_bandwidth;
908         uint8_t  input_coding_format[5];
909         uint8_t  output_coding_format[5];
910         uint16_t input_coded_data_size;
911         uint16_t output_coded_data_size;
912         uint8_t  input_pcm_data_format;
913         uint8_t  output_pcm_data_format;
914         uint8_t  input_pcm_msb_position;
915         uint8_t  output_pcm_msb_position;
916         uint8_t  input_data_path;
917         uint8_t  output_data_path;
918         uint8_t  input_unit_size;
919         uint8_t  output_unit_size;
920         uint16_t max_latency;
921         uint16_t pkt_type;
922         uint8_t  retrans_effort;
923 } __attribute__ ((packed));
924
925 #define BT_HCI_CMD_TRUNCATED_PAGE               0x043f
926 struct bt_hci_cmd_truncated_page {
927         uint8_t  bdaddr[6];
928         uint8_t  pscan_rep_mode;
929         uint16_t clock_offset;
930 } __attribute__ ((packed));
931
932 #define BT_HCI_CMD_TRUNCATED_PAGE_CANCEL        0x0440
933 struct bt_hci_cmd_truncated_page_cancel {
934         uint8_t  bdaddr[6];
935 } __attribute__ ((packed));
936
937 #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST     0x0441
938 struct bt_hci_cmd_set_peripheral_broadcast {
939         uint8_t  enable;
940         uint8_t  lt_addr;
941         uint8_t  lpo_allowed;
942         uint16_t pkt_type;
943         uint16_t min_interval;
944         uint16_t max_interval;
945         uint16_t timeout;
946 } __attribute__ ((packed));
947 struct bt_hci_rsp_set_peripheral_broadcast {
948         uint8_t  status;
949         uint8_t  lt_addr;
950         uint16_t interval;
951 } __attribute__ ((packed));
952
953 #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_RECEIVE     0x0442
954 struct bt_hci_cmd_set_peripheral_broadcast_receive {
955         uint8_t  enable;
956         uint8_t  bdaddr[6];
957         uint8_t  lt_addr;
958         uint16_t interval;
959         uint32_t offset;
960         uint32_t instant;
961         uint16_t timeout;
962         uint8_t  accuracy;
963         uint8_t  skip;
964         uint16_t pkt_type;
965         uint8_t  map[10];
966 } __attribute__ ((packed));
967 struct bt_hci_rsp_set_peripheral_broadcast_receive {
968         uint8_t  status;
969         uint8_t  bdaddr[6];
970         uint8_t  lt_addr;
971 } __attribute__ ((packed));
972
973 #define BT_HCI_CMD_START_SYNC_TRAIN             0x0443
974
975 #define BT_HCI_CMD_RECEIVE_SYNC_TRAIN           0x0444
976 struct bt_hci_cmd_receive_sync_train {
977         uint8_t  bdaddr[6];
978         uint16_t timeout;
979         uint16_t window;
980         uint16_t interval;
981 } __attribute__ ((packed));
982
983 #define BT_HCI_CMD_REMOTE_OOB_EXT_DATA_REQUEST_REPLY    0x0445
984 struct bt_hci_cmd_remote_oob_ext_data_request_reply {
985         uint8_t  bdaddr[6];
986         uint8_t  hash192[16];
987         uint8_t  randomizer192[16];
988         uint8_t  hash256[16];
989         uint8_t  randomizer256[16];
990 } __attribute__ ((packed));
991
992 #define BT_HCI_CMD_HOLD_MODE                    0x0801
993 struct bt_hci_cmd_hold_mode {
994         uint16_t handle;
995         uint16_t max_interval;
996         uint16_t min_interval;
997 } __attribute__ ((packed));
998
999 #define BT_HCI_CMD_SNIFF_MODE                   0x0803
1000 struct bt_hci_cmd_sniff_mode {
1001         uint16_t handle;
1002         uint16_t max_interval;
1003         uint16_t min_interval;
1004         uint16_t attempt;
1005         uint16_t timeout;
1006 } __attribute__ ((packed));
1007
1008 #define BT_HCI_CMD_EXIT_SNIFF_MODE              0x0804
1009 struct bt_hci_cmd_exit_sniff_mode {
1010         uint16_t handle;
1011 } __attribute__ ((packed));
1012
1013 #define BT_HCI_CMD_PARK_STATE                   0x0805
1014 struct bt_hci_cmd_park_state {
1015         uint16_t handle;
1016         uint16_t max_interval;
1017         uint16_t min_interval;
1018 } __attribute__ ((packed));
1019
1020 #define BT_HCI_CMD_EXIT_PARK_STATE              0x0806
1021 struct bt_hci_cmd_exit_park_state {
1022         uint16_t handle;
1023 } __attribute__ ((packed));
1024
1025 #define BT_HCI_CMD_QOS_SETUP                    0x0807
1026 struct bt_hci_cmd_qos_setup {
1027         uint16_t handle;
1028         uint8_t  flags;
1029         uint8_t  service_type;
1030         uint32_t token_rate;
1031         uint32_t peak_bandwidth;
1032         uint32_t latency;
1033         uint32_t delay_variation;
1034 } __attribute__ ((packed));
1035
1036 #define BT_HCI_CMD_ROLE_DISCOVERY               0x0809
1037 struct bt_hci_cmd_role_discovery {
1038         uint16_t handle;
1039 } __attribute__ ((packed));
1040 struct bt_hci_rsp_role_discovery {
1041         uint8_t  status;
1042         uint16_t handle;
1043         uint8_t  role;
1044 } __attribute__ ((packed));
1045
1046 #define BT_HCI_CMD_SWITCH_ROLE                  0x080b
1047 struct bt_hci_cmd_switch_role {
1048         uint8_t  bdaddr[6];
1049         uint8_t  role;
1050 } __attribute__ ((packed));
1051
1052 #define BT_HCI_CMD_READ_LINK_POLICY             0x080c
1053 struct bt_hci_cmd_read_link_policy {
1054         uint16_t handle;
1055 } __attribute__ ((packed));
1056 struct bt_hci_rsp_read_link_policy {
1057         uint8_t  status;
1058         uint16_t handle;
1059         uint16_t policy;
1060 } __attribute__ ((packed));
1061
1062 #define BT_HCI_CMD_WRITE_LINK_POLICY            0x080d
1063 struct bt_hci_cmd_write_link_policy {
1064         uint16_t handle;
1065         uint16_t policy;
1066 } __attribute__ ((packed));
1067 struct bt_hci_rsp_write_link_policy {
1068         uint8_t  status;
1069         uint16_t handle;
1070 } __attribute__ ((packed));
1071
1072 #define BT_HCI_CMD_READ_DEFAULT_LINK_POLICY     0x080e
1073 struct bt_hci_rsp_read_default_link_policy {
1074         uint8_t  status;
1075         uint16_t policy;
1076 } __attribute__ ((packed));
1077
1078 #define BT_HCI_CMD_WRITE_DEFAULT_LINK_POLICY    0x080f
1079 struct bt_hci_cmd_write_default_link_policy {
1080         uint16_t policy;
1081 } __attribute__ ((packed));
1082
1083 #define BT_HCI_CMD_FLOW_SPEC                    0x0810
1084 struct bt_hci_cmd_flow_spec {
1085         uint16_t handle;
1086         uint8_t  flags;
1087         uint8_t  direction;
1088         uint8_t  service_type;
1089         uint32_t token_rate;
1090         uint32_t token_bucket_size;
1091         uint32_t peak_bandwidth;
1092         uint32_t access_latency;
1093 } __attribute__ ((packed));
1094
1095 #define BT_HCI_CMD_SNIFF_SUBRATING              0x0811
1096 struct bt_hci_cmd_sniff_subrating {
1097         uint16_t handle;
1098         uint16_t max_latency;
1099         uint16_t min_remote_timeout;
1100         uint16_t min_local_timeout;
1101 } __attribute__ ((packed));
1102 struct bt_hci_rsp_sniff_subrating {
1103         uint8_t  status;
1104         uint16_t handle;
1105 } __attribute__ ((packed));
1106
1107 #define BT_HCI_CMD_SET_EVENT_MASK               0x0c01
1108 struct bt_hci_cmd_set_event_mask {
1109         uint8_t  mask[8];
1110 } __attribute__ ((packed));
1111
1112 #define BT_HCI_CMD_RESET                        0x0c03
1113
1114 #define BT_HCI_CMD_SET_EVENT_FILTER             0x0c05
1115 struct bt_hci_cmd_set_event_filter {
1116         uint8_t  type;
1117         uint8_t  cond_type;
1118         uint8_t  cond[0];
1119 } __attribute__ ((packed));
1120
1121 #define BT_HCI_CMD_FLUSH                        0x0c08
1122 struct bt_hci_cmd_flush {
1123         uint16_t handle;
1124 } __attribute__ ((packed));
1125 struct bt_hci_rsp_flush {
1126         uint8_t  status;
1127         uint16_t handle;
1128 } __attribute__ ((packed));
1129
1130 #define BT_HCI_CMD_READ_PIN_TYPE                0x0c09
1131 struct bt_hci_rsp_read_pin_type {
1132         uint8_t  status;
1133         uint8_t  pin_type;
1134 } __attribute__ ((packed));
1135
1136 #define BT_HCI_CMD_WRITE_PIN_TYPE               0x0c0a
1137 struct bt_hci_cmd_write_pin_type {
1138         uint8_t  pin_type;
1139 } __attribute__ ((packed));
1140
1141 #define BT_HCI_CMD_CREATE_NEW_UNIT_KEY          0x0c0b
1142
1143 #define BT_HCI_CMD_READ_STORED_LINK_KEY         0x0c0d
1144 struct bt_hci_cmd_read_stored_link_key {
1145         uint8_t  bdaddr[6];
1146         uint8_t  read_all;
1147 } __attribute__ ((packed));
1148 struct bt_hci_rsp_read_stored_link_key {
1149         uint8_t  status;
1150         uint16_t max_num_keys;
1151         uint16_t num_keys;
1152 } __attribute__ ((packed));
1153
1154 #define BT_HCI_CMD_WRITE_STORED_LINK_KEY        0x0c11
1155 struct bt_hci_cmd_write_stored_link_key {
1156         uint8_t  num_keys;
1157 } __attribute__ ((packed));
1158 struct bt_hci_rsp_write_stored_link_key {
1159         uint8_t  status;
1160         uint8_t  num_keys;
1161 } __attribute__ ((packed));
1162
1163 #define BT_HCI_CMD_DELETE_STORED_LINK_KEY       0x0c12
1164 struct bt_hci_cmd_delete_stored_link_key {
1165         uint8_t  bdaddr[6];
1166         uint8_t  delete_all;
1167 } __attribute__ ((packed));
1168 struct bt_hci_rsp_delete_stored_link_key {
1169         uint8_t  status;
1170         uint16_t num_keys;
1171 } __attribute__ ((packed));
1172
1173 #define BT_HCI_CMD_WRITE_LOCAL_NAME             0x0c13
1174 struct bt_hci_cmd_write_local_name {
1175         uint8_t  name[248];
1176 } __attribute__ ((packed));
1177
1178 #define BT_HCI_CMD_READ_LOCAL_NAME              0x0c14
1179 struct bt_hci_rsp_read_local_name {
1180         uint8_t  status;
1181         uint8_t  name[248];
1182 } __attribute__ ((packed));
1183
1184 #define BT_HCI_CMD_READ_CONN_ACCEPT_TIMEOUT     0x0c15
1185 struct bt_hci_rsp_read_conn_accept_timeout {
1186         uint8_t  status;
1187         uint16_t timeout;
1188 } __attribute__ ((packed));
1189
1190 #define BT_HCI_CMD_WRITE_CONN_ACCEPT_TIMEOUT    0x0c16
1191 struct bt_hci_cmd_write_conn_accept_timeout {
1192         uint16_t timeout;
1193 } __attribute__ ((packed));
1194
1195 #define BT_HCI_CMD_READ_PAGE_TIMEOUT            0x0c17
1196 struct bt_hci_rsp_read_page_timeout {
1197         uint8_t  status;
1198         uint16_t timeout;
1199 } __attribute__ ((packed));
1200
1201 #define BT_HCI_CMD_WRITE_PAGE_TIMEOUT           0x0c18
1202 struct bt_hci_cmd_write_page_timeout {
1203         uint16_t timeout;
1204 } __attribute__ ((packed));
1205
1206 #define BT_HCI_CMD_READ_SCAN_ENABLE             0x0c19
1207 struct bt_hci_rsp_read_scan_enable {
1208         uint8_t  status;
1209         uint8_t  enable;
1210 } __attribute__ ((packed));
1211
1212 #define BT_HCI_CMD_WRITE_SCAN_ENABLE            0x0c1a
1213 struct bt_hci_cmd_write_scan_enable {
1214         uint8_t  enable;
1215 } __attribute__ ((packed));
1216
1217 #define BT_HCI_CMD_READ_PAGE_SCAN_ACTIVITY      0x0c1b
1218 struct bt_hci_rsp_read_page_scan_activity {
1219         uint8_t  status;
1220         uint16_t interval;
1221         uint16_t window;
1222 } __attribute__ ((packed));
1223
1224 #define BT_HCI_CMD_WRITE_PAGE_SCAN_ACTIVITY     0x0c1c
1225 struct bt_hci_cmd_write_page_scan_activity {
1226         uint16_t interval;
1227         uint16_t window;
1228 } __attribute__ ((packed));
1229
1230 #define BT_HCI_CMD_READ_INQUIRY_SCAN_ACTIVITY   0x0c1d
1231 struct bt_hci_rsp_read_inquiry_scan_activity {
1232         uint8_t  status;
1233         uint16_t interval;
1234         uint16_t window;
1235 } __attribute__ ((packed));
1236
1237 #define BT_HCI_CMD_WRITE_INQUIRY_SCAN_ACTIVITY  0x0c1e
1238 struct bt_hci_cmd_write_inquiry_scan_activity {
1239         uint16_t interval;
1240         uint16_t window;
1241 } __attribute__ ((packed));
1242
1243 #define BT_HCI_CMD_READ_AUTH_ENABLE             0x0c1f
1244 struct bt_hci_rsp_read_auth_enable {
1245         uint8_t  status;
1246         uint8_t  enable;
1247 } __attribute__ ((packed));
1248
1249 #define BT_HCI_CMD_WRITE_AUTH_ENABLE            0x0c20
1250 struct bt_hci_cmd_write_auth_enable {
1251         uint8_t  enable;
1252 } __attribute__ ((packed));
1253
1254 #define BT_HCI_CMD_READ_ENCRYPT_MODE            0x0c21
1255 struct bt_hci_rsp_read_encrypt_mode {
1256         uint8_t  status;
1257         uint8_t  mode;
1258 } __attribute__ ((packed));
1259
1260 #define BT_HCI_CMD_WRITE_ENCRYPT_MODE           0x0c22
1261 struct bt_hci_cmd_write_encrypt_mode {
1262         uint8_t  mode;
1263 } __attribute__ ((packed));
1264
1265 #define BT_HCI_CMD_READ_CLASS_OF_DEV            0x0c23
1266 struct bt_hci_rsp_read_class_of_dev {
1267         uint8_t  status;
1268         uint8_t  dev_class[3];
1269 } __attribute__ ((packed));
1270
1271 #define BT_HCI_CMD_WRITE_CLASS_OF_DEV           0x0c24
1272 struct bt_hci_cmd_write_class_of_dev {
1273         uint8_t  dev_class[3];
1274 } __attribute__ ((packed));
1275
1276 #define BT_HCI_CMD_READ_VOICE_SETTING           0x0c25
1277 struct bt_hci_rsp_read_voice_setting {
1278         uint8_t  status;
1279         uint16_t setting;
1280 } __attribute__ ((packed));
1281
1282 #define BT_HCI_CMD_WRITE_VOICE_SETTING          0x0c26
1283 struct bt_hci_cmd_write_voice_setting {
1284         uint16_t setting;
1285 } __attribute__ ((packed));
1286
1287 #define BT_HCI_CMD_READ_AUTO_FLUSH_TIMEOUT      0x0c27
1288 struct bt_hci_cmd_read_auto_flush_timeout {
1289         uint16_t handle;
1290 } __attribute__ ((packed));
1291 struct bt_hci_rsp_read_auto_flush_timeout {
1292         uint8_t  status;
1293         uint16_t handle;
1294         uint16_t timeout;
1295 } __attribute__ ((packed));
1296
1297 #define BT_HCI_CMD_WRITE_AUTO_FLUSH_TIMEOUT     0x0c28
1298 struct bt_hci_cmd_write_auto_flush_timeout {
1299         uint16_t handle;
1300         uint16_t timeout;
1301 } __attribute__ ((packed));
1302 struct bt_hci_rsp_write_auto_flush_timeout {
1303         uint8_t  status;
1304         uint16_t handle;
1305 } __attribute__ ((packed));
1306
1307 #define BT_HCI_CMD_READ_NUM_BROADCAST_RETRANS   0x0c29
1308 struct bt_hci_rsp_read_num_broadcast_retrans {
1309         uint8_t  status;
1310         uint8_t  num_retrans;
1311 } __attribute__ ((packed));
1312
1313 #define BT_HCI_CMD_WRITE_NUM_BROADCAST_RETRANS  0x0c2a
1314 struct bt_hci_cmd_write_num_broadcast_retrans {
1315         uint8_t  num_retrans;
1316 } __attribute__ ((packed));
1317
1318 #define BT_HCI_CMD_READ_HOLD_MODE_ACTIVITY      0x0c2b
1319 struct bt_hci_rsp_read_hold_mode_activity {
1320         uint8_t  status;
1321         uint8_t  activity;
1322 } __attribute__ ((packed));
1323
1324 #define BT_HCI_CMD_WRITE_HOLD_MODE_ACTIVITY     0x0c2c
1325 struct bt_hci_cmd_write_hold_mode_activity {
1326         uint8_t  activity;
1327 } __attribute__ ((packed));
1328
1329 #define BT_HCI_CMD_READ_TX_POWER                0x0c2d
1330 struct bt_hci_cmd_read_tx_power {
1331         uint16_t handle;
1332         uint8_t  type;
1333 } __attribute__ ((packed));
1334 struct bt_hci_rsp_read_tx_power {
1335         uint8_t  status;
1336         uint16_t handle;
1337         int8_t   level;
1338 } __attribute__ ((packed));
1339
1340 #define BT_HCI_CMD_READ_SYNC_FLOW_CONTROL       0x0c2e
1341 struct bt_hci_rsp_read_sync_flow_control {
1342         uint8_t  status;
1343         uint8_t  enable;
1344 } __attribute__ ((packed));
1345
1346 #define BT_HCI_CMD_WRITE_SYNC_FLOW_CONTROL      0x0c2f
1347 struct bt_hci_cmd_write_sync_flow_control {
1348         uint8_t  enable;
1349 } __attribute__ ((packed));
1350
1351 #define BT_HCI_CMD_SET_HOST_FLOW_CONTROL        0x0c31
1352 struct bt_hci_cmd_set_host_flow_control {
1353         uint8_t  enable;
1354 } __attribute__ ((packed));
1355
1356 #define BT_HCI_CMD_HOST_BUFFER_SIZE             0x0c33
1357 struct bt_hci_cmd_host_buffer_size {
1358         uint16_t acl_mtu;
1359         uint8_t  sco_mtu;
1360         uint16_t acl_max_pkt;
1361         uint16_t sco_max_pkt;
1362 } __attribute__ ((packed));
1363
1364 #define BT_HCI_CMD_HOST_NUM_COMPLETED_PACKETS   0x0c35
1365 struct bt_hci_cmd_host_num_completed_packets {
1366         uint8_t  num_handles;
1367         uint16_t handle;
1368         uint16_t count;
1369 } __attribute__ ((packed));
1370
1371 #define BT_HCI_CMD_READ_LINK_SUPV_TIMEOUT       0x0c36
1372 struct bt_hci_cmd_read_link_supv_timeout {
1373         uint16_t handle;
1374 } __attribute__ ((packed));
1375 struct bt_hci_rsp_read_link_supv_timeout {
1376         uint8_t  status;
1377         uint16_t handle;
1378         uint16_t timeout;
1379 } __attribute__ ((packed));
1380
1381 #define BT_HCI_CMD_WRITE_LINK_SUPV_TIMEOUT      0x0c37
1382 struct bt_hci_cmd_write_link_supv_timeout {
1383         uint16_t handle;
1384         uint16_t timeout;
1385 } __attribute__ ((packed));
1386 struct bt_hci_rsp_write_link_supv_timeout {
1387         uint8_t  status;
1388         uint16_t handle;
1389 } __attribute__ ((packed));
1390
1391 #define BT_HCI_CMD_READ_NUM_SUPPORTED_IAC       0x0c38
1392 struct bt_hci_rsp_read_num_supported_iac {
1393         uint8_t  status;
1394         uint8_t  num_iac;
1395 } __attribute__ ((packed));
1396
1397 #define BT_HCI_CMD_READ_CURRENT_IAC_LAP         0x0c39
1398 struct bt_hci_rsp_read_current_iac_lap {
1399         uint8_t  status;
1400         uint8_t  num_iac;
1401         uint8_t  iac_lap[0];
1402 } __attribute__ ((packed));
1403
1404 #define BT_HCI_CMD_WRITE_CURRENT_IAC_LAP        0x0c3a
1405 struct bt_hci_cmd_write_current_iac_lap {
1406         uint8_t  num_iac;
1407         uint8_t  iac_lap[0];
1408 } __attribute__ ((packed));
1409
1410 #define BT_HCI_CMD_READ_PAGE_SCAN_PERIOD_MODE   0x0c3b
1411 struct bt_hci_rsp_read_page_scan_period_mode {
1412         uint8_t  status;
1413         uint8_t  mode;
1414 } __attribute__ ((packed));
1415
1416 #define BT_HCI_CMD_WRITE_PAGE_SCAN_PERIOD_MODE  0x0c3c
1417 struct bt_hci_cmd_write_page_scan_period_mode {
1418         uint8_t  mode;
1419 } __attribute__ ((packed));
1420
1421 #define BT_HCI_CMD_READ_PAGE_SCAN_MODE          0x0c3d
1422 struct bt_hci_rsp_read_page_scan_mode {
1423         uint8_t  status;
1424         uint8_t  mode;
1425 } __attribute__ ((packed));
1426
1427 #define BT_HCI_CMD_WRITE_PAGE_SCAN_MODE         0x0c3e
1428 struct bt_hci_cmd_write_page_scan_mode {
1429         uint8_t  mode;
1430 } __attribute__ ((packed));
1431
1432 #define BT_HCI_CMD_SET_AFH_HOST_CLASSIFICATION  0x0c3f
1433 struct bt_hci_cmd_set_afh_host_classification {
1434         uint8_t  map[10];
1435 } __attribute__ ((packed));
1436
1437 #define BT_HCI_CMD_READ_INQUIRY_SCAN_TYPE       0x0c42
1438 struct bt_hci_rsp_read_inquiry_scan_type {
1439         uint8_t  status;
1440         uint8_t  type;
1441 } __attribute__ ((packed));
1442
1443 #define BT_HCI_CMD_WRITE_INQUIRY_SCAN_TYPE      0x0c43
1444 struct bt_hci_cmd_write_inquiry_scan_type {
1445         uint8_t type;
1446 } __attribute__ ((packed));
1447
1448 #define BT_HCI_CMD_READ_INQUIRY_MODE            0x0c44
1449 struct bt_hci_rsp_read_inquiry_mode {
1450         uint8_t  status;
1451         uint8_t  mode;
1452 } __attribute__ ((packed));
1453
1454 #define BT_HCI_CMD_WRITE_INQUIRY_MODE           0x0c45
1455 struct bt_hci_cmd_write_inquiry_mode {
1456         uint8_t  mode;
1457 } __attribute__ ((packed));
1458
1459 #define BT_HCI_CMD_READ_PAGE_SCAN_TYPE          0x0c46
1460 struct bt_hci_rsp_read_page_scan_type {
1461         uint8_t status;
1462         uint8_t type;
1463 } __attribute__ ((packed));
1464
1465 #define BT_HCI_CMD_WRITE_PAGE_SCAN_TYPE         0x0c47
1466 struct bt_hci_cmd_write_page_scan_type {
1467         uint8_t type;
1468 } __attribute__ ((packed));
1469
1470 #define BT_HCI_CMD_READ_AFH_ASSESSMENT_MODE     0x0c48
1471 struct bt_hci_rsp_read_afh_assessment_mode {
1472         uint8_t  status;
1473         uint8_t  mode;
1474 } __attribute__ ((packed));
1475
1476 #define BT_HCI_CMD_WRITE_AFH_ASSESSMENT_MODE    0x0c49
1477 struct bt_hci_cmd_write_afh_assessment_mode {
1478         uint8_t  mode;
1479 } __attribute__ ((packed));
1480
1481 #define BT_HCI_CMD_READ_EXT_INQUIRY_RESPONSE    0x0c51
1482 struct bt_hci_rsp_read_ext_inquiry_response {
1483         uint8_t  status;
1484         uint8_t  fec;
1485         uint8_t  data[240];
1486 } __attribute__ ((packed));
1487
1488 #define BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE   0x0c52
1489 struct bt_hci_cmd_write_ext_inquiry_response {
1490         uint8_t  fec;
1491         uint8_t  data[240];
1492 } __attribute__ ((packed));
1493
1494 #define BT_HCI_CMD_REFRESH_ENCRYPT_KEY          0x0c53
1495 struct bt_hci_cmd_refresh_encrypt_key {
1496         uint16_t handle;
1497 } __attribute__ ((packed));
1498
1499 #define BT_HCI_CMD_READ_SIMPLE_PAIRING_MODE     0x0c55
1500 struct bt_hci_rsp_read_simple_pairing_mode {
1501         uint8_t  status;
1502         uint8_t  mode;
1503 } __attribute__ ((packed));
1504
1505 #define BT_HCI_CMD_WRITE_SIMPLE_PAIRING_MODE    0x0c56
1506 struct bt_hci_cmd_write_simple_pairing_mode {
1507         uint8_t  mode;
1508 } __attribute__ ((packed));
1509
1510 #define BT_HCI_CMD_READ_LOCAL_OOB_DATA          0x0c57
1511 struct bt_hci_rsp_read_local_oob_data {
1512         uint8_t  status;
1513         uint8_t  hash[16];
1514         uint8_t  randomizer[16];
1515 } __attribute__ ((packed));
1516
1517 #define BT_HCI_CMD_READ_INQUIRY_RESP_TX_POWER   0x0c58
1518 struct bt_hci_rsp_read_inquiry_resp_tx_power {
1519         uint8_t  status;
1520         int8_t   level;
1521 } __attribute__ ((packed));
1522
1523 #define BT_HCI_CMD_WRITE_INQUIRY_TX_POWER       0x0c59
1524 struct bt_hci_cmd_write_inquiry_tx_power {
1525         int8_t   level;
1526 } __attribute__ ((packed));
1527
1528 #define BT_HCI_CMD_READ_ERRONEOUS_REPORTING     0x0c5a
1529 struct bt_hci_rsp_read_erroneous_reporting {
1530         uint8_t  status;
1531         uint8_t  mode;
1532 } __attribute__ ((packed));
1533
1534 #define BT_HCI_CMD_WRITE_ERRONEOUS_REPORTING    0x0c5b
1535 struct bt_hci_cmd_write_erroneous_reporting {
1536         uint8_t  mode;
1537 } __attribute__ ((packed));
1538
1539 #define BT_HCI_CMD_ENHANCED_FLUSH               0x0c5f
1540 struct bt_hci_cmd_enhanced_flush {
1541         uint16_t handle;
1542         uint8_t  type;
1543 } __attribute__ ((packed));
1544
1545 #define BT_HCI_CMD_SEND_KEYPRESS_NOTIFY         0x0c60
1546 struct bt_hci_cmd_send_keypress_notify {
1547         uint8_t  bdaddr[6];
1548         uint8_t  type;
1549 } __attribute__ ((packed));
1550 struct bt_hci_rsp_send_keypress_notify {
1551         uint8_t  status;
1552         uint8_t  bdaddr[6];
1553 } __attribute__ ((packed));
1554
1555 #define BT_HCI_CMD_SET_EVENT_MASK_PAGE2         0x0c63
1556 struct bt_hci_cmd_set_event_mask_page2 {
1557         uint8_t  mask[8];
1558 } __attribute__ ((packed));
1559
1560 #define BT_HCI_CMD_READ_LOCATION_DATA           0x0c64
1561 struct bt_hci_rsp_read_location_data {
1562         uint8_t  status;
1563         uint8_t  domain_aware;
1564         uint8_t  domain[2];
1565         uint8_t  domain_options;
1566         uint8_t  options;
1567 } __attribute__ ((packed));
1568
1569 #define BT_HCI_CMD_WRITE_LOCATION_DATA          0x0c65
1570 struct bt_hci_cmd_write_location_data {
1571         uint8_t  domain_aware;
1572         uint8_t  domain[2];
1573         uint8_t  domain_options;
1574         uint8_t  options;
1575 } __attribute__ ((packed));
1576
1577 #define BT_HCI_CMD_READ_FLOW_CONTROL_MODE       0x0c66
1578 struct bt_hci_rsp_read_flow_control_mode {
1579         uint8_t  status;
1580         uint8_t  mode;
1581 } __attribute__ ((packed));
1582
1583 #define BT_HCI_CMD_WRITE_FLOW_CONTROL_MODE      0x0c67
1584 struct bt_hci_cmd_write_flow_control_mode {
1585         uint8_t  mode;
1586 } __attribute__ ((packed));
1587
1588 #define BT_HCI_CMD_READ_ENHANCED_TX_POWER       0x0c68
1589 struct bt_hci_cmd_read_enhanced_tx_power {
1590         uint16_t handle;
1591         uint8_t  type;
1592 } __attribute__ ((packed));
1593 struct bt_hci_rsp_read_enhanced_tx_power {
1594         uint8_t  status;
1595         uint16_t handle;
1596         int8_t   level_gfsk;
1597         int8_t   level_dqpsk;
1598         int8_t   level_8dpsk;
1599 } __attribute__ ((packed));
1600
1601 #define BT_HCI_CMD_SHORT_RANGE_MODE             0x0c6b
1602 struct bt_hci_cmd_short_range_mode {
1603         uint8_t  phy_handle;
1604         uint8_t  mode;
1605 } __attribute__ ((packed));
1606
1607 #define BT_HCI_CMD_READ_LE_HOST_SUPPORTED       0x0c6c
1608 struct bt_hci_rsp_read_le_host_supported {
1609         uint8_t  status;
1610         uint8_t  supported;
1611         uint8_t  simultaneous;
1612 } __attribute__ ((packed));
1613
1614 #define BT_HCI_CMD_WRITE_LE_HOST_SUPPORTED      0x0c6d
1615 struct bt_hci_cmd_write_le_host_supported {
1616         uint8_t  supported;
1617         uint8_t  simultaneous;
1618 } __attribute__ ((packed));
1619
1620 #define BT_HCI_CMD_SET_RESERVED_LT_ADDR         0x0c74
1621 struct bt_hci_cmd_set_reserved_lt_addr {
1622         uint8_t  lt_addr;
1623 } __attribute__ ((packed));
1624 struct bt_hci_rsp_set_reserved_lt_addr {
1625         uint8_t  status;
1626         uint8_t  lt_addr;
1627 } __attribute__ ((packed));
1628
1629 #define BT_HCI_CMD_DELETE_RESERVED_LT_ADDR      0x0c75
1630 struct bt_hci_cmd_delete_reserved_lt_addr {
1631         uint8_t  lt_addr;
1632 } __attribute__ ((packed));
1633 struct bt_hci_rsp_delete_reserved_lt_addr {
1634         uint8_t  status;
1635         uint8_t  lt_addr;
1636 } __attribute__ ((packed));
1637
1638 #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_DATA        0x0c76
1639 struct bt_hci_cmd_set_peripheral_broadcast_data {
1640         uint8_t  lt_addr;
1641         uint8_t  fragment;
1642         uint8_t  length;
1643 } __attribute__ ((packed));
1644 struct bt_hci_rsp_set_peripheral_broadcast_data {
1645         uint8_t  status;
1646         uint8_t  lt_addr;
1647 } __attribute__ ((packed));
1648
1649 #define BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS       0x0c77
1650 struct bt_hci_rsp_read_sync_train_params {
1651         uint8_t  status;
1652         uint16_t interval;
1653         uint32_t timeout;
1654         uint8_t  service_data;
1655 } __attribute__ ((packed));
1656
1657 #define BT_HCI_CMD_WRITE_SYNC_TRAIN_PARAMS      0x0c78
1658 struct bt_hci_cmd_write_sync_train_params {
1659         uint16_t min_interval;
1660         uint16_t max_interval;
1661         uint32_t timeout;
1662         uint8_t  service_data;
1663 } __attribute__ ((packed));
1664 struct bt_hci_rsp_write_sync_train_params {
1665         uint8_t  status;
1666         uint16_t interval;
1667 } __attribute__ ((packed));
1668
1669 #define BT_HCI_CMD_READ_SECURE_CONN_SUPPORT     0x0c79
1670 struct bt_hci_rsp_read_secure_conn_support {
1671         uint8_t  status;
1672         uint8_t  support;
1673 } __attribute__ ((packed));
1674
1675 #define BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT    0x0c7a
1676 struct bt_hci_cmd_write_secure_conn_support {
1677         uint8_t support;
1678 } __attribute__ ((packed));
1679
1680 #define BT_HCI_CMD_READ_AUTH_PAYLOAD_TIMEOUT    0x0c7b
1681 struct bt_hci_cmd_read_auth_payload_timeout {
1682         uint16_t handle;
1683 } __attribute__ ((packed));
1684 struct bt_hci_rsp_read_auth_payload_timeout {
1685         uint8_t  status;
1686         uint16_t handle;
1687         uint16_t timeout;
1688 } __attribute__ ((packed));
1689
1690 #define BT_HCI_CMD_WRITE_AUTH_PAYLOAD_TIMEOUT   0x0c7c
1691 struct bt_hci_cmd_write_auth_payload_timeout {
1692         uint16_t handle;
1693         uint16_t timeout;
1694 } __attribute__ ((packed));
1695 struct bt_hci_rsp_write_auth_payload_timeout {
1696         uint8_t  status;
1697         uint16_t handle;
1698 } __attribute__ ((packed));
1699
1700 #define BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA      0x0c7d
1701 struct bt_hci_rsp_read_local_oob_ext_data {
1702         uint8_t  status;
1703         uint8_t  hash192[16];
1704         uint8_t  randomizer192[16];
1705         uint8_t  hash256[16];
1706         uint8_t  randomizer256[16];
1707 } __attribute__ ((packed));
1708
1709 #define BT_HCI_CMD_READ_EXT_PAGE_TIMEOUT        0x0c7e
1710 struct bt_hci_rsp_read_ext_page_timeout {
1711         uint8_t  status;
1712         uint16_t timeout;
1713 } __attribute__ ((packed));
1714
1715 #define BT_HCI_CMD_WRITE_EXT_PAGE_TIMEOUT       0x0c7f
1716 struct bt_hci_cmd_write_ext_page_timeout {
1717         uint16_t timeout;
1718 } __attribute__ ((packed));
1719
1720 #define BT_HCI_CMD_READ_EXT_INQUIRY_LENGTH      0x0c80
1721 struct bt_hci_rsp_read_ext_inquiry_length {
1722         uint8_t  status;
1723         uint16_t interval;
1724 } __attribute__ ((packed));
1725
1726 #define BT_HCI_CMD_WRITE_EXT_INQUIRY_LENGTH     0x0c81
1727 struct bt_hci_cmd_write_ext_inquiry_length {
1728         uint16_t interval;
1729 } __attribute__ ((packed));
1730
1731 #define BT_HCI_CMD_CONFIG_DATA_PATH             0x0c83
1732 #define BT_HCI_BIT_CONFIG_DATA_PATH             BT_HCI_CMD_BIT(45, 5)
1733 struct bt_hci_cmd_config_data_path {
1734         uint8_t  dir;
1735         uint8_t  id;
1736         uint8_t  vnd_config_len;
1737         uint8_t  vnd_config[0];
1738 } __attribute__ ((packed));
1739
1740 #define BT_HCI_CMD_READ_LOCAL_VERSION           0x1001
1741 struct bt_hci_rsp_read_local_version {
1742         uint8_t  status;
1743         uint8_t  hci_ver;
1744         uint16_t hci_rev;
1745         uint8_t  lmp_ver;
1746         uint16_t manufacturer;
1747         uint16_t lmp_subver;
1748 } __attribute__ ((packed));
1749
1750 #define BT_HCI_CMD_READ_LOCAL_COMMANDS          0x1002
1751 struct bt_hci_rsp_read_local_commands {
1752         uint8_t  status;
1753         uint8_t  commands[64];
1754 } __attribute__ ((packed));
1755
1756 #define BT_HCI_CMD_READ_LOCAL_FEATURES          0x1003
1757 struct bt_hci_rsp_read_local_features {
1758         uint8_t  status;
1759         uint8_t  features[8];
1760 } __attribute__ ((packed));
1761
1762 #define BT_HCI_CMD_READ_LOCAL_EXT_FEATURES      0x1004
1763 struct bt_hci_cmd_read_local_ext_features {
1764         uint8_t  page;
1765 } __attribute__ ((packed));
1766 struct bt_hci_rsp_read_local_ext_features {
1767         uint8_t  status;
1768         uint8_t  page;
1769         uint8_t  max_page;
1770         uint8_t  features[8];
1771 } __attribute__ ((packed));
1772
1773 #define BT_HCI_CMD_READ_BUFFER_SIZE             0x1005
1774 struct bt_hci_rsp_read_buffer_size {
1775         uint8_t  status;
1776         uint16_t acl_mtu;
1777         uint8_t  sco_mtu;
1778         uint16_t acl_max_pkt;
1779         uint16_t sco_max_pkt;
1780 } __attribute__ ((packed));
1781
1782 #define BT_HCI_CMD_READ_COUNTRY_CODE            0x1007
1783 struct bt_hci_rsp_read_country_code {
1784         uint8_t  status;
1785         uint8_t  code;
1786 } __attribute__ ((packed));
1787
1788 #define BT_HCI_CMD_READ_BD_ADDR                 0x1009
1789 struct bt_hci_rsp_read_bd_addr {
1790         uint8_t  status;
1791         uint8_t  bdaddr[6];
1792 } __attribute__ ((packed));
1793
1794 #define BT_HCI_CMD_READ_DATA_BLOCK_SIZE         0x100a
1795 struct bt_hci_rsp_read_data_block_size {
1796         uint8_t  status;
1797         uint16_t max_acl_len;
1798         uint16_t block_len;
1799         uint16_t num_blocks;
1800 } __attribute__ ((packed));
1801
1802 #define BT_HCI_CMD_READ_LOCAL_CODECS            0x100b
1803 struct bt_hci_rsp_read_local_codecs {
1804         uint8_t  status;
1805         uint8_t  num_codecs;
1806         uint8_t  codec[0];
1807 } __attribute__ ((packed));
1808
1809 #define BT_HCI_CMD_READ_LOCAL_PAIRING_OPTIONS   0x100c
1810 struct bt_hci_rsp_read_local_pairing_options {
1811         uint8_t  status;
1812         uint8_t  pairing_options;
1813         uint8_t  max_key_size;
1814 } __attribute__ ((packed));
1815
1816 #define BT_HCI_CMD_READ_LOCAL_CODECS_V2         0x100d
1817 #define BT_HCI_BIT_READ_LOCAL_CODECS_V2         BT_HCI_CMD_BIT(45, 2)
1818 #define BT_HCI_LOCAL_CODEC_BREDR_ACL            BIT(0)
1819 #define BT_HCI_LOCAL_CODEC_BREDR_SCO            BIT(1)
1820 #define BT_HCI_LOCAL_CODEC_LE_CIS               BIT(2)
1821 #define BT_HCI_LOCAL_CODEC_LE_BIS               BIT(3)
1822
1823 struct bt_hci_vnd_codec_v2 {
1824         uint16_t cid;
1825         uint16_t vid;
1826         uint8_t  transport;
1827 } __attribute__ ((packed));
1828
1829 struct bt_hci_vnd_codec {
1830         uint8_t  id;
1831         uint16_t cid;
1832         uint16_t vid;
1833         uint8_t  transport;
1834 } __attribute__ ((packed));
1835
1836 struct bt_hci_codec {
1837         uint8_t  id;
1838         uint8_t  transport;
1839 } __attribute__ ((packed));
1840
1841 struct bt_hci_rsp_read_local_codecs_v2 {
1842         uint8_t  status;
1843         uint8_t  num_codecs;
1844         struct bt_hci_codec codec[0];
1845 } __attribute__ ((packed));
1846
1847 #define BT_HCI_CMD_READ_LOCAL_CODEC_CAPS        0x100e
1848 #define BT_HCI_BIT_READ_LOCAL_CODEC_CAPS        BT_HCI_CMD_BIT(45, 3)
1849 struct bt_hci_cmd_read_local_codec_caps {
1850         struct bt_hci_vnd_codec codec;
1851         uint8_t  dir;
1852 } __attribute__ ((packed));
1853
1854 struct bt_hci_codec_caps {
1855         uint8_t  len;
1856         uint8_t  data[0];
1857 } __attribute__ ((packed));
1858
1859 struct bt_hci_rsp_read_local_codec_caps {
1860         uint8_t  status;
1861         uint8_t  num;
1862         struct bt_hci_codec_caps caps[0];
1863 } __attribute__ ((packed));
1864
1865 #define BT_HCI_CMD_READ_LOCAL_CTRL_DELAY        0x100f
1866 #define BT_HCI_BIT_READ_LOCAL_CTRL_DELAY        BT_HCI_CMD_BIT(45, 4)
1867 struct bt_hci_cmd_read_local_ctrl_delay {
1868         struct bt_hci_vnd_codec codec;
1869         uint8_t  dir;
1870         uint8_t  codec_cfg_len;
1871         uint8_t  codec_cfg[0];
1872 } __attribute__ ((packed));
1873
1874 struct bt_hci_rsp_read_local_ctrl_delay {
1875         uint8_t  status;
1876         uint8_t  min_delay[3];
1877         uint8_t  max_delay[3];
1878 } __attribute__ ((packed));
1879
1880 #define BT_HCI_CMD_READ_FAILED_CONTACT_COUNTER  0x1401
1881 struct bt_hci_cmd_read_failed_contact_counter {
1882         uint16_t handle;
1883 } __attribute__ ((packed));
1884 struct bt_hci_rsp_read_failed_contact_counter {
1885         uint8_t  status;
1886         uint16_t handle;
1887         uint16_t counter;
1888 } __attribute__ ((packed));
1889
1890 #define BT_HCI_CMD_RESET_FAILED_CONTACT_COUNTER 0x1402
1891 struct bt_hci_cmd_reset_failed_contact_counter {
1892         uint16_t handle;
1893 } __attribute__ ((packed));
1894 struct bt_hci_rsp_reset_failed_contact_counter {
1895         uint8_t  status;
1896         uint16_t handle;
1897 } __attribute__ ((packed));
1898
1899 #define BT_HCI_CMD_READ_LINK_QUALITY            0x1403
1900 struct bt_hci_cmd_read_link_quality {
1901         uint16_t handle;
1902 } __attribute__ ((packed));
1903 struct bt_hci_rsp_read_link_quality {
1904         uint8_t  status;
1905         uint16_t handle;
1906         uint8_t  link_quality;
1907 } __attribute__ ((packed));
1908
1909 #define BT_HCI_CMD_READ_RSSI                    0x1405
1910 struct bt_hci_cmd_read_rssi {
1911         uint16_t handle;
1912 } __attribute__ ((packed));
1913 struct bt_hci_rsp_read_rssi {
1914         uint8_t  status;
1915         uint16_t handle;
1916         int8_t   rssi;
1917 } __attribute__ ((packed));
1918
1919 #define BT_HCI_CMD_READ_AFH_CHANNEL_MAP         0x1406
1920 struct bt_hci_cmd_read_afh_channel_map {
1921         uint16_t handle;
1922 } __attribute__ ((packed));
1923 struct bt_hci_rsp_read_afh_channel_map {
1924         uint8_t  status;
1925         uint16_t handle;
1926         uint8_t  mode;
1927         uint8_t  map[10];
1928 } __attribute__ ((packed));
1929
1930 #define BT_HCI_CMD_READ_CLOCK                   0x1407
1931 struct bt_hci_cmd_read_clock {
1932         uint16_t handle;
1933         uint8_t  type;
1934 } __attribute__ ((packed));
1935 struct bt_hci_rsp_read_clock {
1936         uint8_t  status;
1937         uint16_t handle;
1938         uint32_t clock;
1939         uint16_t accuracy;
1940 } __attribute__ ((packed));
1941
1942 #define BT_HCI_CMD_READ_ENCRYPT_KEY_SIZE        0x1408
1943 struct bt_hci_cmd_read_encrypt_key_size {
1944         uint16_t handle;
1945 } __attribute__ ((packed));
1946 struct bt_hci_rsp_read_encrypt_key_size {
1947         uint8_t  status;
1948         uint16_t handle;
1949         uint8_t  key_size;
1950 } __attribute__ ((packed));
1951
1952 #define BT_HCI_CMD_READ_LOCAL_AMP_INFO          0x1409
1953 struct bt_hci_rsp_read_local_amp_info {
1954         uint8_t  status;
1955         uint8_t  amp_status;
1956         uint32_t total_bw;
1957         uint32_t max_bw;
1958         uint32_t min_latency;
1959         uint32_t max_pdu;
1960         uint8_t  amp_type;
1961         uint16_t pal_cap;
1962         uint16_t max_assoc_len;
1963         uint32_t max_flush_to;
1964         uint32_t be_flush_to;
1965 } __attribute__ ((packed));
1966
1967 #define BT_HCI_CMD_READ_LOCAL_AMP_ASSOC         0x140a
1968 struct bt_hci_cmd_read_local_amp_assoc {
1969         uint8_t  phy_handle;
1970         uint16_t len_so_far;
1971         uint16_t max_assoc_len;
1972 } __attribute__ ((packed));
1973 struct bt_hci_rsp_read_local_amp_assoc {
1974         uint8_t  status;
1975         uint8_t  phy_handle;
1976         uint16_t remain_assoc_len;
1977         uint8_t  assoc_fragment[248];
1978 } __attribute__ ((packed));
1979
1980 #define BT_HCI_CMD_WRITE_REMOTE_AMP_ASSOC       0x140b
1981 struct bt_hci_cmd_write_remote_amp_assoc {
1982         uint8_t  phy_handle;
1983         uint16_t len_so_far;
1984         uint16_t remain_assoc_len;
1985         uint8_t  assoc_fragment[248];
1986 } __attribute__ ((packed));
1987 struct bt_hci_rsp_write_remote_amp_assoc {
1988         uint8_t  status;
1989         uint8_t  phy_handle;
1990 } __attribute__ ((packed));
1991
1992 #define BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG     0x140c
1993 struct bt_hci_rsp_get_mws_transport_config {
1994         uint8_t  status;
1995         uint8_t  num_transports;
1996         uint8_t  transport[0];
1997 } __attribute__ ((packed));
1998
1999 #define BT_HCI_CMD_SET_TRIGGERED_CLOCK_CAPTURE  0x140d
2000 struct bt_hci_cmd_set_triggered_clock_capture {
2001         uint16_t handle;
2002         uint8_t  enable;
2003         uint8_t  type;
2004         uint8_t  lpo_allowed;
2005         uint8_t  num_filter;
2006 } __attribute__ ((packed));
2007
2008 #define BT_HCI_CMD_READ_LOOPBACK_MODE           0x1801
2009 struct bt_hci_rsp_read_loopback_mode {
2010         uint8_t  status;
2011         uint8_t  mode;
2012 } __attribute__ ((packed));
2013
2014 #define BT_HCI_CMD_WRITE_LOOPBACK_MODE          0x1802
2015 struct bt_hci_cmd_write_loopback_mode {
2016         uint8_t  mode;
2017 } __attribute__ ((packed));
2018
2019 #define BT_HCI_CMD_ENABLE_DUT_MODE              0x1803
2020
2021 #define BT_HCI_CMD_WRITE_SSP_DEBUG_MODE         0x1804
2022 struct bt_hci_cmd_write_ssp_debug_mode {
2023         uint8_t  mode;
2024 } __attribute__ ((packed));
2025
2026 #define BT_HCI_CMD_LE_SET_EVENT_MASK            0x2001
2027 struct bt_hci_cmd_le_set_event_mask {
2028         uint8_t  mask[8];
2029 } __attribute__ ((packed));
2030
2031 #define BT_HCI_CMD_LE_READ_BUFFER_SIZE          0x2002
2032 struct bt_hci_rsp_le_read_buffer_size {
2033         uint8_t  status;
2034         uint16_t le_mtu;
2035         uint8_t  le_max_pkt;
2036 } __attribute__ ((packed));
2037
2038 #define BT_HCI_CMD_LE_READ_LOCAL_FEATURES       0x2003
2039 struct bt_hci_rsp_le_read_local_features {
2040         uint8_t  status;
2041         uint8_t  features[8];
2042 } __attribute__ ((packed));
2043
2044 #define BT_HCI_CMD_LE_SET_RANDOM_ADDRESS        0x2005
2045 struct bt_hci_cmd_le_set_random_address {
2046         uint8_t  addr[6];
2047 } __attribute__ ((packed));
2048
2049 #define BT_HCI_CMD_LE_SET_ADV_PARAMETERS        0x2006
2050 struct bt_hci_cmd_le_set_adv_parameters {
2051         uint16_t min_interval;
2052         uint16_t max_interval;
2053         uint8_t  type;
2054         uint8_t  own_addr_type;
2055         uint8_t  direct_addr_type;
2056         uint8_t  direct_addr[6];
2057         uint8_t  channel_map;
2058         uint8_t  filter_policy;
2059 } __attribute__ ((packed));
2060
2061 #define BT_HCI_CMD_LE_READ_ADV_TX_POWER         0x2007
2062 struct bt_hci_rsp_le_read_adv_tx_power {
2063         uint8_t  status;
2064         int8_t   level;
2065 } __attribute__ ((packed));
2066
2067 #define BT_HCI_CMD_LE_SET_ADV_DATA              0x2008
2068 struct bt_hci_cmd_le_set_adv_data {
2069         uint8_t  len;
2070         uint8_t  data[31];
2071 } __attribute__ ((packed));
2072
2073 #define BT_HCI_CMD_LE_SET_SCAN_RSP_DATA         0x2009
2074 struct bt_hci_cmd_le_set_scan_rsp_data {
2075         uint8_t  len;
2076         uint8_t  data[31];
2077 } __attribute__ ((packed));
2078
2079 #define BT_HCI_CMD_LE_SET_ADV_ENABLE            0x200a
2080 struct bt_hci_cmd_le_set_adv_enable {
2081         uint8_t  enable;
2082 } __attribute__ ((packed));
2083
2084 #define BT_HCI_CMD_LE_SET_SCAN_PARAMETERS       0x200b
2085 struct bt_hci_cmd_le_set_scan_parameters {
2086         uint8_t  type;
2087         uint16_t interval;
2088         uint16_t window;
2089         uint8_t  own_addr_type;
2090         uint8_t  filter_policy;
2091 } __attribute__ ((packed));
2092
2093 #define BT_HCI_CMD_LE_SET_SCAN_ENABLE           0x200c
2094 struct bt_hci_cmd_le_set_scan_enable {
2095         uint8_t  enable;
2096         uint8_t  filter_dup;
2097 } __attribute__ ((packed));
2098
2099 #define BT_HCI_CMD_LE_CREATE_CONN               0x200d
2100 struct bt_hci_cmd_le_create_conn {
2101         uint16_t scan_interval;
2102         uint16_t scan_window;
2103         uint8_t  filter_policy;
2104         uint8_t  peer_addr_type;
2105         uint8_t  peer_addr[6];
2106         uint8_t  own_addr_type;
2107         uint16_t min_interval;
2108         uint16_t max_interval;
2109         uint16_t latency;
2110         uint16_t supv_timeout;
2111         uint16_t min_length;
2112         uint16_t max_length;
2113 } __attribute__ ((packed));
2114
2115 #define BT_HCI_CMD_LE_CREATE_CONN_CANCEL        0x200e
2116
2117 #define BT_HCI_CMD_LE_READ_ACCEPT_LIST_SIZE     0x200f
2118 struct bt_hci_rsp_le_read_accept_list_size {
2119         uint8_t  status;
2120         uint8_t  size;
2121 } __attribute__ ((packed));
2122
2123 #define BT_HCI_CMD_LE_CLEAR_ACCEPT_LIST         0x2010
2124
2125 #define BT_HCI_CMD_LE_ADD_TO_ACCEPT_LIST        0x2011
2126 struct bt_hci_cmd_le_add_to_accept_list {
2127         uint8_t  addr_type;
2128         uint8_t  addr[6];
2129 } __attribute__ ((packed));
2130
2131 #define BT_HCI_CMD_LE_REMOVE_FROM_ACCEPT_LIST   0x2012
2132 struct bt_hci_cmd_le_remove_from_accept_list {
2133         uint8_t  addr_type;
2134         uint8_t  addr[6];
2135 } __attribute__ ((packed));
2136
2137 #define BT_HCI_CMD_LE_CONN_UPDATE               0x2013
2138 struct bt_hci_cmd_le_conn_update {
2139         uint16_t handle;
2140         uint16_t min_interval;
2141         uint16_t max_interval;
2142         uint16_t latency;
2143         uint16_t supv_timeout;
2144         uint16_t min_length;
2145         uint16_t max_length;
2146 } __attribute__ ((packed));
2147
2148 #define BT_HCI_CMD_LE_SET_HOST_CLASSIFICATION   0x2014
2149 struct bt_hci_cmd_le_set_host_classification {
2150         uint8_t  map[5];
2151 } __attribute__ ((packed));
2152
2153 #define BT_HCI_CMD_LE_READ_CHANNEL_MAP          0x2015
2154 struct bt_hci_cmd_le_read_channel_map {
2155         uint16_t handle;
2156 } __attribute__ ((packed));
2157 struct bt_hci_rsp_le_read_channel_map {
2158         uint8_t  status;
2159         uint16_t handle;
2160         uint8_t  map[5];
2161 } __attribute__ ((packed));
2162
2163 #define BT_HCI_CMD_LE_READ_REMOTE_FEATURES      0x2016
2164 struct bt_hci_cmd_le_read_remote_features {
2165         uint16_t handle;
2166 } __attribute__ ((packed));
2167
2168 #define BT_HCI_CMD_LE_ENCRYPT                   0x2017
2169 struct bt_hci_cmd_le_encrypt {
2170         uint8_t  key[16];
2171         uint8_t  plaintext[16];
2172 } __attribute__ ((packed));
2173 struct bt_hci_rsp_le_encrypt {
2174         uint8_t  status;
2175         uint8_t  data[16];
2176 } __attribute__ ((packed));
2177
2178 #define BT_HCI_CMD_LE_RAND                      0x2018
2179 struct bt_hci_rsp_le_rand {
2180         uint8_t  status;
2181         uint64_t number;
2182 } __attribute__ ((packed));
2183
2184 #define BT_HCI_CMD_LE_START_ENCRYPT             0x2019
2185 struct bt_hci_cmd_le_start_encrypt {
2186         uint16_t handle;
2187         uint64_t rand;
2188         uint16_t ediv;
2189         uint8_t  ltk[16];
2190 } __attribute__ ((packed));
2191
2192 #define BT_HCI_CMD_LE_LTK_REQ_REPLY             0x201a
2193 struct bt_hci_cmd_le_ltk_req_reply {
2194         uint16_t handle;
2195         uint8_t  ltk[16];
2196 } __attribute__ ((packed));
2197 struct bt_hci_rsp_le_ltk_req_reply {
2198         uint8_t  status;
2199         uint16_t handle;
2200 } __attribute__ ((packed));
2201
2202 #define BT_HCI_CMD_LE_LTK_REQ_NEG_REPLY         0x201b
2203 struct bt_hci_cmd_le_ltk_req_neg_reply {
2204         uint16_t handle;
2205 } __attribute__ ((packed));
2206 struct bt_hci_rsp_le_ltk_req_neg_reply {
2207         uint8_t  status;
2208         uint16_t handle;
2209 } __attribute__ ((packed));
2210
2211 #define BT_HCI_CMD_LE_READ_SUPPORTED_STATES     0x201c
2212 struct bt_hci_rsp_le_read_supported_states {
2213         uint8_t  status;
2214         uint8_t  states[8];
2215 } __attribute__ ((packed));
2216
2217 #define BT_HCI_CMD_LE_RECEIVER_TEST             0x201d
2218 struct bt_hci_cmd_le_receiver_test {
2219         uint8_t  frequency;
2220 } __attribute__ ((packed));
2221
2222 #define BT_HCI_CMD_LE_TRANSMITTER_TEST          0x201e
2223 struct bt_hci_cmd_le_transmitter_test {
2224         uint8_t  frequency;
2225         uint8_t  data_len;
2226         uint8_t  payload;
2227 } __attribute__ ((packed));
2228
2229 #define BT_HCI_CMD_LE_TEST_END                  0x201f
2230 struct bt_hci_rsp_le_test_end {
2231         uint8_t  status;
2232         uint16_t num_packets;
2233 } __attribute__ ((packed));
2234
2235 #define BT_HCI_CMD_LE_CONN_PARAM_REQ_REPLY      0x2020
2236 struct bt_hci_cmd_le_conn_param_req_reply {
2237         uint16_t handle;
2238         uint16_t min_interval;
2239         uint16_t max_interval;
2240         uint16_t latency;
2241         uint16_t supv_timeout;
2242         uint16_t min_length;
2243         uint16_t max_length;
2244 } __attribute__ ((packed));
2245 struct bt_hci_rsp_le_conn_param_req_reply {
2246         uint8_t  status;
2247         uint16_t handle;
2248 } __attribute__ ((packed));
2249
2250 #define BT_HCI_CMD_LE_CONN_PARAM_REQ_NEG_REPLY  0x2021
2251 struct bt_hci_cmd_le_conn_param_req_neg_reply {
2252         uint16_t handle;
2253         uint8_t  reason;
2254 } __attribute__ ((packed));
2255 struct bt_hci_rsp_le_conn_param_req_neg_reply {
2256         uint8_t  status;
2257         uint16_t handle;
2258 } __attribute__ ((packed));
2259
2260 #define BT_HCI_CMD_LE_SET_DATA_LENGTH           0x2022
2261 struct bt_hci_cmd_le_set_data_length {
2262         uint16_t handle;
2263         uint16_t tx_len;
2264         uint16_t tx_time;
2265 } __attribute__ ((packed));
2266 struct bt_hci_rsp_le_set_data_length {
2267         uint8_t  status;
2268         uint16_t handle;
2269 } __attribute__ ((packed));
2270
2271 #define BT_HCI_CMD_LE_READ_DEFAULT_DATA_LENGTH  0x2023
2272 struct bt_hci_rsp_le_read_default_data_length {
2273         uint8_t  status;
2274         uint16_t tx_len;
2275         uint16_t tx_time;
2276 } __attribute__ ((packed));
2277
2278 #define BT_HCI_CMD_LE_WRITE_DEFAULT_DATA_LENGTH 0x2024
2279 struct bt_hci_cmd_le_write_default_data_length {
2280         uint16_t tx_len;
2281         uint16_t tx_time;
2282 } __attribute__ ((packed));
2283
2284 #define BT_HCI_CMD_LE_READ_LOCAL_PK256          0x2025
2285
2286 #define BT_HCI_CMD_LE_GENERATE_DHKEY            0x2026
2287 struct bt_hci_cmd_le_generate_dhkey {
2288         uint8_t  remote_pk256[64];
2289 } __attribute__ ((packed));
2290
2291 #define BT_HCI_CMD_LE_ADD_TO_RESOLV_LIST        0x2027
2292 struct bt_hci_cmd_le_add_to_resolv_list {
2293         uint8_t  addr_type;
2294         uint8_t  addr[6];
2295         uint8_t  peer_irk[16];
2296         uint8_t  local_irk[16];
2297 } __attribute__ ((packed));
2298
2299 #define BT_HCI_CMD_LE_REMOVE_FROM_RESOLV_LIST   0x2028
2300 struct bt_hci_cmd_le_remove_from_resolv_list {
2301         uint8_t  addr_type;
2302         uint8_t  addr[6];
2303 } __attribute__ ((packed));
2304
2305 #define BT_HCI_CMD_LE_CLEAR_RESOLV_LIST         0x2029
2306
2307 #define BT_HCI_CMD_LE_READ_RESOLV_LIST_SIZE     0x202a
2308 struct bt_hci_rsp_le_read_resolv_list_size {
2309         uint8_t  status;
2310         uint8_t  size;
2311 } __attribute__ ((packed));
2312
2313 #define BT_HCI_CMD_LE_READ_PEER_RESOLV_ADDR     0x202b
2314 struct bt_hci_cmd_le_read_peer_resolv_addr {
2315         uint8_t  addr_type;
2316         uint8_t  addr[6];
2317 } __attribute__ ((packed));
2318 struct bt_hci_rsp_le_read_peer_resolv_addr {
2319         uint8_t  status;
2320         uint8_t  addr[6];
2321 } __attribute__ ((packed));
2322
2323 #define BT_HCI_CMD_LE_READ_LOCAL_RESOLV_ADDR    0x202c
2324 struct bt_hci_cmd_le_read_local_resolv_addr {
2325         uint8_t  addr_type;
2326         uint8_t  addr[6];
2327 } __attribute__ ((packed));
2328 struct bt_hci_rsp_le_read_local_resolv_addr {
2329         uint8_t  status;
2330         uint8_t  addr[6];
2331 } __attribute__ ((packed));
2332
2333 #define BT_HCI_CMD_LE_SET_RESOLV_ENABLE         0x202d
2334 struct bt_hci_cmd_le_set_resolv_enable {
2335         uint8_t  enable;
2336 } __attribute__ ((packed));
2337
2338 #define BT_HCI_CMD_LE_SET_RESOLV_TIMEOUT        0x202e
2339 struct bt_hci_cmd_le_set_resolv_timeout {
2340         uint16_t timeout;
2341 } __attribute__ ((packed));
2342
2343 #define BT_HCI_CMD_LE_READ_MAX_DATA_LENGTH      0x202f
2344 struct bt_hci_rsp_le_read_max_data_length {
2345         uint8_t  status;
2346         uint16_t max_tx_len;
2347         uint16_t max_tx_time;
2348         uint16_t max_rx_len;
2349         uint16_t max_rx_time;
2350 } __attribute__ ((packed));
2351
2352 #define BT_HCI_CMD_LE_READ_PHY                  0x2030
2353 struct bt_hci_cmd_le_read_phy {
2354         uint16_t handle;
2355 } __attribute__((packed));
2356 struct bt_hci_rsp_le_read_phy {
2357         uint8_t  status;
2358         uint16_t handle;
2359         uint8_t  tx_phy;
2360         uint8_t  rx_phy;
2361 } __attribute__((packed));
2362
2363 #define BT_HCI_CMD_LE_SET_DEFAULT_PHY           0x2031
2364 struct bt_hci_cmd_le_set_default_phy {
2365         uint8_t  all_phys;
2366         uint8_t  tx_phys;
2367         uint8_t  rx_phys;
2368 } __attribute__((packed));
2369
2370 #define BT_HCI_CMD_LE_SET_PHY                   0x2032
2371 struct bt_hci_cmd_le_set_phy {
2372         uint16_t handle;
2373         uint8_t  all_phys;
2374         uint8_t  tx_phys;
2375         uint8_t  rx_phys;
2376         uint16_t phy_opts;
2377 } __attribute__((packed));
2378
2379 #define BT_HCI_CMD_LE_ENHANCED_RECEIVER_TEST                    0x2033
2380 struct bt_hci_cmd_le_enhanced_receiver_test {
2381         uint8_t rx_channel;
2382         uint8_t phy;
2383         uint8_t modulation_index;
2384 } __attribute__((packed));
2385
2386 #define BT_HCI_CMD_LE_ENHANCED_TRANSMITTER_TEST                 0x2034
2387 struct bt_hci_cmd_le_enhanced_transmitter_test {
2388         uint8_t tx_channel;
2389         uint8_t data_len;
2390         uint8_t payload;
2391         uint8_t phy;
2392 } __attribute__((packed));
2393
2394 #define BT_HCI_CMD_LE_SET_ADV_SET_RAND_ADDR                     0x2035
2395 struct bt_hci_cmd_le_set_adv_set_rand_addr {
2396         uint8_t  handle;
2397         uint8_t  bdaddr[6];
2398 } __attribute__ ((packed));
2399
2400 #define BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS                        0x2036
2401 struct bt_hci_cmd_le_set_ext_adv_params {
2402         uint8_t  handle;
2403         uint16_t evt_properties;
2404         uint8_t  min_interval[3];
2405         uint8_t  max_interval[3];
2406         uint8_t  channel_map;
2407         uint8_t  own_addr_type;
2408         uint8_t  peer_addr_type;
2409         uint8_t  peer_addr[6];
2410         uint8_t  filter_policy;
2411         uint8_t  tx_power;
2412         uint8_t  primary_phy;
2413         uint8_t  secondary_max_skip;
2414         uint8_t  secondary_phy;
2415         uint8_t  sid;
2416         uint8_t  notif_enable;
2417 } __attribute__ ((packed));
2418 struct bt_hci_rsp_le_set_ext_adv_params {
2419         uint8_t  status;
2420         uint8_t  tx_power;
2421 } __attribute__ ((packed));
2422
2423 #define BT_HCI_CMD_LE_SET_EXT_ADV_DATA                  0x2037
2424 struct bt_hci_cmd_le_set_ext_adv_data {
2425         uint8_t  handle;
2426         uint8_t  operation;
2427         uint8_t  fragment_preference;
2428         uint8_t  data_len;
2429         uint8_t  data[0];
2430 } __attribute__ ((packed));
2431
2432 #define BT_HCI_CMD_LE_SET_EXT_SCAN_RSP_DATA                     0x2038
2433 struct bt_hci_cmd_le_set_ext_scan_rsp_data {
2434         uint8_t  handle;
2435         uint8_t  operation;
2436         uint8_t  fragment_preference;
2437         uint8_t  data_len;
2438         uint8_t  data[0];
2439 } __attribute__ ((packed));
2440
2441 #define BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE                        0x2039
2442 struct bt_hci_cmd_le_set_ext_adv_enable {
2443         uint8_t  enable;
2444         uint8_t  num_of_sets;
2445 } __attribute__ ((packed));
2446 struct bt_hci_cmd_ext_adv_set {
2447         uint8_t  handle;
2448         uint16_t duration;
2449         uint8_t  max_events;
2450 } __attribute__ ((packed));
2451
2452 #define BT_HCI_CMD_LE_READ_MAX_ADV_DATA_LEN                     0x203a
2453 struct bt_hci_rsp_le_read_max_adv_data_len {
2454         uint8_t  status;
2455         uint16_t max_len;
2456 } __attribute__ ((packed));
2457
2458 #define BT_HCI_CMD_LE_READ_NUM_SUPPORTED_ADV_SETS                       0x203b
2459 struct bt_hci_rsp_le_read_num_supported_adv_sets {
2460         uint8_t  status;
2461         uint8_t  num_of_sets;
2462 } __attribute__ ((packed));
2463
2464 #define BT_HCI_CMD_LE_REMOVE_ADV_SET                    0x203c
2465 struct bt_hci_cmd_le_remove_adv_set {
2466         uint8_t  handle;
2467 } __attribute__ ((packed));
2468
2469 #define BT_HCI_CMD_LE_CLEAR_ADV_SETS                    0x203d
2470
2471 #define BT_HCI_CMD_LE_SET_PA_PARAMS                     0x203e
2472 struct bt_hci_cmd_le_set_pa_params {
2473         uint8_t  handle;
2474         uint16_t min_interval;
2475         uint16_t max_interval;
2476         uint16_t properties;
2477 } __attribute__ ((packed));
2478
2479 #define BT_HCI_CMD_LE_SET_PA_DATA                       0x203f
2480 struct bt_hci_cmd_le_set_pa_data {
2481         uint8_t  handle;
2482         uint8_t  operation;
2483         uint8_t  data_len;
2484         uint8_t  data[0];
2485 } __attribute__ ((packed));
2486
2487 #define BT_HCI_CMD_LE_SET_PA_ENABLE                     0x2040
2488 struct bt_hci_cmd_le_set_pa_enable {
2489         uint8_t  enable;
2490         uint8_t  handle;
2491 } __attribute__ ((packed));
2492
2493 #define BT_HCI_CMD_LE_SET_EXT_SCAN_PARAMS               0x2041
2494 struct bt_hci_cmd_le_set_ext_scan_params {
2495         uint8_t  own_addr_type;
2496         uint8_t  filter_policy;
2497         uint8_t  num_phys;
2498         uint8_t  data[0];
2499 } __attribute__ ((packed));
2500 struct bt_hci_le_scan_phy {
2501         uint8_t  type;
2502         uint16_t interval;
2503         uint16_t window;
2504 } __attribute__ ((packed));
2505
2506 #define BT_HCI_CMD_LE_SET_EXT_SCAN_ENABLE               0x2042
2507 struct bt_hci_cmd_le_set_ext_scan_enable {
2508         uint8_t  enable;
2509         uint8_t  filter_dup;
2510         uint16_t duration;
2511         uint16_t period;
2512 } __attribute__ ((packed));
2513
2514 #define BT_HCI_CMD_LE_EXT_CREATE_CONN           0x2043
2515 struct bt_hci_cmd_le_ext_create_conn {
2516         uint8_t  filter_policy;
2517         uint8_t  own_addr_type;
2518         uint8_t  peer_addr_type;
2519         uint8_t  peer_addr[6];
2520         uint8_t  phys;
2521         uint8_t  data[0];
2522 } __attribute__ ((packed));
2523 struct bt_hci_le_ext_create_conn {
2524         uint16_t scan_interval;
2525         uint16_t scan_window;
2526         uint16_t min_interval;
2527         uint16_t max_interval;
2528         uint16_t latency;
2529         uint16_t supv_timeout;
2530         uint16_t min_length;
2531         uint16_t max_length;
2532 } __attribute__ ((packed));
2533
2534 #define BT_HCI_CMD_LE_PA_CREATE_SYNC            0x2044
2535 struct bt_hci_cmd_le_pa_create_sync {
2536         uint8_t  options;
2537         uint8_t  sid;
2538         uint8_t  addr_type;
2539         uint8_t  addr[6];
2540         uint16_t skip;
2541         uint16_t sync_timeout;
2542         uint8_t  sync_cte_type;
2543 } __attribute__ ((packed));
2544
2545 #define BT_HCI_CMD_LE_PA_CREATE_SYNC_CANCEL             0x2045
2546
2547 #define BT_HCI_CMD_LE_PA_TERM_SYNC              0x2046
2548 struct bt_hci_cmd_le_pa_term_sync {
2549         uint16_t sync_handle;
2550 } __attribute__ ((packed));
2551
2552 #define BT_HCI_CMD_LE_ADD_DEV_PA_LIST           0x2047
2553 struct bt_hci_cmd_le_add_dev_pa_list {
2554         uint8_t  addr_type;
2555         uint8_t  addr[6];
2556         uint8_t  sid;
2557 } __attribute__ ((packed));
2558
2559 #define BT_HCI_CMD_LE_REMOVE_DEV_PA_LIST                0x2048
2560 struct bt_hci_cmd_le_remove_dev_pa_list {
2561         uint8_t  addr_type;
2562         uint8_t  addr[6];
2563         uint8_t  sid;
2564 } __attribute__ ((packed));
2565
2566 #define BT_HCI_CMD_LE_CLEAR_PA_LIST             0x2049
2567
2568 #define BT_HCI_CMD_LE_READ_PA_LIST_SIZE         0x204a
2569 struct bt_hci_rsp_le_read_dev_pa_list_size {
2570         uint8_t  status;
2571         uint8_t  list_size;
2572 } __attribute__ ((packed));
2573
2574 #define BT_HCI_CMD_LE_READ_TX_POWER             0x204b
2575 struct bt_hci_rsp_le_read_tx_power {
2576         uint8_t  status;
2577         int8_t  min_tx_power;
2578         int8_t  max_tx_power;
2579 } __attribute__ ((packed));
2580
2581 #define BT_HCI_CMD_LE_READ_RF_PATH_COMPENSATION         0x204c
2582 struct bt_hci_rsp_le_read_rf_path_comp {
2583         uint8_t  status;
2584         uint16_t rf_tx_path_comp;
2585         uint16_t rf_rx_path_comp;
2586 } __attribute__ ((packed));
2587
2588 #define BT_HCI_CMD_LE_WRITE_RF_PATH_COMPENSATION                0x204d
2589 struct bt_hci_cmd_le_write_rf_path_comp {
2590         uint16_t rf_tx_path_comp;
2591         uint16_t rf_rx_path_comp;
2592 } __attribute__ ((packed));
2593
2594 #define BT_HCI_CMD_LE_SET_PRIV_MODE             0x204e
2595 struct bt_hci_cmd_le_set_priv_mode {
2596         uint8_t  peer_id_addr_type;
2597         uint8_t  peer_id_addr[6];
2598         uint8_t  priv_mode;
2599 } __attribute__ ((packed));
2600
2601 #define BT_HCI_CMD_LE_RECEIVER_TEST_V3          0x204f
2602 struct bt_hci_cmd_le_receiver_test_v3 {
2603         uint8_t  rx_chan;
2604         uint8_t  phy;
2605         uint8_t  mod_index;
2606         uint8_t  cte_len;
2607         uint8_t  cte_type;
2608         uint8_t  duration;
2609         uint8_t  num_antenna_id;
2610         uint8_t  antenna_ids[0];
2611 } __attribute__ ((packed));
2612
2613 #define BT_HCI_CMD_LE_TX_TEST_V3                0x2050
2614 struct bt_hci_cmd_le_tx_test_v3 {
2615         uint8_t  chan;
2616         uint8_t  data_len;
2617         uint8_t  payload;
2618         uint8_t  phy;
2619         uint8_t  cte_len;
2620         uint8_t  cte_type;
2621         uint8_t  duration;
2622         uint8_t  num_antenna_id;
2623         uint8_t  antenna_ids[0];
2624 } __attribute__ ((packed));
2625
2626 #define BT_HCI_CMD_SET_PA_REC_ENABLE            0x2059
2627 struct bt_hci_cmd_set_pa_rec_enable {
2628         uint16_t sync_handle;
2629         uint8_t  enable;
2630 } __attribute__ ((packed));
2631
2632 #define BT_HCI_CMD_PERIODIC_SYNC_TRANS          0x205a
2633 struct bt_hci_cmd_periodic_sync_trans {
2634         uint16_t handle;
2635         uint16_t service_data;
2636         uint16_t sync_handle;
2637 } __attribute__ ((packed));
2638
2639 #define BT_HCI_CMD_PA_SET_INFO_TRANS            0x205b
2640 struct bt_hci_cmd_pa_set_info_trans {
2641         uint16_t handle;
2642         uint16_t service_data;
2643         uint8_t adv_handle;
2644 } __attribute__ ((packed));
2645
2646 #define BT_HCI_CMD_PA_SYNC_TRANS_PARAMS         0x205c
2647 struct bt_hci_cmd_pa_sync_trans_params {
2648         uint16_t  handle;
2649         uint8_t   mode;
2650         uint16_t  skip;
2651         uint16_t  sync_timeout;
2652         uint8_t   cte_type;
2653 } __attribute__ ((packed));
2654
2655 #define BT_HCI_CMD_DEFAULT_PA_SYNC_TRANS_PARAMS 0x205d
2656 struct bt_hci_cmd_default_pa_sync_trans_params {
2657         uint8_t  mode;
2658         uint16_t skip;
2659         uint16_t sync_timeout;
2660         uint8_t  cte_type;
2661 } __attribute__ ((packed));
2662
2663 #define BT_HCI_CMD_LE_READ_BUFFER_SIZE_V2       0x2060
2664 #define BT_HCI_BIT_LE_READ_BUFFER_SIZE_V2       BT_HCI_CMD_BIT(41, 5)
2665 struct bt_hci_rsp_le_read_buffer_size_v2 {
2666         uint8_t  status;
2667         uint16_t acl_mtu;
2668         uint8_t  acl_max_pkt;
2669         uint16_t iso_mtu;
2670         uint8_t  iso_max_pkt;
2671 } __attribute__ ((packed));
2672
2673 #define BT_HCI_CMD_LE_READ_ISO_TX_SYNC          0x2061
2674 #define BT_HCI_BIT_LE_READ_ISO_TX_SYNC          BT_HCI_CMD_BIT(41, 6)
2675 struct bt_hci_cmd_le_read_iso_tx_sync {
2676         uint16_t handle;
2677 } __attribute__ ((packed));
2678
2679 struct bt_hci_rsp_le_read_iso_tx_sync {
2680         uint8_t  status;
2681         uint16_t handle;
2682         uint16_t seq;
2683         uint32_t timestamp;
2684         uint8_t  offset[3];
2685 } __attribute__ ((packed));
2686
2687 #define BT_HCI_CMD_LE_SET_CIG_PARAMS            0x2062
2688 #define BT_HCI_BIT_LE_SET_CIG_PARAMS            BT_HCI_CMD_BIT(41, 7)
2689 struct bt_hci_cis_params {
2690         uint8_t  cis_id;
2691         uint16_t c_sdu;
2692         uint16_t p_sdu;
2693         uint8_t  c_phy;
2694         uint8_t  p_phy;
2695         uint8_t  c_rtn;
2696         uint8_t  p_rtn;
2697 } __attribute__ ((packed));
2698
2699 struct bt_hci_cmd_le_set_cig_params {
2700         uint8_t  cig_id;
2701         uint8_t  c_interval[3];
2702         uint8_t  p_interval[3];
2703         uint8_t  sca;
2704         uint8_t  packing;
2705         uint8_t  framing;
2706         uint16_t c_latency;
2707         uint16_t p_latency;
2708         uint8_t  num_cis;
2709         struct bt_hci_cis_params cis[0];
2710 } __attribute__ ((packed));
2711
2712 struct bt_hci_rsp_le_set_cig_params {
2713         uint8_t  status;
2714         uint8_t  cig_id;
2715         uint8_t  num_handles;
2716         uint16_t handle[0];
2717 } __attribute__ ((packed));
2718
2719 #define BT_HCI_CMD_LE_SET_CIG_PARAMS_TEST       0x2063
2720 #define BT_HCI_BIT_LE_SET_CIG_PARAMS_TEST       BT_HCI_CMD_BIT(42, 0)
2721 struct bt_hci_cis_params_test {
2722         uint8_t  cis_id;
2723         uint8_t  nse;
2724         uint16_t c_sdu;
2725         uint16_t p_sdu;
2726         uint16_t c_pdu;
2727         uint16_t p_pdu;
2728         uint8_t  c_phy;
2729         uint8_t  p_phy;
2730         uint8_t  c_bn;
2731         uint8_t  p_bn;
2732 } __attribute__ ((packed));
2733
2734 struct bt_hci_cmd_le_set_cig_params_test {
2735         uint8_t  cig_id;
2736         uint8_t  c_interval[3];
2737         uint8_t  p_interval[3];
2738         uint8_t  c_ft;
2739         uint8_t  p_ft;
2740         uint16_t iso_interval;
2741         uint8_t  sca;
2742         uint8_t  packing;
2743         uint8_t  framing;
2744         uint8_t  num_cis;
2745         struct bt_hci_cis_params_test cis[0];
2746 } __attribute__ ((packed));
2747
2748 #define BT_HCI_CMD_LE_CREATE_CIS                0x2064
2749 #define BT_HCI_BIT_LE_CREATE_CIS                BT_HCI_CMD_BIT(42, 1)
2750 struct bt_hci_cis {
2751         uint16_t  cis_handle;
2752         uint16_t  acl_handle;
2753 } __attribute__ ((packed));
2754
2755 struct bt_hci_cmd_le_create_cis {
2756         uint8_t  num_cis;
2757         struct bt_hci_cis cis[0];
2758 } __attribute__ ((packed));
2759
2760 #define BT_HCI_CMD_LE_REMOVE_CIG                0x2065
2761 #define BT_HCI_BIT_LE_REMOVE_CIG                BT_HCI_CMD_BIT(42, 2)
2762 struct bt_hci_cmd_le_remove_cig {
2763         uint8_t  cig_id;
2764 } __attribute__ ((packed));
2765
2766 struct bt_hci_rsp_le_remove_cig {
2767         uint8_t  status;
2768         uint8_t  cig_id;
2769 } __attribute__ ((packed));
2770
2771 #define BT_HCI_CMD_LE_ACCEPT_CIS                0x2066
2772 #define BT_HCI_BIT_LE_ACCEPT_CIS                BT_HCI_CMD_BIT(42, 3)
2773 struct bt_hci_cmd_le_accept_cis {
2774         uint16_t handle;
2775 } __attribute__ ((packed));
2776 #define BT_HCI_CMD_LE_REJECT_CIS                0x2067
2777 #define BT_HCI_BIT_LE_REJECT_CIS                BT_HCI_CMD_BIT(42, 4)
2778 struct bt_hci_cmd_le_reject_cis {
2779         uint16_t handle;
2780         uint8_t  reason;
2781 } __attribute__ ((packed));
2782
2783 #define BT_HCI_CMD_LE_CREATE_BIG                0x2068
2784 #define BT_HCI_BIT_LE_CREATE_BIG                BT_HCI_CMD_BIT(42, 5)
2785 struct bt_hci_bis {
2786         uint8_t  sdu_interval[3];
2787         uint16_t sdu;
2788         uint16_t latency;
2789         uint8_t  rtn;
2790         uint8_t  phy;
2791         uint8_t  packing;
2792         uint8_t  framing;
2793         uint8_t  encryption;
2794         uint8_t  bcode[16];
2795 } __attribute__ ((packed));
2796
2797 struct bt_hci_cmd_le_create_big {
2798         uint8_t  handle;
2799         uint8_t  adv_handle;
2800         uint8_t  num_bis;
2801         struct bt_hci_bis bis;
2802 } __attribute__ ((packed));
2803
2804 #define BT_HCI_CMD_LE_CREATE_BIG_TEST           0x2069
2805 #define BT_HCI_BIT_LE_CREATE_BIG_TEST           BT_HCI_CMD_BIT(42, 6)
2806 struct bt_hci_bis_test {
2807         uint8_t  sdu_interval[3];
2808         uint16_t iso_interval;
2809         uint8_t  nse;
2810         uint16_t sdu;
2811         uint16_t  pdu;
2812         uint8_t  phy;
2813         uint8_t  packing;
2814         uint8_t  framing;
2815         uint8_t  bn;
2816         uint8_t  irc;
2817         uint8_t  pto;
2818         uint8_t  encryption;
2819         uint8_t  bcode[16];
2820 } __attribute__ ((packed));
2821
2822 struct bt_hci_cmd_le_create_big_test {
2823         uint8_t  big_handle;
2824         uint8_t  adv_handle;
2825         uint8_t  num_bis;
2826         struct bt_hci_bis_test bis[0];
2827 } __attribute__ ((packed));
2828
2829 #define BT_HCI_CMD_LE_TERM_BIG                  0x206a
2830 #define BT_HCI_BIT_LE_TERM_BIG                  BT_HCI_CMD_BIT(42, 7)
2831 struct bt_hci_cmd_le_term_big {
2832         uint8_t  handle;
2833         uint8_t  reason;
2834 } __attribute__ ((packed));
2835
2836 #define BT_HCI_CMD_LE_BIG_CREATE_SYNC           0x206b
2837 #define BT_HCI_BIT_LE_BIG_CREATE_SYNC           BT_HCI_CMD_BIT(43, 0)
2838 struct bt_hci_bis_sync {
2839         uint8_t  index;
2840 } __attribute__ ((packed));
2841
2842 struct bt_hci_cmd_le_big_create_sync {
2843         uint8_t  handle;
2844         uint16_t sync_handle;
2845         uint8_t  encryption;
2846         uint8_t  bcode[16];
2847         uint8_t  mse;
2848         uint16_t timeout;
2849         uint8_t  num_bis;
2850         struct bt_hci_bis_sync bis[0];
2851 } __attribute__ ((packed));
2852
2853 #define BT_HCI_CMD_LE_BIG_TERM_SYNC             0x206c
2854 #define BT_HCI_BIT_LE_BIG_TERM_SYNC             BT_HCI_CMD_BIT(43, 1)
2855 struct bt_hci_cmd_le_big_term_sync {
2856         uint8_t  handle;
2857 } __attribute__ ((packed));
2858
2859 struct bt_hci_rsp_le_big_term_sync {
2860         uint8_t  status;
2861         uint8_t  handle;
2862 } __attribute__ ((packed));
2863
2864 #define BT_HCI_CMD_LE_REQ_PEER_SCA              0x206d
2865 #define BT_HCI_BIT_LE_REQ_PEER_SCA              BT_HCI_CMD_BIT(43, 2)
2866 struct bt_hci_cmd_le_req_peer_sca {
2867         uint16_t handle;
2868 } __attribute__ ((packed));
2869
2870 #define BT_HCI_CMD_LE_SETUP_ISO_PATH            0x206e
2871 #define BT_HCI_BIT_LE_SETUP_ISO_PATH            BT_HCI_CMD_BIT(43, 3)
2872 struct bt_hci_cmd_le_setup_iso_path {
2873         uint16_t handle;
2874         uint8_t  direction;
2875         uint8_t  path;
2876         uint8_t  codec;
2877         uint16_t codec_cid;
2878         uint16_t codec_vid;
2879         uint8_t  delay[3];
2880         uint8_t  codec_cfg_len;
2881         uint8_t  codec_cfg[0];
2882 } __attribute__ ((packed));
2883
2884 struct bt_hci_rsp_le_setup_iso_path {
2885         uint8_t  status;
2886         uint16_t handle;
2887 } __attribute__ ((packed));
2888
2889 #define BT_HCI_CMD_LE_REMOVE_ISO_PATH           0x206f
2890 #define BT_HCI_BIT_LE_REMOVE_ISO_PATH           BT_HCI_CMD_BIT(43, 4)
2891 struct bt_hci_cmd_le_remove_iso_path {
2892         uint16_t handle;
2893         uint8_t  direction;
2894 } __attribute__ ((packed));
2895
2896 struct bt_hci_rsp_le_remove_iso_path {
2897         uint8_t  status;
2898         uint16_t handle;
2899 } __attribute__ ((packed));
2900
2901 #define BT_HCI_CMD_LE_ISO_TX_TEST               0x2070
2902 #define BT_HCI_BIT_LE_ISO_TX_TEST               BT_HCI_CMD_BIT(43, 5)
2903
2904 #define BT_HCI_CMD_LE_ISO_RX_TEST               0x2071
2905 #define BT_HCI_BIT_LE_ISO_RX_TEST               BT_HCI_CMD_BIT(43, 6)
2906
2907 #define BT_HCI_CMD_LE_ISO_READ_TEST_COUNTER     0x2072
2908 #define BT_HCI_BIT_LE_ISO_READ_TEST_COUNTER     BT_HCI_CMD_BIT(43, 7)
2909
2910 #define BT_HCI_CMD_LE_ISO_TEST_END              0x2073
2911 #define BT_HCI_BIT_LE_ISO_TEST_END              BT_HCI_CMD_BIT(44, 0)
2912
2913 #define BT_HCI_CMD_LE_SET_HOST_FEATURE          0x2074
2914 #define BT_HCI_BIT_LE_SET_HOST_FEATURE          BT_HCI_CMD_BIT(44, 1)
2915 struct bt_hci_cmd_le_set_host_feature {
2916         uint8_t  bit_number;
2917         uint8_t  bit_value;
2918 } __attribute__ ((packed));
2919
2920 #define BT_HCI_CMD_LE_READ_ISO_LINK_QUALITY     0x2075
2921 #define BT_HCI_BIT_LE_READ_ISO_LINK_QUALITY     BT_HCI_CMD_BIT(45, 1)
2922 struct bt_hci_cmd_le_read_iso_link_quality {
2923         uint16_t handle;
2924 } __attribute__ ((packed));
2925
2926 struct bt_hci_rsp_le_read_iso_link_quality {
2927         uint8_t  status;
2928         uint16_t handle;
2929         uint32_t tx_unacked_packets;
2930         uint32_t tx_flushed_packets;
2931         uint32_t tx_last_subevent_packets;
2932         uint32_t retransmitted_packets;
2933         uint32_t crc_error_packets;
2934         uint32_t rx_unreceived_packets;
2935         uint32_t duplicated_packets;
2936 } __attribute__ ((packed));
2937
2938 #define BT_HCI_EVT_INQUIRY_COMPLETE             0x01
2939 struct bt_hci_evt_inquiry_complete {
2940         uint8_t  status;
2941 } __attribute__ ((packed));
2942
2943 #define BT_HCI_EVT_INQUIRY_RESULT               0x02
2944 struct bt_hci_evt_inquiry_result {
2945         uint8_t  num_resp;
2946         uint8_t  bdaddr[6];
2947         uint8_t  pscan_rep_mode;
2948         uint8_t  pscan_period_mode;
2949         uint8_t  pscan_mode;
2950         uint8_t  dev_class[3];
2951         uint16_t clock_offset;
2952 } __attribute__ ((packed));
2953
2954 #define BT_HCI_EVT_CONN_COMPLETE                0x03
2955 struct bt_hci_evt_conn_complete {
2956         uint8_t  status;
2957         uint16_t handle;
2958         uint8_t  bdaddr[6];
2959         uint8_t  link_type;
2960         uint8_t  encr_mode;
2961 } __attribute__ ((packed));
2962
2963 #define BT_HCI_EVT_CONN_REQUEST                 0x04
2964 struct bt_hci_evt_conn_request {
2965         uint8_t  bdaddr[6];
2966         uint8_t  dev_class[3];
2967         uint8_t  link_type;
2968 } __attribute__ ((packed));
2969
2970 #define BT_HCI_EVT_DISCONNECT_COMPLETE          0x05
2971 struct bt_hci_evt_disconnect_complete {
2972         uint8_t  status;
2973         uint16_t handle;
2974         uint8_t  reason;
2975 } __attribute__ ((packed));
2976
2977 #define BT_HCI_EVT_AUTH_COMPLETE                0x06
2978 struct bt_hci_evt_auth_complete {
2979         uint8_t  status;
2980         uint16_t handle;
2981 } __attribute__ ((packed));
2982
2983 #define BT_HCI_EVT_REMOTE_NAME_REQUEST_COMPLETE 0x07
2984 struct bt_hci_evt_remote_name_request_complete {
2985         uint8_t  status;
2986         uint8_t  bdaddr[6];
2987         uint8_t  name[248];
2988 } __attribute__ ((packed));
2989
2990 #define BT_HCI_EVT_ENCRYPT_CHANGE               0x08
2991 struct bt_hci_evt_encrypt_change {
2992         uint8_t  status;
2993         uint16_t handle;
2994         uint8_t  encr_mode;
2995 } __attribute__ ((packed));
2996
2997 #define BT_HCI_EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
2998 struct bt_hci_evt_change_conn_link_key_complete {
2999         uint8_t  status;
3000         uint16_t handle;
3001 } __attribute__ ((packed));
3002
3003 #define BT_HCI_EVT_LINK_KEY_TYPE_CHANGED        0x0a
3004 struct bt_hci_evt_link_key_type_changed {
3005         uint8_t  status;
3006         uint16_t handle;
3007         uint8_t  key_flag;
3008 } __attribute__ ((packed));
3009
3010 #define BT_HCI_EVT_REMOTE_FEATURES_COMPLETE     0x0b
3011 struct bt_hci_evt_remote_features_complete {
3012         uint8_t  status;
3013         uint16_t handle;
3014         uint8_t  features[8];
3015 } __attribute__ ((packed));
3016
3017 #define BT_HCI_EVT_REMOTE_VERSION_COMPLETE      0x0c
3018 struct bt_hci_evt_remote_version_complete {
3019         uint8_t  status;
3020         uint16_t handle;
3021         uint8_t  lmp_ver;
3022         uint16_t manufacturer;
3023         uint16_t lmp_subver;
3024 } __attribute__ ((packed));
3025
3026 #define BT_HCI_EVT_QOS_SETUP_COMPLETE           0x0d
3027 struct bt_hci_evt_qos_setup_complete {
3028         uint8_t  status;
3029         uint16_t handle;
3030         uint8_t  flags;
3031         uint8_t  service_type;
3032         uint32_t token_rate;
3033         uint32_t peak_bandwidth;
3034         uint32_t latency;
3035         uint32_t delay_variation;
3036 } __attribute__ ((packed));
3037
3038 #define BT_HCI_EVT_CMD_COMPLETE                 0x0e
3039 struct bt_hci_evt_cmd_complete {
3040         uint8_t  ncmd;
3041         uint16_t opcode;
3042 } __attribute__ ((packed));
3043
3044 #define BT_HCI_EVT_CMD_STATUS                   0x0f
3045 struct bt_hci_evt_cmd_status {
3046         uint8_t  status;
3047         uint8_t  ncmd;
3048         uint16_t opcode;
3049 } __attribute__ ((packed));
3050
3051 #define BT_HCI_EVT_HARDWARE_ERROR               0x10
3052 struct bt_hci_evt_hardware_error {
3053         uint8_t  code;
3054 } __attribute__ ((packed));
3055
3056 #define BT_HCI_EVT_FLUSH_OCCURRED               0x11
3057 struct bt_hci_evt_flush_occurred {
3058         uint16_t handle;
3059 } __attribute__ ((packed));
3060
3061 #define BT_HCI_EVT_ROLE_CHANGE                  0x12
3062 struct bt_hci_evt_role_change {
3063         uint8_t  status;
3064         uint8_t  bdaddr[6];
3065         uint8_t  role;
3066 } __attribute__ ((packed));
3067
3068 #define BT_HCI_EVT_NUM_COMPLETED_PACKETS        0x13
3069 struct bt_hci_evt_num_completed_packets {
3070         uint8_t  num_handles;
3071         uint16_t handle;
3072         uint16_t count;
3073 } __attribute__ ((packed));
3074
3075 #define BT_HCI_EVT_MODE_CHANGE                  0x14
3076 struct bt_hci_evt_mode_change {
3077         uint8_t  status;
3078         uint16_t handle;
3079         uint8_t  mode;
3080         uint16_t interval;
3081 } __attribute__ ((packed));
3082
3083 #define BT_HCI_EVT_RETURN_LINK_KEYS             0x15
3084 struct bt_hci_evt_return_link_keys {
3085         uint8_t  num_keys;
3086         uint8_t  keys[0];
3087 } __attribute__ ((packed));
3088
3089 #define BT_HCI_EVT_PIN_CODE_REQUEST             0x16
3090 struct bt_hci_evt_pin_code_request {
3091         uint8_t  bdaddr[6];
3092 } __attribute__ ((packed));
3093
3094 #define BT_HCI_EVT_LINK_KEY_REQUEST             0x17
3095 struct bt_hci_evt_link_key_request {
3096         uint8_t  bdaddr[6];
3097 } __attribute__ ((packed));
3098
3099 #define BT_HCI_EVT_LINK_KEY_NOTIFY              0x18
3100 struct bt_hci_evt_link_key_notify {
3101         uint8_t  bdaddr[6];
3102         uint8_t  link_key[16];
3103         uint8_t  key_type;
3104 } __attribute__ ((packed));
3105
3106 #define BT_HCI_EVT_LOOPBACK_COMMAND             0x19
3107
3108 #define BT_HCI_EVT_DATA_BUFFER_OVERFLOW         0x1a
3109 struct bt_hci_evt_data_buffer_overflow {
3110         uint8_t  link_type;
3111 } __attribute__ ((packed));
3112
3113 #define BT_HCI_EVT_MAX_SLOTS_CHANGE             0x1b
3114 struct bt_hci_evt_max_slots_change {
3115         uint16_t handle;
3116         uint8_t  max_slots;
3117 } __attribute__ ((packed));
3118
3119 #define BT_HCI_EVT_CLOCK_OFFSET_COMPLETE        0x1c
3120 struct bt_hci_evt_clock_offset_complete {
3121         uint8_t  status;
3122         uint16_t handle;
3123         uint16_t clock_offset;
3124 } __attribute__ ((packed));
3125
3126 #define BT_HCI_EVT_CONN_PKT_TYPE_CHANGED        0x1d
3127 struct bt_hci_evt_conn_pkt_type_changed {
3128         uint8_t  status;
3129         uint16_t handle;
3130         uint16_t pkt_type;
3131 } __attribute__ ((packed));
3132
3133 #define BT_HCI_EVT_QOS_VIOLATION                0x1e
3134 struct bt_hci_evt_qos_violation {
3135         uint16_t handle;
3136 } __attribute__ ((packed));
3137
3138 #define BT_HCI_EVT_PSCAN_MODE_CHANGE            0x1f
3139 struct bt_hci_evt_pscan_mode_change {
3140         uint8_t  bdaddr[6];
3141         uint8_t  pscan_mode;
3142 } __attribute__ ((packed));
3143
3144 #define BT_HCI_EVT_PSCAN_REP_MODE_CHANGE        0x20
3145 struct bt_hci_evt_pscan_rep_mode_change {
3146         uint8_t  bdaddr[6];
3147         uint8_t  pscan_rep_mode;
3148 } __attribute__ ((packed));
3149
3150 #define BT_HCI_EVT_FLOW_SPEC_COMPLETE           0x21
3151 struct bt_hci_evt_flow_spec_complete {
3152         uint8_t  status;
3153         uint16_t handle;
3154         uint8_t  flags;
3155         uint8_t  direction;
3156         uint8_t  service_type;
3157         uint32_t token_rate;
3158         uint32_t token_bucket_size;
3159         uint32_t peak_bandwidth;
3160         uint32_t access_latency;
3161 } __attribute__ ((packed));
3162
3163 #define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI     0x22
3164 struct bt_hci_evt_inquiry_result_with_rssi {
3165         uint8_t  num_resp;
3166         uint8_t  bdaddr[6];
3167         uint8_t  pscan_rep_mode;
3168         uint8_t  pscan_period_mode;
3169         uint8_t  dev_class[3];
3170         uint16_t clock_offset;
3171         int8_t   rssi;
3172 } __attribute__ ((packed));
3173
3174 #define BT_HCI_EVT_REMOTE_EXT_FEATURES_COMPLETE 0x23
3175 struct bt_hci_evt_remote_ext_features_complete {
3176         uint8_t  status;
3177         uint16_t handle;
3178         uint8_t  page;
3179         uint8_t  max_page;
3180         uint8_t  features[8];
3181 } __attribute__ ((packed));
3182
3183 #define BT_HCI_EVT_SYNC_CONN_COMPLETE           0x2c
3184 struct bt_hci_evt_sync_conn_complete {
3185         uint8_t  status;
3186         uint16_t handle;
3187         uint8_t  bdaddr[6];
3188         uint8_t  link_type;
3189         uint8_t  tx_interval;
3190         uint8_t  retrans_window;
3191         uint16_t rx_pkt_len;
3192         uint16_t tx_pkt_len;
3193         uint8_t  air_mode;
3194 } __attribute__ ((packed));
3195
3196 #define BT_HCI_EVT_SYNC_CONN_CHANGED            0x2d
3197 struct bt_hci_evt_sync_conn_changed {
3198         uint8_t  status;
3199         uint16_t handle;
3200         uint8_t  tx_interval;
3201         uint8_t  retrans_window;
3202         uint16_t rx_pkt_len;
3203         uint16_t tx_pkt_len;
3204 } __attribute__ ((packed));
3205
3206 #define BT_HCI_EVT_SNIFF_SUBRATING              0x2e
3207 struct bt_hci_evt_sniff_subrating {
3208         uint8_t  status;
3209         uint16_t handle;
3210         uint16_t max_tx_latency;
3211         uint16_t max_rx_latency;
3212         uint16_t min_remote_timeout;
3213         uint16_t min_local_timeout;
3214 } __attribute__ ((packed));
3215
3216 #define BT_HCI_EVT_EXT_INQUIRY_RESULT           0x2f
3217 struct bt_hci_evt_ext_inquiry_result {
3218         uint8_t  num_resp;
3219         uint8_t  bdaddr[6];
3220         uint8_t  pscan_rep_mode;
3221         uint8_t  pscan_period_mode;
3222         uint8_t  dev_class[3];
3223         uint16_t clock_offset;
3224         int8_t   rssi;
3225         uint8_t  data[240];
3226 } __attribute__ ((packed));
3227
3228 #define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30
3229 struct bt_hci_evt_encrypt_key_refresh_complete {
3230         uint8_t  status;
3231         uint16_t handle;
3232 } __attribute__ ((packed));
3233
3234 #define BT_HCI_EVT_IO_CAPABILITY_REQUEST        0x31
3235 struct bt_hci_evt_io_capability_request {
3236         uint8_t  bdaddr[6];
3237 } __attribute__ ((packed));
3238
3239 #define BT_HCI_EVT_IO_CAPABILITY_RESPONSE       0x32
3240 struct bt_hci_evt_io_capability_response {
3241         uint8_t  bdaddr[6];
3242         uint8_t  capability;
3243         uint8_t  oob_data;
3244         uint8_t  authentication;
3245 } __attribute__ ((packed));
3246
3247 #define BT_HCI_EVT_USER_CONFIRM_REQUEST         0x33
3248 struct bt_hci_evt_user_confirm_request {
3249         uint8_t  bdaddr[6];
3250         uint32_t passkey;
3251 } __attribute__ ((packed));
3252
3253 #define BT_HCI_EVT_USER_PASSKEY_REQUEST         0x34
3254 struct bt_hci_evt_user_passkey_request {
3255         uint8_t  bdaddr[6];
3256 } __attribute__ ((packed));
3257
3258 #define BT_HCI_EVT_REMOTE_OOB_DATA_REQUEST      0x35
3259 struct bt_hci_evt_remote_oob_data_request {
3260         uint8_t  bdaddr[6];
3261 } __attribute__ ((packed));
3262
3263 #define BT_HCI_EVT_SIMPLE_PAIRING_COMPLETE      0x36
3264 struct bt_hci_evt_simple_pairing_complete {
3265         uint8_t  status;
3266         uint8_t  bdaddr[6];
3267 } __attribute__ ((packed));
3268
3269 #define BT_HCI_EVT_LINK_SUPV_TIMEOUT_CHANGED    0x38
3270 struct bt_hci_evt_link_supv_timeout_changed {
3271         uint16_t handle;
3272         uint16_t timeout;
3273 } __attribute__ ((packed));
3274
3275 #define BT_HCI_EVT_ENHANCED_FLUSH_COMPLETE      0x39
3276 struct bt_hci_evt_enhanced_flush_complete {
3277         uint16_t handle;
3278 } __attribute__ ((packed));
3279
3280 #define BT_HCI_EVT_USER_PASSKEY_NOTIFY          0x3b
3281 struct bt_hci_evt_user_passkey_notify {
3282         uint8_t  bdaddr[6];
3283         uint32_t passkey;
3284 } __attribute__ ((packed));
3285
3286 #define BT_HCI_EVT_KEYPRESS_NOTIFY              0x3c
3287 struct bt_hci_evt_keypress_notify {
3288 uint8_t  bdaddr[6];
3289         uint8_t  type;
3290 } __attribute__ ((packed));
3291
3292 #define BT_HCI_EVT_REMOTE_HOST_FEATURES_NOTIFY  0x3d
3293 struct bt_hci_evt_remote_host_features_notify {
3294         uint8_t  bdaddr[6];
3295         uint8_t  features[8];
3296 } __attribute__ ((packed));
3297
3298 #define BT_HCI_EVT_LE_META_EVENT                0x3e
3299
3300 #define BT_HCI_EVT_PHY_LINK_COMPLETE            0x40
3301 struct bt_hci_evt_phy_link_complete {
3302         uint8_t  status;
3303         uint8_t  phy_handle;
3304 } __attribute__ ((packed));
3305
3306 #define BT_HCI_EVT_CHANNEL_SELECTED             0x41
3307 struct bt_hci_evt_channel_selected {
3308         uint8_t  phy_handle;
3309 } __attribute__ ((packed));
3310
3311 #define BT_HCI_EVT_DISCONN_PHY_LINK_COMPLETE    0x42
3312 struct bt_hci_evt_disconn_phy_link_complete {
3313         uint8_t  status;
3314         uint8_t  phy_handle;
3315         uint8_t  reason;
3316 } __attribute__ ((packed));
3317
3318 #define BT_HCI_EVT_PHY_LINK_LOSS_EARLY_WARNING  0x43
3319 struct bt_hci_evt_phy_link_loss_early_warning {
3320         uint8_t  phy_handle;
3321         uint8_t  reason;
3322 } __attribute__ ((packed));
3323
3324 #define BT_HCI_EVT_PHY_LINK_RECOVERY            0x44
3325 struct bt_hci_evt_phy_link_recovery {
3326         uint8_t  phy_handle;
3327 } __attribute__ ((packed));
3328
3329 #define BT_HCI_EVT_LOGIC_LINK_COMPLETE          0x45
3330 struct bt_hci_evt_logic_link_complete {
3331         uint8_t  status;
3332         uint16_t handle;
3333         uint8_t  phy_handle;
3334         uint8_t  flow_spec;
3335 } __attribute__ ((packed));
3336
3337 #define BT_HCI_EVT_DISCONN_LOGIC_LINK_COMPLETE  0x46
3338 struct bt_hci_evt_disconn_logic_link_complete {
3339         uint8_t  status;
3340         uint16_t handle;
3341         uint8_t  reason;
3342 } __attribute__ ((packed));
3343
3344 #define BT_HCI_EVT_FLOW_SPEC_MODIFY_COMPLETE    0x47
3345 struct bt_hci_evt_flow_spec_modify_complete {
3346         uint8_t  status;
3347         uint16_t handle;
3348 } __attribute__ ((packed));
3349
3350 #define BT_HCI_EVT_NUM_COMPLETED_DATA_BLOCKS    0x48
3351 struct bt_hci_evt_num_completed_data_blocks {
3352         uint16_t total_num_blocks;
3353         uint8_t  num_handles;
3354         uint16_t handle;
3355         uint16_t num_packets;
3356         uint16_t num_blocks;
3357 } __attribute__ ((packed));
3358
3359 #define BT_HCI_EVT_SHORT_RANGE_MODE_CHANGE      0x4c
3360 struct bt_hci_evt_short_range_mode_change {
3361         uint8_t  status;
3362         uint8_t  phy_handle;
3363         uint8_t  mode;
3364 } __attribute__ ((packed));
3365
3366 #define BT_HCI_EVT_AMP_STATUS_CHANGE            0x4d
3367 struct bt_hci_evt_amp_status_change {
3368         uint8_t  status;
3369         uint8_t  amp_status;
3370 } __attribute__ ((packed));
3371
3372 #define BT_HCI_EVT_TRIGGERED_CLOCK_CAPTURE      0x4e
3373 struct bt_hci_evt_triggered_clock_capture {
3374         uint16_t handle;
3375         uint8_t  type;
3376         uint32_t clock;
3377         uint16_t clock_offset;
3378 } __attribute__ ((packed));
3379
3380 #define BT_HCI_EVT_SYNC_TRAIN_COMPLETE          0x4f
3381 struct bt_hci_evt_sync_train_complete {
3382         uint8_t  status;
3383 } __attribute__ ((packed));
3384
3385 #define BT_HCI_EVT_SYNC_TRAIN_RECEIVED          0x50
3386 struct bt_hci_evt_sync_train_received {
3387         uint8_t  status;
3388         uint8_t  bdaddr[6];
3389         uint32_t offset;
3390         uint8_t  map[10];
3391         uint8_t  lt_addr;
3392         uint32_t instant;
3393         uint16_t interval;
3394         uint8_t  service_data;
3395 } __attribute__ ((packed));
3396
3397 #define BT_HCI_EVT_PERIPHERAL_BROADCAST_RECEIVE 0x51
3398 struct bt_hci_evt_peripheral_broadcast_receive {
3399         uint8_t  bdaddr[6];
3400         uint8_t  lt_addr;
3401         uint32_t clock;
3402         uint32_t offset;
3403         uint8_t  status;
3404         uint8_t  fragment;
3405         uint8_t  length;
3406 } __attribute__ ((packed));
3407
3408 #define BT_HCI_EVT_PERIPHERAL_BROADCAST_TIMEOUT 0x52
3409 struct bt_hci_evt_peripheral_broadcast_timeout {
3410         uint8_t  bdaddr[6];
3411         uint8_t  lt_addr;
3412 } __attribute__ ((packed));
3413
3414 #define BT_HCI_EVT_TRUNCATED_PAGE_COMPLETE      0x53
3415 struct bt_hci_evt_truncated_page_complete {
3416         uint8_t  status;
3417         uint8_t  bdaddr[6];
3418 } __attribute__ ((packed));
3419
3420 #define BT_HCI_EVT_PERIPHERAL_PAGE_RESPONSE_TIMEOUT     0x54
3421
3422 #define BT_HCI_EVT_PERIPHERAL_BROADCAST_CHANNEL_MAP_CHANGE      0x55
3423 struct bt_hci_evt_channel_map_change {
3424         uint8_t  map[10];
3425 } __attribute__ ((packed));
3426
3427 #define BT_HCI_EVT_INQUIRY_RESPONSE_NOTIFY      0x56
3428 struct bt_hci_evt_inquiry_response_notify {
3429         uint8_t  lap[3];
3430         int8_t   rssi;
3431 } __attribute__ ((packed));
3432
3433 #define BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXPIRED 0x57
3434 struct bt_hci_evt_auth_payload_timeout_expired {
3435         uint16_t handle;
3436 } __attribute__ ((packed));
3437
3438 #define BT_HCI_EVT_LE_CONN_COMPLETE             0x01
3439 struct bt_hci_evt_le_conn_complete {
3440         uint8_t  status;
3441         uint16_t handle;
3442         uint8_t  role;
3443         uint8_t  peer_addr_type;
3444         uint8_t  peer_addr[6];
3445         uint16_t interval;
3446         uint16_t latency;
3447         uint16_t supv_timeout;
3448         uint8_t  clock_accuracy;
3449 } __attribute__ ((packed));
3450
3451 #define BT_HCI_EVT_LE_ADV_REPORT                0x02
3452 struct bt_hci_evt_le_adv_report {
3453         uint8_t  num_reports;
3454         uint8_t  event_type;
3455         uint8_t  addr_type;
3456         uint8_t  addr[6];
3457         uint8_t  data_len;
3458         uint8_t  data[0];
3459 } __attribute__ ((packed));
3460
3461 #define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE      0x03
3462 struct bt_hci_evt_le_conn_update_complete {
3463         uint8_t  status;
3464         uint16_t handle;
3465         uint16_t interval;
3466         uint16_t latency;
3467         uint16_t supv_timeout;
3468 } __attribute__ ((packed));
3469
3470 #define BT_HCI_EVT_LE_REMOTE_FEATURES_COMPLETE  0x04
3471 struct bt_hci_evt_le_remote_features_complete {
3472         uint8_t  status;
3473         uint16_t handle;
3474         uint8_t  features[8];
3475 } __attribute__ ((packed));
3476
3477 #define BT_HCI_EVT_LE_LONG_TERM_KEY_REQUEST     0x05
3478 struct bt_hci_evt_le_long_term_key_request {
3479         uint16_t handle;
3480         uint64_t rand;
3481         uint16_t ediv;
3482 } __attribute__ ((packed));
3483
3484 #define BT_HCI_EVT_LE_CONN_PARAM_REQUEST        0x06
3485 struct bt_hci_evt_le_conn_param_request {
3486         uint16_t handle;
3487         uint16_t min_interval;
3488         uint16_t max_interval;
3489         uint16_t latency;
3490         uint16_t supv_timeout;
3491 } __attribute__ ((packed));
3492
3493 #define BT_HCI_EVT_LE_DATA_LENGTH_CHANGE        0x07
3494 struct bt_hci_evt_le_data_length_change {
3495         uint16_t handle;
3496         uint16_t max_tx_len;
3497         uint16_t max_tx_time;
3498         uint16_t max_rx_len;
3499         uint16_t max_rx_time;
3500 } __attribute__ ((packed));
3501
3502 #define BT_HCI_EVT_LE_READ_LOCAL_PK256_COMPLETE 0x08
3503 struct bt_hci_evt_le_read_local_pk256_complete {
3504         uint8_t  status;
3505         uint8_t  local_pk256[64];
3506 } __attribute__ ((packed));
3507
3508 #define BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE   0x09
3509 struct bt_hci_evt_le_generate_dhkey_complete {
3510         uint8_t  status;
3511         uint8_t  dhkey[32];
3512 } __attribute__ ((packed));
3513
3514 #define BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE    0x0a
3515 struct bt_hci_evt_le_enhanced_conn_complete {
3516         uint8_t  status;
3517         uint16_t handle;
3518         uint8_t  role;
3519         uint8_t  peer_addr_type;
3520         uint8_t  peer_addr[6];
3521         uint8_t  local_rpa[6];
3522         uint8_t  peer_rpa[6];
3523         uint16_t interval;
3524         uint16_t latency;
3525         uint16_t supv_timeout;
3526         uint8_t  clock_accuracy;
3527 } __attribute__ ((packed));
3528
3529 #define BT_HCI_EVT_LE_DIRECT_ADV_REPORT         0x0b
3530 struct bt_hci_evt_le_direct_adv_report {
3531         uint8_t  num_reports;
3532         uint8_t  event_type;
3533         uint8_t  addr_type;
3534         uint8_t  addr[6];
3535         uint8_t  direct_addr_type;
3536         uint8_t  direct_addr[6];
3537         int8_t   rssi;
3538 } __attribute__ ((packed));
3539
3540 #define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE       0x0c
3541 struct bt_hci_evt_le_phy_update_complete {
3542         uint8_t  status;
3543         uint16_t handle;
3544         uint8_t  tx_phy;
3545         uint8_t  rx_phy;
3546 } __attribute__ ((packed));
3547
3548 #define BT_HCI_EVT_LE_EXT_ADV_REPORT    0x0d
3549 struct bt_hci_evt_le_ext_adv_report {
3550         uint8_t  num_reports;
3551 } __attribute__ ((packed));
3552 struct bt_hci_le_ext_adv_report {
3553         uint16_t event_type;
3554         uint8_t  addr_type;
3555         uint8_t  addr[6];
3556         uint8_t  primary_phy;
3557         uint8_t  secondary_phy;
3558         uint8_t  sid;
3559         uint8_t  tx_power;
3560         int8_t   rssi;
3561         uint16_t interval;
3562         uint8_t  direct_addr_type;
3563         uint8_t  direct_addr[6];
3564         uint8_t  data_len;
3565         uint8_t  data[0];
3566 } __attribute__ ((packed));
3567
3568 #define BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED       0x0e
3569 struct bt_hci_evt_le_per_sync_established {
3570         uint8_t  status;
3571         uint16_t handle;
3572         uint8_t  sid;
3573         uint8_t  addr_type;
3574         uint8_t  addr[6];
3575         uint8_t  phy;
3576         uint16_t interval;
3577         uint8_t  clock_accuracy;
3578 } __attribute__ ((packed));
3579
3580 struct bt_hci_le_pa_base_codec {
3581         uint8_t  id;
3582         uint16_t cid;
3583         uint16_t vid;
3584 } __attribute__ ((packed));
3585
3586 struct bt_hci_lv_data {
3587         uint8_t  len;
3588         uint8_t  data[];
3589 } __attribute__ ((packed));
3590
3591 struct bt_hci_le_pa_base_bis {
3592         uint8_t  index;
3593         struct bt_hci_lv_data codec_cfg[];
3594 } __attribute__ ((packed));
3595
3596 struct bt_hci_le_pa_base_subgroup {
3597         uint8_t  num_bis;
3598         struct bt_hci_le_pa_base_codec codec;
3599         uint8_t  data[];
3600 } __attribute__ ((packed));
3601
3602 struct bt_hci_le_pa_base_data {
3603         uint8_t  pd[3];
3604         uint8_t  num_subgroups;
3605         struct bt_hci_le_pa_base_subgroup subgroups[];
3606 } __attribute__ ((packed));
3607
3608 #define BT_HCI_EVT_LE_PA_REPORT                 0x0f
3609 struct bt_hci_le_pa_report {
3610         uint16_t handle;
3611         uint8_t  tx_power;
3612         int8_t   rssi;
3613         uint8_t  cte_type;
3614         uint8_t  data_status;
3615         uint8_t  data_len;
3616         uint8_t  data[0];
3617 } __attribute__ ((packed));
3618
3619 #define BT_HCI_EVT_LE_PA_SYNC_LOST              0x10
3620 struct bt_hci_evt_le_per_sync_lost {
3621         uint16_t handle;
3622 } __attribute__ ((packed));
3623
3624 #define BT_HCI_EVT_LE_ADV_SET_TERM              0x12
3625 struct bt_hci_evt_le_adv_set_term {
3626         uint8_t  status;
3627         uint8_t  handle;
3628         uint16_t conn_handle;
3629         uint8_t  num_evts;
3630 } __attribute__ ((packed));
3631
3632 #define BT_HCI_EVT_LE_SCAN_REQ_RECEIVED         0x13
3633 struct bt_hci_evt_le_scan_req_received {
3634         uint8_t  handle;
3635         uint8_t  scanner_addr_type;
3636         uint8_t  scanner_addr[6];
3637 } __attribute__ ((packed));
3638
3639 #define BT_HCI_EVT_LE_CHAN_SELECT_ALG           0x14
3640 struct bt_hci_evt_le_chan_select_alg {
3641         uint16_t handle;
3642         uint8_t  algorithm;
3643 } __attribute__ ((packed));
3644
3645 #define BT_HCI_EVT_LE_CTE_REQUEST_FAILED        0x17
3646 struct bt_hci_evt_le_cte_request_failed {
3647         uint8_t  status;
3648         uint16_t handle;
3649 } __attribute__ ((packed));
3650
3651 #define BT_HCI_EVT_LE_PA_SYNC_TRANS_REC         0x18
3652 struct bt_hci_evt_le_pa_sync_trans_rec {
3653         uint8_t  status;
3654         uint16_t handle;
3655         uint16_t service_data;
3656         uint16_t sync_handle;
3657         uint8_t  sid;
3658         uint8_t  addr_type;
3659         uint8_t  addr[6];
3660         uint8_t  phy;
3661         uint16_t interval;
3662         uint8_t  clock_accuracy;
3663 } __attribute__ ((packed));
3664
3665 #define BT_HCI_EVT_LE_CIS_ESTABLISHED           0x19
3666 struct bt_hci_evt_le_cis_established {
3667         uint8_t  status;
3668         uint16_t conn_handle;
3669         uint8_t  cig_sync_delay[3];
3670         uint8_t  cis_sync_delay[3];
3671         uint8_t  c_latency[3];
3672         uint8_t  p_latency[3];
3673         uint8_t  c_phy;
3674         uint8_t  p_phy;
3675         uint8_t  nse;
3676         uint8_t  c_bn;
3677         uint8_t  p_bn;
3678         uint8_t  c_ft;
3679         uint8_t  p_ft;
3680         uint16_t c_mtu;
3681         uint16_t p_mtu;
3682         uint16_t interval;
3683 } __attribute__ ((packed));
3684
3685 #define BT_HCI_EVT_LE_CIS_REQ                   0x1a
3686 struct bt_hci_evt_le_cis_req {
3687         uint16_t acl_handle;
3688         uint16_t cis_handle;
3689         uint8_t  cig_id;
3690         uint8_t  cis_id;
3691 } __attribute__ ((packed));
3692
3693 #define BT_HCI_EVT_LE_BIG_COMPLETE              0x1b
3694 struct bt_hci_evt_le_big_complete {
3695         uint8_t  status;
3696         uint8_t  handle;
3697         uint8_t  sync_delay[3];
3698         uint8_t  latency[3];
3699         uint8_t  phy;
3700         uint8_t  nse;
3701         uint8_t  bn;
3702         uint8_t  pto;
3703         uint8_t  irc;
3704         uint16_t max_pdu;
3705         uint16_t interval;
3706         uint8_t  num_bis;
3707         uint16_t bis_handle[0];
3708 } __attribute__ ((packed));
3709
3710 #define BT_HCI_EVT_LE_BIG_TERMINATE             0x1c
3711 struct bt_hci_evt_le_big_terminate {
3712         uint8_t  handle;
3713         uint8_t  reason;
3714 } __attribute__ ((packed));
3715
3716 #define BT_HCI_EVT_LE_BIG_SYNC_ESTABILISHED     0x1d
3717 struct bt_hci_evt_le_big_sync_estabilished {
3718         uint8_t  status;
3719         uint8_t  handle;
3720         uint8_t  latency[3];
3721         uint8_t  nse;
3722         uint8_t  bn;
3723         uint8_t  pto;
3724         uint8_t  irc;
3725         uint16_t max_pdu;
3726         uint16_t interval;
3727         uint8_t  num_bis;
3728         uint16_t bis[0];
3729 } __attribute__ ((packed));
3730
3731 #define BT_HCI_EVT_LE_BIG_SYNC_LOST             0x1e
3732 struct bt_hci_evt_le_big_sync_lost {
3733         uint8_t  big_handle;
3734         uint8_t  reason;
3735 } __attribute__ ((packed));
3736
3737 #define BT_HCI_EVT_LE_REQ_PEER_SCA_COMPLETE     0x1f
3738 struct bt_hci_evt_le_req_peer_sca_complete {
3739         uint8_t  status;
3740         uint16_t handle;
3741         uint8_t  sca;
3742 } __attribute__ ((packed));
3743
3744 #define BT_HCI_EVT_LE_BIG_INFO_ADV_REPORT       0x22
3745 struct bt_hci_evt_le_big_info_adv_report {
3746         uint16_t sync_handle;
3747         uint8_t  num_bis;
3748         uint8_t  nse;
3749         uint16_t iso_interval;
3750         uint8_t  bn;
3751         uint8_t  pto;
3752         uint8_t  irc;
3753         uint16_t max_pdu;
3754         uint8_t  sdu_interval[3];
3755         uint16_t max_sdu;
3756         uint8_t  phy;
3757         uint8_t  framing;
3758         uint8_t  encryption;
3759 } __attribute__ ((packed));
3760
3761 #define BT_HCI_ERR_SUCCESS                      0x00
3762 #define BT_HCI_ERR_UNKNOWN_COMMAND              0x01
3763 #define BT_HCI_ERR_UNKNOWN_CONN_ID              0x02
3764 #define BT_HCI_ERR_HARDWARE_FAILURE             0x03
3765 #define BT_HCI_ERR_PAGE_TIMEOUT                 0x04
3766 #define BT_HCI_ERR_AUTH_FAILURE                 0x05
3767 #define BT_HCI_ERR_PIN_OR_KEY_MISSING           0x06
3768 #define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED        0x07
3769 #define BT_HCI_ERR_CONN_ALREADY_EXISTS          0x0b
3770 #define BT_HCI_ERR_COMMAND_DISALLOWED           0x0c
3771 #define BT_HCI_ERR_UNSUPPORTED_FEATURE          0x11
3772 #define BT_HCI_ERR_INVALID_PARAMETERS           0x12
3773 #define BT_HCI_ERR_LOCAL_HOST_TERM              0x16
3774 #define BT_HCI_ERR_UNSPECIFIED_ERROR            0x1f
3775 #define BT_HCI_ERR_ADV_TIMEOUT                  0x3c
3776 #define BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH     0x3e
3777 #define BT_HCI_ERR_UNKNOWN_ADVERTISING_ID       0x42
3778 #define BT_HCI_ERR_CANCELLED                    0x44
3779 #define BT_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE      0x25
3780
3781 struct bt_l2cap_hdr {
3782         uint16_t len;
3783         uint16_t cid;
3784         uint8_t  data[];
3785 } __attribute__ ((packed));
3786
3787 struct bt_l2cap_hdr_sig {
3788         uint8_t  code;
3789         uint8_t  ident;
3790         uint16_t len;
3791 } __attribute__ ((packed));
3792
3793 #define BT_L2CAP_PDU_CMD_REJECT         0x01
3794 struct bt_l2cap_pdu_cmd_reject {
3795         uint16_t reason;
3796 } __attribute__ ((packed));
3797
3798 #define BT_L2CAP_PDU_CONN_REQ           0x02
3799 struct bt_l2cap_pdu_conn_req {
3800         uint16_t psm;
3801         uint16_t scid;
3802 } __attribute__ ((packed));
3803
3804 #define BT_L2CAP_PDU_CONN_RSP           0x03
3805 struct bt_l2cap_pdu_conn_rsp {
3806         uint16_t dcid;
3807         uint16_t scid;
3808         uint16_t result;
3809         uint16_t status;
3810 } __attribute__ ((packed));
3811
3812 #define BT_L2CAP_PDU_CONFIG_REQ         0x04
3813 struct bt_l2cap_pdu_config_req {
3814         uint16_t dcid;
3815         uint16_t flags;
3816 } __attribute__ ((packed));
3817
3818 #define BT_L2CAP_PDU_CONFIG_RSP         0x05
3819 struct bt_l2cap_pdu_config_rsp {
3820         uint16_t scid;
3821         uint16_t flags;
3822         uint16_t result;
3823 } __attribute__ ((packed));
3824
3825 #define BT_L2CAP_PDU_DISCONN_REQ        0x06
3826 struct bt_l2cap_pdu_disconn_req {
3827         uint16_t dcid;
3828         uint16_t scid;
3829 } __attribute__ ((packed));
3830
3831 #define BT_L2CAP_PDU_DISCONN_RSP        0x07
3832 struct bt_l2cap_pdu_disconn_rsp {
3833         uint16_t dcid;
3834         uint16_t scid;
3835 } __attribute__ ((packed));
3836
3837 #define BT_L2CAP_PDU_ECHO_REQ           0x08
3838
3839 #define BT_L2CAP_PDU_ECHO_RSP           0x09
3840
3841 #define BT_L2CAP_PDU_INFO_REQ           0x0a
3842 struct bt_l2cap_pdu_info_req {
3843         uint16_t type;
3844 } __attribute__ ((packed));
3845
3846 #define BT_L2CAP_PDU_INFO_RSP           0x0b
3847 struct bt_l2cap_pdu_info_rsp {
3848         uint16_t type;
3849         uint16_t result;
3850         uint8_t  data[0];
3851 } __attribute__ ((packed));
3852
3853 #define BT_L2CAP_PDU_CREATE_CHAN_REQ    0x0c
3854 struct bt_l2cap_pdu_create_chan_req {
3855         uint16_t psm;
3856         uint16_t scid;
3857         uint8_t  ctrlid;
3858 } __attribute__ ((packed));
3859
3860 #define BT_L2CAP_PDU_CREATE_CHAN_RSP    0x0d
3861 struct bt_l2cap_pdu_create_chan_rsp {
3862         uint16_t dcid;
3863         uint16_t scid;
3864         uint16_t result;
3865         uint16_t status;
3866 } __attribute__ ((packed));
3867
3868 #define BT_L2CAP_PDU_MOVE_CHAN_REQ      0x0e
3869 struct bt_l2cap_pdu_move_chan_req {
3870         uint16_t icid;
3871         uint8_t  ctrlid;
3872 } __attribute__ ((packed));
3873
3874 #define BT_L2CAP_PDU_MOVE_CHAN_RSP      0x0f
3875 struct bt_l2cap_pdu_move_chan_rsp {
3876         uint16_t icid;
3877         uint16_t result;
3878 } __attribute__ ((packed));
3879
3880 #define BT_L2CAP_PDU_MOVE_CHAN_CFM      0x10
3881 struct bt_l2cap_pdu_move_chan_cfm {
3882         uint16_t icid;
3883         uint16_t result;
3884 } __attribute__ ((packed));
3885
3886 #define BT_L2CAP_PDU_MOVE_CHAN_CFM_RSP  0x11
3887 struct bt_l2cap_pdu_move_chan_cfm_rsp {
3888         uint16_t icid;
3889 } __attribute__ ((packed));
3890
3891 #define BT_L2CAP_PDU_CONN_PARAM_REQ     0x12
3892 struct bt_l2cap_pdu_conn_param_req {
3893         uint16_t min_interval;
3894         uint16_t max_interval;
3895         uint16_t latency;
3896         uint16_t timeout;
3897 } __attribute__ ((packed));
3898
3899 #define BT_L2CAP_PDU_CONN_PARAM_RSP     0x13
3900 struct bt_l2cap_pdu_conn_param_rsp {
3901         uint16_t result;
3902 } __attribute__ ((packed));
3903
3904 #define BT_L2CAP_PDU_LE_CONN_REQ        0x14
3905 struct bt_l2cap_pdu_le_conn_req {
3906         uint16_t psm;
3907         uint16_t scid;
3908         uint16_t mtu;
3909         uint16_t mps;
3910         uint16_t credits;
3911 } __attribute__ ((packed));
3912
3913 #define BT_L2CAP_PDU_LE_CONN_RSP        0x15
3914 struct bt_l2cap_pdu_le_conn_rsp {
3915         uint16_t dcid;
3916         uint16_t mtu;
3917         uint16_t mps;
3918         uint16_t credits;
3919         uint16_t result;
3920 } __attribute__ ((packed));
3921
3922 #define BT_L2CAP_PDU_LE_FLOWCTL_CREDS   0x16
3923 struct bt_l2cap_pdu_le_flowctl_creds {
3924         uint16_t cid;
3925         uint16_t credits;
3926 } __attribute__ ((packed));
3927
3928 #define BT_L2CAP_PDU_ECRED_CONN_REQ     0x17
3929 struct bt_l2cap_pdu_ecred_conn_req {
3930         uint16_t psm;
3931         uint16_t mtu;
3932         uint16_t mps;
3933         uint16_t credits;
3934         uint16_t scid[0];
3935 } __attribute__ ((packed));
3936
3937 #define BT_L2CAP_PDU_ECRED_CONN_RSP     0x18
3938 struct bt_l2cap_pdu_ecred_conn_rsp {
3939         uint16_t mtu;
3940         uint16_t mps;
3941         uint16_t credits;
3942         uint16_t result;
3943         uint16_t dcid[0];
3944 } __attribute__ ((packed));
3945
3946 #define BT_L2CAP_PDU_ECRED_RECONF_REQ   0x19
3947 struct bt_l2cap_pdu_ecred_reconf_req {
3948         uint16_t mtu;
3949         uint16_t mps;
3950         uint16_t scid[0];
3951 } __attribute__ ((packed));
3952
3953 #define BT_L2CAP_PDU_ECRED_RECONF_RSP   0x1a
3954 struct bt_l2cap_pdu_ecred_reconf_rsp {
3955         uint16_t result;
3956 } __attribute__ ((packed));
3957
3958 struct bt_l2cap_hdr_connless {
3959         uint16_t psm;
3960 } __attribute__ ((packed));
3961
3962 struct bt_l2cap_hdr_amp {
3963         uint8_t  code;
3964         uint8_t  ident;
3965         uint16_t len;
3966 } __attribute__ ((packed));
3967
3968 #define BT_L2CAP_AMP_CMD_REJECT         0x01
3969 struct bt_l2cap_amp_cmd_reject {
3970         uint16_t reason;
3971 } __attribute__ ((packed));
3972
3973 #define BT_L2CAP_AMP_DISCOVER_REQ       0x02
3974 struct bt_l2cap_amp_discover_req {
3975         uint16_t size;
3976         uint16_t features;
3977 } __attribute__ ((packed));
3978
3979 #define BT_L2CAP_AMP_DISCOVER_RSP       0x03
3980 struct bt_l2cap_amp_discover_rsp {
3981         uint16_t size;
3982         uint16_t features;
3983 } __attribute__ ((packed));
3984
3985 #define BT_L2CAP_AMP_CHANGE_NOTIFY      0x04
3986
3987 #define BT_L2CAP_AMP_CHANGE_RESPONSE    0x05
3988
3989 #define BT_L2CAP_AMP_GET_INFO_REQ       0x06
3990 struct bt_l2cap_amp_get_info_req {
3991         uint8_t  ctrlid;
3992 } __attribute__ ((packed));
3993
3994 #define BT_L2CAP_AMP_GET_INFO_RSP       0x07
3995 struct bt_l2cap_amp_get_info_rsp {
3996         uint8_t  ctrlid;
3997         uint8_t  status;
3998         uint32_t total_bw;
3999         uint32_t max_bw;
4000         uint32_t min_latency;
4001         uint16_t pal_cap;
4002         uint16_t max_assoc_len;
4003 } __attribute__ ((packed));
4004
4005 #define BT_L2CAP_AMP_GET_ASSOC_REQ      0x08
4006 struct bt_l2cap_amp_get_assoc_req {
4007         uint8_t  ctrlid;
4008 } __attribute__ ((packed));
4009
4010 #define BT_L2CAP_AMP_GET_ASSOC_RSP      0x09
4011 struct bt_l2cap_amp_get_assoc_rsp {
4012         uint8_t  ctrlid;
4013         uint8_t  status;
4014 } __attribute__ ((packed));
4015
4016 #define BT_L2CAP_AMP_CREATE_PHY_LINK_REQ        0x0a
4017 struct bt_l2cap_amp_create_phy_link_req {
4018         uint8_t  local_ctrlid;
4019         uint8_t  remote_ctrlid;
4020 } __attribute__ ((packed));
4021
4022 #define BT_L2CAP_AMP_CREATE_PHY_LINK_RSP        0x0b
4023 struct bt_l2cap_amp_create_phy_link_rsp {
4024         uint8_t  local_ctrlid;
4025         uint8_t  remote_ctrlid;
4026         uint8_t  status;
4027 } __attribute__ ((packed));
4028
4029 #define BT_L2CAP_AMP_DISCONN_PHY_LINK_REQ       0x0c
4030 struct bt_l2cap_amp_disconn_phy_link_req {
4031         uint8_t  local_ctrlid;
4032         uint8_t  remote_ctrlid;
4033 } __attribute__ ((packed));
4034
4035 #define BT_L2CAP_AMP_DISCONN_PHY_LINK_RSP       0x0d
4036 struct bt_l2cap_amp_disconn_phy_link_rsp {
4037         uint8_t  local_ctrlid;
4038         uint8_t  remote_ctrlid;
4039         uint8_t  status;
4040 } __attribute__ ((packed));
4041
4042 struct bt_l2cap_hdr_att {
4043         uint8_t  code;
4044 } __attribute__ ((packed));
4045
4046 #define BT_L2CAP_ATT_ERROR_RESPONSE             0x01
4047 struct bt_l2cap_att_error_response {
4048         uint8_t  request;
4049         uint16_t handle;
4050         uint8_t  error;
4051 } __attribute__ ((packed));
4052
4053 #define BT_L2CAP_ATT_EXCHANGE_MTU_REQ           0x02
4054 struct bt_l2cap_att_exchange_mtu_req {
4055         uint16_t mtu;
4056 } __attribute__ ((packed));
4057
4058 #define BT_L2CAP_ATT_EXCHANGE_MTU_RSP           0x03
4059 struct bt_l2cap_att_exchange_mtu_rsp {
4060         uint16_t mtu;
4061 } __attribute__ ((packed));
4062
4063 #define BT_L2CAP_ATT_READ_TYPE_REQ              0x08
4064 struct bt_l2cap_att_read_type_req {
4065         uint16_t start_handle;
4066         uint16_t end_handle;
4067 } __attribute__ ((packed));
4068
4069 #define BT_L2CAP_ATT_READ_TYPE_RSP              0x09
4070 struct bt_l2cap_att_read_type_rsp {
4071         uint8_t  length;
4072 } __attribute__ ((packed));
4073
4074 #define BT_L2CAP_ATT_READ_REQ                   0x0a
4075 struct bt_l2cap_att_read_req {
4076         uint16_t handle;
4077 } __attribute__ ((packed));
4078
4079 #define BT_L2CAP_ATT_READ_RSP                   0x0b
4080
4081 #define BT_L2CAP_ATT_READ_GROUP_TYPE_REQ        0x10
4082 struct bt_l2cap_att_read_group_type_req {
4083         uint16_t start_handle;
4084         uint16_t end_handle;
4085 } __attribute__ ((packed));
4086
4087 #define BT_L2CAP_ATT_READ_GROUP_TYPE_RSP        0x11
4088 struct bt_l2cap_att_read_group_type_rsp {
4089         uint8_t  length;
4090 } __attribute__ ((packed));
4091
4092 #define BT_L2CAP_ATT_HANDLE_VALUE_NOTIFY        0x1b
4093 struct bt_l2cap_att_handle_value_notify {
4094         uint16_t handle;
4095 } __attribute__ ((packed));
4096
4097 #define BT_L2CAP_ATT_HANDLE_VALUE_IND           0x1d
4098 struct bt_l2cap_att_handle_value_ind {
4099         uint16_t handle;
4100 } __attribute__ ((packed));
4101
4102 #define BT_L2CAP_ATT_HANDLE_VALUE_CONF          0x1e
4103
4104 struct bt_l2cap_hdr_smp {
4105         uint8_t  code;
4106 } __attribute__ ((packed));
4107
4108 #define BT_L2CAP_SMP_PAIRING_REQUEST    0x01
4109 struct bt_l2cap_smp_pairing_request {
4110         uint8_t  io_capa;
4111         uint8_t  oob_data;
4112         uint8_t  auth_req;
4113         uint8_t  max_key_size;
4114         uint8_t  init_key_dist;
4115         uint8_t  resp_key_dist;
4116 } __attribute__ ((packed));
4117
4118 #define BT_L2CAP_SMP_PAIRING_RESPONSE   0x02
4119 struct bt_l2cap_smp_pairing_response {
4120         uint8_t  io_capa;
4121         uint8_t  oob_data;
4122         uint8_t  auth_req;
4123         uint8_t  max_key_size;
4124         uint8_t  init_key_dist;
4125         uint8_t  resp_key_dist;
4126 } __attribute__ ((packed));
4127
4128 #define BT_L2CAP_SMP_PAIRING_CONFIRM    0x03
4129 struct bt_l2cap_smp_pairing_confirm {
4130         uint8_t  value[16];
4131 } __attribute__ ((packed));
4132
4133 #define BT_L2CAP_SMP_PAIRING_RANDOM     0x04
4134 struct bt_l2cap_smp_pairing_random {
4135         uint8_t  value[16];
4136 } __attribute__ ((packed));
4137
4138 #define BT_L2CAP_SMP_PAIRING_FAILED     0x05
4139 struct bt_l2cap_smp_pairing_failed {
4140         uint8_t  reason;
4141 } __attribute__ ((packed));
4142
4143 #define BT_L2CAP_SMP_ENCRYPT_INFO       0x06
4144 struct bt_l2cap_smp_encrypt_info {
4145         uint8_t  ltk[16];
4146 } __attribute__ ((packed));
4147
4148 #define BT_L2CAP_SMP_CENTRAL_IDENT      0x07
4149 struct bt_l2cap_smp_central_ident {
4150         uint16_t ediv;
4151         uint64_t rand;
4152 } __attribute__ ((packed));
4153
4154 #define BT_L2CAP_SMP_IDENT_INFO         0x08
4155 struct bt_l2cap_smp_ident_info {
4156         uint8_t  irk[16];
4157 } __attribute__ ((packed));
4158
4159 #define BT_L2CAP_SMP_IDENT_ADDR_INFO    0x09
4160 struct bt_l2cap_smp_ident_addr_info {
4161         uint8_t  addr_type;
4162         uint8_t  addr[6];
4163 } __attribute__ ((packed));
4164
4165 #define BT_L2CAP_SMP_SIGNING_INFO       0x0a
4166 struct bt_l2cap_smp_signing_info {
4167         uint8_t  csrk[16];
4168 } __attribute__ ((packed));
4169
4170 #define BT_L2CAP_SMP_SECURITY_REQUEST   0x0b
4171 struct bt_l2cap_smp_security_request {
4172         uint8_t  auth_req;
4173 } __attribute__ ((packed));
4174
4175 #define BT_L2CAP_SMP_PUBLIC_KEY         0x0c
4176 struct bt_l2cap_smp_public_key {
4177         uint8_t  x[32];
4178         uint8_t  y[32];
4179 } __attribute__ ((packed));
4180
4181 #define BT_L2CAP_SMP_DHKEY_CHECK        0x0d
4182 struct bt_l2cap_smp_dhkey_check {
4183         uint8_t  e[16];
4184 } __attribute__ ((packed));
4185
4186 #define BT_L2CAP_SMP_KEYPRESS_NOTIFY    0x0e
4187 struct bt_l2cap_smp_keypress_notify {
4188         uint8_t  type;
4189 } __attribute__ ((packed));
4190
4191 struct bt_sdp_hdr {
4192         uint8_t  pdu;
4193         uint16_t tid;
4194         uint16_t plen;
4195 } __attribute__ ((packed));