@@ -123,6 +123,8 @@ static int hf_mac_lte_dlsch_lcid = -1;
123123static int hf_mac_lte_ulsch_lcid = -1 ;
124124static int hf_mac_lte_sch_extended = -1 ;
125125static int hf_mac_lte_sch_format = -1 ;
126+ static int hf_mac_lte_sch_reserved2 = -1 ;
127+ static int hf_mac_lte_sch_elcid = -1 ;
126128static int hf_mac_lte_sch_length = -1 ;
127129static int hf_mac_lte_mch_reserved = -1 ;
128130static int hf_mac_lte_mch_format2 = -1 ;
@@ -596,6 +598,7 @@ static const true_false_string mac_lte_scell_status_vals = {
596598 "Deactivated"
597599};
598600
601+ #define EXT_LOGICAL_CHANNEL_ID_LCID 0x10
599602#define ACTIVATION_DEACTIVATION_CSI_RS_LCID 0x15
600603#define RECOMMENDED_BIT_RATE_LCID 0x16
601604#define SC_PTM_STOP_INDICATION_LCID 0x17
@@ -621,6 +624,7 @@ static const value_string dlsch_lcid_vals[] =
621624 { 8 , "8" },
622625 { 9 , "9" },
623626 { 10 , "10" },
627+ { EXT_LOGICAL_CHANNEL_ID_LCID , "Extended logical channel ID field" },
624628 { ACTIVATION_DEACTIVATION_CSI_RS_LCID , "Activation/Deactivation of CSI-RS" },
625629 { RECOMMENDED_BIT_RATE_LCID , "Recommended Bit Rate" },
626630 { SC_PTM_STOP_INDICATION_LCID , "SC-PTM Stop Indication" },
@@ -662,6 +666,7 @@ static const value_string ulsch_lcid_vals[] =
662666 { 10 , "10" },
663667 { 11 , "CCCH (Category 0)" },
664668 { 12 , "CCCH (frequency hopping for unicast)" },
669+ { EXT_LOGICAL_CHANNEL_ID_LCID , "Extended logical channel ID field" },
665670 { RECOMMENDED_BIT_RATE_QUERY_LCID , "Recommended Bit Rate Query" },
666671 { SPS_CONFIRMATION_LCID , "SPS Confirmation" },
667672 { TRUNCATED_SIDELINK_BSR_LCID , "Truncated Sidelink BSR" },
@@ -1557,7 +1562,7 @@ typedef struct dynamic_lcid_drb_mapping_t {
15571562} dynamic_lcid_drb_mapping_t ;
15581563
15591564typedef struct ue_dynamic_drb_mappings_t {
1560- dynamic_lcid_drb_mapping_t mapping [11 ]; /* Index is LCID */
1565+ dynamic_lcid_drb_mapping_t mapping [39 ]; /* Index is LCID */
15611566 guint8 drb_to_lcid_mappings [32 ]; /* Also map drbid -> lcid */
15621567} ue_dynamic_drb_mappings_t ;
15631568
@@ -4445,6 +4450,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
44454450 /* Keep track of LCIDs and lengths as we dissect the header */
44464451 guint16 number_of_headers = 0 ;
44474452 guint8 lcids [MAX_HEADERS_IN_PDU ];
4453+ guint8 elcids [MAX_HEADERS_IN_PDU ];
44484454 gint32 pdu_lengths [MAX_HEADERS_IN_PDU ];
44494455
44504456 proto_item * pdu_header_ti ;
@@ -4545,6 +4551,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
45454551 proto_item * ti ;
45464552 gint offset_start_subheader = offset ;
45474553 guint8 first_byte = tvb_get_guint8 (tvb , offset );
4554+ const gchar * lcid_str ;
45484555
45494556 /* Add PDU block header subtree.
45504557 Default with length of 1 byte. */
@@ -4583,37 +4590,45 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
45834590
45844591 lcid_ti = proto_tree_add_item (pdu_subheader_tree , hf_mac_lte_ulsch_lcid ,
45854592 tvb , offset , 1 , ENC_BIG_ENDIAN );
4586- write_pdu_label_and_info (pdu_ti , NULL , pinfo ,
4587- "(%s" ,
4588- val_to_str_const (lcids [number_of_headers ],
4589- ulsch_lcid_vals , "(Unknown LCID)" ));
4590- if (lcids [number_of_headers ] == 11 || lcids [number_of_headers ] == 12 ) {
4591- /* This LCID is used for CCCH by Category 0 devices / devices using frequency hopping for unicast
4592- Let's remap it to LCID 0 for statistics and other checks */
4593- lcids [number_of_headers ] = 0 ;
4593+ if (lcids [number_of_headers ] != EXT_LOGICAL_CHANNEL_ID_LCID ) {
4594+ write_pdu_label_and_info (pdu_ti , NULL , pinfo ,
4595+ "(%s" ,
4596+ val_to_str_const (lcids [number_of_headers ],
4597+ ulsch_lcid_vals , "(Unknown LCID)" ));
4598+ if (lcids [number_of_headers ] == 11 || lcids [number_of_headers ] == 12 ) {
4599+ /* This LCID is used for CCCH by Category 0 devices / devices using frequency hopping for unicast
4600+ Let's remap it to LCID 0 for statistics and other checks */
4601+ lcids [number_of_headers ] = 0 ;
4602+ }
4603+ } else {
4604+ write_pdu_label_and_info (pdu_ti , NULL , pinfo , "(%u" , tvb_get_guint8 (tvb , offset + 1 ) + 32 );
45944605 }
45954606 }
45964607 else {
45974608 /* Downlink */
45984609 lcid_ti = proto_tree_add_item (pdu_subheader_tree , hf_mac_lte_dlsch_lcid ,
45994610 tvb , offset , 1 , ENC_BIG_ENDIAN );
4600- write_pdu_label_and_info (pdu_ti , NULL , pinfo ,
4601- "(%s" ,
4602- val_to_str_const (lcids [number_of_headers ],
4603- dlsch_lcid_vals , "(Unknown LCID)" ));
4604-
4605- if ((lcids [number_of_headers ] == DRX_COMMAND_LCID ) ||
4606- (lcids [number_of_headers ] == LONG_DRX_COMMAND_LCID )) {
4607- expert_add_info_format (pinfo , lcid_ti , & ei_mac_lte_dlsch_lcid ,
4608- "%sDRX command received for UE %u (RNTI %u)" ,
4609- (lcids [number_of_headers ] == LONG_DRX_COMMAND_LCID ) ? "Long " :"" ,
4610- p_mac_lte_info -> ueid , p_mac_lte_info -> rnti );
4611+ if (lcids [number_of_headers ] != EXT_LOGICAL_CHANNEL_ID_LCID ) {
4612+ write_pdu_label_and_info (pdu_ti , NULL , pinfo ,
4613+ "(%s" ,
4614+ val_to_str_const (lcids [number_of_headers ],
4615+ dlsch_lcid_vals , "(Unknown LCID)" ));
4616+
4617+ if ((lcids [number_of_headers ] == DRX_COMMAND_LCID ) ||
4618+ (lcids [number_of_headers ] == LONG_DRX_COMMAND_LCID )) {
4619+ expert_add_info_format (pinfo , lcid_ti , & ei_mac_lte_dlsch_lcid ,
4620+ "%sDRX command received for UE %u (RNTI %u)" ,
4621+ (lcids [number_of_headers ] == LONG_DRX_COMMAND_LCID ) ? "Long " :"" ,
4622+ p_mac_lte_info -> ueid , p_mac_lte_info -> rnti );
4623+ }
4624+ } else {
4625+ write_pdu_label_and_info (pdu_ti , NULL , pinfo , "(%u" , tvb_get_guint8 (tvb , offset + 1 ) + 32 );
46114626 }
46124627 }
46134628 offset ++ ;
46144629
46154630 /* Remember if we've seen a data subheader */
4616- if (lcids [number_of_headers ] <= 10 ) {
4631+ if (lcids [number_of_headers ] <= 10 || lcids [ number_of_headers ] == EXT_LOGICAL_CHANNEL_ID_LCID ) {
46174632 have_seen_data_header = TRUE;
46184633 expecting_body_data = TRUE;
46194634 }
@@ -4623,7 +4638,8 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
46234638
46244639 /* Show an expert item if a control subheader (except Padding) appears
46254640 *after* a data PDU */
4626- if (have_seen_data_header && (lcids [number_of_headers ] > 10 ) && (lcids [number_of_headers ] != PADDING_LCID )) {
4641+ if (have_seen_data_header && (lcids [number_of_headers ] > 10 ) &&
4642+ (lcids [number_of_headers ] != EXT_LOGICAL_CHANNEL_ID_LCID ) && (lcids [number_of_headers ] != PADDING_LCID )) {
46274643 expert_add_info_format (pinfo , lcid_ti , & ei_mac_lte_control_subheader_after_data_subheader ,
46284644 "%cL-SCH control subheaders should not appear after data subheaders" ,
46294645 (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ? 'U' : 'D' );
@@ -4662,6 +4678,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
46624678
46634679 /* Remember that we've seen non-padding control */
46644680 if ((lcids [number_of_headers ] > 10 ) &&
4681+ (lcids [number_of_headers ] != EXT_LOGICAL_CHANNEL_ID_LCID ) &&
46654682 (lcids [number_of_headers ] != PADDING_LCID ) &&
46664683 (lcids [number_of_headers ] != SC_MCCH_SC_MTCH_LCID )) {
46674684 have_seen_non_padding_control = TRUE;
@@ -4673,6 +4690,22 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
46734690 return ;
46744691 }
46754692
4693+ if (lcids [number_of_headers ] == EXT_LOGICAL_CHANNEL_ID_LCID ) {
4694+ guint8 elcid ;
4695+
4696+ ti = proto_tree_add_item (pdu_subheader_tree , hf_mac_lte_sch_reserved2 ,
4697+ tvb , offset , 1 , ENC_BIG_ENDIAN );
4698+ if (reserved != 0 ) {
4699+ expert_add_info_format (pinfo , ti , & ei_mac_lte_reserved_not_zero ,
4700+ "%cL-SCH header Reserved bits not zero" ,
4701+ (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ? 'U' : 'D' );
4702+ }
4703+ elcid = (tvb_get_guint8 (tvb , offset ) & 0x3f );
4704+ elcids [number_of_headers ] = elcid + 32 ;
4705+ proto_tree_add_uint_format_value (pdu_subheader_tree , hf_mac_lte_sch_elcid , tvb , offset ,
4706+ 1 , elcid , "%u (%u)" , elcids [number_of_headers ], elcid );
4707+ offset ++ ;
4708+ }
46764709
46774710 /********************************************************************/
46784711 /* Length field follows if not the last header or for a fixed-sized
@@ -4745,40 +4778,29 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
47454778 break ;
47464779 }
47474780
4781+ if (lcids [number_of_headers ] != EXT_LOGICAL_CHANNEL_ID_LCID ) {
4782+ lcid_str = val_to_str_const (initial_lcid , (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ?
4783+ ulsch_lcid_vals : dlsch_lcid_vals , "Unknown" );
4784+ } else {
4785+ lcid_str = wmem_strdup_printf (wmem_packet_scope (), "%u" , elcids [number_of_headers ]);
4786+ }
4787+
47484788 /* Append summary to subheader root */
4749- proto_item_append_text (pdu_subheader_ti , " (lcid=%s" ,
4750- val_to_str_const (initial_lcid ,
4751- (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ?
4752- ulsch_lcid_vals :
4753- dlsch_lcid_vals ,
4754- "Unknown" ));
4789+ proto_item_append_text (pdu_subheader_ti , " (lcid=%s" , lcid_str );
47554790
47564791 switch (pdu_lengths [number_of_headers ]) {
47574792 case -1 :
47584793 proto_item_append_text (pdu_subheader_ti , ", length is remainder)" );
4759- proto_item_append_text (pdu_header_ti , " (%s:remainder)" ,
4760- val_to_str_const (initial_lcid ,
4761- (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ?
4762- ulsch_lcid_vals : dlsch_lcid_vals ,
4763- "Unknown" ));
4794+ proto_item_append_text (pdu_header_ti , " (%s:remainder)" , lcid_str );
47644795 break ;
47654796 case 0 :
47664797 proto_item_append_text (pdu_subheader_ti , ")" );
4767- proto_item_append_text (pdu_header_ti , " (%s)" ,
4768- val_to_str_const (initial_lcid ,
4769- (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ?
4770- ulsch_lcid_vals : dlsch_lcid_vals ,
4771- "Unknown" ));
4798+ proto_item_append_text (pdu_header_ti , " (%s)" , lcid_str );
47724799 break ;
47734800 default :
47744801 proto_item_append_text (pdu_subheader_ti , ", length=%d)" ,
47754802 pdu_lengths [number_of_headers ]);
4776- proto_item_append_text (pdu_header_ti , " (%s:%u)" ,
4777- val_to_str_const (initial_lcid ,
4778- (p_mac_lte_info -> direction == DIRECTION_UPLINK ) ?
4779- ulsch_lcid_vals : dlsch_lcid_vals ,
4780- "Unknown" ),
4781- pdu_lengths [number_of_headers ]);
4803+ proto_item_append_text (pdu_header_ti , " (%s:%u)" , lcid_str , pdu_lengths [number_of_headers ]);
47824804 break ;
47834805 }
47844806
@@ -4832,7 +4854,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
48324854
48334855 for (n = 0 ; n < number_of_headers ; n ++ ) {
48344856 /* Get out of loop once see any data SDU subheaders */
4835- if ((lcids [n ] <= 10 ) ||
4857+ if ((lcids [n ] <= 10 ) || lcids [ n ] == EXT_LOGICAL_CHANNEL_ID_LCID ||
48364858 ((p_mac_lte_info -> direction == DIRECTION_DOWNLINK ) && (lcids [n ] == SC_MCCH_SC_MTCH_LCID ))) {
48374859 break ;
48384860 }
@@ -5980,8 +6002,14 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
59806002 data_length = (pdu_lengths [n ] == -1 ) ?
59816003 tvb_reported_length_remaining (tvb , offset ) :
59826004 pdu_lengths [n ];
5983- tap_info -> sdus_for_lcid [lcids [n ]]++ ;
5984- tap_info -> bytes_for_lcid [lcids [n ]] += data_length ;
6005+ if ((lcids [n ] >= 3 ) && (lcids [n ] <= 10 )) {
6006+ tap_info -> sdus_for_lcid [lcids [n ]]++ ;
6007+ tap_info -> bytes_for_lcid [lcids [n ]] += data_length ;
6008+ } else if ((lcids [n ] == EXT_LOGICAL_CHANNEL_ID_LCID ) &&
6009+ (elcids [n ] >= 32 ) && (elcids [n ] <= 38 )) {
6010+ tap_info -> sdus_for_lcid [elcids [n ]- 21 ]++ ;
6011+ tap_info -> bytes_for_lcid [elcids [n ]- 21 ] += data_length ;
6012+ }
59856013 offset += data_length ;
59866014 }
59876015 if (lcids [number_of_headers - 1 ] == PADDING_LCID ) {
@@ -6121,19 +6149,20 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
61216149 }
61226150 }
61236151
6124- else if ((lcids [n ] >= 3 ) && (lcids [n ] <= 10 )) {
6152+ else if ((( lcids [n ] >= 3 ) && (lcids [n ] <= 10 )) || ( lcids [ n ] == EXT_LOGICAL_CHANNEL_ID_LCID )) {
61256153
61266154 /* Look for mapping for this LCID to drb channel set by UAT table or through
61276155 configuration protocol. */
61286156 rlc_channel_type_t rlc_channel_type ;
61296157 guint8 seqnum_length ;
61306158 gint drb_id ;
61316159 gboolean rlc_ext_li_field ;
6160+ guint8 lcid = (lcids [n ] == EXT_LOGICAL_CHANNEL_ID_LCID ) ? elcids [n ] : lcids [n ];
61326161 guint8 priority = get_mac_lte_channel_priority (p_mac_lte_info -> ueid ,
6133- lcids [ n ] , p_mac_lte_info -> direction );
6162+ lcid , p_mac_lte_info -> direction );
61346163
61356164 lookup_rlc_channel_from_lcid (p_mac_lte_info -> ueid ,
6136- lcids [ n ] ,
6165+ lcid ,
61376166 p_mac_lte_info -> direction ,
61386167 & rlc_channel_type ,
61396168 & seqnum_length ,
@@ -6216,8 +6245,14 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
62166245 offset += data_length ;
62176246
62186247 /* Update tap sdu and byte count for this channel */
6219- tap_info -> sdus_for_lcid [lcids [n ]]++ ;
6220- tap_info -> bytes_for_lcid [lcids [n ]] += data_length ;
6248+ if ((lcids [n ] >= 3 ) && (lcids [n ] <= 10 )) {
6249+ tap_info -> sdus_for_lcid [lcids [n ]]++ ;
6250+ tap_info -> bytes_for_lcid [lcids [n ]] += data_length ;
6251+ } else if ((lcids [n ] == EXT_LOGICAL_CHANNEL_ID_LCID ) &&
6252+ (elcids [n ] >= 32 ) && (elcids [n ] <= 38 )) {
6253+ tap_info -> sdus_for_lcid [elcids [n ]- 21 ]++ ;
6254+ tap_info -> bytes_for_lcid [elcids [n ]- 21 ] += data_length ;
6255+ }
62216256 }
62226257
62236258 /* Was this a Msg3 that led to a CR answer? */
@@ -7665,7 +7700,7 @@ void set_mac_lte_channel_mapping(drb_mapping_t *drb_mapping)
76657700 lcid = drb_mapping -> lcid ;
76667701
76677702 /* Ignore if LCID is out of range */
7668- if ((lcid < 3 ) || (lcid > 10 )) {
7703+ if ((lcid < 3 ) || (lcid > 10 && lcid < 32 ) || ( lcid > 38 )) {
76697704 return ;
76707705 }
76717706 }
@@ -8266,6 +8301,18 @@ void proto_register_mac_lte(void)
82668301 "UL-SCH Logical Channel Identifier" , HFILL
82678302 }
82688303 },
8304+ { & hf_mac_lte_sch_reserved2 ,
8305+ { "SCH reserved bits" ,
8306+ "mac-lte.sch.reserved2" , FT_UINT8 , BASE_HEX , NULL , 0xc0 ,
8307+ NULL , HFILL
8308+ }
8309+ },
8310+ { & hf_mac_lte_sch_elcid ,
8311+ { "eLCID" ,
8312+ "mac-lte.sch.elcid" , FT_UINT8 , BASE_DEC , NULL , 0x3f ,
8313+ NULL , HFILL
8314+ }
8315+ },
82698316 { & hf_mac_lte_sch_format ,
82708317 { "Format" ,
82718318 "mac-lte.sch.format" , FT_BOOLEAN , 8 , TFS (& format_vals ), 0x80 ,
0 commit comments