Merge remote-tracking branch 'origin/develop' into tdd25period_for_MR

Conflicts:
	openair2/RRC/NR/MESSAGES/asn1_msg.h
This commit is contained in:
Raymond Knopp
2022-03-07 07:38:03 +01:00
106 changed files with 493 additions and 21585 deletions
+1 -1
View File
@@ -69,7 +69,7 @@
#include "nfapi_interface.h"
#include "PHY_INTERFACE/IF_Module.h"
#include "PHY/TOOLS/time_meas.h"
#include "time_meas.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "PHY/LTE_TRANSPORT/transport_common.h"
+2
View File
@@ -623,6 +623,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]);
const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
sched_ctrl->update_pdsch_ps = true;
sched_ctrl->update_pusch_ps = true;
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
if (get_softmodem_params()->sa) {
// add all available DL HARQ processes for this UE in SA
@@ -393,12 +393,17 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP,
#define BLER_UPDATE_FRAME 10
#define BLER_FILTER 0.9f
int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id)
int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id, int mcs_table)
{
gNB_MAC_INST *nrmac = RC.nrmac[mod_id];
const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon;
const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
int max_allowed_mcs = (mcs_table == 1) ? 27 : 28;
int max_mcs = nrmac->dl_max_mcs;
if (nrmac->dl_max_mcs>max_allowed_mcs)
max_mcs = max_allowed_mcs;
NR_DL_bler_stats_t *bler_stats = &nrmac->UE_info.UE_sched_ctrl[UE_id].dl_bler_stats;
/* first call: everything is zero. Initialize to sensible default */
if (bler_stats->last_frame_slot == 0 && bler_stats->mcs == 0) {
@@ -444,7 +449,7 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t
if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) {
new_mcs -= 2;
} else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/
if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9)
if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < max_mcs && dtx > 9)
new_mcs += 1;
else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6)
new_mcs -= 1;
@@ -586,8 +591,10 @@ bool allocate_dl_retransmission(module_id_t module_id,
}
/* check whether we need to switch the TDA allocation since the last
* (re-)transmission */
if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) {
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
sched_ctrl->update_pdsch_ps = false;
}
} else {
/* the retransmission will use a different time domain allocation, check
* that we have enough resources */
@@ -743,7 +750,7 @@ void pf_dl(module_id_t module_id,
/* Calculate coeff */
set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx);
sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id);
sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id, ps->mcsTableIdx);
layers[UE_id] = set_dl_nrOfLayers(sched_ctrl);
const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
@@ -862,8 +869,11 @@ void pf_dl(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
if (ps->nrOfLayers != layers[UE_id] ||
ps->time_domain_allocation != tda)
ps->time_domain_allocation != tda ||
sched_ctrl->update_pdsch_ps) {
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps);
sched_ctrl->update_pdsch_ps = false;
}
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
// Freq-demain allocation
@@ -533,6 +533,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
ps->mcsTableIdx = 2;
}
else ps->mcsTableIdx = 0;
LOG_D(NR_MAC,"MCS Table Index: %d\n",ps->mcsTableIdx);
NR_PDSCH_Config_t *pdsch_Config=NULL;
if (bwpd) pdsch_Config = bwpd->pdsch_Config->choice.setup;
@@ -1939,7 +1940,6 @@ void create_nr_list(NR_list_t *list, int len)
{
list->head = -1;
list->next = malloc(len * sizeof(*list->next));
LOG_W(NR_MAC, "NR list->next %p\n", list->next);
AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n");
for (int i = 0; i < len; ++i)
list->next[i] = -1;
@@ -2279,8 +2279,16 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
} else if (sched_ctrl->available_dl_harq.len == nrofHARQ) {
LOG_D(NR_MAC, "nrofHARQ %d already configured\n", nrofHARQ);
} else {
const int old_nrofHARQ = sched_ctrl->available_dl_harq.len;
AssertFatal(nrofHARQ > old_nrofHARQ,
"cannot resize HARQ list to be smaller (nrofHARQ %d, old_nrofHARQ %d)\n",
nrofHARQ, old_nrofHARQ);
resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
for (int harq = old_nrofHARQ; harq < nrofHARQ; harq++)
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
}
@@ -999,8 +999,11 @@ bool allocate_ul_retransmission(module_id_t module_id,
if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
|| sched_ctrl->update_pusch_ps) {
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
sched_ctrl->update_pusch_ps = false;
}
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
} else {
/* the retransmission will use a different time domain allocation, check
@@ -1237,8 +1240,11 @@ void pf_ul(module_id_t module_id,
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
|| sched_ctrl->update_pusch_ps) {
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
sched_ctrl->update_pusch_ps = false;
}
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->mcs = nrmac->min_grant_mcs;
update_ul_ue_R_Qm(sched_pusch, ps);
@@ -1354,8 +1360,11 @@ void pf_ul(module_id_t module_id,
const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data
|| sched_ctrl->update_pusch_ps) {
nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
sched_ctrl->update_pusch_ps = false;
}
update_ul_ue_R_Qm(sched_pusch, ps);
/* Calculate the current scheduling bytes and the necessary RBs */
+3 -1
View File
@@ -55,7 +55,7 @@
/* PHY */
#include "PHY/defs_gNB.h"
#include "PHY/TOOLS/time_meas.h"
#include "time_meas.h"
/* Interface */
#include "nfapi_nr_interface_scf.h"
@@ -620,6 +620,8 @@ typedef struct {
int ul_failure;
struct CSI_Report CSI_report;
bool SR;
bool update_pdsch_ps;
bool update_pusch_ps;
bool set_mcs;
/// information about every HARQ process
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
+29 -9
View File
@@ -1771,6 +1771,30 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
}
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
rrc_gNB_carrier_data_t *carrier,
NR_UE_NR_Capability_t *uecap) {
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
if (SpCellConfig == NULL) return;
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,
uecap, bwp_Dedicated, scc);
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
if (DL_BWP_list) {
for (int i=0; i<DL_BWP_list->list.count; i++){
NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i];
int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing;
set_dl_mcs_table(scs, uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon);
}
}
}
void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
@@ -2190,6 +2214,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig)
//------------------------------------------------------------------------------
@@ -2226,15 +2252,6 @@ int16_t do_RRCReconfiguration(
ie->radioBearerConfig->srb3_ToRelease = NULL;
ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList;
}
/******************** Secondary Cell Group ********************/
// rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
// fill_default_secondaryCellGroup( carrier->servingcellconfigcommon,
// ue_context_pP->ue_context.secondaryCellGroup,
// 1,
// 1,
// carrier->pdsch_AntennaPorts,
// carrier->initial_csi_index[ue_context_p->local_uid + 1],
// ue_context_pP->local_uid);
/******************** Meas Config ********************/
// measConfig
@@ -2250,6 +2267,9 @@ int16_t do_RRCReconfiguration(
}
if(cellGroupConfig!=NULL){
update_cellGroupConfig(cellGroupConfig,
carrier,
ue_context_pP->ue_context.UE_Capability_nr);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
(void *)cellGroupConfig,
+6
View File
@@ -110,6 +110,10 @@ void fill_initial_cellGroupConfig(int uid,
NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier);
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
rrc_gNB_carrier_data_t *carrier,
NR_UE_NR_Capability_t *uecap);
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup,int use_rlc_um_for_drb);
int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
@@ -145,6 +149,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig);
+91 -1
View File
@@ -31,6 +31,50 @@
#include "nr_rrc_config.h"
#include "common/utils/nr/nr_common.h"
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
NR_ServingCellConfigCommon_t *scc,
int numerology,
int rbsize,
int mcs_table) {
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
nr_bandnr->bandNR = band;
ASN_SEQUENCE_ADD(&cap->rf_Parameters.supportedBandListNR.list,
nr_bandnr);
if (mcs_table == 1) {
int bw = get_supported_band_index(numerology, band, rbsize);
if (band>256) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[0];
bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2));
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
}
else{
cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1));
NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1;
phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1));
*phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported;
}
cap->featureSets = CALLOC(1,sizeof(*cap->featureSets));
NR_FeatureSets_t *fs=cap->featureSets;
fs->featureSetsDownlinkPerCC = CALLOC(1,sizeof(*fs->featureSetsDownlinkPerCC));
NR_FeatureSetDownlinkPerCC_t *fs_cc = CALLOC(1,sizeof(NR_FeatureSetDownlinkPerCC_t));
fs_cc->supportedSubcarrierSpacingDL = numerology;
if(band>256) {
fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr2;
fs_cc->supportedBandwidthDL.choice.fr2 = bw;
}
else{
fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr1;
fs_cc->supportedBandwidthDL.choice.fr1 = bw;
}
fs_cc->supportedModulationOrderDL = CALLOC(1,sizeof(*fs_cc->supportedModulationOrderDL));
*fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256;
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list,
fs_cc);
}
}
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
@@ -124,6 +168,52 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3);
}
}
}
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_ServingCellConfigCommon_t *scc) {
if (cap == NULL){
bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
return;
}
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList;
int bw_rb = -1;
for(int i=0; i<scs_list.list.count; i++){
if(scs == scs_list.list.array[i]->subcarrierSpacing){
bw_rb = scs_list.list.array[i]->carrierBandwidth;
break;
}
}
AssertFatal(bw_rb>0,"Could not find scs-SpecificCarrierList element for scs %d",scs);
int bw = get_supported_band_index(scs, band, bw_rb);
AssertFatal(bw>0,"Supported band corresponding to %d RBs not found\n", bw_rb);
bool supported = false;
if (band>256) {
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) {
supported = true;
break;
}
}
}
else if (cap->phy_Parameters.phy_ParametersFR1 && cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1)
supported = true;
if (supported) {
if(bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL)
bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
}
else
bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
}
+8
View File
@@ -113,6 +113,14 @@ typedef struct physicalcellgroup_s{
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_ServingCellConfigCommon_t *scc);
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
NR_ServingCellConfigCommon_t *scc,
int numerology,
int rbsize,
int mcs_table);
#endif
+2
View File
@@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti);
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
int dl_antenna_ports,
@@ -95,6 +96,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports,
int minRXTXTIMEpdsch,
int do_csirs,
+14 -49
View File
@@ -709,6 +709,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
dedicatedNAS_MessageList = NULL;
}
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
memset(buffer, 0, sizeof(buffer));
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
xid,
@@ -719,8 +721,10 @@ rrc_gNB_generate_defaultRRCReconfiguration(
NULL,
NULL,
dedicatedNAS_MessageList,
ue_context_pP,
&rrc->carrier,
NULL,
NULL);
ue_p->masterCellGroup);
free(ue_context_pP->ue_context.nas_pdu.buffer);
@@ -981,6 +985,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
NULL,
NULL,
dedicatedNAS_MessageList,
ue_context_pP,
&rrc->carrier,
NULL,
cellGroupConfig);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n");
@@ -1152,6 +1158,8 @@ rrc_gNB_modify_dedicatedRRCReconfiguration(
NULL,
dedicatedNAS_MessageList,
NULL,
NULL,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
@@ -1250,6 +1258,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
NULL,
dedicatedNAS_MessageList,
NULL,
NULL,
NULL,
NULL);
ue_context_pP->ue_context.pdu_session_release_command_flag = 1;
@@ -1799,6 +1809,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
NULL, // MeasObj_list,
NULL,
NULL,
NULL,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,
"[MSG] RRC Reconfiguration\n");
@@ -3341,51 +3353,6 @@ unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
return(0);
}
int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
if (common_band>256) {
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0);
}
}
else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0);
// check featureSet
NR_FeatureSets_t *fs=cap->featureSets;
if (fs) {
// go through DL feature sets and look for one with current SCS
for (int i=0;i<fs->featureSetsDownlinkPerCC->list.count;i++) {
if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs &&
fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL &&
*fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1);
}
}
return(0);
}
int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];
int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
if (bandNRinfo->bandNR == common_band && !bandNRinfo->pusch_256QAM) return (0);
}
// check featureSet
NR_FeatureSets_t *fs=cap->featureSets;
if (fs) {
// go through UL feature sets and look for one with current SCS
for (int i=0;i<fs->featureSetsUplinkPerCC->list.count;i++) {
if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs &&
fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL &&
*fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL == NR_ModulationOrder_qam256) return(1);
}
}
return(0);
}
int get_ul_mimo_layersCB(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
@@ -3455,11 +3422,9 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
}
if (ue_context_p->ue_context.UE_Capability_nr) {
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr));
+2
View File
@@ -245,6 +245,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
ue_context_p->ue_context.spCellConfig->spCellConfigDedicated,
reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup,
ue_context_p->ue_context.UE_Capability_nr,
carrier->pdsch_AntennaPorts,
carrier->minRXTXTIME,
carrier->do_CSIRS,
@@ -255,6 +256,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
NULL,
reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup,
ue_context_p->ue_context.UE_Capability_nr,
carrier->pdsch_AntennaPorts,
carrier->minRXTXTIME,
carrier->do_CSIRS,
+10 -44
View File
@@ -45,6 +45,7 @@
#include "SIMULATION/TOOLS/sim.h"
#include "executables/softmodem-common.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "nr_rrc_config.h"
#define false 0
#define true 1
@@ -52,6 +53,7 @@
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
int dl_antenna_ports,
@@ -63,6 +65,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");
if(uecap == NULL)
LOG_E(RRC,"No UE Capabilities available when programming default CellGroup in NSA\n");
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
@@ -336,12 +341,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
if (!get_softmodem_params()->use_256qam_table) {
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL;
} else {
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table));
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
}
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
@@ -605,43 +605,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
if (!get_softmodem_params()->use_256qam_table) {
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
} else {
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
}
bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling));
bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize =
calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1;
if (!get_softmodem_params()->use_256qam_table) {
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL;
} else {
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
}
set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, bwp->bwp_Dedicated, servingcellconfigcommon);
bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI));
*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1;
bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling;
@@ -744,8 +708,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pusch_Config->pusch_TimeDomainAllocationList = NULL;
pusch_Config->pusch_AggregationFactor=NULL;
pusch_Config->mcs_Table=NULL;
pusch_Config->mcs_TableTransformPrecoder=NULL;
pusch_Config->transformPrecoder= NULL;
pusch_Config->mcs_TableTransformPrecoder=NULL;
/* if msg3_transformprecoding is set in conf file - pusch config should not disable it */
if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) {
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
@@ -1324,6 +1288,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports,
int minRXTXTIME,
int do_csirs,
@@ -1338,6 +1303,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
fill_default_secondaryCellGroup(servingcellconfigcommon,
servingcellconfigdedicated,
secondaryCellGroup,
uecap,
1,
1,
dl_antenna_ports,
-607
View File
@@ -1,607 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pad_list.c
* \brief list management primimtives
* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
* \date 2012 - 2014
* \version 0.5
* @ingroup util
*/
//#define LIST_C
//#define NULL 0
#include <stdio.h>
#include <stdlib.h>
#include "pad_list.h"
//#include <mpi.h>
void job_list_init (Job_List_t *listP) {
listP->tail = NULL;
listP->head = NULL;
listP->nb_elements = 0;
}
void event_list_init (Event_List_t *listP) {
listP->tail = NULL;
listP->head = NULL;
listP->nb_elements = 0;
}
void pkt_list_init (Packet_OTG_List_t *listP) {
listP->tail = NULL;
listP->head = NULL;
listP->nb_elements = 0;
}
//-----------------------------------------------------------------------------
void job_list_free (Job_List_t *listP) {
Job_elt_t *le;
while ((le = job_list_remove_head (listP))) {
free(le);
}
}
void event_list_free (Event_List_t *listP) {
Event_elt_t *le;
while ((le = event_list_remove_head (listP))) {
free(le);
}
}
void pkt_list_free (Packet_OTG_List_t *listP) {
Packet_otg_elt_t *le;
while ((le = pkt_list_remove_head (listP))) {
free(le);
}
}
//-----------------------------------------------------------------------------
Job_elt_t *job_list_get_head (Job_List_t *listP) {
return listP->head;
}
Event_elt_t *event_list_get_head (Event_List_t *listP) {
return listP->head;
}
Packet_otg_elt_t *pkt_list_get_head (Packet_OTG_List_t *listP) {
return listP->head;
}
//-----------------------------------------------------------------------------
/*
* remove an element from head of a list
* @param pointer on targeted list
* @return pointer on removed Job_elt_t
*/
Job_elt_t *job_list_remove_head (Job_List_t *listP) {
// access optimisation
Job_elt_t *head;
head = listP->head;
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
} else {
//msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
}
return head;
}
Event_elt_t *event_list_remove_head (Event_List_t *listP) {
// access optimisation
Event_elt_t *head;
head = listP->head;
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
} else {
//msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
}
return head;
}
Packet_otg_elt_t *pkt_list_remove_head (Packet_OTG_List_t *listP) {
// access optimisation
Packet_otg_elt_t *head;
head = listP->head;
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
} else {
//msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name);
}
return head;
}
//-----------------------------------------------------------------------------
Job_elt_t *job_list_remove_element (Job_elt_t *elementP, Job_List_t *listP) {
// access optimisation;
Job_elt_t *head;
if (elementP != NULL) {
// test head
head = listP->head;
if (listP->head == elementP) {
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
}
} else {
while (head) {
if (head->next == elementP) {
head->next = elementP->next;
listP->nb_elements = listP->nb_elements - 1;
if (listP->tail == elementP) {
listP->tail = head;
}
return elementP;
} else {
head = head->next;
}
}
}
}
return elementP;
}
Event_elt_t *event_list_remove_element (Event_elt_t *elementP, Event_List_t *listP) {
// access optimisation;
Event_elt_t *head;
if (elementP != NULL) {
// test head
head = listP->head;
if (listP->head == elementP) {
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
}
} else {
while (head) {
if (head->next == elementP) {
head->next = elementP->next;
listP->nb_elements = listP->nb_elements - 1;
if (listP->tail == elementP) {
listP->tail = head;
}
return elementP;
} else {
head = head->next;
}
}
}
}
return elementP;
}
Packet_otg_elt_t *pkt_list_remove_element (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
// access optimisation;
Packet_otg_elt_t *head;
if (elementP != NULL) {
// test head
head = listP->head;
if (listP->head == elementP) {
// almost one element
if (head != NULL) {
listP->head = head->next;
listP->nb_elements = listP->nb_elements - 1;
// if only one element, update tail
if (listP->head == NULL) {
listP->tail = NULL;
} else {
head->next = NULL;
}
}
} else {
while (head) {
if (head->next == elementP) {
head->next = elementP->next;
listP->nb_elements = listP->nb_elements - 1;
if (listP->tail == elementP) {
listP->tail = head;
}
return elementP;
} else {
head = head->next;
}
}
}
}
return elementP;
}
//-----------------------------------------------------------------------------
/*
* add an element to the beginning of a list
* @param pointer on targeted list
* @return pointer on removed Job_elt_t
*/
void job_list_add_head (Job_elt_t *elementP, Job_List_t *listP) {
// access optimisation;
Job_elt_t *head;
if (elementP != NULL) {
head = listP->head;
listP->nb_elements = listP->nb_elements + 1;
// almost one element
if (head == NULL) {
listP->head = elementP;
listP->tail = elementP;
} else {
elementP->next = head;
listP->head = elementP;
}
}
}
void event_list_add_head (Event_elt_t *elementP, Event_List_t *listP) {
// access optimisation;
Event_elt_t *head;
if (elementP != NULL) {
head = listP->head;
listP->nb_elements = listP->nb_elements + 1;
// almost one element
if (head == NULL) {
listP->head = elementP;
listP->tail = elementP;
} else {
elementP->next = head;
listP->head = elementP;
}
}
}
void pkt_list_add_head (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
// access optimisation;
Packet_otg_elt_t *head;
if (elementP != NULL) {
head = listP->head;
listP->nb_elements = listP->nb_elements + 1;
// almost one element
if (head == NULL) {
listP->head = elementP;
listP->tail = elementP;
} else {
elementP->next = head;
listP->head = elementP;
}
}
}
void event_list_add_element (Event_elt_t *elementP, Event_elt_t *previous, Event_List_t *listP) {
// access optimisation;
Event_elt_t *next;
if (elementP != NULL && previous != NULL) {
elementP->next = NULL;
next = previous->next;
listP->nb_elements = listP->nb_elements + 1;
// almost one element
if (next == NULL) {
previous->next = elementP;
listP->tail = elementP;
} else {
elementP->next = previous->next;
previous->next = elementP;
}
}
}
//-----------------------------------------------------------------------------
/*
* add an element to the end of a list
* @param pointer on targeted list
* @return pointer on removed Job_elt_t
*/
void job_list_add_tail_eurecom (Job_elt_t *elementP, Job_List_t *listP) {
Job_elt_t *tail;
if (elementP != NULL) {
// access optimisation
listP->nb_elements = listP->nb_elements + 1;
elementP->next = NULL;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = elementP;
} else {
tail->next = elementP;
}
listP->tail = elementP;
} else {
//msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
}
}
void event_list_add_tail_eurecom (Event_elt_t *elementP, Event_List_t *listP) {
Event_elt_t *tail;
if (elementP != NULL) {
// access optimisation
listP->nb_elements = listP->nb_elements + 1;
elementP->next = NULL;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = elementP;
} else {
tail->next = elementP;
}
listP->tail = elementP;
} else {
//msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
}
}
void pkt_list_add_tail_eurecom (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) {
Packet_otg_elt_t *tail;
if (elementP != NULL) {
// access optimisation
listP->nb_elements = listP->nb_elements + 1;
elementP->next = NULL;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = elementP;
} else {
tail->next = elementP;
}
listP->tail = elementP;
} else {
//msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n");
}
}
//-----------------------------------------------------------------------------
void job_list_add_list (Job_List_t *sublistP, Job_List_t *listP) {
if (sublistP) {
if (sublistP->head) {
// access optimisation
Job_elt_t *tail;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = sublistP->head;
} else {
tail->next = sublistP->head;
}
listP->tail = sublistP->tail;
// clear sublist
sublistP->head = NULL;
sublistP->tail = NULL;
listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
sublistP->nb_elements = 0;
}
}
}
void event_list_add_list (Event_List_t *sublistP, Event_List_t *listP) {
if (sublistP) {
if (sublistP->head) {
// access optimisation
Event_elt_t *tail;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = sublistP->head;
} else {
tail->next = sublistP->head;
}
listP->tail = sublistP->tail;
// clear sublist
sublistP->head = NULL;
sublistP->tail = NULL;
listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
sublistP->nb_elements = 0;
}
}
}
void pkt_list_add_list (Packet_OTG_List_t *sublistP, Packet_OTG_List_t *listP) {
if (sublistP) {
if (sublistP->head) {
// access optimisation
Packet_otg_elt_t *tail;
tail = listP->tail;
// almost one element
if (tail == NULL) {
listP->head = sublistP->head;
} else {
tail->next = sublistP->head;
}
listP->tail = sublistP->tail;
// clear sublist
sublistP->head = NULL;
sublistP->tail = NULL;
listP->nb_elements = listP->nb_elements + sublistP->nb_elements;
sublistP->nb_elements = 0;
}
}
}
//-----------------------------------------------------------------------------
void job_list_display (Job_List_t *listP) {
//Correct the output once the content of struct Job is fixed
/*Job_elt_t *cursor;
unsigned short nb_elements = 0;
if (listP) {
cursor = listP->head;
if (cursor) {
while (cursor != NULL) {
if (cursor->job.type == eNB_DL)
printf ("DL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
else if (cursor->job.type == UE_DL)
printf ("DL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
else if (cursor->job.type == UE_UL)
printf ("UL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
else if (cursor->job.type == eNB_UL)
printf ("UL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid);
//msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
cursor = cursor->next;
nb_elements++;
}
printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
//msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
}
} else {
printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
//msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
}*/
}
void event_list_display (Event_List_t *listP) {
Event_elt_t *cursor;
unsigned short nb_elements = 0;
if (listP) {
cursor = listP->head;
if (cursor) {
while (cursor != NULL) {
printf ("Ev (%d,%d)\n", (cursor->event).type, (cursor->event).frame);
//msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
cursor = cursor->next;
nb_elements++;
}
printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
//msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
}
} else {
printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
//msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
}
}
void pkt_list_display (Packet_OTG_List_t *listP) {
Packet_otg_elt_t *cursor;
unsigned short nb_elements = 0;
if (listP) {
cursor = listP->head;
if (cursor) {
while (cursor != NULL) {
printf ("Pkt (DST %d, RB %ld)\n", (cursor->otg_pkt).dst_id, (cursor->otg_pkt).rb_id);
//msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2);
cursor = cursor->next;
nb_elements++;
}
printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
//msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
}
} else {
printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
//msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n");
}
}
-87
View File
@@ -1,87 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pad_list.c
* \brief list management primimtives
* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
* \date 2012 - 2014
* \version 0.5
* @ingroup util
*/
#ifndef __list_H__
#define __list_H__
#include "types.h"
//-----------------------------------------------------------------------------
typedef struct Job_List_s {
Job_elt_t *head;
Job_elt_t *tail;
int nb_elements;
} Job_List_t;
typedef struct Event_List_s {
Event_elt_t *head;
Event_elt_t *tail;
int nb_elements;
} Event_List_t;
typedef struct Packet_OTG_List_s {
Packet_otg_elt_t *head;
Packet_otg_elt_t *tail;
int nb_elements;
} Packet_OTG_List_t;
//-----------------------------------------------------------------------------
void job_list_init (Job_List_t*);
void job_list_free (Job_List_t* listP);
Job_elt_t* job_list_get_head (Job_List_t*);
Job_elt_t* job_list_remove_head (Job_List_t* );
Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*);
void job_list_add_head (Job_elt_t* , Job_List_t* );
void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* );
void job_list_add_list (Job_List_t* , Job_List_t* );
void job_list_display (Job_List_t* );
void event_list_init (Event_List_t*);
void event_list_free (Event_List_t* listP);
Event_elt_t* event_list_get_head (Event_List_t*);
Event_elt_t* event_list_remove_head (Event_List_t* );
Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*);
void event_list_add_head (Event_elt_t* , Event_List_t* );
void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* );
void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* );
void event_list_add_list (Event_List_t* , Event_List_t* );
void event_list_display (Event_List_t* );
void pkt_list_init (Packet_OTG_List_t*);
void pkt_list_free (Packet_OTG_List_t* listP);
Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*);
Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* );
Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*);
void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* );
void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* );
void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* );
void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* );
void pkt_list_display (Packet_OTG_List_t* );
#endif
-127
View File
@@ -1,127 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pad_list.c
* \brief list management primimtives
* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein
* \date 2012 - 2014
* \version 0.5
* @ingroup util
*/
#ifndef __FIFO_TYPES_H__
#define __FIFO_TYPES_H__
#include "platform_types.h"
/* Types regrouping both user-defined and regular events */
typedef enum {
MIN_ET=0,
OAI_ET=MIN_ET, // config events
SYS_ET,
TOPO_ET,
APP_ET,
EMU_ET,
DL_ET, // frame events
UL_ET,
S_ET,
PHY_ET, // protocol events
MAC_ET,
RLC_ET,
PDCP_ET,
RRC_ET,
MAX_ET
} Event_Type_t;
/* decomposition of node functions into jobs for a given event */
typedef enum Job_type_e { JT_OTG, JT_PDCP, JT_PHY_MAC, JT_INIT_SYNC, JT_DL, JT_UL, RN_DL, RN_UL, JT_END} Job_Type_t;
typedef enum Operation_Type_e { READ, WRITE, RESET} Operation_Type_t;
typedef struct Job_s {
enum Job_type_e type;
int exe_time; /* execution time at the worker*/
int nid; /* node id*/
eNB_flag_t eNB_flag;
frame_t frame;
int last_slot;
int next_slot;
int ctime;
} Job_t;
typedef struct Signal_buffers_s { // (s = transmit, r,r0 = receive)
double **s_re;
double **s_im;
double **r_re;
double **r_im;
double **r_re0;
double **r_im0;
} Signal_buffers_t;
/*!\brief sybframe type : DL, UL, SF, */
typedef struct Packet_otg_s {
unsigned int sdu_buffer_size;
unsigned char *sdu_buffer;
module_id_t module_id;
rb_id_t rb_id;
module_id_t dst_id;
boolean_t is_ue;
pdcp_transmission_mode_t mode;
} Packet_otg_t;
typedef struct {
Event_Type_t type;
enum Operation_Type_e optype; //op
char *key;
void *value;
frame_t frame;
int ue;
int lcid;
} Event_t;
/*typedef struct Global_Time {
uint32_t frame;
int32_t slot;
int32_t last_slot;
int32_t next_slot;
double time_s;
double time_ms;
};*/
typedef struct Packet_otg_elt_s {
struct Packet_otg_elt_s *next;
struct Packet_otg_elt_s *previous;
Packet_otg_t otg_pkt;
} Packet_otg_elt_t;
typedef struct Job_element_s {
struct Job_element_s *next;
Job_t job;
} Job_elt_t;
typedef struct Event_element_s {
struct Event_element_s *next;
struct Event_element_s *previous;
Event_t event;
} Event_elt_t;
#endif