From 206aa36a47775723629b7ccf1f2106eaf7599d93 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS <laurent.thomas@open-cells.com> Date: Thu, 27 Jul 2023 17:24:00 +0200 Subject: [PATCH] Make read-only globals const, additional fixes - Global variables that are never written to are marked const - Remove some EXTERN declaration - Remove unused `log_mem_multi` from logging module --- common/utils/LOG/log.c | 59 +- common/utils/lte/prach_utils.c | 619 ++++++++++------ common/utils/nr/nr_common.c | 12 +- executables/lte-softmodem.c | 1 - executables/lte-uesoftmodem.c | 2 - executables/nr-ru.c | 7 +- executables/nr-softmodem.c | 6 - executables/nr-uesoftmodem.c | 1 - nfapi/oai_integration/nfapi_pnf.c | 1 - openair1/PHY/CODING/nr_rate_matching.c | 2 +- openair1/PHY/LTE_TRANSPORT/dci_tools_common.c | 2 - .../LTE_TRANSPORT/dci_tools_common_extern.h | 4 - openair1/PHY/LTE_TRANSPORT/prach_common.c | 14 +- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 10 +- openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c | 3 +- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 19 +- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 699 +++++++++++------- .../NR_TRANSPORT/nr_ulsch_llr_computation.c | 4 +- openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.c | 4 +- openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h | 147 +--- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 17 +- .../nr_dlsch_llr_computation.c | 4 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 3 - openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 3 +- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 6 - .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 164 ++-- openair1/PHY/TOOLS/dfts_load.c | 3 +- openair1/PHY/TOOLS/oai_dfts.c | 39 +- openair1/PHY/TOOLS/tools_defs.h | 8 +- openair1/PHY/impl_defs_nr.h | 24 +- openair1/PHY/impl_defs_top.h | 7 +- openair1/PHY/phy_extern.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 - openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +- openair1/SCHED_NR_UE/pucch_uci_ue_nr.c | 8 - openair1/SCHED_NR_UE/pucch_uci_ue_nr.h | 8 - openair1/SCHED_UE/phy_procedures_lte_ue.c | 10 +- openair1/SIMULATION/TOOLS/scm_corrmat.h | 54 +- openair2/E1AP/e1ap.c | 37 +- openair2/F1AP/f1ap_handlers.c | 10 +- openair2/LAYER2/MAC/config.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 17 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 10 +- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 16 +- openair2/LAYER2/MAC/mac_extern.h | 2 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 2 +- openair2/LAYER2/NR_MAC_UE/mac_extern.h | 4 +- openair2/LAYER2/NR_MAC_UE/mac_vars.c | 5 +- openair2/RRC/LTE/rrc_common.c | 164 ++-- openair2/RRC/LTE/rrc_vars.h | 7 +- openair2/RRC/NAS/nas_config.c | 2 +- openair2/UTIL/OPT/probe.c | 17 +- openair3/NAS/COMMON/UTIL/TLVEncoder.c | 14 +- openair3/NAS/COMMON/UTIL/stty.c | 176 +++-- openair3/NAS/UE/API/USER/at_error.c | 236 +++--- openair3/NAS/UE/API/USER/at_response.c | 44 +- openair3/NAS/UE/API/USIM/aka_functions.c | 59 +- openair3/NAS/UE/nas_user.c | 53 +- openair3/NGAP/ngap_gNB_handlers.c | 2 +- openair3/SECU/rijndael.c | 64 +- openair3/UICC/usim_interface.c | 2 +- 62 files changed, 1556 insertions(+), 1377 deletions(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index eed04ecbae4..8b0e1da6bad 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -55,8 +55,7 @@ void read_cpu_hardware (void) __attribute__ ((constructor)); void read_cpu_hardware (void) {__builtin_cpu_init(); } log_mem_cnt_t log_mem_d[2]; -int log_mem_flag=0; -int log_mem_multi=1; +int log_mem_flag = 0; volatile int log_mem_side=0; pthread_mutex_t log_mem_lock; pthread_cond_t log_mem_notify; @@ -88,9 +87,9 @@ const mapping log_options[] = {{"nocolor", FLAG_NOCOLOR}, mapping log_maskmap[] = LOG_MASKMAP_INIT; -static const char *log_level_highlight_start[] = +static const char *const log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */ -static const char *log_level_highlight_end[] = +static const char *const log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */ static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args); @@ -941,35 +940,24 @@ static void log_output_memory(log_component_t *c, const char *file, const char * int logInit_log_mem (void) { - if(log_mem_flag==1){ - if(log_mem_multi==1){ - printf("log-mem multi!!!\n"); - log_mem_d[0].buf_p = malloc(LOG_MEM_SIZE); - log_mem_d[0].buf_index=0; - log_mem_d[0].enable_flag=1; - log_mem_d[1].buf_p = malloc(LOG_MEM_SIZE); - log_mem_d[1].buf_index=0; - log_mem_d[1].enable_flag=1; - log_mem_side=0; - if ((pthread_mutex_init (&log_mem_lock, NULL) != 0) - || (pthread_cond_init (&log_mem_notify, NULL) != 0)) { + if (log_mem_flag == 1) { + log_mem_d[0].buf_p = malloc(LOG_MEM_SIZE); + log_mem_d[0].buf_index = 0; + log_mem_d[0].enable_flag = 1; + log_mem_d[1].buf_p = malloc(LOG_MEM_SIZE); + log_mem_d[1].buf_index = 0; + log_mem_d[1].enable_flag = 1; + log_mem_side = 0; + if ((pthread_mutex_init(&log_mem_lock, NULL) != 0) || (pthread_cond_init(&log_mem_notify, NULL) != 0)) { log_mem_d[1].enable_flag=0; return -1; } - pthread_create(&log_mem_thread, NULL, (void *(*)(void *))flush_mem_to_file, (void*)NULL); - }else{ - printf("log-mem single!!!\n"); - log_mem_d[0].buf_p = malloc(LOG_MEM_SIZE); - log_mem_d[0].buf_index=0; - log_mem_d[0].enable_flag=1; - log_mem_d[1].enable_flag=0; - log_mem_side=0; - } - }else{ - log_mem_d[0].buf_p=NULL; - log_mem_d[1].buf_p=NULL; - log_mem_d[0].enable_flag=0; - log_mem_d[1].enable_flag=0; + pthread_create(&log_mem_thread, NULL, (void *(*)(void *))flush_mem_to_file, (void *)NULL); + } else { + log_mem_d[0].buf_p = NULL; + log_mem_d[1].buf_p = NULL; + log_mem_d[0].enable_flag = 0; + log_mem_d[1].enable_flag = 0; } printf("log init done\n"); @@ -989,7 +977,6 @@ void close_log_mem(void){ while(log_mem_write_flag==1){ usleep(100); } - if(log_mem_multi==1){ snprintf(f_name,1024, "%s_%d.log",log_mem_filename,log_mem_file_cnt); fp=open(f_name, O_WRONLY | O_CREAT, 0666); int ret = write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); @@ -1009,16 +996,6 @@ void close_log_mem(void){ } close(fp); free(log_mem_d[1].buf_p); - }else{ - fp=open(log_mem_filename, O_WRONLY | O_CREAT, 0666); - int ret = write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); - if ( ret < 0) { - fprintf(stderr,"{LOG} %s %d Couldn't write in %s \n",__FILE__,__LINE__,log_mem_filename); - exit(EXIT_FAILURE); - } - close(fp); - free(log_mem_d[0].buf_p); - } } } diff --git a/common/utils/lte/prach_utils.c b/common/utils/lte/prach_utils.c index 9ef29e55a5e..6289d5439ff 100644 --- a/common/utils/lte/prach_utils.c +++ b/common/utils/lte/prach_utils.c @@ -36,215 +36,416 @@ #include "PHY/LTE_TRANSPORT/transport_common.h" // This is table 5.7.1-4 from 36.211 -PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = { - // TDD Configuration Index 0 - { {1,{{0,1,0,2}}},{1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}}, - // TDD Configuration Index 1 - { {1,{{0,2,0,2}}},{1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}}, - // TDD Configuration Index 2 - { {1,{{0,1,1,2}}},{1,{{0,1,1,1}}}, {1,{{0,1,1,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,1}}}}, - // TDD Configuration Index 3 - { {1,{{0,0,0,2}}},{1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}}, - // TDD Configuration Index 4 - { {1,{{0,0,1,2}}},{1,{{0,0,1,1}}}, {1,{{0,0,1,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,1}}}}, - // TDD Configuration Index 5 - { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}}, - // TDD Configuration Index 6 - { {2,{{0,0,0,2},{0,0,1,2}}}, {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {2,{{0,0,0,1},{0,0,0,2}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {2,{{0,0,0,2},{0,0,1,1}}}}, - // TDD Configuration Index 7 - { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,2}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}}, - // TDD Configuration Index 8 - { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,1,1}}}}, - // TDD Configuration Index 9 - { {3,{{0,0,0,1},{0,0,0,2},{0,0,1,2}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,0,2}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {3,{{0,0,0,1},{0,0,0,2},{0,0,1,1}}}}, - // TDD Configuration Index 10 - { {3,{{0,0,0,0},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,2},{0,0,1,0}}}}, - // TDD Configuration Index 11 - { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}}, - // TDD Configuration Index 12 - { {4,{{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, - {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, - {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,2}}}, - {4,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1}}}, - {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}, - {4,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}} - }, - // TDD Configuration Index 13 - { {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1}}} - }, - // TDD Configuration Index 14 - { {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,1}}} - }, - // TDD Configuration Index 15 - { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1}}}, - {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1},{1,0,0,2}}}, - {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,1}}}, {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, - {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}} - }, - // TDD Configuration Index 16 - { {5,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,1,1}}}, - {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,1,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,2}}}, - {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}} - }, - // TDD Configuration Index 17 - { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}} - }, - // TDD Configuration Index 18 - { {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}}, - {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, - {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}}, - {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1},{1,0,0,2}}}, - {6,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0},{2,0,0,1}}}, - {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}}, - {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,0,2}}} - }, - // TDD Configuration Index 19 - { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0},{1,0,1,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,1,1}}} - }, - // TDD Configuration Index 20 - { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}}, - // TDD Configuration Index 21 - { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}}, - - // TDD Configuration Index 22 - { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}}, - - // TDD Configuration Index 23 - { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}}, - - // TDD Configuration Index 24 - { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}}, - - // TDD Configuration Index 25 - { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}}, - - // TDD Configuration Index 26 - { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}}, - - // TDD Configuration Index 27 - { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}}, - {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}} - }, - - // TDD Configuration Index 28 - { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}}, - {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}} - }, - - // TDD Configuration Index 29 - { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}}, - {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}}, - {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}} - }, - - - // TDD Configuration Index 30 - { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}}, - - // TDD Configuration Index 31 - { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}}, - - // TDD Configuration Index 32 - { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}}, - - // TDD Configuration Index 33 - { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}}, - - // TDD Configuration Index 34 - { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}}, - - // TDD Configuration Index 35 - { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}}, - - // TDD Configuration Index 36 - { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}}, - - // TDD Configuration Index 37 - { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}}, - {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}} - }, - - // TDD Configuration Index 38 - { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}}, - {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}} - }, - - // TDD Configuration Index 39 - { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}}, - {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}}, - {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}} - }, - - // TDD Configuration Index 40 - { {1,{{0,1,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}}, - // TDD Configuration Index 41 - { {1,{{0,2,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}}, - - // TDD Configuration Index 42 - { {1,{{0,1,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}}, - - // TDD Configuration Index 43 - { {1,{{0,0,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}}, - - // TDD Configuration Index 44 - { {1,{{0,0,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}}, - - // TDD Configuration Index 45 - { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}}, - - // TDD Configuration Index 46 - { {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}}, - - // TDD Configuration Index 47 - { {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, - {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}} - } -}; - +const PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = { + // TDD Configuration Index 0 + {{1, {{0, 1, 0, 2}}}, + {1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {1, {{0, 1, 0, 2}}}, + {1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {1, {{0, 1, 0, 2}}}}, + // TDD Configuration Index 1 + {{1, {{0, 2, 0, 2}}}, + {1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {1, {{0, 2, 0, 2}}}, + {1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {1, {{0, 2, 0, 2}}}}, + // TDD Configuration Index 2 + {{1, {{0, 1, 1, 2}}}, + {1, {{0, 1, 1, 1}}}, + {1, {{0, 1, 1, 0}}}, + {1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 1, 1}}}}, + // TDD Configuration Index 3 + {{1, {{0, 0, 0, 2}}}, + {1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 2}}}, + {1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 2}}}}, + // TDD Configuration Index 4 + {{1, {{0, 0, 1, 2}}}, + {1, {{0, 0, 1, 1}}}, + {1, {{0, 0, 1, 0}}}, + {1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 1, 1}}}}, + // TDD Configuration Index 5 + {{1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 1}}}}, + // TDD Configuration Index 6 + {{2, {{0, 0, 0, 2}, {0, 0, 1, 2}}}, + {2, {{0, 0, 0, 1}, {0, 0, 1, 1}}}, + {2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {2, {{0, 0, 0, 1}, {0, 0, 0, 2}}}, + {2, {{0, 0, 0, 0}, {0, 0, 0, 1}}}, + {2, {{0, 0, 0, 0}, {1, 0, 0, 0}}}, + {2, {{0, 0, 0, 2}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 7 + {{2, {{0, 0, 0, 1}, {0, 0, 1, 1}}}, + {2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 0}, {0, 0, 0, 2}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 1}, {0, 0, 1, 0}}}}, + // TDD Configuration Index 8 + {{2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 0}, {0, 0, 0, 1}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 0}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 9 + {{3, {{0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 2}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 1}}}, + {3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 1}}}, + {3, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 10 + {{3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 0, 1, 1}}}, + {3, {{0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}}}, + {3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 2}, {0, 0, 1, 0}}}}, + // TDD Configuration Index 11 + {{0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 12 + {{4, {{0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 1}, {0, 0, 1, 2}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}}}, + {4, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 2}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}}}, + {4, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}}}, + {4, {{0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 13 + {{4, {{0, 0, 0, 0}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 2}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 1}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 14 + {{4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 15 + {{5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 1}, {0, 0, 1, 2}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 1}, {1, 0, 0, 2}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {2, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}}}}, + // TDD Configuration Index 16 + {{5, {{0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 0, 1, 2}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 1, 1}}}, + {5, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 1, 0}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 0}, {1, 0, 0, 2}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}}, + // TDD Configuration Index 17 + {{5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 2}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {5, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 0}, {1, 0, 0, 1}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}}, + // TDD Configuration Index 18 + {{6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 0, 1, 2}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}}}, + {6, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}, {2, 0, 1, 0}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 0, 2}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {2, 0, 0, 0}, {2, 0, 0, 1}}}, + {6, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}, {5, 0, 0, 0}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 2}}}}, + // TDD Configuration Index 19 + {{0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 0}, {1, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 1, 0}, {0, 0, 1, 1}, {1, 0, 1, 1}}}}, + // TDD Configuration Index 20 + {{1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 1}}}}, + // TDD Configuration Index 21 + {{1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 1}}}}, + + // TDD Configuration Index 22 + {{1, {{0, 1, 1, 1}}}, + {1, {{0, 1, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 1, 0}}}}, + + // TDD Configuration Index 23 + {{1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 1}}}}, + + // TDD Configuration Index 24 + {{1, {{0, 0, 1, 1}}}, + {1, {{0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 1, 0}}}}, + + // TDD Configuration Index 25 + {{2, {{0, 0, 0, 1}, {0, 0, 1, 1}}}, + {2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 1}, {1, 0, 0, 1}}}, + {2, {{0, 0, 0, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 1}, {0, 0, 1, 0}}}}, + + // TDD Configuration Index 26 + {{3, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}}}, + {3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}}}, + {3, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}}}}, + + // TDD Configuration Index 27 + {{4, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}}}, + {4, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}}}, + {4, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}}}}, + + // TDD Configuration Index 28 + {{5, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}, {2, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {5, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}, {4, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {5, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {2, 0, 0, 1}}}}, + + // TDD Configuration Index 29 + {{6, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}, {2, 0, 0, 1}, {2, 0, 1, 1}}}, + {6, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}, {2, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}, {4, 0, 0, 1}, {5, 0, 0, 1}}}, + {6, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}, {5, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {2, 0, 0, 1}, {2, 0, 1, 0}}}}, + + // TDD Configuration Index 30 + {{1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 1}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 1}}}}, + + // TDD Configuration Index 31 + {{1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 1}}}, + {1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 1}}}}, + + // TDD Configuration Index 32 + {{1, {{0, 1, 1, 1}}}, + {1, {{0, 1, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 1, 0}}}}, + + // TDD Configuration Index 33 + {{1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 1}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 1}}}}, + + // TDD Configuration Index 34 + {{1, {{0, 0, 1, 1}}}, + {1, {{0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 1, 0}}}}, + + // TDD Configuration Index 35 + {{2, {{0, 0, 0, 1}, {0, 0, 1, 1}}}, + {2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 1}, {1, 0, 0, 1}}}, + {2, {{0, 0, 0, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 1}, {0, 0, 1, 0}}}}, + + // TDD Configuration Index 36 + {{3, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}}}, + {3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}}}, + {3, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}}}}, + + // TDD Configuration Index 37 + {{4, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}}}, + {4, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}}}, + {4, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}}}}, + + // TDD Configuration Index 38 + {{5, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}, {2, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {5, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}, {4, 0, 0, 1}}}, + {5, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {5, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {2, 0, 0, 1}}}}, + + // TDD Configuration Index 39 + {{6, {{0, 0, 0, 1}, {0, 0, 1, 1}, {1, 0, 0, 1}, {1, 0, 1, 1}, {2, 0, 0, 1}, {2, 0, 1, 1}}}, + {6, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}, {2, 0, 0, 0}, {2, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}, {3, 0, 0, 1}, {4, 0, 0, 1}, {5, 0, 0, 1}}}, + {6, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}, {4, 0, 0, 0}, {5, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {6, {{0, 0, 0, 1}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {2, 0, 0, 1}, {2, 0, 1, 0}}}}, + + // TDD Configuration Index 40 + {{1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 1, 0, 0}}}}, + // TDD Configuration Index 41 + {{1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 2, 0, 0}}}}, + + // TDD Configuration Index 42 + {{1, {{0, 1, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}}, + + // TDD Configuration Index 43 + {{1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {1, {{0, 0, 0, 0}}}}, + + // TDD Configuration Index 44 + {{1, {{0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}}}}, + + // TDD Configuration Index 45 + {{2, {{0, 0, 0, 0}, {0, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}}}, + {2, {{0, 0, 0, 0}, {1, 0, 0, 0}}}}, + + // TDD Configuration Index 46 + {{3, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {3, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}}}}, + + // TDD Configuration Index 47 + {{4, {{0, 0, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {1, 0, 1, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {0, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}, + {4, {{0, 0, 0, 0}, {1, 0, 0, 0}, {2, 0, 0, 0}, {3, 0, 0, 0}}}}}; uint8_t get_prach_fmt(int prach_ConfigIndex,int frame_type) { if (frame_type == FDD) // FDD diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 4b0722a79c7..c1bd80f0747 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -36,12 +36,12 @@ const char *duplex_mode[]={"FDD","TDD"}; -int tables_5_3_2[5][12] = { - {25, 52, 79, 106, 133, 160, 216, 270, -1, -1, -1, -1}, // 15 FR1 - {11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 245, 273},// 30 FR1 - {-1, 11, 18, 24, 31, 38, 51, 65, 79, 107, 121, 135}, // 60 FR1 - {66, 132, 264, -1 , -1, -1, -1, -1, -1, -1, -1, -1}, // 60 FR2 - {32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1, -1} // 120FR2 +static const int tables_5_3_2[5][12] = { + {25, 52, 79, 106, 133, 160, 216, 270, -1, -1, -1, -1}, // 15 FR1 + {11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 245, 273}, // 30 FR1 + {-1, 11, 18, 24, 31, 38, 51, 65, 79, 107, 121, 135}, // 60 FR1 + {66, 132, 264, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 60 FR2 + {32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1, -1} // 120FR2 }; int get_supported_band_index(int scs, int band, int n_rbs) diff --git a/executables/lte-softmodem.c b/executables/lte-softmodem.c index 1a9060c04cb..aa563263c28 100644 --- a/executables/lte-softmodem.c +++ b/executables/lte-softmodem.c @@ -133,7 +133,6 @@ double sample_rate=30.72e6; double bw = 10.0e6; uint8_t dci_Format = 0; -uint8_t agregation_Level =0xFF; uint8_t nb_antenna_tx = 1; uint8_t nb_antenna_rx = 1; diff --git a/executables/lte-uesoftmodem.c b/executables/lte-uesoftmodem.c index d5b47a198c9..c7e8c9300ae 100644 --- a/executables/lte-uesoftmodem.c +++ b/executables/lte-uesoftmodem.c @@ -132,9 +132,7 @@ double bw = 10.0e6; static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; - uint8_t dci_Format = 0; -uint8_t agregation_Level =0xFF; uint8_t nb_antenna_tx = 1; uint8_t nb_antenna_rx = 1; diff --git a/executables/nr-ru.c b/executables/nr-ru.c index fb3b8a2e6c6..9467704b1d7 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1504,11 +1504,10 @@ int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) { return(-1); } +const char rru_format_options[4][20] = {"OAI_IF5_only", "OAI_IF4p5_only", "OAI_IF5_and_IF4p5", "MBP_IF5"}; -char rru_format_options[4][20] = {"OAI_IF5_only","OAI_IF4p5_only","OAI_IF5_and_IF4p5","MBP_IF5"}; - -char rru_formats[3][20] = {"OAI_IF5","MBP_IF5","OAI_IF4p5"}; -char ru_if_formats[4][20] = {"LOCAL_RF","REMOTE_OAI_IF5","REMOTE_MBP_IF5","REMOTE_OAI_IF4p5"}; +const char rru_formats[3][20] = {"OAI_IF5", "MBP_IF5", "OAI_IF4p5"}; +const char ru_if_formats[4][20] = {"LOCAL_RF", "REMOTE_OAI_IF5", "REMOTE_MBP_IF5", "REMOTE_OAI_IF4p5"}; void configure_ru(int idx, void *arg) { diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 8ccf8bf9235..5c419f19058 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -138,16 +138,10 @@ static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; int chain_offset=0; - uint8_t dci_Format = 0; -uint8_t agregation_Level =0xFF; - uint8_t nb_antenna_tx = 1; uint8_t nb_antenna_rx = 1; -char ref[128] = "internal"; -char channels[128] = "0"; - int rx_input_level_dBm; int otg_enabled; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 35a9f9a4730..e5332e8e5ef 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -154,7 +154,6 @@ double cpuf; int chain_offset = 0; int card_offset = 0; uint64_t num_missed_slots = 0; // counter for the number of missed slots -int transmission_mode = 1; int numerology = 0; int oaisim_flag = 0; int emulate_rf = 0; diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 3de07bd0be6..0a7b53b9ea5 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -83,7 +83,6 @@ nfapi_nr_pdu_t *tx_data_request[1023][20][10]; //[frame][slot][max_num_pdus] uint8_t tx_pdus[32][8][4096]; nfapi_ue_release_request_body_t release_rntis; -uint16_t phy_antenna_capability_values[] = { 1, 2, 4, 8, 16 }; nfapi_nr_pnf_param_response_t g_pnf_param_resp; diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 90ddbe656b0..bdcbaef7763 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -31,7 +31,7 @@ //#define RM_DEBUG 1 -uint8_t index_k0[2][4] = {{0,17,33,56},{0,13,25,43}}; +static const uint8_t index_k0[2][4] = {{0, 17, 33, 56}, {0, 13, 25, 43}}; void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c index 524839359ac..935a6f1f011 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c @@ -97,8 +97,6 @@ uint16_t RIV2nb_rb_LUT100[6000]; uint16_t RIV2first_rb_LUT100[6000]; uint16_t RIV_max100=0; -const int8_t *delta_PUCCH_lut = delta_PUSCH_acc; - uint32_t check_phich_reg(LTE_DL_FRAME_PARMS *frame_parms,uint32_t kprime,uint8_t lprime,uint8_t mi) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common_extern.h b/openair1/PHY/LTE_TRANSPORT/dci_tools_common_extern.h index 63a2e289a9b..219f9a9a1d6 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common_extern.h +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common_extern.h @@ -83,7 +83,3 @@ extern uint32_t distRIV2alloc_gap1_odd_LUT100_3[6000]; extern uint16_t RIV2nb_rb_LUT100[6000]; extern uint16_t RIV2first_rb_LUT100[6000]; extern uint16_t RIV_max100; - -extern const int8_t *delta_PUCCH_lut; -extern const int8_t delta_PUSCH_acc[4]; -extern const int8_t delta_PUSCH_abs[4]; diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c index 3d4676831a0..14bf35aab74 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach_common.c +++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c @@ -295,14 +295,12 @@ const uint16_t prach_root_sequence_map0_3[838] = { 404, 435, 406, 433, 235, 604, 267, 572, 302, 537, 309, 530, 265, 574, 233, 606, 367, 472, 296, 543, 336, 503, 305, 534, 373, 466, 280, 559, 279, 560, 419, 420, 240, 599, 258, 581, 229, 610}; -uint16_t prach_root_sequence_map4[138] = { 1,138,2,137,3,136,4,135,5,134,6,133,7,132,8,131,9,130,10,129, - 11,128,12,127,13,126,14,125,15,124,16,123,17,122,18,121,19,120,20,119, - 21,118,22,117,23,116,24,115,25,114,26,113,27,112,28,111,29,110,30,109, - 31,108,32,107,33,106,34,105,35,104,36,103,37,102,38,101,39,100,40,99, - 41,98,42,97,43,96,44,95,45,94,46,93,47,92,48,91,49,90,50,89, - 51,88,52,87,53,86,54,85,55,84,56,83,57,82,58,81,59,80,60,79, - 61,78,62,77,63,76,64,75,65,74,66,73,67,72,68,71,69,70 - }; +const uint16_t prach_root_sequence_map4[138] = { + 1, 138, 2, 137, 3, 136, 4, 135, 5, 134, 6, 133, 7, 132, 8, 131, 9, 130, 10, 129, 11, 128, 12, 127, 13, 126, 14, 125, + 15, 124, 16, 123, 17, 122, 18, 121, 19, 120, 20, 119, 21, 118, 22, 117, 23, 116, 24, 115, 25, 114, 26, 113, 27, 112, 28, 111, + 29, 110, 30, 109, 31, 108, 32, 107, 33, 106, 34, 105, 35, 104, 36, 103, 37, 102, 38, 101, 39, 100, 40, 99, 41, 98, 42, 97, + 43, 96, 44, 95, 45, 94, 46, 93, 47, 92, 48, 91, 49, 90, 50, 89, 51, 88, 52, 87, 53, 86, 54, 85, 55, 84, 56, 83, + 57, 82, 58, 81, 59, 80, 60, 79, 61, 78, 62, 77, 63, 76, 64, 75, 65, 74, 66, 73, 67, 72, 68, 71, 69, 70}; void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe) { FILE *fd; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index d0f3a9da755..de1af613ef1 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -1521,7 +1521,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format, pdlsch0_harq->Nl = 1; pdlsch0_harq->mimo_mode = frame_parms->nb_antenna_ports_eNB == 1 ?SISO : ALAMOUTI; pdlsch0_harq->dl_power_off = 1; //no power offset - pdlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC &3]; + pdlsch0_harq->delta_PUCCH = delta_PUSCH_acc[TPC & 3]; // compute resource allocation if(dci_format == format1A) @@ -1979,8 +1979,8 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, dlsch1_harq->codeword = 1; dlsch0_harq->Nl = 1; dlsch1_harq->Nl = 1; - dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; - dlsch1_harq->delta_PUCCH = delta_PUCCH_lut[TPC&3]; + dlsch0_harq->delta_PUCCH = delta_PUSCH_acc[TPC & 3]; + dlsch1_harq->delta_PUCCH = delta_PUSCH_acc[TPC & 3]; dlsch0_harq->dl_power_off = 1; dlsch1_harq->dl_power_off = 1; @@ -2598,9 +2598,7 @@ int generate_ue_dlsch_params_from_dci(int frame, //dlsch1_harq->nb_rb = dlsch0_harq->nb_rb; dlsch0_harq->mcs = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->mcs; - dlsch0_harq->delta_PUCCH = delta_PUCCH_lut[((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->TPC&3]; - - + dlsch0_harq->delta_PUCCH = delta_PUSCH_acc[((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->TPC & 3]; /* if (dlsch0_harq->mcs>20) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c index 2e999a42bc1..ec763b07c14 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/phich_ue.c @@ -32,6 +32,7 @@ #include "PHY/defs_UE.h" #include "PHY/phy_extern_ue.h" +#include "PHY/phy_extern.h" #include "SCHED_UE/sched_UE.h" #include "transport_ue.h" #include "transport_proto_ue.h" @@ -86,8 +87,6 @@ void rx_phich(PHY_VARS_UE *ue, uint8_t NSF_PHICH = 4; uint8_t pusch_subframe; - int8_t delta_PUSCH_acc[4] = {-1,0,1,3}; - // check if we're expecting a PHICH in this subframe LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX\n",ue->Mod_id,harq_pid,proc->frame_rx,subframe); diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 43373475a40..d0976ab988f 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -35,9 +35,7 @@ #include <math.h> #include "defs.h" -#define DEFINE_VARIABLES_LOWPAPR_SEQUENCES_NR_H #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" -#undef DEFINE_VARIABLES_LOWPAPR_SEQUENCES_NR_H /******************************************************************* * @@ -54,9 +52,7 @@ * *********************************************************************/ -int16_t *base_sequence_less_than_36(unsigned int M_ZC, - unsigned int u, - unsigned int scaling) +static int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned int scaling) { char *phi_table; int16_t *rv_overbar; @@ -153,10 +149,11 @@ int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) { * *********************************************************************/ -int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, - unsigned int u, - unsigned int v, - unsigned int scaling, unsigned int if_dmrs_seq) +static int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, + unsigned int u, + unsigned int v, + unsigned int scaling, + unsigned int if_dmrs_seq) { int16_t *rv_overbar; unsigned int N_ZC, M_ZC; @@ -199,6 +196,8 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, return rv_overbar; } +int16_t *rv_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][SRS_SB_CONF]; +int16_t *gNB_dmrs_lowpaprtype1_sequence[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) { /* prevent multiple calls, relevant when both UE & gNB initialize this */ @@ -222,7 +221,7 @@ void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) } } - +int16_t *dmrs_lowpaprtype1_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; void generate_ul_reference_signal_sequences(unsigned int scaling) { /* prevent multiple calls, relevant when both UE & gNB initialize this */ diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index dab8e040592..3ef9b30c280 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -41,14 +41,6 @@ #include "PHY/defs_nr_common.h" #include "PHY/defs_gNB.h" - -#ifdef DEFINE_VARIABLES_LOWPAPR_SEQUENCES_NR_H -#define EXTERN -#define INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -#else -#define EXTERN extern -#endif - /************** DEFINE ********************************************/ #define U_GROUP_NUMBER (30) /* maximum number of sequence-group */ #define V_BASE_SEQUENCE_NUMBER (2) /* maximum number of base sequences */ @@ -58,212 +50,326 @@ #define INDEX_SB_LESS_32 (4) /* index of dftsizes array for which subcarrier number is less than 36 */ -EXTERN const uint16_t ul_allocated_re[SRS_SB_CONF] /* number of uplink allocated resource elements */ -/* this table is derivated from TS 38.211 Table 6.4.1.4.3-1: SRS bandwidth configuration which gives m_SRS_b then all possible values of sequence length is */ -/* M_sc_b_SRS = m_SRS_b * N_SC_RB/K_TC with K_TC = 2 or K_TC = 4 as specified in TS 38.211 6.4.1.4.3 */ -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { /* -K_TC 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 -m_SRS_b 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 */ - 6, 12, 18, 24, 30, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 168, 180, 192, 204, 216, 228, 240, -/* -K_TC 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 6 3 3 -m_SRS_b 84 88 92 96 100 104 108 112 116 120 128 132 136 144 152 160 168 176 184 192 100 208 216 */ - 252, 264, 276, 288, 300, 312, 324, 336, 348, 360, 384, 396, 408, 432, 456, 480, 504, 528, 552, 576, 600, 624, 648, -/* -K_TC 3 6 3 3 3 3 6 6 6 6 6 6 6 6 6 6 6 6 6 6 -m_SRS_b 224 116, 240 256 264 272 144 152 160 168 176 184 192 208 216 224 240 256 264 272 */ - 672, 696, 720, 768, 792, 816, 864, 912, 960, 1008, 1056, 1104, 1152, 1248, 1296, 1344, 1440, 1536, 1584, 1632, - -/* below numbers have been added just to include all possible lengths already used for lte */ - 540, 900, 972, 1080, 1200, -} -#endif -; +static const uint16_t ul_allocated_re[SRS_SB_CONF] /* number of uplink allocated resource elements */ + /* this table is derivated from TS 38.211 Table 6.4.1.4.3-1: SRS bandwidth configuration which gives m_SRS_b then all possible + values of sequence length is */ + /* M_sc_b_SRS = m_SRS_b * N_SC_RB/K_TC with K_TC = 2 or K_TC = 4 as specified in TS 38.211 6.4.1.4.3 */ + = { + /* + K_TC 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 + 3 3 3 m_SRS_b 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 + 64 68 72 76 80 */ + 6, + 12, + 18, + 24, + 30, + 36, + 48, + 60, + 72, + 84, + 96, + 108, + 120, + 132, + 144, + 156, + 168, + 180, + 192, + 204, + 216, + 228, + 240, + /* + K_TC 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 + 3 6 3 3 m_SRS_b 84 88 92 96 100 104 108 112 116 120 128 132 136 144 152 160 + 168 176 184 192 100 208 216 */ + 252, + 264, + 276, + 288, + 300, + 312, + 324, + 336, + 348, + 360, + 384, + 396, + 408, + 432, + 456, + 480, + 504, + 528, + 552, + 576, + 600, + 624, + 648, + /* + K_TC 3 6 3 3 3 3 6 6 6 6 6 6 6 6 6 6 6 6 6 6 + m_SRS_b 224 116, 240 256 264 272 144 152 160 168 176 184 192 208 216 224 240 256 264 + 272 */ + 672, + 696, + 720, + 768, + 792, + 816, + 864, + 912, + 960, + 1008, + 1056, + 1104, + 1152, + 1248, + 1296, + 1344, + 1440, + 1536, + 1584, + 1632, + + /* below numbers have been added just to include all possible lengths already used for lte */ + 540, + 900, + 972, + 1080, + 1200, +}; /* table of largest prime number lower than uplink allocated resource elements "ul_allocated_re" */ -EXTERN const uint16_t ref_ul_primes[SRS_SB_CONF] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/* 6, 12, 18, 24, 30, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 168, 180, 192, 204, 216, 228, 240, */ - 5, 11, 17, 23, 29, 31, 47, 59, 71, 83, 89, 107, 113, 127, 139, 151, 167, 179, 191, 199, 211, 227, 239, - -/* 252, 264, 276, 288, 300, 312, 324, 336, 348, 360, 384, 396, 408, 432, 456, 480, 504, 528, 552, 576, 600, 624, 648, */ - 251, 263, 271, 283, 293, 311, 317, 331, 347, 359, 383, 389, 401, 431, 449, 479, 503, 523, 547, 571, 599, 619, 647, - -/* 672, 696, 720, 768, 792, 816, 864, 912, 960, 1008, 1056, 1104, 1152, 1248, 1296, 1344, 1440, 1536, 1584, 1632, */ - 661, 691, 719, 761, 787, 811, 863, 911, 953, 997, 1051, 1103, 1151, 1237, 1291, 1327, 1439, 1531, 1583, 1627, - -/* 540, 900, 972, 1080, 1200, */ - 523, 887, 971, 1069, 1193, -} -#endif -; +static const uint16_t ref_ul_primes[SRS_SB_CONF] = { + /* 6, 12, 18, 24, 30, 36, 48, 60, 72, 84, 96, 108, 120, 132, 144, 156, 168, 180, 192, 204, + 216, 228, 240, */ + 5, + 11, + 17, + 23, + 29, + 31, + 47, + 59, + 71, + 83, + 89, + 107, + 113, + 127, + 139, + 151, + 167, + 179, + 191, + 199, + 211, + 227, + 239, + + /* 252, 264, 276, 288, 300, 312, 324, 336, 348, 360, 384, 396, 408, 432, 456, 480, 504, 528, 552, 576, + 600, 624, 648, */ + 251, + 263, + 271, + 283, + 293, + 311, + 317, + 331, + 347, + 359, + 383, + 389, + 401, + 431, + 449, + 479, + 503, + 523, + 547, + 571, + 599, + 619, + 647, + + /* 672, 696, 720, 768, 792, 816, 864, 912, 960, 1008, 1056, 1104, 1152, 1248, 1296, 1344, 1440, 1536, 1584, + 1632, */ + 661, + 691, + 719, + 761, + 787, + 811, + 863, + 911, + 953, + 997, + 1051, + 1103, + 1151, + 1237, + 1291, + 1327, + 1439, + 1531, + 1583, + 1627, + + /* 540, 900, 972, 1080, 1200, */ + 523, + 887, + 971, + 1069, + 1193, +}; /* Low-PAPR base sequence; see TS 38.211 clause 5.2.2 */ -EXTERN int16_t *rv_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][SRS_SB_CONF]; +extern int16_t *rv_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][SRS_SB_CONF]; /* 38.211 table Table 5.2.2.2-1: Definition of phi(n) for M_ZC = 6 */ -EXTERN const char phi_M_ZC_6[6*U_GROUP_NUMBER] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/* 0 1 2 3 4 5 */ -/* 0 */ -3, -1, 3, 3, -1, -3, -/* 1 */ -3, 3, -1, -1, 3, -3, -/* 2 */ -3, -3, -3, 3, 1, -3, -/* 3 */ 1, 1, 1, 3, -1, -3, -/* 4 */ 1, 1, 1, -3, -1, 3, -/* 5 */ -3, 1, -1, -3, -3, -3, -/* 6 */ -3, 1, 3, -3, -3, -3, -/* 7 */ -3, -1, 1, -3, 1, -1, -/* 8 */ -3, -1, -3, 1, -3, -3, -/* 9 */ -3, -3, 1, -3, 3, -3, -/* 10 */ -3, 1, 3, 1, -3, -3, -/* 11 */ -3, -1, -3, 1, 1, -3, -/* 12 */ 1, 1, 3, -1, -3, 3, -/* 13 */ 1, 1, 3, 3, -1, 3, -/* 14 */ 1, 1, 1, -3, 3, -1, -/* 15 */ 1, 1, 1, -1, 3, -3, -/* 16 */ -3, -1, -1, -1, 3, -1, -/* 17 */ -3, -3, -1, 1, -1, -3, -/* 18 */ -3, -3, -3, 1, -3, -1, -/* 19 */ -3, 1, 1, -3, -1, -3, -/* 20 */ -3, 3, -3, 1, 1, -3, -/* 21 */ -3, 1, -3, -3, -3, -1, -/* 22 */ 1, 1, -3, 3, 1, 3, -/* 23 */ 1, 1, -3, -3, 1, -3, -/* 24 */ 1, 1, 3, -1, 3, 3, -/* 25 */ 1, 1, -3, 1, 3, 3, -/* 26 */ 1, 1, -1, -1, 3, -1, -/* 27 */ 1, 1, -1, 3, -1, -1, -/* 28 */ 1, 1, -1, 3, -3, -1, -/* 29 */ 1, 1, -3, 1, -1, -1, -} -#endif -; +static const char phi_M_ZC_6[6 * U_GROUP_NUMBER] = { + /* 0 1 2 3 4 5 */ + /* 0 */ -3, -1, 3, 3, -1, -3, + /* 1 */ -3, 3, -1, -1, 3, -3, + /* 2 */ -3, -3, -3, 3, 1, -3, + /* 3 */ 1, 1, 1, 3, -1, -3, + /* 4 */ 1, 1, 1, -3, -1, 3, + /* 5 */ -3, 1, -1, -3, -3, -3, + /* 6 */ -3, 1, 3, -3, -3, -3, + /* 7 */ -3, -1, 1, -3, 1, -1, + /* 8 */ -3, -1, -3, 1, -3, -3, + /* 9 */ -3, -3, 1, -3, 3, -3, + /* 10 */ -3, 1, 3, 1, -3, -3, + /* 11 */ -3, -1, -3, 1, 1, -3, + /* 12 */ 1, 1, 3, -1, -3, 3, + /* 13 */ 1, 1, 3, 3, -1, 3, + /* 14 */ 1, 1, 1, -3, 3, -1, + /* 15 */ 1, 1, 1, -1, 3, -3, + /* 16 */ -3, -1, -1, -1, 3, -1, + /* 17 */ -3, -3, -1, 1, -1, -3, + /* 18 */ -3, -3, -3, 1, -3, -1, + /* 19 */ -3, 1, 1, -3, -1, -3, + /* 20 */ -3, 3, -3, 1, 1, -3, + /* 21 */ -3, 1, -3, -3, -3, -1, + /* 22 */ 1, 1, -3, 3, 1, 3, + /* 23 */ 1, 1, -3, -3, 1, -3, + /* 24 */ 1, 1, 3, -1, 3, 3, + /* 25 */ 1, 1, -3, 1, 3, 3, + /* 26 */ 1, 1, -1, -1, 3, -1, + /* 27 */ 1, 1, -1, 3, -1, -1, + /* 28 */ 1, 1, -1, 3, -3, -1, + /* 29 */ 1, 1, -3, 1, -1, -1, +}; /* Table 5.2.2.2-2: Definition of phi ( n ) for M ZC = 12 */ -EXTERN const char phi_M_ZC_12[12*U_GROUP_NUMBER] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/* 0 1 2 3 4 5 6 7 8 9 10 11 */ -/* 0 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3, -/* 1 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3, -/* 2 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3, -/* 3 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3, -/* 4 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1, -/* 5 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3, -/* 6 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3, -/* 7 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3, -/* 8 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1, -/* 9 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3, -/* 10 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3, -/* 11 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3, -/* 12 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3, -/* 13 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3, -/* 14 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3, -/* 15 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3, -/* 16 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1, -/* 17 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3, -/* 18 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3, -/* 19 */ -3, -3, 3, -3, -1, 3, 3, 3, -1, -3, 1, -3, -/* 20 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3, -/* 21 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3, -/* 22 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3, -/* 23 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3, -/* 24 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3, -/* 25 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1, -/* 26 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1, -/* 27 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3, -/* 28 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1, -/* 29 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3, -} -#endif -; +static const char phi_M_ZC_12[12 * U_GROUP_NUMBER] = { + /* 0 1 2 3 4 5 6 7 8 9 10 11 */ + /* 0 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3, + /* 1 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3, + /* 2 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3, + /* 3 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3, + /* 4 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1, + /* 5 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3, + /* 6 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3, + /* 7 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3, + /* 8 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1, + /* 9 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3, + /* 10 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3, + /* 11 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3, + /* 12 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3, + /* 13 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3, + /* 14 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3, + /* 15 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3, + /* 16 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1, + /* 17 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3, + /* 18 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3, + /* 19 */ -3, -3, 3, -3, -1, 3, 3, 3, -1, -3, 1, -3, + /* 20 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3, + /* 21 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3, + /* 22 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3, + /* 23 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3, + /* 24 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3, + /* 25 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1, + /* 26 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1, + /* 27 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3, + /* 28 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1, + /* 29 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3, +}; /* Table 5.2.2.2-3: Definition of phi (n ) for M_ZC = 18 */ -EXTERN const char phi_M_ZC_18[18*U_GROUP_NUMBER] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */ -/* 0 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1, -/* 1 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3, -/* 2 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1, -/* 3 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1, -/* 4 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1, -/* 5 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1, -/* 6 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3, -/* 7 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3, -/* 8 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3, -/* 9 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3, -/* 10 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3, -/* 11 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1, -/* 12 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3, -/* 13 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1, -/* 14 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1, -/* 15 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3, -/* 16 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3, -/* 17 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1, -/* 18 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1, -/* 19 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3, -/* 20 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3, -/* 21 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3, -/* 22 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1, -/* 23 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3, -/* 24 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3, -/* 25 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1, -/* 26 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1, -/* 27 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3, -/* 28 */ -1, -3, 1, -3, -3, -3, 1, 1, 3, 3, -3, 3, 3, -3, -1, 3, -3, 1, -/* 29 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1, -} -#endif -; +static const char phi_M_ZC_18[18 * U_GROUP_NUMBER] = { + /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */ + /* 0 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1, + /* 1 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3, + /* 2 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1, + /* 3 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1, + /* 4 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1, + /* 5 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1, + /* 6 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3, + /* 7 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3, + /* 8 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3, + /* 9 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3, + /* 10 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3, + /* 11 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1, + /* 12 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3, + /* 13 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1, + /* 14 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1, + /* 15 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3, + /* 16 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3, + /* 17 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1, + /* 18 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1, + /* 19 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3, + /* 20 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3, + /* 21 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3, + /* 22 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1, + /* 23 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3, + /* 24 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3, + /* 25 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1, + /* 26 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1, + /* 27 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3, + /* 28 */ -1, -3, 1, -3, -3, -3, 1, 1, 3, 3, -3, 3, 3, -3, -1, 3, -3, 1, + /* 29 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1, +}; /* Table 5.2.2.2-4: Definition of phi (n ) for M_ZC = 24 */ -EXTERN const char phi_M_ZC_24[24*U_GROUP_NUMBER] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 */ -/* 0 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3, -/* 1 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3, -/* 2 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3, -/* 3 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3, -/* 4 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3, -/* 5 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3, -/* 6 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3, -/* 7 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3, -/* 8 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3, -/* 9 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3, -/* 10 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3, -/* 11 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3, -/* 12 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3, -/* 13 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3, -/* 14 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3, -/* 15 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3, -/* 16 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3, -/* 17 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3, -/* 18 */ 3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3, -/* 19 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3, -/* 20 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3, -/* 21 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3, -/* 22 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3, -/* 23 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3, -/* 24 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3, -/* 25 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3, -/* 26 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3, -/* 27 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3, -/* 28 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3, -/* 29 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3, -} -#endif -; +static const char phi_M_ZC_24[24 * U_GROUP_NUMBER] = { + /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 */ + /* 0 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3, + /* 1 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3, + /* 2 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3, + /* 3 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3, + /* 4 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3, + /* 5 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3, + /* 6 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3, + /* 7 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3, + /* 8 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3, + /* 9 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3, + /* 10 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3, + /* 11 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3, + /* 12 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3, + /* 13 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3, + /* 14 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3, + /* 15 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3, + /* 16 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3, + /* 17 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3, + /* 18 */ 3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3, + /* 19 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3, + /* 20 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3, + /* 21 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3, + /* 22 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3, + /* 23 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3, + /* 24 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3, + /* 25 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3, + /* 26 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3, + /* 27 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3, + /* 28 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3, + /* 29 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3, +}; /************** FUNCTION ******************************************/ - -EXTERN int16_t *base_sequence_36_or_larger(unsigned int M_ZC, unsigned int u, unsigned int v, unsigned int scaling, unsigned int if_dmrs_seq); - - -EXTERN int16_t *base_sequence_less_than_36(unsigned int M_ZC, unsigned int u, unsigned int scaling); /*! \brief This function generate the sounding reference symbol (SRS) for the uplink. @param tables of srs @@ -277,68 +383,151 @@ void free_ul_reference_signal_sequences(void); // Supported for 100Mhz configuration - which has max 273 RBs #define MAX_INDEX_DMRS_UL_ALLOCATED_REs 53 - -EXTERN const uint16_t dmrs_ul_allocated_res[MAX_INDEX_DMRS_UL_ALLOCATED_REs] -/* Number of possible DMRS REs based on PRBs allocated for PUSCH. Array has values until 273 RBs (100Mhz BW) - Number of PUSCH RBs allocated should be able to be expressed as 2topowerofn*3topowerofn*5tothepowerofn - According to 3GPP spec 38.211 section 6.3.1.4 - Table used in calculating DMRS low papr type1 sequence for transform precoding */ -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/*RBs 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, */ - 6, 12, 18, 24, 30, 36, 48, 54, 60, 72, 90, 96, - -/*RBs 18, 20, 24, 25, 27, 30, 32, 36, 40, 45, 48, 50, */ - 108, 120, 144, 150, 162, 180, 192, 216, 240, 270, 288, 300, - -/*RBs 54, 60, 64, 72 75, 80, 81, 90, 96, 100, (Bw 40Mhz) */ - 324, 360, 384, 432, 450, 480, 486, 540, 576, 600, - -/*RBs 108, 120 125 128 135 144 150 160 162 180 192 200 */ - 648, 720, 750, 768, 810, 864, 900, 960, 972, 1080, 1152, 1200, - -/*RBs 216 225 240 243 250 256 270 supported until 100Mhz */ - 1296, 1350, 1440, 1458, 1500, 1536, 1620 - -} -#endif -; +static const uint16_t dmrs_ul_allocated_res[MAX_INDEX_DMRS_UL_ALLOCATED_REs] + /* Number of possible DMRS REs based on PRBs allocated for PUSCH. Array has values until 273 RBs (100Mhz BW) + Number of PUSCH RBs allocated should be able to be expressed as 2topowerofn*3topowerofn*5tothepowerofn + According to 3GPP spec 38.211 section 6.3.1.4 + Table used in calculating DMRS low papr type1 sequence for transform precoding */ + = { + /*RBs 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, */ + 6, + 12, + 18, + 24, + 30, + 36, + 48, + 54, + 60, + 72, + 90, + 96, + + /*RBs 18, 20, 24, 25, 27, 30, 32, 36, 40, 45, 48, 50, */ + 108, + 120, + 144, + 150, + 162, + 180, + 192, + 216, + 240, + 270, + 288, + 300, + + /*RBs 54, 60, 64, 72 75, 80, 81, 90, 96, 100, (Bw 40Mhz) */ + 324, + 360, + 384, + 432, + 450, + 480, + 486, + 540, + 576, + 600, + + /*RBs 108, 120 125 128 135 144 150 160 162 180 192 200 */ + 648, + 720, + 750, + 768, + 810, + 864, + 900, + 960, + 972, + 1080, + 1152, + 1200, + + /*RBs 216 225 240 243 250 256 270 supported until 100Mhz */ + 1296, + 1350, + 1440, + 1458, + 1500, + 1536, + 1620 + +}; /* Table of largest prime number N_ZC < possible DMRS REs M_ZC, this array has values until 100Mhz According to 3GPP spec 38.211 section 5.2.2.1 Table used in calculating DMRS low papr type1 sequence for transform precoding */ -EXTERN const uint16_t dmrs_ref_ul_primes[MAX_INDEX_DMRS_UL_ALLOCATED_REs] -#ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -= { -/*DMRS REs 6, 12, 18, 24, 30, 36, 48, 54, 60, 72, 90, 96, */ - 5, 11, 17, 23, 29, 31, 47, 53, 59, 71, 89, 89, - -/*DMRS REs 108, 120, 144, 150, 162, 180, 192, 216, 240, 270, 288, 300, */ - 107, 113, 139, 149, 157, 179, 191, 211, 239, 269, 283, 293, - -/*DMRS REs 324, 360, 384, 432, 450, 480, 486, 540, 576, 600, */ - 317, 359, 383, 431, 449, 479, 479, 523, 571, 599, - -/*DMRS REs 648, 720, 750, 768, 810, 864, 900, 960, 972, 1080, 1152, 1200, */ - 647, 719, 743, 761, 809, 863, 887, 953, 971, 1069, 1151, 1193, - -/*DMRS REs 1296, 1350, 1440, 1458, 1500, 1536 1620 supported until 100Mhz */ - 1291, 1327, 1439, 1453, 1499, 1531, 1619 - - -} -#endif -; +static const uint16_t dmrs_ref_ul_primes[MAX_INDEX_DMRS_UL_ALLOCATED_REs] = { + /*DMRS REs 6, 12, 18, 24, 30, 36, 48, 54, 60, 72, 90, 96, */ + 5, + 11, + 17, + 23, + 29, + 31, + 47, + 53, + 59, + 71, + 89, + 89, + + /*DMRS REs 108, 120, 144, 150, 162, 180, 192, 216, 240, 270, 288, 300, */ + 107, + 113, + 139, + 149, + 157, + 179, + 191, + 211, + 239, + 269, + 283, + 293, + + /*DMRS REs 324, 360, 384, 432, 450, 480, 486, 540, 576, 600, */ + 317, + 359, + 383, + 431, + 449, + 479, + 479, + 523, + 571, + 599, + + /*DMRS REs 648, 720, 750, 768, 810, 864, 900, 960, 972, 1080, 1152, 1200, */ + 647, + 719, + 743, + 761, + 809, + 863, + 887, + 953, + 971, + 1069, + 1151, + 1193, + + /*DMRS REs 1296, 1350, 1440, 1458, 1500, 1536 1620 supported until 100Mhz */ + 1291, + 1327, + 1439, + 1453, + 1499, + 1531, + 1619 + +}; /// PUSCH DMRS for transform precoding -EXTERN int16_t *gNB_dmrs_lowpaprtype1_sequence[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; -EXTERN int16_t *dmrs_lowpaprtype1_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; +extern int16_t *gNB_dmrs_lowpaprtype1_sequence[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; +extern int16_t *dmrs_lowpaprtype1_ul_ref_sig[U_GROUP_NUMBER][V_BASE_SEQUENCE_NUMBER][MAX_INDEX_DMRS_UL_ALLOCATED_REs]; int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res); void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling); void free_gnb_lowpapr_sequences(void); - -#undef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H -#undef EXTERN - #endif /* SSS_NR_H */ diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c index f378830c23d..0578587e4e0 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c @@ -678,7 +678,7 @@ void nr_ulsch_qpsk_qpsk(c16_t *stream0_in, c16_t *stream1_in, c16_t *stream0_out _m_empty(); } -int16_t ones[8] __attribute__((aligned(16))) = {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; +static const int16_t ones[8] __attribute__((aligned(16))) = {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; // Calculates psi_a = psi_r * a_r + psi_i * a_i #define prodsum_psi_a_epi16(psi_r, a_r, psi_i, a_i, psi_a) \ @@ -3945,4 +3945,4 @@ void nr_ulsch_shift_llr(int16_t **llr_layers, uint32_t nb_re, uint32_t rxdataF_e llr_layers0[i] = simde_mm_srai_epi16(llr_layers0[i], shift); llr_layers1[i] = simde_mm_srai_epi16(llr_layers1[i], shift); } -} \ No newline at end of file +} diff --git a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.c b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.c index b2a7471d82b..0cc81d2a29f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.c @@ -36,9 +36,7 @@ #include "PHY/defs_nr_UE.h" -#define DEFINE_VARIABLES_CIC_FILTER_NR_H #include "PHY/NR_UE_TRANSPORT/cic_filter_nr.h" -#undef DEFINE_VARIABLES_CIC_FILTER_NR_H /******************************************************************* * @@ -223,7 +221,7 @@ void fir_filter_basic(int32_t *input, int32_t *output, int length, int taps_fir_ * *********************************************************************/ -void fir_filter(int32_t *input, int32_t *output, int length, int taps_fir_number, int *taps_fir, int scaling_shift) +void fir_filter(int32_t *input, int32_t *output, int length, int taps_fir_number, const int *taps_fir, int scaling_shift) { int32_t current; diff --git a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h index 74e02731ff2..67aab3a666c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/cic_filter_nr.h @@ -36,13 +36,6 @@ #include "PHY/defs_nr_UE.h" #include "PHY/types.h" -#ifdef DEFINE_VARIABLES_CIC_FILTER_NR_H -#define EXTERN -#define INIT_VARIABLES_CIC_FILTER_NR_H -#else -#define EXTERN extern -#endif - /************** DEFINE ********************************************/ #define M_DIFFERENTIAL_DELAY (1) @@ -53,50 +46,28 @@ #define FIR_TAPS_NUMBER (20) #define FIR_FITER_SCALING_ACC (14) -EXTERN double sharpened_fir_taps[FIR_TAPS_NUMBER] -#ifdef INIT_VARIABLES_CIC_FILTER_NR_H -= { -/* -cic filter and compensation FIR have been designed based on cic design tools provided at -http://www.tsdconseil.fr/tutos/index.html --->cfir = cic_comp_design(4,4,1,30720000,2,1650000,20); -R = 4.00, Fin = 30720000.00 Hz, Fout = 7680000.00 Hz. -Attenuation for f > fout/2 : -14.82 dB. -Attenuation at 1650000.00 Hz: -0.15 dB. -Attenuation max. between 0 et 1650000.00 Hz: -0.15 dB. -E.g. in linear scale : * 0.983 -Number of additionnal bits needed for implementation: 7. -Fout = 7680000.00 Hz. -index = 1026 / 4096. -Correction Fint ? -Filtre global : - --->cfir - cfir = -*/ - - 0.0059900, - - 0.0056191, - 0.0107582, - 0.0266043, - 0.0130358, - - 0.0331228, - - 0.0680440, - - 0.0278570, - 0.1106335, - 0.2897060, - 0.3607857, - 0.2607354, - 0.0983409, - - 0.0243749, - - 0.0583235, - - 0.0276023, - 0.0104286, - 0.0199533, - 0.0071721, - - 0.0028096, -} -#endif -; +static const double sharpened_fir_taps[FIR_TAPS_NUMBER] = { + /* + cic filter and compensation FIR have been designed based on cic design tools provided at + http://www.tsdconseil.fr/tutos/index.html + -->cfir = cic_comp_design(4,4,1,30720000,2,1650000,20); + R = 4.00, Fin = 30720000.00 Hz, Fout = 7680000.00 Hz. + Attenuation for f > fout/2 : -14.82 dB. + Attenuation at 1650000.00 Hz: -0.15 dB. + Attenuation max. between 0 et 1650000.00 Hz: -0.15 dB. + E.g. in linear scale : * 0.983 + Number of additionnal bits needed for implementation: 7. + Fout = 7680000.00 Hz. + index = 1026 / 4096. + Correction Fint ? + Filtre global : + + -->cfir + cfir = + */ + -0.0059900, -0.0056191, 0.0107582, 0.0266043, 0.0130358, -0.0331228, -0.0680440, -0.0278570, 0.1106335, 0.2897060, + 0.3607857, 0.2607354, 0.0983409, -0.0243749, -0.0583235, -0.0276023, 0.0104286, 0.0199533, 0.0071721, -0.0028096, +}; #define MAX_SAMPLEFILTER_TAP_NUM (100) #define FIR_SCALING_ACC (15) @@ -119,71 +90,10 @@ typedef struct { * 2 MHz 15 MHz 0 -20 dB */ -EXTERN int filter_taps[SAMPLEFILTER_TAP_NUM] -#ifdef INIT_VARIABLES_CIC_FILTER_NR_H -= { - -1572, - 65, - -132, - 197, - 26, - 393, - 194, - 536, - 250, - 514, - 105, - 279, - -234, - -105, - -646, - -466, - -924, - -583, - -856, - -279, - -321, - 492, - 639, - 1601, - 1812, - 2766, - 2872, - 3650, - 3503, - 3976, - 3503, - 3650, - 2872, - 2766, - 1812, - 1601, - 639, - 492, - -321, - -279, - -856, - -583, - -924, - -466, - -646, - -105, - -234, - 279, - 105, - 514, - 250, - 536, - 194, - 393, - 26, - 197, - -132, - 65, - -1572 -} -#endif -; +static const int filter_taps[SAMPLEFILTER_TAP_NUM] = { + -1572, 65, -132, 197, 26, 393, 194, 536, 250, 514, 105, 279, -234, -105, -646, -466, -924, -583, -856, -279, + -321, 492, 639, 1601, 1812, 2766, 2872, 3650, 3503, 3976, 3503, 3650, 2872, 2766, 1812, 1601, 639, 492, -321, -279, + -856, -583, -924, -466, -646, -105, -234, 279, 105, 514, 250, 536, 194, 393, 26, 197, -132, 65, -1572}; /************** FUNCTION ******************************************/ @@ -193,15 +103,12 @@ void comb_stage(int32_t *input, int32_t *output, int length, int differential_de void rate_change_stage(int32_t *input, int32_t *output, int length, int rate_change); -void fir_filter(int32_t *input, int32_t *output, int length, int taps_fir_number, int32_t *taps_fir, int scaling_shift); +void fir_filter(int32_t *input, int32_t *output, int length, int taps_fir_number, const int32_t *taps_fir, int scaling_shift); void cic_decimator(int16_t *input_buffer, int16_t *output_buffer, int length, int rate_change, int number_cic_stage, int set_scaling_factor, int fir_rate_change); void fir_decimator(int16_t *input_buffer, int16_t *output_buffer, int length, int rate_change, int scaling_factor); -#undef EXTERN -#undef INIT_VARIABLES_CIC_FILTER_NR_H - #endif /* CIC_FILTER_NR_H */ diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 00762afc34e..65491228c40 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -47,15 +47,14 @@ #include "assertions.h" #include "T.h" -char nr_dci_format_string[8][30] = { - "NR_DL_DCI_FORMAT_1_0", - "NR_DL_DCI_FORMAT_1_1", - "NR_DL_DCI_FORMAT_2_0", - "NR_DL_DCI_FORMAT_2_1", - "NR_DL_DCI_FORMAT_2_2", - "NR_DL_DCI_FORMAT_2_3", - "NR_UL_DCI_FORMAT_0_0", - "NR_UL_DCI_FORMAT_0_1"}; +static const char nr_dci_format_string[8][30] = {"NR_DL_DCI_FORMAT_1_0", + "NR_DL_DCI_FORMAT_1_1", + "NR_DL_DCI_FORMAT_2_0", + "NR_DL_DCI_FORMAT_2_1", + "NR_DL_DCI_FORMAT_2_2", + "NR_DL_DCI_FORMAT_2_3", + "NR_UL_DCI_FORMAT_0_0", + "NR_UL_DCI_FORMAT_0_1"}; //#define DEBUG_DCI_DECODING 1 diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c index 1058e23a6aa..3edea7a3c4d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -38,9 +38,7 @@ //#define DEBUG_LLR_SIC - -int16_t nr_zeros[8] __attribute__ ((aligned(16))) = {0,0,0,0,0,0,0,0}; -int16_t nr_ones[8] __attribute__ ((aligned(16))) = {0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff}; +int16_t nr_zeros[8] __attribute__((aligned(16))) = {0, 0, 0, 0, 0, 0, 0, 0}; #if defined(__x86_64__) || defined(__i386__) __m128i rho_rpi __attribute__ ((aligned(16))); __m128i rho_rmi __attribute__((aligned(16))); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index a03555f7721..fdd31058b87 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -196,9 +196,6 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini } -char duplex_string[2][4] = {"FDD","TDD"}; -char prefix_string[2][9] = {"NORMAL","EXTENDED"}; - int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, int n_frames, int sa) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 22fc2716c48..e89b0e5d1c6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -380,7 +380,8 @@ unsigned char sign(int8_t x) { } */ -uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11,12,13,1,4,3,14,15,16,17,2,26,18,19,20,21,22,6,23}; +const uint8_t pbch_deinterleaving_pattern[32] = {28, 0, 31, 30, 7, 29, 25, 27, 5, 8, 24, 9, 10, 11, 12, 13, + 1, 4, 3, 14, 15, 16, 17, 2, 26, 18, 19, 20, 21, 22, 6, 23}; int nr_rx_pbch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index a856be768ff..6d1b775f44e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -33,19 +33,13 @@ #include <stdio.h> #include <math.h> -#define DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H #include "PHY/impl_defs_nr.h" -#undef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H - #include "PHY/defs_nr_UE.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" -#define DEFINE_VARIABLES_SRS_MODULATION_NR_H #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" -#undef DEFINE_VARIABLES_SRS_MODULATION_NR_H - //#define SRS_DEBUG diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index b44914695ef..e8e24834747 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -35,15 +35,6 @@ #include "PHY/defs_nr_UE.h" -#ifdef DEFINE_VARIABLES_SRS_MODULATION_NR_H -#define EXTERN -#define INIT_VARIABLES_SRS_MODULATION_NR_H -#else -#define EXTERN extern -#undef INIT_VARIABLES_SRS_MODULATION_NR_H -#endif - - /************** DEFINE ********************************************/ #define C_SRS_NUMBER (64) @@ -52,93 +43,81 @@ /************** VARIABLES *****************************************/ /* TS 38.211 Table 6.4.1.4.3-1: SRS bandwidth configuration */ -EXTERN const unsigned short srs_bandwidth_config[C_SRS_NUMBER][B_SRS_NUMBER][2] -#ifdef INIT_VARIABLES_SRS_MODULATION_NR_H -= { -/* B_SRS = 0 B_SRS = 1 B_SRS = 2 B_SRS = 3 */ -/* C SRS m_srs0 N_0 m_srs1 N_1 m_srs2 N_2 m_srs3 N_3 */ -/* 0 */ { { 4, 1 },{ 4, 1 },{ 4, 1 },{ 4, 1 } }, -/* 1 */ { { 8, 1 },{ 4, 2 },{ 4, 1 },{ 4, 1 } }, -/* 2 */ { { 12, 1 },{ 4, 3 },{ 4, 1 },{ 4, 1 } }, -/* 3 */ { { 16, 1 },{ 4, 4 },{ 4, 1 },{ 4, 1 } }, -/* 4 */ { { 16, 1 },{ 8, 2 },{ 4, 2 },{ 4, 1 } }, -/* 5 */ { { 20, 1 },{ 4, 5 },{ 4, 1 },{ 4, 1 } }, -/* 6 */ { { 24, 1 },{ 4, 6 },{ 4, 1 },{ 4, 1 } }, -/* 7 */ { { 24, 1 },{ 12, 2 },{ 4, 3 },{ 4, 1 } }, -/* 8 */ { { 28, 1 },{ 4, 7 },{ 4, 1 },{ 4, 1 } }, -/* 9 */ { { 32, 1 },{ 16, 2 },{ 8, 2 },{ 4, 2 } }, -/* 10 */ { { 36, 1 },{ 12, 3 },{ 4, 3 },{ 4, 1 } }, -/* 11 */ { { 40, 1 },{ 20, 2 },{ 4, 5 },{ 4, 1 } }, -/* 12 */ { { 48, 1 },{ 16, 3 },{ 8, 2 },{ 4, 2 } }, -/* 13 */ { { 48, 1 },{ 24, 2 },{ 12, 2 },{ 4, 3 } }, -/* 14 */ { { 52, 1 },{ 4, 13 },{ 4, 1 },{ 4, 1 } }, -/* 15 */ { { 56, 1 },{ 28, 2 },{ 4, 7 },{ 4, 1 } }, -/* 16 */ { { 60, 1 },{ 20, 3 },{ 4, 5 },{ 4, 1 } }, -/* 17 */ { { 64, 1 },{ 32, 2 },{ 16, 2 },{ 4, 4 } }, -/* 18 */ { { 72, 1 },{ 24, 3 },{ 12, 2 },{ 4, 3 } }, -/* 19 */ { { 72, 1 },{ 36, 2 },{ 12, 3 },{ 4, 3 } }, -/* 20 */ { { 76, 1 },{ 4, 19 },{ 4, 1 },{ 4, 1 } }, -/* 21 */ { { 80, 1 },{ 40, 2 },{ 20, 2 },{ 4, 5 } }, -/* 22 */ { { 88, 1 },{ 44, 2 },{ 4, 11 },{ 4, 1 } }, -/* 23 */ { { 96, 1 },{ 32, 3 },{ 16, 2 },{ 4, 4 } }, -/* 24 */ { { 96, 1 },{ 48, 2 },{ 24, 2 },{ 4, 6 } }, -/* 25 */ { { 104, 1 },{ 52, 2 },{ 4, 13 },{ 4, 1 } }, -/* 26 */ { { 112, 1 },{ 56, 2 },{ 28, 2 },{ 4, 7 } }, -/* 27 */ { { 120, 1 },{ 60, 2 },{ 20, 3 },{ 4, 5 } }, -/* 28 */ { { 120, 1 },{ 40, 3 },{ 8, 5 },{ 4, 2 } }, -/* 29 */ { { 120, 1 },{ 24, 5 },{ 12, 2 },{ 4, 3 } }, -/* 30 */ { { 128, 1 },{ 64, 2 },{ 32, 2 },{ 4, 8 } }, -/* 31 */ { { 128, 1 },{ 64, 2 },{ 16, 4 },{ 4, 4 } }, -/* 32 */ { { 128, 1 },{ 16, 8 },{ 8, 2 },{ 4, 2 } }, -/* 33 */ { { 132, 1 },{ 44, 3 },{ 4, 11 },{ 4, 1 } }, -/* 34 */ { { 136, 1 },{ 68, 2 },{ 4, 17 },{ 4, 1 } }, -/* 35 */ { { 144, 1 },{ 72, 2 },{ 36, 2 },{ 4, 9 } }, -/* 36 */ { { 144, 1 },{ 48, 3 },{ 24, 2 },{ 12, 2 } }, -/* 37 */ { { 144, 1 },{ 48, 3 },{ 16, 3 },{ 4, 4 } }, -/* 38 */ { { 144, 1 },{ 16, 9 },{ 8, 2 },{ 4, 2 } }, -/* 39 */ { { 152, 1 },{ 76, 2 },{ 4, 19 },{ 4, 1 } }, -/* 40 */ { { 160, 1 },{ 80, 2 },{ 40, 2 },{ 4, 10 } }, -/* 41 */ { { 160, 1 },{ 80, 2 },{ 20, 4 },{ 4, 5 } }, -/* 42 */ { { 160, 1 },{ 32, 5 },{ 16, 2 },{ 4, 4 } }, -/* 43 */ { { 168, 1 },{ 84, 2 },{ 28, 3 },{ 4, 7 } }, -/* 44 */ { { 176, 1 },{ 88, 2 },{ 44, 2 },{ 4, 11 } }, -/* 45 */ { { 184, 1 },{ 92, 2 },{ 4, 23 },{ 4, 1 } }, -/* 46 */ { { 192, 1 },{ 96, 2 },{ 48, 2 },{ 4, 12 } }, -/* 47 */ { { 192, 1 },{ 96, 2 },{ 24, 4 },{ 4, 6 } }, -/* 48 */ { { 192, 1 },{ 64, 3 },{ 16, 4 },{ 4, 4 } }, -/* 49 */ { { 192, 1 },{ 24, 8 },{ 8, 3 },{ 4, 2 } }, -/* 50 */ { { 208, 1 },{ 104, 2 },{ 52, 2 },{ 4, 13 } }, -/* 51 */ { { 216, 1 },{ 108, 2 },{ 36, 3 },{ 4, 9 } }, -/* 52 */ { { 224, 1 },{ 112, 2 },{ 56, 2 },{ 4, 14 } }, -/* 53 */ { { 240, 1 },{ 120, 2 },{ 60, 2 },{ 4, 15 } }, -/* 54 */ { { 240, 1 },{ 80, 3 },{ 20, 4 },{ 4, 5 } }, -/* 55 */ { { 240, 1 },{ 48, 5 },{ 16, 3 },{ 8, 2 } }, -/* 56 */ { { 240, 1 },{ 24, 10 },{ 12, 2 },{ 4, 3 } }, -/* 57 */ { { 256, 1 },{ 128, 2 },{ 64, 2 },{ 4, 16 } }, -/* 58 */ { { 256, 1 },{ 128, 2 },{ 32, 4 },{ 4, 8 } }, -/* 59 */ { { 256, 1 },{ 16, 16 },{ 8, 2 },{ 4, 2 } }, -/* 60 */ { { 264, 1 },{ 132, 2 },{ 44, 3 },{ 4, 11 } }, -/* 61 */ { { 272, 1 },{ 136, 2 },{ 68, 2 },{ 4, 17 } }, -/* 62 */ { { 272, 1 },{ 68, 4 },{ 4, 17 },{ 4, 1 } }, -/* 63 */ { { 272, 1 },{ 16, 17 },{ 8, 2 },{ 4, 2 } }, -} -#endif -; +static const unsigned short srs_bandwidth_config[C_SRS_NUMBER][B_SRS_NUMBER][2] = { + /* B_SRS = 0 B_SRS = 1 B_SRS = 2 B_SRS = 3 */ + /* C SRS m_srs0 N_0 m_srs1 N_1 m_srs2 N_2 m_srs3 N_3 */ + /* 0 */ {{4, 1}, {4, 1}, {4, 1}, {4, 1}}, + /* 1 */ {{8, 1}, {4, 2}, {4, 1}, {4, 1}}, + /* 2 */ {{12, 1}, {4, 3}, {4, 1}, {4, 1}}, + /* 3 */ {{16, 1}, {4, 4}, {4, 1}, {4, 1}}, + /* 4 */ {{16, 1}, {8, 2}, {4, 2}, {4, 1}}, + /* 5 */ {{20, 1}, {4, 5}, {4, 1}, {4, 1}}, + /* 6 */ {{24, 1}, {4, 6}, {4, 1}, {4, 1}}, + /* 7 */ {{24, 1}, {12, 2}, {4, 3}, {4, 1}}, + /* 8 */ {{28, 1}, {4, 7}, {4, 1}, {4, 1}}, + /* 9 */ {{32, 1}, {16, 2}, {8, 2}, {4, 2}}, + /* 10 */ {{36, 1}, {12, 3}, {4, 3}, {4, 1}}, + /* 11 */ {{40, 1}, {20, 2}, {4, 5}, {4, 1}}, + /* 12 */ {{48, 1}, {16, 3}, {8, 2}, {4, 2}}, + /* 13 */ {{48, 1}, {24, 2}, {12, 2}, {4, 3}}, + /* 14 */ {{52, 1}, {4, 13}, {4, 1}, {4, 1}}, + /* 15 */ {{56, 1}, {28, 2}, {4, 7}, {4, 1}}, + /* 16 */ {{60, 1}, {20, 3}, {4, 5}, {4, 1}}, + /* 17 */ {{64, 1}, {32, 2}, {16, 2}, {4, 4}}, + /* 18 */ {{72, 1}, {24, 3}, {12, 2}, {4, 3}}, + /* 19 */ {{72, 1}, {36, 2}, {12, 3}, {4, 3}}, + /* 20 */ {{76, 1}, {4, 19}, {4, 1}, {4, 1}}, + /* 21 */ {{80, 1}, {40, 2}, {20, 2}, {4, 5}}, + /* 22 */ {{88, 1}, {44, 2}, {4, 11}, {4, 1}}, + /* 23 */ {{96, 1}, {32, 3}, {16, 2}, {4, 4}}, + /* 24 */ {{96, 1}, {48, 2}, {24, 2}, {4, 6}}, + /* 25 */ {{104, 1}, {52, 2}, {4, 13}, {4, 1}}, + /* 26 */ {{112, 1}, {56, 2}, {28, 2}, {4, 7}}, + /* 27 */ {{120, 1}, {60, 2}, {20, 3}, {4, 5}}, + /* 28 */ {{120, 1}, {40, 3}, {8, 5}, {4, 2}}, + /* 29 */ {{120, 1}, {24, 5}, {12, 2}, {4, 3}}, + /* 30 */ {{128, 1}, {64, 2}, {32, 2}, {4, 8}}, + /* 31 */ {{128, 1}, {64, 2}, {16, 4}, {4, 4}}, + /* 32 */ {{128, 1}, {16, 8}, {8, 2}, {4, 2}}, + /* 33 */ {{132, 1}, {44, 3}, {4, 11}, {4, 1}}, + /* 34 */ {{136, 1}, {68, 2}, {4, 17}, {4, 1}}, + /* 35 */ {{144, 1}, {72, 2}, {36, 2}, {4, 9}}, + /* 36 */ {{144, 1}, {48, 3}, {24, 2}, {12, 2}}, + /* 37 */ {{144, 1}, {48, 3}, {16, 3}, {4, 4}}, + /* 38 */ {{144, 1}, {16, 9}, {8, 2}, {4, 2}}, + /* 39 */ {{152, 1}, {76, 2}, {4, 19}, {4, 1}}, + /* 40 */ {{160, 1}, {80, 2}, {40, 2}, {4, 10}}, + /* 41 */ {{160, 1}, {80, 2}, {20, 4}, {4, 5}}, + /* 42 */ {{160, 1}, {32, 5}, {16, 2}, {4, 4}}, + /* 43 */ {{168, 1}, {84, 2}, {28, 3}, {4, 7}}, + /* 44 */ {{176, 1}, {88, 2}, {44, 2}, {4, 11}}, + /* 45 */ {{184, 1}, {92, 2}, {4, 23}, {4, 1}}, + /* 46 */ {{192, 1}, {96, 2}, {48, 2}, {4, 12}}, + /* 47 */ {{192, 1}, {96, 2}, {24, 4}, {4, 6}}, + /* 48 */ {{192, 1}, {64, 3}, {16, 4}, {4, 4}}, + /* 49 */ {{192, 1}, {24, 8}, {8, 3}, {4, 2}}, + /* 50 */ {{208, 1}, {104, 2}, {52, 2}, {4, 13}}, + /* 51 */ {{216, 1}, {108, 2}, {36, 3}, {4, 9}}, + /* 52 */ {{224, 1}, {112, 2}, {56, 2}, {4, 14}}, + /* 53 */ {{240, 1}, {120, 2}, {60, 2}, {4, 15}}, + /* 54 */ {{240, 1}, {80, 3}, {20, 4}, {4, 5}}, + /* 55 */ {{240, 1}, {48, 5}, {16, 3}, {8, 2}}, + /* 56 */ {{240, 1}, {24, 10}, {12, 2}, {4, 3}}, + /* 57 */ {{256, 1}, {128, 2}, {64, 2}, {4, 16}}, + /* 58 */ {{256, 1}, {128, 2}, {32, 4}, {4, 8}}, + /* 59 */ {{256, 1}, {16, 16}, {8, 2}, {4, 2}}, + /* 60 */ {{264, 1}, {132, 2}, {44, 3}, {4, 11}}, + /* 61 */ {{272, 1}, {136, 2}, {68, 2}, {4, 17}}, + /* 62 */ {{272, 1}, {68, 4}, {4, 17}, {4, 1}}, + /* 63 */ {{272, 1}, {16, 17}, {8, 2}, {4, 2}}, +}; #define SRS_PERIODICITY (17) -EXTERN const uint16_t srs_periodicity[SRS_PERIODICITY] -#ifdef INIT_VARIABLES_SRS_MODULATION_NR_H -= { 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560} -#endif -; +static const uint16_t srs_periodicity[SRS_PERIODICITY] = {1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560}; // TS 38.211 - Table 6.4.1.4.2-1 -EXTERN const uint16_t srs_max_number_cs[3] -#ifdef INIT_VARIABLES_SRS_MODULATION_NR_H - = {8, 12, 6} -#endif -; +static const uint16_t srs_max_number_cs[3] = {8, 12, 6}; /*************** FUNCTIONS *****************************************/ @@ -179,7 +158,4 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, c16_t **txdataF); -#undef EXTERN -#undef INIT_VARIABLES_SRS_MODULATION_NR_H - #endif /* SRS_MODULATION_NR_H */ diff --git a/openair1/PHY/TOOLS/dfts_load.c b/openair1/PHY/TOOLS/dfts_load.c index d758f46a433..f83624fcf43 100644 --- a/openair1/PHY/TOOLS/dfts_load.c +++ b/openair1/PHY/TOOLS/dfts_load.c @@ -43,8 +43,7 @@ /* function description array, to be used when loading the dfts/idfts lib */ static loader_shlibfunc_t shlib_fdesc[2]; -static char *arg[64]={"phytest","-O","cmdlineonly::dbgl0"}; - +static char *const arg[64] = {"phytest", "-O", "cmdlineonly::dbgl0"}; int load_dftslib(void) { diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c index 8a83e530ab8..47318550bec 100644 --- a/openair1/PHY/TOOLS/oai_dfts.c +++ b/openair1/PHY/TOOLS/oai_dfts.c @@ -5407,11 +5407,11 @@ void idft98304(int16_t *input, int16_t *output,uint8_t scale) { /// THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d) /// They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output) -static int16_t W1_12s[8]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383}; -static int16_t W2_12s[8]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377}; -static int16_t W3_12s[8]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767}; -static int16_t W4_12s[8]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; -static int16_t W6_12s[8]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0}; +static int16_t const W1_12s[8] __attribute__((aligned(32))) = {28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383}; +static int16_t const W2_12s[8] __attribute__((aligned(32))) = {16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377}; +static int16_t const W3_12s[8] __attribute__((aligned(32))) = {0, -32767, 0, -32767, 0, -32767, 0, -32767}; +static int16_t const W4_12s[8] __attribute__((aligned(32))) = {-16383, -28377, -16383, -28377, -16383, -28377, -16383, -28377}; +static int16_t const W6_12s[8] __attribute__((aligned(32))) = {-32767, 0, -32767, 0, -32767, 0, -32767, 0}; simd_q15_t *W1_12=(simd_q15_t *)W1_12s; simd_q15_t *W2_12=(simd_q15_t *)W2_12s; @@ -5587,11 +5587,30 @@ void dft12(int16_t *x,int16_t *y ,unsigned char scale_flag) } -static int16_t W1_12s_256[16]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383}; -static int16_t W2_12s_256[16]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377}; -static int16_t W3_12s_256[16]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767}; -static int16_t W4_12s_256[16]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377}; -static int16_t W6_12s_256[16]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0}; +static const int16_t W1_12s_256[16] __attribute__((aligned(32))) = + {28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383, 28377, -16383}; +static const int16_t W2_12s_256[16] __attribute__((aligned(32))) = + {16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377, 16383, -28377}; +static const int16_t W3_12s_256[16] + __attribute__((aligned(32))) = {0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767}; +static const int16_t W4_12s_256[16] __attribute__((aligned(32))) = {-16383, + -28377, + -16383, + -28377, + -16383, + -28377, + -16383, + -28377, + -16383, + -28377, + -16383, + -28377, + -16383, + -28377, + -16383, + -28377}; +static const int16_t W6_12s_256[16] + __attribute__((aligned(32))) = {-32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0, -32767, 0}; simd256_q15_t *W1_12_256=(simd256_q15_t *)W1_12s_256; simd256_q15_t *W2_12_256=(simd256_q15_t *)W2_12s_256; diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 9c5b58f851b..5300ebd622f 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -655,17 +655,13 @@ typedef enum idft_size_idx { struct { adftfunc_t func; int size; -} dft_ftab[]= { - FOREACH_DFTSZ(SZ_PTR) -}; +} const dft_ftab[] = {FOREACH_DFTSZ(SZ_PTR)}; #define SZ_iPTR(Sz) {idft ## Sz,Sz}, struct { adftfunc_t func; int size; -} idft_ftab[]= { - FOREACH_IDFTSZ(SZ_iPTR) -}; +} const idft_ftab[] = {FOREACH_IDFTSZ(SZ_iPTR)}; #endif diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h index 316446bf7ac..005e186c308 100644 --- a/openair1/PHY/impl_defs_nr.h +++ b/openair1/PHY/impl_defs_nr.h @@ -37,14 +37,6 @@ #include <stdbool.h> #include "types.h" -#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H -#define EXTERN -#define INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H -#else -#define EXTERN extern -#undef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H -#endif - #ifdef PHY_DBG_DEV_TST #define PHY_DBG_DEV_TST_PRINTF(...) printf(__VA_ARGS__) #else @@ -60,12 +52,7 @@ /* TS 38.211 Table 4.3.2-1: Number of OFDM symbols per slot, slots per frame, and slots per subframe for normal cyclic prefix */ #define MU_NUMBER (5) -EXTERN const uint8_t N_slot_subframe[MU_NUMBER] -#ifdef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H -= { 1, 2, 4, 8, 16} -#endif -; - +static const uint8_t N_slot_subframe[MU_NUMBER] = {1, 2, 4, 8, 16}; #define NB_DL_DATA_TO_UL_ACK (8) /* size of table TS 38.213 Table 9.2.3-1 */ @@ -173,11 +160,7 @@ typedef struct TDD_UL_DL_SlotConfig_s { * ************************************************************************/ -EXTERN const int16_t SRS_antenna_port[MAX_NROFSRS_PORTS] -#ifdef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H -= { 1000, 1001, 1002, 1003 } -#endif -; +static const int16_t SRS_antenna_port[MAX_NROFSRS_PORTS] = {1000, 1001, 1002, 1003}; typedef enum { port1 = 1, @@ -582,7 +565,4 @@ typedef struct { SchedulingRequestResourceConfig_t *sr_ResourceConfig[MAX_NR_OF_SR_CONFIG_PER_CELL_GROUP]; } scheduling_request_config_t; - -#undef EXTERN -#undef INIT_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H #endif /* PHY_IMPL_DEFS_NR_H */ diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h index 679fd34a498..b83800df86b 100644 --- a/openair1/PHY/impl_defs_top.h +++ b/openair1/PHY/impl_defs_top.h @@ -270,13 +270,10 @@ /* FFS_NR_TODO it defines ue capability which is the number of slots */ /* - between reception of pdsch and tarnsmission of its acknowlegment */ /* - between reception of un uplink grant and its related transmission */ +// should be 2 as per NR standard, but current UE is not able to perform this value #define NR_UE_CAPABILITY_SLOT_RX_TO_TX (3) -#ifndef NO_RAT_NR - #define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */ -#else - #define DURATION_RX_TO_TX (6) /* For LTE, this duration is fixed to 4 and it is linked to LTE standard for both modes FDD/TDD */ -#endif +#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) #define NR_MAX_ULSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 6.1 UE procedure for receiving the physical uplink shared channel */ #define NR_MAX_DLSCH_HARQ_PROCESSES (NR_MAX_HARQ_PROCESSES) /* cf 38.214 5.1 UE procedure for receiving the physical downlink shared channel */ diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h index c084f123b4b..8584bf351e3 100644 --- a/openair1/PHY/phy_extern.h +++ b/openair1/PHY/phy_extern.h @@ -177,7 +177,7 @@ static const uint16_t beta_ack[16] = {16, // 2.000 400, // 50.000 640, // 80.000 808}; // 126.00 - +// TS 36.211 5.3 scrambling static const int8_t delta_PUSCH_abs[4] = {-4, -1, 1, 4}; static const int8_t delta_PUSCH_acc[4] = {-1, 0, 1, 3}; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index cd1bdf629ee..5ce9b7e39b5 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -47,8 +47,6 @@ //#define DEBUG_RXDATA //#define SRS_IND_DEBUG -uint8_t SSB_Table[38]={0,2,4,6,8,10,12,14,254,254,16,18,20,22,24,26,28,30,254,254,32,34,36,38,40,42,44,46,254,254,48,50,52,54,56,58,60,62}; - extern uint8_t nfapi_mode; void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) { diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index e2071f059f5..33d550e130b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -44,8 +44,8 @@ extern PHY_VARS_NR_UE ***PHY_vars_UE_g; -const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH", "CSI_RS", "CSI_IM", "TA"}; -const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"}; +const char *const dl_pdu_type[] = {"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH", "CSI_RS", "CSI_IM", "TA"}; +const char *const ul_pdu_type[] = {"PRACH", "PUCCH", "PUSCH", "SRS"}; queue_t nr_rx_ind_queue; queue_t nr_crc_ind_queue; queue_t nr_uci_ind_queue; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 3c5c7e250a5..e53a788ffab 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -74,7 +74,9 @@ fifo_dump_emos_UE emos_dump_UE; #include "intertask_interface.h" #include "T.h" -unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162}; +static const unsigned int gain_table[31] = {100, 112, 126, 141, 158, 178, 200, 224, 251, 282, 316, + 359, 398, 447, 501, 562, 631, 708, 794, 891, 1000, 1122, + 1258, 1412, 1585, 1778, 1995, 2239, 2512, 2818, 3162}; void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, fapi_nr_dci_indication_t *dci_ind, diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 2023d7dec30..3f99a22b71b 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -41,18 +41,10 @@ #include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h" #include <openair1/PHY/impl_defs_nr.h> #include <common/utils/nr/nr_common.h> - -#ifndef NO_RAT_NR - #include "SCHED_NR_UE/defs.h" #include "SCHED_NR_UE/harq_nr.h" -#define DEFINE_VARIABLES_PUCCH_UE_NR_H #include "SCHED_NR_UE/pucch_uci_ue_nr.h" -#undef DEFINE_VARIABLES_PUCCH_UE_NR_H - -#endif - long binary_search_float_nr( diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h index c3fa990eebd..e4063fbd781 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h @@ -42,14 +42,6 @@ #include "PHY/defs_nr_UE.h" -#ifdef DEFINE_VARIABLES_PUCCH_UE_NR_H -#define EXTERN -#define INIT_VARIABLES_PUCCH_UE_NR_H -#else -#define EXTERN extern -#undef INIT_VARIABLES_PUCCH_UE_NR_H -#endif - /************** DEFINE ********************************************/ #define BITS_PER_SYMBOL_BPSK (1) /* 1 bit per symbol for bpsk modulation */ diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index c8c83e86bc1..61429afc9e7 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -2586,13 +2586,9 @@ int ue_pdcch_procedures(uint8_t eNB_id, ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id], ue->pdcch_vars[0%RX_NB_TH][eNB_id]->crnti_is_temporary? ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti: 0)==0)) { // update TPC for PUCCH - if((dci_alloc_rx[i].format == format1) || - (dci_alloc_rx[i].format == format1A) || - (dci_alloc_rx[i].format == format1B) || - (dci_alloc_rx[i].format == format2) || - (dci_alloc_rx[i].format == format2A) || - (dci_alloc_rx[i].format == format2B)) { - //ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->g_pucch += ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid]->delta_PUCCH; + if ((dci_alloc_rx[i].format == format1) || (dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1B) + || (dci_alloc_rx[i].format == format2) || (dci_alloc_rx[i].format == format2A) + || (dci_alloc_rx[i].format == format2B)) { int32_t delta_pucch = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid]->delta_PUCCH; for(int th_id=0; th_id<RX_NB_TH; th_id++) { diff --git a/openair1/SIMULATION/TOOLS/scm_corrmat.h b/openair1/SIMULATION/TOOLS/scm_corrmat.h index 6cb77b5796e..169998f44b9 100644 --- a/openair1/SIMULATION/TOOLS/scm_corrmat.h +++ b/openair1/SIMULATION/TOOLS/scm_corrmat.h @@ -19,29 +19,41 @@ * contact@openairinterface.org */ -static double R22_sqrt[6][32] = { - {0.921700, -0.000000, 0.010380, -0.027448, -0.250153, 0.294754, 0.005961, 0.010769, 0.010380, 0.027448, 0.921700, 0.000000, -0.011595, -0.004130, -0.250153, 0.294754, -0.250153, -0.294754, -0.011595, 0.004130, 0.921700, 0.000000, 0.010380, -0.027448, 0.005961, -0.010769, -0.250153, -0.294754, 0.010380, 0.027448, 0.921700, 0.000000}, - {0.923810, 0.000000, 0.004069, 0.027832, 0.151730, 0.350180, -0.009882, 0.006114, 0.004069, -0.027832, 0.923810, 0.000000, 0.011218, -0.003029, 0.151730, 0.350180, 0.151730, -0.350180, 0.011218, 0.003029, 0.923810, -0.000000, 0.004069, 0.027832, -0.009882, -0.006114, 0.151730, -0.350180, 0.004069, -0.027832, 0.923810, 0.000000}, - {0.927613, 0.000000, 0.014253, 0.025767, -0.061171, -0.367133, 0.009258, -0.007340, 0.014253, -0.025767, 0.927613, -0.000000, -0.011138, -0.003942, -0.061171, -0.367133, -0.061171, 0.367133, -0.011138, 0.003942, 0.927613, 0.000000, 0.014253, 0.025767, 0.009258, 0.007340, -0.061171, 0.367133, 0.014253, -0.025767, 0.927613, 0.000000}, - {0.869794, -0.000000, -0.010613, -0.001218, 0.399115, 0.289852, -0.004464, -0.004096, -0.010613, 0.001218, 0.869794, -0.000000, -0.005276, -0.002978, 0.399115, 0.289852, 0.399115, -0.289852, -0.005276, 0.002978, 0.869794, -0.000000, -0.010613, -0.001218, -0.004464, 0.004096, 0.399115, -0.289852, -0.010613, 0.001218, 0.869794, 0.000000}, - {0.919726, -0.000000, 0.038700, -0.111146, 0.217804, 0.300925, 0.045531, -0.013659, 0.038700, 0.111146, 0.919726, 0.000000, -0.027201, 0.038983, 0.217804, 0.300925, 0.217804, -0.300925, -0.027201, -0.038983, 0.919726, 0.000000, 0.038700, -0.111146, 0.045531, 0.013659, 0.217804, -0.300925, 0.038700, 0.111146, 0.919726, 0.000000}, - {0.867608, -0.000000, 0.194097, -0.112414, -0.418811, 0.095938, -0.081264, 0.075727, 0.194097, 0.112414, 0.867608, -0.000000, -0.106125, -0.032801, -0.418811, 0.095938, -0.418811, -0.095938, -0.106125, 0.032801, 0.867608, 0.000000, 0.194097, -0.112414, -0.081264, -0.075727, -0.418811, -0.095938, 0.194097, 0.112414, 0.867608, 0.000000}, +static const double R22_sqrt[6][32] = { + {0.921700, -0.000000, 0.010380, -0.027448, -0.250153, 0.294754, 0.005961, 0.010769, 0.010380, 0.027448, 0.921700, + 0.000000, -0.011595, -0.004130, -0.250153, 0.294754, -0.250153, -0.294754, -0.011595, 0.004130, 0.921700, 0.000000, + 0.010380, -0.027448, 0.005961, -0.010769, -0.250153, -0.294754, 0.010380, 0.027448, 0.921700, 0.000000}, + {0.923810, 0.000000, 0.004069, 0.027832, 0.151730, 0.350180, -0.009882, 0.006114, 0.004069, -0.027832, 0.923810, + 0.000000, 0.011218, -0.003029, 0.151730, 0.350180, 0.151730, -0.350180, 0.011218, 0.003029, 0.923810, -0.000000, + 0.004069, 0.027832, -0.009882, -0.006114, 0.151730, -0.350180, 0.004069, -0.027832, 0.923810, 0.000000}, + {0.927613, 0.000000, 0.014253, 0.025767, -0.061171, -0.367133, 0.009258, -0.007340, 0.014253, -0.025767, 0.927613, + -0.000000, -0.011138, -0.003942, -0.061171, -0.367133, -0.061171, 0.367133, -0.011138, 0.003942, 0.927613, 0.000000, + 0.014253, 0.025767, 0.009258, 0.007340, -0.061171, 0.367133, 0.014253, -0.025767, 0.927613, 0.000000}, + {0.869794, -0.000000, -0.010613, -0.001218, 0.399115, 0.289852, -0.004464, -0.004096, -0.010613, 0.001218, 0.869794, + -0.000000, -0.005276, -0.002978, 0.399115, 0.289852, 0.399115, -0.289852, -0.005276, 0.002978, 0.869794, -0.000000, + -0.010613, -0.001218, -0.004464, 0.004096, 0.399115, -0.289852, -0.010613, 0.001218, 0.869794, 0.000000}, + {0.919726, -0.000000, 0.038700, -0.111146, 0.217804, 0.300925, 0.045531, -0.013659, 0.038700, 0.111146, 0.919726, + 0.000000, -0.027201, 0.038983, 0.217804, 0.300925, 0.217804, -0.300925, -0.027201, -0.038983, 0.919726, 0.000000, + 0.038700, -0.111146, 0.045531, 0.013659, 0.217804, -0.300925, 0.038700, 0.111146, 0.919726, 0.000000}, + {0.867608, -0.000000, 0.194097, -0.112414, -0.418811, 0.095938, -0.081264, 0.075727, 0.194097, 0.112414, 0.867608, + -0.000000, -0.106125, -0.032801, -0.418811, 0.095938, -0.418811, -0.095938, -0.106125, 0.032801, 0.867608, 0.000000, + 0.194097, -0.112414, -0.081264, -0.075727, -0.418811, -0.095938, 0.194097, 0.112414, 0.867608, 0.000000}, }; -static double R21_sqrt[6][8] = { - {0.922167, 0.000000,-0.250280, 0.294903,-0.250280, -0.294903,0.922167, 0.000000}, - {0.924238, 0.000000,0.151801, 0.350342,0.151801, -0.350342,0.924238, 0.000000}, - {0.928080, 0.000000,-0.061202, -0.367318,-0.061202, 0.367318,0.928080, 0.000000}, - {0.869860, 0.000000,0.399145, 0.289874,0.399145, -0.289874,0.869860, 0.000000}, - {0.927225, 0.000000,0.219580, 0.303378,0.219580, -0.303378,0.927225, 0.000000}, - {0.896133, 0.000000,-0.432581, 0.099092,-0.432581, -0.099092,0.896133, 0.000000}, +static const double R21_sqrt[6][8] = { + {0.922167, 0.000000, -0.250280, 0.294903, -0.250280, -0.294903, 0.922167, 0.000000}, + {0.924238, 0.000000, 0.151801, 0.350342, 0.151801, -0.350342, 0.924238, 0.000000}, + {0.928080, 0.000000, -0.061202, -0.367318, -0.061202, 0.367318, 0.928080, 0.000000}, + {0.869860, 0.000000, 0.399145, 0.289874, 0.399145, -0.289874, 0.869860, 0.000000}, + {0.927225, 0.000000, 0.219580, 0.303378, 0.219580, -0.303378, 0.927225, 0.000000}, + {0.896133, 0.000000, -0.432581, 0.099092, -0.432581, -0.099092, 0.896133, 0.000000}, }; -static double R12_sqrt[6][8] = { - {0.999494, 0.000000,0.011256, -0.029765,0.011256, 0.029765,0.999494, 0.000000}, - {0.999537, 0.000000,0.004402, 0.030114,0.004402, -0.030114,0.999537, 0.000000}, - {0.999497, 0.000000,0.015358, 0.027764,0.015358, -0.027764,0.999497, 0.000000}, - {0.999925, -0.000000,-0.012201, -0.001400,-0.012201, 0.001400,0.999925, 0.000000}, - {0.991912, 0.000000,0.041738, -0.119870,0.041738, 0.119870,0.991912, 0.000000}, - {0.968169, 0.000000,0.216594, -0.125443,0.216594, 0.125443,0.968169, 0.000000}, +static const double R12_sqrt[6][8] = { + {0.999494, 0.000000, 0.011256, -0.029765, 0.011256, 0.029765, 0.999494, 0.000000}, + {0.999537, 0.000000, 0.004402, 0.030114, 0.004402, -0.030114, 0.999537, 0.000000}, + {0.999497, 0.000000, 0.015358, 0.027764, 0.015358, -0.027764, 0.999497, 0.000000}, + {0.999925, -0.000000, -0.012201, -0.001400, -0.012201, 0.001400, 0.999925, 0.000000}, + {0.991912, 0.000000, 0.041738, -0.119870, 0.041738, 0.119870, 0.991912, 0.000000}, + {0.968169, 0.000000, 0.216594, -0.125443, 0.216594, 0.125443, 0.968169, 0.000000}, }; // TS 38.104 - Table G.2.3.1.2-2: MIMO correlation matrices for high correlation diff --git a/openair2/E1AP/e1ap.c b/openair2/E1AP/e1ap.c index 27eb9f58480..4ad4ea8415e 100644 --- a/openair2/E1AP/e1ap.c +++ b/openair2/E1AP/e1ap.c @@ -36,25 +36,28 @@ #define E1AP_NUM_MSG_HANDLERS 14 typedef int (*e1ap_message_processing_t)(e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *message_p); -e1ap_message_processing_t e1ap_message_processing[E1AP_NUM_MSG_HANDLERS][3] = { - - { 0, 0, 0 }, /* Reset */ - { 0, 0, 0 }, /* ErrorIndication */ - { 0, 0, 0 }, /* privateMessage */ - { e1apCUCP_handle_SETUP_REQUEST, e1apCUUP_handle_SETUP_RESPONSE, e1apCUUP_handle_SETUP_FAILURE }, /* gNBCUUPE1Setup */ - { 0, 0, 0 }, /* gNBCUCPE1Setup */ - { 0, 0, 0 }, /* gNBCUUPConfigurationUpdate */ - { 0, 0, 0 }, /* gNBCUCPConfigurationUpdate */ - { 0, 0, 0 }, /* E1Release */ - { e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST, e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE, e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE }, /* bearerContextSetup */ - { e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_REQUEST, 0, 0 }, /* bearerContextModification */ - { 0, 0, 0 }, /* bearerContextModificationRequired */ - { e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND, e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE, 0 }, /* bearerContextRelease */ - { 0, 0, 0 }, /* bearerContextReleaseRequired */ - { 0, 0, 0 } /* bearerContextInactivityNotification */ +const e1ap_message_processing_t e1ap_message_processing[E1AP_NUM_MSG_HANDLERS][3] = { + + {0, 0, 0}, /* Reset */ + {0, 0, 0}, /* ErrorIndication */ + {0, 0, 0}, /* privateMessage */ + {e1apCUCP_handle_SETUP_REQUEST, e1apCUUP_handle_SETUP_RESPONSE, e1apCUUP_handle_SETUP_FAILURE}, /* gNBCUUPE1Setup */ + {0, 0, 0}, /* gNBCUCPE1Setup */ + {0, 0, 0}, /* gNBCUUPConfigurationUpdate */ + {0, 0, 0}, /* gNBCUCPConfigurationUpdate */ + {0, 0, 0}, /* E1Release */ + {e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST, + e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE, + e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE}, /* bearerContextSetup */ + {e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_REQUEST, 0, 0}, /* bearerContextModification */ + {0, 0, 0}, /* bearerContextModificationRequired */ + {e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND, e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE, 0}, /* bearerContextRelease */ + {0, 0, 0}, /* bearerContextReleaseRequired */ + {0, 0, 0} /* bearerContextInactivityNotification */ }; -const char *e1ap_direction2String(int e1ap_dir) { +const char *const e1ap_direction2String(int e1ap_dir) +{ static const char *e1ap_direction_String[] = { "", /* Nothing */ "Initiating message", /* initiating message */ diff --git a/openair2/F1AP/f1ap_handlers.c b/openair2/F1AP/f1ap_handlers.c index 8b6cc38fecf..3eb4b1d86d1 100644 --- a/openair2/F1AP/f1ap_handlers.c +++ b/openair2/F1AP/f1ap_handlers.c @@ -71,11 +71,11 @@ static const f1ap_message_processing_t f1ap_messages_processing[][3] = { }; const char *f1ap_direction2String(int f1ap_dir) { - static const char *f1ap_direction_String[] = { - "", /* Nothing */ - "Initiating message", /* initiating message */ - "Successfull outcome", /* successfull outcome */ - "UnSuccessfull outcome", /* successfull outcome */ + static const char *const f1ap_direction_String[] = { + "", /* Nothing */ + "Initiating message", /* initiating message */ + "Successfull outcome", /* successfull outcome */ + "UnSuccessfull outcome", /* successfull outcome */ }; return(f1ap_direction_String[f1ap_dir]); } diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 528c979595c..d23dc23ebf0 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -225,7 +225,7 @@ int32_t get_uldl_offset(int eutra_bandP) { return (eutra_bandtable[i].dl_min - eutra_bandtable[i].ul_min); } -uint32_t bw_table[6] = {6*180,15*180,25*180,50*180,75*180,100*180}; +const int32_t bw_table[6] = {6 * 180, 15 * 180, 25 * 180, 50 * 180, 75 * 180, 100 * 180}; void config_mib(int Mod_idP, int CC_idP, @@ -333,7 +333,7 @@ void config_sib1(int Mod_idP, int CC_idP, LTE_TDD_Config_t *tdd_ConfigP) { } } -int power_off_dB[6] = { 78, 118, 140, 170, 188, 200 }; +const int power_off_dB[6] = {78, 118, 140, 170, 188, 200}; void config_sib2(int Mod_idP, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 40eeacfaec2..dadd019241c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -1353,7 +1353,22 @@ initiate_ra_proc(module_id_t module_idP, do { if (IS_SOFTMODEM_IQPLAYER) { /* iq player mode, use deterministic rnti */ static int drnti[MAX_MOBILES_PER_ENB]; - static int drnti_def[]={ 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 }; + static const int drnti_def[] = {0xbda7, + 0x71da, + 0x9c40, + 0xc350, + 0x2710, + 0x4e20, + 0x7530, + 0x1388, + 0x3a98, + 0x61a8, + 0x88b8, + 0xafc8, + 0xd6d8, + 0x1b58, + 0x4268, + 0x6978}; for (int j=0; j<MAX_MOBILES_PER_ENB && j< (sizeof(drnti_def)/sizeof(int));j++) drnti[i]=drnti_def[i]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index ccd5289a6f9..ce96d5ab877 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1449,15 +1449,7 @@ fill_nfapi_ulsch_harq_information(module_id_t module_ } //------------------------------------------------------------------------------ -uint8_t -Np[6][4] = { - {0, 1, 3, 5}, - {0, 3, 8, 13}, - {0, 5, 13, 22}, - {0, 11, 27, 44}, - {0, 16, 41, 66}, - {0, 22, 55, 88} -}; +const uint8_t Np[6][4] = {{0, 1, 3, 5}, {0, 3, 8, 13}, {0, 5, 13, 22}, {0, 11, 27, 44}, {0, 16, 41, 66}, {0, 22, 55, 88}}; //------------------------------------------------------------------------------ // This is part of the PUCCH allocation procedure (see Section 10.1 36.213) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 1372cb7276e..167ac2628e0 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -69,14 +69,14 @@ extern int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req); // This table holds the allowable PRB sizes for ULSCH transmissions -uint8_t rb_table[34] = { - 1, 2, 3, 4, 5, // 0-4 - 6, 8, 9, 10, 12, // 5-9 - 15, 16, 18, 20, 24, // 10-14 - 25, 27, 30, 32, 36, // 15-19 - 40, 45, 48, 50, 54, // 20-24 - 60, 64, 72, 75, 80, // 25-29 - 81, 90, 96, 100 // 30-33 +const uint8_t rb_table[34] = { + 1, 2, 3, 4, 5, // 0-4 + 6, 8, 9, 10, 12, // 5-9 + 15, 16, 18, 20, 24, // 10-14 + 25, 27, 30, 32, 36, // 15-19 + 40, 45, 48, 50, 54, // 20-24 + 60, 64, 72, 75, 80, // 25-29 + 81, 90, 96, 100 // 30-33 }; // This table hold the possible number of MTC repetition for CE ModeA diff --git a/openair2/LAYER2/MAC/mac_extern.h b/openair2/LAYER2/MAC/mac_extern.h index 085df928ca8..e3cc8f3392d 100644 --- a/openair2/LAYER2/MAC/mac_extern.h +++ b/openair2/LAYER2/MAC/mac_extern.h @@ -42,7 +42,7 @@ extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES extern int NB_UE_INST; extern const int cqi_to_mcs[16]; -extern uint8_t rb_table[34]; +extern const uint8_t rb_table[34]; extern rb_id_t mbms_rab_id; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 0067c546ba4..b206d85d613 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3633,7 +3633,7 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig, long transformPrec } } -int tdd_period_to_num[8] = {500,625,1000,1250,2000,2500,5000,10000}; +static const int tdd_period_to_num[8] = {500, 625, 1000, 1250, 2000, 2500, 5000, 10000}; bool is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slot) { diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index ac837d7798e..132e08c7f19 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -80,5 +80,5 @@ extern void mac_rlc_data_ind(const module_id_t module_idP, num_tb_t num_tbP, crc_t *crcs_pP); -extern const char *rnti_types[]; -extern const char *dci_formats[]; +extern const char *const rnti_types[]; +extern const char *const dci_formats[]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c index b435dd773f7..43a3acf9ebf 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_vars.c +++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c @@ -32,8 +32,9 @@ #include <stdint.h> -const char *rnti_types[]={"RNTI_new", "RNTI_C", "RNTI_RA", "NR_RNTI_P", "NR_RNTI_CS", "NR_RNTI_TC", "NR_RNTI_SP_CSI", "NR_RNTI_SI"}; -const char *dci_formats[]={"1_0", "1_1", "2_0", "2_1", "2_2", "2_3", "0_0", "0_1"}; +const char* const rnti_types[] = + {"RNTI_new", "RNTI_C", "RNTI_RA", "NR_RNTI_P", "NR_RNTI_CS", "NR_RNTI_TC", "NR_RNTI_SP_CSI", "NR_RNTI_SI"}; +const char* const dci_formats[] = {"1_0", "1_1", "2_0", "2_1", "2_2", "2_3", "0_0", "0_1"}; // table_7_3_1_1_2_2_3_4_5 contains values for number of layers and precoding information for tables 7.3.1.1.2-2/3/4/5 from TS 38.212 subclause 7.3.1.1.2 // the first 6 columns contain table 7.3.1.1.2-2: Precoding information and number of layers, for 4 antenna ports, if transformPrecoder=disabled and maxRank = 2 or 3 or 4 diff --git a/openair2/RRC/LTE/rrc_common.c b/openair2/RRC/LTE/rrc_common.c index 7509aeae4fd..7654b56922d 100644 --- a/openair2/RRC/LTE/rrc_common.c +++ b/openair2/RRC/LTE/rrc_common.c @@ -166,48 +166,48 @@ typedef struct { unsigned long dl_minfreq, dl_maxfreq; } band_freq; -static band_freq bands[] = { - { BAND_TYPE_FDD, 1, 1920000000UL, 1980000000UL, 2110000000UL, 2170000000UL }, - { BAND_TYPE_FDD, 2, 1850000000UL, 1910000000UL, 1930000000UL, 1990000000UL }, - { BAND_TYPE_FDD, 3, 1710000000UL, 1785000000UL, 1805000000UL, 1880000000UL }, - { BAND_TYPE_FDD, 4, 1710000000UL, 1755000000UL, 2110000000UL, 2155000000UL }, - { BAND_TYPE_FDD, 5, 824000000UL, 849000000UL, 869000000UL, 894000000UL }, - /* to remove? */{ BAND_TYPE_FDD, 6, 830000000UL, 840000000UL, 875000000UL, 885000000UL }, - { BAND_TYPE_FDD, 7, 2500000000UL, 2570000000UL, 2620000000UL, 2690000000UL }, - { BAND_TYPE_FDD, 8, 880000000UL, 915000000UL, 925000000UL, 960000000UL }, - { BAND_TYPE_FDD, 9, 1749900000UL, 1784900000UL, 1844900000UL, 1879900000UL }, - { BAND_TYPE_FDD, 10, 1710000000UL, 1770000000UL, 2110000000UL, 2170000000UL }, - { BAND_TYPE_FDD, 11, 1427900000UL, 1447900000UL, 1475900000UL, 1495900000UL }, - { BAND_TYPE_FDD, 12, 699000000UL, 716000000UL, 729000000UL, 746000000UL }, - { BAND_TYPE_FDD, 13, 777000000UL, 787000000UL, 746000000UL, 756000000UL }, - { BAND_TYPE_FDD, 14, 788000000UL, 798000000UL, 758000000UL, 768000000UL }, - { BAND_TYPE_FDD, 17, 704000000UL, 716000000UL, 734000000UL, 746000000UL }, - { BAND_TYPE_FDD, 18, 815000000UL, 830000000UL, 860000000UL, 875000000UL }, - { BAND_TYPE_FDD, 19, 830000000UL, 845000000UL, 875000000UL, 890000000UL }, - { BAND_TYPE_FDD, 20, 832000000UL, 862000000UL, 791000000UL, 821000000UL }, - { BAND_TYPE_FDD, 21, 1447900000UL, 1462900000UL, 1495900000UL, 1510900000UL }, - { BAND_TYPE_FDD, 22, 3410000000UL, 3490000000UL, 3510000000UL, 3590000000UL }, - { BAND_TYPE_FDD, 23, 2000000000UL, 2020000000UL, 2180000000UL, 2200000000UL }, - { BAND_TYPE_FDD, 24, 1626500000UL, 1660500000UL, 1525000000UL, 1559000000UL }, - { BAND_TYPE_FDD, 25, 1850000000UL, 1915000000UL, 1930000000UL, 1995000000UL }, - - { BAND_TYPE_TDD, 33, 1900000000UL, 1920000000UL, 1900000000UL, 1920000000UL }, - { BAND_TYPE_TDD, 34, 2010000000UL, 2025000000UL, 2010000000UL, 2025000000UL }, - { BAND_TYPE_TDD, 35, 1850000000UL, 1910000000UL, 1850000000UL, 1910000000UL }, - { BAND_TYPE_TDD, 36, 1930000000UL, 1990000000UL, 1930000000UL, 1990000000UL }, - { BAND_TYPE_TDD, 37, 1910000000UL, 1930000000UL, 1910000000UL, 1930000000UL }, - { BAND_TYPE_TDD, 38, 2570000000UL, 2620000000UL, 2570000000UL, 2620000000UL }, - { BAND_TYPE_TDD, 39, 1880000000UL, 1920000000UL, 1880000000UL, 1920000000UL }, - { BAND_TYPE_TDD, 40, 2300000000UL, 2400000000UL, 2300000000UL, 2400000000UL }, - { BAND_TYPE_TDD, 41, 2496000000UL, 2690000000UL, 2496000000UL, 2690000000UL }, - { BAND_TYPE_TDD, 42, 3400000000UL, 3600000000UL, 3400000000UL, 3600000000UL }, - { BAND_TYPE_TDD, 43, 3600000000UL, 3800000000UL, 3600000000UL, 3800000000UL }, - // ... - { BAND_TYPE_FDD, 65, 1920000000UL, 2010000000UL, 2110000000UL, 2200000000UL}, - { BAND_TYPE_FDD, 66, 1710000000UL, 1780000000UL, 2110000000UL, 2200000000UL}, - { BAND_TYPE_FDD, 71, 663000000UL, 698000000UL, 617000000UL, 652000000UL }, - { BAND_TYPE_FDD, 72, 451000000UL, 456000000UL, 461000000UL, 466000000UL }, - { BAND_TYPE_FDD, 73, 450000000UL, 455000000UL, 460000000UL, 466000000UL }, +static const band_freq bands[] = { + {BAND_TYPE_FDD, 1, 1920000000UL, 1980000000UL, 2110000000UL, 2170000000UL}, + {BAND_TYPE_FDD, 2, 1850000000UL, 1910000000UL, 1930000000UL, 1990000000UL}, + {BAND_TYPE_FDD, 3, 1710000000UL, 1785000000UL, 1805000000UL, 1880000000UL}, + {BAND_TYPE_FDD, 4, 1710000000UL, 1755000000UL, 2110000000UL, 2155000000UL}, + {BAND_TYPE_FDD, 5, 824000000UL, 849000000UL, 869000000UL, 894000000UL}, + /* to remove? */ {BAND_TYPE_FDD, 6, 830000000UL, 840000000UL, 875000000UL, 885000000UL}, + {BAND_TYPE_FDD, 7, 2500000000UL, 2570000000UL, 2620000000UL, 2690000000UL}, + {BAND_TYPE_FDD, 8, 880000000UL, 915000000UL, 925000000UL, 960000000UL}, + {BAND_TYPE_FDD, 9, 1749900000UL, 1784900000UL, 1844900000UL, 1879900000UL}, + {BAND_TYPE_FDD, 10, 1710000000UL, 1770000000UL, 2110000000UL, 2170000000UL}, + {BAND_TYPE_FDD, 11, 1427900000UL, 1447900000UL, 1475900000UL, 1495900000UL}, + {BAND_TYPE_FDD, 12, 699000000UL, 716000000UL, 729000000UL, 746000000UL}, + {BAND_TYPE_FDD, 13, 777000000UL, 787000000UL, 746000000UL, 756000000UL}, + {BAND_TYPE_FDD, 14, 788000000UL, 798000000UL, 758000000UL, 768000000UL}, + {BAND_TYPE_FDD, 17, 704000000UL, 716000000UL, 734000000UL, 746000000UL}, + {BAND_TYPE_FDD, 18, 815000000UL, 830000000UL, 860000000UL, 875000000UL}, + {BAND_TYPE_FDD, 19, 830000000UL, 845000000UL, 875000000UL, 890000000UL}, + {BAND_TYPE_FDD, 20, 832000000UL, 862000000UL, 791000000UL, 821000000UL}, + {BAND_TYPE_FDD, 21, 1447900000UL, 1462900000UL, 1495900000UL, 1510900000UL}, + {BAND_TYPE_FDD, 22, 3410000000UL, 3490000000UL, 3510000000UL, 3590000000UL}, + {BAND_TYPE_FDD, 23, 2000000000UL, 2020000000UL, 2180000000UL, 2200000000UL}, + {BAND_TYPE_FDD, 24, 1626500000UL, 1660500000UL, 1525000000UL, 1559000000UL}, + {BAND_TYPE_FDD, 25, 1850000000UL, 1915000000UL, 1930000000UL, 1995000000UL}, + + {BAND_TYPE_TDD, 33, 1900000000UL, 1920000000UL, 1900000000UL, 1920000000UL}, + {BAND_TYPE_TDD, 34, 2010000000UL, 2025000000UL, 2010000000UL, 2025000000UL}, + {BAND_TYPE_TDD, 35, 1850000000UL, 1910000000UL, 1850000000UL, 1910000000UL}, + {BAND_TYPE_TDD, 36, 1930000000UL, 1990000000UL, 1930000000UL, 1990000000UL}, + {BAND_TYPE_TDD, 37, 1910000000UL, 1930000000UL, 1910000000UL, 1930000000UL}, + {BAND_TYPE_TDD, 38, 2570000000UL, 2620000000UL, 2570000000UL, 2620000000UL}, + {BAND_TYPE_TDD, 39, 1880000000UL, 1920000000UL, 1880000000UL, 1920000000UL}, + {BAND_TYPE_TDD, 40, 2300000000UL, 2400000000UL, 2300000000UL, 2400000000UL}, + {BAND_TYPE_TDD, 41, 2496000000UL, 2690000000UL, 2496000000UL, 2690000000UL}, + {BAND_TYPE_TDD, 42, 3400000000UL, 3600000000UL, 3400000000UL, 3600000000UL}, + {BAND_TYPE_TDD, 43, 3600000000UL, 3800000000UL, 3600000000UL, 3800000000UL}, + // ... + {BAND_TYPE_FDD, 65, 1920000000UL, 2010000000UL, 2110000000UL, 2200000000UL}, + {BAND_TYPE_FDD, 66, 1710000000UL, 1780000000UL, 2110000000UL, 2200000000UL}, + {BAND_TYPE_FDD, 71, 663000000UL, 698000000UL, 617000000UL, 652000000UL}, + {BAND_TYPE_FDD, 72, 451000000UL, 456000000UL, 461000000UL, 466000000UL}, + {BAND_TYPE_FDD, 73, 450000000UL, 455000000UL, 460000000UL, 466000000UL}, }; typedef struct { @@ -220,46 +220,46 @@ typedef struct { int ul_offmin, ul_offmax; } earfcn; -static earfcn earfcn_table[] = { - { 1, 2110000000UL, 0, 0, 599, 1920000000UL, 18000, 18000, 18599 }, - { 2, 1930000000UL, 600, 600, 1199, 1850000000UL, 18600, 18600, 19199 }, - { 3, 1805000000UL, 1200, 1200, 1949, 1710000000UL, 19200, 19200, 19949 }, - { 4, 2110000000UL, 1950, 1950, 2399, 1710000000UL, 19950, 19950, 20399 }, - { 5, 869000000UL, 2400, 2400, 2649, 824000000UL, 20400, 20400, 20649 }, - { 6, 875000000UL, 2650, 2650, 2749, 830000000UL, 20650, 20650, 20749 }, - { 7, 2620000000UL, 2750, 2750, 3449, 2500000000UL, 20750, 20750, 21449 }, - { 8, 925000000UL, 3450, 3450, 3799, 880000000UL, 21450, 21450, 21799 }, - { 9, 1844900000UL, 3800, 3800, 4149, 1749900000UL, 21800, 21800, 22149 }, - { 10, 2110000000UL, 4150, 4150, 4749, 1710000000UL, 22150, 22150, 22749 }, - { 11, 1475900000UL, 4750, 4750, 4949, 1427900000UL, 22750, 22750, 22949 }, - { 12, 729000000UL, 5010, 5010, 5179, 699000000UL, 23010, 23010, 23179 }, - { 13, 746000000UL, 5180, 5180, 5279, 777000000UL, 23180, 23180, 23279 }, - { 14, 758000000UL, 5280, 5280, 5379, 788000000UL, 23280, 23280, 23379 }, - { 17, 734000000UL, 5730, 5730, 5849, 704000000UL, 23730, 23730, 23849 }, - { 18, 860000000UL, 5850, 5850, 5999, 815000000UL, 23850, 23850, 23999 }, - { 19, 875000000UL, 6000, 6000, 6149, 830000000UL, 24000, 24000, 24149 }, - { 20, 791000000UL, 6150, 6150, 6449, 832000000UL, 24150, 24150, 24449 }, - { 21, 1495900000UL, 6450, 6450, 6599, 1447900000UL, 24450, 24450, 24599 }, - { 22, 3510000000UL, 6600, 6600, 7399, 3410000000UL, 24600, 24600, 25399 }, - { 23, 2180000000UL, 7500, 7500, 7699, 2000000000UL, 25500, 25500, 25699 }, - { 24, 1525000000UL, 7700, 7700, 8039, 1626500000UL, 25700, 25700, 26039 }, - { 25, 1930000000UL, 8040, 8040, 8689, 1850000000UL, 26040, 26040, 26689 }, - { 33, 1900000000UL, 36000, 36000, 36199, 1900000000UL, 36000, 36000, 36199 }, - { 34, 2010000000UL, 36200, 36200, 36349, 2010000000UL, 36200, 36200, 36349 }, - { 35, 1850000000UL, 36350, 36350, 36949, 1850000000UL, 36350, 36350, 36949 }, - { 36, 1930000000UL, 36950, 36950, 37549, 1930000000UL, 36950, 36950, 37549 }, - { 37, 1910000000UL, 37550, 37550, 37749, 1910000000UL, 37550, 37550, 37749 }, - { 38, 2570000000UL, 37750, 37750, 38249, 2570000000UL, 37750, 37750, 38249 }, - { 39, 1880000000UL, 38250, 38250, 38649, 1880000000UL, 38250, 38250, 38649 }, - { 40, 2300000000UL, 38650, 38650, 39649, 2300000000UL, 38650, 38650, 39649 }, - { 41, 2496000000UL, 39650, 39650, 41589, 2496000000UL, 39650, 39650, 41589 }, - { 42, 3400000000UL, 41590, 41590, 43589, 3400000000UL, 41590, 41590, 43589 }, - { 43, 3600000000UL, 43590, 43590, 45589, 3600000000UL, 43590, 43590, 45589 }, - // ... - { 66, 2110000000UL, 66436, 66436, 67335, 17100000000UL, 131972, 131972, 132671}, - { 71, 617000000UL, 68586, 68586, 68935, 6630000000UL, 133122, 133122, 133471}, - { 72, 461000000UL, 68936, 68936, 68985, 4510000000UL, 133472, 133472, 133521}, - { 73, 460000000UL, 68986, 68986, 69035, 4500000000UL, 133522, 133522, 133571}, +static const earfcn earfcn_table[] = { + {1, 2110000000UL, 0, 0, 599, 1920000000UL, 18000, 18000, 18599}, + {2, 1930000000UL, 600, 600, 1199, 1850000000UL, 18600, 18600, 19199}, + {3, 1805000000UL, 1200, 1200, 1949, 1710000000UL, 19200, 19200, 19949}, + {4, 2110000000UL, 1950, 1950, 2399, 1710000000UL, 19950, 19950, 20399}, + {5, 869000000UL, 2400, 2400, 2649, 824000000UL, 20400, 20400, 20649}, + {6, 875000000UL, 2650, 2650, 2749, 830000000UL, 20650, 20650, 20749}, + {7, 2620000000UL, 2750, 2750, 3449, 2500000000UL, 20750, 20750, 21449}, + {8, 925000000UL, 3450, 3450, 3799, 880000000UL, 21450, 21450, 21799}, + {9, 1844900000UL, 3800, 3800, 4149, 1749900000UL, 21800, 21800, 22149}, + {10, 2110000000UL, 4150, 4150, 4749, 1710000000UL, 22150, 22150, 22749}, + {11, 1475900000UL, 4750, 4750, 4949, 1427900000UL, 22750, 22750, 22949}, + {12, 729000000UL, 5010, 5010, 5179, 699000000UL, 23010, 23010, 23179}, + {13, 746000000UL, 5180, 5180, 5279, 777000000UL, 23180, 23180, 23279}, + {14, 758000000UL, 5280, 5280, 5379, 788000000UL, 23280, 23280, 23379}, + {17, 734000000UL, 5730, 5730, 5849, 704000000UL, 23730, 23730, 23849}, + {18, 860000000UL, 5850, 5850, 5999, 815000000UL, 23850, 23850, 23999}, + {19, 875000000UL, 6000, 6000, 6149, 830000000UL, 24000, 24000, 24149}, + {20, 791000000UL, 6150, 6150, 6449, 832000000UL, 24150, 24150, 24449}, + {21, 1495900000UL, 6450, 6450, 6599, 1447900000UL, 24450, 24450, 24599}, + {22, 3510000000UL, 6600, 6600, 7399, 3410000000UL, 24600, 24600, 25399}, + {23, 2180000000UL, 7500, 7500, 7699, 2000000000UL, 25500, 25500, 25699}, + {24, 1525000000UL, 7700, 7700, 8039, 1626500000UL, 25700, 25700, 26039}, + {25, 1930000000UL, 8040, 8040, 8689, 1850000000UL, 26040, 26040, 26689}, + {33, 1900000000UL, 36000, 36000, 36199, 1900000000UL, 36000, 36000, 36199}, + {34, 2010000000UL, 36200, 36200, 36349, 2010000000UL, 36200, 36200, 36349}, + {35, 1850000000UL, 36350, 36350, 36949, 1850000000UL, 36350, 36350, 36949}, + {36, 1930000000UL, 36950, 36950, 37549, 1930000000UL, 36950, 36950, 37549}, + {37, 1910000000UL, 37550, 37550, 37749, 1910000000UL, 37550, 37550, 37749}, + {38, 2570000000UL, 37750, 37750, 38249, 2570000000UL, 37750, 37750, 38249}, + {39, 1880000000UL, 38250, 38250, 38649, 1880000000UL, 38250, 38250, 38649}, + {40, 2300000000UL, 38650, 38650, 39649, 2300000000UL, 38650, 38650, 39649}, + {41, 2496000000UL, 39650, 39650, 41589, 2496000000UL, 39650, 39650, 41589}, + {42, 3400000000UL, 41590, 41590, 43589, 3400000000UL, 41590, 41590, 43589}, + {43, 3600000000UL, 43590, 43590, 45589, 3600000000UL, 43590, 43590, 45589}, + // ... + {66, 2110000000UL, 66436, 66436, 67335, 17100000000UL, 131972, 131972, 132671}, + {71, 617000000UL, 68586, 68586, 68935, 6630000000UL, 133122, 133122, 133471}, + {72, 461000000UL, 68936, 68936, 68985, 4510000000UL, 133472, 133472, 133521}, + {73, 460000000UL, 68986, 68986, 69035, 4500000000UL, 133522, 133522, 133571}, }; int freq_to_arfcn10(int band, unsigned long freq) { diff --git a/openair2/RRC/LTE/rrc_vars.h b/openair2/RRC/LTE/rrc_vars.h index 372517ee9d5..0b1db9ab34f 100644 --- a/openair2/RRC/LTE/rrc_vars.h +++ b/openair2/RRC/LTE/rrc_vars.h @@ -71,11 +71,8 @@ LTE_LogicalChannelConfig_t SRB1_logicalChannelConfig_defaultValue = {.ul_Specif &logicalChannelSR_Mask_r9_ext1 }; -LTE_LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {.ul_SpecificParameters= - &LCSRB2, - .ext1= - &logicalChannelSR_Mask_r9_ext1 - }; +const LTE_LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {.ul_SpecificParameters = &LCSRB2, + .ext1 = &logicalChannelSR_Mask_r9_ext1}; //CONSTANTS uint16_t RACH_FREQ_ALLOC; diff --git a/openair2/RRC/NAS/nas_config.c b/openair2/RRC/NAS/nas_config.c index 5b852546c47..f53c4d5c469 100644 --- a/openair2/RRC/NAS/nas_config.c +++ b/openair2/RRC/NAS/nas_config.c @@ -60,7 +60,7 @@ void nas_getparams(void) { // this datamodel require this static because we partially keep data like baseNetAddress (malloc on a global) // but we loose the opther attributes in nasoptions between two calls if is is not static ! // clang-format off - static paramdef_t nasoptions[] = { + paramdef_t nasoptions[] = { /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* configuration parameters for netlink, includes network parameters when running in noS1 mode */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index 2c59978ca2e..94150164e80 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -101,14 +101,15 @@ int opt_enabled=0; //static unsigned int g_PDUOffset; FILE *file_fd = NULL; -pcap_hdr_t file_header = { - 0xa1b2c3d4, /* magic number */ - 2, 4, /* version number is 2.4 */ - 0, /* timezone */ - 0, /* sigfigs - apparently all tools do this */ - 65535, /* snaplen - this should be long enough */ - DLT_IPV4 - //MAC_LTE_DLT /* Data Link Type (DLT). Set as unused value 147 for now */ +const pcap_hdr_t file_header = { + 0xa1b2c3d4, /* magic number */ + 2, + 4, /* version number is 2.4 */ + 0, /* timezone */ + 0, /* sigfigs - apparently all tools do this */ + 65535, /* snaplen - this should be long enough */ + DLT_IPV4 + // MAC_LTE_DLT /* Data Link Type (DLT). Set as unused value 147 for now */ }; trace_mode_t opt_type = OPT_NONE; diff --git a/openair3/NAS/COMMON/UTIL/TLVEncoder.c b/openair3/NAS/COMMON/UTIL/TLVEncoder.c index 9d3a1449891..0316c353fae 100644 --- a/openair3/NAS/COMMON/UTIL/TLVEncoder.c +++ b/openair3/NAS/COMMON/UTIL/TLVEncoder.c @@ -27,13 +27,13 @@ int errorCodeEncoder = 0; -const char *errorCodeStringEncoder[] = { - "No error", - "Buffer NULL", - "Buffer too short", - "Octet string too long for IEI", - "Wrong message type", - "Protocol not supported", +const char *const errorCodeStringEncoder[] = { + "No error", + "Buffer NULL", + "Buffer too short", + "Octet string too long for IEI", + "Wrong message type", + "Protocol not supported", }; void tlv_encode_perror(void) diff --git a/openair3/NAS/COMMON/UTIL/stty.c b/openair3/NAS/COMMON/UTIL/stty.c index fe87a63e440..9989149f595 100644 --- a/openair3/NAS/COMMON/UTIL/stty.c +++ b/openair3/NAS/COMMON/UTIL/stty.c @@ -68,129 +68,127 @@ typedef struct sttyset_s { } sttyset_t; /* Table of terminal I/O parameters */ -static sttyset_t stty_params[] = { - { "0", BFLG, 0, B0 }, - { "50", BFLG, 0, B50 }, - { "75", BFLG, 0, B75 }, - { "110", BFLG, 0, B110 }, - { "134", BFLG, 0, B134 }, - { "150", BFLG, 0, B150 }, - { "200", BFLG, 0, B200 }, - { "300", BFLG, 0, B300 }, - { "600", BFLG, 0, B600 }, - { "1200", BFLG, 0, B1200 }, - { "1800", BFLG, 0, B1800 }, - { "2400", BFLG, 0, B2400 }, - { "4800", BFLG, 0, B4800 }, - { "9600", BFLG, 0, B9600 }, - { "19200", BFLG, 0, B19200 }, - { "38400", BFLG, 0, B38400 }, +static const sttyset_t stty_params[] = {{"0", BFLG, 0, B0}, + {"50", BFLG, 0, B50}, + {"75", BFLG, 0, B75}, + {"110", BFLG, 0, B110}, + {"134", BFLG, 0, B134}, + {"150", BFLG, 0, B150}, + {"200", BFLG, 0, B200}, + {"300", BFLG, 0, B300}, + {"600", BFLG, 0, B600}, + {"1200", BFLG, 0, B1200}, + {"1800", BFLG, 0, B1800}, + {"2400", BFLG, 0, B2400}, + {"4800", BFLG, 0, B4800}, + {"9600", BFLG, 0, B9600}, + {"19200", BFLG, 0, B19200}, + {"38400", BFLG, 0, B38400}, #ifdef B57600 - { "57600", BFLG, 0, B57600 }, + {"57600", BFLG, 0, B57600}, #endif #ifdef B115200 - { "115200", BFLG, 0, B115200 }, + {"115200", BFLG, 0, B115200}, #endif #ifdef B230400 - { "230400", BFLG, 0, B230400 }, + {"230400", BFLG, 0, B230400}, #endif - { "cs7", CFLG, CSIZE, CS7 }, - { "cs8", CFLG, CSIZE, CS8 }, - { "cstopb", CFLG, CSTOPB, CSTOPB }, - { "cread", CFLG, CREAD, CREAD }, - { "parenb", CFLG, PARENB, PARENB }, - { "parodd", CFLG, PARODD, PARODD }, - { "hubcl", CFLG, HUPCL, HUPCL }, - { "clocal", CFLG, CLOCAL, CLOCAL }, + {"cs7", CFLG, CSIZE, CS7}, + {"cs8", CFLG, CSIZE, CS8}, + {"cstopb", CFLG, CSTOPB, CSTOPB}, + {"cread", CFLG, CREAD, CREAD}, + {"parenb", CFLG, PARENB, PARENB}, + {"parodd", CFLG, PARODD, PARODD}, + {"hubcl", CFLG, HUPCL, HUPCL}, + {"clocal", CFLG, CLOCAL, CLOCAL}, #ifdef CRTSCTS - { "crtscts",CFLG, CRTSCTS, CRTSCTS }, + {"crtscts", CFLG, CRTSCTS, CRTSCTS}, #endif #ifdef ORTSFL - { "ortsfl", CFLG, ORTSFL, ORTSFL }, + {"ortsfl", CFLG, ORTSFL, ORTSFL}, #endif #ifdef CTSFLOW - { "ctsflow",CFLG, CTSFLOW, CTSFLOW }, + {"ctsflow", CFLG, CTSFLOW, CTSFLOW}, #endif #ifdef RTSFLOW - { "rtsflow",CFLG, RTSFLOW, RTSFLOW }, + {"rtsflow", CFLG, RTSFLOW, RTSFLOW}, #endif - { "ignbrk", IFLG, IGNBRK, IGNBRK }, - { "brkint", IFLG, BRKINT, BRKINT }, - { "ignpar", IFLG, IGNPAR, IGNPAR }, - { "parmrk", IFLG, PARMRK, PARMRK }, - { "inpck", IFLG, INPCK, INPCK }, - { "istrip", IFLG, ISTRIP, ISTRIP }, - { "inlcr", IFLG, INLCR, INLCR }, - { "igncr", IFLG, IGNCR, IGNCR }, - { "icrnl", IFLG, ICRNL, ICRNL }, + {"ignbrk", IFLG, IGNBRK, IGNBRK}, + {"brkint", IFLG, BRKINT, BRKINT}, + {"ignpar", IFLG, IGNPAR, IGNPAR}, + {"parmrk", IFLG, PARMRK, PARMRK}, + {"inpck", IFLG, INPCK, INPCK}, + {"istrip", IFLG, ISTRIP, ISTRIP}, + {"inlcr", IFLG, INLCR, INLCR}, + {"igncr", IFLG, IGNCR, IGNCR}, + {"icrnl", IFLG, ICRNL, ICRNL}, #ifdef IUCLC // Missing on OSX, FreeBSD - { "iuclc", IFLG, IUCLC, IUCLC }, + {"iuclc", IFLG, IUCLC, IUCLC}, #endif - { "ixon", IFLG, IXON, IXON }, - { "ixany", IFLG, IXANY, IXANY }, - { "ixoff", IFLG, IXOFF, IXOFF }, + {"ixon", IFLG, IXON, IXON}, + {"ixany", IFLG, IXANY, IXANY}, + {"ixoff", IFLG, IXOFF, IXOFF}, #ifdef IMAXBEL - { "imaxbel",IFLG, IMAXBEL, IMAXBEL }, + {"imaxbel", IFLG, IMAXBEL, IMAXBEL}, #endif - { "opost", OFLG, OPOST, OPOST }, + {"opost", OFLG, OPOST, OPOST}, #ifdef ILCUC // Missing on OSX, FreeBSD - { "olcuc", OFLG, OLCUC, OLCUC }, + {"olcuc", OFLG, OLCUC, OLCUC}, #endif - { "onlcr", OFLG, ONLCR, ONLCR }, - { "ocrnl", OFLG, OCRNL, OCRNL }, - { "onocr", OFLG, ONOCR, ONOCR }, - { "onlret", OFLG, ONLRET, ONLRET }, - { "ofil", OFLG, OFILL, OFILL }, - { "ofdel", OFLG, OFDEL, OFDEL }, - { "nl0", OFLG, NLDLY, NL0 }, - { "nl1", OFLG, NLDLY, NL1 }, - { "cr0", OFLG, CRDLY, CR0 }, - { "cr1", OFLG, CRDLY, CR1 }, - { "cr2", OFLG, CRDLY, CR2 }, - { "cr3", OFLG, CRDLY, CR3 }, - { "tab0", OFLG, TABDLY, TAB0 }, - { "tab1", OFLG, TABDLY, TAB1 }, - { "tab2", OFLG, TABDLY, TAB2 }, - { "tab3", OFLG, TABDLY, TAB3 }, - { "bs0", OFLG, BSDLY, BS0 }, - { "bs1", OFLG, BSDLY, BS1 }, - { "vt0", OFLG, VTDLY, VT0 }, - { "vt1", OFLG, VTDLY, VT1 }, - { "ff0", OFLG, FFDLY, FF0 }, - { "ff1", OFLG, FFDLY, FF1 }, - { "isig", LFLG, ISIG, ISIG }, - { "icanon", LFLG, ICANON, ICANON }, + {"onlcr", OFLG, ONLCR, ONLCR}, + {"ocrnl", OFLG, OCRNL, OCRNL}, + {"onocr", OFLG, ONOCR, ONOCR}, + {"onlret", OFLG, ONLRET, ONLRET}, + {"ofil", OFLG, OFILL, OFILL}, + {"ofdel", OFLG, OFDEL, OFDEL}, + {"nl0", OFLG, NLDLY, NL0}, + {"nl1", OFLG, NLDLY, NL1}, + {"cr0", OFLG, CRDLY, CR0}, + {"cr1", OFLG, CRDLY, CR1}, + {"cr2", OFLG, CRDLY, CR2}, + {"cr3", OFLG, CRDLY, CR3}, + {"tab0", OFLG, TABDLY, TAB0}, + {"tab1", OFLG, TABDLY, TAB1}, + {"tab2", OFLG, TABDLY, TAB2}, + {"tab3", OFLG, TABDLY, TAB3}, + {"bs0", OFLG, BSDLY, BS0}, + {"bs1", OFLG, BSDLY, BS1}, + {"vt0", OFLG, VTDLY, VT0}, + {"vt1", OFLG, VTDLY, VT1}, + {"ff0", OFLG, FFDLY, FF0}, + {"ff1", OFLG, FFDLY, FF1}, + {"isig", LFLG, ISIG, ISIG}, + {"icanon", LFLG, ICANON, ICANON}, #ifdef XCASE // Missing on OSX, FreeBSD - { "xcase", LFLG, XCASE, XCASE }, + {"xcase", LFLG, XCASE, XCASE}, #endif - { "echo", LFLG, ECHO, ECHO }, - { "echoe", LFLG, ECHOE, ECHOE }, - { "echok", LFLG, ECHOK, ECHOK }, - { "echonl", LFLG, ECHONL, ECHONL }, - { "noflsh", LFLG, NOFLSH, NOFLSH }, - { "tostop", LFLG, TOSTOP, TOSTOP }, + {"echo", LFLG, ECHO, ECHO}, + {"echoe", LFLG, ECHOE, ECHOE}, + {"echok", LFLG, ECHOK, ECHOK}, + {"echonl", LFLG, ECHONL, ECHONL}, + {"noflsh", LFLG, NOFLSH, NOFLSH}, + {"tostop", LFLG, TOSTOP, TOSTOP}, #ifdef ECHOCTL - { "echoctl",LFLG, ECHOCTL, ECHOCTL }, + {"echoctl", LFLG, ECHOCTL, ECHOCTL}, #endif #ifdef ECHOPRT - { "echoprt",LFLG, ECHOPRT, ECHOPRT }, + {"echoprt", LFLG, ECHOPRT, ECHOPRT}, #endif #ifdef ECHOKE - { "echoke", LFLG, ECHOKE, ECHOKE }, + {"echoke", LFLG, ECHOKE, ECHOKE}, #endif #ifdef FLUSHO - { "flusho", LFLG, FLUSHO, FLUSHO }, + {"flusho", LFLG, FLUSHO, FLUSHO}, #endif #ifdef PENDIN - { "pendin", LFLG, PENDIN, PENDIN }, + {"pendin", LFLG, PENDIN, PENDIN}, #endif - { "iexten", LFLG, IEXTEN, IEXTEN }, + {"iexten", LFLG, IEXTEN, IEXTEN}, #ifdef TOSTOP - { "tostop", LFLG, TOSTOP, TOSTOP }, + {"tostop", LFLG, TOSTOP, TOSTOP}, #endif - { "raw", RFLG, 0, 0 }, - { NULL, 0, 0, 0 } -}; + {"raw", RFLG, 0, 0}, + {NULL, 0, 0, 0}}; static int _stty_set_this(struct termios *term, const sttyset_t *p, bool turnon); diff --git a/openair3/NAS/UE/API/USER/at_error.c b/openair3/NAS/UE/API/USER/at_error.c index bad7127adc4..78a3c407e94 100644 --- a/openair3/NAS/UE/API/USER/at_error.c +++ b/openair3/NAS/UE/API/USER/at_error.c @@ -74,136 +74,136 @@ at_error_format_t at_error_format = AT_ERROR_OFF; * General errors * -------------- */ -static const char * _at_error_str[] = { - "phone failure", - "no connection to phone", - "phone-adaptor link reserved", - "operation not allowed", - "operation not supported", - "PH-SIM PIN required", - "PH-FSIM PIN required", - "PH-FSIM PUK required", - NULL, - NULL, - "SIM not inserted", - "SIM PIN required", - "SIM PUK required", - "SIM failure", - "SIM busy", - "SIM wrong", - "incorrect password", - "SIM PIN2 required", - "SIM PUK2 required", - NULL, - "memory full", - "invalid index", - "not found", - "memory failure", - "text string too long", - "invalid characters in text string", - "dial string too long", - "invalid characters in dial string", - NULL, - NULL, - "no network service", - "network timeout", - "network not allowed - emergency calls only", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "network personalization PIN required", - "network personalization PUK required", - "network subset personalization PIN required", - "network subset personalization PUK required", - "service provider personalization PIN required", - "service provider personalization PUK required", - "corporate personalization PIN required", - "corporate personalization PUK required", - "hidden key required", - "EAP method not supported", - "Incorrect parameters", +static const char* const _at_error_str[] = { + "phone failure", + "no connection to phone", + "phone-adaptor link reserved", + "operation not allowed", + "operation not supported", + "PH-SIM PIN required", + "PH-FSIM PIN required", + "PH-FSIM PUK required", + NULL, + NULL, + "SIM not inserted", + "SIM PIN required", + "SIM PUK required", + "SIM failure", + "SIM busy", + "SIM wrong", + "incorrect password", + "SIM PIN2 required", + "SIM PUK2 required", + NULL, + "memory full", + "invalid index", + "not found", + "memory failure", + "text string too long", + "invalid characters in text string", + "dial string too long", + "invalid characters in dial string", + NULL, + NULL, + "no network service", + "network timeout", + "network not allowed - emergency calls only", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "network personalization PIN required", + "network personalization PUK required", + "network subset personalization PIN required", + "network subset personalization PUK required", + "service provider personalization PIN required", + "service provider personalization PUK required", + "corporate personalization PIN required", + "corporate personalization PUK required", + "hidden key required", + "EAP method not supported", + "Incorrect parameters", }; /* * GPRS-related errors * ------------------- */ -static const char* _at_error_gprs[] = { - "Illegal MS", - NULL, - NULL, - "Illegal ME", - "GPRS services not allowed", - NULL, - NULL, - NULL, - "PLMN not allowed", - "Location area not allowed", - "Roaming not allowed in this location area", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "service option not supported", - "requested service option not subscribed", - "service option temporarily out of order", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "unspecified GPRS error", - "PDP authentication failure", - "invalid mobile class", - "Last PDN disconnection not allowed", +static const char* const _at_error_gprs[] = { + "Illegal MS", + NULL, + NULL, + "Illegal ME", + "GPRS services not allowed", + NULL, + NULL, + NULL, + "PLMN not allowed", + "Location area not allowed", + "Roaming not allowed in this location area", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "service option not supported", + "requested service option not subscribed", + "service option temporarily out of order", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "unspecified GPRS error", + "PDP authentication failure", + "invalid mobile class", + "Last PDN disconnection not allowed", }; /* * VBS / VGCS and eMLPP -related errors * ------------------------------------ */ -static const char* _at_error_vbs[] = { - /* 151 "VBS/VGCS not supported by the network" */ - "No service subscription on SIM", - "No subscription for group ID", - "Group Id not activated on SIM", - "No matching notification", - "VBS/VGCS call already present", - "Congestion", - "Network failure", - "Uplink busy", - "No access rights for SIM file", - "No subscription for priority", - "operation not applicable or not possible", - "Group Id prefixes not supported", - "Group Id prefixes not usable for VBS", - "Group Id prefix value invalid", +static const char* const _at_error_vbs[] = { + /* 151 "VBS/VGCS not supported by the network" */ + "No service subscription on SIM", + "No subscription for group ID", + "Group Id not activated on SIM", + "No matching notification", + "VBS/VGCS call already present", + "Congestion", + "Network failure", + "Uplink busy", + "No access rights for SIM file", + "No subscription for priority", + "operation not applicable or not possible", + "Group Id prefixes not supported", + "Group Id prefixes not usable for VBS", + "Group Id prefix value invalid", }; /* Returns the verbose value of AT command error */ diff --git a/openair3/NAS/UE/API/USER/at_response.c b/openair3/NAS/UE/API/USER/at_response.c index 60a8918f828..28b6c0425a5 100644 --- a/openair3/NAS/UE/API/USER/at_response.c +++ b/openair3/NAS/UE/API/USER/at_response.c @@ -89,28 +89,28 @@ typedef int (*_at_response_encode_function_t) (char* buffer, const at_response_t static _at_response_encode_function_t _at_response_encode_function[AT_RESPONSE_ID_MAX] = { NULL, - _at_response_encode_cgsn, /* CGSN */ - _at_response_encode_cgmi, /* CGMI */ - _at_response_encode_cgmm, /* CGMM */ - _at_response_encode_cgmr, /* CGMR */ - _at_response_encode_cimi, /* CIMI */ - _at_response_encode_cfun, /* CFUN */ - _at_response_encode_cpin, /* CPIN */ - _at_response_encode_csq, /* CSQ */ - _at_response_encode_cesq, /* CESQ */ - _at_response_encode_clac, /* CLAC */ - _at_response_encode_cmee, /* CMEE */ - _at_response_encode_cnum, /* CNUM */ - _at_response_encode_clck, /* CLCK */ - _at_response_encode_cops, /* COPS */ - _at_response_encode_creg, /* CREG */ - _at_response_encode_cgatt, /* CGATT */ - _at_response_encode_cgreg, /* CGREG */ - _at_response_encode_cereg, /* CEREG */ - _at_response_encode_cgdcont, /* CGDCONT */ - _at_response_encode_cgact, /* CGACT */ - _at_response_encode_cgpaddr, /* CGPADDR */ - _at_response_encode_cgev, /* CGEV: unsolicited result */ + _at_response_encode_cgsn, /* CGSN */ + _at_response_encode_cgmi, /* CGMI */ + _at_response_encode_cgmm, /* CGMM */ + _at_response_encode_cgmr, /* CGMR */ + _at_response_encode_cimi, /* CIMI */ + _at_response_encode_cfun, /* CFUN */ + _at_response_encode_cpin, /* CPIN */ + _at_response_encode_csq, /* CSQ */ + _at_response_encode_cesq, /* CESQ */ + _at_response_encode_clac, /* CLAC */ + _at_response_encode_cmee, /* CMEE */ + _at_response_encode_cnum, /* CNUM */ + _at_response_encode_clck, /* CLCK */ + _at_response_encode_cops, /* COPS */ + _at_response_encode_creg, /* CREG */ + _at_response_encode_cgatt, /* CGATT */ + _at_response_encode_cgreg, /* CGREG */ + _at_response_encode_cereg, /* CEREG */ + _at_response_encode_cgdcont, /* CGDCONT */ + _at_response_encode_cgact, /* CGACT */ + _at_response_encode_cgpaddr, /* CGPADDR */ + _at_response_encode_cgev, /* CGEV: unsolicited result */ }; /* String representation of Packet Domain events (cf. network_pdn_state_t) */ diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c index 88a9415e08d..d2e3fc36c57 100644 --- a/openair3/NAS/UE/API/USIM/aka_functions.c +++ b/openair3/NAS/UE/API/USIM/aka_functions.c @@ -305,44 +305,33 @@ void ComputeOPc(const u8 op[16], u8 op_c_pP[16]) /*-------------------- Rijndael round subkeys ---------------------*/ u8 roundKeys[11][4][4]; /*--------------------- Rijndael S box table ----------------------*/ -u8 S[256] = { - 99,124,119,123,242,107,111,197, 48, 1,103, 43,254,215,171,118, - 202,130,201,125,250, 89, 71,240,173,212,162,175,156,164,114,192, - 183,253,147, 38, 54, 63,247,204, 52,165,229,241,113,216, 49, 21, - 4,199, 35,195, 24,150, 5,154, 7, 18,128,226,235, 39,178,117, - 9,131, 44, 26, 27,110, 90,160, 82, 59,214,179, 41,227, 47,132, - 83,209, 0,237, 32,252,177, 91,106,203,190, 57, 74, 76, 88,207, - 208,239,170,251, 67, 77, 51,133, 69,249, 2,127, 80, 60,159,168, - 81,163, 64,143,146,157, 56,245,188,182,218, 33, 16,255,243,210, - 205, 12, 19,236, 95,151, 68, 23,196,167,126, 61,100, 93, 25,115, - 96,129, 79,220, 34, 42,144,136, 70,238,184, 20,222, 94, 11,219, - 224, 50, 58, 10, 73, 6, 36, 92,194,211,172, 98,145,149,228,121, - 231,200, 55,109,141,213, 78,169,108, 86,244,234,101,122,174, 8, - 186,120, 37, 46, 28,166,180,198,232,221,116, 31, 75,189,139,138, - 112, 62,181,102, 72, 3,246, 14, 97, 53, 87,185,134,193, 29,158, - 225,248,152, 17,105,217,142,148,155, 30,135,233,206, 85, 40,223, - 140,161,137, 13,191,230, 66,104, 65,153, 45, 15,176, 84,187, 22, +const u8 S[256] = { + 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, + 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, + 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, + 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, + 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, + 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22, }; /*------- This array does the multiplication by x in GF(2^8) ------*/ -u8 Xtime[256] = { - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, - 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, - 96, 98,100,102,104,106,108,110,112,114,116,118,120,122,124,126, - 128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158, - 160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190, - 192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222, - 224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254, - 27, 25, 31, 29, 19, 17, 23, 21, 11, 9, 15, 13, 3, 1, 7, 5, - 59, 57, 63, 61, 51, 49, 55, 53, 43, 41, 47, 45, 35, 33, 39, 37, - 91, 89, 95, 93, 83, 81, 87, 85, 75, 73, 79, 77, 67, 65, 71, 69, - 123,121,127,125,115,113,119,117,107,105,111,109, 99, 97,103,101, - 155,153,159,157,147,145,151,149,139,137,143,141,131,129,135,133, - 187,185,191,189,179,177,183,181,171,169,175,173,163,161,167,165, - 219,217,223,221,211,209,215,213,203,201,207,205,195,193,199,197, - 251,249,255,253,243,241,247,245,235,233,239,237,227,225,231,229 -}; +const u8 Xtime[256] = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, + 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, + 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, + 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, + 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, + 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 27, 25, 31, 29, + 19, 17, 23, 21, 11, 9, 15, 13, 3, 1, 7, 5, 59, 57, 63, 61, 51, 49, 55, 53, 43, 41, + 47, 45, 35, 33, 39, 37, 91, 89, 95, 93, 83, 81, 87, 85, 75, 73, 79, 77, 67, 65, 71, 69, + 123, 121, 127, 125, 115, 113, 119, 117, 107, 105, 111, 109, 99, 97, 103, 101, 155, 153, 159, 157, 147, 145, + 151, 149, 139, 137, 143, 141, 131, 129, 135, 133, 187, 185, 191, 189, 179, 177, 183, 181, 171, 169, 175, 173, + 163, 161, 167, 165, 219, 217, 223, 221, 211, 209, 215, 213, 203, 201, 207, 205, 195, 193, 199, 197, 251, 249, + 255, 253, 243, 241, 247, 245, 235, 233, 239, 237, 227, 225, 231, 229}; /*------------------------------------------------------------------- * Rijndael key schedule function. Takes 16-byte key and creates * all Rijndael's internal subkeys ready for encryption. diff --git a/openair3/NAS/UE/nas_user.c b/openair3/NAS/UE/nas_user.c index 56e41e4610e..ab32c216e5b 100644 --- a/openair3/NAS/UE/nas_user.c +++ b/openair3/NAS/UE/nas_user.c @@ -91,29 +91,29 @@ static int _nas_user_proc_clac (nas_user_t *user, const at_command_t *data); /* NAS procedures applicable to AT commands */ typedef int (*_nas_user_procedure_t) (nas_user_t *, const at_command_t *); -static _nas_user_procedure_t _nas_user_procedure[AT_COMMAND_ID_MAX] = { - NULL, - _nas_user_proc_cgsn, /* CGSN */ - _nas_user_proc_cgmi, /* CGMI */ - _nas_user_proc_cgmm, /* CGMM */ - _nas_user_proc_cgmr, /* CGMR */ - _nas_user_proc_cimi, /* CIMI */ - _nas_user_proc_cfun, /* CFUN */ - _nas_user_proc_cpin, /* CPIN */ - _nas_user_proc_csq, /* CSQ */ - _nas_user_proc_cesq, /* CESQ */ - _nas_user_proc_clac, /* CLAC */ - _nas_user_proc_cmee, /* CMEE */ - _nas_user_proc_cnum, /* CNUM */ - _nas_user_proc_clck, /* CLCK */ - _nas_user_proc_cops, /* COPS */ - _nas_user_proc_creg, /* CREG */ - _nas_user_proc_cgatt, /* CGATT */ - _nas_user_proc_cgreg, /* CGREG */ - _nas_user_proc_cereg, /* CEREG */ - _nas_user_proc_cgdcont, /* CGDCONT */ - _nas_user_proc_cgact, /* CGACT */ - _nas_user_proc_cgpaddr, /* CGPADDR */ +static const _nas_user_procedure_t _nas_user_procedure[AT_COMMAND_ID_MAX] = { + NULL, + _nas_user_proc_cgsn, /* CGSN */ + _nas_user_proc_cgmi, /* CGMI */ + _nas_user_proc_cgmm, /* CGMM */ + _nas_user_proc_cgmr, /* CGMR */ + _nas_user_proc_cimi, /* CIMI */ + _nas_user_proc_cfun, /* CFUN */ + _nas_user_proc_cpin, /* CPIN */ + _nas_user_proc_csq, /* CSQ */ + _nas_user_proc_cesq, /* CESQ */ + _nas_user_proc_clac, /* CLAC */ + _nas_user_proc_cmee, /* CMEE */ + _nas_user_proc_cnum, /* CNUM */ + _nas_user_proc_clck, /* CLCK */ + _nas_user_proc_cops, /* COPS */ + _nas_user_proc_creg, /* CREG */ + _nas_user_proc_cgatt, /* CGATT */ + _nas_user_proc_cgreg, /* CGREG */ + _nas_user_proc_cereg, /* CEREG */ + _nas_user_proc_cgdcont, /* CGDCONT */ + _nas_user_proc_cgact, /* CGACT */ + _nas_user_proc_cgpaddr, /* CGPADDR */ }; /* @@ -122,12 +122,7 @@ static _nas_user_procedure_t _nas_user_procedure[AT_COMMAND_ID_MAX] = { * --------------------------------------------------------------------- */ -static const char *_nas_user_sim_status_str[] = { - "READY", - "SIM PIN", - "SIM PUK", - "PH-SIM PIN" -}; +static const char *const _nas_user_sim_status_str[] = {"READY", "SIM PIN", "SIM PUK", "PH-SIM PIN"}; /****************************************************************************/ /****************** E X P O R T E D F U N C T I O N S ******************/ diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index f548ed4b426..788f56381f8 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -1290,7 +1290,7 @@ int ngap_gNB_handle_ng_ENDC_pdusession_modification_confirm(uint32_t } /* Handlers matrix. Only gNB related procedure present here */ -ngap_message_decoded_callback ngap_messages_callback[][3] = { +const ngap_message_decoded_callback ngap_messages_callback[][3] = { {0, 0, 0}, /* AMFConfigurationUpdate */ {0, 0, 0}, /* AMFStatusIndication */ {0, 0, 0}, /* CellTrafficTrace */ diff --git a/openair3/SECU/rijndael.c b/openair3/SECU/rijndael.c index c245af80f19..d6c8ca13e3b 100644 --- a/openair3/SECU/rijndael.c +++ b/openair3/SECU/rijndael.c @@ -22,42 +22,34 @@ #include <stdint.h> /* Rijndael S-box SR */ -uint8_t SR[256] = { - 0x63,0x7C,0x77,0x7B,0xF2,0x6B,0x6F,0xC5,0x30,0x01,0x67,0x2B,0xFE,0xD7,0xAB,0x76, - 0xCA,0x82,0xC9,0x7D,0xFA,0x59,0x47,0xF0,0xAD,0xD4,0xA2,0xAF,0x9C,0xA4,0x72,0xC0, - 0xB7,0xFD,0x93,0x26,0x36,0x3F,0xF7,0xCC,0x34,0xA5,0xE5,0xF1,0x71,0xD8,0x31,0x15, - 0x04,0xC7,0x23,0xC3,0x18,0x96,0x05,0x9A,0x07,0x12,0x80,0xE2,0xEB,0x27,0xB2,0x75, - 0x09,0x83,0x2C,0x1A,0x1B,0x6E,0x5A,0xA0,0x52,0x3B,0xD6,0xB3,0x29,0xE3,0x2F,0x84, - 0x53,0xD1,0x00,0xED,0x20,0xFC,0xB1,0x5B,0x6A,0xCB,0xBE,0x39,0x4A,0x4C,0x58,0xCF, - 0xD0,0xEF,0xAA,0xFB,0x43,0x4D,0x33,0x85,0x45,0xF9,0x02,0x7F,0x50,0x3C,0x9F,0xA8, - 0x51,0xA3,0x40,0x8F,0x92,0x9D,0x38,0xF5,0xBC,0xB6,0xDA,0x21,0x10,0xFF,0xF3,0xD2, - 0xCD,0x0C,0x13,0xEC,0x5F,0x97,0x44,0x17,0xC4,0xA7,0x7E,0x3D,0x64,0x5D,0x19,0x73, - 0x60,0x81,0x4F,0xDC,0x22,0x2A,0x90,0x88,0x46,0xEE,0xB8,0x14,0xDE,0x5E,0x0B,0xDB, - 0xE0,0x32,0x3A,0x0A,0x49,0x06,0x24,0x5C,0xC2,0xD3,0xAC,0x62,0x91,0x95,0xE4,0x79, - 0xE7,0xC8,0x37,0x6D,0x8D,0xD5,0x4E,0xA9,0x6C,0x56,0xF4,0xEA,0x65,0x7A,0xAE,0x08, - 0xBA,0x78,0x25,0x2E,0x1C,0xA6,0xB4,0xC6,0xE8,0xDD,0x74,0x1F,0x4B,0xBD,0x8B,0x8A, - 0x70,0x3E,0xB5,0x66,0x48,0x03,0xF6,0x0E,0x61,0x35,0x57,0xB9,0x86,0xC1,0x1D,0x9E, - 0xE1,0xF8,0x98,0x11,0x69,0xD9,0x8E,0x94,0x9B,0x1E,0x87,0xE9,0xCE,0x55,0x28,0xDF, - 0x8C,0xA1,0x89,0x0D,0xBF,0xE6,0x42,0x68,0x41,0x99,0x2D,0x0F,0xB0,0x54,0xBB,0x16 -}; +const uint8_t SR[256] = { + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, + 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, + 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, + 0xEB, 0x27, 0xB2, 0x75, 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, 0xD0, 0xEF, 0xAA, 0xFB, + 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, + 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, + 0x64, 0x5D, 0x19, 0x73, 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, 0xE7, 0xC8, 0x37, 0x6D, + 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, + 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, + 0x86, 0xC1, 0x1D, 0x9E, 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16}; /* S-box SQ */ -uint8_t SQ[256] = { - 0x25,0x24,0x73,0x67,0xD7,0xAE,0x5C,0x30,0xA4,0xEE,0x6E,0xCB,0x7D,0xB5,0x82,0xDB, - 0xE4,0x8E,0x48,0x49,0x4F,0x5D,0x6A,0x78,0x70,0x88,0xE8,0x5F,0x5E,0x84,0x65,0xE2, - 0xD8,0xE9,0xCC,0xED,0x40,0x2F,0x11,0x28,0x57,0xD2,0xAC,0xE3,0x4A,0x15,0x1B,0xB9, - 0xB2,0x80,0x85,0xA6,0x2E,0x02,0x47,0x29,0x07,0x4B,0x0E,0xC1,0x51,0xAA,0x89,0xD4, - 0xCA,0x01,0x46,0xB3,0xEF,0xDD,0x44,0x7B,0xC2,0x7F,0xBE,0xC3,0x9F,0x20,0x4C,0x64, - 0x83,0xA2,0x68,0x42,0x13,0xB4,0x41,0xCD,0xBA,0xC6,0xBB,0x6D,0x4D,0x71,0x21,0xF4, - 0x8D,0xB0,0xE5,0x93,0xFE,0x8F,0xE6,0xCF,0x43,0x45,0x31,0x22,0x37,0x36,0x96,0xFA, - 0xBC,0x0F,0x08,0x52,0x1D,0x55,0x1A,0xC5,0x4E,0x23,0x69,0x7A,0x92,0xFF,0x5B,0x5A, - 0xEB,0x9A,0x1C,0xA9,0xD1,0x7E,0x0D,0xFC,0x50,0x8A,0xB6,0x62,0xF5,0x0A,0xF8,0xDC, - 0x03,0x3C,0x0C,0x39,0xF1,0xB8,0xF3,0x3D,0xF2,0xD5,0x97,0x66,0x81,0x32,0xA0,0x00, - 0x06,0xCE,0xF6,0xEA,0xB7,0x17,0xF7,0x8C,0x79,0xD6,0xA7,0xBF,0x8B,0x3F,0x1F,0x53, - 0x63,0x75,0x35,0x2C,0x60,0xFD,0x27,0xD3,0x94,0xA5,0x7C,0xA1,0x05,0x58,0x2D,0xBD, - 0xD9,0xC7,0xAF,0x6B,0x54,0x0B,0xE0,0x38,0x04,0xC8,0x9D,0xE7,0x14,0xB1,0x87,0x9C, - 0xDF,0x6F,0xF9,0xDA,0x2A,0xC4,0x59,0x16,0x74,0x91,0xAB,0x26,0x61,0x76,0x34,0x2B, - 0xAD,0x99,0xFB,0x72,0xEC,0x33,0x12,0xDE,0x98,0x3B,0xC0,0x9B,0x3E,0x18,0x10,0x3A, - 0x56,0xE1,0x77,0xC9,0x1E,0x9E,0x95,0xA3,0x90,0x19,0xA8,0x6C,0x09,0xD0,0xF0,0x86 -}; +const uint8_t SQ[256] = { + 0x25, 0x24, 0x73, 0x67, 0xD7, 0xAE, 0x5C, 0x30, 0xA4, 0xEE, 0x6E, 0xCB, 0x7D, 0xB5, 0x82, 0xDB, 0xE4, 0x8E, 0x48, 0x49, + 0x4F, 0x5D, 0x6A, 0x78, 0x70, 0x88, 0xE8, 0x5F, 0x5E, 0x84, 0x65, 0xE2, 0xD8, 0xE9, 0xCC, 0xED, 0x40, 0x2F, 0x11, 0x28, + 0x57, 0xD2, 0xAC, 0xE3, 0x4A, 0x15, 0x1B, 0xB9, 0xB2, 0x80, 0x85, 0xA6, 0x2E, 0x02, 0x47, 0x29, 0x07, 0x4B, 0x0E, 0xC1, + 0x51, 0xAA, 0x89, 0xD4, 0xCA, 0x01, 0x46, 0xB3, 0xEF, 0xDD, 0x44, 0x7B, 0xC2, 0x7F, 0xBE, 0xC3, 0x9F, 0x20, 0x4C, 0x64, + 0x83, 0xA2, 0x68, 0x42, 0x13, 0xB4, 0x41, 0xCD, 0xBA, 0xC6, 0xBB, 0x6D, 0x4D, 0x71, 0x21, 0xF4, 0x8D, 0xB0, 0xE5, 0x93, + 0xFE, 0x8F, 0xE6, 0xCF, 0x43, 0x45, 0x31, 0x22, 0x37, 0x36, 0x96, 0xFA, 0xBC, 0x0F, 0x08, 0x52, 0x1D, 0x55, 0x1A, 0xC5, + 0x4E, 0x23, 0x69, 0x7A, 0x92, 0xFF, 0x5B, 0x5A, 0xEB, 0x9A, 0x1C, 0xA9, 0xD1, 0x7E, 0x0D, 0xFC, 0x50, 0x8A, 0xB6, 0x62, + 0xF5, 0x0A, 0xF8, 0xDC, 0x03, 0x3C, 0x0C, 0x39, 0xF1, 0xB8, 0xF3, 0x3D, 0xF2, 0xD5, 0x97, 0x66, 0x81, 0x32, 0xA0, 0x00, + 0x06, 0xCE, 0xF6, 0xEA, 0xB7, 0x17, 0xF7, 0x8C, 0x79, 0xD6, 0xA7, 0xBF, 0x8B, 0x3F, 0x1F, 0x53, 0x63, 0x75, 0x35, 0x2C, + 0x60, 0xFD, 0x27, 0xD3, 0x94, 0xA5, 0x7C, 0xA1, 0x05, 0x58, 0x2D, 0xBD, 0xD9, 0xC7, 0xAF, 0x6B, 0x54, 0x0B, 0xE0, 0x38, + 0x04, 0xC8, 0x9D, 0xE7, 0x14, 0xB1, 0x87, 0x9C, 0xDF, 0x6F, 0xF9, 0xDA, 0x2A, 0xC4, 0x59, 0x16, 0x74, 0x91, 0xAB, 0x26, + 0x61, 0x76, 0x34, 0x2B, 0xAD, 0x99, 0xFB, 0x72, 0xEC, 0x33, 0x12, 0xDE, 0x98, 0x3B, 0xC0, 0x9B, 0x3E, 0x18, 0x10, 0x3A, + 0x56, 0xE1, 0x77, 0xC9, 0x1E, 0x9E, 0x95, 0xA3, 0x90, 0x19, 0xA8, 0x6C, 0x09, 0xD0, 0xF0, 0x86}; diff --git a/openair3/UICC/usim_interface.c b/openair3/UICC/usim_interface.c index fe91ff7d8d0..16bb6b25094 100644 --- a/openair3/UICC/usim_interface.c +++ b/openair3/UICC/usim_interface.c @@ -52,7 +52,7 @@ extern uint16_t NB_UE_INST; static uicc_t** uiccArray=NULL; -const char *hexTable="0123456789abcdef"; +const char *const hexTable = "0123456789abcdef"; static inline uint8_t mkDigit(unsigned char in) { for (int i=0; i<16; i++) if (tolower(in)==hexTable[i]) -- GitLab