1 /* Routines for UMTS FP disassembly
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 #include <epan/packet.h>
31 #include <epan/expert.h>
33 #include "packet-umts_fp.h"
36 - remaining message types
37 - verify header & payload CRCs
38 - look for (and report as expert info) spare extension bytes
41 /* Initialize the protocol and registered fields. */
44 static int hf_fp_channel_type = -1;
45 static int hf_fp_direction = -1;
46 static int hf_fp_header_crc = -1;
47 static int hf_fp_ft = -1;
48 static int hf_fp_cfn = -1;
49 static int hf_fp_pch_cfn = -1;
50 static int hf_fp_pch_toa = -1;
51 static int hf_fp_cfn_control = -1;
52 static int hf_fp_toa = -1;
53 static int hf_fp_tfi = -1;
54 static int hf_fp_usch_tfi = -1;
55 static int hf_fp_cpch_tfi = -1;
56 static int hf_fp_propagation_delay = -1;
57 static int hf_fp_tb = -1;
58 static int hf_fp_received_sync_ul_timing_deviation = -1;
59 static int hf_fp_pch_pi = -1;
60 static int hf_fp_pch_tfi = -1;
61 static int hf_fp_fach_tfi = -1;
62 static int hf_fp_transmit_power_level = -1;
63 static int hf_fp_paging_indication_bitmap = -1;
64 static int hf_fp_pdsch_set_id = -1;
65 static int hf_fp_rx_timing_deviation = -1;
66 static int hf_fp_dch_control_frame_type = -1;
67 static int hf_fp_dch_rx_timing_deviation = -1;
68 static int hf_fp_quality_estimate = -1;
69 static int hf_fp_payload_crc = -1;
70 static int hf_fp_edch_header_crc = -1;
71 static int hf_fp_edch_fsn = -1;
72 static int hf_fp_edch_subframe = -1;
73 static int hf_fp_edch_number_of_subframes = -1;
74 static int hf_fp_edch_harq_retransmissions = -1;
75 static int hf_fp_edch_subframe_number = -1;
76 static int hf_fp_edch_number_of_mac_es_pdus = -1;
77 static int hf_fp_edch_ddi = -1;
78 static int hf_fp_edch_subframe_header = -1;
79 static int hf_fp_edch_number_of_mac_d_pdus = -1;
80 static int hf_fp_edch_pdu_padding = -1;
81 static int hf_fp_edch_tsn = -1;
82 static int hf_fp_edch_mac_es_pdu = -1;
83 static int hf_fp_cmch_pi = -1;
84 static int hf_fp_user_buffer_size = -1;
85 static int hf_fp_hsdsch_credits = -1;
86 static int hf_fp_hsdsch_max_macd_pdu_len = -1;
87 static int hf_fp_hsdsch_interval = -1;
88 static int hf_fp_hsdsch_repetition_period = -1;
89 static int hf_fp_hsdsch_data_padding = -1;
90 static int hf_fp_hsdsch_new_ie_flags = -1;
91 static int hf_fp_hsdsch_new_ie_flag[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
92 static int hf_fp_hsdsch_drt = -1;
93 static int hf_fp_timing_advance = -1;
94 static int hf_fp_num_of_pdu = -1;
95 static int hf_fp_mac_d_pdu_len = -1;
96 static int hf_fp_mac_d_pdu = -1;
97 static int hf_fp_data = -1;
98 static int hf_fp_crcis = -1;
99 static int hf_fp_crci[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
100 static int hf_fp_common_control_frame_type = -1;
101 static int hf_fp_t1 = -1;
102 static int hf_fp_t2 = -1;
103 static int hf_fp_t3 = -1;
104 static int hf_fp_ul_sir_target = -1;
105 static int hf_fp_pusch_set_id = -1;
106 static int hf_fp_activation_cfn = -1;
107 static int hf_fp_duration = -1;
108 static int hf_fp_power_offset = -1;
109 static int hf_fp_code_number = -1;
110 static int hf_fp_spreading_factor = -1;
111 static int hf_fp_mc_info = -1;
112 static int hf_fp_rach_new_ie_flags = -1;
113 static int hf_fp_rach_new_ie_flag[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
114 static int hf_fp_cell_portion_id = -1;
115 static int hf_fp_radio_interface_parameter_update_flag[5] = {-1, -1, -1, -1, -1};
116 static int hf_fp_dpc_mode = -1;
117 static int hf_fp_tpc_po = -1;
118 static int hf_fp_multiple_rl_set_indicator = -1;
119 static int hf_fp_max_ue_tx_pow = -1;
120 static int hf_fp_congestion_status = -1;
123 static int ett_fp = -1;
124 static int ett_fp_data = -1;
125 static int ett_fp_crcis = -1;
126 static int ett_fp_edch_subframe_header = -1;
127 static int ett_fp_edch_subframe = -1;
128 static int ett_fp_hsdsch_new_ie_flags = -1;
129 static int ett_fp_rach_new_ie_flags = -1;
132 /* E-DCH channel header information */
135 guint8 subframe_number;
136 guint8 number_of_mac_es_pdus;
138 guint16 number_of_mac_d_pdus[64];
142 static const value_string channel_type_vals[] =
144 { CHANNEL_RACH_FDD, "RACH_FDD" },
145 { CHANNEL_RACH_TDD, "RACH_TDD" },
146 { CHANNEL_FACH_FDD, "FACH_FDD" },
147 { CHANNEL_FACH_TDD, "FACH_TDD" },
148 { CHANNEL_DSCH_FDD, "DSCH_FDD" },
149 { CHANNEL_DSCH_TDD, "DSCH_TDD" },
150 { CHANNEL_USCH_TDD_384, "USCH_TDD_384" },
151 { CHANNEL_USCH_TDD_128, "USCH_TDD_128" },
152 { CHANNEL_PCH, "PCH" },
153 { CHANNEL_CPCH, "CPCH" },
154 { CHANNEL_BCH, "BCH" },
155 { CHANNEL_DCH, "DCH" },
156 { CHANNEL_HSDSCH, "HSDSCH" },
157 { CHANNEL_IUR_CPCHF, "IUR CPCHF" },
158 { CHANNEL_IUR_FACH, "IUR FACH" },
159 { CHANNEL_IUR_DSCH, "IUR DSCH" },
160 { CHANNEL_EDCH, "EDCH" },
161 { CHANNEL_RACH_TDD_128, "RACH_TDD_128" },
165 static const value_string data_control_vals[] = {
171 static const value_string direction_vals[] = {
177 static const value_string crci_vals[] = {
179 { 1, "Not correct" },
183 static const value_string paging_indication_vals[] = {
184 { 0, "no PI-bitmap in payload" },
185 { 1, "PI-bitmap in payload" },
189 static const value_string spreading_factor_vals[] = {
200 static const value_string congestion_status_vals[] = {
201 {0, "No TNL congestion"},
202 {1, "Reserved for future use"},
203 {2, "TNL congestion - detected by delay build-up"},
204 {3, "TNL congestion - detected by frame loss"},
209 /* DCH control types */
210 #define DCH_OUTER_LOOP_POWER_CONTROL 1
211 #define DCH_TIMING_ADJUSTMENT 2
212 #define DCH_DL_SYNCHRONISATION 3
213 #define DCH_UL_SYNCHRONISATION 4
215 #define DCH_DL_NODE_SYNCHRONISATION 6
216 #define DCH_UL_NODE_SYNCHRONISATION 7
217 #define DCH_RX_TIMING_DEVIATION 8
218 #define DCH_RADIO_INTERFACE_PARAMETER_UPDATE 9
219 #define DCH_TIMING_ADVANCE 10
220 #define DCH_TNL_CONGESTION_INDICATION 11
222 static const value_string dch_control_frame_type_vals[] = {
223 { DCH_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" },
224 { DCH_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" },
225 { DCH_DL_SYNCHRONISATION, "DL SYNCHRONISATION" },
226 { DCH_UL_SYNCHRONISATION, "UL SYNCHRONISATION" },
227 { 5, "Reserved Value" },
228 { DCH_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" },
229 { DCH_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" },
230 { DCH_RX_TIMING_DEVIATION, "RX TIMING DEVIATION" },
231 { DCH_RADIO_INTERFACE_PARAMETER_UPDATE, "RADIO INTERFACE PARAMETER UPDATE" },
232 { DCH_TIMING_ADVANCE, "TIMING ADVANCE" },
233 { DCH_TNL_CONGESTION_INDICATION, "TNL CONGESTION INDICATION" },
238 /* Common channel control types */
239 #define COMMON_OUTER_LOOP_POWER_CONTROL 1
240 #define COMMON_TIMING_ADJUSTMENT 2
241 #define COMMON_DL_SYNCHRONISATION 3
242 #define COMMON_UL_SYNCHRONISATION 4
244 #define COMMON_DL_NODE_SYNCHRONISATION 6
245 #define COMMON_UL_NODE_SYNCHRONISATION 7
246 #define COMMON_DYNAMIC_PUSCH_ASSIGNMENT 8
247 #define COMMON_TIMING_ADVANCE 9
248 #define COMMON_HS_DSCH_Capacity_Request 10
249 #define COMMON_HS_DSCH_Capacity_Allocation 11
251 static const value_string common_control_frame_type_vals[] = {
252 { COMMON_OUTER_LOOP_POWER_CONTROL, "OUTER LOOP POWER CONTROL" },
253 { COMMON_TIMING_ADJUSTMENT, "TIMING ADJUSTMENT" },
254 { COMMON_DL_SYNCHRONISATION, "DL SYNCHRONISATION" },
255 { COMMON_UL_SYNCHRONISATION, "UL SYNCHRONISATION" },
256 { 5, "Reserved Value" },
257 { COMMON_DL_NODE_SYNCHRONISATION, "DL NODE SYNCHRONISATION" },
258 { COMMON_UL_NODE_SYNCHRONISATION, "UL NODE SYNCHRONISATION" },
259 { COMMON_DYNAMIC_PUSCH_ASSIGNMENT, "DYNAMIC PUSCH ASSIGNMENT" },
260 { COMMON_TIMING_ADVANCE, "TIMING ADVANCE" },
261 { COMMON_HS_DSCH_Capacity_Request, "HS-DSCH Capacity Request" },
262 { COMMON_HS_DSCH_Capacity_Allocation, "HS-DSCH Capacity Allocation" },
266 /* Dissect message parts */
267 static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
268 int offset, struct _fp_info *p_fp_info, int *num_tbs);
269 static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
270 int offset, guint16 length, guint8 number_of_pdus);
271 static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
272 int num_tbs, int offset);
274 /* Dissect common control messages */
275 static void dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
276 int offset, struct _fp_info *p_fp_info);
277 static void dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree,
278 tvbuff_t *tvb, int offset);
279 static void dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree,
280 tvbuff_t *tvb, int offset);
281 static void dissect_common_dl_syncronisation(packet_info *pinfo, proto_tree *tree,
282 tvbuff_t *tvb, int offset,
283 struct _fp_info *p_fp_info);
284 static void dissect_common_ul_syncronisation(packet_info *pinfo, proto_tree *tree,
285 tvbuff_t *tvb, int offset,
286 struct _fp_info *p_fp_info);
287 static void dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree,
288 tvbuff_t *tvb, int offset);
289 static void dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree,
290 tvbuff_t *tvb, int offset);
291 static void dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
292 tvbuff_t *tvb, int offset);
293 static void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
294 int offset, struct _fp_info *p_fp_info);
295 static void dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree,
296 tvbuff_t *tvb, int offset);
298 /* Dissect common channel types */
299 static void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
300 int offset, struct _fp_info *p_fp_info);
301 static void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
302 int offset, struct _fp_info *p_fp_info);
303 static void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
304 int offset, struct _fp_info *p_fp_info);
305 static void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
306 int offset, struct _fp_info *p_fp_info);
307 static void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
308 int offset, struct _fp_info *p_fp_info);
309 static void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
310 int offset, struct _fp_info *p_fp_info);
311 static void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
312 int offset, struct _fp_info *p_fp_info _U_);
313 static void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
314 int offset, struct _fp_info *p_fp_info);
317 /* Dissect DCH control messages */
318 static void dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo,
319 tvbuff_t *tvb, int offset);
320 static void dissect_dch_rx_timing_deviation(proto_tree *tree, tvbuff_t *tvb, int offset);
321 static void dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo,
322 tvbuff_t *tvb, int offset);
323 static void dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo,
324 tvbuff_t *tvb, int offset);
325 static void dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo,
326 tvbuff_t *tvb, int offset);
327 static void dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo,
328 tvbuff_t *tvb, int offset);
329 static void dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo,
330 tvbuff_t *tvb, int offset);
331 static void dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo,
332 tvbuff_t *tvb, int offset);
333 static void dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
334 tvbuff_t *tvb, int offset);
335 static void dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo,
336 tvbuff_t *tvb, int offset);
339 static void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
343 /* Dissect a DCH channel */
344 static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
345 int offset, struct _fp_info *p_fp_info);
347 /* Dissect dedicated channels */
348 static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
349 int offset, struct _fp_info *p_fp_info);
350 static void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
352 void proto_register_fp(void);
353 void proto_reg_handoff_fp(void);
358 /* Dissect the TBs of a data frame */
359 int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
360 int offset, struct _fp_info *p_fp_info, int *num_tbs)
365 proto_item *ti = NULL;
366 proto_tree *data_tree = NULL;
370 /* Add data subtree */
371 ti = proto_tree_add_string_format(tree, hf_fp_data, tvb, offset, 0,
373 "TB data for %u chans",
374 p_fp_info->num_chans);
375 data_tree = proto_item_add_subtree(ti, ett_fp_data);
378 /* Now for the TB data */
379 for (chan=0; chan < p_fp_info->num_chans; chan++)
382 for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++)
387 ti = proto_tree_add_item(data_tree, hf_fp_tb, tvb,
388 offset + (bit_offset/8),
389 ((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8,
391 proto_item_append_text(ti, " (chan %u, tb %u, %u bits)",
392 chan+1, n+1, p_fp_info->chan_tf_size[chan]);
396 /* Advance bit offset */
397 bit_offset += p_fp_info->chan_tf_size[chan];
398 data_bits += p_fp_info->chan_tf_size[chan];
400 /* Pad out to next byte */
403 bit_offset += (8 - (bit_offset % 8));
408 if (check_col(pinfo->cinfo, COL_INFO))
410 col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)",
411 data_bits, *num_tbs);
414 /* Data tree should cover entire length */
417 proto_item_set_len(data_tree, bit_offset/8);
418 proto_item_append_text(ti, " (%u bits in %u tbs)", data_bits, *num_tbs);
421 /* Move offset past TBs (we know its already padded out to next byte) */
422 offset += (bit_offset / 8);
428 /* Dissect the MAC-d PDUs of an HS-DSCH frame */
429 int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
430 int offset, guint16 length, guint8 number_of_pdus)
434 proto_item *ti = NULL;
435 proto_tree *data_tree = NULL;
437 /* Add data subtree */
440 ti = proto_tree_add_string_format(tree, hf_fp_data, tvb, offset, 0,
442 "%u MAC-d PDUs of %u bits",
445 data_tree = proto_item_add_subtree(ti, ett_fp_data);
448 /* Now for the PDUs */
449 for (pdu=0; pdu < number_of_pdus; pdu++)
455 /* Show 4 bits padding at start of PDU */
456 proto_tree_add_item(data_tree, hf_fp_hsdsch_data_padding, tvb, offset+(bit_offset/8), 1, FALSE);
463 ti = proto_tree_add_item(data_tree, hf_fp_mac_d_pdu, tvb,
464 offset + (bit_offset/8),
465 ((bit_offset % 8) + length + 7) / 8,
467 proto_item_append_text(ti, " (PDU %u)", pdu+1);
470 /* Advance bit offset */
471 bit_offset += length;
473 /* Pad out to next byte */
476 bit_offset += (8 - (bit_offset % 8));
480 /* Data tree should cover entire length */
481 proto_item_set_len(data_tree, bit_offset/8);
483 /* Move offset past PDUs (we know its already padded out to next byte) */
484 offset += (bit_offset / 8);
486 /* Show summary in info column */
487 if (check_col(pinfo->cinfo, COL_INFO))
489 col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
490 number_of_pdus, length);
497 /* Dissect CRCI bits (uplink) */
498 int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
499 int num_tbs, int offset)
502 proto_item *ti = NULL;
503 proto_tree *crcis_tree = NULL;
506 /* Add CRCIs subtree */
509 ti = proto_tree_add_string_format(tree, hf_fp_crcis, tvb, offset, 0,
511 "CRCI bits for %u tbs",
513 crcis_tree = proto_item_add_subtree(ti, ett_fp_crcis);
517 for (n=0; n < num_tbs; n++)
519 int bit = (tvb_get_guint8(tvb, offset+(n/8)) >> (7-(n%8))) & 0x01;
520 proto_tree_add_item(crcis_tree, hf_fp_crci[n%8], tvb, offset+(n/8),
526 expert_add_info_format(pinfo, ti,
527 PI_CHECKSUM, PI_WARN,
528 "CRCI error bit set for TB");
534 /* Highlight range of bytes covered by indicator bits */
535 proto_item_set_len(ti, (num_tbs+7) / 8);
537 /* Show error count in root text */
538 proto_item_append_text(ti, " (%u errors)", errors);
541 offset += ((num_tbs+7) / 8);
547 /***********************************************************/
548 /* Common control message types */
550 void dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
551 int offset, struct _fp_info *p_fp_info)
553 if (p_fp_info->channel != CHANNEL_PCH)
559 cfn = tvb_get_guint8(tvb, offset);
560 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
564 toa = tvb_get_ntohs(tvb, offset);
565 proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
568 if (check_col(pinfo->cinfo, COL_INFO))
570 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
578 /* PCH CFN is 12 bits */
579 cfn = (tvb_get_ntohs(tvb, offset) >> 4);
580 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
583 /* 4 bits of padding follow... */
585 /* 20 bits of ToA (followed by 4 padding bits) */
586 toa = ((int)(tvb_get_ntoh24(tvb, offset) << 8)) / 4096;
587 proto_tree_add_int(tree, hf_fp_pch_toa, tvb, offset, 3, toa);
589 if (check_col(pinfo->cinfo, COL_INFO))
591 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
596 void dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree,
597 tvbuff_t *tvb, int offset)
600 guint32 t1 = tvb_get_ntoh24(tvb, offset);
601 proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, FALSE);
603 if (check_col(pinfo->cinfo, COL_INFO))
605 col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u", t1);
609 void dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree,
610 tvbuff_t *tvb, int offset)
615 t1 = tvb_get_ntoh24(tvb, offset);
616 proto_tree_add_item(tree, hf_fp_t1, tvb, offset, 3, FALSE);
620 t2 = tvb_get_ntoh24(tvb, offset);
621 proto_tree_add_item(tree, hf_fp_t2, tvb, offset, 3, FALSE);
625 t3 = tvb_get_ntoh24(tvb, offset);
626 proto_tree_add_item(tree, hf_fp_t3, tvb, offset, 3, FALSE);
629 if (check_col(pinfo->cinfo, COL_INFO))
631 col_append_fstr(pinfo->cinfo, COL_INFO, " T1=%u T2=%u, T3=%u",
636 void dissect_common_dl_syncronisation(packet_info *pinfo, proto_tree *tree,
637 tvbuff_t *tvb, int offset, struct _fp_info *p_fp_info)
641 if (p_fp_info->channel != CHANNEL_PCH)
644 cfn = tvb_get_guint8(tvb, offset);
645 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
649 /* PCH CFN is 12 bits */
650 cfn = (tvb_get_ntohs(tvb, offset) >> 4);
651 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
653 /* 4 bits of padding follow... */
656 if (check_col(pinfo->cinfo, COL_INFO))
658 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u", cfn);
662 void dissect_common_ul_syncronisation(packet_info *pinfo, proto_tree *tree,
663 tvbuff_t *tvb, int offset, struct _fp_info *p_fp_info)
665 dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info);
668 void dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
671 guint8 timing_advance;
674 cfn = tvb_get_guint8(tvb, offset);
675 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
679 timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4;
680 proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance*4);
683 if (check_col(pinfo->cinfo, COL_INFO))
685 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, TA = %u",
686 cfn, timing_advance);
690 void dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree,
691 tvbuff_t *tvb, int offset)
694 guint16 user_buffer_size;
697 priority = (tvb_get_guint8(tvb, offset) & 0x0f);
698 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
701 /* User buffer size */
702 user_buffer_size = tvb_get_ntohs(tvb, offset);
703 proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, FALSE);
706 if (check_col(pinfo->cinfo, COL_INFO))
708 col_append_fstr(pinfo->cinfo, COL_INFO, " CmCH-PI=%u User-Buffer-Size=%u",
709 priority, user_buffer_size);
712 /* TODO: Spare extension may follow */
715 void dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
716 tvbuff_t *tvb, int offset)
719 guint16 max_pdu_length;
720 guint8 repetition_period;
725 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
728 /* Max MAC-d PDU length (13 bits) */
729 max_pdu_length = (tvb_get_ntohs(tvb, offset) >> 3);
730 proto_tree_add_item(tree, hf_fp_hsdsch_max_macd_pdu_len, tvb, offset, 2, FALSE);
733 /* HS-DSCH credits (11 bits) */
734 credits = (tvb_get_ntohs(tvb, offset) & 0x07ff);
735 ti = proto_tree_add_item(tree, hf_fp_hsdsch_credits, tvb, offset, 2, FALSE);
739 proto_item_append_text(ti, " (stop transmission)");
743 proto_item_append_text(ti, " (unlimited)");
746 /* HS-DSCH Interval */
747 interval = tvb_get_guint8(tvb, offset);
748 ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10);
752 proto_item_append_text(ti, " (none of the credits shall be used)");
755 /* HS-DSCH Repetition period */
756 repetition_period = tvb_get_guint8(tvb, offset);
757 ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, FALSE);
759 if (repetition_period == 0)
761 proto_item_append_text(ti, " (unlimited repetition period)");
764 if (check_col(pinfo->cinfo, COL_INFO))
766 col_append_fstr(pinfo->cinfo, COL_INFO,
767 " Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u",
768 max_pdu_length, credits, interval, repetition_period);
771 /* TODO: Spare extension may follow */
775 void dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree,
776 tvbuff_t *tvb, int offset)
779 guint8 activation_cfn;
783 pusch_set_id = tvb_get_guint8(tvb, offset);
784 proto_tree_add_item(tree, hf_fp_pusch_set_id, tvb, offset, 1, FALSE);
788 activation_cfn = tvb_get_guint8(tvb, offset);
789 proto_tree_add_item(tree, hf_fp_activation_cfn, tvb, offset, 1, FALSE);
793 duration = tvb_get_guint8(tvb, offset) * 10;
794 proto_tree_add_uint(tree, hf_fp_duration, tvb, offset, 1, duration);
796 if (check_col(pinfo->cinfo, COL_INFO))
798 col_append_fstr(pinfo->cinfo, COL_INFO,
799 " PUSCH Set Id=%u Activation CFN=%u Duration=%u",
800 pusch_set_id, activation_cfn, duration);
808 /* Dissect the control part of a common channel message */
809 void dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
810 int offset, struct _fp_info *p_fp_info)
812 /* Common control frame type */
813 guint8 control_frame_type = tvb_get_guint8(tvb, offset);
814 proto_tree_add_item(tree, hf_fp_common_control_frame_type, tvb, offset, 1, FALSE);
817 if (check_col(pinfo->cinfo, COL_INFO))
819 col_append_str(pinfo->cinfo, COL_INFO,
820 val_to_str(control_frame_type, common_control_frame_type_vals, "Unknown"));
823 /* Frame-type specific dissection */
824 switch (control_frame_type)
826 case COMMON_OUTER_LOOP_POWER_CONTROL:
828 case COMMON_TIMING_ADJUSTMENT:
829 dissect_common_timing_adjustment(pinfo, tree, tvb, offset, p_fp_info);
831 case COMMON_DL_SYNCHRONISATION:
832 dissect_common_dl_syncronisation(pinfo, tree, tvb, offset, p_fp_info);
834 case COMMON_UL_SYNCHRONISATION:
835 dissect_common_ul_syncronisation(pinfo, tree, tvb, offset, p_fp_info);
837 case COMMON_DL_NODE_SYNCHRONISATION:
838 dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset);
840 case COMMON_UL_NODE_SYNCHRONISATION:
841 dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset);
843 case COMMON_DYNAMIC_PUSCH_ASSIGNMENT:
844 dissect_common_dynamic_pusch_assignment(pinfo, tree, tvb, offset);
846 case COMMON_TIMING_ADVANCE:
847 dissect_common_timing_advance(pinfo, tree, tvb, offset);
849 case COMMON_HS_DSCH_Capacity_Request:
850 dissect_hsdpa_capacity_request(pinfo, tree, tvb, offset);
852 case COMMON_HS_DSCH_Capacity_Allocation:
853 dissect_hsdpa_capacity_allocation(pinfo, tree, tvb, offset);
863 /**************************/
864 /* Dissect a RACH channel */
865 void dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
866 int offset, struct _fp_info *p_fp_info)
868 gboolean is_control_frame;
871 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
874 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
875 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
878 if (check_col(pinfo->cinfo, COL_INFO))
880 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
883 if (is_control_frame)
885 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
895 cfn = tvb_get_guint8(tvb, offset);
896 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
899 if (check_col(pinfo->cinfo, COL_INFO))
901 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
905 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
908 if (p_fp_info->channel == CHANNEL_RACH_FDD)
910 /* Propagation delay */
911 proto_tree_add_uint(tree, hf_fp_propagation_delay, tvb, offset, 1,
912 tvb_get_guint8(tvb, offset) * 3);
916 if (p_fp_info->channel == CHANNEL_RACH_TDD)
918 /* Rx Timing Deviation */
919 proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, FALSE);
923 if (p_fp_info->channel == CHANNEL_RACH_TDD_128)
925 /* Received SYNC UL Timing Deviation */
926 proto_tree_add_item(tree, hf_fp_received_sync_ul_timing_deviation, tvb, offset, 1, FALSE);
931 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
934 offset = dissect_crci_bits(tvb, pinfo, tree, num_tbs, offset);
936 /* Info introduced in R6 */
937 if (p_fp_info->release == 6)
941 guint8 flag_bytes = 0;
946 proto_item *new_ie_flags_ti;
947 proto_tree *new_ie_flags_tree;
950 /* Add new IE flags subtree */
951 new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_rach_new_ie_flags, tvb, offset, 1,
953 new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_rach_new_ie_flags);
956 flags = tvb_get_guint8(tvb, offset);
959 /* Dissect individual bits */
960 for (n=0; n < 8; n++)
962 proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_new_ie_flag[n], tvb, offset, 1, FALSE);
963 if ((flags >> (7-n)) & 0x01)
970 proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found);
972 /* Last bit set will indicate another flags byte follows... */
973 } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/
975 /* Cell portion ID */
976 proto_tree_add_item(tree, hf_fp_cell_portion_id, tvb, offset, 1, FALSE);
981 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
987 /**************************/
988 /* Dissect a FACH channel */
989 void dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
990 int offset, struct _fp_info *p_fp_info)
992 gboolean is_control_frame;
995 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
998 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
999 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1002 if (check_col(pinfo->cinfo, COL_INFO))
1004 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1007 if (is_control_frame)
1009 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1019 cfn = tvb_get_guint8(tvb, offset);
1020 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1023 if (check_col(pinfo->cinfo, COL_INFO))
1025 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1029 proto_tree_add_item(tree, hf_fp_fach_tfi, tvb, offset, 1, FALSE);
1032 /* Transmit power level */
1033 proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
1034 (float)(int)(tvb_get_guint8(tvb, offset)) / 10);
1038 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1041 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1047 /**************************/
1048 /* Dissect a DSCH channel */
1049 void dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1050 int offset, struct _fp_info *p_fp_info)
1052 gboolean is_control_frame;
1055 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1058 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1059 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1062 if (check_col(pinfo->cinfo, COL_INFO))
1064 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1067 if (is_control_frame)
1069 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1079 cfn = tvb_get_guint8(tvb, offset);
1080 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1083 if (check_col(pinfo->cinfo, COL_INFO))
1085 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1089 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
1093 /* Other fields depend upon release & FDD/TDD settings */
1094 if (((p_fp_info->release == 99) || (p_fp_info->release == 4)) &&
1095 (p_fp_info->channel == CHANNEL_DSCH_FDD))
1098 proto_tree_add_float(tree, hf_fp_power_offset, tvb, offset, 1,
1100 ((float)(tvb_get_guint8(tvb, offset)) * (float)(0.25)));
1104 proto_tree_add_item(tree, hf_fp_code_number, tvb, offset, 1, FALSE);
1107 /* Spreading Factor (3 bits) */
1108 proto_tree_add_item(tree, hf_fp_spreading_factor, tvb, offset, 1, FALSE);
1110 /* MC info (4 bits)*/
1111 proto_tree_add_item(tree, hf_fp_mc_info, tvb, offset, 1, FALSE);
1113 /* Last bit of this byte is spare */
1121 proto_tree_add_item(tree, hf_fp_pdsch_set_id, tvb, offset, 1, FALSE);
1124 /* Transmit power level */
1125 proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
1126 (float)(tvb_get_guint8(tvb, offset)) / 10);
1131 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1134 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1140 /**************************/
1141 /* Dissect a USCH channel */
1142 void dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1143 int offset, struct _fp_info *p_fp_info)
1145 gboolean is_control_frame;
1148 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1151 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1152 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1155 if (check_col(pinfo->cinfo, COL_INFO))
1157 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1160 if (is_control_frame)
1162 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1172 cfn = tvb_get_guint8(tvb, offset);
1173 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1176 if (check_col(pinfo->cinfo, COL_INFO))
1178 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1182 proto_tree_add_item(tree, hf_fp_usch_tfi, tvb, offset, 1, FALSE);
1185 /* Rx Timing Deviation */
1186 proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, FALSE);
1190 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1193 proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, FALSE);
1197 offset = dissect_crci_bits(tvb, pinfo, tree, num_tbs, offset);
1200 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1207 /**************************/
1208 /* Dissect a PCH channel */
1209 void dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1210 int offset, struct _fp_info *p_fp_info)
1212 gboolean is_control_frame;
1214 gboolean paging_indication;
1217 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1220 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1221 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1224 if (check_col(pinfo->cinfo, COL_INFO))
1226 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1229 if (is_control_frame)
1231 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1239 /* 12-bit CFN value */
1240 proto_tree_add_item(tree, hf_fp_pch_cfn, tvb, offset, 2, FALSE);
1241 pch_cfn = (tvb_get_ntohs(tvb, offset) & 0xfff0) >> 4;
1244 if (check_col(pinfo->cinfo, COL_INFO))
1246 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%04u ", pch_cfn);
1249 /* Paging indication */
1250 proto_tree_add_item(tree, hf_fp_pch_pi, tvb, offset, 1, FALSE);
1251 paging_indication = tvb_get_guint8(tvb, offset) & 0x01;
1255 proto_tree_add_item(tree, hf_fp_pch_tfi, tvb, offset, 1, FALSE);
1258 /* Optional paging indications */
1259 if (paging_indication)
1262 ti = proto_tree_add_item(tree, hf_fp_paging_indication_bitmap, tvb,
1264 (p_fp_info->paging_indications+7) / 8,
1266 proto_item_append_text(ti, " (%u bits)", p_fp_info->paging_indications);
1267 offset += ((p_fp_info->paging_indications+7) / 8);
1271 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1274 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1280 /**************************/
1281 /* Dissect a CPCH channel */
1282 void dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1283 int offset, struct _fp_info *p_fp_info)
1285 gboolean is_control_frame;
1288 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1291 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1292 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1295 if (check_col(pinfo->cinfo, COL_INFO))
1297 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1300 if (is_control_frame)
1302 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1312 cfn = tvb_get_guint8(tvb, offset);
1313 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1316 if (check_col(pinfo->cinfo, COL_INFO))
1318 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1322 proto_tree_add_item(tree, hf_fp_cpch_tfi, tvb, offset, 1, FALSE);
1325 /* Propagation delay */
1326 proto_tree_add_uint(tree, hf_fp_propagation_delay, tvb, offset, 1,
1327 tvb_get_guint8(tvb, offset) * 3);
1331 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1334 offset = dissect_crci_bits(tvb, pinfo, tree, num_tbs, offset);
1337 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1342 /********************************/
1343 /* Dissect an IUR DSCH channel */
1344 void dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1345 int offset, struct _fp_info *p_fp_info _U_)
1347 gboolean is_control_frame;
1350 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1353 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1354 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1357 if (check_col(pinfo->cinfo, COL_INFO))
1359 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1362 if (is_control_frame)
1364 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1375 /************************/
1376 /* DCH control messages */
1378 void dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1384 control_cfn = tvb_get_guint8(tvb, offset);
1385 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1389 toa = tvb_get_ntohs(tvb, offset);
1390 proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
1393 if (check_col(pinfo->cinfo, COL_INFO))
1395 col_append_fstr(pinfo->cinfo, COL_INFO,
1396 " CFN = %u, ToA = %d", control_cfn, toa);
1400 void dissect_dch_rx_timing_deviation(proto_tree *tree, tvbuff_t *tvb, int offset)
1403 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1406 /* Rx Timing Deviation */
1407 proto_tree_add_item(tree, hf_fp_dch_rx_timing_deviation, tvb, offset, 1, FALSE);
1411 void dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1414 guint cfn = tvb_get_guint8(tvb, offset);
1415 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1418 if (check_col(pinfo->cinfo, COL_INFO))
1420 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u", cfn);
1424 void dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1430 cfn = tvb_get_guint8(tvb, offset);
1431 proto_tree_add_item(tree, hf_fp_cfn_control, tvb, offset, 1, FALSE);
1435 toa = tvb_get_ntohs(tvb, offset);
1436 proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, FALSE);
1439 if (check_col(pinfo->cinfo, COL_INFO))
1441 col_append_fstr(pinfo->cinfo, COL_INFO, " CFN = %u, ToA = %d",
1446 void dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1449 float target = -8.2 + (0.1 * (float)(tvb_get_guint8(tvb, offset)));
1450 proto_tree_add_float(tree, hf_fp_ul_sir_target, tvb, offset, 1, target);
1452 if (check_col(pinfo->cinfo, COL_INFO))
1454 col_append_fstr(pinfo->cinfo, COL_INFO, "SIR Target = %f", target);
1458 void dissect_dch_dl_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1460 dissect_common_dl_node_synchronisation(pinfo, tree, tvb, offset);
1463 void dissect_dch_ul_node_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1465 dissect_common_ul_node_synchronisation(pinfo, tree, tvb, offset);
1468 void dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
1474 /* Show defined flags in these 2 bytes */
1475 for (n=4; n >= 0; n--)
1477 proto_tree_add_item(tree, hf_fp_radio_interface_parameter_update_flag[n], tvb, offset, 2, FALSE);
1482 cfn = tvb_get_guint8(tvb, offset);
1483 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1487 proto_tree_add_item(tree, hf_fp_dpc_mode, tvb, offset, 1, FALSE);
1490 proto_tree_add_item(tree, hf_fp_tpc_po, tvb, offset, 1, FALSE);
1493 /* Multiple RL sets indicator */
1494 proto_tree_add_item(tree, hf_fp_multiple_rl_set_indicator, tvb, offset, 1, FALSE);
1498 value = (tvb_get_guint8(tvb, offset) & 0x7f);
1499 proto_tree_add_int(tree, hf_fp_max_ue_tx_pow, tvb, offset, 1, -55 + value);
1501 /* TODO: spare extension */
1504 void dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1506 dissect_common_timing_advance(pinfo, tree, tvb, offset);
1509 void dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1511 guint8 status = (tvb_get_guint8(tvb, offset) & 0x03);
1513 /* Congestion status */
1514 proto_tree_add_int(tree, hf_fp_congestion_status, tvb, offset, 1, FALSE);
1516 if (check_col(pinfo->cinfo, COL_INFO))
1518 col_append_fstr(pinfo->cinfo, COL_INFO, " status = %s",
1519 val_to_str(status, congestion_status_vals, "unknown"));
1526 /* DCH control frame */
1527 void dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1529 /* Control frame type */
1530 guint8 control_frame_type = tvb_get_guint8(tvb, offset);
1531 proto_tree_add_item(tree, hf_fp_dch_control_frame_type, tvb, offset, 1, FALSE);
1534 if (check_col(pinfo->cinfo, COL_INFO))
1536 col_append_str(pinfo->cinfo, COL_INFO,
1537 val_to_str(control_frame_type,
1538 dch_control_frame_type_vals, "Unknown"));
1541 switch (control_frame_type)
1543 case DCH_TIMING_ADJUSTMENT:
1544 dissect_dch_timing_adjustment(tree, pinfo, tvb, offset);
1546 case DCH_RX_TIMING_DEVIATION:
1547 dissect_dch_rx_timing_deviation(tree, tvb, offset);
1549 case DCH_DL_SYNCHRONISATION:
1550 dissect_dch_dl_synchronisation(tree, pinfo, tvb, offset);
1552 case DCH_UL_SYNCHRONISATION:
1553 dissect_dch_ul_synchronisation(tree, pinfo, tvb, offset);
1555 case DCH_OUTER_LOOP_POWER_CONTROL:
1556 dissect_dch_outer_loop_power_control(tree, pinfo, tvb, offset);
1558 case DCH_DL_NODE_SYNCHRONISATION:
1559 dissect_dch_dl_node_synchronisation(tree, pinfo, tvb, offset);
1561 case DCH_UL_NODE_SYNCHRONISATION:
1562 dissect_dch_ul_node_synchronisation(tree, pinfo, tvb, offset);
1564 case DCH_RADIO_INTERFACE_PARAMETER_UPDATE:
1565 dissect_dch_radio_interface_parameter_update(tree, pinfo, tvb, offset);
1567 case DCH_TIMING_ADVANCE:
1568 dissect_dch_timing_advance(tree, pinfo, tvb, offset);
1570 case DCH_TNL_CONGESTION_INDICATION:
1571 dissect_dch_tnl_congestion_indication(tree, pinfo, tvb, offset);
1576 /*******************************/
1577 /* Dissect a DCH channel */
1578 void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1579 int offset, struct _fp_info *p_fp_info)
1581 gboolean is_control_frame;
1585 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1588 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1589 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1592 if (check_col(pinfo->cinfo, COL_INFO))
1594 col_append_str(pinfo->cinfo, COL_INFO,
1595 is_control_frame ? " [Control] " :
1596 ((p_fp_info->is_uplink) ? " [ULData] " :
1600 if (is_control_frame)
1602 /* DCH control frame */
1603 dissect_dch_control_frame(tree, pinfo, tvb, offset);
1607 /************************/
1613 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1614 cfn = tvb_get_guint8(tvb, offset);
1617 if (check_col(pinfo->cinfo, COL_INFO))
1619 col_append_fstr(pinfo->cinfo, COL_INFO, "CFN=%03u ", cfn);
1622 /* One TFI for each channel */
1623 for (chan=0; chan < p_fp_info->num_chans; chan++)
1625 proto_tree_add_item(tree, hf_fp_tfi, tvb, offset, 1, FALSE);
1629 /* Dissect TB data */
1630 offset = dissect_tb_data(tvb, pinfo, tree, offset, p_fp_info, &num_tbs);
1632 /* QE (uplink only) */
1633 if (p_fp_info->is_uplink)
1635 proto_tree_add_item(tree, hf_fp_quality_estimate, tvb, offset, 1, FALSE);
1639 /* CRCI bits (uplink only) */
1640 if (p_fp_info->is_uplink)
1642 offset = dissect_crci_bits(tvb, pinfo, tree, num_tbs, offset);
1645 /* Payload CRC (optional) */
1646 if (p_fp_info->dch_crc_present)
1648 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1655 /**********************************/
1656 /* Dissect an E-DCH channel */
1657 void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1658 int offset, struct _fp_info *p_fp_info)
1660 gboolean is_control_frame;
1661 guint8 number_of_subframes;
1664 struct subframe_info subframes[8];
1667 proto_tree_add_item(tree, hf_fp_edch_header_crc, tvb, offset, 2, FALSE);
1670 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1671 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1674 if (check_col(pinfo->cinfo, COL_INFO))
1676 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1679 if (is_control_frame)
1681 /* DCH control frame */
1682 dissect_dch_control_frame(tree, pinfo, tvb, offset);
1686 /********************************/
1687 /* E-DCH data here */
1689 guint bit_offset = 0;
1690 guint total_bits = 0;
1693 proto_tree_add_item(tree, hf_fp_edch_fsn, tvb, offset, 1, FALSE);
1696 /* Number of subframes.
1697 This was 3 bits in early releases, is 4 bits offset by 1 in later releases */
1698 if ((p_fp_info->dct2000_variant % 256) > 1)
1700 /* Use 4 bits plus offset of 1 */
1701 number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x0f) + 1;
1705 /* Use 3 bits only */
1706 number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x07);
1708 proto_tree_add_uint(tree, hf_fp_edch_number_of_subframes, tvb, offset, 1,
1709 number_of_subframes);
1714 cfn = tvb_get_guint8(tvb, offset);
1715 proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, FALSE);
1718 /* EDCH subframe header list */
1719 for (n=0; n < number_of_subframes; n++)
1722 proto_item *subframe_header_ti;
1723 proto_tree *subframe_header_tree;
1725 /* Add subframe header subtree */
1726 subframe_header_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe_header, tvb, offset, 0,
1728 subframe_header_tree = proto_item_add_subtree(subframe_header_ti, ett_fp_edch_subframe_header);
1730 /* Number of HARQ Retransmissions */
1731 proto_tree_add_item(subframe_header_tree, hf_fp_edch_harq_retransmissions, tvb,
1734 /* Subframe number */
1735 subframes[n].subframe_number = (tvb_get_guint8(tvb, offset) & 0x07);
1736 proto_tree_add_item(subframe_header_tree, hf_fp_edch_subframe_number, tvb,
1740 /* Number of MAC-es PDUs */
1741 subframes[n].number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
1742 proto_tree_add_item(subframe_header_tree, hf_fp_edch_number_of_mac_es_pdus,
1743 tvb, offset, 1, FALSE);
1746 proto_item_append_text(subframe_header_ti, " %u header (%u MAC-es PDUs)",
1747 subframes[n].subframe_number,
1748 subframes[n].number_of_mac_es_pdus);
1750 /* Details of each MAC-es PDU */
1751 for (i=0; i < subframes[n].number_of_mac_es_pdus; i++)
1759 ddi_offset = offset + (bit_offset / 8);
1761 switch (bit_offset%8)
1764 ddi = (tvb_get_guint8(tvb, ddi_offset) >> 2);
1767 ddi = (tvb_get_guint8(tvb, ddi_offset) & 0x3f);
1770 ddi = (tvb_get_ntohs(tvb, ddi_offset) >> 6) & 0x003f;
1773 ddi = (tvb_get_ntohs(tvb, ddi_offset) >> 4) & 0x003f;
1776 /* Can't get here, but avoid warning */
1780 proto_tree_add_uint(subframe_header_tree, hf_fp_edch_ddi, tvb, ddi_offset,
1781 ((bit_offset%8) <= 2) ? 1 : 2, ddi);
1783 subframes[n].ddi[i] = ddi;
1786 /* Number of MAC-d PDUs (6 bits) */
1787 n_pdus_offset = offset + (bit_offset / 8);
1788 switch (bit_offset%8)
1791 n_pdus = (tvb_get_guint8(tvb, n_pdus_offset) >> 2);
1794 n_pdus = (tvb_get_guint8(tvb, n_pdus_offset) & 0x3f);
1797 n_pdus = (tvb_get_ntohs(tvb, n_pdus_offset) >> 6) & 0x003f;
1800 n_pdus = (tvb_get_ntohs(tvb, n_pdus_offset) >> 4) & 0x003f;
1803 /* Can't get here, but avoid warning */
1806 proto_tree_add_uint(subframe_header_tree, hf_fp_edch_number_of_mac_d_pdus, tvb, n_pdus_offset,
1807 ((bit_offset%8) <= 2) ? 1 : 2, n_pdus);
1809 subframes[n].number_of_mac_d_pdus[i] = n_pdus;
1813 /* Tree should cover entire subframe header */
1814 proto_item_set_len(subframe_header_ti, bit_offset/8);
1816 offset += ((bit_offset+7)/8);
1819 /* EDCH subframes */
1821 for (n=0; n < number_of_subframes; n++)
1824 proto_item *subframe_ti;
1825 proto_tree *subframe_tree;
1826 guint bits_in_subframe = 0;
1827 guint mac_d_pdus_in_subframe = 0;
1831 /* Add subframe subtree */
1832 subframe_ti = proto_tree_add_string_format(tree, hf_fp_edch_subframe, tvb, offset, 0,
1833 "", "Subframe %u data", subframes[n].subframe_number);
1834 subframe_tree = proto_item_add_subtree(subframe_ti, ett_fp_edch_subframe);
1836 for (i=0; i < subframes[n].number_of_mac_es_pdus; i++)
1843 /* Look up mac-d pdu size for this ddi */
1844 for (m=0; m < p_fp_info->no_ddi_entries; m++)
1846 if (subframes[n].ddi[i] == p_fp_info->edch_ddi[m])
1848 size = p_fp_info->edch_macd_pdu_size[m];
1853 if (m == p_fp_info->no_ddi_entries)
1855 /* Not found. Oops */
1859 /* Send MAC-dd PDUs together as one MAC-es PDU */
1860 send_size = size * subframes[n].number_of_mac_d_pdus[i];
1863 proto_tree_add_item(subframe_tree, hf_fp_edch_pdu_padding, tvb,
1864 offset + (bit_offset/8),
1869 proto_tree_add_item(subframe_tree, hf_fp_edch_tsn, tvb,
1870 offset + (bit_offset/8),
1877 ti = proto_tree_add_item(subframe_tree, hf_fp_edch_mac_es_pdu, tvb,
1878 offset + (bit_offset/8),
1879 ((bit_offset % 8) + send_size + 7) / 8,
1881 proto_item_append_text(ti, " (%u * %u = %u bits, subframe %d)",
1882 size, subframes[n].number_of_mac_d_pdus[i],
1885 bits_in_subframe += send_size;
1886 mac_d_pdus_in_subframe += subframes[n].number_of_mac_d_pdus[i];
1888 bit_offset += send_size;
1890 /* Pad out to next byte */
1893 bit_offset += (8 - (bit_offset % 8));
1899 /* Tree should cover entire subframe */
1900 proto_item_set_len(subframe_ti, bit_offset/8);
1902 /* Append summary info to subframe label */
1903 proto_item_append_text(subframe_ti, " (%u bits in %u MAC-d PDUs)",
1904 bits_in_subframe, mac_d_pdus_in_subframe);
1906 total_bits += bits_in_subframe;
1908 offset += (bit_offset/8);
1911 /* Report number of subframes in info column */
1912 if (check_col(pinfo->cinfo, COL_INFO))
1914 col_append_fstr(pinfo->cinfo, COL_INFO,
1915 " CFN = %03u (%u bits in %u subframes)",
1916 cfn, total_bits, number_of_subframes);
1919 /* Payload CRC (optional) */
1920 /* TODO: is this test correct...? */
1921 /* if (p_fp_info->dch_crc_present) */
1922 if (tvb_length_remaining(tvb, offset) == 2)
1924 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
1930 /***********************************/
1931 /* Dissect an HSDSCH channel */
1932 void dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1933 int offset, struct _fp_info *p_fp_info)
1935 gboolean is_control_frame;
1938 proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, FALSE);
1941 is_control_frame = tvb_get_guint8(tvb, offset) & 0x01;
1942 proto_tree_add_item(tree, hf_fp_ft, tvb, offset, 1, FALSE);
1945 if (check_col(pinfo->cinfo, COL_INFO))
1947 col_append_str(pinfo->cinfo, COL_INFO, is_control_frame ? " [Control] " : " [Data] ");
1950 if (is_control_frame)
1952 dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
1956 guint8 number_of_pdus;
1959 /********************************/
1960 /* HS-DCH data here */
1963 proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, FALSE);
1966 /* MAC-d PDU Length (13 bits) */
1967 pdu_length = (tvb_get_ntohs(tvb, offset) >> 3);
1968 proto_tree_add_item(tree, hf_fp_mac_d_pdu_len, tvb, offset, 2, FALSE);
1972 number_of_pdus = tvb_get_guint8(tvb, offset);
1973 proto_tree_add_item(tree, hf_fp_num_of_pdu, tvb, offset, 1, FALSE);
1976 /* User buffer size */
1977 proto_tree_add_item(tree, hf_fp_user_buffer_size, tvb, offset, 2, FALSE);
1981 offset = dissect_macd_pdu_data(tvb, pinfo, tree, offset, pdu_length,
1984 /* Extra R6 stuff */
1985 if (p_fp_info->release == 6)
1989 guint8 flag_bytes = 0;
1994 proto_item *new_ie_flags_ti;
1995 proto_tree *new_ie_flags_tree;
1996 guint ies_found = 0;
1998 /* Add new IE flags subtree */
1999 new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_new_ie_flags, tvb, offset, 1,
2000 "", "New IE flags");
2001 new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_hsdsch_new_ie_flags);
2003 /* Read next byte */
2004 flags = tvb_get_guint8(tvb, offset);
2007 /* Dissect individual bits */
2008 for (n=0; n < 8; n++)
2010 proto_tree_add_item(new_ie_flags_tree, hf_fp_hsdsch_new_ie_flag[n], tvb, offset, 1, FALSE);
2011 if ((flags >> (7-n)) & 0x01)
2018 proto_item_append_text(new_ie_flags_ti, " (%u IEs found)", ies_found);
2020 /* Last bit set will indicate another flags byte follows... */
2021 } while (0); /*((flags & 0x01) && (flag_bytes < 31));*/
2023 if (1) /*(flags & 0x8) */
2025 /* DRT is shown as mandatory in the diagram (3GPP TS 25.435 V6.3.0),
2026 but the description below it states that
2027 it should depend upon the first bit. The detailed description of
2028 New IE flags doesn't agree, so treat as mandatory for now... */
2029 proto_tree_add_item(tree, hf_fp_hsdsch_drt, tvb, offset, 2, FALSE);
2034 /* TODO: may be spare extension to skip */
2037 proto_tree_add_item(tree, hf_fp_payload_crc, tvb, offset, 2, FALSE);
2044 /*****************************/
2045 /* Main dissection function. */
2046 void dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
2048 proto_tree *fp_tree;
2051 struct _fp_info *p_fp_info;
2053 /* Append this protocol name rather than replace. */
2054 if (check_col(pinfo->cinfo, COL_PROTOCOL))
2055 col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP");
2057 /* Create fp tree. */
2058 ti = proto_tree_add_item(tree, proto_fp, tvb, offset, -1, FALSE);
2059 fp_tree = proto_item_add_subtree(ti, ett_fp);
2061 /* Look for packet info! */
2062 p_fp_info = p_get_proto_data(pinfo->fd, proto_fp);
2064 /* Can't dissect anything without it... */
2065 if (p_fp_info == NULL)
2070 /* Show channel type in info column, tree */
2071 if (check_col(pinfo->cinfo, COL_INFO))
2073 col_set_str(pinfo->cinfo, COL_INFO,
2074 val_to_str(p_fp_info->channel,
2076 "Unknown channel type"));
2078 proto_item_append_text(ti, " (%s)",
2079 val_to_str(p_fp_info->channel,
2081 "Unknown channel type"));
2083 /* Add channel type as a generated field */
2084 ti = proto_tree_add_uint(fp_tree, hf_fp_channel_type, tvb, 0, 0, p_fp_info->channel);
2085 PROTO_ITEM_SET_GENERATED(ti);
2087 /* Add link direction as a generated field */
2088 ti = proto_tree_add_uint(fp_tree, hf_fp_direction, tvb, 0, 0, p_fp_info->is_uplink);
2089 PROTO_ITEM_SET_GENERATED(ti);
2092 /*************************************/
2093 /* Dissect according to channel type */
2094 switch (p_fp_info->channel)
2096 case CHANNEL_RACH_TDD:
2097 case CHANNEL_RACH_TDD_128:
2098 case CHANNEL_RACH_FDD:
2099 dissect_rach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2102 dissect_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2104 case CHANNEL_FACH_FDD:
2105 case CHANNEL_FACH_TDD:
2106 dissect_fach_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2108 case CHANNEL_DSCH_FDD:
2109 case CHANNEL_DSCH_TDD:
2110 dissect_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2112 case CHANNEL_USCH_TDD_128:
2113 case CHANNEL_USCH_TDD_384:
2114 dissect_usch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2117 dissect_pch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2120 dissect_cpch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2126 case CHANNEL_HSDSCH:
2127 dissect_hsdsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2129 case CHANNEL_IUR_CPCHF:
2131 case CHANNEL_IUR_FACH:
2133 case CHANNEL_IUR_DSCH:
2134 dissect_iur_dsch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2137 dissect_e_dch_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info);
2145 void proto_register_fp(void)
2147 static hf_register_info hf[] =
2149 { &hf_fp_channel_type,
2151 "fp.channel-type", FT_UINT8, BASE_HEX, VALS(channel_type_vals), 0x0,
2152 "Channel Type", HFILL
2157 "fp.direction", FT_UINT8, BASE_HEX, VALS(direction_vals), 0x0,
2158 "Link direction", HFILL
2161 { &hf_fp_header_crc,
2163 "fp.header-crc", FT_UINT8, BASE_HEX, NULL, 0xfe,
2169 "fp.ft", FT_UINT8, BASE_HEX, VALS(data_control_vals), 0x01,
2175 "fp.cfn", FT_UINT8, BASE_DEC, NULL, 0x0,
2176 "Connection Frame Number", HFILL
2181 "fp.pch.cfn", FT_UINT16, BASE_DEC, NULL, 0xfff0,
2182 "PCH Connection Frame Number", HFILL
2187 "fp.pch.toa", FT_INT24, BASE_DEC, NULL, 0x0,
2188 "PCH Time of Arrival", HFILL
2191 { &hf_fp_cfn_control,
2193 "fp.cfn-control", FT_UINT8, BASE_DEC, NULL, 0x0,
2194 "Connection Frame Number Control", HFILL
2199 "fp.cfn-control", FT_INT16, BASE_DEC, NULL, 0x0,
2200 "Time of arrival (units are 125 microseconds)", HFILL
2205 "fp.tb", FT_NONE, BASE_NONE, NULL, 0x0,
2206 "Transport Block", HFILL
2211 "fp.tfi", FT_UINT8, BASE_DEC, NULL, 0x0,
2212 "Transport Format Indicator", HFILL
2217 "fp.usch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f,
2218 "USCH Transport Format Indicator", HFILL
2223 "fp.cpch.tfi", FT_UINT8, BASE_DEC, NULL, 0x1f,
2224 "CPCH Transport Format Indicator", HFILL
2227 { &hf_fp_propagation_delay,
2228 { "Propagation Delay",
2229 "fp.propagation-delay", FT_UINT8, BASE_DEC, NULL, 0x0,
2230 "Propagation Delay", HFILL
2233 { &hf_fp_dch_control_frame_type,
2234 { "Control Frame Type",
2235 "fp.dch.control.frame-type", FT_UINT8, BASE_HEX, VALS(dch_control_frame_type_vals), 0x0,
2236 "DCH Control Frame Type", HFILL
2239 { &hf_fp_dch_rx_timing_deviation,
2240 { "Rx Timing Deviation",
2241 "fp.dch.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
2242 "DCH Rx Timing Deviation", HFILL
2245 { &hf_fp_quality_estimate,
2246 { "Quality Estimate",
2247 "fp.dch.quality-estimate", FT_UINT8, BASE_DEC, 0, 0x0,
2248 "Quality Estimate", HFILL
2251 { &hf_fp_payload_crc,
2253 "fp.payload-crc", FT_UINT16, BASE_HEX, 0, 0x0,
2254 "Payload CRC", HFILL
2257 { &hf_fp_common_control_frame_type,
2258 { "Control Frame Type",
2259 "fp.common.control.frame-type", FT_UINT8, BASE_HEX, VALS(common_control_frame_type_vals), 0x0,
2260 "Common Control Frame Type", HFILL
2265 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x80,
2266 "CRC correctness indicator", HFILL
2271 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x40,
2272 "CRC correctness indicator", HFILL
2277 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x20,
2278 "CRC correctness indicator", HFILL
2283 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x10,
2284 "CRC correctness indicator", HFILL
2289 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x08,
2290 "CRC correctness indicator", HFILL
2295 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x04,
2296 "CRC correctness indicator", HFILL
2301 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x02,
2302 "CRC correctness indicator", HFILL
2307 "fp.crci", FT_UINT8, BASE_HEX, VALS(crci_vals), 0x01,
2308 "CRC correctness indicator", HFILL
2311 { &hf_fp_received_sync_ul_timing_deviation,
2312 { "Received SYNC UL Timing Deviation",
2313 "fp.rx-sync-ul-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
2314 "Received SYNC UL Timing Deviation", HFILL
2318 { "Paging Indication",
2319 "fp.pch.pi", FT_UINT8, BASE_DEC, VALS(paging_indication_vals), 0x01,
2320 "Indicates if the PI Bitmap is present", HFILL
2325 "fp.pch.tfi", FT_UINT8, BASE_DEC, 0, 0x1f,
2326 "PCH Transport Format Indicator", HFILL
2331 "fp.fach.tfi", FT_UINT8, BASE_DEC, 0, 0x1f,
2332 "FACH Transport Format Indicator", HFILL
2335 { &hf_fp_transmit_power_level,
2336 { "Transmit Power Level",
2337 "fp.transmit-power-level", FT_FLOAT, BASE_DEC, 0, 0x0,
2338 "Transmit Power Level (dB)", HFILL
2341 { &hf_fp_pdsch_set_id,
2343 "fp.pdsch-set-id", FT_UINT8, BASE_DEC, 0, 0x0,
2344 "A pointer to the PDSCH Set which shall be used to transmit", HFILL
2347 { &hf_fp_paging_indication_bitmap,
2348 { "Paging Indications bitmap",
2349 "fp.pch.pi-bitmap", FT_NONE, BASE_NONE, NULL, 0x0,
2350 "Paging Indication bitmap", HFILL
2353 { &hf_fp_rx_timing_deviation,
2354 { "Rx Timing Deviation",
2355 "fp.common.control.rx-timing-deviation", FT_UINT8, BASE_DEC, 0, 0x0,
2356 "Common Rx Timing Deviation", HFILL
2359 { &hf_fp_edch_header_crc,
2360 { "E-DCH Header CRC",
2361 "fp.edch.header-crc", FT_UINT16, BASE_HEX, 0, 0xfef,
2362 "E-DCH Header CRC", HFILL
2367 "fp.edch.fsn", FT_UINT8, BASE_DEC, 0, 0x0f,
2368 "E-DCH Frame Sequence Number", HFILL
2371 { &hf_fp_edch_number_of_subframes,
2372 { "No of subframes",
2373 "fp.edch.no-of-subframes", FT_UINT8, BASE_DEC, 0, 0x0f,
2374 "E-DCH Number of subframes", HFILL
2377 { &hf_fp_edch_harq_retransmissions,
2378 { "No of HARQ Retransmissions",
2379 "fp.edch.no-of-harq-retransmissions", FT_UINT8, BASE_DEC, 0, 0x78,
2380 "E-DCH Number of HARQ retransmissions", HFILL
2383 { &hf_fp_edch_subframe_number,
2384 { "Subframe number",
2385 "fp.edch.subframe-number", FT_UINT8, BASE_DEC, 0, 0x07,
2386 "E-DCH Subframe number", HFILL
2389 { &hf_fp_edch_number_of_mac_es_pdus,
2390 { "Number of Mac-es PDUs",
2391 "fp.edch.number-of-mac-es-pdus", FT_UINT8, BASE_DEC, 0, 0xf0,
2392 "Number of Mac-es PDUs", HFILL
2397 "fp.edch.ddi", FT_UINT8, BASE_DEC, 0, 0x0,
2398 "E-DCH Data Description Indicator", HFILL
2401 { &hf_fp_edch_subframe,
2403 "fp.edch.subframe", FT_STRING, BASE_NONE, NULL, 0x0,
2404 "EDCH Subframe", HFILL
2407 { &hf_fp_edch_subframe_header,
2408 { "Subframe header",
2409 "fp.edch.subframe-header", FT_STRING, BASE_NONE, NULL, 0x0,
2410 "EDCH Subframe header", HFILL
2413 { &hf_fp_edch_number_of_mac_d_pdus,
2414 { "Number of Mac-d PDUs",
2415 "fp.edch.number-of-mac-d-pdus", FT_UINT8, BASE_DEC, 0, 0x0,
2416 "Number of Mac-d PDUs", HFILL
2419 { &hf_fp_edch_pdu_padding,
2421 "fp.edch-data-padding", FT_UINT8, BASE_DEC, 0, 0xc0,
2422 "E-DCH padding before PDU", HFILL
2427 "fp.edch-tsn", FT_UINT8, BASE_DEC, 0, 0x3f,
2428 "E-DCH Transmission Sequence Number", HFILL
2431 { &hf_fp_edch_mac_es_pdu,
2433 "fp.edch.mac-es-pdu", FT_NONE, BASE_NONE, NULL, 0x0,
2439 "fp.cmch-pi", FT_UINT8, BASE_DEC, 0, 0x0f,
2440 "Common Transport Channel Priority Indicator", HFILL
2443 { &hf_fp_user_buffer_size,
2444 { "User buffer size",
2445 "fp.user-buffer-size", FT_UINT16, BASE_DEC, 0, 0x0,
2446 "User buffer size in octets", HFILL
2449 { &hf_fp_hsdsch_credits,
2450 { "HS-DSCH Credits",
2451 "fp.hsdsch-credits", FT_UINT16, BASE_DEC, 0, 0x07ff,
2452 "HS-DSCH Credits", HFILL
2455 { &hf_fp_hsdsch_max_macd_pdu_len,
2456 { "Max MAC-d PDU Length",
2457 "fp.hsdsch.max-macd-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8,
2458 "Maximum MAC-d PDU Length in bits", HFILL
2461 { &hf_fp_hsdsch_interval,
2462 { "HS-DSCH Interval in milliseconds",
2463 "fp.hsdsch-interval", FT_UINT8, BASE_DEC, 0, 0x0,
2464 "HS-DSCH Interval in milliseconds", HFILL
2467 { &hf_fp_hsdsch_repetition_period,
2468 { "HS-DSCH Repetition Period",
2469 "fp.hsdsch-repetition-period", FT_UINT8, BASE_DEC, 0, 0x0,
2470 "HS-DSCH Repetition Period in milliseconds", HFILL
2473 { &hf_fp_hsdsch_data_padding,
2475 "fp.hsdsch-data-padding", FT_UINT8, BASE_DEC, 0, 0xf0,
2476 "HS-DSCH Repetition Period in milliseconds", HFILL
2479 { &hf_fp_hsdsch_new_ie_flags,
2481 "fp.hsdsch.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0,
2482 "New IEs flags", HFILL
2485 { &hf_fp_hsdsch_new_ie_flag[0],
2487 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80,
2488 "DRT IE present", HFILL
2491 { &hf_fp_hsdsch_new_ie_flag[1],
2493 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40,
2494 "New IE present", HFILL
2497 { &hf_fp_hsdsch_new_ie_flag[2],
2499 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20,
2500 "New IE present", HFILL
2503 { &hf_fp_hsdsch_new_ie_flag[3],
2505 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10,
2506 "New IE present", HFILL
2509 { &hf_fp_hsdsch_new_ie_flag[4],
2511 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08,
2512 "New IE present", HFILL
2515 { &hf_fp_hsdsch_new_ie_flag[5],
2517 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04,
2518 "New IE present", HFILL
2521 { &hf_fp_hsdsch_new_ie_flag[6],
2523 "fp.hsdsch.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02,
2524 "New IE present", HFILL
2527 { &hf_fp_hsdsch_new_ie_flag[7],
2528 { "Another new IE flags byte",
2529 "fp.hsdsch.new-ie-flags-byte", FT_UINT8, BASE_DEC, 0, 0x01,
2530 "Another new IE flagsbyte", HFILL
2533 { &hf_fp_hsdsch_drt,
2535 "fp.hsdsch.drt", FT_UINT8, BASE_DEC, 0, 0xf0,
2536 "Delay Reference Time", HFILL
2539 { &hf_fp_timing_advance,
2541 "fp.timing-advance", FT_UINT8, BASE_DEC, 0, 0x3f,
2542 "Timing advance in chips", HFILL
2545 { &hf_fp_num_of_pdu,
2547 "fp.hsdsch.num-of-pdu", FT_UINT8, BASE_DEC, 0, 0x0,
2548 "Number of PDUs in the payload", HFILL
2551 { &hf_fp_mac_d_pdu_len,
2552 { "MAC-d PDU Length",
2553 "fp.hsdsch.mac-d-pdu-len", FT_UINT16, BASE_DEC, 0, 0xfff8,
2554 "MAC-d PDU Length in bits", HFILL
2559 "fp.mac-d-pdu", FT_NONE, BASE_NONE, NULL, 0x0,
2565 "fp.data", FT_STRING, BASE_NONE, NULL, 0x0,
2571 "fp.crcis", FT_STRING, BASE_NONE, NULL, 0x0,
2572 "CRC Indicators for uplink TBs", HFILL
2577 "fp.t1", FT_UINT24, BASE_DEC, NULL, 0x0,
2578 "RNC frame number indicating time it sends frame", HFILL
2583 "fp.t2", FT_UINT24, BASE_DEC, NULL, 0x0,
2584 "NodeB frame number indicating time it received DL Sync", HFILL
2589 "fp.t3", FT_UINT24, BASE_DEC, NULL, 0x0,
2590 "NodeB frame number indicating time it sends frame", HFILL
2593 { &hf_fp_ul_sir_target,
2595 "fp.ul-sir_target", FT_FLOAT, BASE_DEC, 0, 0x0,
2596 "Value (in dB) of the SIR target to be used by the UL inner loop power control", HFILL
2599 { &hf_fp_pusch_set_id,
2601 "fp.pusch-set-id", FT_UINT8, BASE_DEC, NULL, 0x0,
2602 "Identifies PUSCH Set from those configured in NodeB", HFILL
2605 { &hf_fp_activation_cfn,
2607 "fp.activation-cfn", FT_UINT8, BASE_DEC, NULL, 0x0,
2608 "Activation Connection Frame Number", HFILL
2613 "fp.pusch-set-id", FT_UINT8, BASE_DEC, NULL, 0x0,
2614 "Duration of the activation period of the PUSCH Set", HFILL
2617 { &hf_fp_power_offset,
2619 "fp.power-offset", FT_FLOAT, BASE_NONE, NULL, 0x0,
2620 "Power offset (in dB)", HFILL
2623 { &hf_fp_code_number,
2625 "fp.code-number", FT_UINT8, BASE_DEC, NULL, 0x0,
2626 "Code number", HFILL
2629 { &hf_fp_spreading_factor,
2630 { "Spreading factor",
2631 "fp.spreading-factor", FT_UINT8, BASE_DEC, VALS(spreading_factor_vals), 0xf0,
2632 "Spreading factor", HFILL
2637 "fp.mc-info", FT_UINT8, BASE_DEC, NULL, 0x0e,
2641 { &hf_fp_rach_new_ie_flags,
2643 "fp.rach.new-ie-flags", FT_STRING, BASE_NONE, 0, 0x0,
2644 "New IEs flags", HFILL
2647 { &hf_fp_rach_new_ie_flag[0],
2649 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x80,
2650 "New IE present", HFILL
2653 { &hf_fp_rach_new_ie_flag[1],
2655 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x40,
2656 "New IE present", HFILL
2659 { &hf_fp_rach_new_ie_flag[2],
2661 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x20,
2662 "New IE present", HFILL
2665 { &hf_fp_rach_new_ie_flag[3],
2667 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x10,
2668 "New IE present", HFILL
2671 { &hf_fp_rach_new_ie_flag[4],
2673 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x08,
2674 "New IE present", HFILL
2677 { &hf_fp_rach_new_ie_flag[5],
2679 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x04,
2680 "New IE present", HFILL
2683 { &hf_fp_rach_new_ie_flag[6],
2685 "fp.rach.new-ie-flag", FT_UINT8, BASE_DEC, 0, 0x02,
2686 "New IE present", HFILL
2689 { &hf_fp_rach_new_ie_flag[7],
2690 { "Another new IE flags byte",
2691 "fp.rach.new-ie-flags-byte", FT_UINT8, BASE_DEC, 0, 0x01,
2692 "Another new IE flags byte", HFILL
2695 { &hf_fp_cell_portion_id,
2696 { "Cell Portion ID",
2697 "fp.cell-portion-id", FT_UINT8, BASE_DEC, NULL, 0x3f,
2698 "Cell Portion ID", HFILL
2702 { &hf_fp_radio_interface_parameter_update_flag[0],
2704 "fp.radio_interface_param.cfn-valid", FT_UINT16, BASE_DEC, 0, 0x0001,
2708 { &hf_fp_radio_interface_parameter_update_flag[1],
2710 "fp.radio_interface_param.tpc-po-valid", FT_UINT16, BASE_DEC, 0, 0x0002,
2711 "TPC PO valid", HFILL
2714 { &hf_fp_radio_interface_parameter_update_flag[2],
2716 "fp.radio_interface_param.dpc-mode-valid", FT_UINT16, BASE_DEC, 0, 0x0004,
2717 "DPC mode valid", HFILL
2720 { &hf_fp_radio_interface_parameter_update_flag[3],
2721 { "RL sets indicator valid",
2722 "fp.radio_interface_param.rl-sets-indicator-valid", FT_UINT16, BASE_DEC, 0, 0x0020,
2726 { &hf_fp_radio_interface_parameter_update_flag[4],
2727 { "MAX_UE_TX_POW valid",
2728 "fp.radio_interface_param.max-ue-tx-pow-valid", FT_UINT16, BASE_DEC, 0, 0x0040,
2729 "MAX UE TX POW valid", HFILL
2734 "fp.dpc-mode", FT_UINT8, BASE_DEC, NULL, 0x20,
2735 "DPC Mode to be applied in the uplink", HFILL
2740 "fp.tpc-po", FT_UINT8, BASE_DEC, NULL, 0x1f,
2744 { &hf_fp_multiple_rl_set_indicator,
2745 { "Multiple RL sets indicator",
2746 "fp.multiple-rl-sets-indicator", FT_UINT8, BASE_DEC, NULL, 0x80,
2747 "Multiple RL sets indicator", HFILL
2750 { &hf_fp_max_ue_tx_pow,
2752 "fp.max-ue-tx-pow", FT_INT8, BASE_DEC, NULL, 0x0,
2753 "Max UE TX POW (dBm)", HFILL
2756 { &hf_fp_congestion_status,
2757 { "Congestion Status",
2758 "fp.congestion-status", FT_UINT8, BASE_DEC, VALS(congestion_status_vals), 0x03,
2759 "Congestion Status", HFILL
2766 static gint *ett[] =
2771 &ett_fp_edch_subframe_header,
2772 &ett_fp_edch_subframe,
2773 &ett_fp_hsdsch_new_ie_flags,
2774 &ett_fp_rach_new_ie_flags
2777 /* Register protocol. */
2778 proto_fp = proto_register_protocol("FP", "FP", "fp");
2779 proto_register_field_array(proto_fp, hf, array_length(hf));
2780 proto_register_subtree_array(ett, array_length(ett));
2782 /* Allow other dissectors to find this one by name. */
2783 register_dissector("fp", dissect_fp, proto_fp);
2787 void proto_reg_handoff_fp(void)