diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h index cdc5302320..627c052df5 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_ue_interface.h @@ -21,66 +21,6 @@ #include "stddef.h" -// Constants - update based on implementation -#define NFAPI_NR_MAX_PHY_RF_INSTANCES 2 -#define NFAPI_NR_PNF_PARAM_GENERAL_LOCATION_LENGTH 16 -#define NFAPI_NR_PNF_PARAM_GENERAL_OUI_LENGTH 3 -#define NFAPI_NR_MAX_NUM_RF_BANDS 16 - -// The following definition control the size of arrays used in the interface. -// These may be changed if desired. They are used in the encoder to make sure -// that the user has not specified a 'count' larger than the max array, and also -// used by the decoder when decode an array. If the 'count' received is larger -// than the array it is to be stored in the decode fails. -#define NFAPI_NR_MAX_NUM_ANTENNAS 8 -#define NFAPI_NR_MAX_NUM_SUBBANDS 13 -#define NFAPI_NR_MAX_BF_VECTORS 8 -#define NFAPI_NR_MAX_CC 1 -#define NFAPI_NR_MAX_NUM_PHYSICAL_ANTENNAS 8 -#define NFAPI_NR_MAX_RSSI 8 -#define NFAPI_NR_MAX_PSC_LIST 32 -#define NFAPI_NR_MAX_PCI_LIST 32 -#define NFAPI_NR_MAX_CARRIER_LIST 32 -#define NFAPI_NR_MAX_ARFCN_LIST 128 -#define NFAPI_NR_MAX_LTE_CELLS_FOUND 8 -#define NFAPI_NR_MAX_UTRAN_CELLS_FOUND 8 -#define NFAPI_NR_MAX_GSM_CELLS_FOUND 8 -#define NFAPI_NR_MAX_NB_IOT_CELLS_FOUND 8 -#define NFAPI_NR_MAX_SI_PERIODICITY 8 -#define NFAPI_NR_MAX_SI_INDEX 8 -#define NFAPI_NR_MAX_MIB_LENGTH 32 -#define NFAPI_NR_MAX_SIB_LENGTH 256 -#define NFAPI_NR_MAX_SI_LENGTH 256 -#define NFAPI_NR_MAX_OPAQUE_DATA 64 -#define NFAPI_NR_MAX_NUM_SCHEDULED_UES 8 // Used in the TPM structure -#define NFAPI_NR_MAX_PNF_PHY 5 -#define NFAPI_NR_MAX_PNF_PHY_RF_CONFIG 5 -#define NFAPI_NR_MAX_PNF_RF 5 -#define NFAPI_NR_MAX_NMM_FREQUENCY_BANDS 32 -#define NFAPI_NR_MAX_RECEIVED_INTERFERENCE_POWER_RESULTS 100 -#define NFAPI_NR_MAX_UL_DL_CONFIGURATIONS 5 -#define NFAPI_NR_MAX_CSI_RS_RESOURCE_CONFIG 4 -#define NFAPI_NR_MAX_ANTENNA_PORT_COUNT 8 -#define NFAPI_NR_MAX_EPDCCH_PRB 8 -#define NFAPI_NR_MAX_TX_PHYSICAL_ANTENNA_PORTS 8 -#define NFAPI_NR_MAX_NUMBER_ACK_NACK_TDD 8 -#define NFAPI_NR_MAX_RO_DL 8 - -#define NFAPI_NR_HEADER_LENGTH 8 -#define NFAPI_NR_P7_HEADER_LENGTH 16 - -#define NFAPI_NR_VENDOR_EXTENSION_MIN_TAG_VALUE 0xF000 -#define NFAPI_NR_VENDOR_EXTENSION_MAX_TAG_VALUE 0xFFFF - -#define NFAPI_NR_VERSION_3_0_11 0x000 -#define NFAPI_NR_VERSION_3_0_12 0x001 - -#define NFAPI_NR_HALF_FRAME_INDEX_FIRST_HALF 0 -#define NFAPI_NR_HALF_FRAME_INDEX_SECOND_HALF 1 - -// The IANA agreed port definition of the P5 SCTP VNF enpoint -// http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=7701 -#define NFAPI_NR_P5_SCTP_PORT 7701 #define NFAPI_NR_MAX_NUM_DL_ALLOCATIONS 16 @@ -328,6 +268,7 @@ typedef struct { } nfapi_nr_dl_config_request_t; + // // P5 // @@ -583,7 +524,28 @@ typedef struct { } nfapi_nr_ul_bwp_common_config_t; typedef struct { + uint8_t inter_slot_frequency_hopping; + uint8_t additional_dmrs; + uint8_t max_code_rate; + uint8_t number_of_slots; + uint8_t pi2bpsk; + uint8_t simultaneous_harq_ack_csi; + } nfapi_nr_pucch_format_config_t; + typedef struct { + nfapi_nr_pucch_format_config_t format1; + nfapi_nr_pucch_format_config_t format2; + nfapi_nr_pucch_format_config_t format3; + nfapi_nr_pucch_format_config_t format4; + nfapi_nr_pucch_resource_t multi_csi_pucch_resources[2]; + uint8_t dl_data_to_ul_ack[8]; + // pucch power control + uint8_t deltaF_pucch_f0; + uint8_t deltaF_pucch_f1; + uint8_t deltaF_pucch_f2; + uint8_t deltaF_pucch_f3; + uint8_t deltaF_pucch_f4; + uint8_t two_pucch_pc_adjusment_states; } nfapi_nr_ul_bwp_dedicated_config_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index c699ad5232..2c5be13cff 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -30,97 +30,100 @@ */ +#include "mac_proto.h" + int nr_rrc_mac_config_req_ue( - module_id_t Mod_idP, - int CC_idP, - uint8_t eNB_index, - MAC_CellGroupConfig_t *mac_cell_group_config, - PhysicalCellGroupConfig_t *phy_cell_group_config, - SpCellConfig_t *spcell_config){ + module_id_t module_id, + int CC_idP, + uint8_t gNB_index, + NR_MIB_t *mibP, + NR_MAC_CellGroupConfig_t *mac_cell_group_configP, + NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, + NR_SpCellConfig_t *spcell_configP ){ - NR_UE_MAC_INST *mac = get_mac_inst(Mod_idP); + NR_UE_MAC_INST *mac = get_mac_inst(module_id); ServingCellConfig_t *serving_cell_config = spcell_config->spCellConfigDedicated; // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. - if(mac_cell_group_config != (MAC_CellGroupConfig_t *)0){ - if(mac_cell_group_config->drx_Config != (drx_Config_t *)0 ){ - mac->drx_Config = mac_cell_group_config->drx_Config; + if(mib != NULL){ + + } + + if(mac_cell_group_configP != NULL){ + if(mac_cell_group_configP->drx_Config != NULL ){ + mac->drx_Config = mac_cell_group_configP->drx_Config; } - if(mac_cell_group_config->SchedulingRequestConfig != (SchedulingRequestConfig_t *)0 ){ - mac->SchedulingRequestConfig = mac_cell_group_config->SchedulingRequestConfig; + if(mac_cell_group_configP->SchedulingRequestConfig != NULL ){ + mac->SchedulingRequestConfig = mac_cell_group_configP->SchedulingRequestConfig; } - if(mac_cell_group_config->BSR_Config != (BSR_Config_t *)0 ){ - mac->BSR_Config = mac_cell_group_config->BSR_Config; + if(mac_cell_group_configP->BSR_Config != NULL ){ + mac->BSR_Config = mac_cell_group_configP->BSR_Config; } - if(mac_cell_group_config->TAG_Config != (TAG_Config_t *)0 ){ - mac->TAG_Config = mac_cell_group_config->TAG_Config; + if(mac_cell_group_configP->TAG_Config != NULL ){ + mac->TAG_Config = mac_cell_group_configP->TAG_Config; } - if(mac_cell_group_config->phr_Config != (phr_Config_t *)0 ){ - mac->phr_Config = mac_cell_group_config->phr_Config; + if(mac_cell_group_configP->phr_Config != NULL ){ + mac->phr_Config = mac_cell_group_configP->phr_Config; } - if(mac_cell_group_config->cs_RNTI != (cs_RNTI_t *)0 ){ - mac->cs_RNTI = mac_cell_group_config->cs_RNTI; + if(mac_cell_group_configP->cs_RNTI != NULL ){ + mac->cs_RNTI = mac_cell_group_configP->cs_RNTI; } } - if(phy_cell_group_config != (PhysicalCellGroupConfig_t *)0){ - config_phy(phy_cell_group_config, NULL); + if(phy_cell_group_configP != NULL ){ + //config_phy(phy_cell_group_config, NULL); } - if(serving_cell_config_config != (SpCellConfig_t *)0){ - config_phy(NULL, spcell_config); +// TODO check +/* + if(serving_cell_config_configP != NULL ){ + //config_phy(NULL, spcell_config); mac->servCellIndex = spcell_config->servCellIndex; } - if(serving_cell_config != (spCellConfigDedicated_t *)0){ - if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != (TDD_UL_DL_ConfigDedicated_t *)0){ + if(serving_cell_config != NULL ){ + if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != NULL ){ mac->tdd_UL_DL_ConfigurationDedicated = serving_cell_config->tdd_UL_DL_ConfigurationDedicated; } - if(spcell_config->initialDownlinkBWP != (BWP_DownlinkDedicated_t *)0){ + if(spcell_config->initialDownlinkBWP != NULL ){ mac->init_DL_BWP = spcell_config->initialDownlinkBWP; } // storage list of DL BWP config. TODO should be modify to maintain(add/release) a list inside MAC instance, this implementation just use for one-shot RRC configuration setting. - if(spcell_config->downlinkBWP_ToAddModList != (struct ServingCellConfig__downlinkBWP_ToAddModList *)0){ + if(spcell_config->downlinkBWP_ToAddModList != NULL ){ mac->BWP_Downlink_list = spcell_config->downlinkBWP_ToAddModList->list; mac->BWP_Downlink_count = spcell_config->downlinkBWP_ToAddModList->count; } - if(spcell_config->bwp_InactivityTimer != (long *)0){ + if(spcell_config->bwp_InactivityTimer != NULL ){ mac->bwp_InactivityTimer = spcell_config->bwp_InactivityTimer; } - if(spcell_config->defaultDownlinkBWP_Id != (BWP_Id_t *)0){ + if(spcell_config->defaultDownlinkBWP_Id != NULL ){ mac->defaultDownlinkBWP_Id = spcell_config->defaultDownlinkBWP_Id; } - if(spcell_config->pdsch_ServingCellConfig != (PDSCH_ServingCellConfig_t *)0){ + if(spcell_config->pdsch_ServingCellConfig != NULL ){ mac->pdsch_ServingCellConfig = spcell_config->pdsch_ServingCellConfig; } - if(spcell_config->csi_MeasConfig != (CSI_MeasConfig_t *)0){ + if(spcell_config->csi_MeasConfig != NULL ){ mac->csi_MeasConfig = spcell_config->csi_MeasConfig; } spcell_config->tag_Id = spcell_config.tag_Id; } - +*/ //scell config not yet - - - - - - return (0); } diff --git a/openair2/LAYER2/NR_MAC_UE/mac.h b/openair2/LAYER2/NR_MAC_UE/mac.h new file mode 100644 index 0000000000..253c855da8 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/mac.h @@ -0,0 +1,92 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file LAYER2/MAC/defs.h +* \brief MAC data structures, constant, and function prototype +* \author Navid Nikaein and Raymond Knopp +* \date 2011 +* \version 0.5 +* \email navid.nikaein@eurecom.fr + +*/ +/** @defgroup _oai2 openair2 Reference Implementation + * @ingroup _ref_implementation_ + * @{ + */ + +/*@}*/ + +#ifndef __LAYER2_MAC_DEFS_H__ +#define __LAYER2_MAC_DEFS_H__ + + + +#include +#include +#include + +#include "COMMON/platform_constants.h" +#include "BCCH-BCH-Message.h" +#include "RadioResourceConfigCommon.h" +#include "RadioResourceConfigCommonSIB.h" +#include "RadioResourceConfigDedicated.h" +#include "MeasGapConfig.h" +#include "SchedulingInfoList.h" +#include "TDD-Config.h" +#include "RACH-ConfigCommon.h" +#include "MeasObjectToAddModList.h" +#include "MobilityControlInfo.h" +#if defined(Rel10) || defined(Rel14) +#include "MBSFN-AreaInfoList-r9.h" +#include "MBSFN-SubframeConfigList.h" +#include "PMCH-InfoList-r9.h" +#include "SCellToAddMod-r10.h" +#endif +#ifdef Rel14 +#include "SystemInformationBlockType1-v1310-IEs.h" +#endif + +#include "nfapi_interface.h" +#include "PHY_INTERFACE/IF_Module.h" + +#include "PHY/TOOLS/time_meas.h" + +#include "PHY/defs_common.h" // for PRACH_RESOURCES_t + +#include "targets/ARCH/COMMON/common_lib.h" + +//solve implicit declaration +#include "PHY/LTE_ESTIMATION/lte_estimation.h" +#include "PHY/LTE_TRANSPORT/transport_proto.h" +#include "PHY/LTE_TRANSPORT/transport_common_proto.h" + +/** @defgroup _mac MAC + * @ingroup _oai2 + * @{ + */ + +/*!\brief Values of BCCH logical channel (fake)*/ +#define NR_BCCH_DL_SCH 3 // SI + +/*!\brief Values of PCCH logical channel (fake) */ +#define NR_BCCH_BCH 5 // MIB +/*@}*/ +#endif /*__LAYER2_MAC_DEFS_H__ */ diff --git a/openair2/LAYER2/NR_MAC_UE/defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h similarity index 100% rename from openair2/LAYER2/NR_MAC_UE/defs.h rename to openair2/LAYER2/NR_MAC_UE/mac_defs.h diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h new file mode 100644 index 0000000000..b8f18bf950 --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -0,0 +1,57 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file LAYER2/MAC/proto.h + * \brief MAC functions prototypes for eNB and UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \email navid.nikaein@eurecom.fr + * \version 1.0 + */ +#ifndef __LAYER2_MAC_PROTO_H__ +#define __LAYER2_MAC_PROTO_H__ + +#include "mac_defs.h" + +/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param extra_bits extra bits for frame calculation + \param ssb_index SSB index for frame calculation + \param frameP pointer to frame for revising after frame calculation + \param pduP pointer to pdu + \param pdu_length length of pdu*/ +void nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len); + + +/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param mibP pointer to RRC message MIB + \param mac_cell_group_configP pointer to RRC message MAC-related in cell group config + \param phy_cell_group_configP pointer to RRC message PHY-related in cell group config + \param spcell_configP pointer to RRC message serving cell config*/ +int nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP ){ + +#endif +/** @}*/ diff --git a/openair2/LAYER2/NR_MAC_UE/vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c similarity index 100% rename from openair2/LAYER2/NR_MAC_UE/vars.c rename to openair2/LAYER2/NR_MAC_UE/mac_vars.c diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c new file mode 100644 index 0000000000..c81ec73e3b --- /dev/null +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -0,0 +1,49 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file ue_procedures.c + * \brief procedures related to UE + * \author Navid Nikaein and Raymond Knopp + * \date 2010 - 2014 + * \version 1 + * \email: navid.nikaein@eurecom.fr + * @ingroup _mac + + */ +#include "mac_proto.h" +#include "RRC/NR_UE/proto.h" + +void +nr_ue_decode_mib( + module_id_t module_id, + int CC_id, + uint8_t gNB_index, + uint8_t extra_bits, + uint32_t ssb_index, + uint32_t *frameP, + void *pduP, + uint16_t pdu_len){ + + nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, frameP, + NR_BCCH_BCH, (uint8_t *) pduP, pdu_len ); + + // frame calculation +} diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c new file mode 100644 index 0000000000..2c51fe4c6c --- /dev/null +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -0,0 +1,57 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file l2_interface.c + * \brief layer 2 interface, used to support different RRC sublayer + * \author Raymond Knopp and Navid Nikaein + * \date 2010-2014 + * \version 1.0 + * \company Eurecom + * \email: raymond.knopp@eurecom.fr + */ + +#include "rrc_defs.h" +#include "rrc_proto.h" + +typedef uint32_t channel_t; + +int8_t +nr_mac_rrc_data_ind_ue( + const module_id_t module_id, + const int CC_id, + const uint8_t gNB_index, + const uint32_t* frameP, + const channel_t channel, + const uint8_t* pduP, + const sdu_size_t pdu_len){ + + switch(channel){ + case NR_BCCH_BCH: + nr_rrc_ue_decode_NR_BCCH_BCH_Message( module_id, gNB_index, (uint8_t*)pduP, pdu_len); + break; + default: + break; + } + + + return(0); + +} \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 5cc1f28f7a..a7155372a3 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -32,119 +32,11 @@ #define RRC_UE_C #include "rrc_list.h" -// header files for RRC message for NR might be change to add prefix in from of the file name. -#include "assertions.h" -#include "hashtable.h" -#include "asn1_conversions.h" -#include "defs.h" -#include "PHY/TOOLS/dB_routines.h" -#include "extern.h" -#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" -#include "LAYER2/RLC/rlc.h" -#include "COMMON/mac_rrc_primitives.h" -#include "UTIL/LOG/log.h" -#include "UTIL/LOG/vcd_signal_dumper.h" -#ifndef CELLULAR -#include "RRC/LITE/MESSAGES/asn1_msg.h" -#endif -#include "RRCConnectionRequest.h" -#include "RRCConnectionReconfiguration.h" -#include "UL-CCCH-Message.h" -#include "DL-CCCH-Message.h" -#include "UL-DCCH-Message.h" -#include "DL-DCCH-Message.h" -#include "BCCH-DL-SCH-Message.h" -#include "PCCH-Message.h" -#if defined(Rel10) || defined(Rel14) -#include "MCCH-Message.h" -#endif -#include "MeasConfig.h" -#include "MeasGapConfig.h" -#include "MeasObjectEUTRA.h" -#include "TDD-Config.h" -#include "UECapabilityEnquiry.h" -#include "UE-CapabilityRequest.h" -#include "RRC/NAS/nas_config.h" -#include "RRC/NAS/rb_config.h" -#if ENABLE_RAL -#include "rrc_UE_ral.h" -#endif - -#if defined(ENABLE_SECURITY) -# include "UTIL/OSA/osa_defs.h" -#endif - - -#if defined(ENABLE_ITTI) -#include "intertask_interface.h" -#endif - - - -// from NR SRB3 -uint8_t nr_rrc_ue_decode_dcch( - const uint8_t *buffer, - const uint32_t size -){ - // uper_decode by nr R15 rrc_connection_reconfiguration - - NR_DL_DCCH_Message_t *nr_dl_dcch_msg = (NR_DL_DCCH_Message_t *)0; - - uper_decode(NULL, - &asn_DEF_NR_DL_DCCH_Message, - (void**)&nr_dl_dcch_msg, - (uint8_t *)buffer, - size, 0, 0); - - if(nr_dl_dcch_msg != NULL){ - switch(nr_dl_dcch_msg->message.present){ - case DL_DCCH_MessageType_PR_c1: - - switch(nr_dl_dcch_msg->message.choice.c1.present){ - case DL_DCCH_MessageType__c1_PR_rrcReconfiguration: - nr_rrc_ue_process_rrcReconfiguration(&nr_dl_dcch_msg->message.choice.c1.choice.rrcReconfiguration); - break; - - case DL_DCCH_MessageType__c1_PR_NOTHING: - case DL_DCCH_MessageType__c1_PR_spare15: - case DL_DCCH_MessageType__c1_PR_spare14: - case DL_DCCH_MessageType__c1_PR_spare13: - case DL_DCCH_MessageType__c1_PR_spare12: - case DL_DCCH_MessageType__c1_PR_spare11: - case DL_DCCH_MessageType__c1_PR_spare10: - case DL_DCCH_MessageType__c1_PR_spare9: - case DL_DCCH_MessageType__c1_PR_spare8: - case DL_DCCH_MessageType__c1_PR_spare7: - case DL_DCCH_MessageType__c1_PR_spare6: - case DL_DCCH_MessageType__c1_PR_spare5: - case DL_DCCH_MessageType__c1_PR_spare4: - case DL_DCCH_MessageType__c1_PR_spare3: - case DL_DCCH_MessageType__c1_PR_spare2: - case DL_DCCH_MessageType__c1_PR_spare1: - default: - // not support or unuse - break; - } - break; - case DL_DCCH_MessageType_PR_NOTHING: - case DL_DCCH_MessageType_PR_messageClassExtension: - default: - // not support or unuse - break; - } - - // release memory allocation - free(nr_dl_dcch_msg); - }else{ - // log.. - } - - return 0; - -} +#include "rrc_defs.h" +#include "rrc_proto.h" // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) -uint8_t nr_rrc_ue_decode_secondary_cellgroup_config( +int8_t nr_rrc_ue_decode_secondary_cellgroup_config( const uint8_t *buffer, const uint32_t size ){ @@ -161,7 +53,8 @@ uint8_t nr_rrc_ue_decode_secondary_cellgroup_config( nr_rrc_ue_process_scg_config(cellGroupConfig); }else{ nr_rrc_ue_process_scg_config(cellGroupConfig); - asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + //asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + SEQUENCE_free(&asn_DEF_CellGroupConfig, (void *)cellGroupConfig, 0); } nr_rrc_mac_config_req_ue(); @@ -170,7 +63,7 @@ uint8_t nr_rrc_ue_decode_secondary_cellgroup_config( // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (decoded) // RRCReconfiguration -uint8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration){ +int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration){ switch(rrcReconfiguration.criticalExtensions.present){ case RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration: @@ -197,7 +90,8 @@ uint8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfi }else{ // after first time, update it and free the memory after. nr_rrc_ue_process_scg_config(cellGroupConfig); - asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + //asn_DEF_CellGroupConfig.free_struct(asn_DEF_CellGroupConfig, cellGroupConfig, 0); + SEQUENCE_free(&asn_DEF_CellGroupConfig, (void *)cellGroupConfig, 0); } } @@ -228,11 +122,11 @@ uint8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfi nr_rrc_mac_config_req_ue(); } -uint8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ +int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ } -uint8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ +int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ int i; void *listobj; if(NR_UE_rrc_inst->cell_group_config==NULL){ @@ -274,12 +168,12 @@ uint8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ } } } -uint8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config){ +int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config){ } -uint8_t openair_rrc_top_init_ue_nr(void){ +int8_t openair_rrc_top_init_ue_nr(void){ if(NB_NR_UE_INST > 0){ NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); @@ -318,22 +212,140 @@ uint8_t openair_rrc_top_init_ue_nr(void){ } -uint8_t nr_ue_process_rlc_bearer_list(NR_CellGroupConfig_t *cell_group_config){ +int8_t nr_ue_process_rlc_bearer_list(NR_CellGroupConfig_t *cell_group_config){ }; -uint8_t nr_ue_process_secondary_cell_list(NR_CellGroupConfig_t *cell_group_config){ +int8_t nr_ue_process_secondary_cell_list(NR_CellGroupConfig_t *cell_group_config){ }; -uint8_t nr_ue_process_mac_cell_group_config(NR_MAC_CellGroupConfig_t *mac_cell_group_config){ +int8_t nr_ue_process_mac_cell_group_config(NR_MAC_CellGroupConfig_t *mac_cell_group_config){ }; -uint8_t nr_ue_process_physical_cell_group_config(NR_PhysicalCellGroupConfig_t *phy_cell_group_config){ +int8_t nr_ue_process_physical_cell_group_config(NR_PhysicalCellGroupConfig_t *phy_cell_group_config){ }; -uint8_t nr_ue_process_spcell_config(NR_SpCellConfig_t *spcell_config){ +int8_t nr_ue_process_spcell_config(NR_SpCellConfig_t *spcell_config){ }; + +/*brief decode BCCH-BCH (MIB) message*/ +int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( + const module_id_t module_id, + const uint8_t gNB_index, + uint8_t *const bufferP, + const uint8_t buffer_len){ + int i; + NR_BCCH_BCH_Message_t *bcch_message = NULL; + NR_MIB_t *mib = NR_UE_rrc_inst->mib; + + asn_dec_rval_t dec_rval = uper_decode_complete( NULL, + &asn_DEF_NR_BCCH_BCH_Message, + (void **)&bcch_message, + (const void *)bufferP, + buffer_len ); + + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { + LOG_E( RRC, "[UE %"PRIu8"] Failed to decode BCCH_DLSCH_MESSAGE (%zu bits)\n", + module_id, + dec_rval.consumed ); + + for (i=0; imessage.choice.mib, + sizeof(NR_MIB_t) ); + + nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL); + + return 0; +} + + +// from NR SRB3 +int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message( + const module_id_t module_id, + const uint8_t gNB_index, + const uint8_t *bufferP, + const uint32_t buffer_len){ + // uper_decode by nr R15 rrc_connection_reconfiguration + + NR_DL_DCCH_Message_t *nr_dl_dcch_msg = (NR_DL_DCCH_Message_t *)0; + + asn_dec_rval_t dec_rval = uper_decode( NULL, + &asn_DEF_NR_DL_DCCH_Message, + (void**)&nr_dl_dcch_msg, + (uint8_t *)bufferP, + buffer_len, 0, 0); + + if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) { + LOG_E( RRC, "[UE %"PRIu8"] Failed to decode NR_DL_DCCH_Message (%zu bits)\n", + module_id, + dec_rval.consumed ); + + for (i=0; imessage.present){ + case DL_DCCH_MessageType_PR_c1: + + switch(nr_dl_dcch_msg->message.choice.c1.present){ + case DL_DCCH_MessageType__c1_PR_rrcReconfiguration: + nr_rrc_ue_process_rrcReconfiguration(&nr_dl_dcch_msg->message.choice.c1.choice.rrcReconfiguration); + break; + + case DL_DCCH_MessageType__c1_PR_NOTHING: + case DL_DCCH_MessageType__c1_PR_spare15: + case DL_DCCH_MessageType__c1_PR_spare14: + case DL_DCCH_MessageType__c1_PR_spare13: + case DL_DCCH_MessageType__c1_PR_spare12: + case DL_DCCH_MessageType__c1_PR_spare11: + case DL_DCCH_MessageType__c1_PR_spare10: + case DL_DCCH_MessageType__c1_PR_spare9: + case DL_DCCH_MessageType__c1_PR_spare8: + case DL_DCCH_MessageType__c1_PR_spare7: + case DL_DCCH_MessageType__c1_PR_spare6: + case DL_DCCH_MessageType__c1_PR_spare5: + case DL_DCCH_MessageType__c1_PR_spare4: + case DL_DCCH_MessageType__c1_PR_spare3: + case DL_DCCH_MessageType__c1_PR_spare2: + case DL_DCCH_MessageType__c1_PR_spare1: + default: + // not support or unuse + break; + } + break; + case DL_DCCH_MessageType_PR_NOTHING: + case DL_DCCH_MessageType_PR_messageClassExtension: + default: + // not support or unuse + break; + } + + // release memory allocation + SEQUENCE_free( &asn_DEF_NR_DL_DCCH_Message, (void *)nr_dl_dcch_msg, 1 ); + }else{ + // log.. + } + + return 0; + +} diff --git a/openair2/RRC/NR_UE/defs.h b/openair2/RRC/NR_UE/rrc_defs.h similarity index 52% rename from openair2/RRC/NR_UE/defs.h rename to openair2/RRC/NR_UE/rrc_defs.h index 1eea863ab8..dbf445821b 100644 --- a/openair2/RRC/NR_UE/defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -36,122 +36,22 @@ #include #include "rrc_list.h" +/*#include "NR_MeasConfig.h" +#include "NR_CellGroupConfig.h" +#include "NR_RadioBearerConfig.h" +#include "NR_RLC_Bearer_Config_t" +#include "asn1_constants.h" +#include "NR_SchedulingRequestToAddMod.h"*/ -#include "collection/tree.h" -#include "rrc_types.h" -#include "PHY/defs.h" -#include "LAYER2/RLC/rlc.h" - -#include "COMMON/platform_constants.h" -#include "COMMON/platform_types.h" - -#include "LAYER2/MAC/defs.h" - -#include "SystemInformationBlockType1.h" -#include "SystemInformation.h" -#include "RRCConnectionReconfiguration.h" -#include "RRCConnectionReconfigurationComplete.h" -#include "RRCConnectionSetup.h" -#include "RRCConnectionSetupComplete.h" -#include "RRCConnectionRequest.h" -#include "RRCConnectionReestablishmentRequest.h" -#include "BCCH-DL-SCH-Message.h" -#include "BCCH-BCH-Message.h" -#if defined(Rel10) || defined(Rel14) -#include "MCCH-Message.h" -#include "MBSFNAreaConfiguration-r9.h" -#include "SCellToAddMod-r10.h" -#endif -#include "AS-Config.h" -#include "AS-Context.h" -#include "UE-EUTRA-Capability.h" -#include "MeasResults.h" - -/* for ImsiMobileIdentity_t */ -#include "MobileIdentity.h" +#define NB_NR_UE_INST 1 typedef struct NR_UE_RRC_INST_s { - nr_rrc_state_t rrc_state; - nr_rrc_sub_state_t rrc_sub_state; -#if 0 - OAI_UECapability_t *UECap; - uint8_t *UECapability; - uint8_t UECapability_size; - UE_RRC_INFO Info[NB_SIG_CNX_UE]; - SRB_INFO Srb0[NB_SIG_CNX_UE]; - SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; - SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; - HANDOVER_INFO_UE HandoverInfoUe; - uint8_t *SIB1[NB_CNX_UE]; - uint8_t sizeof_SIB1[NB_CNX_UE]; - uint8_t *SI[NB_CNX_UE]; - uint8_t sizeof_SI[NB_CNX_UE]; - uint8_t SIB1Status[NB_CNX_UE]; - uint8_t SIStatus[NB_CNX_UE]; - SystemInformationBlockType1_t *sib1[NB_CNX_UE]; - SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI(). - SystemInformationBlockType2_t *sib2[NB_CNX_UE]; - SystemInformationBlockType3_t *sib3[NB_CNX_UE]; - SystemInformationBlockType4_t *sib4[NB_CNX_UE]; - SystemInformationBlockType5_t *sib5[NB_CNX_UE]; - SystemInformationBlockType6_t *sib6[NB_CNX_UE]; - SystemInformationBlockType7_t *sib7[NB_CNX_UE]; - SystemInformationBlockType8_t *sib8[NB_CNX_UE]; - SystemInformationBlockType9_t *sib9[NB_CNX_UE]; - SystemInformationBlockType10_t *sib10[NB_CNX_UE]; - SystemInformationBlockType11_t *sib11[NB_CNX_UE]; -#if defined(Rel10) || defined(Rel14) - uint8_t MBMS_flag; - uint8_t *MCCH_MESSAGE[NB_CNX_UE]; - uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE]; - uint8_t MCCH_MESSAGEStatus[NB_CNX_UE]; - MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE]; - SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE]; - SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE]; -#endif -#ifdef CBA - uint8_t num_active_cba_groups; - uint16_t cba_rnti[NUM_MAX_CBA_GROUP]; -#endif - uint8_t num_srb; - struct SRB_ToAddMod *SRB1_config[NB_CNX_UE]; - struct SRB_ToAddMod *SRB2_config[NB_CNX_UE]; - struct DRB_ToAddMod *DRB_config[NB_CNX_UE][8]; - rb_id_t *defaultDRB; // remember the ID of the default DRB - MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ]; - struct ReportConfigToAddMod *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG]; - struct QuantityConfig *QuantityConfig[NB_CNX_UE]; - struct MeasIdToAddMod *MeasId[NB_CNX_UE][MAX_MEAS_ID]; - MEAS_REPORT_LIST *measReportList[NB_CNX_UE][MAX_MEAS_ID]; - uint32_t measTimer[NB_CNX_UE][MAX_MEAS_ID][6]; // 6 neighboring cells - RSRP_Range_t s_measure; - struct MeasConfig__speedStatePars *speedStatePars; - struct PhysicalConfigDedicated *physicalConfigDedicated[NB_CNX_UE]; - struct SPS_Config *sps_Config[NB_CNX_UE]; - MAC_MainConfig_t *mac_MainConfig[NB_CNX_UE]; - MeasGapConfig_t *measGapConfig[NB_CNX_UE]; - double filter_coeff_rsrp; // [7] ??? - double filter_coeff_rsrq; // [7] ??? - float rsrp_db[7]; - float rsrq_db[7]; - float rsrp_db_filtered[7]; - float rsrq_db_filtered[7]; -#if defined(ENABLE_SECURITY) - /* KeNB as computed from parameters within USIM card */ - uint8_t kenb[32]; - uint8_t nh[32]; - int8_t nh_ncc; -#endif + NR_MeasConfig_t *meas_config; + NR_CellGroupConfig_t *cell_group_config; + NR_RadioBearerConfig_t *radio_bearer_config; - /* Used integrity/ciphering algorithms */ - CipheringAlgorithm_r12_t ciphering_algorithm; - e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; -#endif - - NR_MeasConfig_t *meas_config; - NR_CellGroupConfig_t *cell_group_config; - NR_RadioBearerConfig_t *radio_bearer_config; + NR_MIB_t *mib; // lists // CellGroupConfig.rlc-BearerToAddModList @@ -200,9 +100,6 @@ typedef struct NR_UE_RRC_INST_s { RRC_LIST_TYPE(NR_CSI_ResourceConfig_t, NR_maxNrofCSI_ResourceConfigurations) CSI_ResourceConfig_list; // CellGroupConfig.spCellConfig.spCellConfigDedicated RRC_LIST_TYPE(NR_CSI_ReportConfig_t, NR_maxNrofCSI_ReportConfigurations) CSI_ReportConfig_list; - - - } NR_UE_RRC_INST_t; diff --git a/openair2/RRC/NR_UE/rrc_list.h b/openair2/RRC/NR_UE/rrc_list.h index 7dfa0006c7..5bad103dd4 100644 --- a/openair2/RRC/NR_UE/rrc_list.h +++ b/openair2/RRC/NR_UE/rrc_list.h @@ -1,4 +1,5 @@ - +#ifndef _RRC_LIST_H_ +#define _RRC_LIST_H_ #define RRC_LIST_TYPE(T, N) \ @@ -14,61 +15,61 @@ #define RRC_LIST_INIT(list, c) \ do { \ int iterator; \ - (list).count = (c); \ + (list).count = (c); \ for(iterator=0; iteratorid_name == (list).entries[iterator]->id_name){ \ + if((new)->id_name == (list).entries[iterator]->id_name){ \ (list).entries[iterator] = (new); \ - break; \ - } \ - } \ - if(iterator==-1){ \ - for(iterator=0; iterator<(list).count; ++iterator){ \ - if((list).entries[iterator] == NULL){ \ + break; \ + } \ + } \ + if(iterator==-1){ \ + for(iterator=0; iterator<(list).count; ++iterator){ \ + if((list).entries[iterator] == NULL){ \ (list).next[iterator] = (list).start; \ - (list).prev[iterator] = -1; \ - if((list).start != -1){ \ - (list).prev[list.start] = iterator; \ - } \ - (list).start = iterator; \ + (list).prev[iterator] = -1; \ + if((list).start != -1){ \ + (list).prev[list.start] = iterator; \ + } \ + (list).start = iterator; \ (list).entries[iterator] = (new); \ - break; \ - } \ - } \ - } \ + break; \ + } \ + } \ + } \ }while(0) // search entries by id, unlink from the list and output free pointer for upper function to release memory -#define RRC_LIST_MOD_REL(list, id_name, id, free) \ - do{ \ - int iterator; \ +#define RRC_LIST_MOD_REL(list, id_name, id, free) \ + do{ \ + int iterator; \ for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \ - if(id == (list).entries[iterator]->id_name){ \ - if((list).prev[iterator] == -1){ \ + if(id == (list).entries[iterator]->id_name){ \ + if((list).prev[iterator] == -1){ \ (list).start = (list).next[iterator]; \ - }else{ \ - (list).next[(list).prev[iterator]] = (list).next[iterator]; \ - } \ - if((list).next[iterator] != -1){ \ - (list).prev[(list).next[iterator]] = (list).prev[iterator]; \ - } \ + }else{ \ + (list).next[(list).prev[iterator]] = (list).next[iterator]; \ + } \ + if((list).next[iterator] != -1){ \ + (list).prev[(list).next[iterator]] = (list).prev[iterator]; \ + } \ (free) = (list).entries[iterator]; \ - (list).entries[iterator] = NULL; \ - break; \ - } \ - } \ + (list).entries[iterator] = NULL; \ + break; \ + } \ + } \ }while(0) @@ -78,10 +79,4 @@ #define RRC_LIST_ENTRY(list, i) \ list.entries[i] - - - - - - - +#endif \ No newline at end of file diff --git a/openair2/RRC/NR_UE/proto.h b/openair2/RRC/NR_UE/rrc_proto.h similarity index 60% rename from openair2/RRC/NR_UE/proto.h rename to openair2/RRC/NR_UE/rrc_proto.h index 6e876297f6..1cbf2884af 100644 --- a/openair2/RRC/NR_UE/proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -30,8 +30,10 @@ /** \addtogroup _rrc * @{ */ +#ifndef _RRC_PROTO_H_ +#define _RRC_PROTO_H_ -#include "defs.h" +#include "rrc_defs.h" // // main_rrc.c @@ -46,34 +48,54 @@ int nr_l3_init_ue(void); /**\brief Initial the top level RRC structure instance*/ uint8_t openair_rrc_top_init_ue_nr(void); -/**\brief Decode DCCH from gNB, sent from lower layer through SRB3 - \param buffer encoded DCCH bytes stream message - \param size length of buffer*/ -int8_t nr_rrc_ue_decode_dcch(const uint8_t *buffer, const uint32_t size); + /**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config - \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. - \param size length of buffer*/ + \param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message. + \param size length of buffer*/ //TODO check to use which one int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size); int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const uint32_t size); - + /**\brief Process NR RRC connection reconfiguration via SRB3 - \param rrcReconfiguration decoded rrc connection reconfiguration*/ + \param rrcReconfiguration decoded rrc connection reconfiguration*/ int8_t nr_rrc_ue_process_rrcReconfiguration(RRCReconfiguration_t *rrcReconfiguration); /**\prief Process measurement config from NR RRC connection reconfiguration message - \param meas_config measurement configuration*/ + \param meas_config measurement configuration*/ int8_t nr_rrc_ue_process_meas_config(MeasConfig_t *meas_config); /**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives - \param cell_group_config secondary cell group configuration*/ + \param cell_group_config secondary cell group configuration*/ //TODO check EN-DC function call flow. int8_t nr_rrc_ue_process_scg_config(CellGroupConfig_t *cell_group_config); /**\prief Process radio bearer config from NR RRC connection reconfiguration message - \param radio_bearer_config radio bearer configuration*/ + \param radio_bearer_config radio bearer configuration*/ int8_t nr_rrc_ue_process_radio_bearer_config(RadioBearerConfig_t *radio_bearer_config); +/**\brief decode NR BCCH-BCH (MIB) message + \param module_idP module id + \param gNB_index gNB index + \param sduP pointer to buffer of ASN message BCCH-BCH + \param sdu_len length of buffer*/ +int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len); + +/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3 + \param buffer encoded DCCH bytes stream message + \param size length of buffer*/ +int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const uint8_t *buffer, const uint32_t size); + +/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP) + \param module_id module id + \param CC_id component carrier id + \param gNB_index gNB index + \param frameP pointer to frame for calculation + \param channel indicator for channel of the pdu + \param pduP pointer to pdu + \param pdu_len data length of pdu*/ +int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const uint32_t *frameP, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len); + /** @}*/ +#endif \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_types.h b/openair2/RRC/NR_UE/rrc_types.h deleted file mode 100644 index b5540145b0..0000000000 --- a/openair2/RRC/NR_UE/rrc_types.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file rrc_types.h -* \brief rrc types and subtypes -* \author Navid Nikaein and Raymond Knopp -* \date 2011 - 2014 -* \version 1.0 -* \company Eurecom -* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr -*/ - -#ifndef NR_RRC_TYPES_H_ -#define NR_RRC_TYPES_H_ - -typedef enum nr_rrc_state_e { - //RRC_STATE_INACTIVE=0, - //RRC_STATE_IDLE, - //RRC_STATE_CONNECTED, - - //RRC_STATE_FIRST = RRC_STATE_INACTIVE, - //RRC_STATE_LAST = RRC_STATE_CONNECTED, - RRC_STATE_IDLE = 0, - RRC_STATE_INACTIVE, - RRC_STATE_CONNECTED, - - RRC_STATE_FIRST = RRC_STATE_IDLE, - RRC_STATE_LAST = RRC_STATE_CONNECTED - -} nr_rrc_state_t; - -typedef enum nr_rrc_sub_state_e { - //RRC_SUB_STATE_INACTIVE=0, - - //RRC_SUB_STATE_IDLE_SEARCHING, - //RRC_SUB_STATE_IDLE_RECEIVING_SIB, - //RRC_SUB_STATE_IDLE_SIB_COMPLETE, - //RRC_SUB_STATE_IDLE_CONNECTING, - //RRC_SUB_STATE_IDLE, - - //RRC_SUB_STATE_CONNECTED, - - //RRC_SUB_STATE_INACTIVE_FIRST = RRC_SUB_STATE_INACTIVE, - //RRC_SUB_STATE_INACTIVE_LAST = RRC_SUB_STATE_INACTIVE, - - //RRC_SUB_STATE_IDLE_FIRST = RRC_SUB_STATE_IDLE_SEARCHING, - //RRC_SUB_STATE_IDLE_LAST = RRC_SUB_STATE_IDLE, - - //RRC_SUB_STATE_CONNECTED_FIRST = RRC_SUB_STATE_CONNECTED, - //RRC_SUB_STATE_CONNECTED_LAST = RRC_SUB_STATE_CONNECTED, -} nr_rrc_sub_state_t; - -#endif /* RRC_TYPES_H_ */ diff --git a/openair2/RRC/NR_UE/vars.h b/openair2/RRC/NR_UE/vars.h index f21b49e916..7c3e6d6cc0 100644 --- a/openair2/RRC/NR_UE/vars.h +++ b/openair2/RRC/NR_UE/vars.h @@ -38,4 +38,5 @@ #include "LAYER2/MAC/defs.h" NR_UE_RRC_INST_t *NR_UE_rrc_inst; + #endif