From c3606017351d2161ae3241283ec5265b632f6091 Mon Sep 17 00:00:00 2001 From: WEI-TAI CHEN Date: Thu, 12 Jul 2018 02:10:56 -0700 Subject: [PATCH] fix error and warning --- cmake_targets/CMakeLists.txt | 1 + openair2/GNB_APP/gnb_app.c | 3 ++- openair2/GNB_APP/gnb_config.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 ++- ...hduler_primitives.c => gNB_scheduler_primitives.c} | 11 +++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 8 +++++--- openair2/RRC/NR/L2_nr_interface.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 8 files changed, 21 insertions(+), 13 deletions(-) rename openair2/LAYER2/NR_MAC_gNB/{gNB_scehduler_primitives.c => gNB_scheduler_primitives.c} (95%) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index c16a1317b8..7dba5c0393 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1471,6 +1471,7 @@ set (MAC_SRC ${NR_MAC_DIR}/config.c ${NR_MAC_DIR}/gNB_scheduler.c ${NR_MAC_DIR}/gNB_scheduler_bch.c + ${NR_MAC_DIR}/gNB_scheduler_primitives.c ) diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c index d4f8c3dbca..75b0289088 100644 --- a/openair2/GNB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -115,8 +115,9 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, return register_gnb_pending; } # endif -#endif */ +#endif + /*------------------------------------------------------------------------------*/ void *gNB_app_task(void *args_p) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index c09149b14d..9699dbada6 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -606,11 +606,11 @@ int RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { paramdef_t GNBParams[] = GNBPARAMS_DESC; paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; ////////// Physical parameters - //checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK; + checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK; paramdef_t CCsParams[] = NRCCPARAMS_DESC; paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0}; - //paramdef_t SRB1Params[] = SRB1PARAMS_DESC; + paramdef_t SRB1Params[] = SRB1PARAMS_DESC; /* get global parameters, defined outside any section in the config file */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 062f4b435c..a409bcdbc2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -176,6 +176,7 @@ void check_nr_ul_failure(module_id_t module_idP, } */ +/* void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { gNB_MAC_INST *gNB = RC.nrmac[module_idP]; @@ -257,7 +258,7 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram } // SRS config } } - +*/ void copy_nr_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) { int CC_id; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scehduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c similarity index 95% rename from openair2/LAYER2/NR_MAC_gNB/gNB_scehduler_primitives.c rename to openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cb03c7c29d..7b5d9ba8e4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scehduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -31,16 +31,20 @@ #include "assertions.h" +#include "LAYER2/MAC/mac.h" #include "LAYER2/NR_MAC_gNB/mac.h" #include "LAYER2/MAC/mac_extern.h" -#include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "UTIL/LOG/log.h" #include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" #include "OCG_extern.h" + +#include "RRC/LTE/rrc_extern.h" #include "RRC/NR/nr_rrc_extern.h" +#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" @@ -52,7 +56,7 @@ #include "T.h" #define ENABLE_MAC_PAYLOAD_DEBUG -#define DEBUG_eNB_SCHEDULER 1 +#define DEBUG_gNB_SCHEDULER 1 #include "common/ran_context.h" @@ -60,8 +64,7 @@ extern RAN_CONTEXT_t RC; extern int n_active_slices; -int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP) -{ +int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP){ // if FDD return dummy value if (ccP->tdd_Config == NULL) return (0); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 17e6cc15a7..551cffeed3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -5,8 +5,6 @@ #include "mac.h" #include "PHY/defs_nr_common.h" -void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP); - void mac_top_init_gNB(void); int rrc_mac_config_req_gNB(module_id_t Mod_idP, @@ -19,13 +17,17 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, NR_ServingCellConfigCommon_t *servingcellconfigcommon ); +int is_nr_UL_sf(NR_COMMON_channels_t * ccP, sub_frame_t subframeP); + void clear_nr_nfapi_information(gNB_MAC_INST * gNB, int CC_idP, frame_t frameP, - sub_frame_t subframeP) + sub_frame_t subframeP); void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP); +void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP); + #endif /*__LAYER2_NR_MAC_PROTO_H__*/ \ No newline at end of file diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 859b2d2f67..87f85faa2e 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -38,7 +38,7 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP, mib = &carrier->mib; if( (Srb_id & RAB_OFFSET ) == MIBCH) { - mib->message.choice.mib->systemFrameNumber.buf = sfn_msb[0] << 2; + mib->message.choice.mib->systemFrameNumber.buf[0] = sfn_msb << 2; enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message, NULL, (void *)mib, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index ca69b338e8..d502e907e9 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -207,7 +207,7 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier, //36.331 SFN BIT STRING (SIZE (8) , 38.331 SFN BIT STRING (SIZE (6)) uint8_t sfn_msb = (uint8_t)((frame>>4)&0x3f); mib->message.choice.mib->systemFrameNumber.buf = CALLOC(1,sizeof(uint8_t)); - mib->message.choice.mib->systemFrameNumber.buf = sfn_msb[0] << 2; + mib->message.choice.mib->systemFrameNumber.buf[0] = sfn_msb << 2; mib->message.choice.mib->systemFrameNumber.size = 1; mib->message.choice.mib->systemFrameNumber.bits_unused=2;