Merge remote-tracking branch 'origin/develop' into Dedicated-BWPs
# Conflicts: # openair1/PHY/TOOLS/lte_ue_scope.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c # openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c # openair2/RRC/NR/rrc_gNB_reconfig.c
This commit is contained in:
@@ -353,9 +353,18 @@ typedef struct pdusession_tobeswitched_s {
|
||||
uint32_t gtp_teid;
|
||||
} pdusession_tobeswitched_t;
|
||||
|
||||
typedef struct qos_flow_tobe_modified_s {
|
||||
uint8_t qfi; // 0~63
|
||||
} qos_flow_tobe_modified_t;
|
||||
|
||||
typedef struct pdusession_modify_s {
|
||||
/* Unique pdusession_id for the UE. */
|
||||
uint8_t pdusession_id;
|
||||
|
||||
uint8_t nb_of_qos_flow;
|
||||
|
||||
// qos_flow_add_or_modify
|
||||
qos_flow_tobe_modified_t qos[QOSFLOW_MAX_VALUE];
|
||||
} pdusession_modify_t;
|
||||
|
||||
typedef enum ngap_Cause_e {
|
||||
@@ -821,7 +830,7 @@ typedef struct ngap_pdusession_modify_req_s {
|
||||
/* Number of pdusession to be modify in the list */
|
||||
uint8_t nb_pdusessions_tomodify;
|
||||
|
||||
/* E RAB modify request */
|
||||
/* pdu session modify request */
|
||||
pdusession_t pdusession_modify_params[NGAP_MAX_PDUSESSION];
|
||||
} ngap_pdusession_modify_req_t;
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -315,21 +315,21 @@ void get_info_from_tda_tables(int default_abc,
|
||||
int tda,
|
||||
int dmrs_TypeA_Position,
|
||||
int normal_CP,
|
||||
bool *is_mapping_typeA,
|
||||
int *startSymbolIndex,
|
||||
int *nrOfSymbols) {
|
||||
int k0 = 0;
|
||||
int is_mapping_typeA = 1;
|
||||
switch(default_abc){
|
||||
case 1:
|
||||
if (normal_CP){
|
||||
if (dmrs_TypeA_Position){
|
||||
is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0];
|
||||
k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][3];
|
||||
}
|
||||
else{
|
||||
is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0];
|
||||
k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][3];
|
||||
@@ -337,13 +337,13 @@ void get_info_from_tda_tables(int default_abc,
|
||||
}
|
||||
else{
|
||||
if (dmrs_TypeA_Position){
|
||||
is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0];
|
||||
k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][3];
|
||||
}
|
||||
else{
|
||||
is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0];
|
||||
k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][3];
|
||||
@@ -352,13 +352,13 @@ void get_info_from_tda_tables(int default_abc,
|
||||
break;
|
||||
case 2:
|
||||
if (dmrs_TypeA_Position){
|
||||
is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0];
|
||||
k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][3];
|
||||
}
|
||||
else{
|
||||
is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0];
|
||||
k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][3];
|
||||
@@ -366,13 +366,13 @@ void get_info_from_tda_tables(int default_abc,
|
||||
break;
|
||||
case 3:
|
||||
if (dmrs_TypeA_Position){
|
||||
is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0];
|
||||
k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][3];
|
||||
}
|
||||
else{
|
||||
is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0];
|
||||
*is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0];
|
||||
k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][1];
|
||||
*startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][2];
|
||||
*nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][3];
|
||||
@@ -382,7 +382,6 @@ void get_info_from_tda_tables(int default_abc,
|
||||
AssertFatal(1==0,"Invalid default time domaing allocation type\n");
|
||||
}
|
||||
AssertFatal(k0==0,"Only k0 = 0 is supported\n");
|
||||
AssertFatal(is_mapping_typeA==1,"Only mapping type A is currently supported\n");
|
||||
}
|
||||
|
||||
const char *prachfmt[]={"0","1","2","3", "A1","A2","A3","B1","B4","C0","C2","A1/B1","A2/B2","A3/B3"};
|
||||
@@ -2722,6 +2721,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits);
|
||||
// 2nd DAI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that
|
||||
dci_pdu->dai[1].nbits = 2;
|
||||
size += dci_pdu->dai[1].nbits;
|
||||
@@ -2993,7 +2993,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
|
||||
dci_pdu->srs_request.nbits = 3;
|
||||
size += dci_pdu->srs_request.nbits;
|
||||
// CBGTI
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig&&
|
||||
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup &&
|
||||
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
|
||||
uint8_t maxCBGperTB = (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock + 1) * 2;
|
||||
long *maxCWperDCI_rrc = pdsch_Config->maxNrofCodeWordsScheduledByDCI;
|
||||
@@ -3338,65 +3339,65 @@ uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i
|
||||
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
|
||||
int *period, int *offset) {
|
||||
|
||||
if(nzpcsi != NULL) {
|
||||
if(periodicityAndOffset != NULL) {
|
||||
|
||||
NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = nzpcsi->periodicityAndOffset->present;
|
||||
NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = periodicityAndOffset->present;
|
||||
|
||||
switch(p_and_o){
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots4:
|
||||
*period = 4;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots4;
|
||||
*offset = periodicityAndOffset->choice.slots4;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots5:
|
||||
*period = 5;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots5;
|
||||
*offset = periodicityAndOffset->choice.slots5;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots8:
|
||||
*period = 8;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots8;
|
||||
*offset = periodicityAndOffset->choice.slots8;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots10:
|
||||
*period = 10;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots10;
|
||||
*offset = periodicityAndOffset->choice.slots10;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots16:
|
||||
*period = 16;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots16;
|
||||
*offset = periodicityAndOffset->choice.slots16;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots20:
|
||||
*period = 20;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots20;
|
||||
*offset = periodicityAndOffset->choice.slots20;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots32:
|
||||
*period = 32;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots32;
|
||||
*offset = periodicityAndOffset->choice.slots32;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots40:
|
||||
*period = 40;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots40;
|
||||
*offset = periodicityAndOffset->choice.slots40;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots64:
|
||||
*period = 64;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots64;
|
||||
*offset = periodicityAndOffset->choice.slots64;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots80:
|
||||
*period = 80;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots80;
|
||||
*offset = periodicityAndOffset->choice.slots80;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots160:
|
||||
*period = 160;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots160;
|
||||
*offset = periodicityAndOffset->choice.slots160;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots320:
|
||||
*period = 320;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots320;
|
||||
*offset = periodicityAndOffset->choice.slots320;
|
||||
break;
|
||||
case NR_CSI_ResourcePeriodicityAndOffset_PR_slots640:
|
||||
*period = 640;
|
||||
*offset = nzpcsi->periodicityAndOffset->choice.slots640;
|
||||
*offset = periodicityAndOffset->choice.slots640;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"No periodicity and offset found in CSI resource");
|
||||
|
||||
@@ -141,6 +141,7 @@ void get_info_from_tda_tables(int default_abc,
|
||||
int tda,
|
||||
int dmrs_TypeA_Position,
|
||||
int normal_CP,
|
||||
bool *is_mapping_typeA,
|
||||
int *startSymbolIndex,
|
||||
int *nrOfSymbols);
|
||||
|
||||
@@ -161,7 +162,7 @@ int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH);
|
||||
void find_period_offest_SR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset);
|
||||
|
||||
void csi_period_offset(NR_CSI_ReportConfig_t *csirep,
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi,
|
||||
struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset,
|
||||
int *period, int *offset);
|
||||
|
||||
void reverse_n_bits(uint8_t *value, uint16_t bitlen);
|
||||
|
||||
@@ -214,6 +214,7 @@ uint8_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
int csi_report_id,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig);
|
||||
|
||||
uint8_t get_rsrp_index(int rsrp);
|
||||
@@ -271,6 +272,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
int *mappingtype,
|
||||
uint8_t time_domain_ind,
|
||||
int default_abc,
|
||||
bool use_default);
|
||||
@@ -350,6 +352,8 @@ and fills the PRACH PDU per each FD occasion.
|
||||
*/
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id);
|
||||
void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, int thread_id);
|
||||
void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot);
|
||||
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot);
|
||||
|
||||
/* \brief This function schedules the Msg3 transmission
|
||||
@param
|
||||
|
||||
@@ -470,6 +470,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
int *mapping_type,
|
||||
uint8_t time_domain_ind,
|
||||
int default_abc,
|
||||
bool use_default){
|
||||
@@ -547,13 +548,15 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
else {// Default configuration from tables
|
||||
|
||||
bool is_typeA;
|
||||
get_info_from_tda_tables(default_abc,
|
||||
time_domain_ind,
|
||||
dmrs_typeA_pos,
|
||||
1, // normal CP
|
||||
&is_typeA,
|
||||
&sliv_S,
|
||||
&sliv_L);
|
||||
|
||||
*mapping_type = is_typeA? typeA : typeB;
|
||||
dlsch_config_pdu->number_symbols = sliv_L;
|
||||
dlsch_config_pdu->start_symbol = sliv_S;
|
||||
}
|
||||
@@ -868,12 +871,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
|
||||
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
|
||||
int mappingtype;
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,default_abc,rnti==SI_RNTI) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,
|
||||
NULL,dlsch_config_pdu_1_0,&mappingtype,
|
||||
dci->time_domain_assignment.val,
|
||||
default_abc,rnti==SI_RNTI) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB);
|
||||
if(pdsch_TimeDomainAllocationList && rnti!=SI_RNTI)
|
||||
mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
|
||||
@@ -1065,13 +1073,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
int mappingtype;
|
||||
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = choose_dl_tda_list(pdsch_Config,bwpc->pdsch_ConfigCommon->choice.setup);
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,0,false) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,
|
||||
NULL,dlsch_config_pdu_1_1,&mappingtype,
|
||||
dci->time_domain_assignment.val,0,false) < 0) {
|
||||
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB);
|
||||
if(pdsch_TimeDomainAllocationList)
|
||||
mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
|
||||
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
|
||||
|
||||
@@ -2401,7 +2412,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
|
||||
"CSI resource not found among PUCCH resources\n");
|
||||
|
||||
pucch->resource_indicator = found;
|
||||
csi_bits = nr_get_csi_payload(mac, pucch, csi_measconfig);
|
||||
csi_bits += nr_get_csi_payload(mac, pucch, csi_report_id, csi_measconfig);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2415,31 +2426,30 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
int csi_report_id,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig) {
|
||||
|
||||
int n_csi_bits = 0;
|
||||
|
||||
AssertFatal(csi_MeasConfig->csi_ReportConfigToAddModList->list.count>0,"No CSI Report configuration available\n");
|
||||
|
||||
for (int csi_report_id=0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){
|
||||
struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
|
||||
NR_CSI_ResourceConfigId_t csi_ResourceConfigId = csi_reportconfig->resourcesForChannelMeasurement;
|
||||
switch(csi_reportconfig->reportQuantity.present) {
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_none:
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP:
|
||||
n_csi_bits += get_ssb_rsrp_payload(mac,pucch,csi_reportconfig,csi_ResourceConfigId,csi_MeasConfig);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI:
|
||||
AssertFatal(1==0,"Measurement report based on CSI-RS not availalble\n");
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid CSI report quantity type %d\n",csi_reportconfig->reportQuantity.present);
|
||||
}
|
||||
struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
|
||||
NR_CSI_ResourceConfigId_t csi_ResourceConfigId = csi_reportconfig->resourcesForChannelMeasurement;
|
||||
switch(csi_reportconfig->reportQuantity.present) {
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_none:
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP:
|
||||
n_csi_bits = get_ssb_rsrp_payload(mac,pucch,csi_reportconfig,csi_ResourceConfigId,csi_MeasConfig);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI:
|
||||
AssertFatal(1==0,"Measurement report based on CSI-RS not availalble\n");
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid CSI report quantity type %d\n",csi_reportconfig->reportQuantity.present);
|
||||
}
|
||||
return (n_csi_bits);
|
||||
}
|
||||
@@ -3843,6 +3853,21 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
|
||||
LOG_A(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID);
|
||||
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
|
||||
ra->RA_RAPID_found = 1;
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
/* When we are emulating L1 with multiple UEs, the rx_indication will have
|
||||
multiple RAR PDUs. The code would previously handle each of these PDUs,
|
||||
but it should only be handling the single RAR that matches the current
|
||||
UE. */
|
||||
LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id);
|
||||
dl_info->rx_ind->number_pdus = 1;
|
||||
if (pdu_id != 0) {
|
||||
memcpy(&dl_info->rx_ind->rx_indication_body[0],
|
||||
&dl_info->rx_ind->rx_indication_body[pdu_id],
|
||||
sizeof(fapi_nr_rx_indication_body_t));
|
||||
}
|
||||
mac->nr_ue_emul_l1.expected_rar = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
|
||||
@@ -776,7 +776,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
||||
return -1;
|
||||
}
|
||||
/* TIME_DOM_RESOURCE_ASSIGNMENT */
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, dci->time_domain_assignment.val,0,false) < 0) {
|
||||
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, NULL, dci->time_domain_assignment.val,0,false) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1054,6 +1054,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
nr_dcireq_t dcireq;
|
||||
|
||||
if(mac->cg != NULL){ // we have a cg
|
||||
|
||||
nr_schedule_csirs_reception(mac, rx_frame, rx_slot);
|
||||
nr_schedule_csi_for_im(mac, rx_frame, rx_slot);
|
||||
|
||||
dcireq.module_id = mod_id;
|
||||
dcireq.gNB_index = gNB_index;
|
||||
dcireq.cc_id = cc_id;
|
||||
@@ -2317,7 +2321,6 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
return;
|
||||
|
||||
if (N_UCI > 0) {
|
||||
|
||||
LOG_D(NR_MAC,"%d.%d configure pucch, O_SR %d, O_ACK %d, O_CSI %d\n",frameP,slotP,O_SR,O_ACK,O_CSI);
|
||||
pucch->resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI);
|
||||
select_pucch_resource(mac, pucch);
|
||||
@@ -2341,9 +2344,206 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
|
||||
if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0)
|
||||
return;
|
||||
|
||||
NR_CellGroupConfig_t *CellGroup = mac->cg;
|
||||
|
||||
if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated ||
|
||||
!CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig)
|
||||
return;
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||
|
||||
if (csi_measconfig->csi_IM_ResourceToAddModList == NULL)
|
||||
return;
|
||||
|
||||
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
|
||||
NR_CSI_IM_Resource_t *imcsi;
|
||||
int period, offset;
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
int mu = mac->DLbwp[dl_bwp_id-1] ?
|
||||
mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing :
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing;
|
||||
|
||||
for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){
|
||||
imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id];
|
||||
csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset);
|
||||
if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
|
||||
continue;
|
||||
fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15;
|
||||
const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1];
|
||||
const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth:
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth;
|
||||
csiim_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csiim_config_pdu->subcarrier_spacing = mu;
|
||||
csiim_config_pdu->start_rb = imcsi->freqBand->startingRB;
|
||||
csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs;
|
||||
// As specified in 5.2.2.4 of 38.214
|
||||
switch (imcsi->csi_IM_ResourceElementPattern->present) {
|
||||
case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0:
|
||||
for (int i = 0; i<4; i++) {
|
||||
csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1);
|
||||
csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2);
|
||||
}
|
||||
break;
|
||||
case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1:
|
||||
for (int i = 0; i<4; i++) {
|
||||
csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i;
|
||||
csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid CSI-IM pattern\n");
|
||||
}
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
}
|
||||
|
||||
void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
|
||||
if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0)
|
||||
return;
|
||||
|
||||
NR_CellGroupConfig_t *CellGroup = mac->cg;
|
||||
|
||||
if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated ||
|
||||
!CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig)
|
||||
return;
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
|
||||
|
||||
if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL)
|
||||
return;
|
||||
|
||||
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi;
|
||||
int period, offset;
|
||||
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
|
||||
int mu = mac->DLbwp[dl_bwp_id-1] ?
|
||||
mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing :
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing;
|
||||
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
|
||||
csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset);
|
||||
if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
|
||||
continue;
|
||||
LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15;
|
||||
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
|
||||
|
||||
const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1];
|
||||
const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth:
|
||||
mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth;
|
||||
csirs_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE);
|
||||
csirs_config_pdu->subcarrier_spacing = mu;
|
||||
csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB;
|
||||
csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
|
||||
csirs_config_pdu->csi_type = 1; // NZP-CSI-RS
|
||||
csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
|
||||
if (resourceMapping.firstOFDMSymbolInTimeDomain2)
|
||||
csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2;
|
||||
csirs_config_pdu->cdm_type = resourceMapping.cdm_Type;
|
||||
csirs_config_pdu->freq_density = resourceMapping.density.present;
|
||||
if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5)
|
||||
&& (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs))
|
||||
csirs_config_pdu->freq_density--;
|
||||
csirs_config_pdu->scramb_id = nzpcsi->scramblingID;
|
||||
switch(resourceMapping.frequencyDomainAllocation.present){
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1:
|
||||
csirs_config_pdu->row = 1;
|
||||
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
|
||||
csirs_config_pdu->row = 2;
|
||||
csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0));
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4:
|
||||
csirs_config_pdu->row = 4;
|
||||
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other:
|
||||
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f;
|
||||
// determining the row of table 7.4.1.5.3-1 in 38.211
|
||||
switch(resourceMapping.nrofPorts){
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p1:
|
||||
AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n");
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
|
||||
csirs_config_pdu->row = 3;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p4:
|
||||
csirs_config_pdu->row = 5;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_config_pdu->row = 8;
|
||||
else{
|
||||
int num_k = 0;
|
||||
for (int k=0; k<6; k++)
|
||||
num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01);
|
||||
if(num_k==4)
|
||||
csirs_config_pdu->row = 6;
|
||||
else
|
||||
csirs_config_pdu->row = 7;
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p12:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_config_pdu->row = 10;
|
||||
else
|
||||
csirs_config_pdu->row = 9;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_config_pdu->row = 12;
|
||||
else
|
||||
csirs_config_pdu->row = 11;
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_config_pdu->row = 14;
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
|
||||
csirs_config_pdu->row = 15;
|
||||
else
|
||||
csirs_config_pdu->row = 13;
|
||||
}
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p32:
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
|
||||
csirs_config_pdu->row = 17;
|
||||
else{
|
||||
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
|
||||
csirs_config_pdu->row = 18;
|
||||
else
|
||||
csirs_config_pdu->row = 16;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n");
|
||||
}
|
||||
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS;
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x
|
||||
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
||||
// - todo:
|
||||
|
||||
@@ -631,16 +631,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
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 (sched_ctrl->available_dl_harq.len == 0) {
|
||||
if (get_softmodem_params()->sa) {
|
||||
// add all available DL HARQ processes for this UE in SA
|
||||
create_dl_harq_list(sched_ctrl, pdsch);
|
||||
}
|
||||
else {
|
||||
const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
|
||||
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
||||
AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ,
|
||||
"Reconfiguration of available harq processes not yet supported\n");
|
||||
}
|
||||
// update coreset/searchspace
|
||||
void *bwpd = NULL;
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
|
||||
@@ -1034,6 +1034,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
int start_symbol_index,nr_of_symbols;
|
||||
|
||||
SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols);
|
||||
int mcsindex = -1; // init value
|
||||
|
||||
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
|
||||
pusch_pdu->rnti = rnti;
|
||||
@@ -1042,10 +1043,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
pusch_pdu->bwp_size = bwp_size;
|
||||
pusch_pdu->subcarrier_spacing = scs;
|
||||
pusch_pdu->cyclic_prefix = 0;
|
||||
pusch_pdu->mcs_index = 1;
|
||||
pusch_pdu->mcs_table = 0;
|
||||
pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
|
||||
pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
|
||||
pusch_pdu->transform_precoding = 1;
|
||||
else
|
||||
@@ -1082,15 +1080,23 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++)
|
||||
num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1;
|
||||
|
||||
pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order,
|
||||
pusch_pdu->target_code_rate,
|
||||
pusch_pdu->rb_size,
|
||||
pusch_pdu->nr_of_symbols,
|
||||
num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol
|
||||
0, //nb_rb_oh
|
||||
0, // to verify tb scaling
|
||||
pusch_pdu->nrOfLayers)>>3;
|
||||
int TBS = 0;
|
||||
while(TBS<7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
||||
mcsindex++;
|
||||
pusch_pdu->target_code_rate = nr_get_code_rate_ul(mcsindex,pusch_pdu->mcs_table);
|
||||
pusch_pdu->qam_mod_order = nr_get_Qm_ul(mcsindex,pusch_pdu->mcs_table);
|
||||
TBS = nr_compute_tbs(pusch_pdu->qam_mod_order,
|
||||
pusch_pdu->target_code_rate,
|
||||
pusch_pdu->rb_size,
|
||||
pusch_pdu->nr_of_symbols,
|
||||
num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol
|
||||
0, //nb_rb_oh
|
||||
0, // to verify tb scaling
|
||||
pusch_pdu->nrOfLayers)>>3;
|
||||
|
||||
pusch_pdu->mcs_index = mcsindex;
|
||||
pusch_pdu->pusch_data.tb_size = TBS;
|
||||
}
|
||||
}
|
||||
|
||||
void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra, uint8_t *RAR_pdu)
|
||||
@@ -1182,7 +1188,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
time_domain_assignment = 1;
|
||||
else
|
||||
time_domain_assignment = 0;
|
||||
uint8_t mcsIndex = 0;
|
||||
int mcsIndex = -1; // initialization value
|
||||
int rbStart = 0;
|
||||
int rbSize = 8;
|
||||
|
||||
@@ -1339,9 +1345,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
pdsch_pdu_rel15->SubcarrierSpacing = genericParameters->subcarrierSpacing;
|
||||
pdsch_pdu_rel15->CyclicPrefix = 0;
|
||||
pdsch_pdu_rel15->NrOfCodewords = 1;
|
||||
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,mcsTableIdx);
|
||||
pdsch_pdu_rel15->qamModOrder[0] = 2;
|
||||
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
|
||||
pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx;
|
||||
pdsch_pdu_rel15->rvIndex[0] = 0;
|
||||
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
|
||||
@@ -1365,9 +1368,38 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
startSymbolIndex,
|
||||
mappingtype, 1);
|
||||
|
||||
int x_Overhead = 0;
|
||||
uint8_t tb_scaling = 0;
|
||||
nr_get_tbs_dl(&dl_tti_pdsch_pdu->pdsch_pdu, x_Overhead, pdsch_pdu_rel15->numDmrsCdmGrpsNoData, tb_scaling);
|
||||
int R, Qm;
|
||||
uint8_t N_PRB_DMRS;
|
||||
uint32_t TBS=0;
|
||||
if (dmrsConfigType == NFAPI_NR_DMRS_TYPE1) {
|
||||
// if no data in dmrs cdm group is 1 only even REs have no data
|
||||
// if no data in dmrs cdm group is 2 both odd and even REs have no data
|
||||
N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*6;
|
||||
}
|
||||
else {
|
||||
N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*4;
|
||||
}
|
||||
uint16_t dmrs_length = get_num_dmrs(pdsch_pdu_rel15->dlDmrsSymbPos);
|
||||
|
||||
while(TBS<9) { // min TBS for RAR is 9 bytes
|
||||
mcsIndex++;
|
||||
R = nr_get_code_rate_dl(mcsIndex, mcsTableIdx);
|
||||
Qm = nr_get_Qm_dl(mcsIndex, mcsTableIdx);
|
||||
TBS = nr_compute_tbs(Qm,
|
||||
R,
|
||||
rbSize,
|
||||
nrOfSymbols,
|
||||
N_PRB_DMRS*dmrs_length,
|
||||
0, // overhead
|
||||
tb_scaling, // tb scaling
|
||||
1)>>3; // layers
|
||||
|
||||
pdsch_pdu_rel15->targetCodeRate[0] = R;
|
||||
pdsch_pdu_rel15->qamModOrder[0] = Qm;
|
||||
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
|
||||
pdsch_pdu_rel15->TBSize[0] = TBS;
|
||||
}
|
||||
|
||||
// Fill PDCCH DL DCI PDU
|
||||
nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci];
|
||||
@@ -1667,20 +1699,16 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
int rbSize = 0;
|
||||
uint8_t tb_scaling = 0;
|
||||
uint16_t *vrb_map = cc[CC_id].vrb_map;
|
||||
|
||||
do {
|
||||
do {
|
||||
if(rbSize < BWPSize)
|
||||
rbSize++;
|
||||
LOG_D(NR_MAC,"Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT);
|
||||
harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx),
|
||||
nr_get_code_rate_dl(mcsIndex, mcsTableIdx),
|
||||
rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3;
|
||||
} while (rbSize < BWPSize && harq->tb_size < ra->mac_pdu_length);
|
||||
if(harq->tb_size < ra->mac_pdu_length) {
|
||||
rbSize = 0;
|
||||
else
|
||||
mcsIndex++;
|
||||
}
|
||||
} while(rbSize < BWPSize && harq->tb_size < ra->mac_pdu_length && mcsIndex<=28);
|
||||
LOG_D(NR_MAC,"Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT);
|
||||
harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx),
|
||||
nr_get_code_rate_dl(mcsIndex, mcsTableIdx),
|
||||
rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3;
|
||||
} while (harq->tb_size < ra->mac_pdu_length && mcsIndex<=28);
|
||||
|
||||
AssertFatal(harq->tb_size >= ra->mac_pdu_length,"Cannot allocate Msg4\n");
|
||||
|
||||
|
||||
@@ -613,14 +613,15 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
|
||||
int startSymbolIndex = 0;
|
||||
int nrOfSymbols = 0;
|
||||
bool is_typeA;
|
||||
|
||||
get_info_from_tda_tables(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern,
|
||||
time_domain_allocation,
|
||||
gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
|
||||
1, &startSymbolIndex, &nrOfSymbols);
|
||||
1, &is_typeA,
|
||||
&startSymbolIndex, &nrOfSymbols);
|
||||
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
|
||||
int mappingtype = is_typeA? typeA: typeB;
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1);
|
||||
|
||||
// Configure sched_ctrlCommon for SIB1
|
||||
|
||||
@@ -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;
|
||||
@@ -587,7 +592,7 @@ 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 || sched_ctrl->update_pdsch_ps) {
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, 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 {
|
||||
@@ -746,7 +751,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);
|
||||
|
||||
@@ -532,6 +532,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;
|
||||
if (bwp &&
|
||||
@@ -1945,14 +1946,45 @@ void dump_nr_list(NR_list_t *listP)
|
||||
void create_nr_list(NR_list_t *list, int len)
|
||||
{
|
||||
list->head = -1;
|
||||
list->next = calloc(len, sizeof(*list->next));
|
||||
AssertFatal(list, "cannot calloc() memory for NR_list_t->next\n");
|
||||
list->next = malloc(len * sizeof(*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;
|
||||
list->tail = -1;
|
||||
list->len = len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resize an NR_list
|
||||
*/
|
||||
void resize_nr_list(NR_list_t *list, int new_len)
|
||||
{
|
||||
if (new_len == list->len)
|
||||
return;
|
||||
if (new_len > list->len) {
|
||||
/* list->head remains */
|
||||
const int old_len = list->len;
|
||||
int* n = realloc(list->next, new_len * sizeof(*list->next));
|
||||
AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
|
||||
list->next = n;
|
||||
for (int i = old_len; i < new_len; ++i)
|
||||
list->next[i] = -1;
|
||||
/* list->tail remains */
|
||||
list->len = new_len;
|
||||
} else { /* new_len < len */
|
||||
AssertFatal(list->head < new_len, "shortened list head out of index %d (new len %d)\n", list->head, new_len);
|
||||
AssertFatal(list->tail < new_len, "shortened list tail out of index %d (new len %d)\n", list->head, new_len);
|
||||
for (int i = 0; i < list->len; ++i)
|
||||
AssertFatal(list->next[i] < new_len, "shortened list entry out of index %d (new len %d)\n", list->next[i], new_len);
|
||||
/* list->head remains */
|
||||
int *n = realloc(list->next, new_len * sizeof(*list->next));
|
||||
AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
|
||||
list->next = n;
|
||||
/* list->tail remains */
|
||||
list->len = new_len;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroy an NR_list
|
||||
*/
|
||||
@@ -2213,10 +2245,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
"no pdsch-ServingCellConfig found for UE %d\n",
|
||||
UE_id);
|
||||
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
|
||||
// add DL HARQ processes for this UE only in NSA
|
||||
// (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage)
|
||||
if (!get_softmodem_params()->sa)
|
||||
create_dl_harq_list(sched_ctrl,pdsch);
|
||||
// pdsch == NULL in SA -> will create default (8) number of HARQ processes
|
||||
create_dl_harq_list(sched_ctrl, pdsch);
|
||||
// add all available UL HARQ processes for this UE
|
||||
// nb of ul harq processes not configurable
|
||||
create_nr_list(&sched_ctrl->available_ul_harq, 16);
|
||||
@@ -2244,11 +2274,31 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
|
||||
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
||||
// add all available DL HARQ processes for this UE
|
||||
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||
for (int harq = 0; harq < nrofHARQ; harq++)
|
||||
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);
|
||||
AssertFatal(sched_ctrl->available_dl_harq.len == sched_ctrl->feedback_dl_harq.len
|
||||
&& sched_ctrl->available_dl_harq.len == sched_ctrl->retrans_dl_harq.len,
|
||||
"HARQ lists have different lengths (%d/%d/%d)\n",
|
||||
sched_ctrl->available_dl_harq.len,
|
||||
sched_ctrl->feedback_dl_harq.len,
|
||||
sched_ctrl->retrans_dl_harq.len);
|
||||
if (sched_ctrl->available_dl_harq.len == 0) {
|
||||
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||
for (int harq = 0; harq < nrofHARQ; harq++)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/* hack data to remove UE in the phy */
|
||||
@@ -2457,11 +2507,11 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
|
||||
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
|
||||
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
|
||||
csi_period_offset(NULL,nzpcsi,&period,&offset);
|
||||
csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset);
|
||||
|
||||
if((frame*n_slots_frame+slot-offset)%period == 0) {
|
||||
|
||||
LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
LOG_D(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot);
|
||||
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
|
||||
memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
|
||||
@@ -2505,7 +2555,7 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
|
||||
csirs_pdu_rel15->row = 2;
|
||||
csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0));
|
||||
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0));
|
||||
for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++)
|
||||
vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1);
|
||||
break;
|
||||
@@ -2520,6 +2570,7 @@ void nr_csirs_scheduling(int Mod_idP,
|
||||
// determining the row of table 7.4.1.5.3-1 in 38.211
|
||||
switch(resourceMapping.nrofPorts){
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p1:
|
||||
AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n");
|
||||
break;
|
||||
case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
|
||||
csirs_pdu_rel15->row = 3;
|
||||
|
||||
@@ -357,6 +357,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
|
||||
/* Functions to manage an NR_list_t */
|
||||
void dump_nr_list(NR_list_t *listP);
|
||||
void create_nr_list(NR_list_t *listP, int len);
|
||||
void resize_nr_list(NR_list_t *list, int new_len);
|
||||
void destroy_nr_list(NR_list_t *list);
|
||||
void add_nr_list(NR_list_t *listP, int id);
|
||||
void remove_nr_list(NR_list_t *listP, int id);
|
||||
|
||||
@@ -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"
|
||||
@@ -642,6 +642,8 @@ typedef struct {
|
||||
int ul_failure;
|
||||
struct CSI_Report CSI_report;
|
||||
bool SR;
|
||||
bool update_pdsch_ps;
|
||||
bool update_pusch_ps;
|
||||
bool set_mcs;
|
||||
bool update_pdsch_ps;
|
||||
bool update_pusch_ps;
|
||||
|
||||
@@ -101,13 +101,6 @@ typedef struct {
|
||||
|
||||
static rlc_data_req_queue q;
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
static void *rlc_data_req_thread(void *_)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1044,7 +1044,7 @@ next_pdu:
|
||||
set_end_different_sdu:
|
||||
/* don't go more than rx_highest_status - 1 */
|
||||
if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) {
|
||||
ret.so_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
|
||||
ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
|
||||
entity->sn_modulus;
|
||||
ret.so_end = 0xffff;
|
||||
return ret;
|
||||
@@ -1305,9 +1305,8 @@ static int missing_size(nr_rlc_entity_am_t *entity, missing_data_t *m,
|
||||
missing_data_t m_nack;
|
||||
|
||||
/* be careful to limit a range to 255 SNs, that is: cut if needed */
|
||||
sn_count = m->sn_end - m->sn_start + 1;
|
||||
if (sn_count < 0)
|
||||
sn_count += entity->sn_modulus;
|
||||
sn_count = (m->sn_end - m->sn_start + entity->sn_modulus)
|
||||
% entity->sn_modulus + 1;
|
||||
|
||||
sn_start = m->sn_start;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ extern uint16_t sl_ahead;
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
{
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (UL_info->rach_ind.number_of_pdus > 0) {
|
||||
LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||
oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
|
||||
@@ -71,69 +71,29 @@ void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
}
|
||||
return;
|
||||
}
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_rach_indication_t *rach_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_rach_ind_queue.num_items == 0)
|
||||
return;
|
||||
LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
|
||||
rach_ind = get_queue(&gnb_rach_ind_queue);
|
||||
|
||||
UL_INFO.rach_ind = *rach_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_INFO.rach_ind = UL_info->rach_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
|
||||
int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn;
|
||||
if (frame_diff < 0)
|
||||
{
|
||||
int frame_diff = UL_info->frame - UL_info->rach_ind.sfn;
|
||||
if (frame_diff < 0) {
|
||||
frame_diff += 1024;
|
||||
}
|
||||
bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7);
|
||||
|
||||
if (UL_INFO.rach_ind.number_of_pdus>0 && in_timewindow) {
|
||||
if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) {
|
||||
LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",
|
||||
UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot);
|
||||
int npdus = UL_INFO.rach_ind.number_of_pdus;
|
||||
for(int i = 0; i < npdus; i++) {
|
||||
UL_INFO.rach_ind.number_of_pdus--;
|
||||
UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot);
|
||||
for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) {
|
||||
UL_info->rach_ind.number_of_pdus--;
|
||||
if (UL_INFO.rach_ind.pdu_list[i].num_preamble>0)
|
||||
AssertFatal(UL_INFO.rach_ind.pdu_list[i].num_preamble==1,
|
||||
"More than 1 preamble not supported\n");
|
||||
|
||||
nr_initiate_ra_proc(UL_INFO.module_id,
|
||||
UL_INFO.CC_id,
|
||||
UL_INFO.rach_ind.sfn,
|
||||
UL_INFO.rach_ind.slot,
|
||||
UL_INFO.rach_ind.pdu_list[i].preamble_list[0].preamble_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].freq_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].symbol_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance);
|
||||
AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble == 1, "More than 1 preamble not supported\n");
|
||||
nr_initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->rach_ind.sfn,
|
||||
UL_info->rach_ind.slot,
|
||||
UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index,
|
||||
UL_info->rach_ind.pdu_list[i].freq_index,
|
||||
UL_info->rach_ind.pdu_list[i].symbol_index,
|
||||
UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance);
|
||||
}
|
||||
}
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (rach_ind && rach_ind->number_of_pdus > 0)
|
||||
{
|
||||
for(int i = 0; i < rach_ind->number_of_pdus; i++)
|
||||
{
|
||||
free(rach_ind->pdu_list[i].preamble_list);
|
||||
rach_ind->pdu_list[i].preamble_list = NULL;
|
||||
}
|
||||
free(rach_ind->pdu_list);
|
||||
rach_ind->pdu_list = NULL;
|
||||
}
|
||||
free(rach_ind);
|
||||
rach_ind = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,26 +108,11 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
return;
|
||||
}
|
||||
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_uci_indication_t *uci_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_uci_ind_queue.num_items == 0)
|
||||
return;
|
||||
LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
|
||||
uci_ind = get_queue(&gnb_uci_ind_queue);
|
||||
UL_INFO.uci_ind = *uci_ind;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_INFO.uci_ind = UL_info->uci_ind;
|
||||
}
|
||||
|
||||
const module_id_t mod_id = UL_info->module_id;
|
||||
const frame_t frame = UL_INFO.uci_ind.sfn;
|
||||
const sub_frame_t slot = UL_INFO.uci_ind.slot;
|
||||
int num_ucis = UL_INFO.uci_ind.num_ucis;
|
||||
nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list;
|
||||
const frame_t frame = UL_info->uci_ind.sfn;
|
||||
const sub_frame_t slot = UL_info->uci_ind.slot;
|
||||
int num_ucis = UL_info->uci_ind.num_ucis;
|
||||
nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list;
|
||||
|
||||
for (int i = 0; i < num_ucis; i++) {
|
||||
switch (uci_list[i].pdu_type) {
|
||||
@@ -178,7 +123,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
|
||||
LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n",
|
||||
UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size);
|
||||
UL_info->uci_ind.sfn, UL_info->uci_ind.slot, num_ucis, uci_list[i].pdu_size);
|
||||
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
|
||||
break;
|
||||
}
|
||||
@@ -192,39 +137,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
}
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
for (int i = 0; i < num_ucis; i++) {
|
||||
switch (uci_list[i].pdu_type) {
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
|
||||
if (uci_list[i].pucch_pdu_format_0_1.harq) {
|
||||
free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
|
||||
uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL;
|
||||
}
|
||||
free(uci_list[i].pucch_pdu_format_0_1.harq);
|
||||
uci_list[i].pucch_pdu_format_0_1.harq = NULL;
|
||||
free(uci_list[i].pucch_pdu_format_0_1.sr);
|
||||
uci_list[i].pucch_pdu_format_0_1.sr = NULL;
|
||||
break;
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (uci_ind && num_ucis > 0) {
|
||||
free(uci_list);
|
||||
uci_list = NULL;
|
||||
}
|
||||
free(uci_ind);
|
||||
uci_ind = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static bool crc_sfn_slot_matcher(void *wanted, void *candidate)
|
||||
@@ -264,173 +178,202 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
|
||||
return;
|
||||
}
|
||||
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = NULL;
|
||||
nfapi_nr_crc_indication_t *crc_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
rx_ind = get_queue(&gnb_rx_ind_queue);
|
||||
if (!rx_ind)
|
||||
{
|
||||
LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n");
|
||||
return;
|
||||
if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) {
|
||||
AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs,
|
||||
"number_of_pdus %d, number_crcs %d\n",
|
||||
UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs);
|
||||
for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) {
|
||||
const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i];
|
||||
const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i];
|
||||
LOG_D(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x "
|
||||
"UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
|
||||
i, crc->rnti, i, rx->rnti);
|
||||
|
||||
AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n",
|
||||
crc->rnti, rx->rnti);
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
crc->tb_crc_status ? "error" : "ok",
|
||||
crc->tb_crc_status);
|
||||
|
||||
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->rx_ind.sfn,
|
||||
UL_info->rx_ind.slot,
|
||||
rx->rnti,
|
||||
crc->tb_crc_status ? NULL : rx->pdu,
|
||||
rx->pdu_length,
|
||||
rx->timing_advance,
|
||||
rx->ul_cqi,
|
||||
rx->rssi);
|
||||
handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc);
|
||||
}
|
||||
|
||||
int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
|
||||
|
||||
crc_ind = unqueue_matching(&gnb_crc_ind_queue,
|
||||
MAX_QUEUE_SIZE,
|
||||
crc_sfn_slot_matcher,
|
||||
&sfn_slot);
|
||||
if (!crc_ind)
|
||||
{
|
||||
LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
|
||||
put_queue(&gnb_rx_ind_queue, rx_ind);
|
||||
return;
|
||||
}
|
||||
|
||||
UL_INFO.rx_ind = *rx_ind;
|
||||
UL_INFO.crc_ind = *crc_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
else
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
UL_info->crc_ind.number_crcs = 0;
|
||||
}
|
||||
|
||||
static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind,
|
||||
nfapi_nr_uci_indication_t *uci_ind,
|
||||
nfapi_nr_rx_data_indication_t *rx_ind,
|
||||
nfapi_nr_crc_indication_t *crc_ind) {
|
||||
if (rach_ind && rach_ind->number_of_pdus > 0)
|
||||
{
|
||||
UL_INFO.rx_ind = UL_info->rx_ind;
|
||||
UL_INFO.crc_ind = UL_info->crc_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
for(int i = 0; i < rach_ind->number_of_pdus; i++)
|
||||
{
|
||||
free_and_zero(rach_ind->pdu_list[i].preamble_list);
|
||||
}
|
||||
free_and_zero(rach_ind->pdu_list);
|
||||
free_and_zero(rach_ind);
|
||||
}
|
||||
if (uci_ind && uci_ind->num_ucis > 0)
|
||||
{
|
||||
for (int i = 0; i < uci_ind->num_ucis; i++) {
|
||||
switch (uci_ind->uci_list[i].pdu_type) {
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
|
||||
if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) {
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
|
||||
}
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr);
|
||||
break;
|
||||
|
||||
UL_INFO.frame = UL_INFO.rx_ind.sfn;
|
||||
UL_INFO.slot = UL_INFO.rx_ind.slot;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n",
|
||||
UL_info->frame, UL_info->slot,
|
||||
UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot,
|
||||
UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot
|
||||
);
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free_and_zero(uci_ind->uci_list);
|
||||
free_and_zero(uci_ind);
|
||||
}
|
||||
if (rx_ind && rx_ind->number_of_pdus > 0)
|
||||
{
|
||||
free_and_zero(rx_ind->pdu_list);
|
||||
free_and_zero(rx_ind);
|
||||
}
|
||||
if (crc_ind && crc_ind->number_crcs > 0)
|
||||
{
|
||||
free_and_zero(crc_ind->crc_list);
|
||||
free_and_zero(crc_ind);
|
||||
}
|
||||
}
|
||||
|
||||
if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) {
|
||||
for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) {
|
||||
int j;
|
||||
for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i];
|
||||
const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j];
|
||||
LOG_D(NR_PHY,
|
||||
"UL_INFO.crc_ind.pdu_list[%d].rnti:%04x "
|
||||
"UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n",
|
||||
j,
|
||||
crc->rnti,
|
||||
i,
|
||||
rx->rnti);
|
||||
static void remove_crc_pdu(nfapi_nr_crc_indication_t *crc_ind, int index) {
|
||||
AssertFatal(index >= 0, "Invalid index %d\n", index);
|
||||
AssertFatal(index < crc_ind->number_crcs, "Invalid index %d\n", index);
|
||||
AssertFatal(crc_ind->number_crcs > 0, "Invalid crc_ind->number_crcs %d\n", crc_ind->number_crcs);
|
||||
|
||||
if (crc->rnti != rx->rnti)
|
||||
{
|
||||
LOG_D(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti);
|
||||
continue;
|
||||
}
|
||||
memmove(crc_ind->crc_list + index,
|
||||
crc_ind->crc_list + index + 1,
|
||||
sizeof(*crc_ind->crc_list) * (crc_ind->number_crcs - index - 1));
|
||||
crc_ind->number_crcs--;
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
|
||||
UL_INFO.frame,
|
||||
UL_INFO.slot,
|
||||
crc->tb_crc_status ? "error" : "ok",
|
||||
crc->tb_crc_status);
|
||||
static void remove_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, int index) {
|
||||
AssertFatal(index >= 0, "Invalid index %d\n", index);
|
||||
AssertFatal(index < rx_ind->number_of_pdus, "Invalid index %d\n", index);
|
||||
AssertFatal(rx_ind->number_of_pdus > 0, "Invalid rx_ind->number_of_pdus %d\n", rx_ind->number_of_pdus);
|
||||
|
||||
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
||||
nr_rx_sdu(UL_INFO.module_id,
|
||||
UL_INFO.CC_id,
|
||||
UL_INFO.rx_ind.sfn,
|
||||
UL_INFO.rx_ind.slot,
|
||||
rx->rnti,
|
||||
crc->tb_crc_status ? NULL : rx->pdu,
|
||||
rx->pdu_length,
|
||||
rx->timing_advance,
|
||||
rx->ul_cqi,
|
||||
rx->rssi);
|
||||
handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc);
|
||||
memmove(rx_ind->pdu_list + index,
|
||||
rx_ind->pdu_list + index + 1,
|
||||
sizeof(*rx_ind->pdu_list) * (rx_ind->number_of_pdus - index - 1));
|
||||
rx_ind->number_of_pdus--;
|
||||
}
|
||||
|
||||
static bool crc_ind_has_rnti(nfapi_nr_crc_indication_t *crc_ind, uint16_t rnti) {
|
||||
for (int i = 0; i < crc_ind->number_crcs; i++) {
|
||||
if (rnti == crc_ind->crc_list[i].rnti) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool rx_ind_has_rnti(nfapi_nr_rx_data_indication_t *rx_ind, uint16_t rnti) {
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
|
||||
if (rnti == rx_ind->pdu_list[i].rnti) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc_indication_t *crc_ind) {
|
||||
AssertFatal(crc_ind->number_crcs > 0 && rx_ind->number_of_pdus > 0,
|
||||
"Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n",
|
||||
crc_ind->number_crcs, rx_ind->number_of_pdus);
|
||||
if (crc_ind->number_crcs > rx_ind->number_of_pdus) {
|
||||
int num_unmatched_crcs = 0;
|
||||
nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched));
|
||||
crc_ind_unmatched->header = crc_ind->header;
|
||||
crc_ind_unmatched->sfn = crc_ind->sfn;
|
||||
crc_ind_unmatched->slot = crc_ind->slot;
|
||||
crc_ind_unmatched->number_crcs = crc_ind->number_crcs - rx_ind->number_of_pdus;
|
||||
crc_ind_unmatched->crc_list = calloc(crc_ind_unmatched->number_crcs, sizeof(nfapi_nr_crc_t));
|
||||
for (int i = 0; i < crc_ind->number_crcs; i++) {
|
||||
if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) {
|
||||
LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n",
|
||||
i, crc_ind->crc_list[i].rnti);
|
||||
crc_ind_unmatched->crc_list[num_unmatched_crcs] = crc_ind->crc_list[i];
|
||||
num_unmatched_crcs++;
|
||||
remove_crc_pdu(crc_ind, i);
|
||||
}
|
||||
if (crc_ind->number_crcs == rx_ind->number_of_pdus) {
|
||||
break;
|
||||
} // for (j=0;j<UL_INFO.crc_ind.number_crcs;j++)
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
int last = UL_INFO.crc_ind.number_crcs - 1;
|
||||
if (j < last)
|
||||
{
|
||||
crc_ind->crc_list[j] = crc_ind->crc_list[last];
|
||||
UL_INFO.crc_ind.number_crcs--;
|
||||
}
|
||||
else if (j == last)
|
||||
{
|
||||
UL_INFO.crc_ind.number_crcs--;
|
||||
}
|
||||
|
||||
last = UL_INFO.rx_ind.number_of_pdus - 1;
|
||||
if (i < last)
|
||||
{
|
||||
rx_ind->pdu_list[i] = rx_ind->pdu_list[last];
|
||||
UL_INFO.rx_ind.number_of_pdus--;
|
||||
i--;
|
||||
}
|
||||
else if (i == last)
|
||||
{
|
||||
UL_INFO.rx_ind.number_of_pdus--;
|
||||
}
|
||||
}
|
||||
} // for (i=0;i<UL_INFO.rx_ind.number_of_pdus;i++)
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (UL_INFO.crc_ind.number_crcs > 0)
|
||||
{
|
||||
crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs;
|
||||
requeue(&gnb_crc_ind_queue, crc_ind);
|
||||
}
|
||||
|
||||
if (UL_INFO.rx_ind.number_of_pdus > 0)
|
||||
{
|
||||
rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus;
|
||||
requeue(&gnb_rx_ind_queue, rx_ind);
|
||||
}
|
||||
|
||||
if (UL_INFO.crc_ind.number_crcs == 0)
|
||||
{
|
||||
free(crc_ind->crc_list);
|
||||
crc_ind->crc_list = NULL;
|
||||
free(crc_ind);
|
||||
crc_ind = NULL;
|
||||
}
|
||||
if (UL_INFO.rx_ind.number_of_pdus == 0)
|
||||
{
|
||||
free(rx_ind->pdu_list);
|
||||
rx_ind->pdu_list = NULL;
|
||||
free(rx_ind);
|
||||
rx_ind = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
AssertFatal(crc_ind_unmatched->number_crcs == num_unmatched_crcs, "crc_ind num_pdus %d doesnt match %d\n",
|
||||
crc_ind_unmatched->number_crcs, num_unmatched_crcs);
|
||||
if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched))
|
||||
{
|
||||
UL_info->crc_ind.number_crcs = 0;
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n");
|
||||
free_and_zero(crc_ind_unmatched->crc_list);
|
||||
free_and_zero(crc_ind_unmatched);
|
||||
}
|
||||
} else if ((UL_INFO.rx_ind.number_of_pdus != 0)
|
||||
|| (UL_INFO.crc_ind.number_crcs != 0)) {
|
||||
LOG_E(NR_PHY,
|
||||
"hoping not to have mis-match between CRC ind and RX ind - "
|
||||
"hopefully the missing message is coming shortly "
|
||||
"rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n",
|
||||
UL_INFO.rx_ind.number_of_pdus,
|
||||
UL_INFO.rx_ind.sfn,
|
||||
UL_INFO.rx_ind.slot,
|
||||
UL_INFO.crc_ind.number_crcs,
|
||||
UL_INFO.crc_ind.sfn,
|
||||
UL_INFO.crc_ind.slot);
|
||||
}
|
||||
else if (crc_ind->number_crcs < rx_ind->number_of_pdus) {
|
||||
int num_unmatched_rxs = 0;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched));
|
||||
rx_ind_unmatched->header = rx_ind->header;
|
||||
rx_ind_unmatched->sfn = rx_ind->sfn;
|
||||
rx_ind_unmatched->slot = rx_ind->slot;
|
||||
rx_ind_unmatched->number_of_pdus = rx_ind->number_of_pdus - crc_ind->number_crcs;
|
||||
rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t));
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
|
||||
if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) {
|
||||
LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n",
|
||||
i, rx_ind->pdu_list[i].rnti);
|
||||
rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i];
|
||||
num_unmatched_rxs++;
|
||||
remove_rx_pdu(rx_ind, i);
|
||||
}
|
||||
if (rx_ind->number_of_pdus == crc_ind->number_crcs) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
AssertFatal(rx_ind_unmatched->number_of_pdus == num_unmatched_rxs, "rx_ind num_pdus %d doesnt match %d\n",
|
||||
rx_ind_unmatched->number_of_pdus, num_unmatched_rxs);
|
||||
if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched))
|
||||
{
|
||||
LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n");
|
||||
free_and_zero(rx_ind_unmatched->pdu_list);
|
||||
free_and_zero(rx_ind_unmatched);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_E(NR_MAC, "The number of crc pdus %d = the number of rx pdus %d\n",
|
||||
crc_ind->number_crcs, rx_ind->number_of_pdus);
|
||||
}
|
||||
}
|
||||
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
||||
AssertFatal(UL_info!=NULL,"UL_info is null\n");
|
||||
#ifdef DUMP_FAPI
|
||||
dump_ul(UL_info);
|
||||
#endif
|
||||
@@ -440,17 +383,63 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
NR_IF_Module_t *ifi = nr_if_inst[module_id];
|
||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||
LOG_D(NR_PHY,"SFN/SLOT:%d.%d module_id:%d CC_id:%d UL_info[rach_pdus:%zu rx_ind:%zu crcs:%zu]\n",
|
||||
UL_info->frame,UL_info->slot,
|
||||
module_id,CC_id, gnb_rach_ind_queue.num_items,
|
||||
gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
|
||||
UL_info->frame, UL_info->slot,
|
||||
module_id, CC_id,
|
||||
gnb_rach_ind_queue.num_items,
|
||||
gnb_rx_ind_queue.num_items,
|
||||
gnb_crc_ind_queue.num_items);
|
||||
|
||||
nfapi_nr_rach_indication_t *rach_ind = NULL;
|
||||
nfapi_nr_uci_indication_t *uci_ind = NULL;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = NULL;
|
||||
nfapi_nr_crc_indication_t *crc_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_rach_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
|
||||
rach_ind = get_queue(&gnb_rach_ind_queue);
|
||||
AssertFatal(rach_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
|
||||
UL_info->rach_ind = *rach_ind;
|
||||
}
|
||||
if (gnb_uci_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
|
||||
uci_ind = get_queue(&gnb_uci_ind_queue);
|
||||
AssertFatal(uci_ind->num_ucis > 0, "Invalid number of PDUs\n");
|
||||
UL_info->uci_ind = *uci_ind;
|
||||
}
|
||||
if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n",
|
||||
gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
|
||||
rx_ind = get_queue(&gnb_rx_ind_queue);
|
||||
int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
|
||||
crc_ind = unqueue_matching(&gnb_crc_ind_queue,
|
||||
MAX_QUEUE_SIZE,
|
||||
crc_sfn_slot_matcher,
|
||||
&sfn_slot);
|
||||
if (!crc_ind) {
|
||||
LOG_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
|
||||
requeue(&gnb_rx_ind_queue, rx_ind);
|
||||
}
|
||||
else {
|
||||
AssertFatal(rx_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
|
||||
AssertFatal(crc_ind->number_crcs > 0, "Invalid number of PDUs\n");
|
||||
if (crc_ind->number_crcs != rx_ind->number_of_pdus)
|
||||
match_crc_rx_pdu(rx_ind, crc_ind);
|
||||
UL_info->rx_ind = *rx_ind;
|
||||
UL_info->crc_ind = *crc_ind;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handle_nr_rach(UL_info);
|
||||
|
||||
handle_nr_uci(UL_info);
|
||||
// clear UL DCI prior to handling ULSCH
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
free_unqueued_nfapi_indications(rach_ind, uci_ind, rx_ind, crc_ind);
|
||||
}
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
|
||||
if (ifi->CC_mask==0) {
|
||||
|
||||
@@ -296,11 +296,11 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
|
||||
{
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id);
|
||||
mac->nr_ue_emul_l1.expected_sib = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(*mac->nr_ue_emul_l1.index_has_sib));
|
||||
memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(mac->nr_ue_emul_l1.index_has_sib));
|
||||
mac->nr_ue_emul_l1.expected_rar = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(*mac->nr_ue_emul_l1.index_has_rar));
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
|
||||
mac->nr_ue_emul_l1.expected_dci = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(*mac->nr_ue_emul_l1.index_has_dci));
|
||||
memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(mac->nr_ue_emul_l1.index_has_dci));
|
||||
int pdu_idx = 0;
|
||||
|
||||
int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs;
|
||||
@@ -424,7 +424,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
|
||||
|
||||
if (!dl_info->rx_ind)
|
||||
{
|
||||
dl_info->rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t));
|
||||
dl_info->rx_ind = CALLOC(num_pdus, sizeof(fapi_nr_rx_indication_t));
|
||||
}
|
||||
AssertFatal(dl_info->rx_ind != NULL, "%s: Out of memory in calloc", __FUNCTION__);
|
||||
fapi_nr_rx_indication_t *rx_ind = dl_info->rx_ind;
|
||||
@@ -1038,7 +1038,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t
|
||||
// Note: sdu should always be processed because data and timing advance updates are transmitted by the UE
|
||||
int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){
|
||||
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid;
|
||||
|
||||
update_harq_status(dl_info->module_id,
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid,
|
||||
|
||||
@@ -4293,9 +4293,10 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
|
||||
LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA;
|
||||
asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list);
|
||||
measresulteutra_list->physCellId = phy_id;
|
||||
//asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
|
||||
//measresult_cgi2->cellGlobalId= {0};
|
||||
//measresult_cgi2->trackingAreaCode= {0};
|
||||
/* TODO: This asn1cCalloc leaks memory but also masks a bug.
|
||||
If we delete this asn1cCalloc statement, eNB will crash in NSA mode.
|
||||
Please don't delete the following line unless the bug has been found. */
|
||||
asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
|
||||
struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult;
|
||||
asn1cCallocOne(measResult->rsrpResult, rsrp_tar);
|
||||
asn1cCallocOne(measResult->rsrqResult, rsrq_tar);
|
||||
|
||||
@@ -2022,6 +2022,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,
|
||||
@@ -2443,6 +2467,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)
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -2479,15 +2505,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
|
||||
@@ -2503,6 +2520,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,
|
||||
|
||||
@@ -112,6 +112,10 @@ void fill_initial_cellGroupConfig(int uid,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
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);
|
||||
|
||||
int16_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
@@ -148,6 +152,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);
|
||||
|
||||
|
||||
@@ -31,17 +31,64 @@
|
||||
#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);
|
||||
|
||||
int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
// coreset duration setting to be improved in the framework of RRC harmonization, potentially using a common function
|
||||
int len_coreset = 1;
|
||||
if (curr_bwp < 48)
|
||||
len_coreset = 2;
|
||||
// setting default TDA for DL with
|
||||
struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
|
||||
timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot
|
||||
timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,14-len_coreset); // basic slot configuration starting in symbol 1 til the end of the slot
|
||||
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,
|
||||
timedomainresourceallocation);
|
||||
|
||||
if(frame_type==TDD) {
|
||||
// TDD
|
||||
if(scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
@@ -49,7 +96,7 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
|
||||
if(dl_symb > 1) {
|
||||
timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
|
||||
timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
|
||||
timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation
|
||||
timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,dl_symb-len_coreset); // mixed slot configuration starting in symbol 1 til the end of the dl allocation
|
||||
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,
|
||||
timedomainresourceallocation);
|
||||
}
|
||||
@@ -102,6 +149,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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -345,14 +345,18 @@ typedef struct gNB_RRC_UE_s {
|
||||
uint8_t setup_e_rabs;
|
||||
/* Number of e_rab to be setup in the list */
|
||||
uint8_t nb_of_e_rabs;
|
||||
/* Total number of pdu session already setup in the list */
|
||||
uint8_t setup_pdu_sessions;
|
||||
/* Number of pdu session to be setup in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* Number of e_rab to be modified in the list */
|
||||
uint8_t nb_of_modify_e_rabs;
|
||||
uint8_t nb_of_failed_e_rabs;
|
||||
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
/* Total number of pdu session already setup in the list */
|
||||
uint8_t setup_pdu_sessions;
|
||||
/* Number of pdu session to be setup in the list */
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* Number of e_rab to be modified in the list */
|
||||
uint8_t nb_of_modify_pdusessions;
|
||||
uint8_t nb_of_failed_pdusessions;
|
||||
pdu_session_param_t modify_pdusession[NR_NB_RB_MAX];
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
/* list of pdu session to be setup by RRC layers */
|
||||
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
|
||||
@@ -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,
|
||||
@@ -94,6 +95,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,
|
||||
@@ -218,3 +220,24 @@ void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP);
|
||||
|
||||
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
+203
-50
@@ -98,6 +98,7 @@
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
#include <openair2/X2AP/x2ap_eNB.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
#include "BIT_STRING.h"
|
||||
#include "assertions.h"
|
||||
@@ -740,6 +741,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,
|
||||
@@ -750,8 +753,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);
|
||||
|
||||
@@ -1011,6 +1016,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");
|
||||
@@ -1053,6 +1060,178 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_gNB_modify_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
NR_DRB_ToAddMod_t *DRB_config = NULL;
|
||||
NR_DRB_ToAddModList_t **DRB_configList = NULL;
|
||||
NR_DRB_ToAddModList_t *DRB_configList2 = NULL;
|
||||
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList
|
||||
*dedicatedNAS_MessageList = NULL;
|
||||
NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL;
|
||||
uint8_t buffer[RRC_BUF_SIZE];
|
||||
uint16_t size;
|
||||
int qos_flow_index = 0;
|
||||
int i, j;
|
||||
|
||||
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
|
||||
DRB_configList = &ue_context_pP->ue_context.DRB_configList;
|
||||
|
||||
DRB_configList2 = CALLOC(1, sizeof(NR_DRB_ToAddModList_t));
|
||||
memset(DRB_configList2, 0, sizeof(NR_DRB_ToAddModList_t));
|
||||
|
||||
dedicatedNAS_MessageList = CALLOC(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList));
|
||||
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
|
||||
// bypass the new and already configured pdu sessions
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].status >= PDU_SESSION_STATUS_DONE) {
|
||||
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].cause != NGAP_CAUSE_NOTHING) {
|
||||
// set xid of failure pdu session
|
||||
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
|
||||
continue;
|
||||
}
|
||||
|
||||
// search exist DRB_config
|
||||
for (j = 0; j < (*DRB_configList)->list.count; j++) {
|
||||
if ((*DRB_configList)->list.array[j]->cnAssociation->choice.sdap_Config->pdu_Session ==
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id) {
|
||||
DRB_config = (*DRB_configList)->list.array[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (DRB_config == NULL) {
|
||||
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unspecified;
|
||||
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Reference TS23501 Table 5.7.4-1: Standardized 5QI to QoS characteristics mapping
|
||||
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
|
||||
switch (ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI) {
|
||||
case 1: //100ms
|
||||
case 2: //150ms
|
||||
case 3: //50ms
|
||||
case 4: //300ms
|
||||
case 5: //100ms
|
||||
case 6: //300ms
|
||||
case 7: //100ms
|
||||
case 8: //300ms
|
||||
case 9: //300ms Video (Buffered Streaming)TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc.)
|
||||
// TODO
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI);
|
||||
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_not_supported_5QI_value;
|
||||
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC, "PDU SESSION ID %ld, DRB ID %ld (index %d), QOS flow %d, 5QI %ld \n",
|
||||
DRB_config->cnAssociation->choice.sdap_Config->pdu_Session,
|
||||
DRB_config->drb_Identity, i,
|
||||
qos_flow_index,
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI
|
||||
);
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config);
|
||||
|
||||
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_DONE;
|
||||
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
|
||||
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
|
||||
dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t));
|
||||
memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(dedicatedNAS_Message,
|
||||
(char *)ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer,
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.length);
|
||||
ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message);
|
||||
|
||||
LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length,
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
|
||||
} else {
|
||||
// TODO
|
||||
LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
|
||||
}
|
||||
}
|
||||
|
||||
/* If list is empty free the list and reset the address */
|
||||
if (dedicatedNAS_MessageList->list.count == 0) {
|
||||
free(dedicatedNAS_MessageList);
|
||||
dedicatedNAS_MessageList = NULL;
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
|
||||
xid,
|
||||
NULL,
|
||||
DRB_configList2,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
dedicatedNAS_MessageList,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
|
||||
/* Free the NAS PDU buffer and invalidate it */
|
||||
free(ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer);
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,
|
||||
"[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCReconfiguration (bytes %d, UE RNTI %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
LOG_D(NR_RRC,
|
||||
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH);
|
||||
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
uint8_t *message_buffer;
|
||||
message_buffer = itti_malloc (TASK_RRC_GNB_SIM, TASK_RRC_UE_SIM, size);
|
||||
memcpy (message_buffer, buffer, size);
|
||||
message_p = itti_alloc_new_message (TASK_RRC_GNB_SIM, 0, GNB_RRC_DCCH_DATA_IND);
|
||||
GNB_RRC_DCCH_DATA_IND (message_p).rbid = DCCH;
|
||||
GNB_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
|
||||
GNB_RRC_DCCH_DATA_IND (message_p).size = size;
|
||||
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
|
||||
#else
|
||||
nr_rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
@@ -1110,6 +1289,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
NULL,
|
||||
dedicatedNAS_MessageList,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
ue_context_pP->ue_context.pdu_session_release_command_flag = 1;
|
||||
@@ -1659,6 +1840,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");
|
||||
@@ -2258,10 +2441,23 @@ rrc_gNB_decode_dcch(
|
||||
//NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid);
|
||||
} else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) {
|
||||
if (ue_context_p->ue_context.setup_pdu_sessions > 0) {
|
||||
if (ue_context_p->ue_context.nb_of_pdusessions > 0) {
|
||||
rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
|
||||
ue_context_p->ue_context.nb_of_pdusessions = 0;
|
||||
}
|
||||
}
|
||||
if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) {
|
||||
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
|
||||
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
|
||||
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
|
||||
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
|
||||
|
||||
for(int i = 0; i < NR_NB_RB_MAX; i++) {
|
||||
ue_context_p->ue_context.modify_pdusession[i].xid = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3226,51 +3422,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;
|
||||
|
||||
@@ -3340,11 +3491,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));
|
||||
@@ -3539,6 +3688,10 @@ void *rrc_gnb_task(void *args_p) {
|
||||
rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_MODIFY_REQ:
|
||||
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case NGAP_PDUSESSION_RELEASE_COMMAND:
|
||||
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
@@ -1058,6 +1058,264 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
|
||||
MessageDef *msg_p,
|
||||
const char *msg_name,
|
||||
instance_t instance
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
uint16_t ue_initial_id;
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
uint8_t nb_pdusessions_tomodify;
|
||||
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||
uint8_t i;
|
||||
uint8_t qos_flow_index;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
ue_initial_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).ue_initial_id;
|
||||
gNB_ue_ngap_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).gNB_ue_ngap_id;
|
||||
nb_pdusessions_tomodify = NGAP_PDUSESSION_MODIFY_REQ(msg_p).nb_pdusessions_tomodify;
|
||||
|
||||
ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id);
|
||||
if (ue_context_p == NULL) {
|
||||
LOG_W(NR_RRC, "[gNB %ld] In NGAP_PDUSESSION_MODIFY_REQ: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id);
|
||||
// TODO
|
||||
return (-1);
|
||||
} else {
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ctxt.eNB_index = 0;
|
||||
|
||||
ue_context_p->ue_context.gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
{
|
||||
int j;
|
||||
boolean_t is_treated[NGAP_MAX_PDUSESSION] = {FALSE};
|
||||
uint8_t nb_of_failed_pdusessions = 0;
|
||||
|
||||
for (i = 0; i < nb_pdusessions_tomodify; i++) {
|
||||
if (is_treated[i] == TRUE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Check if same PDU session ID to handle multiple pdu sessions
|
||||
for (j = i+1; j < nb_pdusessions_tomodify; j++) {
|
||||
if (is_treated[j] == FALSE &&
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id ==
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
|
||||
// handle multiple pdu session id
|
||||
LOG_D(NR_RRC, "handle multiple pdu session id \n");
|
||||
ue_context_p->ue_context.modify_pdusession[j].status = PDU_SESSION_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_pdusession[j].param.pdusession_id =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id;
|
||||
ue_context_p->ue_context.modify_pdusession[j].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_pdusession[j].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
|
||||
nb_of_failed_pdusessions++;
|
||||
is_treated[i] = TRUE;
|
||||
is_treated[j] = TRUE;
|
||||
}
|
||||
}
|
||||
// handle multiple pdu session id case
|
||||
if (is_treated[i] == TRUE) {
|
||||
LOG_D(NR_RRC, "handle multiple pdu session id \n");
|
||||
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
|
||||
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
|
||||
nb_of_failed_pdusessions++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check pdu session ID is established
|
||||
for (j = 0; j < NR_NB_RB_MAX -3; j++) {
|
||||
if (ue_context_p->ue_context.pduSession[j].param.pdusession_id ==
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
|
||||
if (ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_TORELEASE ||
|
||||
ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_DONE) {
|
||||
break;
|
||||
}
|
||||
// Found established pdu session, prepare to send RRC message
|
||||
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
|
||||
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_NOTHING;
|
||||
if (NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer != NULL) {
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.buffer =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer;
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.length =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.length;
|
||||
}
|
||||
// Save new pdu session parameters, qos, upf addr, teid
|
||||
for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; qos_flow_index++) {
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.qos[qos_flow_index] =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].qos[qos_flow_index];
|
||||
}
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.nb_qos =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos;
|
||||
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.upf_addr =
|
||||
ue_context_p->ue_context.pduSession[j].param.upf_addr;
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.gtp_teid =
|
||||
ue_context_p->ue_context.pduSession[j].param.gtp_teid;
|
||||
|
||||
is_treated[i] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// handle Unknown pdu session ID
|
||||
if (is_treated[i] == FALSE) {
|
||||
LOG_D(NR_RRC, "handle Unknown pdu session ID \n");
|
||||
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
|
||||
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
|
||||
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
|
||||
nb_of_failed_pdusessions++;
|
||||
is_treated[i] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.nb_of_modify_pdusessions = nb_pdusessions_tomodify;
|
||||
ue_context_p->ue_context.nb_of_failed_pdusessions = nb_of_failed_pdusessions;
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) {
|
||||
LOG_D(NR_RRC, "generate RRCReconfiguration \n");
|
||||
rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p);
|
||||
} else { // all pdu modification failed
|
||||
LOG_I(NR_RRC, "pdu session modify failed, fill NGAP_PDUSESSION_MODIFY_RESP with the pdu session information that failed to modify \n");
|
||||
uint8_t nb_of_pdu_sessions_failed = 0;
|
||||
MessageDef *msg_fail_p = NULL;
|
||||
msg_fail_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
|
||||
if (msg_fail_p == NULL) {
|
||||
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_fail_p is NULL \n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions = 0;
|
||||
|
||||
for (nb_of_pdu_sessions_failed = 0; nb_of_pdu_sessions_failed < ue_context_p->ue_context.nb_of_failed_pdusessions; nb_of_pdu_sessions_failed++) {
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].pdusession_id =
|
||||
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].param.pdusession_id;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause =
|
||||
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause_value =
|
||||
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause_value;
|
||||
}
|
||||
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions_failed =
|
||||
ue_context_p->ue_context.nb_of_failed_pdusessions;
|
||||
itti_send_msg_to_task(TASK_NGAP, instance, msg_fail_p);
|
||||
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
|
||||
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
|
||||
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t xid
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
MessageDef *msg_p = NULL;
|
||||
int i, j;
|
||||
uint8_t qos_flow_index;
|
||||
uint8_t pdu_sessions_failed = 0;
|
||||
uint8_t pdu_sessions_done = 0;
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
|
||||
if (msg_p == NULL) {
|
||||
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_p is NULL \n");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC, "send message NGAP_PDUSESSION_MODIFY_RESP \n");
|
||||
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
|
||||
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
|
||||
if (xid == ue_context_pP->ue_context.modify_pdusession[i].xid) {
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_DONE) {
|
||||
for (j = 0; j < ue_context_pP->ue_context.setup_pdu_sessions; j++) {
|
||||
if (ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id ==
|
||||
ue_context_pP->ue_context.pduSession[j].param.pdusession_id) {
|
||||
LOG_I(NR_RRC, "update pdu session %d \n", ue_context_pP->ue_context.pduSession[j].param.pdusession_id);
|
||||
// Update ue_context_pP->ue_context.pduSession
|
||||
ue_context_pP->ue_context.pduSession[j].status = PDU_SESSION_STATUS_ESTABLISHED;
|
||||
ue_context_pP->ue_context.pduSession[j].cause = NGAP_CAUSE_NOTHING;
|
||||
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
|
||||
ue_context_pP->ue_context.pduSession[j].param.qos[qos_flow_index] =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j < ue_context_pP->ue_context.setup_pdu_sessions) {
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
|
||||
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].qos[qos_flow_index].qfi =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].qfi;
|
||||
}
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].nb_of_qos_flow =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos;
|
||||
LOG_I(NR_RRC, "Modify Resp (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ",
|
||||
pdu_sessions_done, i, ue_context_pP->ue_context.modify_pdusession[i].status, xid,
|
||||
ue_context_pP->ue_context.nb_of_modify_pdusessions,
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id);
|
||||
pdu_sessions_done++;
|
||||
} else {
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
|
||||
pdu_sessions_failed++;
|
||||
}
|
||||
} else if ((ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_NEW) ||
|
||||
(ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED)) {
|
||||
LOG_D (NR_RRC, "PDU SESSION is NEW or already ESTABLISHED\n");
|
||||
} else if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_FAILED) {
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value =
|
||||
ue_context_pP->ue_context.modify_pdusession[i].cause_value;
|
||||
pdu_sessions_failed++;
|
||||
}
|
||||
} else {
|
||||
LOG_D(NR_RRC,"xid does not correspond (context pdu session index %d, status %d, xid %d/%d) \n ",
|
||||
i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.modify_pdusession[i].xid);
|
||||
}
|
||||
}
|
||||
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions = pdu_sessions_done;
|
||||
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions_failed = pdu_sessions_failed;
|
||||
|
||||
if (pdu_sessions_done > 0 || pdu_sessions_failed > 0) {
|
||||
LOG_D(NR_RRC,"NGAP_PDUSESSION_MODIFY_RESP: sending the message: nb_of_pdusessions %d, total pdu session %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_modify_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, i);
|
||||
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
|
||||
const module_id_t gnb_mod_idP,
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "NR_RRCSetupComplete-IEs.h"
|
||||
#include "NR_RegisteredAMF.h"
|
||||
#include "NR_UL-DCCH-Message.h"
|
||||
#include "NGAP_CauseRadioNetwork.h"
|
||||
|
||||
typedef struct rrc_ue_ngap_ids_s {
|
||||
/* Tree related data */
|
||||
@@ -107,6 +108,27 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
|
||||
instance_t instance
|
||||
);
|
||||
|
||||
int
|
||||
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
|
||||
MessageDef *msg_p,
|
||||
const char *msg_name,
|
||||
instance_t instance
|
||||
);
|
||||
|
||||
int
|
||||
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t xid
|
||||
);
|
||||
|
||||
void
|
||||
rrc_gNB_modify_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
|
||||
const module_id_t gnb_mod_idP,
|
||||
|
||||
@@ -42,27 +42,7 @@
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
|
||||
extern boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
@@ -268,6 +248,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,
|
||||
@@ -278,6 +259,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,
|
||||
|
||||
@@ -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
|
||||
@@ -87,6 +88,7 @@ void fill_default_nsa_downlinkBWP(NR_BWP_Downlink_t *bwp,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
int dl_antenna_ports,
|
||||
uint64_t bitmap) {
|
||||
|
||||
@@ -305,42 +307,7 @@ void fill_default_nsa_downlinkBWP(NR_BWP_Downlink_t *bwp,
|
||||
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;
|
||||
@@ -582,8 +549,8 @@ void fill_default_nsa_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
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));
|
||||
@@ -680,6 +647,7 @@ void fill_default_nsa_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
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,
|
||||
@@ -691,6 +659,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.
|
||||
@@ -964,12 +935,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;
|
||||
@@ -1064,8 +1030,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));
|
||||
@@ -1194,7 +1160,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
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));
|
||||
fill_default_nsa_downlinkBWP(bwp, bwp_loop, secondaryCellGroup, servingcellconfigdedicated, servingcellconfigcommon, dl_antenna_ports, bitmap);
|
||||
fill_default_nsa_downlinkBWP(bwp, bwp_loop, secondaryCellGroup, servingcellconfigdedicated, servingcellconfigcommon, uecap, dl_antenna_ports, bitmap);
|
||||
ASN_SEQUENCE_ADD(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
|
||||
@@ -1531,17 +1497,17 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||
break;
|
||||
case 2:
|
||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
||||
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||
break;
|
||||
@@ -1574,6 +1540,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,
|
||||
@@ -1588,6 +1555,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
fill_default_secondaryCellGroup(servingcellconfigcommon,
|
||||
servingcellconfigdedicated,
|
||||
secondaryCellGroup,
|
||||
uecap,
|
||||
1,
|
||||
1,
|
||||
dl_antenna_ports,
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
#include "nr_nas_msg_sim.h"
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
NR_UE_RRC_INST_t *NR_UE_rrc_inst;
|
||||
/* NAS Attach request with IMSI */
|
||||
@@ -178,27 +179,6 @@ static int nr_rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_NR_t subS
|
||||
return (0);
|
||||
}
|
||||
|
||||
extern boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id,
|
||||
const uint8_t *buffer,
|
||||
@@ -2230,7 +2210,7 @@ nr_rrc_ue_establish_srb2(
|
||||
// nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig);
|
||||
}
|
||||
|
||||
if(ie->nonCriticalExtension->masterCellGroup!=NULL) {
|
||||
if((ie->nonCriticalExtension) && (ie->nonCriticalExtension->masterCellGroup!=NULL)) {
|
||||
nr_rrc_ue_process_masterCellGroup(
|
||||
ctxt_pP,
|
||||
gNB_index,
|
||||
@@ -2243,7 +2223,7 @@ nr_rrc_ue_establish_srb2(
|
||||
}
|
||||
|
||||
/* Check if there is dedicated NAS information to forward to NAS */
|
||||
if (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL) {
|
||||
if ((ie->nonCriticalExtension) && (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL)) {
|
||||
int list_count;
|
||||
uint32_t pdu_length;
|
||||
uint8_t *pdu_buffer;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -621,7 +621,12 @@ void x2ap_eNB_handle_sgNB_release_request(instance_t instance,
|
||||
}
|
||||
|
||||
target = x2ap_get_eNB(NULL, x2ap_release_req->assoc_id, 0);
|
||||
DevAssert(target != NULL);
|
||||
if (target == NULL) {
|
||||
X2AP_ERROR("no X2AP target eNB on assoc_id %d, dropping sgNB release request\n", x2ap_release_req->assoc_id);
|
||||
/* x2ap_gNB_handle_ENDC_sGNB_release_request_acknowledge() would handle the
|
||||
* ack, but does not do anything */
|
||||
return;
|
||||
}
|
||||
|
||||
/* id_source is not used by oai's gNB so it's not big deal. For
|
||||
* interoperability with other gNBs things may need to be refined.
|
||||
|
||||
Reference in New Issue
Block a user