Commit a8709f03 authored by Calvin HSU's avatar Calvin HSU

ue add MIB RX primitives and RRC

parent 5d7b79c2
...@@ -1319,12 +1319,14 @@ add_library(PHY_RU ${PHY_SRC_RU}) ...@@ -1319,12 +1319,14 @@ add_library(PHY_RU ${PHY_SRC_RU})
#Layer 2 library #Layer 2 library
##################### #####################
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE)
set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE) set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC) set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC)
set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0) set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0)
set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0) set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0)
set(RLC_TM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0) set(RLC_TM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0)
set(RRC_DIR ${OPENAIR2_DIR}/RRC/LTE) set(RRC_DIR ${OPENAIR2_DIR}/RRC/LTE)
set(NR_UE_RRC_DIR ${OPENAIR2_DIR}/RRC/NR_UE)
set(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0) set(PDCP_DIR ${OPENAIR2_DIR}/LAYER2/PDCP_v10.1.0)
set(L2_SRC set(L2_SRC
${OPENAIR2_DIR}/LAYER2/openair2_proc.c ${OPENAIR2_DIR}/LAYER2/openair2_proc.c
...@@ -1411,6 +1413,9 @@ set(L2_SRC_UE ...@@ -1411,6 +1413,9 @@ set(L2_SRC_UE
${RRC_DIR}/rrc_common.c ${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface_common.c ${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c ${RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
) )
set (MAC_SRC set (MAC_SRC
...@@ -1442,6 +1447,10 @@ set (MAC_SRC_UE ...@@ -1442,6 +1447,10 @@ set (MAC_SRC_UE
${MAC_DIR}/l1_helpers.c ${MAC_DIR}/l1_helpers.c
${MAC_DIR}/rar_tools_ue.c ${MAC_DIR}/rar_tools_ue.c
${MAC_DIR}/config_ue.c ${MAC_DIR}/config_ue.c
${NR_UE_MAC_DIR}/config_ue.c
${NR_UE_MAC_DIR}/mac_vars.c
${NR_UE_MAC_DIR}/main_ue_nr.c
${NR_UE_MAC_DIR}/nr_ue_procedures.c
) )
set (ENB_APP_SRC set (ENB_APP_SRC
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -29,98 +29,101 @@ ...@@ -29,98 +29,101 @@
* @ingroup _mac * @ingroup _mac
*/ */
#include "defs.h"
#include "proto.h"
int int
nr_rrc_mac_config_req_ue( nr_rrc_mac_config_req_ue(
module_id_t Mod_idP, module_id_t module_id,
int CC_idP, int CC_idP,
uint8_t eNB_index, uint8_t gNB_index,
MAC_CellGroupConfig_t *mac_cell_group_config, NR_MIB_t *mibP,
PhysicalCellGroupConfig_t *phy_cell_group_config, NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
SpCellConfig_t *spcell_config){ 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_t *mac = get_mac_inst(module_id);
ServingCellConfig_t *serving_cell_config = spcell_config->spCellConfigDedicated; // NR_ServingCellConfig_t *serving_cell_config = spcell_configP->spCellConfigDedicated;
// TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. // 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(mibP != NULL){
if(mac_cell_group_config->drx_Config != (drx_Config_t *)0 ){ ;
mac->drx_Config = mac_cell_group_config->drx_Config;
} }
if(mac_cell_group_config->SchedulingRequestConfig != (SchedulingRequestConfig_t *)0 ){ if(mac_cell_group_configP != NULL){
mac->SchedulingRequestConfig = mac_cell_group_config->SchedulingRequestConfig; if(mac_cell_group_configP->drx_Config != NULL ){
mac->drx_Config = mac_cell_group_configP->drx_Config;
} }
if(mac_cell_group_config->BSR_Config != (BSR_Config_t *)0 ){ if(mac_cell_group_configP->schedulingRequestConfig != NULL ){
mac->BSR_Config = mac_cell_group_config->BSR_Config; mac->schedulingRequestConfig = mac_cell_group_configP->schedulingRequestConfig;
} }
if(mac_cell_group_config->TAG_Config != (TAG_Config_t *)0 ){ if(mac_cell_group_configP->bsr_Config != NULL ){
mac->TAG_Config = mac_cell_group_config->TAG_Config; mac->bsr_Config = mac_cell_group_configP->bsr_Config;
} }
if(mac_cell_group_config->phr_Config != (phr_Config_t *)0 ){ if(mac_cell_group_configP->tag_Config != NULL ){
mac->phr_Config = mac_cell_group_config->phr_Config; mac->tag_Config = mac_cell_group_configP->tag_Config;
} }
if(mac_cell_group_config->cs_RNTI != (cs_RNTI_t *)0 ){ if(mac_cell_group_configP->phr_Config != NULL ){
mac->cs_RNTI = mac_cell_group_config->cs_RNTI; mac->phr_Config = mac_cell_group_configP->phr_Config;
}
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){ if(phy_cell_group_configP != NULL ){
config_phy(phy_cell_group_config, NULL); //config_phy(phy_cell_group_config, NULL);
} }
if(serving_cell_config_config != (SpCellConfig_t *)0){ // TODO check
config_phy(NULL, spcell_config); #if 0
if(serving_cell_config_configP != NULL ){
//config_phy(NULL, spcell_config);
mac->servCellIndex = spcell_config->servCellIndex; mac->servCellIndex = spcell_config->servCellIndex;
} }
if(serving_cell_config != (spCellConfigDedicated_t *)0){ if(serving_cell_config != NULL ){
if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != (TDD_UL_DL_ConfigDedicated_t *)0){ if(serving_cell_config->tdd_UL_DL_ConfigurationDedicated != NULL ){
mac->tdd_UL_DL_ConfigurationDedicated = serving_cell_config->tdd_UL_DL_ConfigurationDedicated; 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; 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. // 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_list = spcell_config->downlinkBWP_ToAddModList->list;
mac->BWP_Downlink_count = spcell_config->downlinkBWP_ToAddModList->count; 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; 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; 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; 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; mac->csi_MeasConfig = spcell_config->csi_MeasConfig;
} }
spcell_config->tag_Id = spcell_config.tag_Id; spcell_config->tag_Id = spcell_config.tag_Id;
} }
#endif
//scell config not yet //scell config not yet
return 0;
return (0);
} }
\ No newline at end of file
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
/*@}*/ /*@}*/
#ifndef __LAYER2_MAC_DEFS_H__ #ifndef __LAYER2_NR_MAC_DEFS_H__
#define __LAYER2_MAC_DEFS_H__ #define __LAYER2_NR_MAC_DEFS_H__
...@@ -43,66 +43,37 @@ ...@@ -43,66 +43,37 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "PHY/defs.h" #include "platform_types.h"
#include "PHY/LTE_TRANSPORT/defs.h"
#include "COMMON/platform_constants.h"
#include "BCCH-BCH-Message.h"
#include "RadioResourceConfigCommon.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 "NR_DRX-Config.h"
#include "NR_SchedulingRequestConfig.h"
#include "NR_BSR-Config.h"
#include "NR_TAG-Config.h"
#include "NR_PHR-Config.h"
#include "NR_RNTI-Value.h"
#include "NR_MIB.h"
#include "NR_MAC-CellGroupConfig.h"
#include "NR_PhysicalCellGroupConfig.h"
#include "NR_SpCellConfig.h"
#include "NR_ServingCellConfig.h"
#define NB_NR_UE_MAC_INST 1
/*!\brief Top level UE MAC structure */ /*!\brief Top level UE MAC structure */
typedef struct { typedef struct {
//// MAC config //// MAC config
drx_Config_t *drx_config; NR_DRX_Config_t *drx_Config; /* OPTIONAL */
SchedulingRequestConfig_t *SchedulingRequestConfig; NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */
BSR_Config_t *BSR_Config; NR_BSR_Config_t *bsr_Config; /* OPTIONAL */
TAG_Config_t *TAG_Config; NR_TAG_Config_t *tag_Config; /* OPTIONAL */
phr_Config_t *phr_Config; NR_PHR_Config_t *phr_Config; /* OPTIONAL */
cs_RNTI_t *cs_RNTI;
ServCellIndex_t *servCellIndex; NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */
//// Serving cell config } NR_UE_MAC_INST_t;
TDD_UL_DL_ConfigDedicated_t *tdd_UL_DL_ConfigurationDedicated;
// init DL BWP
BWP_DownlinkDedicated_t *init_DL_BWP;
// DL BWP list, not default one
BWP_Downlink_t **BWP_Downlink_list;
int BWP_Downlink_count;
//BWP_Id_t *firstActiveDownlinkBWP_Id;
long *bwp_InactivityTimer;
BWP_Id_t *defaultDownlinkBWP_Id;
//struct UplinkConfig *uplinkConfig;
//struct UplinkConfig *supplementaryUplink;
PDSCH_ServingCellConfig_t *pdsch_ServingCellConfig;
CSI_MeasConfig_t *csi_MeasConfig;
//SRS_CarrierSwitching_t *carrierSwitching;
//long *sCellDeactivationTimer /* OPTIONAL */;
//struct CrossCarrierSchedulingConfig *crossCarrierSchedulingConfig /* OPTIONAL */;
TAG_Id_t tag_Id;
//long *ue_BeamLockFunction /* OPTIONAL */;
//long *pathlossReferenceLinking /* OPTIONAL */;
} UE_MAC_INST;
#include "proto.h"
/*@}*/ /*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */ #endif /*__LAYER2_MAC_DEFS_H__ */
/*
* 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#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__ */
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
*/ */
UE_MAC_INST_t UE_mac_inst; //[NB_MODULE_MAX]; #include "defs.h"
NR_UE_MAC_INST_t UE_mac_inst; //[NB_MODULE_MAX];
...@@ -31,17 +31,15 @@ ...@@ -31,17 +31,15 @@
#include "defs.h" #include "defs.h"
#include "proto.h" #include "proto.h"
#include "extern.h"
#include "assertions.h"
static NR_UE_MAC_INST_t *nr_ue_mac_inst; static NR_UE_MAC_INST_t *nr_ue_mac_inst;
int int
nr_l2_init_ue(void) nr_l2_init_ue(void)
{ {
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); //LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
LOG_I(MAC, "[MAIN] init UE MAC functions \n"); //LOG_I(MAC, "[MAIN] init UE MAC functions \n");
//init mac here //init mac here
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST); nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST);
...@@ -50,6 +48,6 @@ nr_l2_init_ue(void) ...@@ -50,6 +48,6 @@ nr_l2_init_ue(void)
return (1); return (1);
} }
NR_UE_MAC_INST_t *get_mac_inst(Module_id_t Mod_idP){ NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP){
return &nr_ue_mac_inst[(int)Mod_idP]; return &nr_ue_mac_inst[(int)Mod_idP];
} }
/*
* 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 "proto.h"
#include "RRC/NR_UE/rrc_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
}
/*
* 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 "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 );
int nr_l2_init_ue(void);
NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP);
#endif
/** @}*/
/*
* 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 vars.h
* \brief mac vars
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
#ifndef __MAC_VARS_H__
#define __MAC_VARS_H__
#ifdef USER_MODE
//#include "stdio.h"
#endif //USER_MODE
#include "PHY/defs.h"
#include "defs.h"
#include "PHY_INTERFACE/defs.h"
#include "COMMON/mac_rrc_primitives.h"
const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57,67,78,91,
105,125,146,171,200,234,274,321,376,440,515,603,706,826,967,1132,
1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099,
16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000
};
// extended bsr table--currently not used
const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,
181,223,274,337,414,509,625,769,945,1162,1429,
1757,2161,2657,3267,4017,4940,6074,7469,9185,
11294,13888,17077,20999,25822,31752,39045,48012,
59039,72598,89272,109774,134986,165989,204111,
250990,308634,379519,466683,573866,705666,867737,
1067031,1312097,1613447,1984009,2439678,3000000,
6000000};
//#define MAX_SIZE_OF_AGG3 576
//#define MAX_SIZE_OF_AGG2 288
//#define MAX_SIZE_OF_AGG1 144
//#define MAX_SIZE_OF_AGG0 72
/*
* If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise
* this is also dependent to transmission mode, where an offset could be defined
*/
// the follwoing three tables are calibrated for TXMODE 1 and 2
const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits
//{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44
};
const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55
};
const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59
{3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64
};
//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181};
MAC_xface *mac_xface;
uint32_t RRC_CONNECTION_FLAG;
UE_MAC_INST *UE_mac_inst; //[NB_MODULE_MAX];
eNB_MAC_INST *eNB_mac_inst; //[NB_MODULE_MAX];
MAC_RLC_XFACE *Mac_rlc_xface;
/// Primary component carrier index of eNB
int pCC_id[NUMBER_OF_eNB_MAX];
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
/*
#ifndef USER_MODE
RRC_XFACE *Rrc_xface;
MAC_xface *mac_xface;
#else
#include "PHY_INTERFACE/extern.h"
#include "RRC/LITE/extern.h"
#endif
*/
uint8_t Is_rrc_registered;
#ifdef OPENAIR2
unsigned char NB_eNB_INST=0;
unsigned char NB_UE_INST=0;
unsigned char NB_RN_INST=0;
unsigned char NB_INST=0;
#endif
DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
#if defined(Rel10) || defined(Rel14)
DCI1C_5MHz_t MCCH_alloc_pdu;
#endif
DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
#endif
...@@ -19,53 +19,39 @@ ...@@ -19,53 +19,39 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file rrc_types.h /*! \file l2_interface.c
* \brief rrc types and subtypes * \brief layer 2 interface, used to support different RRC sublayer
* \author Navid Nikaein and Raymond Knopp * \author Raymond Knopp and Navid Nikaein
* \date 2011 - 2014 * \date 2010-2014
* \version 1.0 * \version 1.0
* \company Eurecom * \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr * \email: 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 { #include "rrc_defs.h"
//RRC_SUB_STATE_INACTIVE=0, #include "rrc_proto.h"
//RRC_SUB_STATE_IDLE_SEARCHING, typedef uint32_t channel_t;
//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, 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){
//RRC_SUB_STATE_INACTIVE_FIRST = RRC_SUB_STATE_INACTIVE, switch(channel){
//RRC_SUB_STATE_INACTIVE_LAST = RRC_SUB_STATE_INACTIVE, case NR_BCCH_BCH:
nr_rrc_ue_decode_NR_BCCH_BCH_Message( module_id, gNB_index, (uint8_t*)pduP, pdu_len);
break;
default:
break;
}
//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, return(0);
//RRC_SUB_STATE_CONNECTED_LAST = RRC_SUB_STATE_CONNECTED,
} nr_rrc_sub_state_t;
#endif /* RRC_TYPES_H_ */ }
\ No newline at end of file
/*
* 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/LITE/defs.h
* \brief RRC struct definitions and function prototypes
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_NR_RRC_DEFS_H__
#define __OPENAIR_NR_RRC_DEFS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.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"
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
/* Used integrity/ciphering algorithms */
CipheringAlgorithm_r12_t ciphering_algorithm;
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
#endif
MeasConfig_t *meas_config;
CellGroupConfig_t *cell_group_config;
RadioBearerConfig_t *radio_bearer_config;
} NR_UE_RRC_INST_t;
#include "proto.h"
#endif
/** @} */
#include "defs.h" #include "defs.h"
#include "proto.h" #include "rrc_proto.h"
#include "extern.h"
#include "assertions.h"
int nr_l3_init_ue(void){ int nr_l3_init_ue(void){
LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n");
......
This diff is collapsed.
/*
* 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/LITE/defs.h
* \brief RRC struct definitions and function prototypes
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
*/
#ifndef __OPENAIR_NR_RRC_DEFS_H__
#define __OPENAIR_NR_RRC_DEFS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "platform_types.h"
#include "LAYER2/NR_MAC_UE/mac.h"
#include "rrc_list.h"
#include "NR_asn_constant.h"
#include "NR_MeasConfig.h"
#include "NR_CellGroupConfig.h"
#include "NR_RadioBearerConfig.h"
#include "NR_RLC-Bearer-Config.h"
#include "asn1_constants.h"
#include "NR_SchedulingRequestToAddMod.h"
#include "NR_MIB.h"
#include "NR_BCCH-BCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#define NB_NR_UE_INST 1
typedef uint32_t channel_t;
typedef struct NR_UE_RRC_INST_s {
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
RRC_LIST_TYPE(NR_RLC_Bearer_Config_t, NR_maxLC_ID) RLC_Bearer_Config_list;
// CellGroupConfig.mac-CellGroupConfig.schedulingrequest
RRC_LIST_TYPE(NR_SchedulingRequestToAddMod_t, NR_maxNrofSR_ConfigPerCellGroup) SchedulingRequest_list;
// CellGroupConfig.mac-CellGroupConfig.TAG
RRC_LIST_TYPE(NR_TAG_ToAddMod_t, NR_maxNrofTAGs) TAG_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated.tdduldlslotconfig
RRC_LIST_TYPE(NR_TDD_UL_DL_SlotConfig_t, NR_maxNrofSlots) TDD_UL_DL_SlotConfig_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated.bwps
RRC_LIST_TYPE(NR_BWP_Downlink_t, NR_maxNrofBWPs) BWP_Downlink_list;
//BWP-DownlinkDedicated 0=INIT-DL-BWP, 1..4 for DL-BWPs
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.controlresourceset
RRC_LIST_TYPE(NR_ControlResourceSet_t, 3) ControlResourceSet_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.searchspace
RRC_LIST_TYPE(NR_SearchSpace_t, 10) SearchSpace_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.slotformatindicator
RRC_LIST_TYPE(NR_SlotFormatCombinationsPerCell_t, NR_maxNrofAggregatedCellsPerCellGroup) SlotFormatCombinationsPerCell_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_TCI_State_t, NR_maxNrofTCI_States) TCI_State_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_RateMatchPattern_t, NR_maxNrofRateMatchPatterns) RateMatchPattern_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_Resource_t, NR_maxNrofZP_CSI_RS_Resources) ZP_CSI_RS_Resource_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) Aperidic_ZP_CSI_RS_ResourceSet_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) SP_ZP_CSI_RS_ResourceSet_list[5];
// TODO check the way to implement mutiple list inside bwps
// uplink bwp also
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_NZP_CSI_RS_Resource_t, NR_maxNrofNZP_CSI_RS_Resources) NZP_CSI_RS_Resource_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_NZP_CSI_RS_ResourceSet_t, NR_maxNrofNZP_CSI_RS_ResourceSets) NZP_CSI_RS_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_IM_Resource_t, NR_maxNrofCSI_IM_Resources) CSI_IM_Resource_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_IM_ResourceSet_t, NR_maxNrofCSI_IM_ResourceSets) CSI_IM_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_SSB_ResourceSet_t, NR_maxNrofCSI_SSB_ResourceSets) CSI_SSB_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
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;
#endif
/** @} */
#ifndef _RRC_LIST_H_
#define _RRC_LIST_H_
#define RRC_LIST_TYPE(T, N) \
struct { \
T *entries[N]; \
int next[N]; \
int prev[N]; \
int start; \
int count; \
}
// initial function for the certain list, storage number of entry, initial pointer and corresponding links
#define RRC_LIST_INIT(list, c) \
do { \
int iterator; \
(list).count = (c); \
for(iterator=0; iterator<c; ++iterator){ \
(list).entries[iterator] = NULL; \
(list).next[iterator] = -1; \
(list).prev[iterator] = -1; \
(list).start = -1; \
} \
}while(0)
// check the entry by id first then update or create new entry.
#define RRC_LIST_MOD_ADD(list, new, id_name) \
do { \
int iterator; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
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){ \
(list).next[iterator] = (list).start; \
(list).prev[iterator] = -1; \
if((list).start != -1){ \
(list).prev[list.start] = iterator; \
} \
(list).start = iterator; \
(list).entries[iterator] = (new); \
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; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
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]; \
} \
(free) = (list).entries[iterator]; \
(list).entries[iterator] = NULL; \
break; \
} \
} \
}while(0)
#define RRC_LIST_FOREACH(list, i) \
for((i)=(list).start; (i) != -1; (i)=(list).next[i])
#define RRC_LIST_ENTRY(list, i) \
list.entries[i]
#endif
\ No newline at end of file
...@@ -30,9 +30,15 @@ ...@@ -30,9 +30,15 @@
/** \addtogroup _rrc /** \addtogroup _rrc
* @{ * @{
*/ */
#ifndef _RRC_PROTO_H_
#define _RRC_PROTO_H_
#include "defs.h"
#include "rrc_defs.h"
#include "NR_RRCReconfiguration.h"
#include "NR_MeasConfig.h"
#include "NR_CellGroupConfig.h"
#include "NR_RadioBearerConfig.h"
// //
// main_rrc.c // main_rrc.c
// //
...@@ -44,12 +50,9 @@ int nr_l3_init_ue(void); ...@@ -44,12 +50,9 @@ int nr_l3_init_ue(void);
// //
/**\brief Initial the top level RRC structure instance*/ /**\brief Initial the top level RRC structure instance*/
uint8_t openair_rrc_top_init_ue_nr(void); int8_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 /**\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 buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message.
...@@ -61,19 +64,44 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const ...@@ -61,19 +64,44 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const
/**\brief Process NR RRC connection reconfiguration via SRB3 /**\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); int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration);
/**\prief Process measurement config from NR RRC connection reconfiguration message /**\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); int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config);
/**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives /**\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. //TODO check EN-DC function call flow.
int8_t nr_rrc_ue_process_scg_config(CellGroupConfig_t *cell_group_config); int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config);
/**\prief Process radio bearer config from NR RRC connection reconfiguration message /**\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); int8_t nr_rrc_ue_process_radio_bearer_config(NR_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 module_id module id
\param gNB_index gNB index
\param buffer encoded DCCH bytes stream message
\param size length of buffer*/
int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, 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
...@@ -32,10 +32,8 @@ ...@@ -32,10 +32,8 @@
#ifndef __OPENAIR_NR_RRC_VARS_H__ #ifndef __OPENAIR_NR_RRC_VARS_H__
#define __OPENAIR_NR_RRC_VARS_H__ #define __OPENAIR_NR_RRC_VARS_H__
#include "defs.h" #include "rrc_defs.h"
#include "LAYER2/RLC/rlc.h"
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/defs.h"
NR_UE_RRC_INST_t *NR_UE_rrc_inst; NR_UE_RRC_INST_t *NR_UE_rrc_inst;
#endif #endif
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
//typedef char bool; //typedef char bool;
#include <stdbool.h> #include <stdbool.h>
#include "omg_constants.h"
#ifdef STANDALONE #ifdef STANDALONE
typedef struct { typedef struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment