Commit 70dd524e authored by Guido Casati's avatar Guido Casati Committed by Bartosz Podrygajlo

Define softmodem bits in a separate header for either C and C++

parent d8bba312
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef SOFTMODEM_BITS_H
#define SOFTMODEM_BITS_H
// clang-format off
#define BIT_0 (1 << 0)
#define BIT_1 (1 << 1)
#define BIT_2 (1 << 2)
#define BIT_10 (1 << 10)
#define BIT_12 (1 << 12)
#define BIT_13 (1 << 13)
#define BIT_15 (1 << 15)
#define BIT_16 (1 << 16)
#define BIT_17 (1 << 17)
#define BIT_18 (1 << 18)
#define BIT_20 (1 << 20)
#define BIT_21 (1 << 21)
#define BIT_22 (1 << 22)
#define BIT_23 (1 << 23)
#define BIT_24 (1 << 24)
#define BIT_25 (1 << 25)
#define SOFTMODEM_NOS1_BIT BIT_0
#define SOFTMODEM_NOKRNMOD_BIT BIT_1
#define SOFTMODEM_NONBIOT_BIT BIT_2
#define SOFTMODEM_RFSIM_BIT BIT_10
#define SOFTMODEM_SIML1_BIT BIT_12
#define SOFTMODEM_DLSIM_BIT BIT_13
#define SOFTMODEM_DOSCOPE_BIT BIT_15
#define SOFTMODEM_RECPLAY_BIT BIT_16
#define SOFTMODEM_TELNETCLT_BIT BIT_17
#define SOFTMODEM_RECRECORD_BIT BIT_18
#define SOFTMODEM_ENB_BIT BIT_20
#define SOFTMODEM_GNB_BIT BIT_21
#define SOFTMODEM_4GUE_BIT BIT_22
#define SOFTMODEM_5GUE_BIT BIT_23
#define SOFTMODEM_NOSTATS_BIT BIT_24
#define SOFTMODEM_IMSCOPE_BIT BIT_25
// clang-format on
#endif // SOFTMODEM_BITS_H
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#ifndef SOFTMODEM_COMMON_H #ifndef SOFTMODEM_COMMON_H
#define SOFTMODEM_COMMON_H #define SOFTMODEM_COMMON_H
#include "openair1/PHY/defs_common.h" #include "openair1/PHY/defs_common.h"
#include "softmodem-bits.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
...@@ -277,22 +278,6 @@ extern int usrp_tx_thread; ...@@ -277,22 +278,6 @@ extern int usrp_tx_thread;
/***************************************************************************************************************************************/ /***************************************************************************************************************************************/
#define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NONBIOT_BIT (1<<2)
#define SOFTMODEM_RFSIM_BIT (1<<10)
#define SOFTMODEM_SIML1_BIT (1<<12)
#define SOFTMODEM_DLSIM_BIT (1<<13)
#define SOFTMODEM_DOSCOPE_BIT (1<<15)
#define SOFTMODEM_RECPLAY_BIT (1<<16)
#define SOFTMODEM_TELNETCLT_BIT (1<<17)
#define SOFTMODEM_RECRECORD_BIT (1<<18)
#define SOFTMODEM_ENB_BIT (1<<20)
#define SOFTMODEM_GNB_BIT (1<<21)
#define SOFTMODEM_4GUE_BIT (1<<22)
#define SOFTMODEM_5GUE_BIT (1<<23)
#define SOFTMODEM_NOSTATS_BIT (1<<24)
#define SOFTMODEM_IMSCOPE_BIT (1<<25)
#define SOFTMODEM_FUNC_BITS (SOFTMODEM_ENB_BIT | SOFTMODEM_GNB_BIT | SOFTMODEM_5GUE_BIT | SOFTMODEM_4GUE_BIT) #define SOFTMODEM_FUNC_BITS (SOFTMODEM_ENB_BIT | SOFTMODEM_GNB_BIT | SOFTMODEM_5GUE_BIT | SOFTMODEM_4GUE_BIT)
#define MAPPING_SOFTMODEM_FUNCTIONS {{"enb",SOFTMODEM_ENB_BIT},{"gnb",SOFTMODEM_GNB_BIT},{"4Gue",SOFTMODEM_4GUE_BIT},{"5Gue",SOFTMODEM_5GUE_BIT}} #define MAPPING_SOFTMODEM_FUNCTIONS {{"enb",SOFTMODEM_ENB_BIT},{"gnb",SOFTMODEM_GNB_BIT},{"4Gue",SOFTMODEM_4GUE_BIT},{"5Gue",SOFTMODEM_5GUE_BIT}}
......
...@@ -42,6 +42,7 @@ uint64_t get_softmodem_optmask(void); ...@@ -42,6 +42,7 @@ uint64_t get_softmodem_optmask(void);
#include <sstream> #include <sstream>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include "executables/softmodem-bits.h"
#define MAX_OFFSETS 14 #define MAX_OFFSETS 14
#define NR_MAX_RB 273 #define NR_MAX_RB 273
...@@ -617,7 +618,6 @@ void *imscope_thread(void *data_void_ptr) ...@@ -617,7 +618,6 @@ void *imscope_thread(void *data_void_ptr)
static double last_frame_time = glfwGetTime(); static double last_frame_time = glfwGetTime();
static int target_fps = 24; static int target_fps = 24;
const int SOFTMODEM_5GUE_BIT = 1 << 23;
bool is_ue = (get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) > 0; bool is_ue = (get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) > 0;
while (!glfwWindowShouldClose(window)) { while (!glfwWindowShouldClose(window)) {
// Poll and handle events (inputs, window resize, etc.) // Poll and handle events (inputs, window resize, etc.)
...@@ -704,9 +704,6 @@ void *imscope_thread(void *data_void_ptr) ...@@ -704,9 +704,6 @@ void *imscope_thread(void *data_void_ptr)
extern "C" void imscope_autoinit(void *dataptr) extern "C" void imscope_autoinit(void *dataptr)
{ {
// Copied here due to issues with headers
const int SOFTMODEM_GNB_BIT = 1 << 21;
const int SOFTMODEM_5GUE_BIT = 1 << 23;
AssertFatal((get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) || (get_softmodem_optmask() & SOFTMODEM_GNB_BIT), AssertFatal((get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) || (get_softmodem_optmask() & SOFTMODEM_GNB_BIT),
"Scope cannot find NRUE or GNB context"); "Scope cannot find NRUE or GNB context");
......
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