mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 12:40:28 +00:00
Compare commits
1 Commits
metanoia-m
...
nullPointe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44bea3f58e |
@@ -763,11 +763,11 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF)
|
||||
{
|
||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
||||
AssertFatal(uci_ind != NULL, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
|
||||
AssertFatal(uci_ind, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
|
||||
*uci_ind = *ind;
|
||||
|
||||
uci_ind->uci_list = CALLOC(NFAPI_NR_UCI_IND_MAX_PDU, sizeof(nfapi_nr_uci_t));
|
||||
AssertFatal(uci_ind->uci_list != NULL, "Memory not allocated for uci_ind->uci_list in phy_nr_uci_indication.");
|
||||
AssertFatal(uci_ind->uci_list, "Memory not allocated for uci_ind->uci_list in phy_nr_uci_indication.");
|
||||
for (int i = 0; i < ind->num_ucis; i++)
|
||||
{
|
||||
uci_ind->uci_list[i] = ind->uci_list[i];
|
||||
|
||||
@@ -1485,9 +1485,9 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
|
||||
|
||||
int nfapi_p4_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t *config) {
|
||||
nfapi_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
|
||||
uint8_t *end = pPackedBuf + packedBufLen;
|
||||
uint8_t *pWritePackedMessage = pPackedBuf;
|
||||
uint8_t *pPackedLengthField = &pWritePackedMessage[4];
|
||||
uint8_t *end = (pPackedBuf == NULL) ? NULL : (uint8_t *)pPackedBuf + packedBufLen;
|
||||
uint8_t *pWritePackedMessage = (pPackedBuf == NULL) ? NULL : (uint8_t *)pPackedBuf;
|
||||
uint8_t *pPackedLengthField = (pPackedBuf == NULL) ? NULL : &pWritePackedMessage[4];
|
||||
uint32_t packedMsgLen;
|
||||
uint16_t packedMsgLen16;
|
||||
|
||||
|
||||
@@ -113,11 +113,10 @@ t_nrPolar_params *nr_polar_params(int8_t messageType, uint16_t messageLength, ui
|
||||
// printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams);
|
||||
//Else, initialize and add node to the end of the linked list.
|
||||
t_nrPolar_params *newPolarInitNode = calloc(sizeof(t_nrPolar_params),1);
|
||||
AssertFatal(newPolarInitNode, "[nr_polar_init] New t_nrPolar_params * could not be created");
|
||||
newPolarInitNode->busy=true;
|
||||
pthread_mutex_unlock(&PolarListMutex);
|
||||
|
||||
AssertFatal(newPolarInitNode != NULL, "[nr_polar_init] New t_nrPolar_params * could not be created");
|
||||
|
||||
// LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime);
|
||||
newPolarInitNode->idx = PolarKey;
|
||||
newPolarInitNode->nextPtr = NULL;
|
||||
|
||||
@@ -3392,7 +3392,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
if (dlsch0 != NULL){
|
||||
amp_rho_a = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_a)>>13); //amp=512 in full scale; dlsch0->sqrt_rho_a=8192in Q2.13, 1 in full scale
|
||||
amp_rho_b = (int16_t)(((int32_t)amp*dlsch0->sqrt_rho_b)>>13);
|
||||
} else{
|
||||
}else if (dlsch1 != NULL){
|
||||
amp_rho_a = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_a)>>13);
|
||||
amp_rho_b = (int16_t)(((int32_t)amp*dlsch1->sqrt_rho_b)>>13);
|
||||
}
|
||||
|
||||
@@ -56,13 +56,14 @@ double computeRhoA_eNB(uint8_t pa,
|
||||
|
||||
sqrt_rho_a_lin= pow(10,(0.05*rho_a_dB));
|
||||
|
||||
if (dlsch_eNB) {
|
||||
if (dlsch_eNB != NULL) {
|
||||
dlsch_eNB->sqrt_rho_a= (short) (sqrt_rho_a_lin*pow(2,13));
|
||||
dlsch_eNB->pa = pa;
|
||||
}
|
||||
|
||||
#if DEBUG_PC
|
||||
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n",p_a,pa_values[ pdsch_config_dedicated->p_a],dlsch_eNB->sqrt_rho_a);
|
||||
printf("eNB: p_a=%d, value=%f, sqrt_rho_a=%d\n", p_a, pa_values[pdsch_config_dedicated->p_a], dlsch_eNB->sqrt_rho_a);
|
||||
#endif
|
||||
}
|
||||
|
||||
return(rho_a_dB);
|
||||
}
|
||||
@@ -88,13 +89,14 @@ double computeRhoB_eNB(uint8_t pa,
|
||||
|
||||
sqrt_rho_b_lin= pow(10,(0.05*rho_b_dB));
|
||||
|
||||
if (dlsch_eNB) {
|
||||
if (dlsch_eNB != NULL) {
|
||||
dlsch_eNB->sqrt_rho_b= (short) (sqrt_rho_b_lin*pow(2,13));
|
||||
dlsch_eNB->pb = pb;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_PC
|
||||
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n",n_antenna_port,pb,ratioPB[1][pb],dlsch_eNB->sqrt_rho_b);
|
||||
printf("eNB: n_ant=%d, p_b=%d -> rho_b/rho_a=%f -> sqrt_rho_b=%d\n", n_antenna_port, pb, ratioPB[1][pb], dlsch_eNB->sqrt_rho_b);
|
||||
#endif
|
||||
}
|
||||
return(rho_b_dB);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ NR_gNB_ULSCH_t *find_nr_ulsch(PHY_VARS_gNB *gNB, uint16_t rnti, int pid)
|
||||
|
||||
for (int i = 0; i < gNB->max_nb_pusch; i++) {
|
||||
ulsch = &gNB->ulsch[i];
|
||||
AssertFatal(ulsch != NULL, "gNB->ulsch[%d] is null\n", i);
|
||||
AssertFatal(ulsch, "gNB->ulsch[%d] is null\n", i);
|
||||
if (!ulsch->active) {
|
||||
if (first_free_index == -1)
|
||||
first_free_index = i;
|
||||
|
||||
@@ -162,7 +162,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
pucch_pdu->bit_len_harq,pucch_pdu->sr_flag);
|
||||
|
||||
NR_gNB_PHY_STATS_t *phy_stats = get_phy_stats(gNB, pucch_pdu->rnti);
|
||||
AssertFatal(phy_stats != NULL, "phy_stats shouldn't be NULL\n");
|
||||
AssertFatal(phy_stats, "phy_stats shouldn't be NULL\n");
|
||||
phy_stats->frame = frame;
|
||||
NR_gNB_UCI_STATS_t *uci_stats = &phy_stats->uci_stats;
|
||||
|
||||
|
||||
@@ -594,10 +594,10 @@ int main(int argc, char **argv) {
|
||||
memset(buf,0,sizeof(buf));
|
||||
proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
|
||||
|
||||
if(!proc_fd)
|
||||
printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
|
||||
else {
|
||||
while(fgets(buf, 63, proc_fd))
|
||||
if (proc_fd == NULL) {
|
||||
printf("Error: cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
|
||||
} else {
|
||||
while (fgets(buf, 63, proc_fd) != NULL) {
|
||||
printf("%s", buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -683,14 +683,18 @@ int main(int argc, char **argv) {
|
||||
memset(buf,0,sizeof(buf));
|
||||
proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
|
||||
|
||||
if(!proc_fd)
|
||||
if (proc_fd == NULL) {
|
||||
printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
|
||||
else {
|
||||
while(fgets(buf, 63, proc_fd))
|
||||
} else {
|
||||
while(fgets(buf, 63, proc_fd)) {
|
||||
printf("%s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (proc_fd != NULL) {
|
||||
fclose(proc_fd);
|
||||
}
|
||||
|
||||
fclose(proc_fd);
|
||||
cpu_freq_GHz = ((double)atof(buf))/1e6;
|
||||
#else
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
|
||||
@@ -344,7 +344,7 @@ void do_UL_sig(sim_t *sim, uint16_t subframe, uint8_t abstraction_flag, LTE_DL_F
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
|
||||
txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
|
||||
AssertFatal(txdata != NULL,"txdata is null\n");
|
||||
AssertFatal(txdata, "txdata is null\n");
|
||||
|
||||
sf_offset = subframe*frame_parms->samples_per_tti;
|
||||
if (subframe>0) sf_offset_tdd = sf_offset - PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset;
|
||||
|
||||
@@ -2228,8 +2228,12 @@ int get_modchannel_index(char *buf, int debug, void *vdata, telnet_printfunc_t p
|
||||
}
|
||||
if (debug)
|
||||
LOG_I(UTIL, "%s received %s\n", __FUNCTION__, buf);
|
||||
webdatadef_t *tdata = (webdatadef_t *)vdata;
|
||||
tdata->numlines = 0;
|
||||
webdatadef_t *tdata = NULL;
|
||||
if (vdata != NULL) {
|
||||
tdata = (webdatadef_t *)vdata;
|
||||
tdata->numlines = 0;
|
||||
}
|
||||
|
||||
if (strncmp(buf, "set", 3) == 0) {
|
||||
return get_channel_params(buf, debug, vdata, prnt);
|
||||
}
|
||||
@@ -2246,7 +2250,7 @@ int get_modchannel_index(char *buf, int debug, void *vdata, telnet_printfunc_t p
|
||||
snprintf(tdata->tblname, sizeof(tdata->tblname) - 1, "No running model in the system");
|
||||
}
|
||||
}
|
||||
return tdata->numlines;
|
||||
return (tdata != NULL) ? tdata->numlines : -1;
|
||||
} /* get_currentchannel_type */
|
||||
/*------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -2825,7 +2825,7 @@ long get_transformPrecoding(const NR_UE_UL_BWP_t *current_UL_BWP, nr_dci_format_
|
||||
if (dci_format == NR_UL_DCI_FORMAT_0_1 && current_UL_BWP && current_UL_BWP->pusch_Config && current_UL_BWP->pusch_Config->transformPrecoder)
|
||||
return *current_UL_BWP->pusch_Config->transformPrecoder;
|
||||
|
||||
if (current_UL_BWP->rach_ConfigCommon && current_UL_BWP->rach_ConfigCommon->msg3_transformPrecoder)
|
||||
if (current_UL_BWP && current_UL_BWP->rach_ConfigCommon && current_UL_BWP->rach_ConfigCommon->msg3_transformPrecoder)
|
||||
return NR_PUSCH_Config__transformPrecoder_enabled;
|
||||
|
||||
return NR_PUSCH_Config__transformPrecoder_disabled;
|
||||
@@ -2850,7 +2850,7 @@ uint8_t get_pusch_nb_antenna_ports(NR_PUSCH_Config_t *pusch_Config,
|
||||
// shall be configured with the same value for all these SRS resources.
|
||||
if (srs_resource_set->usage == NR_SRS_ResourceSet__usage_codebook) {
|
||||
NR_SRS_Resource_t *srs_resource = srs_config->srs_ResourceToAddModList->list.array[sri];
|
||||
AssertFatal(srs_resource != NULL, "SRS resource indicated by DCI does not exist\n");
|
||||
AssertFatal(srs_resource, "SRS resource indicated by DCI does not exist\n");
|
||||
n_antenna_port = 1 << srs_resource->nrofSRS_Ports;
|
||||
break;
|
||||
}
|
||||
@@ -2989,6 +2989,10 @@ uint8_t compute_precoding_information(NR_PUSCH_Config_t *pusch_Config,
|
||||
const uint8_t *nrOfLayers,
|
||||
uint32_t *val) {
|
||||
|
||||
long max_rank = -1;
|
||||
long *ul_FullPowerTransmission = NULL;
|
||||
long *codebookSubset = NULL;
|
||||
|
||||
// It is only applicable to codebook based transmission. This field occupies 0 bits for non-codebook based
|
||||
// transmission. It also occupies 0 bits for codebook based transmission using a single antenna port.
|
||||
uint8_t nbits = 0;
|
||||
@@ -2998,13 +3002,15 @@ uint8_t compute_precoding_information(NR_PUSCH_Config_t *pusch_Config,
|
||||
|
||||
uint8_t pusch_antenna_ports = get_pusch_nb_antenna_ports(pusch_Config, srs_config, srs_resource_indicator);
|
||||
if ((pusch_Config && pusch_Config->txConfig != NULL && *pusch_Config->txConfig == NR_PUSCH_Config__txConfig_nonCodebook) ||
|
||||
pusch_antenna_ports == 1) {
|
||||
pusch_antenna_ports == 1) {
|
||||
return nbits;
|
||||
}
|
||||
|
||||
long max_rank = *pusch_Config->maxRank;
|
||||
long *ul_FullPowerTransmission = pusch_Config->ext1 ? pusch_Config->ext1->ul_FullPowerTransmission_r16 : NULL;
|
||||
long *codebookSubset = pusch_Config->codebookSubset;
|
||||
if(pusch_Config != NULL) {
|
||||
long max_rank = *pusch_Config->maxRank;
|
||||
long *ul_FullPowerTransmission = pusch_Config->ext1 ? pusch_Config->ext1->ul_FullPowerTransmission_r16 : NULL;
|
||||
long *codebookSubset = pusch_Config->codebookSubset;
|
||||
}
|
||||
|
||||
if (pusch_antenna_ports == 2) {
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
// carrier config
|
||||
LOG_D(MAC, "Entering UE Config Common\n");
|
||||
|
||||
AssertFatal(scc != NULL, "scc cannot be null\n");
|
||||
AssertFatal(scc, "scc cannot be null\n");
|
||||
|
||||
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
int bw_index = get_supported_band_index(frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
|
||||
|
||||
@@ -73,7 +73,8 @@ void init_RA(module_id_t mod_id,
|
||||
ra->RA_backoff_cnt = 0;
|
||||
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = 0;
|
||||
NR_SubcarrierSpacing_t prach_scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
|
||||
if(nr_rach_ConfigCommon != NULL)
|
||||
NR_SubcarrierSpacing_t prach_scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
|
||||
int n_prbs = get_N_RA_RB (prach_scs, mac->current_UL_BWP.scs);
|
||||
int start_prb = rach_ConfigGeneric->msg1_FrequencyStart + mac->current_UL_BWP.BWPStart;
|
||||
int carrier_bandwidth = mac->scc_SIB ? mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth :
|
||||
|
||||
@@ -1332,30 +1332,32 @@ void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
NR_PUCCH_Resource_t *pucchres = pucch->pucch_resource;
|
||||
|
||||
if (current_UL_BWP->harq_ACK_SpatialBundlingPUCCH != NULL || *current_DL_BWP->pdsch_HARQ_ACK_Codebook != 1) {
|
||||
LOG_E(MAC,"PUCCH Unsupported cell group configuration\n");
|
||||
return;
|
||||
} else if (current_DL_BWP && current_DL_BWP->pdsch_servingcellconfig && current_DL_BWP->pdsch_servingcellconfig->codeBlockGroupTransmission != NULL) {
|
||||
LOG_E(MAC,"PUCCH Unsupported code block group for serving cell config\n");
|
||||
return;
|
||||
if (current_UL_BWP != NULL) {
|
||||
if (current_UL_BWP->harq_ACK_SpatialBundlingPUCCH != NULL || (current_DL_BWP && *current_DL_BWP->pdsch_HARQ_ACK_Codebook != 1)) {
|
||||
LOG_E(MAC,"PUCCH Unsupported cell group configuration\n");
|
||||
return;
|
||||
} else if (current_DL_BWP && current_DL_BWP->pdsch_servingcellconfig && current_DL_BWP->pdsch_servingcellconfig->codeBlockGroupTransmission != NULL) {
|
||||
LOG_E(MAC,"PUCCH Unsupported code block group for serving cell config\n");
|
||||
return;
|
||||
}
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = current_UL_BWP ? current_UL_BWP->pusch_Config : NULL;
|
||||
if (pusch_Config) {
|
||||
pusch_id = pusch_Config->dataScramblingIdentityPUSCH;
|
||||
if (pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->transformPrecodingDisabled != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
else if (pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
}
|
||||
|
||||
NR_PUCCH_Config_t *pucch_Config = current_UL_BWP->pucch_Config;
|
||||
AssertFatal(pucch_Config, "no pucch_Config\n");
|
||||
|
||||
pucch_pdu->bwp_size = current_UL_BWP->BWPSize;
|
||||
pucch_pdu->bwp_start = current_UL_BWP->BWPStart;
|
||||
}
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = current_UL_BWP ? current_UL_BWP->pusch_Config : NULL;
|
||||
if (pusch_Config) {
|
||||
pusch_id = pusch_Config->dataScramblingIdentityPUSCH;
|
||||
if (pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->transformPrecodingDisabled != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
else if (pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB != NULL &&
|
||||
pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled != NULL)
|
||||
id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled->scramblingID0;
|
||||
}
|
||||
|
||||
NR_PUCCH_Config_t *pucch_Config = current_UL_BWP->pucch_Config;
|
||||
AssertFatal(pucch_Config, "no pucch_Config\n");
|
||||
|
||||
pucch_pdu->bwp_size = current_UL_BWP->BWPSize;
|
||||
pucch_pdu->bwp_start = current_UL_BWP->BWPStart;
|
||||
pucch_pdu->prb_start = pucchres->startingPRB;
|
||||
pucch_pdu->freq_hop_flag = pucchres->intraSlotFrequencyHopping!= NULL ? 1 : 0;
|
||||
pucch_pdu->second_hop_prb = pucchres->secondHopPRB!= NULL ? *pucchres->secondHopPRB : 0;
|
||||
|
||||
@@ -641,7 +641,7 @@ bool nr_mac_update_cellgroup(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupCon
|
||||
DevAssert(CellGroup != NULL);
|
||||
|
||||
NR_UE_info_t *UE = find_nr_UE(&nrmac->UE_info, rnti);
|
||||
AssertFatal(UE != NULL, "Can't find UE %04x for CellGroup update\n", rnti);
|
||||
AssertFatal(UE, "Can't find UE %04x for CellGroup update\n", rnti);
|
||||
|
||||
/* copy CellGroup by calling asn1c encode this is a temporary hack to avoid the gNB having a pointer to RRC CellGroup structure
|
||||
* (otherwise it would be applied to early)
|
||||
|
||||
@@ -783,7 +783,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP,
|
||||
// generation of DCI 0_0 to schedule msg3 retransmission
|
||||
NR_SearchSpace_t *ss = ra->ra_ss;
|
||||
NR_ControlResourceSet_t *coreset = ra->coreset;
|
||||
AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg3 retransmission\n");
|
||||
AssertFatal(coreset,"Coreset cannot be null for RA-Msg3 retransmission\n");
|
||||
|
||||
const int coresetid = coreset->controlResourceSetId;
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid];
|
||||
@@ -1184,7 +1184,7 @@ static void nr_generate_Msg2(module_id_t module_idP,
|
||||
}
|
||||
|
||||
NR_ControlResourceSet_t *coreset = ra->coreset;
|
||||
AssertFatal(coreset != NULL,"Coreset cannot be null for RA-Msg2\n");
|
||||
AssertFatal(coreset,"Coreset cannot be null for RA-Msg2\n");
|
||||
const int coresetid = coreset->controlResourceSetId;
|
||||
// Calculate number of symbols
|
||||
int time_domain_assignment = get_dl_tda(nr_mac, scc, slotP);
|
||||
|
||||
@@ -948,6 +948,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
NR_tda_info_t *tda_info = &sched_pdsch->tda_info;
|
||||
NR_pdsch_dmrs_t *dmrs_parms = &sched_pdsch->dmrs_parms;
|
||||
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid];
|
||||
AssertFatal(harq,"harq is null\n");
|
||||
DevAssert(!harq->is_waiting);
|
||||
add_tail_nr_list(&sched_ctrl->feedback_dl_harq, current_harq_pid);
|
||||
NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[sched_pdsch->pucch_allocation];
|
||||
@@ -978,7 +979,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
pucch->ul_slot,
|
||||
sched_pdsch->pucch_allocation,
|
||||
sched_ctrl->tpc1);
|
||||
|
||||
const int bwp_id = current_BWP->bwp_id;
|
||||
const int coresetid = sched_ctrl->coreset->controlResourceSetId;
|
||||
|
||||
@@ -1030,7 +1030,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
pdsch_pdu->qamModOrder[0] = Qm;
|
||||
pdsch_pdu->mcsIndex[0] = sched_pdsch->mcs;
|
||||
pdsch_pdu->mcsTable[0] = current_BWP->mcsTableIdx;
|
||||
AssertFatal(harq!=NULL,"harq is null\n");
|
||||
AssertFatal(harq->round<gNB_mac->dl_bler.harq_round_max,"%d",harq->round);
|
||||
pdsch_pdu->rvIndex[0] = nr_rv_round_map[harq->round%4];
|
||||
pdsch_pdu->TBSize[0] = TBS;
|
||||
|
||||
@@ -45,7 +45,7 @@ const int get_ul_tda(gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *sc
|
||||
NR_SCHED_ENSURE_LOCKED(&nrmac->sched_lock);
|
||||
|
||||
/* there is a mixed slot only when in TDD */
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc && scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n");
|
||||
|
||||
if (tdd && tdd->nrofUplinkSymbols > 1) { // if there is uplink symbols in mixed slot
|
||||
@@ -923,9 +923,15 @@ static uint8_t get_max_tpmi(const NR_PUSCH_Config_t *pusch_Config,
|
||||
return max_tpmi;
|
||||
}
|
||||
|
||||
long max_rank = *pusch_Config->maxRank;
|
||||
long *ul_FullPowerTransmission = pusch_Config->ext1 ? pusch_Config->ext1->ul_FullPowerTransmission_r16 : NULL;
|
||||
long *codebookSubset = pusch_Config->codebookSubset;
|
||||
long max_rank = -1;
|
||||
long *ul_FullPowerTransmission = NULL;
|
||||
long *codebookSubset = NULL;
|
||||
|
||||
if (pusch_Config != NULL) {
|
||||
max_rank = *pusch_Config->maxRank;
|
||||
*ul_FullPowerTransmission = pusch_Config->ext1 ? pusch_Config->ext1->ul_FullPowerTransmission_r16 : NULL;
|
||||
*codebookSubset = pusch_Config->codebookSubset;
|
||||
}
|
||||
|
||||
if (num_ue_srs_ports == 2) {
|
||||
|
||||
@@ -1911,7 +1917,7 @@ static bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_
|
||||
const NR_SIB1_t *sib1 = nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL;
|
||||
NR_ServingCellConfigCommonSIB_t *scc_sib1 = sib1 ? sib1->servingCellConfigCommon : NULL;
|
||||
|
||||
AssertFatal(scc!=NULL || scc_sib1!=NULL,"We need one serving cell config common\n");
|
||||
AssertFatal(scc || scc_sib1,"We need one serving cell config common\n");
|
||||
|
||||
// no UEs
|
||||
if (nr_mac->UE_info.list[0] == NULL)
|
||||
|
||||
@@ -35,8 +35,8 @@ void *nr_pdcp_integrity_nia2_init(uint8_t integrity_key[16])
|
||||
// This is a hack. Reduce the 3 functions to just cipher?
|
||||
// No. The overhead is x8 times more. Don't change before measuring
|
||||
// return integrity_key;
|
||||
cbc_cmac_ctx_t* ctx = calloc(1, sizeof(cbc_cmac_ctx_t));
|
||||
DevAssert(ctx != NULL && "Memory exhausted");
|
||||
cbc_cmac_ctx_t* ctx = calloc(1, sizeof(cbc_cmac_ctx_t));
|
||||
AssertFatal(ctx, "Memory exhausted");
|
||||
|
||||
*ctx = init_aes_128_cbc_cmac(integrity_key);
|
||||
return ctx;
|
||||
|
||||
@@ -904,7 +904,7 @@ void nr_rlc_activate_srb0(int rnti, struct gNB_MAC_INST_s *mac, void *rawUE,
|
||||
struct srb0_data *srb0_data;
|
||||
|
||||
srb0_data = calloc(1, sizeof(struct srb0_data));
|
||||
AssertFatal(srb0_data != NULL, "out of memory\n");
|
||||
AssertFatal(srb0_data, "out of memory\n");
|
||||
|
||||
srb0_data->mac = mac;
|
||||
srb0_data->rnti = rnti;
|
||||
|
||||
@@ -782,7 +782,7 @@ int16_t do_RRCReconfiguration(
|
||||
ie->nonCriticalExtension->dedicatedNAS_MessageList = dedicatedNAS_MessageList;
|
||||
}
|
||||
|
||||
if(cellGroupConfig!=NULL){
|
||||
if(cellGroupConfig!=NULL && ue_context_pP!=NULL){
|
||||
update_cellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.gNB_ue_ngap_id, ue_context_pP ? ue_context_pP->ue_context.UE_Capability_nr : NULL, configuration);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
|
||||
@@ -2553,7 +2553,8 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
|
||||
uint64_t bitmap = get_ssb_bitmap(servingcellconfigcommon);
|
||||
// See comment at the end of this function regarding ServingCellConfig
|
||||
fix_servingcellconfigdedicated(servingcellconfigdedicated);
|
||||
if(servingcellconfigdedicated != NULL)
|
||||
fix_servingcellconfigdedicated(servingcellconfigdedicated);
|
||||
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = calloc(1, sizeof(*secondaryCellGroup));
|
||||
secondaryCellGroup->cellGroupId = scg_id;
|
||||
@@ -2655,74 +2656,76 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
initialUplinkBWP->pucch_Config = NULL;
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = NULL;
|
||||
if (servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
pusch_Config =
|
||||
servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
}
|
||||
initialUplinkBWP->pusch_Config = config_pusch(pusch_Config, servingcellconfigcommon, uecap);
|
||||
|
||||
long maxMIMO_Layers =
|
||||
servingcellconfigdedicated->uplinkConfig && servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig
|
||||
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1
|
||||
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers
|
||||
? *servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers
|
||||
: 1;
|
||||
|
||||
int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,
|
||||
MAX_BWP_SIZE);
|
||||
initialUplinkBWP->srs_Config = calloc(1, sizeof(*initialUplinkBWP->srs_Config));
|
||||
config_srs(servingcellconfigcommon, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS);
|
||||
|
||||
// Downlink BWPs
|
||||
int n_dl_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->downlinkBWP_ToAddModList) {
|
||||
n_dl_bwp = servingcellconfigdedicated->downlinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if (n_dl_bwp > 0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) {
|
||||
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
|
||||
config_downlinkBWP(bwp,
|
||||
servingcellconfigcommon,
|
||||
servingcellconfigdedicated,
|
||||
uecap,
|
||||
dl_antenna_ports,
|
||||
configuration->force_256qam_off,
|
||||
bwp_loop,
|
||||
false);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list, bwp);
|
||||
if(servingcellconfigdedicated != NULL) {
|
||||
if (servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
pusch_Config =
|
||||
servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id =
|
||||
servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id =
|
||||
servingcellconfigdedicated->defaultDownlinkBWP_Id ? *servingcellconfigdedicated->defaultDownlinkBWP_Id : 1;
|
||||
}
|
||||
initialUplinkBWP->pusch_Config = config_pusch(pusch_Config, servingcellconfigcommon, uecap);
|
||||
|
||||
// Uplink BWPs
|
||||
int n_ul_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->uplinkConfig
|
||||
&& servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
n_ul_bwp = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if (n_ul_bwp > 0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_ul_bwp; bwp_loop++) {
|
||||
NR_BWP_Uplink_t *ubwp = calloc(1, sizeof(*ubwp));
|
||||
config_uplinkBWP(ubwp, bwp_loop, false, uid, configuration, servingcellconfigdedicated, servingcellconfigcommon, uecap);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list, ubwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id =
|
||||
servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id
|
||||
? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id
|
||||
long maxMIMO_Layers =
|
||||
servingcellconfigdedicated->uplinkConfig && servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig
|
||||
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1
|
||||
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers
|
||||
? *servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers
|
||||
: 1;
|
||||
|
||||
int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,
|
||||
MAX_BWP_SIZE);
|
||||
initialUplinkBWP->srs_Config = calloc(1, sizeof(*initialUplinkBWP->srs_Config));
|
||||
config_srs(servingcellconfigcommon, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS);
|
||||
|
||||
// Downlink BWPs
|
||||
int n_dl_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->downlinkBWP_ToAddModList) {
|
||||
n_dl_bwp = servingcellconfigdedicated->downlinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if (n_dl_bwp > 0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) {
|
||||
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
|
||||
config_downlinkBWP(bwp,
|
||||
servingcellconfigcommon,
|
||||
servingcellconfigdedicated,
|
||||
uecap,
|
||||
dl_antenna_ports,
|
||||
configuration->force_256qam_off,
|
||||
bwp_loop,
|
||||
false);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list, bwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id =
|
||||
servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id =
|
||||
servingcellconfigdedicated->defaultDownlinkBWP_Id ? *servingcellconfigdedicated->defaultDownlinkBWP_Id : 1;
|
||||
}
|
||||
|
||||
// Uplink BWPs
|
||||
int n_ul_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->uplinkConfig
|
||||
&& servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
n_ul_bwp = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if (n_ul_bwp > 0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_ul_bwp; bwp_loop++) {
|
||||
NR_BWP_Uplink_t *ubwp = calloc(1, sizeof(*ubwp));
|
||||
config_uplinkBWP(ubwp, bwp_loop, false, uid, configuration, servingcellconfigdedicated, servingcellconfigcommon, uecap);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list, ubwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id =
|
||||
calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id =
|
||||
servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id
|
||||
? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id
|
||||
: 1;
|
||||
}
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->bwp_InactivityTimer = NULL;
|
||||
@@ -2862,10 +2865,12 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pathlossReferenceLinking = NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->servingCellMO = NULL;
|
||||
|
||||
// this is pure evil: We should only pass in a ServingCellConfig, without
|
||||
// modifying it! TODO: make a separate function that creates a
|
||||
// ServingCellConfig, and reuse it here
|
||||
*servingcellconfigdedicated = *secondaryCellGroup->spCellConfig->spCellConfigDedicated;
|
||||
if(servingcellconfigdedicated != NULL) {
|
||||
// this is pure evil: We should only pass in a ServingCellConfig, without
|
||||
// modifying it! TODO: make a separate function that creates a
|
||||
// ServingCellConfig, and reuse it here
|
||||
*servingcellconfigdedicated = *secondaryCellGroup->spCellConfig->spCellConfigDedicated;
|
||||
}
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, (void *)secondaryCellGroup->spCellConfig);
|
||||
|
||||
@@ -120,8 +120,9 @@ int main (int argc, const char* argv[])
|
||||
const char* devpath = user_parser_get_devpath();
|
||||
const char* devattr = user_parser_get_devattr();
|
||||
|
||||
printf("%s -host %s -port %s -dev %s -params %s\n",
|
||||
argv[0], host, port, devpath, devattr);
|
||||
if(host && port && devpath && devattr)
|
||||
printf("%s -host %s -port %s -dev %s -params %s\n",
|
||||
argv[0], host, port, devpath, devattr);
|
||||
|
||||
/*
|
||||
* Initialize the communication channel to the NAS sublayer
|
||||
|
||||
Reference in New Issue
Block a user