Bluetooth: HCI: Add missing Core4's cmd/evt identifies
Add a lof of Command Opcodes. Implement trivial Event: "Inquiry Response Notification" and "Get MWS Transport Layer Configuration" Change-Id: I4ca13878e2f972caae4320e9c0149dc3d75c45a5 Reviewed-on: https://code.wireshark.org/review/18668 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
This commit is contained in:
parent
c799699040
commit
7f033b6806
|
@ -668,7 +668,8 @@ value_string_ext bthci_cmd_ogf_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ogf_va
|
|||
{ (base) | 0x041, "Set Connectionless Slave Broadcast" }, \
|
||||
{ (base) | 0x042, "Set Connectionless Slave Broadcast Receive" }, \
|
||||
{ (base) | 0x043, "Start Synchronization Train" }, \
|
||||
{ (base) | 0x044, "Receive Synchronization Train" }
|
||||
{ (base) | 0x044, "Receive Synchronization Train" }, \
|
||||
{ (base) | 0x045, "Remove OOB Extended Data Request Reply" } \
|
||||
|
||||
static const value_string bthci_cmd_ocf_link_control_vals[] = {
|
||||
LINK_CONTROL_VALS(0x0), \
|
||||
|
@ -800,7 +801,16 @@ value_string_ext bthci_cmd_ocf_link_policy_vals_ext = VALUE_STRING_EXT_INIT(bthc
|
|||
{ (base) | 0x075, "Delete Reserved LT_ADDR" }, \
|
||||
{ (base) | 0x076, "Set Connectionless Slave Broadcast Data" }, \
|
||||
{ (base) | 0x077, "Read Synchronization Train Parameters" }, \
|
||||
{ (base) | 0x078, "Write Synchronization Train Parameters" }
|
||||
{ (base) | 0x078, "Write Synchronization Train Parameters" }, \
|
||||
{ (base) | 0x079, "Read Secure Connections Host Support" }, \
|
||||
{ (base) | 0x07A, "Write Secure Connections Host Support" }, \
|
||||
{ (base) | 0x07B, "Read Authenticated Payload Timeout" }, \
|
||||
{ (base) | 0x07C, "Write Authenticated Payload Timeout" }, \
|
||||
{ (base) | 0x07D, "Read Local OOB Extended Data" }, \
|
||||
{ (base) | 0x07E, "Read Extended Page Timeout" }, \
|
||||
{ (base) | 0x07F, "Write Extended Page Timeout" }, \
|
||||
{ (base) | 0x080, "Read Extended Inquiry Length" }, \
|
||||
{ (base) | 0x081, "Write Extended Inquiry Length" }
|
||||
|
||||
static const value_string bthci_cmd_ocf_host_controller_and_baseband_vals[] = {
|
||||
HOST_CONTROLLER_AND_BASEBAND_VALS(0x0),
|
||||
|
@ -862,7 +872,8 @@ value_string_ext bthci_cmd_ocf_status_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd
|
|||
{ (base) | 0x004, "Write Simple Pairing Debug Mode" }, \
|
||||
{ (base) | 0x007, "Enable AMP Receiver Reports" }, \
|
||||
{ (base) | 0x008, "AMP Test End" }, \
|
||||
{ (base) | 0x009, "AMP Test" }
|
||||
{ (base) | 0x009, "AMP Test" }, \
|
||||
{ (base) | 0x00A, "Write Secure Connections Test Mode" }
|
||||
|
||||
static const value_string bthci_cmd_ocf_testing_vals[] = {
|
||||
TESTING_VALS(0x0),
|
||||
|
@ -2119,6 +2130,7 @@ dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
case 0x0042: /* Set Connectionless Slave Broadcast Receive */
|
||||
case 0x0043: /* Start Synchronization Train */
|
||||
case 0x0044: /* Receive Synchronization Train */
|
||||
case 0x0045: /* Remove OOB Extended Data Request Reply */
|
||||
/* TODO: Implement above cases */
|
||||
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
|
||||
offset += tvb_reported_length_remaining(tvb, offset);
|
||||
|
@ -2884,6 +2896,15 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
|
|||
case 0x076: /* Set Connectionless Slave Broadcast Data */
|
||||
case 0x077: /* Read Synchronization Train Parameters */
|
||||
case 0x078: /* Write Synchronization Train Parameters */
|
||||
case 0x079: /* Read Secure Connections Host Support */
|
||||
case 0x07A: /* Write Secure Connections Host Support */
|
||||
case 0x07B: /* Read Authenticated Payload Timeout */
|
||||
case 0x07C: /* Write Authenticated Payload Timeout */
|
||||
case 0x07D: /* Read Local OOB Extended Data */
|
||||
case 0x07E: /* Read Extended Page Timeout */
|
||||
case 0x07F: /* Write Extended Page Timeout */
|
||||
case 0x080: /* Read Extended Inquiry Length */
|
||||
case 0x081: /* Write Extended Inquiry Length */
|
||||
/* TODO: Implement above cases */
|
||||
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
|
||||
offset += tvb_reported_length_remaining(tvb, offset);
|
||||
|
@ -3020,9 +3041,11 @@ dissect_testing_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
|
|||
break;
|
||||
|
||||
case 0x009: /* AMP Test */
|
||||
/* TODO: Implement above cases */
|
||||
case 0x00A: /* Write Secure Connections Test Mode */
|
||||
/* TODO */
|
||||
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
|
||||
offset += tvb_reported_length_remaining(tvb, offset);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -378,6 +378,17 @@ static int hf_bthci_evt_le_features_data_packet_length_extension = -1;
|
|||
static int hf_bthci_evt_le_features_ll_privacy = -1;
|
||||
static int hf_bthci_evt_le_features_extended_scanner_filter_policies = -1;
|
||||
static int hf_bthci_evt_le_features_reserved = -1;
|
||||
static int hf_bthci_evt_mws_number_of_transports = -1;
|
||||
static int hf_bthci_evt_mws_transport_layers = -1;
|
||||
static int hf_bthci_evt_mws_transport_layers_item = -1;
|
||||
static int hf_bthci_evt_mws_transport_layer = -1;
|
||||
static int hf_bthci_evt_mws_number_of_baud_rates = -1;
|
||||
static int hf_bthci_evt_mws_to_mws_baud_rates = -1;
|
||||
static int hf_bthci_evt_mws_to_mws_baud_rates_tranport_item = -1;
|
||||
static int hf_bthci_evt_mws_to_mws_baud_rate = -1;
|
||||
static int hf_bthci_evt_mws_from_mws_baud_rates = -1;
|
||||
static int hf_bthci_evt_mws_from_mws_baud_rates_tranport_item = -1;
|
||||
static int hf_bthci_evt_mws_from_mws_baud_rate = -1;
|
||||
|
||||
static const int *hfx_bthci_evt_le_features[] = {
|
||||
&hf_bthci_evt_le_features_encryption,
|
||||
|
@ -409,6 +420,12 @@ static gint ett_ptype_subtree = -1;
|
|||
static gint ett_le_state_subtree = -1;
|
||||
static gint ett_le_channel_map = -1;
|
||||
static gint ett_le_features = -1;
|
||||
static gint ett_mws_transport_layers = -1;
|
||||
static gint ett_mws_transport_layers_item = -1;
|
||||
static gint ett_mws_to_mws_baud_rates = -1;
|
||||
static gint ett_mws_to_mws_baud_rates_transport_item = -1;
|
||||
static gint ett_mws_from_mws_baud_rates = -1;
|
||||
static gint ett_mws_from_mws_baud_rates_transport_item = -1;
|
||||
static gint ett_expert = -1;
|
||||
|
||||
extern value_string_ext ext_usb_vendors_vals;
|
||||
|
@ -503,6 +520,8 @@ static const value_string evt_code_vals[] = {
|
|||
{0x54, "Slave Page Response Timeout"},
|
||||
{0x55, "Connectionless Slave Broadcast Channel Map Change"},
|
||||
{0x56, "Inquiry Response Notification"},
|
||||
/* Core 4*/
|
||||
{0x57, "Authenticated Payload Timeout Expired"},
|
||||
/* Other */
|
||||
{0xfe, "Bluetooth Logo Testing"},
|
||||
{0xff, "Vendor-Specific"},
|
||||
|
@ -752,6 +771,13 @@ static const value_string evt_air_mode_vals[] = {
|
|||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const value_string mws_transport_layer_vals[] = {
|
||||
{ 0x00, "Disabled" },
|
||||
{ 0x01, "WCI-1 Transport" },
|
||||
{ 0x02, "WCI-2 Transport" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
void proto_register_bthci_evt(void);
|
||||
void proto_reg_handoff_bthci_evt(void);
|
||||
|
||||
|
@ -3945,6 +3971,107 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
|
|||
break;
|
||||
}
|
||||
|
||||
case 0x140C: /* Get MWS Transport Layer Configuration */ {
|
||||
guint8 transports;
|
||||
guint8 i_transport;
|
||||
guint16 baud_rates = 0;
|
||||
guint16 i_baud_rate;
|
||||
gint32 baud_rate_to;
|
||||
proto_item *sub_item;
|
||||
proto_tree *sub_tree;
|
||||
proto_item *sub2_item;
|
||||
proto_tree *sub2_tree;
|
||||
gint offset_baud_rates;
|
||||
|
||||
proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_NA);
|
||||
status = tvb_get_guint8(tvb, offset);
|
||||
send_hci_summary_status_tap(status, pinfo, bluetooth_data);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(tree, hf_bthci_evt_mws_number_of_transports, tvb, offset, 1, ENC_NA);
|
||||
transports = tvb_get_guint8(tvb, offset);
|
||||
offset += 1;
|
||||
|
||||
sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_transport_layers, tvb, offset, transports * 2, ENC_NA);
|
||||
sub_tree = proto_item_add_subtree(sub_item, ett_mws_transport_layers);
|
||||
|
||||
offset_baud_rates = offset = 1;
|
||||
|
||||
for (i_transport = 0; i_transport < transports; i_transport += 1) {
|
||||
sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_transport_layers_item, tvb, offset, transports * 2, ENC_NA);
|
||||
sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_transport_layers_item);
|
||||
proto_item_append_text(sub2_item, " #%u", i_transport + 1);
|
||||
|
||||
proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_transport_layer, tvb, offset, 1, ENC_NA);
|
||||
offset += 1;
|
||||
|
||||
proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_number_of_baud_rates, tvb, offset, 1, ENC_NA);
|
||||
baud_rates += tvb_get_guint8(tvb, offset);
|
||||
offset += 1;
|
||||
}
|
||||
|
||||
sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_to_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA);
|
||||
sub_tree = proto_item_add_subtree(sub_item, ett_mws_to_mws_baud_rates);
|
||||
|
||||
baud_rate_to = -1;
|
||||
i_transport = 1;
|
||||
sub2_tree = sub_tree;
|
||||
for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) {
|
||||
if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) {
|
||||
baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2);
|
||||
sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_to_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA);
|
||||
proto_item_append_text(sub2_item, " #%u", i_transport);
|
||||
sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_to_mws_baud_rates_transport_item);
|
||||
i_transport += 1;
|
||||
}
|
||||
|
||||
proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_to_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
sub_item = proto_tree_add_item(tree, hf_bthci_evt_mws_from_mws_baud_rates, tvb, offset, baud_rates * 4, ENC_NA);
|
||||
sub_tree = proto_item_add_subtree(sub_item, ett_mws_from_mws_baud_rates);
|
||||
|
||||
baud_rate_to = -1;
|
||||
i_transport = 1;
|
||||
sub2_tree = sub_tree;
|
||||
for (i_baud_rate = 0; i_baud_rate < baud_rates; i_baud_rate += 1) {
|
||||
if (baud_rate_to == -1 || baud_rate_to == i_baud_rate) {
|
||||
baud_rate_to = tvb_get_guint8(tvb, offset_baud_rates + (i_transport - 1) * 2);
|
||||
sub2_item = proto_tree_add_item(sub_tree, hf_bthci_evt_mws_from_mws_baud_rates_tranport_item, tvb, offset, (baud_rate_to - i_baud_rate) * 4, ENC_NA);
|
||||
proto_item_append_text(sub2_item, " #%u", i_transport);
|
||||
sub2_tree = proto_item_add_subtree(sub2_item, ett_mws_from_mws_baud_rates_transport_item);
|
||||
i_transport += 1;
|
||||
}
|
||||
|
||||
proto_tree_add_item(sub2_tree, hf_bthci_evt_mws_from_mws_baud_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
|
||||
offset += 4;
|
||||
}
|
||||
break; }
|
||||
|
||||
case 0x0C7A: /* Write Secure Connections Host Support */
|
||||
case 0x2020: /* LE Remote Connection Parameter Request Reply */
|
||||
case 0x2021: /* LE Remote Connection Parameter Request Negative Reply */
|
||||
case 0x2022: /* LE Set Data Length */
|
||||
case 0x2023: /* LE Read Suggested Default Data Length */
|
||||
case 0x2024: /* LE Write Suggested Default Data Length */
|
||||
case 0x2025: /* LE Read Local P-256 Public Key */
|
||||
case 0x2026: /* LE Generate DHKey */
|
||||
case 0x2027: /* LE Add Device to Resolving List */
|
||||
case 0x2028: /* LE Remove Device From Resolving List */
|
||||
case 0x2029: /* LE Clear Resolving List */
|
||||
case 0x202A: /* LE Read Resolving List Size */
|
||||
case 0x202B: /* LE Read Peer Resolvable Address */
|
||||
case 0x202C: /* LE Read Local Resolvable Address */
|
||||
case 0x202D: /* LE Set Address Resolution Enable */
|
||||
case 0x202E: /* LE Set Resolvable Private Address Timeout */
|
||||
case 0x202F: /* LE Read Maximum Data Length */
|
||||
/* TODO */
|
||||
proto_tree_add_expert(tree, pinfo, &ei_event_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset));
|
||||
offset += tvb_reported_length_remaining(tvb, offset);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
proto_tree_add_expert(tree, pinfo, &ei_event_unknown_command, tvb, offset, tvb_captured_length_remaining(tvb, offset));
|
||||
offset += tvb_reported_length_remaining(tvb, offset);
|
||||
|
@ -4729,6 +4856,12 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
offset = dissect_bthci_evt_amp_status_change(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data);
|
||||
break;
|
||||
|
||||
case 0x56: /* Inquiry Response Notification */
|
||||
proto_tree_add_item(bthci_evt_tree, hf_bthci_evt_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
break;
|
||||
|
||||
case 0x4e: /* Triggered Clock Capture */
|
||||
case 0x4f: /* Synchronization Train Complete */
|
||||
case 0x50: /* Synchronization Train Received */
|
||||
|
@ -4737,7 +4870,6 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
case 0x53: /* Truncated Page Complete */
|
||||
case 0x54: /* Slave Page Response Timeout */
|
||||
case 0x55: /* Connectionless Slave Broadcast Channel Map Change */
|
||||
case 0x56: /* Inquiry Response Notification */
|
||||
case 0xfe: /* Bluetooth Logo Testing */
|
||||
/* TODO: Implement above cases */
|
||||
proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, tvb_captured_length_remaining(tvb, offset));
|
||||
|
@ -6776,6 +6908,61 @@ proto_register_bthci_evt(void)
|
|||
FT_BOOLEAN, 64, NULL, G_GUINT64_CONSTANT(0xFFFFFFFFFFFFFF00),
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_number_of_transports,
|
||||
{ "Number of Transports", "bthci_evt.mws.number_of_transports",
|
||||
FT_UINT8, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_transport_layers,
|
||||
{ "Transport Layers", "bthci_evt.mws.transport_layers",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_transport_layers_item,
|
||||
{ "Transport Layer Item", "bthci_evt.mws.transport_layers.item",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_transport_layer,
|
||||
{ "Transport Layer", "bthci_evt.mws.transport_layers.item.transport_layer",
|
||||
FT_UINT8, BASE_HEX, VALS(mws_transport_layer_vals), 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_number_of_baud_rates,
|
||||
{ "Number of Baud Rates", "bthci_evt.mws.number_of_baud_rates",
|
||||
FT_UINT8, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_to_mws_baud_rates,
|
||||
{ "To MWS Baud Rates", "bthci_evt.mws.to_mws_baud_rates",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_to_mws_baud_rates_tranport_item,
|
||||
{ "To MWS Baud Rates Item", "bthci_evt.mws.to_mws_baud_rates.item",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_to_mws_baud_rate,
|
||||
{ "To MWS Baud Rate", "bthci_evt.mws.to_mws_baud_rates.item.baud_rate",
|
||||
FT_UINT32, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_from_mws_baud_rates,
|
||||
{ "From MWS Baud Rates", "bthci_evt.mws.from_mws_baud_rates",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_from_mws_baud_rates_tranport_item,
|
||||
{ "From MWS Baud Rates Item", "bthci_evt.mws.from_mws_baud_rates.item",
|
||||
FT_NONE, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bthci_evt_mws_from_mws_baud_rate,
|
||||
{ "From MWS Baud Rate", "bthci_evt.mws.from_mws_baud_rates.item.baud_rate",
|
||||
FT_UINT32, BASE_DEC, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
}
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
|
@ -6795,6 +6982,12 @@ proto_register_bthci_evt(void)
|
|||
&ett_le_state_subtree,
|
||||
&ett_le_channel_map,
|
||||
&ett_le_features,
|
||||
&ett_mws_transport_layers,
|
||||
&ett_mws_transport_layers_item,
|
||||
&ett_mws_to_mws_baud_rates,
|
||||
&ett_mws_to_mws_baud_rates_transport_item,
|
||||
&ett_mws_from_mws_baud_rates,
|
||||
&ett_mws_from_mws_baud_rates_transport_item,
|
||||
&ett_expert
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue