1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
20 * @file This file consist of FAPI internal functions.
24 #ifndef NR5G_FAPI_CONFIG_LOADER_H_
25 #define NR5G_FAPI_CONFIG_LOADER_H_
27 #include "nr5g_fapi_std.h"
28 #include "nr5g_fapi_common_types.h"
29 #include "nr5g_fapi_dpdk.h"
30 #include "nr5g_fapi_log.h"
32 #define NR5G_FAPI_DEVICE_NAME_LEN 512
35 DPDK_IOVA_PA_MODE = 0,
40 typedef struct _nr5g_fapi_thread_info {
41 pthread_t thread_id; /* ID returned by pthread_create() */
42 pthread_attr_t thread_attr;
43 } nr5g_fapi_thread_info_t;
45 typedef struct _nr5g_fapi_config_worker_cfg {
47 uint8_t thread_priority;
48 uint8_t thread_sched_policy;
49 } nr5g_fapi_config_worker_cfg_t;
51 typedef struct _nr5g_fapi_config_wls_cfg {
52 char device_name[NR5G_FAPI_DEVICE_NAME_LEN];
54 } nr5g_fapi_config_wls_cfg_t;
56 typedef struct nr5g_fapi_config_dpdk_cfg_t {
57 uint8_t iova_mode; /*0 - PA mode, 1 - VA mode */
58 } nr5g_fapi_config_dpdk_cft_t;
60 typedef struct _nr5g_fapi_config_log_cfg {
61 nr5g_fapi_log_types_t level;
62 } nr5g_fapi_config_log_cfg_t;
64 typedef struct _nr5g_fapi_cfg {
66 nr5g_fapi_config_worker_cfg_t mac2phy_worker;
67 nr5g_fapi_config_worker_cfg_t phy2mac_worker;
68 nr5g_fapi_config_worker_cfg_t urllc_worker;
69 nr5g_fapi_config_wls_cfg_t wls;
70 nr5g_fapi_config_log_cfg_t logger;
71 nr5g_fapi_thread_info_t mac2phy_thread_info;
72 nr5g_fapi_thread_info_t phy2mac_thread_info;
73 nr5g_fapi_config_dpdk_cft_t dpdk;
77 p_nr5g_fapi_cfg_t nr5g_fapi_config_loader(
79 const char *cfg_fname);
81 #endif // NR5G_FAPI_CONFIG_LOADER_H_