Commit 393185df authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/Refactor_UL_MAC_PDU_decoding' into...

Merge remote-tracking branch 'origin/Refactor_UL_MAC_PDU_decoding' into integration_2024_w49 (!3129)

Refactor UL MAC PDU decoding

Refactor the UL MAC PDU decoding: A single function is created to decode the
entire MAC subheader
uint8_t decode_ul_mac_sub_pdu_header(uint8_t *pduP, uint8_t *lcid, uint16_t *length).
It returns the length of the MAC subheader and outputs the LCID and Length.

This new function is called from 2 functions: lcid_crnti_lookahead() and
nr_process_mac_pdu().

After calling it in nr_process_mac_pdu(), the validation of the PDU can be
made for all the MAC subPDUs in a single place, allowing for less and more
clean code (as opposed with the previous version where the validation was
made multiple times inside the LCID switch-case).

Additionally, this MR updates the list of LCIDs as in 3GPP TS 38.321 v18.3.0
Table 6.2.1-2: Values of LCID for UL-SCH when the LX field is not present or
is set to 0.
parents 2fad0001 99ea7146
......@@ -427,12 +427,24 @@ typedef struct {
#define DL_SCH_LCID_CON_RES_ID 0x3E
#define DL_SCH_LCID_PADDING 0x3F
#define UL_SCH_LCID_CCCH1 0x00
#define UL_SCH_LCID_CCCH_64_BITS 0x00
#define UL_SCH_LCID_SRB1 0x01
#define UL_SCH_LCID_SRB2 0x02
#define UL_SCH_LCID_SRB3 0x03
#define UL_SCH_LCID_DTCH 0x04
#define UL_SCH_LCID_CCCH 0x34
#define UL_SCH_LCID_EXTENDED_LCID_2_OCT 0x21
#define UL_SCH_LCID_EXTENDED_LCID_1_OCT 0x22
#define UL_SCH_LCID_CCCH_48_BITS_REDCAP 0x23
#define UL_SCH_LCID_CCCH_64_BITS_REDCAP 0x24
#define UL_SCH_LCID_TRUNCATED_ENHANCED_BFR 0x2B
#define UL_SCH_LCID_TIMING_ADVANCE_REPORT 0x2C
#define UL_SCH_LCID_TRUNCATED_SIDELINK_BSR 0x2D
#define UL_SCH_LCID_SIDELINK_BSR 0x2E
#define UL_SCH_LCID_LBT_FAILURE_4_OCT 0x30
#define UL_SCH_LCID_LBT_FAILURE_1_OCT 0x31
#define UL_SCH_LCID_BFR 0x32
#define UL_SCH_LCID_TRUNCATED_BFR 0x33
#define UL_SCH_LCID_CCCH_48_BITS 0x34
#define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35
#define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
......
......@@ -656,7 +656,7 @@ static uint8_t *fill_msg3_pdu_from_rlc(NR_UE_MAC_INST_t *mac, uint8_t *pdu, int
{
RA_config_t *ra = &mac->ra;
// regular Msg3/MsgA_PUSCH with PDU coming from higher layers
*(NR_MAC_SUBHEADER_FIXED *)pdu = (NR_MAC_SUBHEADER_FIXED){.LCID = UL_SCH_LCID_CCCH};
*(NR_MAC_SUBHEADER_FIXED *)pdu = (NR_MAC_SUBHEADER_FIXED){.LCID = UL_SCH_LCID_CCCH_48_BITS};
pdu += sizeof(NR_MAC_SUBHEADER_FIXED);
tbs_size_t len = mac_rlc_data_req(mac->ue_id,
mac->ue_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment