Commit 35c4f94e authored by cig's avatar cig

Introduced a new function to retrieve the transformPrecoding status

- this return whether the transform precoder is enabled or not
- redundant configuration code has been migrated to the new function
- get_transformPrecoding is a common MAC function used already
  @ UE side, can be adopted by gNB too
parent c99c0431
...@@ -2284,6 +2284,46 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) { ...@@ -2284,6 +2284,46 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) {
return 4; return 4;
} }
// Set the transform precoding status according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16:
// - "UE procedure for applying transform precoding on PUSCH"
uint8_t get_transformPrecoding(NR_ServingCellConfigCommon_t *scc,
NR_PUSCH_Config_t *pusch_config,
NR_BWP_Uplink_t *ubwp,
uint8_t *dci_format,
int rnti_type,
uint8_t configuredGrant){
uint8_t cg_transformPrecoder = 0;
if (configuredGrant) {
if (ubwp->bwp_Dedicated->configuredGrantConfig){
if (ubwp->bwp_Dedicated->configuredGrantConfig->choice.setup->transformPrecoder){
return *ubwp->bwp_Dedicated->configuredGrantConfig->choice.setup->transformPrecoder;
} else {
cg_transformPrecoder = 1;
}
}
}
if (rnti_type == NR_RNTI_RA || *dci_format == NR_UL_DCI_FORMAT_0_0 || cg_transformPrecoder){
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) {
return 1;
} else {
return 0;
}
} else if (*dci_format != NR_UL_DCI_FORMAT_0_0 && pusch_config->transformPrecoder != NULL) {
return *pusch_config->transformPrecoder;
}
LOG_E(MAC, "In %s: could not fetch transform precoder status...\n", __FUNCTION__);
return -1;
}
uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc, uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
dci_pdu_rel15_t *dci_pdu, dci_pdu_rel15_t *dci_pdu,
...@@ -2413,16 +2453,8 @@ uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc, ...@@ -2413,16 +2453,8 @@ uint16_t nr_dci_size(NR_ServingCellConfigCommon_t *scc,
} }
} }
// Precoding info and number of layers // Precoding info and number of layers
long transformPrecoder; long transformPrecoder = get_transformPrecoding(scc, pusch_Config, ubwp, (uint8_t*)&format, rnti_type, 0);
if (pusch_Config->transformPrecoder == NULL){
// if transform precoder is null, apply the values from msg3
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
transformPrecoder = 1;
else
transformPrecoder = 0;
}
else
transformPrecoder = *pusch_Config->transformPrecoder;
if (pusch_Config->txConfig != NULL){ if (pusch_Config->txConfig != NULL){
if (*pusch_Config->txConfig == NR_PUSCH_Config__txConfig_codebook){ if (*pusch_Config->txConfig == NR_PUSCH_Config__txConfig_codebook){
if (pusch_antenna_ports > 1) { if (pusch_antenna_ports > 1) {
......
...@@ -130,4 +130,18 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config, ...@@ -130,4 +130,18 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols); uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
@param *pusch_config, pointer to pusch config
@param *ubwp pointer to uplink bwp
@param *dci_format pointer to dci format
@param rnti_type rnti type
@param configuredGrant indicates whether a configured grant was received or not
@returns transformPrecoding value */
uint8_t get_transformPrecoding(NR_ServingCellConfigCommon_t *scc,
NR_PUSCH_Config_t *pusch_config,
NR_BWP_Uplink_t *ubwp,
uint8_t *dci_format,
int rnti_type,
uint8_t configuredGrant);
#endif #endif
...@@ -1979,6 +1979,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr ...@@ -1979,6 +1979,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; NR_BWP_Id_t bwp_id = mac->UL_BWP_Id;
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
fapi_nr_ul_config_request_t *ul_config = NULL; fapi_nr_ul_config_request_t *ul_config = NULL;
int rnti_type = get_rnti_type(mac, rnti);
//const uint16_t n_RB_DLBWP = dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15.N_RB_BWP; //make sure this has been set //const uint16_t n_RB_DLBWP = dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15.N_RB_BWP; //make sure this has been set
AssertFatal(mac->DLbwp[0]!=NULL,"DLbwp[0] should not be zero here!\n"); AssertFatal(mac->DLbwp[0]!=NULL,"DLbwp[0] should not be zero here!\n");
...@@ -2061,10 +2062,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr ...@@ -2061,10 +2062,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
pusch_config_pdu_0_0->mcs_index = dci->mcs; pusch_config_pdu_0_0->mcs_index = dci->mcs;
/* MCS TABLE */ /* MCS TABLE */
if (mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) if (rnti_type != NR_RNTI_CS || (rnti_type == NR_RNTI_CS && dci->ndi == 1)) {
pusch_config_pdu_0_0->transform_precoding = 1; pusch_config_pdu_0_0->transform_precoding = get_transformPrecoding(mac->scc, pusch_config, NULL, &dci_format, rnti_type, 0);
else }
pusch_config_pdu_0_0->transform_precoding = 0;
if (pusch_config_pdu_0_0->transform_precoding == transform_precoder_disabled) if (pusch_config_pdu_0_0->transform_precoding == transform_precoder_disabled)
pusch_config_pdu_0_0->mcs_table = get_pusch_mcs_table(pusch_config->mcs_Table, 0, pusch_config_pdu_0_0->mcs_table = get_pusch_mcs_table(pusch_config->mcs_Table, 0,
...@@ -2193,14 +2193,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr ...@@ -2193,14 +2193,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
/* MCS */ /* MCS */
pusch_config_pdu_0_1->mcs_index = dci->mcs; pusch_config_pdu_0_1->mcs_index = dci->mcs;
/* MCS TABLE */ /* MCS TABLE */
if (pusch_config->transformPrecoder == NULL) {
if (mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) if (rnti_type != NR_RNTI_CS || (rnti_type == NR_RNTI_CS && dci->ndi == 1)) {
pusch_config_pdu_0_1->transform_precoding = 1; pusch_config_pdu_0_1->transform_precoding = get_transformPrecoding(mac->scc, pusch_config, NULL, &dci_format, rnti_type, 0);
else
pusch_config_pdu_0_1->transform_precoding = 0;
} }
else
pusch_config_pdu_0_1->transform_precoding = *pusch_config->transformPrecoder;
if (pusch_config_pdu_0_1->transform_precoding == transform_precoder_disabled) if (pusch_config_pdu_0_1->transform_precoding == transform_precoder_disabled)
pusch_config_pdu_0_1->mcs_table = get_pusch_mcs_table(pusch_config->mcs_Table, 0, pusch_config_pdu_0_1->mcs_table = get_pusch_mcs_table(pusch_config->mcs_Table, 0,
......
...@@ -153,10 +153,7 @@ void nr_config_Msg3_pdu(NR_UE_MAC_INST_t *mac, ...@@ -153,10 +153,7 @@ void nr_config_Msg3_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->scid = 0; pusch_config_pdu->scid = 0;
// Transform precoding according to 6.1.3 UE procedure for applying transform precoding on PUSCH in 38.214 // Transform precoding according to 6.1.3 UE procedure for applying transform precoding on PUSCH in 38.214
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) pusch_config_pdu->transform_precoding = get_transformPrecoding(scc, pusch_Config, NULL, NULL, NR_RNTI_RA, 0);
pusch_config_pdu->transform_precoding = 1;
else
pusch_config_pdu->transform_precoding = 0;
// Resource allocation in frequency domain according to 6.1.2.2 in TS 38.214 // Resource allocation in frequency domain according to 6.1.2.2 in TS 38.214
pusch_config_pdu->resource_alloc = pusch_Config->resourceAllocation; pusch_config_pdu->resource_alloc = pusch_Config->resourceAllocation;
......
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