Commit c93a9497 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/develop-NSA_SA_fixes' into integration_2021_wk30_b

parents 94ba6157 165b4068
...@@ -24,10 +24,6 @@ gNBs = ...@@ -24,10 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -235,6 +231,8 @@ MACRLCs = ( ...@@ -235,6 +231,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -231,6 +229,8 @@ MACRLCs = ( ...@@ -231,6 +229,8 @@ MACRLCs = (
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
ulsch_max_slots_inactivity = 1; ulsch_max_slots_inactivity = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -230,6 +230,8 @@ MACRLCs = ( ...@@ -230,6 +230,8 @@ MACRLCs = (
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
ulsch_max_slots_inactivity = 100; ulsch_max_slots_inactivity = 100;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -23,9 +23,6 @@ gNBs = ...@@ -23,9 +23,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -228,6 +225,8 @@ MACRLCs = ( ...@@ -228,6 +225,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -23,9 +23,6 @@ gNBs = ...@@ -23,9 +23,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -235,6 +232,8 @@ MACRLCs = ( ...@@ -235,6 +232,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -107,9 +107,9 @@ ...@@ -107,9 +107,9 @@
#define MACRLC_LOCAL_S_PORTD_IDX 15 #define MACRLC_LOCAL_S_PORTD_IDX 15
#define MACRLC_REMOTE_S_PORTD_IDX 16 #define MACRLC_REMOTE_S_PORTD_IDX 16
#define MACRLC_ULSCH_MAX_SLOTS_INACTIVITY 17 #define MACRLC_ULSCH_MAX_SLOTS_INACTIVITY 17
#define MACRLC_PUSCHTARGETSNRX10_IDX 17 #define MACRLC_PUSCHTARGETSNRX10_IDX 18
#define MACRLC_PUCCHTARGETSNRX10_IDX 18 #define MACRLC_PUCCHTARGETSNRX10_IDX 19
#define MACRLC_PUCCHFAILURETHRES_IDX 19 #define MACRLC_PUCCHFAILURETHRES_IDX 20
#define MACRLC_PUSCHFAILURETHRES_IDX 20 #define MACRLC_PUSCHFAILURETHRES_IDX 21
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif #endif
...@@ -1985,10 +1985,13 @@ find_UE_id(module_id_t mod_idP, ...@@ -1985,10 +1985,13 @@ find_UE_id(module_id_t mod_idP,
{ {
int UE_id; int UE_id;
UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info; UE_info_t *UE_info = &RC.mac[mod_idP]->UE_info;
if(!UE_info)
return -1;
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
if (UE_info->active[UE_id] == TRUE) { if (UE_info->active[UE_id] == TRUE) {
if (UE_info->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) { int CC_id = UE_PCCID(mod_idP, UE_id);
if (CC_id>=0 && CC_id<NFAPI_CC_MAX && UE_info->UE_template[CC_id][UE_id].rnti == rntiP) {
return UE_id; return UE_id;
} }
} }
......
...@@ -789,11 +789,10 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){ ...@@ -789,11 +789,10 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){
} }
// Handlig failure of RA procedure @ MAC layer // Handling failure of RA procedure @ MAC layer
// according to section 5 of 3GPP TS 38.321 version 16.2.1 Release 16 // according to section 5 of 3GPP TS 38.321 version 16.2.1 Release 16
// todo: // todo:
// - complete handling of received contention-based RA preamble // - complete handling of received contention-based RA preamble
// - 2-step RA implementation
void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_resources, frame_t frame, int slot) { void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_resources, frame_t frame, int slot) {
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
...@@ -806,29 +805,19 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res ...@@ -806,29 +805,19 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++; prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER++;
if(prach_resources->RA_TYPE == RA_4STEP){
if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1){ if (prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER == ra->preambleTransMax + 1){
LOG_D(MAC, "In %s: [UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n", __FUNCTION__, mod_id, frame, slot, ra->preambleTransMax); LOG_D(MAC, "In %s: [UE %d][%d.%d] Maximum number of RACH attempts (%d) reached, selecting backoff time...\n",
__FUNCTION__, mod_id, frame, slot, ra->preambleTransMax);
ra->RA_backoff_cnt = rand() % (prach_resources->RA_PREAMBLE_BACKOFF + 1); ra->RA_backoff_cnt = rand() % (prach_resources->RA_PREAMBLE_BACKOFF + 1);
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1; prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP += 2; // 2 dB increment prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP += 2; // 2 dB increment
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id); prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
} else { } else {
// Resetting RA window // Resetting RA window
nr_get_RA_window(mac); nr_get_RA_window(mac);
}
} else if (prach_resources->RA_TYPE == RA_2STEP){
LOG_E(MAC, "Missing implementation of RA failure handling for 2-step RA...\n");
} }
} }
...@@ -1539,8 +1539,10 @@ void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t ...@@ -1539,8 +1539,10 @@ void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t
ra->state = RA_IDLE; ra->state = RA_IDLE;
ra->timing_offset = 0; ra->timing_offset = 0;
ra->RRC_timer = 20; ra->RRC_timer = 20;
ra->rnti = 0;
ra->msg3_round = 0; ra->msg3_round = 0;
if(ra->cfra == false) {
ra->rnti = 0;
}
} }
......
...@@ -711,7 +711,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -711,7 +711,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
current_rnti); current_rnti);
if( (frameP==ra->Msg3_frame) && (slotP==ra->Msg3_slot) ) { if( (frameP==ra->Msg3_frame) && (slotP==ra->Msg3_slot) ) {
LOG_W(NR_MAC, "Random Access %i failed at state %i (TC_RNTI %04x RNTI %04x\n", i, ra->state,ra->rnti,current_rnti); LOG_W(NR_MAC, "Random Access %i failed at state %i (TC_RNTI %04x RNTI %04x)\n", i, ra->state,ra->rnti,current_rnti);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
} }
...@@ -722,6 +722,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -722,6 +722,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
int UE_id=-1; int UE_id=-1;
UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->CellGroup); UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->CellGroup);
if (UE_id<0) {
LOG_W(NR_MAC, "Random Access %i discarded at state %i (TC_RNTI %04x RNTI %04x): max number of users achieved!\n", i, ra->state,ra->rnti,current_rnti);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
return;
}
UE_info->UE_beam_index[UE_id] = ra->beam_id; UE_info->UE_beam_index[UE_id] = ra->beam_id;
// re-initialize ta update variables after RA procedure completion // re-initialize ta update variables after RA procedure completion
......
...@@ -3070,7 +3070,10 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { ...@@ -3070,7 +3070,10 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
ue_context_p, ue_context_p,
NGAP_CAUSE_RADIO_NETWORK, NGAP_CAUSE_RADIO_NETWORK,
30); 30);
}else{ }
// Remove here the MAC and RRC context when RRC is not connected or gNB is not connected to CN5G
if(ue_context_p->ue_context.StatusRrc < NR_RRC_CONNECTED || ue_context_p->ue_context.gNB_ue_ngap_id == 0) {
mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti);
rrc_rlc_remove_ue(ctxt_pP); rrc_rlc_remove_ue(ctxt_pP);
pdcp_remove_UE(ctxt_pP); pdcp_remove_UE(ctxt_pP);
...@@ -3082,6 +3085,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { ...@@ -3082,6 +3085,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti);
} }
} }
break; // break RB_FOREACH break; // break RB_FOREACH
} }
} }
......
...@@ -25,10 +25,6 @@ gNBs = ...@@ -25,10 +25,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -236,6 +232,8 @@ MACRLCs = ( ...@@ -236,6 +232,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -229,6 +227,8 @@ MACRLCs = ( ...@@ -229,6 +227,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -213,6 +211,8 @@ MACRLCs = ( ...@@ -213,6 +211,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -227,6 +225,8 @@ MACRLCs = ( ...@@ -227,6 +225,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -227,6 +225,8 @@ MACRLCs = ( ...@@ -227,6 +225,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -24,8 +24,6 @@ gNBs = ...@@ -24,8 +24,6 @@ gNBs =
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts = 1; pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1; pusch_AntennaPorts = 1;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
servingCellConfigCommon = ( servingCellConfigCommon = (
{ {
...@@ -243,6 +241,8 @@ MACRLCs = ( ...@@ -243,6 +241,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -230,6 +230,8 @@ MACRLCs = ( ...@@ -230,6 +230,8 @@ MACRLCs = (
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
ulsch_max_slots_inactivity = 100; ulsch_max_slots_inactivity = 100;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -230,6 +230,8 @@ MACRLCs = ( ...@@ -230,6 +230,8 @@ MACRLCs = (
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
ulsch_max_slots_inactivity = 100; ulsch_max_slots_inactivity = 100;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
...@@ -258,6 +258,8 @@ MACRLCs = ( ...@@ -258,6 +258,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
} }
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment