1 /* packet-bthci_vendor.c
2 * Routines for the Bluetooth HCI Vendors Commands/Events
4 * Copyright 2014, Michal Labedzki for Tieto Corporation
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
16 #include <epan/expert.h>
19 #include "packet-bluetooth.h"
20 #include "packet-bthci_cmd.h"
21 #include "packet-bthci_evt.h"
24 static int proto_bthci_vendor_intel
;
26 static int hf_intel_opcode
;
27 static int hf_intel_opcode_ogf
;
28 static int hf_intel_opcode_ocf
;
29 static int hf_intel_parameter_length
;
30 static int hf_intel_number_of_allowed_command_packets
;
31 static int hf_intel_event_code
;
32 static int hf_intel_status
;
33 static int hf_intel_line
;
34 static int hf_intel_module
;
35 static int hf_intel_reason
;
36 static int hf_intel_zero
;
37 static int hf_intel_number_of_packets
;
38 static int hf_intel_source
;
39 static int hf_intel_reset_type
;
40 static int hf_intel_reset_reason
;
41 static int hf_intel_ddc_status
;
42 static int hf_intel_bd_data_status
;
43 static int hf_intel_secure_send_commands_result
;
44 static int hf_intel_handle
;
45 static int hf_intel_access_address
;
46 static int hf_intel_scan_status
;
47 static int hf_intel_scan_status_reserved
;
48 static int hf_intel_scan_status_page_scan
;
49 static int hf_intel_scan_status_inquiry_scan
;
50 static int hf_intel_link_pdu_trace_type
;
51 static int hf_intel_link_clock
;
52 static int hf_intel_link_id
;
53 static int hf_intel_link_count
;
54 static int hf_intel_bd_addr
;
55 static int hf_intel_packet_table
;
56 static int hf_intel_exception_type
;
57 static int hf_intel_reset_reset_type
;
58 static int hf_intel_reset_patch_enable
;
59 static int hf_intel_reset_ddc_reload
;
60 static int hf_intel_reset_boot_option
;
61 static int hf_intel_reset_boot_address
;
62 static int hf_intel_hardware_platform
;
63 static int hf_intel_hardware_variant
;
64 static int hf_intel_hardware_revision
;
65 static int hf_intel_firmware_variant
;
66 static int hf_intel_firmware_revision
;
67 static int hf_intel_firmware_build_version_nn
;
68 static int hf_intel_firmware_build_version_cw
;
69 static int hf_intel_firmware_build_version_yy
;
70 static int hf_intel_firmware_patch
;
71 static int hf_intel_identifier
;
72 static int hf_intel_secure_send_type
;
73 static int hf_intel_manufacturer_mode
;
74 static int hf_intel_manufacturer_reset
;
75 static int hf_intel_transmit_traces
;
76 static int hf_intel_transmit_arq
;
77 static int hf_intel_receive_traces
;
78 static int hf_intel_stimulated_exception_type
;
79 static int hf_intel_mem_address
;
80 static int hf_intel_mem_mode
;
81 static int hf_intel_mem_length
;
82 static int hf_intel_ddc_config_length
;
83 static int hf_intel_set_event_mask
;
84 static int hf_intel_set_event_mask_reserved_15_63
;
85 static int hf_intel_set_event_mask_firmware_trace_string
;
86 static int hf_intel_set_event_mask_le_link_established
;
87 static int hf_intel_set_event_mask_reserved_12
;
88 static int hf_intel_set_event_mask_system_exception
;
89 static int hf_intel_set_event_mask_fatal_exception
;
90 static int hf_intel_set_event_mask_debug_exception
;
91 static int hf_intel_set_event_mask_reserved_8
;
92 static int hf_intel_set_event_mask_scan_status
;
93 static int hf_intel_set_event_mask_reserved_3_6
;
94 static int hf_intel_set_event_mask_ptt_switch_notification
;
95 static int hf_intel_set_event_mask_sco_rejected_via_lmp
;
96 static int hf_intel_set_event_mask_bootup
;
97 static int hf_intel_data
;
99 static int * const hfx_intel_scan_status
[] = {
100 &hf_intel_scan_status_reserved
,
101 &hf_intel_scan_status_page_scan
,
102 &hf_intel_scan_status_inquiry_scan
,
106 static int * const hfx_intel_set_event_mask
[] = {
107 &hf_intel_set_event_mask_reserved_15_63
,
108 &hf_intel_set_event_mask_firmware_trace_string
,
109 &hf_intel_set_event_mask_le_link_established
,
110 &hf_intel_set_event_mask_reserved_12
,
111 &hf_intel_set_event_mask_system_exception
,
112 &hf_intel_set_event_mask_fatal_exception
,
113 &hf_intel_set_event_mask_debug_exception
,
114 &hf_intel_set_event_mask_reserved_8
,
115 &hf_intel_set_event_mask_scan_status
,
116 &hf_intel_set_event_mask_reserved_3_6
,
117 &hf_intel_set_event_mask_ptt_switch_notification
,
118 &hf_intel_set_event_mask_sco_rejected_via_lmp
,
119 &hf_intel_set_event_mask_bootup
,
123 static dissector_handle_t bthci_vendor_intel_handle
;
124 static dissector_handle_t btlmp_handle
;
125 static dissector_handle_t btle_handle
;
127 static int ett_intel
;
128 static int ett_intel_opcode
;
129 static int ett_intel_scan_status
;
130 static int ett_intel_set_event_mask
;
132 static expert_field ei_intel_undecoded
;
133 static expert_field ei_intel_unexpected_parameter
;
134 static expert_field ei_intel_unexpected_data
;
136 #define INTEL_OPCODE_VALS(base) \
137 { (base) | 0x0001, "Reset" }, \
138 { (base) | 0x0002, "No Operation" }, \
139 { (base) | 0x0005, "Read Version" }, \
140 { (base) | 0x0006, "Set UART Baudrate" }, \
141 { (base) | 0x0007, "Enable LPM" }, \
142 { (base) | 0x0008, "PCM Write Configuration" }, \
143 { (base) | 0x0009, "Secure Send" }, \
144 { (base) | 0x000D, "Read Secure Boot Params" }, \
145 { (base) | 0x000E, "Write Secure Boot Params" }, \
146 { (base) | 0x000F, "Unlock" }, \
147 { (base) | 0x0010, "Change UART Baudrate" }, \
148 { (base) | 0x0011, "Manufacturer Mode" }, \
149 { (base) | 0x0012, "Read Link RSSI" }, \
150 { (base) | 0x0022, "Get Exception Info" }, \
151 { (base) | 0x0024, "Clear Exception Info" }, \
152 { (base) | 0x002F, "Write BD Data" }, \
153 { (base) | 0x0030, "Read BD Data" }, \
154 { (base) | 0x0031, "Write BD Address" }, \
155 { (base) | 0x0032, "Flow Specification" }, \
156 { (base) | 0x0034, "Read Secure ID" }, \
157 { (base) | 0x0038, "Set Synchronous USB Interface Type" }, \
158 { (base) | 0x0039, "Config Synchronous Interface" }, \
159 { (base) | 0x003F, "SW RF Kill" }, \
160 { (base) | 0x0043, "Activate/Deactivate Traces" }, \
161 { (base) | 0x004D, "Stimulate Exception" }, \
162 { (base) | 0x0050, "Read HW Version" }, \
163 { (base) | 0x0052, "Set Event Mask" }, \
164 { (base) | 0x0053, "Config_Link_Controller" }, \
165 { (base) | 0x0089, "DDC Write" }, \
166 { (base) | 0x008A, "DDC Read" }, \
167 { (base) | 0x008B, "DDC Config Write" }, \
168 { (base) | 0x008C, "DDC Config Read" }, \
169 { (base) | 0x008D, "Memory Read" }, \
170 { (base) | 0x008E, "Memory Write" }
172 static const value_string intel_opcode_ocf_vals
[] = {
173 INTEL_OPCODE_VALS(0x0),
177 static const value_string intel_opcode_vals
[] = {
178 INTEL_OPCODE_VALS(0x3F << 10),
182 static const value_string intel_event_code_vals
[] = {
183 { 0x01, "Fatal Exception" },
185 { 0x05, "Default BD Data" },
186 { 0x06, "Secure Send Commands Result" },
187 { 0x08, "Debug Exception" },
188 { 0x0F, "LE Link Established" },
189 { 0x11, "Scan Status" },
190 { 0x16, "Activate/Deactivate Traces Complete" },
191 { 0x17, "Link PDU Trace" },
192 { 0x19, "Write BD Data Complete" },
193 { 0x25, "SCO Rejected via LMP" },
194 { 0x26, "PTT Switch Notification" },
195 { 0x29, "System Exception" },
196 { 0x2C, "FW Trace String" },
197 { 0x2E, "FW Trace Binary" },
201 static const value_string intel_module_vals
[] = {
217 static const value_string intel_source_vals
[] = {
218 { 0x00, "Bootloader" },
219 { 0x01, "Operational Firmware" },
220 { 0x02, "Self Test Firmware" },
224 static const value_string intel_reset_type_vals
[] = {
225 { 0x00, "Hardware Reset" },
226 { 0x01, "Soft Watchdog Reset" },
227 { 0x02, "Soft Software Reset" },
228 { 0x03, "Hard Watchdog Reset" },
229 { 0x04, "Hard Software Reset" },
233 static const value_string intel_reset_reason_vals
[] = {
234 { 0x00, "Power On" },
235 { 0x01, "Reset Command" },
236 { 0x02, "Intel Reset Command" },
237 { 0x03, "Watchdog" },
238 { 0x04, "Fatal Exception" },
239 { 0x05, "System Exception" },
244 static const value_string intel_ddc_status_vals
[] = {
245 { 0x00, "Firmware Default" },
246 { 0x01, "Firmware Default Plus OTP" },
247 { 0x02, "Persistent RAM" },
248 { 0x03, "Not Used" },
252 static const value_string intel_bd_data_status_vals
[] = {
253 { 0x02, "Invalid Manufacturing Data" },
257 static const value_string intel_secure_send_commands_result_vals
[] = {
259 { 0x01, "General Failure" },
260 { 0x02, "Hardware Failure" },
261 { 0x03, "Signature Verification Failed" },
262 { 0x04, "Parsing Error of Command Buffer" },
263 { 0x05, "Command Execution Failure" },
264 { 0x06, "Command Parameters Error" },
265 { 0x07, "Command Missing" },
269 static const value_string intel_link_pdu_trace_type_vals
[] = {
279 static const value_string intel_packet_table_vals
[] = {
280 { 0x00, "Basic Rate" },
281 { 0x01, "Enhanced Data Rate" },
285 static const value_string intel_exception_type_vals
[] = {
286 { 0x00, "No Exception" },
287 { 0x01, "Undefined Instruction" },
288 { 0x02, "Prefetch Abort" },
289 { 0x03, "Data Abort" },
293 static const value_string intel_reset_reset_type_vals
[] = {
294 { 0x00, "Soft Software Reset" },
295 { 0x01, "Hard Software Reset" },
299 static const value_string intel_reset_patch_enable_vals
[] = {
300 { 0x00, "Disabled" },
305 static const value_string intel_reset_ddc_reload_vals
[] = {
306 { 0x00, "Disabled" },
307 { 0x01, "Reload from OTP" },
311 static const value_string intel_secure_send_type_vals
[] = {
319 static const value_string intel_manufacturer_mode_vals
[] = {
320 { 0x00, "Disabled" },
325 static const value_string intel_manufacturer_reset_vals
[] = {
326 { 0x00, "No Reset" },
327 { 0x01, "Reset and Deactivate Patches" },
328 { 0x02, "Reset and Activate Patches" },
332 static const value_string intel_stimulated_exception_type_vals
[] = {
333 { 0x00, "Fatal Exception" },
334 { 0x01, "Debug Exception" },
338 static const value_string intel_mem_mode_vals
[] = {
339 { 0x00, "Byte Access" },
340 { 0x01, "Half Word Access" },
341 { 0x02, "Word Access" },
346 void proto_register_bthci_vendor_intel(void);
347 void proto_reg_handoff_bthci_vendor_intel(void);
350 dissect_bthci_vendor_intel(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
352 proto_item
*main_item
;
353 proto_tree
*main_tree
;
354 proto_item
*opcode_item
;
355 proto_tree
*opcode_tree
;
356 proto_item
*sub_item
;
357 bluetooth_data_t
*bluetooth_data
;
359 int offset_parameters
;
362 const char *description
;
367 uint32_t interface_id
;
370 bluetooth_data
= (bluetooth_data_t
*) data
;
371 if (bluetooth_data
) {
372 interface_id
= bluetooth_data
->interface_id
;
373 adapter_id
= bluetooth_data
->adapter_id
;
375 interface_id
= HCI_INTERFACE_DEFAULT
;
376 adapter_id
= HCI_ADAPTER_DEFAULT
;
379 main_item
= proto_tree_add_item(tree
, proto_bthci_vendor_intel
, tvb
, 0, -1, ENC_NA
);
380 main_tree
= proto_item_add_subtree(main_item
, ett_intel
);
382 switch (pinfo
->p2p_dir
) {
385 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HCI_CMD_INTEL");
386 col_set_str(pinfo
->cinfo
, COL_INFO
, "Sent Intel ");
388 opcode_item
= proto_tree_add_item(main_tree
, hf_intel_opcode
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
389 opcode_tree
= proto_item_add_subtree(opcode_item
, ett_intel_opcode
);
390 opcode
= tvb_get_letohs(tvb
, offset
);
391 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ogf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
393 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ocf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
394 ocf
= opcode
& 0x03ff;
397 description
= val_to_str_const(ocf
, intel_opcode_ocf_vals
, "unknown");
398 if (g_strcmp0(description
, "unknown") != 0)
399 col_append_str(pinfo
->cinfo
, COL_INFO
, description
);
401 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Unknown Command 0x%04X (opcode 0x%04X)", ocf
, opcode
);
403 if (have_tap_listener(bluetooth_hci_summary_tap
)) {
404 bluetooth_hci_summary_tap_t
*tap_hci_summary
;
406 tap_hci_summary
= wmem_new(pinfo
->pool
, bluetooth_hci_summary_tap_t
);
407 tap_hci_summary
->interface_id
= interface_id
;
408 tap_hci_summary
->adapter_id
= adapter_id
;
410 tap_hci_summary
->type
= BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE
;
411 tap_hci_summary
->ogf
= opcode
>> 10;
412 tap_hci_summary
->ocf
= ocf
;
413 if (try_val_to_str(ocf
, intel_opcode_ocf_vals
))
414 tap_hci_summary
->name
= description
;
416 tap_hci_summary
->name
= NULL
;
417 tap_queue_packet(bluetooth_hci_summary_tap
, pinfo
, tap_hci_summary
);
420 proto_tree_add_item(main_tree
, hf_intel_parameter_length
, tvb
, offset
, 1, ENC_NA
);
421 length
= tvb_get_uint8(tvb
, offset
);
424 offset_parameters
= offset
;
427 case 0x0001: /* Reset */
428 proto_tree_add_item(main_tree
, hf_intel_reset_reset_type
, tvb
, offset
, 1, ENC_NA
);
431 proto_tree_add_item(main_tree
, hf_intel_reset_patch_enable
, tvb
, offset
, 1, ENC_NA
);
434 proto_tree_add_item(main_tree
, hf_intel_reset_ddc_reload
, tvb
, offset
, 1, ENC_NA
);
437 proto_tree_add_item(main_tree
, hf_intel_reset_ddc_reload
, tvb
, offset
, 1, ENC_NA
);
440 proto_tree_add_item(main_tree
, hf_intel_reset_boot_option
, tvb
, offset
, 1, ENC_NA
);
443 proto_tree_add_item(main_tree
, hf_intel_reset_boot_address
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
447 case 0x0002: /* No Operation */
448 case 0x0006: /* Set UART Baudrate */
449 case 0x0007: /* Enable LPM */
450 case 0x0008: /* PCM Write Configuration */
451 case 0x000E: /* Write Secure Boot Params */
452 case 0x000F: /* Unlock */
453 case 0x0010: /* Change UART Baudrate */
454 case 0x0012: /* Read Link RSSI */
455 case 0x0022: /* Get Exception Info */
456 case 0x0024: /* Clear Exception Info */
457 case 0x0032: /* Flow Specification */
458 case 0x0034: /* Read Secure ID */
459 case 0x0038: /* Set Synchronous USB Interface Type */
460 case 0x0039: /* Config Synchronous Interface */
461 case 0x0050: /* Read HW Version */
462 case 0x0053: /* Config_Link_Controller */
463 case 0x0089: /* DDC Write */
464 case 0x008A: /* DDC Read */
465 case 0x008C: /* DDC Config Read */
466 case 0x008D: /* Memory Read */
470 case 0x0005: /* Read Version */
471 case 0x000D: /* Read Secure Boot Params */
472 case 0x0030: /* Read BD Data */
473 case 0x003F: /* SW RF Kill */
477 case 0x0009: /* Secure Send */
478 proto_tree_add_item(main_tree
, hf_intel_secure_send_type
, tvb
, offset
, 1, ENC_NA
);
481 if (length
- 1 > 0) {
482 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
483 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
484 offset
+= length
- 1;
488 case 0x0011: /* Manufacturer Mode */
489 proto_tree_add_item(main_tree
, hf_intel_manufacturer_mode
, tvb
, offset
, 1, ENC_NA
);
492 proto_tree_add_item(main_tree
, hf_intel_manufacturer_reset
, tvb
, offset
, 1, ENC_NA
);
496 case 0x002F: /* Write BD Data */
497 offset
= dissect_bd_addr(hf_intel_bd_addr
, pinfo
, main_tree
, tvb
, offset
, false, interface_id
, adapter_id
, NULL
);
499 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 6, ENC_NA
);
500 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
503 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 8, ENC_NA
);
504 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
507 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 1, ENC_NA
);
508 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
511 if (length
- 6 - 8 - 1 > 0) {
512 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
- 6 - 8 - 1, ENC_NA
);
513 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
514 offset
+= length
- 6 - 8 - 1;
518 case 0x0031: /* Write BD Address */
519 offset
= dissect_bd_addr(hf_intel_bd_addr
, pinfo
, main_tree
, tvb
, offset
, false, interface_id
, adapter_id
, NULL
);
522 case 0x0043: /* Activate/Deactivate Traces */
523 proto_tree_add_item(main_tree
, hf_intel_transmit_traces
, tvb
, offset
, 1, ENC_NA
);
526 proto_tree_add_item(main_tree
, hf_intel_transmit_arq
, tvb
, offset
, 1, ENC_NA
);
529 proto_tree_add_item(main_tree
, hf_intel_receive_traces
, tvb
, offset
, 1, ENC_NA
);
533 case 0x004D: /* Stimulate Exception */
534 proto_tree_add_item(main_tree
, hf_intel_stimulated_exception_type
, tvb
, offset
, 1, ENC_NA
);
538 case 0x0052: /* Set Event Mask */
539 proto_tree_add_bitmask(main_tree
, tvb
, offset
, hf_intel_set_event_mask
, ett_intel_set_event_mask
, hfx_intel_set_event_mask
, ENC_LITTLE_ENDIAN
);
543 case 0x008B: /* DDC Config Write */
545 uint8_t ddc_config_length
;
547 proto_tree_add_item(main_tree
, hf_intel_ddc_config_length
, tvb
, offset
, 1, ENC_NA
);
548 ddc_config_length
= tvb_get_uint8(tvb
, offset
);
551 proto_tree_add_item(main_tree
, hf_intel_identifier
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
554 proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, ddc_config_length
, ENC_NA
);
555 offset
+= ddc_config_length
;
557 length
-= 1 + 3 + ddc_config_length
;
561 case 0x008E: /* Memory Write */
562 proto_tree_add_item(main_tree
, hf_intel_mem_address
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
565 proto_tree_add_item(main_tree
, hf_intel_mem_mode
, tvb
, offset
, 1, ENC_NA
);
568 proto_tree_add_item(main_tree
, hf_intel_mem_length
, tvb
, offset
, 1, ENC_NA
);
571 proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, tvb_get_uint8(tvb
, offset
- 1), ENC_NA
);
572 offset
+= tvb_get_uint8(tvb
, offset
- 1);
577 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
578 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
583 if (offset
- offset_parameters
< length
) {
584 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
- (offset
- offset_parameters
), ENC_NA
);
585 expert_add_info(pinfo
, sub_item
, &ei_intel_unexpected_parameter
);
586 offset
+= length
- (offset
- offset_parameters
);
591 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HCI_EVT_INTEL");
592 col_set_str(pinfo
->cinfo
, COL_INFO
, "Rcvd Intel ");
594 event_code
= tvb_get_uint8(tvb
, offset
);
596 if (try_val_to_str(event_code
, intel_event_code_vals
))
597 description
= val_to_str(event_code
, intel_event_code_vals
, "Unknown 0x%08x");
599 description
= val_to_str_ext(event_code
, &bthci_evt_evt_code_vals_ext
, "Unknown 0x%08x");
600 col_append_str(pinfo
->cinfo
, COL_INFO
, description
);
601 proto_tree_add_item(main_tree
, hf_intel_event_code
, tvb
, offset
, 1, ENC_NA
);
604 if (have_tap_listener(bluetooth_hci_summary_tap
)) {
605 bluetooth_hci_summary_tap_t
*tap_hci_summary
;
607 tap_hci_summary
= wmem_new(pinfo
->pool
, bluetooth_hci_summary_tap_t
);
608 tap_hci_summary
->interface_id
= interface_id
;
609 tap_hci_summary
->adapter_id
= adapter_id
;
611 tap_hci_summary
->type
= BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT
;
612 tap_hci_summary
->event
= event_code
;
613 if (try_val_to_str_ext(event_code
, &bthci_evt_evt_code_vals_ext
))
614 tap_hci_summary
->name
= description
;
616 tap_hci_summary
->name
= NULL
;
617 tap_queue_packet(bluetooth_hci_summary_tap
, pinfo
, tap_hci_summary
);
620 proto_tree_add_item(main_tree
, hf_intel_parameter_length
, tvb
, offset
, 1, ENC_NA
);
621 length
= tvb_get_uint8(tvb
, offset
);
624 offset_parameters
= offset
;
626 switch (event_code
) {
627 case 0x0e: /* Command Complete */
628 proto_tree_add_item(main_tree
, hf_intel_number_of_allowed_command_packets
, tvb
, offset
, 1, ENC_NA
);
631 opcode_item
= proto_tree_add_item(main_tree
, hf_intel_opcode
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
632 opcode_tree
= proto_item_add_subtree(opcode_item
, ett_intel_opcode
);
633 opcode
= tvb_get_letohs(tvb
, offset
);
634 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ogf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
636 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ocf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
637 ocf
= opcode
& 0x03ff;
640 description
= val_to_str_const(ocf
, intel_opcode_ocf_vals
, "unknown");
641 if (g_strcmp0(description
, "unknown") != 0)
642 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " (%s)", description
);
644 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " (Unknown Command 0x%04X [opcode 0x%04X])", ocf
, opcode
);
646 if (have_tap_listener(bluetooth_hci_summary_tap
)) {
647 bluetooth_hci_summary_tap_t
*tap_hci_summary
;
649 tap_hci_summary
= wmem_new(pinfo
->pool
, bluetooth_hci_summary_tap_t
);
650 tap_hci_summary
->interface_id
= interface_id
;
651 tap_hci_summary
->adapter_id
= adapter_id
;
653 tap_hci_summary
->type
= BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE
;
654 tap_hci_summary
->ogf
= opcode
>> 10;
655 tap_hci_summary
->ocf
= ocf
;
656 if (try_val_to_str(ocf
, intel_opcode_ocf_vals
))
657 tap_hci_summary
->name
= description
;
659 tap_hci_summary
->name
= NULL
;
660 tap_queue_packet(bluetooth_hci_summary_tap
, pinfo
, tap_hci_summary
);
663 proto_tree_add_item(main_tree
, hf_intel_status
, tvb
, offset
, 1, ENC_NA
);
664 status
= tvb_get_uint8(tvb
, offset
);
668 case 0x0001: /* Reset */
669 case 0x0009: /* Secure Send */
670 case 0x0011: /* Manufacturer Mode */
671 case 0x0031: /* Write BD Address */
672 case 0x003F: /* SW RF Kill */
673 case 0x004D: /* Stimulate Exception */
674 case 0x0052: /* Set Event Mask */
675 case 0x008E: /* Memory Write */
679 case 0x0002: /* No Operation */
680 case 0x0006: /* Set UART Baudrate */
681 case 0x0007: /* Enable LPM */
682 case 0x0008: /* PCM Write Configuration */
683 case 0x000D: /* Read Secure Boot Params */
684 case 0x000E: /* Write Secure Boot Params */
685 case 0x000F: /* Unlock */
686 case 0x0010: /* Change UART Baudrate */
687 case 0x0012: /* Read Link RSSI */
688 case 0x0022: /* Get Exception Info */
689 case 0x0024: /* Clear Exception Info */
690 case 0x002F: /* Write BD Data */
691 case 0x0032: /* Flow Specification */
692 case 0x0034: /* Read Secure ID */
693 case 0x0038: /* Set Synchronous USB Interface Type */
694 case 0x0039: /* Config Synchronous Interface */
695 case 0x0043: /* Activate/Deactivate Traces */
696 case 0x0050: /* Read HW Version */
697 case 0x0053: /* Config_Link_Controller */
698 case 0x0089: /* DDC Write */
699 case 0x008A: /* DDC Read */
700 case 0x008C: /* DDC Config Read */
701 case 0x008D: /* Memory Read */
705 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
706 if (status
== STATUS_SUCCESS
)
707 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
709 expert_add_info(pinfo
, sub_item
, &ei_intel_unexpected_parameter
);
713 case 0x0005: /* Read Version */
714 proto_tree_add_item(main_tree
, hf_intel_hardware_platform
, tvb
, offset
, length
, ENC_NA
);
717 proto_tree_add_item(main_tree
, hf_intel_hardware_variant
, tvb
, offset
, length
, ENC_NA
);
720 proto_tree_add_item(main_tree
, hf_intel_hardware_revision
, tvb
, offset
, length
, ENC_NA
);
723 proto_tree_add_item(main_tree
, hf_intel_firmware_variant
, tvb
, offset
, length
, ENC_NA
);
726 proto_tree_add_item(main_tree
, hf_intel_firmware_revision
, tvb
, offset
, length
, ENC_NA
);
729 proto_tree_add_item(main_tree
, hf_intel_firmware_build_version_nn
, tvb
, offset
, length
, ENC_NA
);
732 proto_tree_add_item(main_tree
, hf_intel_firmware_build_version_cw
, tvb
, offset
, length
, ENC_NA
);
735 proto_tree_add_item(main_tree
, hf_intel_firmware_build_version_yy
, tvb
, offset
, length
, ENC_NA
);
738 proto_tree_add_item(main_tree
, hf_intel_firmware_patch
, tvb
, offset
, length
, ENC_NA
);
742 case 0x0030: /* Read BD Data */
743 offset
= dissect_bd_addr(hf_intel_bd_addr
, pinfo
, main_tree
, tvb
, offset
, false, interface_id
, adapter_id
, NULL
);
746 case 0x008B: /* DDC Config Write */
747 proto_tree_add_item(main_tree
, hf_intel_identifier
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
753 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
754 if (status
== STATUS_SUCCESS
)
755 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
757 expert_add_info(pinfo
, sub_item
, &ei_intel_unexpected_parameter
);
766 case 0x01: /* Fatal Exception */
767 case 0x08: /* Debug Exception */
768 proto_tree_add_item(main_tree
, hf_intel_line
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
771 proto_tree_add_item(main_tree
, hf_intel_module
, tvb
, offset
, 1, ENC_NA
);
774 proto_tree_add_item(main_tree
, hf_intel_reason
, tvb
, offset
, 1, ENC_NA
);
778 case 0x02: /* Bootup */
779 proto_tree_add_item(main_tree
, hf_intel_zero
, tvb
, offset
, 1, ENC_NA
);
782 proto_tree_add_item(main_tree
, hf_intel_number_of_packets
, tvb
, offset
, 1, ENC_NA
);
785 proto_tree_add_item(main_tree
, hf_intel_source
, tvb
, offset
, 1, ENC_NA
);
788 proto_tree_add_item(main_tree
, hf_intel_reset_type
, tvb
, offset
, 1, ENC_NA
);
791 proto_tree_add_item(main_tree
, hf_intel_reset_reason
, tvb
, offset
, 1, ENC_NA
);
794 proto_tree_add_item(main_tree
, hf_intel_ddc_status
, tvb
, offset
, 1, ENC_NA
);
798 case 0x05: /* Default BD Data */
799 proto_tree_add_item(main_tree
, hf_intel_bd_data_status
, tvb
, offset
, 1, ENC_NA
);
803 case 0x06: /* Secure Send Commands Result */
804 proto_tree_add_item(main_tree
, hf_intel_secure_send_commands_result
, tvb
, offset
, 1, ENC_NA
);
807 opcode_item
= proto_tree_add_item(main_tree
, hf_intel_opcode
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
808 opcode_tree
= proto_item_add_subtree(opcode_item
, ett_intel_opcode
);
809 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ogf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
811 proto_tree_add_item(opcode_tree
, hf_intel_opcode_ocf
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
814 proto_tree_add_item(main_tree
, hf_intel_status
, tvb
, offset
, 1, ENC_NA
);
818 case 0x0F: /* LE Link Established */
819 proto_tree_add_item(main_tree
, hf_intel_handle
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
822 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 8, ENC_NA
);
823 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
826 proto_tree_add_item(main_tree
, hf_intel_access_address
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
829 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
- 2 - 8 - 4, ENC_NA
);
830 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
831 offset
+= length
- 2 - 8 - 4;
834 case 0x11: /* Scan Status */
835 proto_tree_add_bitmask(main_tree
, tvb
, offset
, hf_intel_scan_status
, ett_intel_scan_status
, hfx_intel_scan_status
, ENC_NA
);
839 case 0x16: /* Activate/Deactivate Traces Complete */
840 proto_tree_add_item(main_tree
, hf_intel_status
, tvb
, offset
, 1, ENC_NA
);
844 case 0x17: /* Link PDU Trace */
845 proto_tree_add_item(main_tree
, hf_intel_link_pdu_trace_type
, tvb
, offset
, 1, ENC_NA
);
846 type
= tvb_get_uint8(tvb
, offset
);
849 proto_tree_add_item(main_tree
, hf_intel_handle
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
853 case 0x00: /* LMP Rx*/
854 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 1, ENC_NA
);
855 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
858 call_dissector(btlmp_handle
, tvb_new_subset_length(tvb
, offset
, length
- 3 - 4), pinfo
, tree
);
859 offset
+= length
- 3 - 4;
861 proto_tree_add_item(main_tree
, hf_intel_link_clock
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
865 case 0x01: /* LMP Tx*/
866 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 1, ENC_NA
);
867 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
870 call_dissector(btlmp_handle
, tvb_new_subset_length(tvb
, offset
, length
- 3 - 5), pinfo
, tree
);
871 offset
+= length
- 3 - 5;
873 proto_tree_add_item(main_tree
, hf_intel_link_clock
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
876 proto_tree_add_item(main_tree
, hf_intel_link_id
, tvb
, offset
, 1, ENC_NA
);
880 case 0x02: /* LMP Ack */
881 proto_tree_add_item(main_tree
, hf_intel_link_clock
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
884 proto_tree_add_item(main_tree
, hf_intel_link_id
, tvb
, offset
, 1, ENC_NA
);
888 case 0x03: /* LL Rx */
889 case 0x04: /* LL Tx */
890 proto_tree_add_item(main_tree
, hf_intel_link_count
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
893 proto_tree_add_item(main_tree
, hf_intel_link_id
, tvb
, offset
, 1, ENC_NA
);
896 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, 2, ENC_NA
);
897 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
900 call_dissector(btle_handle
, tvb_new_subset_length(tvb
, offset
, length
- 3 - 2 - 1 - 2), pinfo
, tree
);
901 offset
+= length
- 3 - 2 - 1 - 2;
904 case 0x05: /* LL Ack */
905 proto_tree_add_item(main_tree
, hf_intel_link_count
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
908 proto_tree_add_item(main_tree
, hf_intel_link_id
, tvb
, offset
, 1, ENC_NA
);
915 case 0x19: /* Write BD Data Complete */
916 proto_tree_add_item(main_tree
, hf_intel_status
, tvb
, offset
, 1, ENC_NA
);
920 case 0x25: /* SCO Rejected via LMP */
921 offset
= dissect_bd_addr(hf_intel_bd_addr
, pinfo
, main_tree
, tvb
, offset
, false, interface_id
, adapter_id
, NULL
);
923 proto_tree_add_item(main_tree
, hf_intel_reason
, tvb
, offset
, 1, ENC_NA
);
927 case 0x26: /* PTT Switch Notification */
928 proto_tree_add_item(main_tree
, hf_intel_handle
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
931 proto_tree_add_item(main_tree
, hf_intel_packet_table
, tvb
, offset
, 1, ENC_NA
);
935 case 0x29: /* System Exception */
936 proto_tree_add_item(main_tree
, hf_intel_exception_type
, tvb
, offset
, 1, ENC_NA
);
939 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
- 1, ENC_NA
);
940 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
941 offset
+= length
- 1;
944 case 0x2C: /* FW Trace String */
945 case 0x2E: /* FW Trace Binary */
946 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
947 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
953 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
, ENC_NA
);
954 expert_add_info(pinfo
, sub_item
, &ei_intel_undecoded
);
959 if (offset
- offset_parameters
< length
) {
960 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, length
- (offset
- offset_parameters
), ENC_NA
);
961 expert_add_info(pinfo
, sub_item
, &ei_intel_unexpected_parameter
);
962 offset
+= length
- (offset
- offset_parameters
);
967 case P2P_DIR_UNKNOWN
:
969 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "HCI_INTEL");
970 col_set_str(pinfo
->cinfo
, COL_INFO
, "UnknownDirection Intel ");
972 if (tvb_captured_length_remaining(tvb
, offset
) > 0) {
973 proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, tvb_captured_length_remaining(tvb
, offset
), ENC_NA
);
974 offset
+= tvb_captured_length_remaining(tvb
, offset
);
979 if (tvb_captured_length_remaining(tvb
, offset
) > 0) {
980 sub_item
= proto_tree_add_item(main_tree
, hf_intel_data
, tvb
, offset
, tvb_captured_length_remaining(tvb
, offset
), ENC_NA
);
981 expert_add_info(pinfo
, sub_item
, &ei_intel_unexpected_data
);
982 offset
+= tvb_captured_length_remaining(tvb
, offset
);
989 proto_register_bthci_vendor_intel(void)
991 expert_module_t
*expert_module
;
993 static hf_register_info hf
[] = {
995 { "Command Opcode", "bthci_vendor.intel.opcode",
996 FT_UINT16
, BASE_HEX
, VALS(intel_opcode_vals
), 0x0,
997 "HCI Command Opcode", HFILL
}
999 { &hf_intel_opcode_ogf
,
1000 { "Opcode Group Field", "bthci_vendor.intel.opcode.ogf",
1001 FT_UINT16
, BASE_HEX
|BASE_EXT_STRING
, &bthci_cmd_ogf_vals_ext
, 0xfc00,
1004 { &hf_intel_opcode_ocf
,
1005 { "Opcode Command Field", "bthci_vendor.intel.opcode.ocf",
1006 FT_UINT16
, BASE_HEX
, VALS(intel_opcode_ocf_vals
), 0x03ff,
1009 { &hf_intel_parameter_length
,
1010 { "Parameter Total Length", "bthci_vendor.intel.parameter_length",
1011 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1014 { &hf_intel_number_of_allowed_command_packets
,
1015 { "Number of Allowed Command Packets", "bthci_vendor.intel.number_of_allowed_command_packets",
1016 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1019 { &hf_intel_event_code
,
1020 { "Event Code", "bthci_vendor.intel.event_code",
1021 FT_UINT8
, BASE_HEX
, VALS(intel_event_code_vals
), 0x0,
1025 { "Status", "bthci_vendor.intel.status",
1026 FT_UINT8
, BASE_HEX
|BASE_EXT_STRING
, &bthci_cmd_status_vals_ext
, 0x0,
1030 { "Line", "bthci_vendor.intel.line",
1031 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1035 { "Module", "bthci_vendor.intel.module",
1036 FT_UINT8
, BASE_HEX
, VALS(intel_module_vals
), 0x0,
1040 { "Reason", "bthci_vendor.intel.reason",
1041 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1045 { "Zero", "bthci_vendor.intel.zero",
1046 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1049 { &hf_intel_number_of_packets
,
1050 { "Number of Packets", "bthci_vendor.intel.number_of_packets",
1051 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1055 { "Source", "bthci_vendor.intel.source",
1056 FT_UINT8
, BASE_HEX
, VALS(intel_source_vals
), 0x0,
1059 { &hf_intel_reset_type
,
1060 { "Reset Type", "bthci_vendor.intel.reset_type",
1061 FT_UINT8
, BASE_HEX
, VALS(intel_reset_type_vals
), 0x0,
1064 { &hf_intel_reset_reason
,
1065 { "Reset Reason", "bthci_vendor.intel.reset_reason",
1066 FT_UINT8
, BASE_HEX
, VALS(intel_reset_reason_vals
), 0x0,
1069 { &hf_intel_ddc_status
,
1070 { "DDC Status", "bthci_vendor.intel.ddc_status",
1071 FT_UINT8
, BASE_HEX
, VALS(intel_ddc_status_vals
), 0x0,
1074 { &hf_intel_bd_data_status
,
1075 { "BD Data Status", "bthci_vendor.intel.bd_data_status",
1076 FT_UINT8
, BASE_HEX
, VALS(intel_bd_data_status_vals
), 0x0,
1079 { &hf_intel_secure_send_commands_result
,
1080 { "Secure Send Commands Result", "bthci_vendor.intel.secure_send_commands_result",
1081 FT_UINT8
, BASE_HEX
, VALS(intel_secure_send_commands_result_vals
), 0x0,
1085 { "Handle", "bthci_vendor.intel.handle",
1086 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1089 { &hf_intel_access_address
,
1090 { "Access Address", "bthci_vendor.intel.access_address",
1091 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1094 { &hf_intel_scan_status
,
1095 { "Scan Status", "bthci_vendor.intel.scan_status",
1096 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1099 { &hf_intel_scan_status_reserved
,
1100 { "Reserved", "bthci_vendor.intel.scan_status.reserved",
1101 FT_UINT8
, BASE_HEX
, NULL
, 0xFC,
1104 { &hf_intel_scan_status_page_scan
,
1105 { "Page Scan", "bthci_vendor.intel.scan_status.page_scan",
1106 FT_UINT8
, BASE_HEX
, NULL
, 0x2,
1109 { &hf_intel_scan_status_inquiry_scan
,
1110 { "Inquiry Scan", "bthci_vendor.intel.scan_status.inquiry_scan",
1111 FT_UINT8
, BASE_HEX
, NULL
, 0x1,
1114 { &hf_intel_link_pdu_trace_type
,
1115 { "Link PDU Trace Type", "bthci_vendor.intel.link_pdu_trace_type",
1116 FT_UINT8
, BASE_HEX
, VALS(intel_link_pdu_trace_type_vals
), 0x0,
1119 { &hf_intel_link_clock
,
1120 { "Clock", "bthci_vendor.intel.clock",
1121 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1124 { &hf_intel_link_id
,
1125 { "ID", "bthci_vendor.intel.id",
1126 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1129 { &hf_intel_link_count
,
1130 { "Count", "bthci_vendor.intel.count",
1131 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1134 { &hf_intel_bd_addr
,
1135 { "BD_ADDR", "bthci_vendor.intel.bd_addr",
1136 FT_ETHER
, BASE_NONE
, NULL
, 0x0,
1137 "Bluetooth Device Address", HFILL
}
1139 { &hf_intel_packet_table
,
1140 { "Packet Table", "bthci_vendor.intel.packet_table",
1141 FT_UINT8
, BASE_HEX
, VALS(intel_packet_table_vals
), 0x0,
1144 { &hf_intel_exception_type
,
1145 { "Exception Type", "bthci_vendor.intel.exception_type",
1146 FT_UINT8
, BASE_HEX
, VALS(intel_exception_type_vals
), 0x0,
1149 { &hf_intel_reset_reset_type
,
1150 { "Type", "bthci_vendor.intel.reset.type",
1151 FT_UINT8
, BASE_HEX
, VALS(intel_reset_reset_type_vals
), 0x0,
1154 { &hf_intel_reset_patch_enable
,
1155 { "Patch Enable", "bthci_vendor.intel.reset.patch_enable",
1156 FT_UINT8
, BASE_HEX
, VALS(intel_reset_patch_enable_vals
), 0x0,
1159 { &hf_intel_reset_ddc_reload
,
1160 { "DDC Reload", "bthci_vendor.intel.reset.ddc_reload",
1161 FT_UINT8
, BASE_HEX
, VALS(intel_reset_ddc_reload_vals
), 0x0,
1164 { &hf_intel_reset_boot_option
,
1165 { "Boot Option", "bthci_vendor.intel.reset.boot.option",
1166 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1169 { &hf_intel_reset_boot_address
,
1170 { "Boot Address", "bthci_vendor.intel.reset.boot.address",
1171 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1174 { &hf_intel_hardware_platform
,
1175 { "Hardware Platform", "bthci_vendor.intel.hardware.platform",
1176 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1179 { &hf_intel_hardware_variant
,
1180 { "Hardware Variant", "bthci_vendor.intel.hardware.variant",
1181 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1184 { &hf_intel_hardware_revision
,
1185 { "Hardware Revision", "bthci_vendor.intel.hardware.revision",
1186 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1189 { &hf_intel_firmware_variant
,
1190 { "Firmware Variant", "bthci_vendor.intel.firmware.variant",
1191 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1194 { &hf_intel_firmware_revision
,
1195 { "Firmware Revision", "bthci_vendor.intel.firmware.revision",
1196 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1199 { &hf_intel_firmware_build_version_nn
,
1200 { "Firmware Build Version nn", "bthci_vendor.intel.firmware.build_version.nn",
1201 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1204 { &hf_intel_firmware_build_version_cw
,
1205 { "Firmware Build Version cw", "bthci_vendor.intel.firmware.build_version.cw",
1206 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1209 { &hf_intel_firmware_build_version_yy
,
1210 { "Firmware Build Version yy", "bthci_vendor.intel.firmware.build_version.yy",
1211 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1214 { &hf_intel_firmware_patch
,
1215 { "Firmware Patch", "bthci_vendor.intel.firmware.patch",
1216 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1219 { &hf_intel_identifier
,
1220 { "Identifier", "bthci_vendor.intel.identifier",
1221 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1224 { &hf_intel_secure_send_type
,
1225 { "Type", "bthci_vendor.intel.secure_send.type",
1226 FT_UINT8
, BASE_HEX
, VALS(intel_secure_send_type_vals
), 0x0,
1229 { &hf_intel_manufacturer_mode
,
1230 { "Manufacturer Mode", "bthci_vendor.intel.manufacturer.mode",
1231 FT_UINT8
, BASE_HEX
, VALS(intel_manufacturer_mode_vals
), 0x0,
1234 { &hf_intel_manufacturer_reset
,
1235 { "Manufacturer Reset", "bthci_vendor.intel.manufacturer.reset",
1236 FT_UINT8
, BASE_HEX
, VALS(intel_manufacturer_reset_vals
), 0x0,
1239 { &hf_intel_transmit_traces
,
1240 { "Transmit Traces", "bthci_vendor.intel.transmit_traces",
1241 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1244 { &hf_intel_transmit_arq
,
1245 { "Transmit ARQ", "bthci_vendor.intel.transmit_arq",
1246 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1249 { &hf_intel_receive_traces
,
1250 { "Receive Traces", "bthci_vendor.intel.receive_traces",
1251 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1254 { &hf_intel_stimulated_exception_type
,
1255 { "Stimulated Exception Type", "bthci_vendor.intel.stimulated_exception_type",
1256 FT_UINT8
, BASE_HEX
, VALS(intel_stimulated_exception_type_vals
), 0x0,
1259 { &hf_intel_mem_address
,
1260 { "Address", "bthci_vendor.intel.mem.address",
1261 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
1264 { &hf_intel_mem_mode
,
1265 { "Mode", "bthci_vendor.intel.mem.mode",
1266 FT_UINT8
, BASE_HEX
, VALS(intel_mem_mode_vals
), 0x0,
1269 { &hf_intel_mem_length
,
1270 { "Length", "bthci_vendor.intel.mem.length",
1271 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1274 { &hf_intel_ddc_config_length
,
1275 { "Length", "bthci_vendor.intel.ddc_config.length",
1276 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1279 { &hf_intel_set_event_mask
,
1280 { "Event Mask", "bthci_vendor.intel.event_mask",
1281 FT_UINT64
, BASE_HEX
, NULL
, 0x0,
1284 { &hf_intel_set_event_mask_reserved_15_63
,
1285 { "Reserved", "bthci_vendor.intel.event_mask.reserved.15_63",
1286 FT_UINT64
, BASE_HEX
, NULL
, UINT64_C(0xFFFFFFFFFFFF8000),
1289 { &hf_intel_set_event_mask_firmware_trace_string
,
1290 { "Firmware Trace String", "bthci_vendor.intel.event_mask.firmware_trace_string",
1291 FT_BOOLEAN
, 64, NULL
, 0x0000000000004000,
1294 { &hf_intel_set_event_mask_le_link_established
,
1295 { "LE Link_Established", "bthci_vendor.intel.event_mask.le_link_established",
1296 FT_BOOLEAN
, 64, NULL
, 0x0000000000002000,
1299 { &hf_intel_set_event_mask_reserved_12
,
1300 { "Reserved", "bthci_vendor.intel.event_mask.reserved.12",
1301 FT_UINT64
, BASE_HEX
, NULL
, 0x0000000000001000,
1304 { &hf_intel_set_event_mask_system_exception
,
1305 { "System Exception", "bthci_vendor.intel.event_mask.system_exception",
1306 FT_BOOLEAN
, 64, NULL
, 0x0000000000000800,
1309 { &hf_intel_set_event_mask_fatal_exception
,
1310 { "Fatal Exception", "bthci_vendor.intel.event_mask.fatal_exception",
1311 FT_BOOLEAN
, 64, NULL
, 0x0000000000000400,
1314 { &hf_intel_set_event_mask_debug_exception
,
1315 { "Debug Exception", "bthci_vendor.intel.event_mask.debug_exception",
1316 FT_BOOLEAN
, 64, NULL
, 0x0000000000000200,
1319 { &hf_intel_set_event_mask_reserved_8
,
1320 { "Reserved", "bthci_vendor.intel.event_mask.reserved",
1321 FT_UINT64
, BASE_HEX
, NULL
, 0x0000000000000100,
1324 { &hf_intel_set_event_mask_scan_status
,
1325 { "Scan Status", "bthci_vendor.intel.event_mask.scan_status",
1326 FT_BOOLEAN
, 64, NULL
, 0x0000000000000080,
1329 { &hf_intel_set_event_mask_reserved_3_6
,
1330 { "Reserved", "bthci_vendor.intel.event_mask.reserved.3_6",
1331 FT_UINT64
, BASE_HEX
, NULL
, 0x0000000000000078,
1334 { &hf_intel_set_event_mask_ptt_switch_notification
,
1335 { "PTT Switch Notification", "bthci_vendor.intel.event_mask.ptt_switch_notification",
1336 FT_BOOLEAN
, 64, NULL
, 0x0000000000000004,
1339 { &hf_intel_set_event_mask_sco_rejected_via_lmp
,
1340 { "SCO Rejected via LMP", "bthci_vendor.intel.event_mask.sco_rejected_via_lmp",
1341 FT_BOOLEAN
, 64, NULL
, 0x0000000000000002,
1344 { &hf_intel_set_event_mask_bootup
,
1345 { "Bootup", "bthci_vendor.intel.event_mask.bootup",
1346 FT_BOOLEAN
, 64, NULL
, 0x0000000000000001,
1350 { "Data", "bthci_vendor.intel.data",
1351 FT_NONE
, BASE_NONE
, NULL
, 0x0,
1356 static int *ett
[] = {
1359 &ett_intel_scan_status
,
1360 &ett_intel_set_event_mask
1363 static ei_register_info ei
[] = {
1364 { &ei_intel_undecoded
, { "bthci_vendor.intel.undecoded", PI_UNDECODED
, PI_NOTE
, "Undecoded", EXPFILL
}},
1365 { &ei_intel_unexpected_parameter
, { "bthci_vendor.intel.unexpected_parameter", PI_PROTOCOL
, PI_WARN
, "Unexpected parameter", EXPFILL
}},
1366 { &ei_intel_unexpected_data
, { "bthci_vendor.intel.unexpected_data", PI_PROTOCOL
, PI_WARN
, "Unexpected data", EXPFILL
}},
1369 proto_bthci_vendor_intel
= proto_register_protocol("Bluetooth Intel HCI",
1370 "HCI Intel", "bthci_vendor.intel");
1372 bthci_vendor_intel_handle
= register_dissector("bthci_vendor.intel", dissect_bthci_vendor_intel
, proto_bthci_vendor_intel
);
1374 proto_register_field_array(proto_bthci_vendor_intel
, hf
, array_length(hf
));
1375 proto_register_subtree_array(ett
, array_length(ett
));
1377 expert_module
= expert_register_protocol(proto_bthci_vendor_intel
);
1378 expert_register_field_array(expert_module
, ei
, array_length(ei
));
1382 proto_reg_handoff_bthci_vendor_intel(void)
1384 btlmp_handle
= find_dissector_add_dependency("btlmp", proto_bthci_vendor_intel
);
1385 btle_handle
= find_dissector_add_dependency("btle", proto_bthci_vendor_intel
);
1387 dissector_add_for_decode_as("bthci_cmd.vendor", bthci_vendor_intel_handle
);
1389 dissector_add_uint("bluetooth.vendor", 0x0002, bthci_vendor_intel_handle
);
1393 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1398 * indent-tabs-mode: nil
1401 * vi: set shiftwidth=4 tabstop=8 expandtab:
1402 * :indentSize=4:tabSize=8:noTabs=true: