Commit e0e1ca65 authored by Robert Schmidt's avatar Robert Schmidt

Make SA the default mode, remove corresponding option

parent 220d851d
...@@ -304,15 +304,14 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -304,15 +304,14 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
init_pdcp(); init_pdcp();
} }
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(node_type) if (get_softmodem_params()->nsa) { //&& !NODE_IS_DU(node_type)
LOG_I(X2AP, "X2AP enabled \n"); LOG_I(X2AP, "X2AP enabled \n");
__attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end); __attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
} }
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info /* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
* can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/ * can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
if ((get_softmodem_params()->sa || is_x2ap_enabled()) && if (IS_SA_MODE(get_softmodem_params()) && !NODE_IS_DU(node_type)) {
!NODE_IS_DU(node_type)) {
/* Try to register each gNB */ /* Try to register each gNB */
//registered_gnb = 0; //registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end); __attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
...@@ -324,7 +323,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -324,7 +323,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
return -1; return -1;
} }
if (is_x2ap_enabled()) { if (get_softmodem_params()->nsa) {
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0) { if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0) {
LOG_E(X2AP, "Create task for X2AP failed\n"); LOG_E(X2AP, "Create task for X2AP failed\n");
} }
...@@ -333,8 +332,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -333,8 +332,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
} }
} }
if (get_softmodem_params()->sa && if (IS_SA_MODE(get_softmodem_params()) && !NODE_IS_DU(node_type)) {
!NODE_IS_DU(node_type)) {
char* gnb_ipv4_address_for_NGU = NULL; char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0; uint32_t gnb_port_for_NGU = 0;
...@@ -383,7 +381,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -383,7 +381,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
} }
//Use check on x2ap to consider the NSA scenario //Use check on x2ap to consider the NSA scenario
if((is_x2ap_enabled() || get_softmodem_params()->sa) && (node_type != ngran_gNB_CUCP)) { if((is_x2ap_enabled() || IS_SA_MODE(get_softmodem_params())) && (node_type != ngran_gNB_CUCP)) {
if (itti_create_task (TASK_GTPV1_U, &gtpv1uTask, NULL) < 0) { if (itti_create_task (TASK_GTPV1_U, &gtpv1uTask, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n"); LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1; return -1;
......
...@@ -286,7 +286,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -286,7 +286,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n", LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n",
frame, slot); frame, slot);
if (get_softmodem_params()->sa && mac->mib == NULL) { if (IS_SA_MODE(get_softmodem_params()) && mac->mib == NULL) {
LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n"); LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n");
nr_ue_dl_indication(&mac->dl_info); nr_ue_dl_indication(&mac->dl_info);
process_queued_nr_nfapi_msgs(mac, sfn_slot); process_queued_nr_nfapi_msgs(mac, sfn_slot);
...@@ -392,7 +392,7 @@ static void UE_synch(void *arg) { ...@@ -392,7 +392,7 @@ static void UE_synch(void *arg) {
ret = sl_nr_slss_search(UE, &syncD->proc, SL_NR_SSB_REPETITION_IN_FRAMES); ret = sl_nr_slss_search(UE, &syncD->proc, SL_NR_SSB_REPETITION_IN_FRAMES);
} else { } else {
nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier); nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier);
ret = nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, syncD->gscnInfo, syncD->numGscn); ret = nr_initial_sync(&syncD->proc, UE, 2, IS_SA_MODE(get_softmodem_params()), syncD->gscnInfo, syncD->numGscn);
} }
if (ret.cell_detected) { if (ret.cell_detected) {
...@@ -601,7 +601,7 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE, const UE_nr_rxtx_proc_t *proc ...@@ -601,7 +601,7 @@ static int UE_dl_preprocessing(PHY_VARS_NR_UE *UE, const UE_nr_rxtx_proc_t *proc
if (UE->sl_mode == 2) if (UE->sl_mode == 2)
fp = &UE->SL_UE_PHY_PARAMS.sl_frame_params; fp = &UE->SL_UE_PHY_PARAMS.sl_frame_params;
if (IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) { if (IS_SOFTMODEM_NOS1 || IS_SA_MODE(get_softmodem_params())) {
// Start synchronization with a target gNB // Start synchronization with a target gNB
if (UE->synch_request.received_synch_request == 1) { if (UE->synch_request.received_synch_request == 1) {
...@@ -1056,7 +1056,7 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf ...@@ -1056,7 +1056,7 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf
NR_UE_MAC_INST_t *mac = get_mac_inst(i); NR_UE_MAC_INST_t *mac = get_mac_inst(i);
mac->if_module = nr_ue_if_module_init(i); mac->if_module = nr_ue_if_module_init(i);
AssertFatal(mac->if_module, "can not initialize IF module\n"); AssertFatal(mac->if_module, "can not initialize IF module\n");
if (!get_softmodem_params()->sa || !get_softmodem_params()->sl_mode) { if (!IS_SA_MODE(get_softmodem_params()) || !get_softmodem_params()->sl_mode) {
init_nsa_message(&rrc_inst[i], reconfig_file, rbconfig_file); init_nsa_message(&rrc_inst[i], reconfig_file, rbconfig_file);
nr_rlc_activate_srb0(mac_inst[i].crnti, NULL, send_srb0_rrc); nr_rlc_activate_srb0(mac_inst[i].crnti, NULL, send_srb0_rrc);
} }
......
...@@ -480,7 +480,7 @@ int main(int argc, char **argv) ...@@ -480,7 +480,7 @@ int main(int argc, char **argv)
NR_UE_MAC_INST_t *mac = get_mac_inst(inst); NR_UE_MAC_INST_t *mac = get_mac_inst(inst);
init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats); init_nr_ue_phy_cpu_stats(&UE[CC_id]->phy_cpu_stats);
if (get_softmodem_params()->sa || get_softmodem_params()->sl_mode) { // set frame config to initial values from command line if (IS_SA_MODE(get_softmodem_params()) || get_softmodem_params()->sl_mode) { // set frame config to initial values from command line
// and assume that the SSB is centered on the grid // and assume that the SSB is centered on the grid
uint16_t nr_band = get_softmodem_params()->band; uint16_t nr_band = get_softmodem_params()->band;
mac->nr_band = nr_band; mac->nr_band = nr_band;
......
...@@ -123,7 +123,6 @@ extern "C" ...@@ -123,7 +123,6 @@ extern "C"
#define CONTINUOUS_TX softmodem_params.continuous_tx #define CONTINUOUS_TX softmodem_params.continuous_tx
#define PHY_TEST softmodem_params.phy_test #define PHY_TEST softmodem_params.phy_test
#define DO_RA softmodem_params.do_ra #define DO_RA softmodem_params.do_ra
#define SA softmodem_params.sa
#define SL_MODE softmodem_params.sl_mode #define SL_MODE softmodem_params.sl_mode
#define WAIT_FOR_SYNC softmodem_params.wait_for_sync #define WAIT_FOR_SYNC softmodem_params.wait_for_sync
#define CHAIN_OFFSET softmodem_params.chain_offset #define CHAIN_OFFSET softmodem_params.chain_offset
...@@ -155,7 +154,6 @@ extern int usrp_tx_thread; ...@@ -155,7 +154,6 @@ extern int usrp_tx_thread;
{"thread-pool", CONFIG_HLP_TPOOL, 0, .strptr=&TP_CONFIG, .defstrval="-1,-1,-1,-1,-1,-1,-1,-1", TYPE_STRING, 0}, \ {"thread-pool", CONFIG_HLP_TPOOL, 0, .strptr=&TP_CONFIG, .defstrval="-1,-1,-1,-1,-1,-1,-1,-1", TYPE_STRING, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, .iptr=&PHY_TEST, .defintval=0, TYPE_INT, 0}, \ {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, .iptr=&PHY_TEST, .defintval=0, TYPE_INT, 0}, \
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, .iptr=&DO_RA, .defintval=0, TYPE_INT, 0}, \ {"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, .iptr=&DO_RA, .defintval=0, TYPE_INT, 0}, \
{"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, .iptr=&SA, .defintval=0, TYPE_INT, 0}, \
{"sl-mode", CONFIG_HLP_SL_MODE, 0, .u8ptr=&SL_MODE, .defintval=0, TYPE_UINT8, 0}, \ {"sl-mode", CONFIG_HLP_SL_MODE, 0, .u8ptr=&SL_MODE, .defintval=0, TYPE_UINT8, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, .u8ptr=&USIM_TEST, .defintval=0, TYPE_UINT8, 0}, \ {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, .u8ptr=&USIM_TEST, .defintval=0, TYPE_UINT8, 0}, \
{"clock-source", CONFIG_HLP_CLK, 0, .uptr=&CLOCK_SOURCE, .defintval=0, TYPE_UINT, 0}, \ {"clock-source", CONFIG_HLP_CLK, 0, .uptr=&CLOCK_SOURCE, .defintval=0, TYPE_UINT, 0}, \
...@@ -224,7 +222,6 @@ extern int usrp_tx_thread; ...@@ -224,7 +222,6 @@ extern int usrp_tx_thread;
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s3a = { config_checkstr_assign_integer, \ { .s3a = { config_checkstr_assign_integer, \
{"MONOLITHIC", "PNF", "VNF", "AERIAL","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF"}, \ {"MONOLITHIC", "PNF", "VNF", "AERIAL","UE_STUB_PNF","UE_STUB_OFFNET","STANDALONE_PNF"}, \
{NFAPI_MONOLITHIC, NFAPI_MODE_PNF, NFAPI_MODE_VNF, NFAPI_MODE_AERIAL,NFAPI_UE_STUB_PNF,NFAPI_UE_STUB_OFFNET,NFAPI_MODE_STANDALONE_PNF}, \ {NFAPI_MONOLITHIC, NFAPI_MODE_PNF, NFAPI_MODE_VNF, NFAPI_MODE_AERIAL,NFAPI_UE_STUB_PNF,NFAPI_UE_STUB_OFFNET,NFAPI_MODE_STANDALONE_PNF}, \
...@@ -305,7 +302,6 @@ typedef struct { ...@@ -305,7 +302,6 @@ typedef struct {
char *threadPoolConfig; char *threadPoolConfig;
int phy_test; int phy_test;
int do_ra; int do_ra;
int sa;
uint8_t sl_mode; uint8_t sl_mode;
uint8_t usim_test; uint8_t usim_test;
int emulate_rf; int emulate_rf;
...@@ -333,6 +329,8 @@ typedef struct { ...@@ -333,6 +329,8 @@ typedef struct {
int threequarter_fs; int threequarter_fs;
} softmodem_params_t; } softmodem_params_t;
#define IS_SA_MODE(sM_params) (!(sM_params)->phy_test && !(sM_params)->do_ra && !(sM_params)->nsa)
uint64_t get_softmodem_optmask(void); uint64_t get_softmodem_optmask(void);
uint64_t set_softmodem_optmask(uint64_t bitmask); uint64_t set_softmodem_optmask(uint64_t bitmask);
uint64_t clear_softmodem_optmask(uint64_t bitmask); uint64_t clear_softmodem_optmask(uint64_t bitmask);
......
...@@ -283,7 +283,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -283,7 +283,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
init_timeshift_rotation(fp); init_timeshift_rotation(fp);
// initialize to false only for SA since in do-ra and phy-test it is already set to true before getting here // initialize to false only for SA since in do-ra and phy-test it is already set to true before getting here
if (get_softmodem_params()->sa) if (IS_SA_MODE(get_softmodem_params()))
ue->received_config_request = false; ue->received_config_request = false;
return 0; return 0;
......
...@@ -271,7 +271,7 @@ void nr_generate_pbch(PHY_VARS_gNB *gNB, ...@@ -271,7 +271,7 @@ void nr_generate_pbch(PHY_VARS_gNB *gNB,
pbch_a |= ((pbch_pdu[i >> 3] >> (7 - (i & 7))) & 1) << i; pbch_a |= ((pbch_pdu[i >> 3] >> (7 - (i & 7))) & 1) << i;
// NSA to signal no coreset0 // NSA to signal no coreset0
const int ssb_sc_offset = get_softmodem_params()->sa ? config->ssb_table.ssb_subcarrier_offset.value : 31; const int ssb_sc_offset = IS_SA_MODE(get_softmodem_params()) ? config->ssb_table.ssb_subcarrier_offset.value : 31;
#ifdef DEBUG_PBCH_ENCODING #ifdef DEBUG_PBCH_ENCODING
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
......
...@@ -95,7 +95,7 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_n ...@@ -95,7 +95,7 @@ void nr_common_signal_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_n
const int sc_offset = (fp->freq_range == FR1) ? pdu->SsbSubcarrierOffset >> scs : pdu->SsbSubcarrierOffset; const int sc_offset = (fp->freq_range == FR1) ? pdu->SsbSubcarrierOffset >> scs : pdu->SsbSubcarrierOffset;
fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset); fp->ssb_start_subcarrier = (12 * prb_offset + sc_offset);
if (fp->print_ue_help_cmdline_log && get_softmodem_params()->sa) { if (fp->print_ue_help_cmdline_log && IS_SA_MODE(get_softmodem_params())) {
fp->print_ue_help_cmdline_log = false; fp->print_ue_help_cmdline_log = false;
if (fp->dl_CarrierFreq != fp->ul_CarrierFreq) if (fp->dl_CarrierFreq != fp->ul_CarrierFreq)
LOG_A(PHY, LOG_A(PHY,
......
...@@ -153,7 +153,6 @@ int main(int argc, char **argv) ...@@ -153,7 +153,6 @@ int main(int argc, char **argv)
int ssb_scan_threads = 0; int ssb_scan_threads = 0;
channel_desc_t *gNB2UE; channel_desc_t *gNB2UE;
get_softmodem_params()->sa = 1;
get_softmodem_params()->usim_test = 1; get_softmodem_params()->usim_test = 1;
//uint8_t extended_prefix_flag=0; //uint8_t extended_prefix_flag=0;
......
...@@ -71,7 +71,8 @@ uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, const E ...@@ -71,7 +71,8 @@ uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, const E
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) { for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
{ {
if(get_softmodem_params()->sa){ if (IS_SA_MODE(get_softmodem_params())) {
// note: there is an implicit relationship between the data structure and the message name // note: there is an implicit relationship between the data structure and the message name
msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NGAP_REGISTER_GNB_REQ); //Message Temporarily reuse msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NGAP_REGISTER_GNB_REQ); //Message Temporarily reuse
......
...@@ -1003,7 +1003,7 @@ static NR_ServingCellConfigCommon_t *get_scc_config(configmodule_interface_t *cf ...@@ -1003,7 +1003,7 @@ static NR_ServingCellConfigCommon_t *get_scc_config(configmodule_interface_t *cf
*scc->ssbSubcarrierSpacing, *scc->ssbSubcarrierSpacing,
*frequencyInfoDL->absoluteFrequencySSB); *frequencyInfoDL->absoluteFrequencySSB);
LOG_I(RRC, "absoluteFrequencySSB %ld corresponds to %lu Hz\n", *frequencyInfoDL->absoluteFrequencySSB, ssb_freq); LOG_I(RRC, "absoluteFrequencySSB %ld corresponds to %lu Hz\n", *frequencyInfoDL->absoluteFrequencySSB, ssb_freq);
if (get_softmodem_params()->sa) if (IS_SA_MODE(get_softmodem_params()))
check_ssb_raster(ssb_freq, *frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); check_ssb_raster(ssb_freq, *frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
fix_scc(scc, ssb_bitmap); fix_scc(scc, ssb_bitmap);
} }
...@@ -1226,7 +1226,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, ...@@ -1226,7 +1226,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
req->cell[0].info.measurement_timing_config = mtc_buf; req->cell[0].info.measurement_timing_config = mtc_buf;
req->cell[0].info.measurement_timing_config_len = len; req->cell[0].info.measurement_timing_config_len = len;
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
// in NSA we don't transmit SIB1, so cannot fill DU system information // in NSA we don't transmit SIB1, so cannot fill DU system information
// so cannot send MIB either // so cannot send MIB either
...@@ -1503,7 +1503,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) ...@@ -1503,7 +1503,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
f1ap_served_cell_info_t info; f1ap_served_cell_info_t info;
read_du_cell_info(cfg, NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1); read_du_cell_info(cfg, NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1);
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac);
if (scc->ext2 && scc->ext2->ntn_Config_r17) if (scc->ext2 && scc->ext2->ntn_Config_r17)
nr_mac_configure_sib19(RC.nrmac[0]); nr_mac_configure_sib19(RC.nrmac[0]);
...@@ -1826,7 +1826,7 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc) ...@@ -1826,7 +1826,7 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc)
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL); config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
if (GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr == NULL) { if (GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID // Calculate a default gNB ID
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
uint32_t hash; uint32_t hash;
hash = ngap_generate_gNB_id (); hash = ngap_generate_gNB_id ();
gnb_id = i + (hash & 0xFFFFFF8); gnb_id = i + (hash & 0xFFFFFF8);
...@@ -1978,7 +1978,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -1978,7 +1978,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < GNBParamList.numelt; k++) { for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) { if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default gNB ID // Calculate a default gNB ID
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
uint32_t hash; uint32_t hash;
hash = ngap_generate_gNB_id (); hash = ngap_generate_gNB_id ();
...@@ -2119,7 +2119,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -2119,7 +2119,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
// SCTP SETTING // SCTP SETTING
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG); sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix); config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr); NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
...@@ -2208,7 +2208,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2208,7 +2208,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
for (k = 0; k < GNBParamList.numelt; k++) { for (k = 0; k < GNBParamList.numelt; k++) {
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) { if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
// Calculate a default eNB ID // Calculate a default eNB ID
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
uint32_t hash; uint32_t hash;
hash = ngap_generate_gNB_id (); hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFFFF8); gnb_id = k + (hash & 0xFFFFFF8);
...@@ -2343,7 +2343,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { ...@@ -2343,7 +2343,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG); sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix); config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr); X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
......
...@@ -160,7 +160,7 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int nb_inst) ...@@ -160,7 +160,7 @@ NR_UE_MAC_INST_t *nr_l2_init_ue(int nb_inst)
mac->ue_id = j; mac->ue_id = j;
nr_ue_init_mac(mac); nr_ue_init_mac(mac);
nr_ue_mac_default_configs(mac); nr_ue_mac_default_configs(mac);
if (get_softmodem_params()->sa) if (IS_SA_MODE(get_softmodem_params()))
ue_init_config_request(mac, get_softmodem_params()->numerology); ue_init_config_request(mac, get_softmodem_params()->numerology);
} }
......
...@@ -783,7 +783,7 @@ void nr_ue_get_rach(NR_UE_MAC_INST_t *mac, int CC_id, frame_t frame, uint8_t gNB ...@@ -783,7 +783,7 @@ void nr_ue_get_rach(NR_UE_MAC_INST_t *mac, int CC_id, frame_t frame, uint8_t gNB
ra->Msg3_size = size_sdu + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT); ra->Msg3_size = size_sdu + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
} }
} else if (!get_softmodem_params()->sa) { } else if (!IS_SA_MODE(get_softmodem_params())) {
uint8_t temp_pdu[16] = {0}; uint8_t temp_pdu[16] = {0};
size_sdu = nr_write_ce_ulsch_pdu(temp_pdu, mac, 0, &(mac->crnti), NULL, NULL, NULL); size_sdu = nr_write_ce_ulsch_pdu(temp_pdu, mac, 0, &(mac->crnti), NULL, NULL, NULL);
ra->Msg3_size = size_sdu; ra->Msg3_size = size_sdu;
......
...@@ -3810,7 +3810,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce, ...@@ -3810,7 +3810,7 @@ int nr_write_ce_ulsch_pdu(uint8_t *mac_ce,
pdu, mac_ce); pdu, mac_ce);
} }
if (crnti && (!get_softmodem_params()->sa && get_softmodem_params()->do_ra && mac->ra.ra_state != nrRA_SUCCEEDED)) { if (crnti && (!IS_SA_MODE(get_softmodem_params()) && get_softmodem_params()->do_ra && mac->ra.ra_state != nrRA_SUCCEEDED)) {
LOG_D(NR_MAC, "In %s: generating C-RNTI MAC CE with C-RNTI %x\n", __FUNCTION__, (*crnti)); LOG_D(NR_MAC, "In %s: generating C-RNTI MAC CE with C-RNTI %x\n", __FUNCTION__, (*crnti));
// MAC CE fixed subheader // MAC CE fixed subheader
......
...@@ -437,7 +437,7 @@ static void config_common(gNB_MAC_INST *nrmac, ...@@ -437,7 +437,7 @@ static void config_common(gNB_MAC_INST *nrmac,
+ (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, + (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value,
frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing)
* i); * i);
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
prach_fd_occasion->k1.value = prach_fd_occasion->k1.value =
NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE)
+ rach_ConfigCommon->rach_ConfigGeneric.msg1_FrequencyStart + rach_ConfigCommon->rach_ConfigGeneric.msg1_FrequencyStart
...@@ -751,7 +751,7 @@ void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_C ...@@ -751,7 +751,7 @@ void nr_fill_sched_osi(gNB_MAC_INST *nrmac, const struct NR_SetupRelease_PDCCH_C
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac) void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac)
{ {
AssertFatal(get_softmodem_params()->sa > 0, "error: SIB1 only applicable for SA\n"); AssertFatal(IS_SA_MODE(get_softmodem_params()), "error: SIB1 only applicable for SA\n");
NR_COMMON_channels_t *cc = &nrmac->common_channels[0]; NR_COMMON_channels_t *cc = &nrmac->common_channels[0];
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
...@@ -763,7 +763,7 @@ void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_ ...@@ -763,7 +763,7 @@ void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_
void nr_mac_configure_sib19(gNB_MAC_INST *nrmac) void nr_mac_configure_sib19(gNB_MAC_INST *nrmac)
{ {
AssertFatal(get_softmodem_params()->sa > 0, "error: SIB19 only applicable for SA\n"); AssertFatal(IS_SA_MODE(get_softmodem_params()), "error: SIB19 only applicable for SA\n");
NR_COMMON_channels_t *cc = &nrmac->common_channels[0]; NR_COMMON_channels_t *cc = &nrmac->common_channels[0];
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_BCCH_DL_SCH_Message_t *sib19 = get_SIB19_NR(scc); NR_BCCH_DL_SCH_Message_t *sib19 = get_SIB19_NR(scc);
......
...@@ -221,7 +221,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_ ...@@ -221,7 +221,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_
// This schedules SIB1 // This schedules SIB1
// SIB19 will be scheduled if ntn_Config_r17 is initialized // SIB19 will be scheduled if ntn_Config_r17 is initialized
if (get_softmodem_params()->sa == 1) { if (IS_SA_MODE(get_softmodem_params())) {
schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req); schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
if (cc->sib19) if (cc->sib19)
schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req, cc->sib19_bcch_length, cc->sib19_bcch_pdu); schedule_nr_sib19(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req, cc->sib19_bcch_length, cc->sib19_bcch_pdu);
......
...@@ -2291,7 +2291,7 @@ void nr_clear_ra_proc(NR_RA_t *ra) ...@@ -2291,7 +2291,7 @@ void nr_clear_ra_proc(NR_RA_t *ra)
NR_SCHED_ENSURE_LOCKED(&RC.nrmac[0]->sched_lock); NR_SCHED_ENSURE_LOCKED(&RC.nrmac[0]->sched_lock);
memset(ra, 0, sizeof(*ra)); memset(ra, 0, sizeof(*ra));
ra->ra_state = nrRA_gNB_IDLE; ra->ra_state = nrRA_gNB_IDLE;
if (get_softmodem_params()->sa) { // in SA, prefill with allowed preambles if (IS_SA_MODE(get_softmodem_params())) { // in SA, prefill with allowed preambles
ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES; ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
ra->preambles.preamble_list[i] = i; ra->preambles.preamble_list[i] = i;
......
...@@ -187,7 +187,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -187,7 +187,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
const int prb_offset = offset_pointa >> scs; const int prb_offset = offset_pointa >> scs;
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu); schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu);
fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset, ssb_start_symbol, CC_id, beam.idx); fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset, ssb_start_symbol, CC_id, beam.idx);
if (get_softmodem_params()->sa == 1) { if (IS_SA_MODE(get_softmodem_params())) {
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb], get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
frameP, frameP,
mib, mib,
...@@ -219,7 +219,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -219,7 +219,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
const int prb_offset = offset_pointa >> scs; const int prb_offset = offset_pointa >> scs;
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu); schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu);
fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset, ssb_start_symbol, CC_id, beam.idx); fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset, ssb_start_symbol, CC_id, beam.idx);
if (get_softmodem_params()->sa == 1) { if (IS_SA_MODE(get_softmodem_params())) {
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb], get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
frameP, frameP,
mib, mib,
...@@ -251,7 +251,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, ...@@ -251,7 +251,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
const int prb_offset = offset_pointa >> (scs-2); // reference 60kHz const int prb_offset = offset_pointa >> (scs-2); // reference 60kHz
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu); schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, beam_index, ssbSubcarrierOffset, offset_pointa, mib_pdu);
fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset >> (scs - 2), ssb_start_symbol, CC_id, beam.idx); fill_ssb_vrb_map(cc, prb_offset, ssbSubcarrierOffset >> (scs - 2), ssb_start_symbol, CC_id, beam.idx);
if (get_softmodem_params()->sa == 1) { if (IS_SA_MODE(get_softmodem_params())) {
get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb], get_type0_PDCCH_CSS_config_parameters(&gNB->type0_PDCCH_CSS_config[i_ssb],
frameP, frameP,
mib, mib,
......
...@@ -3004,7 +3004,7 @@ static void nr_mac_apply_cellgroup(gNB_MAC_INST *mac, NR_UE_info_t *UE, frame_t ...@@ -3004,7 +3004,7 @@ static void nr_mac_apply_cellgroup(gNB_MAC_INST *mac, NR_UE_info_t *UE, frame_t
reset_srs_stats(UE); reset_srs_stats(UE);
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
// add all available DL,UL HARQ processes for this UE in SA // add all available DL,UL HARQ processes for this UE in SA
create_dl_harq_list(sched_ctrl, &UE->sc_info); create_dl_harq_list(sched_ctrl, &UE->sc_info);
create_ul_harq_list(sched_ctrl, &UE->sc_info); create_ul_harq_list(sched_ctrl, &UE->sc_info);
......
...@@ -343,7 +343,7 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu ...@@ -343,7 +343,7 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu
(received_pdu->RNTI != mac->ra.ra_rnti || mac->ra.RA_RAPID_found)) (received_pdu->RNTI != mac->ra.ra_rnti || mac->ra.RA_RAPID_found))
return false; return false;
} }
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
if (mac->state == UE_NOT_SYNC) if (mac->state == UE_NOT_SYNC)
return false; return false;
if (received_pdu->RNTI == 0xFFFF) if (received_pdu->RNTI == 0xFFFF)
......
...@@ -1835,7 +1835,7 @@ NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc) ...@@ -1835,7 +1835,7 @@ NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc)
AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n"); AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n");
int ssb_subcarrier_offset = 31; // default value for NSA int ssb_subcarrier_offset = 31; // default value for NSA
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
ssb_subcarrier_offset = get_ssb_subcarrier_offset(*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB, ssb_subcarrier_offset = get_ssb_subcarrier_offset(*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB,
scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA, scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA,
*scc->ssbSubcarrierSpacing); *scc->ssbSubcarrierSpacing);
......
...@@ -340,7 +340,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id) ...@@ -340,7 +340,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
NR_MIB_t *mib = NULL; NR_MIB_t *mib = NULL;
NR_SIB1_t *sib1 = NULL; NR_SIB1_t *sib1 = NULL;
if (sys_info != NULL && sys_info->mib != NULL && !(sys_info->sib1 == NULL && get_softmodem_params()->sa)) { if (sys_info != NULL && sys_info->mib != NULL && !(sys_info->sib1 == NULL && IS_SA_MODE(get_softmodem_params()))) {
if (!extract_sys_info(sys_info, &mib, &sib1)) { if (!extract_sys_info(sys_info, &mib, &sib1)) {
LOG_W(RRC, "rejecting DU ID %ld\n", req->gNB_DU_id); LOG_W(RRC, "rejecting DU ID %ld\n", req->gNB_DU_id);
fail.cause = F1AP_CauseProtocol_semantic_error; fail.cause = F1AP_CauseProtocol_semantic_error;
...@@ -491,7 +491,7 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update ...@@ -491,7 +491,7 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update
const f1ap_gnb_du_system_info_t *sys_info = conf_up->cell_to_modify[0].sys_info; const f1ap_gnb_du_system_info_t *sys_info = conf_up->cell_to_modify[0].sys_info;
if (sys_info != NULL && sys_info->mib != NULL && !(sys_info->sib1 == NULL && get_softmodem_params()->sa)) { if (sys_info != NULL && sys_info->mib != NULL && !(sys_info->sib1 == NULL && IS_SA_MODE(get_softmodem_params()))) {
// MIB is mandatory, so will be overwritten. SIB1 is optional, so will // MIB is mandatory, so will be overwritten. SIB1 is optional, so will
// only be overwritten if present in sys_info // only be overwritten if present in sys_info
ASN_STRUCT_FREE(asn_DEF_NR_MIB, du->mib); ASN_STRUCT_FREE(asn_DEF_NR_MIB, du->mib);
......
...@@ -96,7 +96,7 @@ NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfig, cons ...@@ -96,7 +96,7 @@ NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfig, cons
(enc_rval.encoded+7)>>3); (enc_rval.encoded+7)>>3);
FILE *fd; // file to be generated for nr-ue FILE *fd; // file to be generated for nr-ue
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra > 0 || get_softmodem_params()->sa == 1) { if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra > 0) {
// This is for phytest only, emulate first X2 message if uecap.raw file is present // This is for phytest only, emulate first X2 message if uecap.raw file is present
LOG_I(RRC,"Dumping NR_RRCReconfiguration message (%jd bytes)\n",(enc_rval.encoded+7)>>3); LOG_I(RRC,"Dumping NR_RRCReconfiguration message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
for (int i=0; i<(enc_rval.encoded+7)>>3; i++) { for (int i=0; i<(enc_rval.encoded+7)>>3; i++) {
...@@ -121,7 +121,7 @@ NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfig, cons ...@@ -121,7 +121,7 @@ NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfig, cons
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra > 0 || get_softmodem_params()->sa == 1) { if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra > 0) {
LOG_I(RRC,"Dumping scg_RB_Config message (%jd bytes)\n",(enc_rval.encoded+7)>>3); LOG_I(RRC,"Dumping scg_RB_Config message (%jd bytes)\n",(enc_rval.encoded+7)>>3);
for (int i=0; i<(enc_rval.encoded+7)>>3; i++) { for (int i=0; i<(enc_rval.encoded+7)>>3; i++) {
......
...@@ -116,7 +116,7 @@ RB_PROTOTYPE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries, ...@@ -116,7 +116,7 @@ RB_PROTOTYPE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries,
void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m) void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m)
{ {
AssertFatal(!get_softmodem_params()->sa, "%s() cannot be called in SA mode, it is intrinsically for NSA\n", __func__); AssertFatal(!IS_SA_MODE(get_softmodem_params()), "%s() cannot be called in SA mode, it is intrinsically for NSA\n", __func__);
// generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331) // generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331)
const nr_mac_config_t *configuration = &RC.nrmac[0]->radio_config; const nr_mac_config_t *configuration = &RC.nrmac[0]->radio_config;
MessageDef *msg; MessageDef *msg;
...@@ -153,7 +153,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a ...@@ -153,7 +153,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
} }
// NR RRCReconfiguration // NR RRCReconfiguration
if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1 || get_softmodem_params()->sa == 1){ if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) {
UE->rb_config = get_default_rbconfig(10 /* EPS bearer ID */, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master); UE->rb_config = get_default_rbconfig(10 /* EPS bearer ID */, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master);
} else { } else {
/* TODO: handle more than one bearer */ /* TODO: handle more than one bearer */
......
...@@ -223,7 +223,7 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc, ...@@ -223,7 +223,7 @@ static void nr_rrc_ue_process_rrcReconfiguration(NR_UE_RRC_INST_t *rrc,
nr_rrc_cellgroup_configuration(rrc, cellGroupConfig); nr_rrc_cellgroup_configuration(rrc, cellGroupConfig);
AssertFatal(!get_softmodem_params()->sa, "secondaryCellGroup only used in NSA for now\n"); AssertFatal(!IS_SA_MODE(get_softmodem_params()), "secondaryCellGroup only used in NSA for now\n");
nr_rrc_mac_config_req_cg(rrc->ue_id, 0, cellGroupConfig, rrc->UECap.UE_NR_Capability); nr_rrc_mac_config_req_cg(rrc->ue_id, 0, cellGroupConfig, rrc->UECap.UE_NR_Capability);
asn1cFreeStruc(asn_DEF_NR_CellGroupConfig, cellGroupConfig); asn1cFreeStruc(asn_DEF_NR_CellGroupConfig, cellGroupConfig);
} }
...@@ -551,7 +551,7 @@ static void nr_rrc_ue_decode_NR_BCCH_BCH_Message(NR_UE_RRC_INST_t *rrc, ...@@ -551,7 +551,7 @@ static void nr_rrc_ue_decode_NR_BCCH_BCH_Message(NR_UE_RRC_INST_t *rrc,
} }
int get_sib = 0; int get_sib = 0;
if (get_softmodem_params()->sa && bcch_message->message.present == NR_BCCH_BCH_MessageType_PR_mib if (IS_SA_MODE(get_softmodem_params()) && bcch_message->message.present == NR_BCCH_BCH_MessageType_PR_mib
&& bcch_message->message.choice.mib->cellBarred == NR_MIB__cellBarred_notBarred && rrc->nrRrcState != RRC_STATE_DETACH_NR) { && bcch_message->message.choice.mib->cellBarred == NR_MIB__cellBarred_notBarred && rrc->nrRrcState != RRC_STATE_DETACH_NR) {
NR_UE_RRC_SI_INFO *SI_info = &rrc->perNB[gNB_index].SInfo; NR_UE_RRC_SI_INFO *SI_info = &rrc->perNB[gNB_index].SInfo;
// to schedule MAC to get SI if required // to schedule MAC to get SI if required
...@@ -994,7 +994,7 @@ static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const ...@@ -994,7 +994,7 @@ static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const
const char *nas_msg; const char *nas_msg;
int nas_msg_length; int nas_msg_length;
if (get_softmodem_params()->sa) { if (IS_SA_MODE(get_softmodem_params())) {
as_nas_info_t initialNasMsg; as_nas_info_t initialNasMsg;
nr_ue_nas_t *nas = get_ue_nas_info(rrc->ue_id); nr_ue_nas_t *nas = get_ue_nas_info(rrc->ue_id);
generateRegistrationRequest(&initialNasMsg, nas); generateRegistrationRequest(&initialNasMsg, nas);
......
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