Commit 91968d84 authored by Calvin's avatar Calvin

P5 message UL/DL BWP Common/Dedicated finish, primitibes of MIB RX/RRC decode done

parent 7c770135
......@@ -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 {
......
......@@ -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);
}
/*
* 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__ */
/*
* 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
/** @}*/
/*
* 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
}
......@@ -19,53 +19,39 @@
* 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;
/*! \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
*/
typedef enum nr_rrc_sub_state_e {
//RRC_SUB_STATE_INACTIVE=0,
#include "rrc_defs.h"
#include "rrc_proto.h"
//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,
typedef uint32_t channel_t;
//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,
//RRC_SUB_STATE_INACTIVE_LAST = RRC_SUB_STATE_INACTIVE,
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;
}
//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;
return(0);
#endif /* RRC_TYPES_H_ */
}
\ No newline at end of file
This diff is collapsed.
......@@ -36,122 +36,22 @@
#include <string.h>
#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
/* 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_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;
......
#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; iterator<c; ++iterator){ \
(list).entries[iterator] = NULL; \
(list).next[iterator] = -1; \
(list).prev[iterator] = -1; \
(list).start = -1; \
(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; \
#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){ \
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
......@@ -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
......@@ -38,4 +38,5 @@
#include "LAYER2/MAC/defs.h"
NR_UE_RRC_INST_t *NR_UE_rrc_inst;
#endif
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