Commit 079157eb authored by wujing's avatar wujing

cherry-pick 3efc7538

parent 6ca57535
...@@ -1783,7 +1783,7 @@ void init_RU_proc(RU_t *ru) { ...@@ -1783,7 +1783,7 @@ void init_RU_proc(RU_t *ru) {
pthread_cond_init( &proc->cond_asynch_rxtx, NULL); pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
pthread_cond_init( &proc->cond_synch,NULL); pthread_cond_init( &proc->cond_synch,NULL);
pthread_cond_init( &proc->cond_gNBs, NULL); pthread_cond_init( &proc->cond_gNBs, NULL);
//threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT_MAX ); threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT_MAX );
if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
threadCreate( &proc->pthread_FH1, ru_thread_tx, (void *)ru, "thread_FH1", -1, OAI_PRIORITY_RT ); threadCreate( &proc->pthread_FH1, ru_thread_tx, (void *)ru, "thread_FH1", -1, OAI_PRIORITY_RT );
......
...@@ -401,7 +401,7 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -401,7 +401,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
} }
} }
if (EPC_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) { if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (gnb_nb > 0) { if (gnb_nb > 0) {
/* /*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
...@@ -824,7 +824,7 @@ int main( int argc, char **argv ) ...@@ -824,7 +824,7 @@ int main( int argc, char **argv )
} }
openair0_cfg[0].threequarter_fs = threequarter_fs; openair0_cfg[0].threequarter_fs = threequarter_fs;
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test; AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
if (get_softmodem_params()->do_ra) if (get_softmodem_params()->do_ra)
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n"); AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
......
...@@ -235,8 +235,8 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL ...@@ -235,8 +235,8 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL
void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap);
void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scc(NR_ServingCellConfigCommon_t *scc);
s1ap_eNB_config_t s1ap_config; ngap_gNB_config_t ngap_config;
uint32_t s1ap_generate_eNB_id(void) {return 0;} uint32_t ngap_generate_gNB_id(void) {return 0;}
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;} void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;}
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;} void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;}
......
...@@ -173,7 +173,7 @@ void *gNB_app_task(void *args_p) ...@@ -173,7 +173,7 @@ void *gNB_app_task(void *args_p)
__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);
} }
if (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
/* 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);//, gnb_properties_p); __attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
......
...@@ -342,7 +342,7 @@ void RCconfig_nr_flexran() ...@@ -342,7 +342,7 @@ void RCconfig_nr_flexran()
/* gNB ID from configuration, as read in by RCconfig_RRC() */ /* gNB ID from configuration, as read in by RCconfig_RRC() */
if (!GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr) { if (!GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr) {
// Calculate a default gNB ID // Calculate a default gNB ID
if (EPC_MODE_ENABLED) if (AMF_MODE_ENABLED)
gnb_id = i + (ngap_generate_gNB_id () & 0xFFFFFF8); gnb_id = i + (ngap_generate_gNB_id () & 0xFFFFFF8);
else else
gnb_id = i; gnb_id = i;
...@@ -542,7 +542,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -542,7 +542,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
AssertFatal (i<num_gnbs,"Failed to parse config file no %ith element in %s \n",i, GNB_CONFIG_STRING_ACTIVE_GNBS); AssertFatal (i<num_gnbs,"Failed to parse config file no %ith element in %s \n",i, GNB_CONFIG_STRING_ACTIVE_GNBS);
/* /*
if (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0; asn_debug = 0;
asn1_xer_print = 0; asn1_xer_print = 0;
...@@ -568,7 +568,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -568,7 +568,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
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 (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
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);
...@@ -753,7 +753,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -753,7 +753,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL);
/* /*
if (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0; asn_debug = 0;
asn1_xer_print = 0; asn1_xer_print = 0;
...@@ -784,7 +784,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -784,7 +784,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 (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
uint32_t hash; uint32_t hash;
hash = ngap_generate_gNB_id (); hash = ngap_generate_gNB_id ();
...@@ -938,7 +938,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -938,7 +938,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 (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
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( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix); config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),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);
...@@ -1057,7 +1057,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { ...@@ -1057,7 +1057,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 (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
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);
...@@ -1178,7 +1178,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { ...@@ -1178,7 +1178,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 (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
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( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix); config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),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);
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include "oaisim_amf_test_s1c.h" #include "oaisim_amf_test_s1c.h"
#endif #endif
ngap_gNB_config_t ngap_config;
static int ngap_gNB_generate_ng_setup_request( static int ngap_gNB_generate_ng_setup_request(
ngap_gNB_instance_t *instance_p, ngap_gNB_amf_data_t *ngap_amf_data_p); ngap_gNB_instance_t *instance_p, ngap_gNB_amf_data_t *ngap_amf_data_p);
......
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
#ifndef NGAP_GNB_H_ #ifndef NGAP_GNB_H_
#define NGAP_GNB_H_ #define NGAP_GNB_H_
typedef struct ngap_gNB_config_s {
// MME related params
unsigned char amf_enabled; ///< AMF enabled ?
} ngap_gNB_config_t;
extern ngap_gNB_config_t ngap_config;
#define AMF_MODE_ENABLED ngap_config.amf_enabled
void *ngap_gNB_process_itti_msg(void*); void *ngap_gNB_process_itti_msg(void*);
void ngap_gNB_init(void); void ngap_gNB_init(void);
void *ngap_gNB_task(void *arg); void *ngap_gNB_task(void *arg);
......
This diff is collapsed.
This diff is collapsed.
...@@ -49,38 +49,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id, ...@@ -49,38 +49,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) NGAP_NGAP_PDU_t *pdu)
{ {
#if 0 //TODO
ngap_gNB_amf_data_t *amf_desc_p;
NGAP_OverloadStart_t *container;
NGAP_OverloadStartIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.OverloadStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_OverloadStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_OverloadResponse, true);
if (ie != NULL) {
DevCheck(ie->value.choice.OverloadResponse.present ==
NGAP_OverloadResponse_PR_overloadAction,
NGAP_OverloadResponse_PR_overloadAction, 0, 0);
}
/* Non UE-associated signalling -> stream 0 */
DevCheck(stream == 0, stream, 0, 0);
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
/* No AMF context associated */
return -1;
}
/* Mark the AMF as overloaded and set the overload state according to
* the value received.
*/
amf_desc_p->state = NGAP_GNB_OVERLOAD;
amf_desc_p->overload_state =
ie->value.choice.OverloadResponse.choice.overloadAction;
#endif
return 0; return 0;
} }
......
...@@ -50,38 +50,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id, ...@@ -50,38 +50,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) NGAP_NGAP_PDU_t *pdu)
{ {
#if 0 //TODO
NGAP_TraceStart_t *container;
NGAP_TraceStartIEs_t *ie;
struct ngap_gNB_ue_context_s *ue_desc_p = NULL;
struct ngap_gNB_amf_data_s *amf_ref_p;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.TraceStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_TraceStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID, TRUE);
amf_ref_p = ngap_gNB_get_AMF(NULL, assoc_id, 0);
DevAssert(amf_ref_p != NULL);
if (ie != NULL) {
ue_desc_p = ngap_gNB_get_ue_context(amf_ref_p->ngap_gNB_instance,
ie->value.choice.GNB_UE_NGAP_ID);
}
if (ue_desc_p == NULL) {
/* Could not find context associated with this gNB_ue_ngap_id -> generate
* trace failure indication.
*/
NGAP_E_UTRAN_Trace_ID_t trace_id;
NGAP_Cause_t cause;
memset(&trace_id, 0, sizeof(NGAP_E_UTRAN_Trace_ID_t));
memset(&cause, 0, sizeof(NGAP_Cause_t));
cause.present = NGAP_Cause_PR_radioNetwork;
cause.choice.radioNetwork = NGAP_CauseRadioNetwork_unknown_pair_ue_ngap_id;
ngap_gNB_generate_trace_failure(NULL, &trace_id, &cause);
}
#endif
return 0; return 0;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
# ifdef OPENAIR2 # ifdef OPENAIR2
#include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
#include "s1ap_eNB.h" #include "ngap_gNB.h"
#include "nas_ue_task.h" #include "nas_ue_task.h"
#include "udp_eNB_task.h" #include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h" #include "gtpv1u_eNB_task.h"
...@@ -59,7 +59,7 @@ int create_gNB_tasks(uint32_t gnb_nb) ...@@ -59,7 +59,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
} }
if (EPC_MODE_ENABLED) { if (AMF_MODE_ENABLED) {
if (gnb_nb > 0) { if (gnb_nb > 0) {
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { /*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n"); LOG_E(SCTP, "Create task for SCTP failed\n");
......
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