aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-mac-lte.c26
-rw-r--r--epan/dissectors/packet-mac-lte.h15
-rw-r--r--gtk/mac_lte_stat_dlg.c59
3 files changed, 68 insertions, 32 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 43e767bbb2..f15d78c791 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -230,8 +230,10 @@ static const value_string bch_transport_channel_vals[] =
static const value_string crc_status_vals[] =
{
- { 0, "Failed"},
- { 1, "OK"},
+ { crc_success, "OK"},
+ { crc_fail, "Failed"},
+ { crc_high_code_rate, "High Code Rate"},
+ { crc_pdsch_lost, "PDSCH Lost"},
{ 0, NULL }
};
@@ -510,6 +512,7 @@ static const value_string predefined_frame_vals[] =
};
+
/**************************************************************************/
/* Preferences state */
/**************************************************************************/
@@ -3017,13 +3020,19 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_uint(context_tree, hf_mac_lte_context_crc_status,
tvb, 0, 0, p_mac_lte_info->detailed_phy_info.dl_info.crc_status);
PROTO_ITEM_SET_GENERATED(ti);
- if (p_mac_lte_info->detailed_phy_info.dl_info.crc_status != TRUE) {
+ if (p_mac_lte_info->detailed_phy_info.dl_info.crc_status != crc_success) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
- "%s Frame has CRC error",
- (p_mac_lte_info->direction == DIRECTION_UPLINK) ? "UL" : "DL");
+ "%s Frame has CRC error problem (%s)",
+ (p_mac_lte_info->direction == DIRECTION_UPLINK) ? "UL" : "DL",
+ val_to_str_const(p_mac_lte_info->detailed_phy_info.dl_info.crc_status,
+ crc_status_vals,
+ "Unknown"));
write_pdu_label_and_info(pdu_ti, NULL, pinfo,
- "%s: <CRC FAILURE> UEId=%u %s=%u ",
+ "%s: <CRC %s> UEId=%u %s=%u ",
(p_mac_lte_info->direction == DIRECTION_UPLINK) ? "UL" : "DL",
+ val_to_str_const(p_mac_lte_info->detailed_phy_info.dl_info.crc_status,
+ crc_status_vals,
+ "Unknown"),
p_mac_lte_info->ueid,
val_to_str_const(p_mac_lte_info->rntiType, rnti_type_vals,
"Unknown RNTI type"),
@@ -3066,7 +3075,8 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* IF CRC status failed, just do decode as raw bytes */
if (!global_mac_lte_dissect_crc_failures &&
- (p_mac_lte_info->crcStatusValid && !p_mac_lte_info->detailed_phy_info.dl_info.crc_status)) {
+ (p_mac_lte_info->crcStatusValid &&
+ (p_mac_lte_info->detailed_phy_info.dl_info.crc_status != crc_success))) {
proto_tree_add_item(mac_lte_tree, hf_mac_lte_raw_pdu, tvb, offset, -1, FALSE);
write_pdu_label_and_info(pdu_ti, NULL, pinfo, "Raw data (%u bytes)", tvb_length_remaining(tvb, offset));
@@ -3497,7 +3507,7 @@ void proto_register_mac_lte(void)
{ &hf_mac_lte_raw_pdu,
{ "Raw data",
"mac-lte.raw-data", FT_BYTES, BASE_NONE, 0, 0x0,
- "Raw bytes of PDU (e.g. if CRC failed)", HFILL
+ "Raw bytes of PDU (e.g. if CRC error)", HFILL
}
},
{ &hf_mac_lte_padding_data,
diff --git a/epan/dissectors/packet-mac-lte.h b/epan/dissectors/packet-mac-lte.h
index 540d3af59b..94add011db 100644
--- a/epan/dissectors/packet-mac-lte.h
+++ b/epan/dissectors/packet-mac-lte.h
@@ -77,6 +77,13 @@ typedef enum mac_lte_dl_retx {
dl_retx_unknown
} mac_lte_dl_retx;
+typedef enum mac_lte_crc_status {
+ crc_fail = 0,
+ crc_success = 1,
+ crc_high_code_rate = 2,
+ crc_pdsch_lost = 3
+} mac_lte_crc_status;
+
/* Context info attached to each LTE MAC frame */
typedef struct mac_lte_info
{
@@ -94,7 +101,7 @@ typedef struct mac_lte_info
gboolean isPredefinedData;
guint16 length;
guint8 reTxCount; /* UL */
- guint8 crcStatusValid;
+ mac_lte_crc_status crcStatusValid;
mac_lte_dl_retx dl_retx;
@@ -116,8 +123,8 @@ typedef struct mac_lte_info
guint8 aggregation_level;
guint8 mcs_index;
guint8 redundancy_version_index;
- guint8 resource_block_length;
- guint8 crc_status;
+ guint8 resource_block_length;
+ mac_lte_crc_status crc_status;
} dl_info;
} detailed_phy_info;
@@ -135,7 +142,7 @@ typedef struct mac_lte_tap_info {
guint8 rntiType;
guint8 isPredefinedData;
guint8 crcStatusValid;
- guint8 crcStatus;
+ mac_lte_crc_status crcStatus;
guint8 direction;
guint8 isPHYRetx;
diff --git a/gtk/mac_lte_stat_dlg.c b/gtk/mac_lte_stat_dlg.c
index 88b17dd46a..6f788ca000 100644
--- a/gtk/mac_lte_stat_dlg.c
+++ b/gtk/mac_lte_stat_dlg.c
@@ -68,12 +68,13 @@ enum {
UL_BYTES_COLUMN,
UL_BW_COLUMN,
UL_PADDING_PERCENT_COLUMN,
- UL_CRC_ERRORS_COLUMN,
UL_RETX_FRAMES_COLUMN,
DL_FRAMES_COLUMN,
DL_BYTES_COLUMN,
DL_BW_COLUMN,
- DL_CRC_ERRORS_COLUMN,
+ DL_CRC_FAILED_COLUMN,
+ DL_CRC_HIGH_CODE_RATE_COLUMN,
+ DL_CRC_PDSCH_LOST_COLUMN,
DL_RETX_FRAMES_COLUMN,
TABLE_COLUMN,
NUM_UE_COLUMNS
@@ -96,8 +97,8 @@ enum {
};
static const gchar *ue_titles[] = { "RNTI", "Type", "UEId",
- "UL Frames", "UL Bytes", "UL MBit/sec", "UL Padding %", "UL CRC Errors", "UL ReTX Frames",
- "DL Frames", "DL Bytes", "DL MBit/sec", "DL CRC Errors", "DL ReTX Frames"};
+ "UL Frames", "UL Bytes", "UL MBit/sec", "UL Padding %", "UL ReTX",
+ "DL Frames", "DL Bytes", "DL MBit/sec", "DL CRC Failed", "DL CRC High Code Rate", "DL CRC PSSCH Lost", "DL ReTX"};
static const gchar *channel_titles[] = { "CCCH",
"LCID 1", "LCID 2", "LCID 3", "LCID 4", "LCID 5",
@@ -127,7 +128,9 @@ typedef struct mac_lte_row_data {
guint32 DL_total_bytes;
nstime_t DL_time_start;
nstime_t DL_time_stop;
- guint32 DL_CRC_errors;
+ guint32 DL_CRC_failures;
+ guint32 DL_CRC_high_code_rate;
+ guint32 DL_CRC_PDSCH_lost;
guint32 DL_retx_frames;
guint32 UL_bytes_for_lcid[11];
@@ -276,7 +279,9 @@ static mac_lte_ep_t* alloc_mac_lte_ep(struct mac_lte_tap_info *si, packet_info *
ep->stats.UL_padding_bytes = 0;
ep->stats.DL_total_bytes = 0;
ep->stats.UL_CRC_errors = 0;
- ep->stats.DL_CRC_errors = 0;
+ ep->stats.DL_CRC_failures = 0;
+ ep->stats.DL_CRC_high_code_rate = 0;
+ ep->stats.DL_CRC_PDSCH_lost = 0;
ep->stats.UL_retx_frames = 0;
ep->stats.DL_retx_frames = 0;
@@ -402,16 +407,6 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Update entry with details from si */
te->stats.rnti = si->rnti;
te->stats.is_predefined_data = si->isPredefinedData;
- if (si->crcStatusValid && !si->crcStatus) {
- if (si->direction == DIRECTION_UPLINK) {
- te->stats.UL_CRC_errors++;
- return 1;
- }
- else {
- te->stats.DL_CRC_errors++;
- return 1;
- }
- }
/* Uplink */
if (si->direction == DIRECTION_UPLINK) {
@@ -420,6 +415,11 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
return 1;
}
+ if (si->crcStatusValid && (si->crcStatus != crc_success)) {
+ te->stats.UL_CRC_errors++;
+ return 1;
+ }
+
/* Update time range */
if (te->stats.UL_frames == 0) {
te->stats.UL_time_start = si->time;
@@ -452,6 +452,24 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
return 1;
}
+ if (si->crcStatusValid && (si->crcStatus != crc_success)) {
+ switch (si->crcStatus) {
+ case crc_fail:
+ te->stats.DL_CRC_failures++;
+ break;
+ case crc_high_code_rate:
+ te->stats.DL_CRC_high_code_rate++;
+ break;
+ case crc_pdsch_lost:
+ te->stats.DL_CRC_PDSCH_lost++;
+ break;
+ default:
+ /* Something went wrong! */
+ break;
+ }
+ return 1;
+ }
+
/* Update time range */
if (te->stats.DL_frames == 0) {
te->stats.DL_time_start = si->time;
@@ -662,12 +680,13 @@ mac_lte_stat_draw(void *phs)
tmp->stats.UL_total_bytes ?
(((float)tmp->stats.UL_padding_bytes / (float)tmp->stats.UL_raw_bytes) * 100.0) :
0.0,
- UL_CRC_ERRORS_COLUMN, tmp->stats.UL_CRC_errors,
UL_RETX_FRAMES_COLUMN, tmp->stats.UL_retx_frames,
DL_FRAMES_COLUMN, tmp->stats.DL_frames,
DL_BYTES_COLUMN, tmp->stats.DL_total_bytes,
DL_BW_COLUMN, DL_bw,
- DL_CRC_ERRORS_COLUMN, tmp->stats.DL_CRC_errors,
+ DL_CRC_FAILED_COLUMN, tmp->stats.DL_CRC_failures,
+ DL_CRC_HIGH_CODE_RATE_COLUMN, tmp->stats.DL_CRC_high_code_rate,
+ DL_CRC_PDSCH_LOST_COLUMN, tmp->stats.DL_CRC_PDSCH_lost,
DL_RETX_FRAMES_COLUMN, tmp->stats.DL_retx_frames,
TABLE_COLUMN, tmp,
-1);
@@ -925,8 +944,8 @@ static void gtk_mac_lte_stat_init(const char *optarg, void *userdata _U_)
/* Create the table of UE data */
store = gtk_list_store_new(NUM_UE_COLUMNS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT,
- G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_INT, G_TYPE_INT, /* UL */
- G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_INT, G_TYPE_INT, /* DL */
+ G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_FLOAT, G_TYPE_INT, /* UL */
+ G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, /* DL */
G_TYPE_POINTER);
hs->ue_table = GTK_TREE_VIEW(tree_view_new(GTK_TREE_MODEL(store)));
gtk_container_add(GTK_CONTAINER (ues_scrolled_window), GTK_WIDGET(hs->ue_table));