- Make FP radio division mode/speed explicit in struct for R7

- Various R7 fixes












svn path=/trunk/; revision=25425
This commit is contained in:
Martin Mathieson 2008-06-04 17:33:48 +00:00
parent 5d522be77d
commit acd6d3fb35
4 changed files with 108 additions and 16 deletions

View File

@ -765,12 +765,17 @@ void attach_fp_info(packet_info *pinfo, gboolean received, const char *protocol_
/* Channel type */ /* Channel type */
p_fp_info->channel = outhdr_values[i++]; p_fp_info->channel = outhdr_values[i++];
/* Node type */ /* Derive direction from node type/side */
node_type = outhdr_values[i++]; node_type = outhdr_values[i++];
p_fp_info->is_uplink = (( received && (node_type == 2)) || p_fp_info->is_uplink = (( received && (node_type == 2)) ||
(!received && (node_type == 1))); (!received && (node_type == 1)));
/* Division type introduced for R7 */
if (p_fp_info->release == 7)
{
p_fp_info->division = outhdr_values[i++];
}
/* HS-DSCH config */ /* HS-DSCH config */
if (p_fp_info->channel == CHANNEL_HSDSCH) if (p_fp_info->channel == CHANNEL_HSDSCH)
{ {

View File

@ -98,6 +98,9 @@ fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint32 length)
if (!p_fp_info || length < 22) if (!p_fp_info || length < 22)
return; return;
/* Store division type */
p_fp_info->division = radio_mode;
/* Format used by K15, later fields are shifted by 8 bytes. */ /* Format used by K15, later fields are shifted by 8 bytes. */
if (pntohs(extra_info+2) == 5) if (pntohs(extra_info+2) == 5)
adj = 8; adj = 8;
@ -165,9 +168,12 @@ fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint32 length)
if (info_type == 0x30) { /* data frame */ if (info_type == 0x30) { /* data frame */
p_fp_info->num_chans = extra_info[23 + adj]; p_fp_info->num_chans = extra_info[23 + adj];
/* For each channel */
for (i = 0; i < (guint)p_fp_info->num_chans && (36+i*104+adj) <= length; ++i) { for (i = 0; i < (guint)p_fp_info->num_chans && (36+i*104+adj) <= length; ++i) {
/* Read TB size */
p_fp_info->chan_tf_size[i] = pntohl(extra_info+28+i*104+adj); p_fp_info->chan_tf_size[i] = pntohl(extra_info+28+i*104+adj);
if (p_fp_info->chan_tf_size[i]) if (p_fp_info->chan_tf_size[i])
/* Work out number of TBs on this channel */
p_fp_info->chan_num_tbs[i] = pntohl(extra_info+32+i*104+adj) p_fp_info->chan_num_tbs[i] = pntohl(extra_info+32+i*104+adj)
/ p_fp_info->chan_tf_size[i]; / p_fp_info->chan_tf_size[i];
} }

View File

@ -45,6 +45,7 @@
int proto_fp = -1; int proto_fp = -1;
static int hf_fp_channel_type = -1; static int hf_fp_channel_type = -1;
static int hf_fp_division = -1;
static int hf_fp_direction = -1; static int hf_fp_direction = -1;
static int hf_fp_header_crc = -1; static int hf_fp_header_crc = -1;
static int hf_fp_ft = -1; static int hf_fp_ft = -1;
@ -192,6 +193,16 @@ static const value_string channel_type_vals[] =
{ 0, NULL } { 0, NULL }
}; };
static const value_string division_vals[] =
{
{ Division_FDD, "FDD"},
{ Division_TDD_384, "TDD-384"},
{ Division_TDD_128, "TDD-128"},
{ Division_TDD_768, "TDD-768"},
{ 0, NULL }
};
static const value_string data_control_vals[] = { static const value_string data_control_vals[] = {
{ 0, "Data" }, { 0, "Data" },
{ 1, "Control" }, { 1, "Control" },
@ -1277,15 +1288,27 @@ void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Bit 0 indicates Cell Portion ID */ /* Bit 0 indicates Cell Portion ID */
if (flags & 0x01) { if (flags & 0x01) {
proto_tree_add_item(tree, hf_fp_cell_portion_id, tvb, offset, 1, FALSE); if (p_fp_info->division == Division_FDD)
offset++; {
proto_tree_add_item(tree, hf_fp_cell_portion_id, tvb, offset, 1, FALSE);
offset++;
}
else
{
/* Wrong mode - warn + expert item. */
proto_item *ti = proto_tree_add_text(tree, tvb, 0, 0, "Error: Cell Portion ID indicated, but not in FDD mode");
PROTO_ITEM_SET_GENERATED(ti);
expert_add_info_format(pinfo, ti,
PI_MALFORMED, PI_WARN,
"Cell Portion ID indicated, but not in FDD mode");
}
} }
/* Bit 1 indicates Ext propagation delay. /* Bit 1 indicates Ext propagation delay.
TODO: add expert info item if flag set but a TDD channel... */ TODO: add expert info item if flag set but a TDD channel... */
if ((flags & 0x20) & (propagation_delay_ti != NULL)) { if ((flags & 0x02) && (propagation_delay_ti != NULL)) {
guint16 extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff; guint16 extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff;
proto_tree_add_item(tree, hf_fp_ext_propagation_delay, tvb, offset, 1, FALSE); proto_tree_add_item(tree, hf_fp_ext_propagation_delay, tvb, offset, 2, FALSE);
/* Adding 10 bits to original 8 */ /* Adding 10 bits to original 8 */
proto_item_append_text(propagation_delay_ti, " (extended to %u)", proto_item_append_text(propagation_delay_ti, " (extended to %u)",
@ -1799,8 +1822,30 @@ int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
/* Optional E-RUCCH */ /* Optional E-RUCCH */
if (e_rucch_present) if (e_rucch_present)
{ {
/* TODO: 6 for 3.84, 5 for 7.68 */ /* Value of bit_offset depends upon division type */
int bit_offset = 6; int bit_offset;
switch (p_fp_info->division)
{
case Division_TDD_384:
bit_offset = 6;
break;
case Division_TDD_768:
bit_offset = 5;
break;
default:
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, 0,
"Error: expecting TDD-384 or TDD-768");
PROTO_ITEM_SET_GENERATED(ti);
expert_add_info_format(pinfo, ti,
PI_MALFORMED, PI_NOTE,
"Error: expecting TDD-384 or TDD-768");
bit_offset = 6;
}
}
proto_tree_add_item(tree, hf_fp_dch_e_rucch_flag, tvb, offset, 1, FALSE); proto_tree_add_item(tree, hf_fp_dch_e_rucch_flag, tvb, offset, 1, FALSE);
proto_tree_add_bits_item(tree, hf_fp_dch_e_rucch_flag, tvb, proto_tree_add_bits_item(tree, hf_fp_dch_e_rucch_flag, tvb,
offset*8 + bit_offset, 1, FALSE); offset*8 + bit_offset, 1, FALSE);
@ -1812,11 +1857,25 @@ int dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
*/ */
if (extended_bits_present) if (extended_bits_present)
{ {
/* TODO: 1 for 3.84, 2 for 7.68, */ guint8 extra_bits;
guint bits_to_extend = 1; guint bits_to_extend;
guint8 extra_bits = tvb_get_guint8(tvb, offset) & switch (p_fp_info->division)
(bits_to_extend == 1) ? 0x01 : 0x3; {
timing_deviation = (timing_deviation) | (extra_bits << 8); case Division_TDD_384:
bits_to_extend = 1;
break;
case Division_TDD_768:
bits_to_extend = 2;
break;
default:
/* TODO: report unexpected division type */
bits_to_extend = 1;
break;
}
extra_bits = tvb_get_guint8(tvb, offset) &
(bits_to_extend == 1) ? 0x01 : 0x3;
timing_deviation = (extra_bits << 8) | (timing_deviation);
proto_item_append_text(timing_deviation_ti, proto_item_append_text(timing_deviation_ti,
" (extended to 0x%x)", " (extended to 0x%x)",
timing_deviation); timing_deviation);
@ -2756,6 +2815,13 @@ void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_uint(fp_tree, hf_fp_channel_type, tvb, 0, 0, p_fp_info->channel); ti = proto_tree_add_uint(fp_tree, hf_fp_channel_type, tvb, 0, 0, p_fp_info->channel);
PROTO_ITEM_SET_GENERATED(ti); PROTO_ITEM_SET_GENERATED(ti);
/* Add division type as a generated field */
if (p_fp_info->release == 7)
{
ti = proto_tree_add_uint(fp_tree, hf_fp_division, tvb, 0, 0, p_fp_info->division);
PROTO_ITEM_SET_GENERATED(ti);
}
/* Add link direction as a generated field */ /* Add link direction as a generated field */
ti = proto_tree_add_uint(fp_tree, hf_fp_direction, tvb, 0, 0, p_fp_info->is_uplink); ti = proto_tree_add_uint(fp_tree, hf_fp_direction, tvb, 0, 0, p_fp_info->is_uplink);
PROTO_ITEM_SET_GENERATED(ti); PROTO_ITEM_SET_GENERATED(ti);
@ -2844,6 +2910,12 @@ void proto_register_fp(void)
"Channel Type", HFILL "Channel Type", HFILL
} }
}, },
{ &hf_fp_division,
{ "Division",
"fp.division", FT_UINT8, BASE_HEX, VALS(division_vals), 0x0,
"Radio division type", HFILL
}
},
{ &hf_fp_direction, { &hf_fp_direction,
{ "Direction", { "Direction",
"fp.direction", FT_UINT8, BASE_HEX, VALS(direction_vals), 0x0, "fp.direction", FT_UINT8, BASE_HEX, VALS(direction_vals), 0x0,
@ -3506,7 +3578,7 @@ void proto_register_fp(void)
}, },
{ &hf_fp_ext_propagation_delay, { &hf_fp_ext_propagation_delay,
{ "Ext Propagation Delay", { "Ext Propagation Delay",
"fp.ext-propagation-delay", FT_UINT8, BASE_DEC, NULL, 0x0, "fp.ext-propagation-delay", FT_UINT16, BASE_DEC, NULL, 0x03ff,
"Ext Propagation Delay", HFILL "Ext Propagation Delay", HFILL
} }
}, },

View File

@ -40,7 +40,7 @@
#define CHANNEL_IUR_FACH 15 #define CHANNEL_IUR_FACH 15
#define CHANNEL_IUR_DSCH 16 #define CHANNEL_IUR_DSCH 16
#define CHANNEL_EDCH 17 #define CHANNEL_EDCH 17
#define CHANNEL_RACH_TDD_128 65 #define CHANNEL_RACH_TDD_128 66
enum fp_interface_type enum fp_interface_type
{ {
@ -48,6 +48,14 @@ enum fp_interface_type
IuR_Interface IuR_Interface
}; };
enum division_type
{
Division_FDD=1,
Division_TDD_384=2,
Division_TDD_128=3,
Division_TDD_768=4
};
enum fp_hsdsch_entity enum fp_hsdsch_entity
{ {
entity_not_specified=0, entity_not_specified=0,
@ -59,7 +67,8 @@ enum fp_hsdsch_entity
typedef struct fp_info typedef struct fp_info
{ {
enum fp_interface_type iface_type; enum fp_interface_type iface_type;
guint8 release; /* e.g. 99, 4, 5, 6 */ enum division_type division;
guint8 release; /* e.g. 99, 4, 5, 6, 7 */
guint16 release_year; /* e.g. 2001 */ guint16 release_year; /* e.g. 2001 */
guint8 release_month; /* e.g. 12 for December */ guint8 release_month; /* e.g. 12 for December */
gboolean is_uplink; gboolean is_uplink;