Commit 0ecd346b authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/NR_UE_data_scrambling_fix' into integration_2024_w12

parents c45fb431 91e5d800
...@@ -494,6 +494,7 @@ typedef struct { ...@@ -494,6 +494,7 @@ typedef struct {
uint32_t tbslbrm; uint32_t tbslbrm;
uint8_t nscid; uint8_t nscid;
uint16_t dlDmrsScramblingId; uint16_t dlDmrsScramblingId;
uint16_t dlDataScramblingId;
uint16_t pduBitmap; uint16_t pduBitmap;
uint32_t k1_feedback; uint32_t k1_feedback;
uint8_t ldpcBaseGraph; uint8_t ldpcBaseGraph;
......
...@@ -55,11 +55,7 @@ ...@@ -55,11 +55,7 @@
//extern int32_t uplink_counter; //extern int32_t uplink_counter;
void nr_pusch_codeword_scrambling_uci(uint8_t *in, void nr_pusch_codeword_scrambling_uci(uint8_t *in, uint32_t size, uint32_t Nid, uint32_t n_RNTI, uint32_t* out)
uint32_t size,
uint32_t Nid,
uint32_t n_RNTI,
uint32_t* out)
{ {
uint8_t reset, b_idx; uint8_t reset, b_idx;
uint32_t x1 = 0, x2 = 0, s = 0, temp_out = 0; uint32_t x1 = 0, x2 = 0, s = 0, temp_out = 0;
...@@ -93,12 +89,7 @@ void nr_pusch_codeword_scrambling_uci(uint8_t *in, ...@@ -93,12 +89,7 @@ void nr_pusch_codeword_scrambling_uci(uint8_t *in,
} }
} }
void nr_pusch_codeword_scrambling(uint8_t *in, void nr_pusch_codeword_scrambling(uint8_t *in, uint32_t size, uint32_t Nid, uint32_t n_RNTI, bool uci_on_pusch, uint32_t* out)
uint32_t size,
uint32_t Nid,
uint32_t n_RNTI,
bool uci_on_pusch,
uint32_t* out)
{ {
if (uci_on_pusch) if (uci_on_pusch)
nr_pusch_codeword_scrambling_uci(in, size, Nid, n_RNTI, out); nr_pusch_codeword_scrambling_uci(in, size, Nid, n_RNTI, out);
...@@ -221,7 +212,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ...@@ -221,7 +212,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
nr_pusch_codeword_scrambling(harq_process_ul_ue->f, nr_pusch_codeword_scrambling(harq_process_ul_ue->f,
available_bits, available_bits,
ulsch_ue->Nid_cell, pusch_pdu->data_scrambling_id,
rnti, rnti,
false, false,
scrambled_output); scrambled_output);
......
...@@ -691,7 +691,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t * ...@@ -691,7 +691,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
nr_dlsch_unscrambling(llr[0], nr_dlsch_unscrambling(llr[0],
dl_harq0->G, dl_harq0->G,
0, 0,
ue->frame_parms.Nid_cell, dlsch[0].dlsch_config.dlDataScramblingId,
dlsch[0].rnti); dlsch[0].rnti);
...@@ -787,7 +787,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t * ...@@ -787,7 +787,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
nr_dlsch_unscrambling(llr[1], nr_dlsch_unscrambling(llr[1],
dl_harq1->G, dl_harq1->G,
0, 0,
ue->frame_parms.Nid_cell, dlsch[1].dlsch_config.dlDataScramblingId,
dlsch[1].rnti); dlsch[1].rnti);
stop_meas(&ue->dlsch_unscrambling_stats); stop_meas(&ue->dlsch_unscrambling_stats);
......
...@@ -374,6 +374,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -374,6 +374,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
dci_pdu_rel15_t *dci, dci_pdu_rel15_t *dci,
RAR_grant_t *rar_grant, RAR_grant_t *rar_grant,
uint16_t rnti, uint16_t rnti,
int ss_type,
const nr_dci_format_t dci_format); const nr_dci_format_t dci_format);
int nr_rrc_mac_config_req_sl_preconfig(module_id_t module_id, int nr_rrc_mac_config_req_sl_preconfig(module_id_t module_id,
......
...@@ -189,10 +189,8 @@ int get_rnti_type(const NR_UE_MAC_INST_t *mac, const uint16_t rnti) ...@@ -189,10 +189,8 @@ int get_rnti_type(const NR_UE_MAC_INST_t *mac, const uint16_t rnti)
} else { } else {
AssertFatal(1 == 0, "Not identified/handled rnti %d \n", rnti); AssertFatal(1 == 0, "Not identified/handled rnti %d \n", rnti);
} }
LOG_D(MAC, "Returning rnti_type %s \n", rnti_types(rnti_type));
LOG_D(MAC, "Returning rnti_type %s \n", rnti_types(rnti_type)); return rnti_type;
return rnti_type;
} }
void nr_ue_decode_mib(NR_UE_MAC_INST_t *mac, int cc_id) void nr_ue_decode_mib(NR_UE_MAC_INST_t *mac, int cc_id)
...@@ -447,7 +445,7 @@ static int nr_ue_process_dci_ul_00(NR_UE_MAC_INST_t *mac, ...@@ -447,7 +445,7 @@ static int nr_ue_process_dci_ul_00(NR_UE_MAC_INST_t *mac,
if (!pdu) if (!pdu)
return -1; return -1;
int ret = nr_config_pusch_pdu(mac, &tda_info, &pdu->pusch_config_pdu, dci, NULL, dci_ind->rnti, NR_UL_DCI_FORMAT_0_0); int ret = nr_config_pusch_pdu(mac, &tda_info, &pdu->pusch_config_pdu, dci, NULL, dci_ind->rnti, dci_ind->ss_type, NR_UL_DCI_FORMAT_0_0);
if (ret != 0) if (ret != 0)
remove_ul_config_last_item(pdu); remove_ul_config_last_item(pdu);
release_ul_config(pdu, false); release_ul_config(pdu, false);
...@@ -520,7 +518,7 @@ static int nr_ue_process_dci_ul_01(NR_UE_MAC_INST_t *mac, ...@@ -520,7 +518,7 @@ static int nr_ue_process_dci_ul_01(NR_UE_MAC_INST_t *mac,
fapi_nr_ul_config_request_pdu_t *pdu = lockGet_ul_config(mac, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH); fapi_nr_ul_config_request_pdu_t *pdu = lockGet_ul_config(mac, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH);
if (!pdu) if (!pdu)
return -1; return -1;
int ret = nr_config_pusch_pdu(mac, &tda_info, &pdu->pusch_config_pdu, dci, NULL, dci_ind->rnti, NR_UL_DCI_FORMAT_0_1); int ret = nr_config_pusch_pdu(mac, &tda_info, &pdu->pusch_config_pdu, dci, NULL, dci_ind->rnti, dci_ind->ss_type, NR_UL_DCI_FORMAT_0_1);
if (ret != 0) if (ret != 0)
remove_ul_config_last_item(pdu); remove_ul_config_last_item(pdu);
release_ul_config(pdu, false); release_ul_config(pdu, false);
...@@ -664,6 +662,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac, ...@@ -664,6 +662,13 @@ static int nr_ue_process_dci_dl_10(NR_UE_MAC_INST_t *mac,
else else
dlsch_pdu->dlDmrsScramblingId = mac->physCellId; dlsch_pdu->dlDmrsScramblingId = mac->physCellId;
if (get_rnti_type(mac, dci_ind->rnti) == TYPE_C_RNTI_
&& dci_ind->ss_type != NR_SearchSpace__searchSpaceType_PR_common
&& pdsch_config->dataScramblingIdentityPDSCH)
dlsch_pdu->dlDataScramblingId = *pdsch_config->dataScramblingIdentityPDSCH;
else
dlsch_pdu->dlDataScramblingId = mac->physCellId;
/* dmrs symbol positions*/ /* dmrs symbol positions*/
dlsch_pdu->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, dlsch_pdu->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
NR_DL_DCI_FORMAT_1_0, NR_DL_DCI_FORMAT_1_0,
...@@ -975,6 +980,11 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac, ...@@ -975,6 +980,11 @@ static int nr_ue_process_dci_dl_11(NR_UE_MAC_INST_t *mac,
return -1; return -1;
} }
if (pdsch_Config->dataScramblingIdentityPDSCH)
dlsch_pdu->dlDataScramblingId = *pdsch_Config->dataScramblingIdentityPDSCH;
else
dlsch_pdu->dlDataScramblingId = mac->physCellId;
dlsch_pdu->dmrsConfigType = dl_dmrs_config->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2; dlsch_pdu->dmrsConfigType = dl_dmrs_config->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214, /* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
...@@ -3979,7 +3989,14 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d ...@@ -3979,7 +3989,14 @@ static void nr_ue_process_rar(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *d
if (!pdu) if (!pdu)
return; return;
// Config Msg3 PDU // Config Msg3 PDU
int ret = nr_config_pusch_pdu(mac, &tda_info, &pdu->pusch_config_pdu, NULL, &rar_grant, rnti, NR_DCI_NONE); int ret = nr_config_pusch_pdu(mac,
&tda_info,
&pdu->pusch_config_pdu,
NULL,
&rar_grant,
rnti,
NR_SearchSpace__searchSpaceType_PR_common,
NR_DCI_NONE);
if (ret != 0) if (ret != 0)
remove_ul_config_last_item(pdu); remove_ul_config_last_item(pdu);
release_ul_config(pdu, false); release_ul_config(pdu, false);
......
...@@ -502,6 +502,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -502,6 +502,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
dci_pdu_rel15_t *dci, dci_pdu_rel15_t *dci,
RAR_grant_t *rar_grant, RAR_grant_t *rar_grant,
uint16_t rnti, uint16_t rnti,
int ss_type,
const nr_dci_format_t dci_format) const nr_dci_format_t dci_format)
{ {
uint16_t l_prime_mask = 0; uint16_t l_prime_mask = 0;
...@@ -513,10 +514,10 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -513,10 +514,10 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
// Common configuration // Common configuration
pusch_config_pdu->dmrs_config_type = pusch_dmrs_type1; pusch_config_pdu->dmrs_config_type = pusch_dmrs_type1;
pusch_config_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; pusch_config_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
pusch_config_pdu->nrOfLayers = 1; pusch_config_pdu->nrOfLayers = 1;
pusch_config_pdu->Tpmi = 0; pusch_config_pdu->Tpmi = 0;
pusch_config_pdu->rnti = rnti; pusch_config_pdu->rnti = rnti;
pusch_dmrs_AdditionalPosition_t add_pos = pusch_dmrs_pos2; pusch_dmrs_AdditionalPosition_t add_pos = pusch_dmrs_pos2;
int dmrslength = 1; int dmrslength = 1;
...@@ -625,16 +626,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -625,16 +626,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->transform_precoding = get_transformPrecoding(current_UL_BWP, dci_format, 0); pusch_config_pdu->transform_precoding = get_transformPrecoding(current_UL_BWP, dci_format, 0);
/*DCI format-related configuration*/ /*DCI format-related configuration*/
int target_ss;
if (dci_format == NR_UL_DCI_FORMAT_0_0) { if (dci_format == NR_UL_DCI_FORMAT_0_0) {
target_ss = NR_SearchSpace__searchSpaceType_PR_common;
if ((pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) && if ((pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) &&
pusch_config_pdu->nr_of_symbols < 3) pusch_config_pdu->nr_of_symbols < 3)
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 1; pusch_config_pdu->num_dmrs_cdm_grps_no_data = 1;
else else
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2; pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
} else if (dci_format == NR_UL_DCI_FORMAT_0_1) { } else if (dci_format == NR_UL_DCI_FORMAT_0_1) {
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
ul_layers_config(mac, pusch_config_pdu, dci, dci_format); ul_layers_config(mac, pusch_config_pdu, dci, dci_format);
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format); ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format);
} else { } else {
...@@ -652,6 +650,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -652,6 +650,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
} }
pusch_config_pdu->scid = 0; pusch_config_pdu->scid = 0;
pusch_config_pdu->data_scrambling_id = mac->physCellId;
if (pusch_Config->dataScramblingIdentityPUSCH
&& rnti_type == TYPE_C_RNTI_
&& !(dci_format == NR_UL_DCI_FORMAT_0_0 && ss_type == NR_SearchSpace__searchSpaceType_PR_common))
pusch_config_pdu->data_scrambling_id = *pusch_Config->dataScramblingIdentityPUSCH;
pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId; pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId;
if (dci_format == NR_UL_DCI_FORMAT_0_1) if (dci_format == NR_UL_DCI_FORMAT_0_1)
pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val; pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val;
...@@ -706,7 +710,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -706,7 +710,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
} }
/* FREQ_HOPPING_FLAG */ /* FREQ_HOPPING_FLAG */
if ((pusch_Config!=NULL) && (pusch_Config->frequencyHopping!=NULL) && (pusch_Config->resourceAllocation != NR_PUSCH_Config__resourceAllocation_resourceAllocationType0)){ if ((pusch_Config != NULL)
&& (pusch_Config->frequencyHopping != NULL)
&& (pusch_Config->resourceAllocation != NR_PUSCH_Config__resourceAllocation_resourceAllocationType0)) {
pusch_config_pdu->frequency_hopping = dci->frequency_hopping_flag.val; pusch_config_pdu->frequency_hopping = dci->frequency_hopping_flag.val;
} }
...@@ -714,17 +720,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -714,17 +720,12 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->mcs_index = dci->mcs; pusch_config_pdu->mcs_index = dci->mcs;
/* MCS TABLE */ /* MCS TABLE */
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) { pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_TableTransformPrecoder : NULL,
pusch_config_pdu->mcs_table = pusch_config_pdu->transform_precoding != NR_PUSCH_Config__transformPrecoder_disabled,
get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_Table : NULL, 0, dci_format, rnti_type, target_ss, false); dci_format,
} else { rnti_type,
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_TableTransformPrecoder : NULL, ss_type,
1, false);
dci_format,
rnti_type,
target_ss,
false);
}
/* NDI */ /* NDI */
NR_UL_HARQ_INFO_t *harq = &mac->ul_harq_info[dci->harq_pid]; NR_UL_HARQ_INFO_t *harq = &mac->ul_harq_info[dci->harq_pid];
......
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