X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fapi_5g%2Fsource%2Fnr5g_fapi.c;fp=fapi_5g%2Fsource%2Fnr5g_fapi.c;h=bfcb606c92fb707d6a18d7c08c8b1c2d66d2435a;hp=0000000000000000000000000000000000000000;hb=9d66fca5c45c8b3e0d6eab6d51a90c8e9d2614dc;hpb=2fbf70096f64af622da983e88c5a64e90ad9bdbd diff --git a/fapi_5g/source/nr5g_fapi.c b/fapi_5g/source/nr5g_fapi.c new file mode 100644 index 0000000..bfcb606 --- /dev/null +++ b/fapi_5g/source/nr5g_fapi.c @@ -0,0 +1,59 @@ +/****************************************************************************** +* +* Copyright (c) 2019 Intel. +* +* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +* +* 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. +* +*******************************************************************************/ +#include + +#include "nr5g_fapi_std.h" +#include "nr5g_fapi_common_types.h" +#include "nr5g_fapi_args.h" +#include "nr5g_fapi_config_loader.h" +#include "nr5g_fapi_dpdk.h" +#include "nr5g_fapi_framework.h" +#include "nr5g_fapi_cmd.h" + +int main( + int argc, + char **argv) +{ + const char *config_file = NULL; + p_nr5g_fapi_cfg_t config = NULL; + + if (NULL == (config_file = nr5g_fapi_parse_args(argc, argv))) { + NR5G_FAPI_LOG(ERROR_LOG, ("Config file parsing error")); + exit(1); + } + + if (NULL == (config = nr5g_fapi_config_loader(argv[0], config_file))) { + NR5G_FAPI_LOG(ERROR_LOG, ("Config file loading error")); + exit(1); + } + + nr5g_fapi_dpdk_init(config); + + if (FAILURE == nr5g_fapi_framework_init(config)) { + NR5G_FAPI_LOG(ERROR_LOG, ("ORAN_5G_FAPI init failed")); + exit(1); + } + NR5G_FAPI_LOG(INFO_LOG, ("ORAN_5G_FAPI init successful")); + + nr5g_fapi_cmgr((void *)config); + nr5g_fapi_dpdk_wait(config); + pthread_attr_destroy(&config->phy2mac_thread_info.thread_attr); + pthread_attr_destroy(&config->mac2phy_thread_info.thread_attr); + free(config); + return 0; +}