Commit a0d58f22 authored by hardy's avatar hardy

Merge remote-tracking branch 'origin/NR_SA_NGAP_RRC_wk42' into integration_2020_wk48

parents 40141270 be31d514
This diff is collapsed.
......@@ -66,6 +66,7 @@ UE_TIMING_TRACE="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
NR="False"
ITTI_SIM="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc"
trap handle_ctrl_c INT
......@@ -159,6 +160,8 @@ Options
Build for I/Q record-playback modes
-k | --skip-shared-libraries
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
--ittiSIM
Makes the itti simulator
-h | --help
Print this help
......@@ -413,6 +416,11 @@ function main() {
CMAKE_CMD="$CMAKE_CMD -GNinja"
MAKE_CMD=ninja
shift;;
--ittiSIM)
ittiSIM=1
ITTI_SIM="True"
echo_info "Will compile itti simulator"
shift;;
-h | --help)
print_help
exit 1;;
......@@ -571,7 +579,7 @@ function main() {
config_libconfig_shlib=params_libconfig
# first generate the CMakefile in the right directory
if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then
if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" ] ; then
# softmodem compilation
......@@ -595,6 +603,7 @@ function main() {
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build
eval $CMAKE_CMD
......@@ -616,6 +625,10 @@ function main() {
execlist="$execlist nr-uesoftmodem"
fi
if [ "$ittiSIM" = "1" ] ; then
execlist="$execlist nr-ittisim"
fi
for f in $execlist ; do
echo_info "Compiling $f..."
compilations \
......
......@@ -16,4 +16,5 @@ set ( UE_DEBUG_TRACE False )
set ( UE_TIMING_TRACE False )
set ( USRP_REC_PLAY False )
set ( SKIP_SHARED_LIB_FLAG False )
set ( PHYSIM True)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
......@@ -19,6 +19,10 @@ if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
fi
if [ "$ASN1C_PREFIX" = "NGAP_" ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}VolumeTimedReport-Item.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}VolumeTimedReport-Item.c
fi
fi
touch $done_flag
......@@ -445,6 +445,7 @@ int logInit (void)
register_log_component("NR_RRC","log",NR_RRC);
register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_PHY","log",NR_PHY);
register_log_component("NGAP","",NGAP);
for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
......
......@@ -226,6 +226,7 @@ typedef enum {
X2AP,
M2AP,
M3AP,
NGAP,
GNB_APP,
NR_RRC,
NR_MAC,
......
......@@ -400,6 +400,27 @@ ID = LEGACY_S1AP_TRACE
GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_INFO
DESC = NGAP legacy logs - info level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_ERROR
DESC = NGAP legacy logs - error level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_WARNING
DESC = NGAP legacy logs - warning level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_DEBUG
DESC = NGAP legacy logs - debug level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_TRACE
DESC = NGAP legacy logs - trace level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_X2AP_INFO
DESC = X2AP legacy logs - info level
GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_INFO:LEGACY
......
......@@ -49,11 +49,14 @@ typedef enum {
MSC_RLC_ENB,
MSC_PDCP_ENB,
MSC_RRC_ENB,
MSC_RRC_GNB,
MSC_IP_ENB,
MSC_S1AP_ENB,
MSC_NGAP_GNB,
MSC_GTPU_ENB,
MSC_GTPU_SGW,
MSC_S1AP_MME,
MSC_NGAP_AMF,
MSC_MMEAPP_MME,
MSC_NAS_MME,
MSC_NAS_EMM_MME,
......
......@@ -16,3 +16,8 @@
#include "openair2/COMMON/gtpv1_u_messages_def.h"
#include "openair2/COMMON/flexran_messages_def.h"
#include "openair2/COMMON/f1ap_messages_def.h"
#include "openair2/COMMON/ngap_messages_def.h"
#if ITTI_SIM
#include "openair2/COMMON/itti_sim_messages_def.h"
#endif
......@@ -230,6 +230,7 @@ typedef struct IttiMsgText_s {
#include <openair2/COMMON/sctp_messages_types.h>
#include <openair2/COMMON/udp_messages_types.h>
#include <openair2/COMMON/gtpv1_u_messages_types.h>
#include <openair2/COMMON/ngap_messages_types.h>
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/NAS/UE/nas_proc_defs.h>
#include <openair3/NAS/UE/ESM/esmData.h>
......@@ -260,6 +261,11 @@ typedef struct IttiMsgText_s {
void *rrc_enb_process_itti_msg(void *);
#include <openair3/SCTP/sctp_eNB_task.h>
#include <openair3/S1AP/s1ap_eNB.h>
#include <openair3/NGAP/ngap_gNB.h>
#ifdef ITTI_SIM
#include <openair2/COMMON/itti_sim_messages_types.h>
#endif
/*
static const char *const messages_definition_xml = {
......@@ -312,6 +318,7 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL,NULL)\
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NGAP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
......@@ -329,6 +336,7 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_RLC_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_PDCP_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\
......@@ -336,6 +344,8 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_MAX, TASK_PRIORITY_MED, 200, NULL, NULL)
#define TASK_DEF(TaskID, pRIO, qUEUEsIZE, FuNc, ThreadFunc) { pRIO, qUEUEsIZE, #TaskID, FuNc, ThreadFunc },
......
......@@ -83,6 +83,8 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "executables/thread-common.h"
#include "NB_IoT_interface.h"
#include "x2ap_eNB.h"
#include "ngap_gNB.h"
#include "gnb_paramdef.h"
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
......@@ -387,30 +389,52 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return -1;
}*/
if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0){
LOG_E(SCTP, "Create task for SCTP failed\n");
return -1;
LOG_E(SCTP, "Create task for SCTP failed\n");
return -1;
}
if (is_x2ap_enabled()) {
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0){
LOG_E(X2AP, "Create task for X2AP failed\n");
}
if(itti_create_task(TASK_X2AP, x2ap_task, NULL) < 0){
LOG_E(X2AP, "Create task for X2AP failed\n");
}
}
else {
LOG_I(X2AP, "X2AP is disabled.\n");
LOG_I(X2AP, "X2AP is disabled.\n");
}
}
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++){
if( NETParams[i].strptr == NULL){
LOG_E(NGAP, "No configuration in the file.\n");
NGAP_CONF_MODE = 0;
}
else {
LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr);
}
}
if (EPC_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (gnb_nb > 0) {
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
/*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
return -1;
}
if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(S1AP, "Create task for S1AP failed\n");
return -1;
}*/
*/
if(NGAP_CONF_MODE){
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(NGAP, "Create task for NGAP failed\n");
return -1;
}
} else {
LOG_E(NGAP, "Ngap task not created\n");
}
if(!emulate_rf){
......@@ -430,9 +454,9 @@ int create_gNB_tasks(uint32_t gnb_nb) {
if (gnb_nb > 0) {
if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
return -1;
}
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
return -1;
}
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
......@@ -821,7 +845,8 @@ int main( int argc, char **argv )
}
openair0_cfg[0].threequarter_fs = threequarter_fs;
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
if (get_softmodem_params()->do_ra)
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
......
......@@ -776,7 +776,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
#endif
void pdcch_scrambling(NR_DL_FRAME_PARMS *frame_parms,
#if 0
void nr_pdcch_scrambling(NR_DL_FRAME_PARMS *frame_parms,
uint8_t nr_tti_rx,
uint8_t *e,
uint32_t length) {
......@@ -799,6 +800,7 @@ void pdcch_scrambling(NR_DL_FRAME_PARMS *frame_parms,
e[i] = (e[i]&1) ^ ((s>>(i&0x1f))&1);
}
}
#endif
#ifdef NR_PDCCH_DCI_RUN
......
......@@ -1124,7 +1124,7 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, int uci_size)
break;
}
else {
pucch_resource_set_id = 1;
pucch_resource_set_id = 1;
return (pucch_resource_set_id);
break;
}
......
......@@ -235,8 +235,8 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL
void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap);
void prepare_scc(NR_ServingCellConfigCommon_t *scc);
s1ap_eNB_config_t s1ap_config;
uint32_t s1ap_generate_eNB_id(void) {return 0;}
ngap_gNB_config_t ngap_config;
uint32_t ngap_generate_gNB_id(void) {return 0;}
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) { return;}
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { return;}
......
/*
* 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 itti_sim_messages_def.h
* \brief itti message for itti simulator
* \author Yoshio INOUE, Masayuki HARADA
* \email yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
* \date 2020
* \version 0.1
*/
MESSAGE_DEF(GNB_RRC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBBCCHind)
MESSAGE_DEF(GNB_RRC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBCCCHind)
MESSAGE_DEF(GNB_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, GNBDCCHind)
MESSAGE_DEF(UE_RRC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, UECCCHind)
MESSAGE_DEF(UE_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED, itti_sim_rrc_ch_t, UEDCCHind)
/*
* 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 itti_sim_messages_types.h
* \brief itti message for itti simulator
* \author Yoshio INOUE, Masayuki HARADA
* \email yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
* \date 2020
* \version 0.1
*/
#ifndef ITTI_SIM_MESSAGES_TYPES_H_
#define ITTI_SIM_MESSAGES_TYPES_H_
#include "LTE_asn_constant.h"
#define GNB_RRC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBBCCHind
#define GNB_RRC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBCCCHind
#define GNB_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.GNBDCCHind
#define UE_RRC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.UECCCHind
#define UE_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.UEDCCHind
typedef struct itti_sim_rrc_ch_s {
rb_id_t rbid;
uint8_t *sdu;
int size;
} itti_sim_rrc_ch_t;
#endif /* ITTI_SIM_MESSAGES_TYPES_H_ */
......@@ -41,10 +41,16 @@ MESSAGE_DEF(RRC_MAC_CCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDat
MESSAGE_DEF(RRC_MAC_CCCH_DATA_CNF, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataCnf, rrc_mac_ccch_data_cnf)
MESSAGE_DEF(RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacCcchDataInd, rrc_mac_ccch_data_ind)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataReq, rrc_mac_mcch_data_req)
MESSAGE_DEF(RRC_MAC_MCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacMcchDataInd, rrc_mac_mcch_data_ind)
MESSAGE_DEF(RRC_MAC_PCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacPcchDataReq, rrc_mac_pcch_data_req)
/* RRC configures DRX context (MAC timers) of a UE */
MESSAGE_DEF(RRC_MAC_DRX_CONFIG_REQ, MESSAGE_PRIORITY_MED, rrc_mac_drx_config_req_t, rrc_mac_drx_config_req)
\ No newline at end of file
MESSAGE_DEF(RRC_MAC_DRX_CONFIG_REQ, MESSAGE_PRIORITY_MED, rrc_mac_drx_config_req_t, rrc_mac_drx_config_req)
// gNB
MESSAGE_DEF(NR_RRC_MAC_CCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacCcchDataInd, nr_rrc_mac_ccch_data_ind)
MESSAGE_DEF(NR_RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacBcchDataInd, nr_rrc_mac_bcch_data_ind)
......@@ -38,6 +38,7 @@
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_ind
#define NR_RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_bcch_data_ind
#define RRC_MAC_BCCH_MBMS_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_req
#define RRC_MAC_BCCH_MBMS_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_ind
......@@ -45,6 +46,7 @@
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_cnf
#define RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_ind
#define NR_RRC_MAC_CCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_ccch_data_ind
#define RRC_MAC_MCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_mcch_data_req
#define RRC_MAC_MCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_mcch_data_ind
......@@ -86,6 +88,15 @@ typedef struct RrcMacBcchDataInd_s {
uint8_t rsrp;
} RrcMacBcchDataInd;
typedef struct NRRrcMacBcchDataInd_s {
uint32_t frame;
uint8_t sub_frame;
uint32_t sdu_size;
uint8_t sdu[BCCH_SDU_SIZE];
uint8_t gnb_index;
uint8_t rsrq;
uint8_t rsrp;
} NRRrcMacBcchDataInd;
typedef struct RrcMacBcchMbmsDataReq_s {
uint32_t frame;
......@@ -126,6 +137,16 @@ typedef struct RrcMacCcchDataInd_s {
int CC_id;
} RrcMacCcchDataInd;
typedef struct NRRrcMacCcchDataInd_s {
uint32_t frame;
uint8_t sub_frame;
uint16_t rnti;
uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE];
uint8_t gnb_index;
int CC_id;
} NRRrcMacCcchDataInd;
typedef struct RrcMacMcchDataReq_s {
uint32_t frame;
uint32_t sdu_size;
......
/*
* 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
*/
/*
* ngap_messages_def.h
*
* Created on: 2020
* Author: Yoshio INOUE, Masayuki HARADA
* Email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com)
*/
/* Messages for NGAP logging */
MESSAGE_DEF(NGAP_UPLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_uplink_nas_log)
MESSAGE_DEF(NGAP_UE_CAPABILITY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_capability_ind_log)
MESSAGE_DEF(NGAP_INITIAL_CONTEXT_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_initial_context_setup_log)
MESSAGE_DEF(NGAP_NAS_NON_DELIVERY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_nas_non_delivery_ind_log)
MESSAGE_DEF(NGAP_DOWNLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_downlink_nas_log)
MESSAGE_DEF(NGAP_S1_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_s1_setup_log)
MESSAGE_DEF(NGAP_INITIAL_UE_MESSAGE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_initial_ue_message_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_req_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMMAND_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_command_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMPLETE_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_complete_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_log)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_setup_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_setup_response_log)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_modify_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_modify_response_log)
MESSAGE_DEF(NGAP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_paging_log)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_release_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_release_response_log)
MESSAGE_DEF(NGAP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_error_indication_log)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_path_switch_req_log)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_ACK_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_path_switch_req_ack_log)
/* gNB application layer -> NGAP messages */
MESSAGE_DEF(NGAP_REGISTER_GNB_REQ , MESSAGE_PRIORITY_MED, ngap_register_gnb_req_t , ngap_register_gnb_req)
/* NGAP -> gNB application layer messages */
MESSAGE_DEF(NGAP_REGISTER_GNB_CNF , MESSAGE_PRIORITY_MED, ngap_register_gnb_cnf_t , ngap_register_gnb_cnf)
MESSAGE_DEF(NGAP_DEREGISTERED_GNB_IND , MESSAGE_PRIORITY_MED, ngap_deregistered_gnb_ind_t , ngap_deregistered_gnb_ind)
/* RRC -> NGAP messages */
MESSAGE_DEF(NGAP_NAS_FIRST_REQ , MESSAGE_PRIORITY_MED, ngap_nas_first_req_t , ngap_nas_first_req)
MESSAGE_DEF(NGAP_UPLINK_NAS , MESSAGE_PRIORITY_MED, ngap_uplink_nas_t , ngap_uplink_nas)
MESSAGE_DEF(NGAP_UE_CAPABILITIES_IND , MESSAGE_PRIORITY_MED, ngap_ue_cap_info_ind_t , ngap_ue_cap_info_ind)
MESSAGE_DEF(NGAP_INITIAL_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, ngap_initial_context_setup_resp_t, ngap_initial_context_setup_resp)
MESSAGE_DEF(NGAP_INITIAL_CONTEXT_SETUP_FAIL, MESSAGE_PRIORITY_MED, ngap_initial_context_setup_fail_t, ngap_initial_context_setup_fail)
MESSAGE_DEF(NGAP_NAS_NON_DELIVERY_IND , MESSAGE_PRIORITY_MED, ngap_nas_non_delivery_ind_t , ngap_nas_non_delivery_ind)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_RESP , MESSAGE_PRIORITY_MED, ngap_ue_release_resp_t , ngap_ue_release_resp)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMPLETE, MESSAGE_PRIORITY_MED, ngap_ue_release_complete_t , ngap_ue_release_complete)
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_RESP , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_resp_t , ngap_ue_ctxt_modification_resp)
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_FAIL , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_fail_t , ngap_ue_ctxt_modification_fail)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_RESP , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_resp_t , ngap_pdusession_setup_resp)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_req_fail_t , ngap_pdusession_setup_request_fail)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_RESP , MESSAGE_PRIORITY_MED, ngap_pdusession_modify_resp_t , ngap_pdusession_modify_resp)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, ngap_pdusession_release_resp_t , ngap_pdusession_release_resp)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, ngap_path_switch_req_t , ngap_path_switch_req)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, ngap_path_switch_req_ack_t , ngap_path_switch_req_ack)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFICATION_IND , MESSAGE_PRIORITY_MED, ngap_pdusession_modification_ind_t , ngap_pdusession_modification_ind)
/* NGAP -> RRC messages */
MESSAGE_DEF(NGAP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, ngap_downlink_nas_t , ngap_downlink_nas )
MESSAGE_DEF(NGAP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, ngap_initial_context_setup_req_t , ngap_initial_context_setup_req )
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_REQ , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_req_t , ngap_ue_ctxt_modification_req)
MESSAGE_DEF(NGAP_PAGING_IND , MESSAGE_PRIORITY_MED, ngap_paging_ind_t , ngap_paging_ind )
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQ , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_req_t , ngap_pdusession_setup_req )
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_REQ , MESSAGE_PRIORITY_MED, ngap_pdusession_modify_req_t , ngap_pdusession_modify_req )
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_COMMAND , MESSAGE_PRIORITY_MED, ngap_pdusession_release_command_t , ngap_pdusession_release_command)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMMAND, MESSAGE_PRIORITY_MED, ngap_ue_release_command_t , ngap_ue_release_command)
/* NGAP <-> RRC messages (can be initiated either by MME or gNB) */
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_REQ , MESSAGE_PRIORITY_MED, ngap_ue_release_req_t , ngap_ue_release_req)
This diff is collapsed.
......@@ -31,3 +31,6 @@
MESSAGE_DEF(RRC_DCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataReq, rrc_dcch_data_req)
MESSAGE_DEF(RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcDcchDataInd, rrc_dcch_data_ind)
MESSAGE_DEF(RRC_PCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcPcchDataReq, rrc_pcch_data_req)
// gNB
MESSAGE_DEF(NR_RRC_DCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcDcchDataInd, nr_rrc_dcch_data_ind)
......@@ -35,6 +35,9 @@
#define RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_dcch_data_ind
#define RRC_PCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_pcch_data_req
// gNB
#define NR_RRC_DCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_dcch_data_ind
//-------------------------------------------------------------------------------------------//
// Messages between RRC and PDCP layers
typedef struct RrcDcchDataReq_s {
......@@ -61,6 +64,16 @@ typedef struct RrcDcchDataInd_s {
uint8_t eNB_index; // LG: needed in UE
} RrcDcchDataInd;
typedef struct NRRrcDcchDataInd_s {
uint32_t frame;
uint8_t dcch_index;
uint32_t sdu_size;
uint8_t *sdu_p;
uint16_t rnti;
uint8_t module_id;
uint8_t gNB_index; // LG: needed in UE
} NRRrcDcchDataInd;
typedef struct RrcPcchDataReq_s {
uint32_t sdu_size;
uint8_t *sdu_p;
......
......@@ -299,6 +299,12 @@ typedef struct protocol_ctxt_s {
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
#define PROTOCOL_NR_CTXT_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \
((CTXT_Pp)->enb_flag == GNB_FLAG_YES) ? "gNB":" UE", \
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
#define CHECK_CTXT_ARGS(CTXT_Pp)
#define exit_fun(msg) exit_function(__FILE__,__FUNCTION__,__LINE__,msg)
......
......@@ -74,6 +74,7 @@ TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200)
/// Non Access Stratum task
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
......@@ -81,3 +82,8 @@ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
//MESSAGE GENERATOR TASK
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200)
#ifdef ITTI_SIM
TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200)
#endif
......@@ -39,7 +39,7 @@
#include "x2ap_eNB.h"
#include "intertask_interface.h"
#include "s1ap_eNB.h"
#include "ngap_gNB.h"
#include "sctp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#include "PHY/INIT/phy_init.h"
......@@ -75,26 +75,29 @@ static void configure_nr_rrc(uint32_t gnb_id)
static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, const Enb_properties_array_t *enb_properties)
{
uint32_t gnb_id;
//MessageDef *msg_p;
MessageDef *msg_p;
uint32_t register_gnb_pending = 0;
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
{
//s1ap_register_enb_req_t *s1ap_register_gNB; //Type Temporarily reuse
// note: there is an implicit relationship between the data structure and the message name
/*msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse
if(NGAP_CONF_MODE){
ngap_register_gnb_req_t *ngap_register_gNB; //Type Temporarily reuse
// note: there is an implicit relationship between the data structure and the message name
msg_p = itti_alloc_new_message (TASK_GNB_APP, NGAP_REGISTER_GNB_REQ); //Message Temporarily reuse
RCconfig_NR_S1(msg_p, gnb_id);*/
RCconfig_NR_NG(msg_p, gnb_id);
ngap_register_gNB = &NGAP_REGISTER_GNB_REQ(msg_p); //Message Temporarily reuse
if (gnb_id == 0) RCconfig_nr_gtpu();
LOG_I(GNB_APP,"default drx %d\n",ngap_register_gNB->default_drx);
/*s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse
LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx);*/
itti_send_msg_to_task (TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
}
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
if (gnb_id == 0) RCconfig_nr_gtpu();
//itti_send_msg_to_task (TASK_S1AP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
register_gnb_pending++;
}
......@@ -173,7 +176,7 @@ void *gNB_app_task(void *args_p)
__attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
}
if (EPC_MODE_ENABLED) {
if (AMF_MODE_ENABLED) {
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
......@@ -201,16 +204,16 @@ void *gNB_app_task(void *args_p)
break;
/*
case S1AP_REGISTER_ENB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
case NGAP_REGISTER_GNB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_REGISTER_GNB_CNF(msg_p).nb_amf);
/*
DevAssert(register_gnb_pending > 0);
register_gnb_pending--;
// Check if at least gNB is registered with one MME
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
// Check if at least gNB is registered with one AMF
if (NGAP_REGISTER_GNB_CNF(msg_p).nb_amf > 0) {
registered_gnb++;
}
......@@ -226,7 +229,7 @@ void *gNB_app_task(void *args_p)
} else {
uint32_t not_associated = gnb_nb - registered_gnb;
LOG_W(GNB_APP, " %d gNB %s not associated with a MME, retrying registration in %d seconds ...\n",
LOG_W(GNB_APP, " %d gNB %s not associated with a AMF, retrying registration in %d seconds ...\n",
not_associated, not_associated > 1 ? "are" : "is", GNB_REGISTER_RETRY_DELAY);
// Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds
......@@ -241,12 +244,12 @@ void *gNB_app_task(void *args_p)
}
}
}
break;
*/
case S1AP_DEREGISTERED_ENB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
break;
case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
/* TODO handle recovering of registration */
break;
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
#include "platform_constants.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#include "ngap_messages_types.h"
#ifdef CMAKER
#include "rrc_messages_types.h"
......@@ -102,7 +103,7 @@ extern void NRRCConfig(void);
//void ru_config_display(void);
void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
......
This diff is collapsed.
......@@ -185,6 +185,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
int ss_id;
uint8_t bwp_id = 1, coreset_id = 1;
//NR_ServingCellConfig_t *scd = mac->scg->spCellConfig->spCellConfigDedicated;
NR_BWP_Downlink_t *bwp = mac->DLbwp[bwp_id - 1];
#ifdef DEBUG_DCI
......
......@@ -2094,7 +2094,7 @@ uint16_t nr_dci_format_size (PHY_VARS_NR_UE *ue,
(dynamic_prb_BundlingType2==dy_2_n4)||(dynamic_prb_BundlingType2==dy_2_wideband)) prb_BundlingType_size=1;
// 15 RATE_MATCHING_IND FIXME!!!
// according to TS 38.212: Rate matching indicator 0, 1, or 2 bits according to higher layer parameter rateMatchPattern
// according to TS 38.212: Rate matching indicator  E0, 1, or 2 bits according to higher layer parameter rateMatchPattern
uint8_t rateMatching_bits = pdsch_config.n_rateMatchPatterns;
// 16 ZP_CSI_RS_TRIGGER FIXME!!!
// 0, 1, or 2 bits as defined in Subclause 5.1.4.2 of [6, TS 38.214].
......@@ -2237,7 +2237,7 @@ uint16_t nr_dci_format_size (PHY_VARS_NR_UE *ue,
// 2 bits otherwise
uint8_t ptrs_dmrs_bits=0; //FIXME!!!
// 46 BETA_OFFSET_IND
// at IE PUSCH-Config, beta_offset indicator 0 if the higher layer parameter betaOffsets = semiStatic; otherwise 2 bits
// at IE PUSCH-Config, beta_offset indicator  E0 if the higher layer parameter betaOffsets = semiStatic; otherwise 2 bits
// uci-OnPUSCH
// Selection between and configuration of dynamic and semi-static beta-offset. If the field is absent or released, the UE applies the value 'semiStatic' and the BetaOffsets
uint8_t betaOffsets = 0;
......@@ -4236,10 +4236,10 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
case NR_RNTI_P:
/*
// Short Messages Indicator 2 bits
// Short Messages Indicator  E2 bits
for (int i=0; i<2; i++)
dci_pdu |= (((uint64_t)dci_pdu_rel15->short_messages_indicator>>(1-i))&1)<<(dci_size-pos++);
// Short Messages 8 bits
// Short Messages  E8 bits
for (int i=0; i<8; i++)
*dci_pdu |= (((uint64_t)dci_pdu_rel15->short_messages>>(7-i))&1)<<(dci_size-pos++);
// Freq domain assignment 0-16 bit
......@@ -4306,13 +4306,13 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
// HARQ process number 4bit
pos+=4;
dci_pdu_rel15->harq_pid = (*dci_pdu>>(dci_size-pos))&0xf;
// Downlink assignment index 2 bits
// Downlink assignment index  E2 bits
pos+=2;
dci_pdu_rel15->dai[0].val = (*dci_pdu>>(dci_size-pos))&3;
// TPC command for scheduled PUCCH 2 bits
// TPC command for scheduled PUCCH  E2 bits
pos+=2;
dci_pdu_rel15->tpc = (*dci_pdu>>(dci_size-pos))&3;
// PDSCH-to-HARQ_feedback timing indicator 3 bits
// PDSCH-to-HARQ_feedback timing indicator  E3 bits
pos+=3;
dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = (*dci_pdu>>(dci_size-pos))&7;
......@@ -4330,10 +4330,9 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
// Time domain assignment 4bit
pos+=4;
dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0xf;
// This is not supported yet - Skip for now
// Frequency hopping flag – 1 bit
//pos++;
//dci_pdu_rel15->frequency_hopping_flag.val= (*dci_pdu>>(dci_size-pos))&1;
// Frequency hopping flag  E1 bit
pos++;
dci_pdu_rel15->frequency_hopping_flag.val= (*dci_pdu>>(dci_size-pos))&1;
// MCS 5 bit
pos+=5;
dci_pdu_rel15->mcs= (*dci_pdu>>(dci_size-pos))&0x1f;
......@@ -4346,10 +4345,10 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
// HARQ process number 4bit
pos+=4;
dci_pdu_rel15->harq_pid = (*dci_pdu>>(dci_size-pos))&0xf;
// TPC command for scheduled PUSCH 2 bits
// TPC command for scheduled PUSCH  E2 bits
pos+=2;
dci_pdu_rel15->tpc = (*dci_pdu>>(dci_size-pos))&3;
// UL/SUL indicator 1 bit
// UL/SUL indicator  E1 bit
/* commented for now (RK): need to get this from BWP descriptor
if (cfg->pucch_config.pucch_GroupHopping.value)
dci_pdu->= ((uint64_t)*dci_pdu>>(dci_size-pos)ul_sul_indicator&1)<<(dci_size-pos++);
......@@ -4367,7 +4366,7 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
// Time domain assignment 4bit
for (int i=0; i<4; i++)
dci_pdu->= (((uint64_t)*dci_pdu>>(dci_size-pos)time_domain_assignment>>(3-i))&1)<<(dci_size-pos++);
// Frequency hopping flag 1 bit
// Frequency hopping flag  E1 bit
dci_pdu->= ((uint64_t)*dci_pdu>>(dci_size-pos)frequency_hopping_flag&1)<<(dci_size-pos++);
// MCS 5 bit
for (int i=0; i<5; i++)
......@@ -4381,11 +4380,11 @@ int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
for (int i=0; i<4; i++)
*dci_pdu |= (((uint64_t)*dci_pdu>>(dci_size-pos)harq_pid>>(3-i))&1)<<(dci_size-pos++);
// TPC command for scheduled PUSCH 2 bits
// TPC command for scheduled PUSCH  E2 bits
for (int i=0; i<2; i++)
dci_pdu->= (((uint64_t)*dci_pdu>>(dci_size-pos)tpc>>(1-i))&1)<<(dci_size-pos++);
*/
// UL/SUL indicator 1 bit
// UL/SUL indicator  E1 bit
/*
commented for now (RK): need to get this information from BWP descriptor
if (cfg->pucch_config.pucch_GroupHopping.value)
......
......@@ -798,7 +798,11 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
AssertFatal(1==0,"Couldn't fine pucch resource indicator %d in PUCCH resource set %d for %d UCI bits",pucch_resource,i,O_uci);
}
if (pucchresset->pucch_ResourceSetId == 1 && O_uci>2) {
#if (NR_RRC_VERSION >= MAKE_VERSION(16, 0, 0))
N3 = pucchresset->maxPayloadSize!= NULL ? *pucchresset->maxPayloadSize : 1706;
#else
N3 = pucchresset->maxPayloadMinus1!= NULL ? *pucchresset->maxPayloadMinus1 : 1706;
#endif
if (N2<O_uci && N3>O_uci) {
if (pucch_resource < n_list)
resource_id = pucchresset->resourceList.list.array[pucch_resource];
......
......@@ -869,10 +869,45 @@ boolean_t pdcp_remove_UE(
return 1;
}
void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_id,
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP)
void pdcp_config_set_security(
const protocol_ctxt_t* const ctxt_pP,
pdcp_t *const pdcp_pP,
const rb_id_t rb_id,
const uint16_t lc_idP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP)
{
TODO;
DevAssert(pdcp_pP != NULL);
if ((security_modeP >= 0) && (security_modeP <= 0x77)) {
pdcp_pP->cipheringAlgorithm = security_modeP & 0x0f;
pdcp_pP->integrityProtAlgorithm = (security_modeP>>4) & 0xf;
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_SET_SECURITY_MODE: cipheringAlgorithm %d integrityProtAlgorithm %d\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm);
pdcp_pP->kRRCenc = kRRCenc_pP;
pdcp_pP->kRRCint = kRRCint_pP;
pdcp_pP->kUPenc = kUPenc_pP;
/* Activate security */
pdcp_pP->security_activated = 1;
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security ciph %X integ %x UE %"PRIx16" ",
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti);
} else {
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security failed UE %"PRIx16" ",
ctxt_pP->rnti);
LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
security_modeP);
}
}
static boolean_t pdcp_data_req_drb(
......
......@@ -37,6 +37,9 @@
#include "COMMON/s1ap_messages_types.h"
#include "COMMON/rrc_messages_types.h"
#if ITTI_SIM
#include "COMMON/itti_sim_messages_types.h"
#endif
#include "collection/tree.h"
#include "rrc_types_NB_IoT.h"
......
......@@ -43,6 +43,77 @@
extern RAN_CONTEXT_t RC;
int
nr_rrc_mac_remove_ue(module_id_t mod_idP,
rnti_t rntiP){
// todo
return 0;
}
//------------------------------------------------------------------------------
uint8_t
nr_rrc_data_req(
const protocol_ctxt_t *const ctxt_pP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_sizeP,
uint8_t *const buffer_pP,
const pdcp_transmission_mode_t modeP
)
//------------------------------------------------------------------------------
{
if(sdu_sizeP == 255) {
LOG_I(RRC,"sdu_sizeP == 255");
return FALSE;
}
MSC_LOG_TX_MESSAGE(
ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
buffer_pP,
sdu_sizeP,
MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ctxt_pP->rnti,
muiP,
sdu_sizeP);
MessageDef *message_p;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t *message_buffer;
message_buffer = itti_malloc (
ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
sdu_sizeP);
memcpy (message_buffer, buffer_pP, sdu_sizeP);
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
//memcpy (RRC_DCCH_DATA_REQ (message_p).sdu_p, buffer_pP, sdu_sizeP);
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
ctxt_pP->instance,
message_p);
LOG_I(RRC,"sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB\n");
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* messages automatically */
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
pdcp_run(ctxt_pP);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
const int CC_id,
const frame_t frameP,
......
This diff is collapsed.
......@@ -82,3 +82,47 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
void do_SpCellConfig(gNB_RRC_INST *rrc,
struct NR_SpCellConfig *spconfig);
uint8_t do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer);
uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
int CC_id,
uint8_t *const buffer,
const uint8_t transaction_id,
NR_SRB_ToAddModList_t *SRB_configList);
uint8_t do_NR_SecurityModeCommand(
const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id,
const uint8_t cipheringAlgorithm,
NR_IntegrityProtAlgorithm_t *integrityProtAlgorithm);
uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer,
const uint8_t Transaction_id);
uint8_t do_NR_RRCConnectionRelease(uint8_t *buffer,
uint8_t Transaction_id);
uint16_t do_RRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t *buffer,
uint8_t Transaction_id,
gNB_RRC_INST *gnb_rrc_inst);
uint8_t do_RRCSetupComplete(uint8_t Mod_id,
uint8_t *buffer,
const uint8_t Transaction_id,
uint8_t sel_plmn_id,
const int dedicatedInfoNASLength,
const char *dedicatedInfoNAS);
uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv);
uint8_t do_NR_RRCReconfigurationComplete(
const protocol_ctxt_t *const ctxt_pP,
uint8_t *buffer,
const uint8_t Transaction_id
);
This diff is collapsed.
......@@ -54,6 +54,7 @@
#include "NR_BCCH-BCH-Message.h"
#include "NR_PLMN-IdentityInfo.h"
#include "NR_MCC-MNC-Digit.h"
#include "NR_NG-5G-S-TMSI.h"
//#include "MCCH-Message.h"
//#include "MBSFNAreaConfiguration-r9.h"
//#include "SCellToAddMod-r10.h"
......@@ -89,10 +90,10 @@ typedef struct nr_uid_linear_allocator_s {
#define PROTOCOL_NR_RRC_CTXT_UE_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NR_RRC_CTXT_UE_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT
#define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp)
#define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp)
#define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
......@@ -149,7 +150,7 @@ typedef struct UE_RRC_INFO_NR_s {
uint32_t SIStatus;
uint32_t SIcnt;
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint16_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint8_t handoverTarget;
//HO_STATE_t ho_state;
uint16_t
......@@ -168,8 +169,9 @@ typedef struct UE_RRC_INFO_NR_s {
typedef struct UE_S_TMSI_NR_s {
boolean_t presence;
mme_code_t mme_code;
m_tmsi_t m_tmsi;
uint16_t amf_set_id;
uint8_t amf_pointer;
uint32_t fiveg_tmsi;
} __attribute__ ((__packed__)) NR_UE_S_TMSI;
......@@ -246,6 +248,14 @@ typedef struct SRB_INFO_TABLE_ENTRY_NR_s {
uint32_t Next_check_frame;
} NR_SRB_INFO_TABLE_ENTRY;
typedef struct nr_rrc_guami_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_len;
uint8_t amf_region_id;
uint16_t amf_set_id;
uint8_t amf_pointer;
} nr_rrc_guami_t;
typedef struct gNB_RRC_UE_s {
uint8_t primaryCC_id;
......@@ -267,7 +277,9 @@ typedef struct gNB_RRC_UE_s {
NR_UE_NR_Capability_t* UE_Capability_nr;
int UE_Capability_size;
NR_UE_MRDC_Capability_t* UE_Capability_MRDC;
int UE_MRDC_Capability_size;
NR_CellGroupConfig_t *secondaryCellGroup;
NR_RRCReconfiguration_t *reconfig;
......@@ -275,13 +287,12 @@ typedef struct gNB_RRC_UE_s {
ImsiMobileIdentity_t imsi;
#if defined(ENABLE_SECURITY)
/* KeNB as derived from KASME received from EPC */
uint8_t kenb[32];
int8_t kenb_ncc;
/* KgNB as derived from KASME received from EPC */
uint8_t kgnb[32];
int8_t kgnb_ncc;
uint8_t nh[32];
int8_t nh_ncc;
#endif
/* Used integrity/ciphering algorithms */
NR_CipheringAlgorithm_t ciphering_algorithm;
e_NR_IntegrityProtAlgorithm integrity_algorithm;
......@@ -290,8 +301,10 @@ typedef struct gNB_RRC_UE_s {
rnti_t rnti;
uint64_t random_ue_identity;
/* Information from UE RRC ConnectionRequest */
UE_S_TMSI Initialue_identity_s_TMSI;
/* Information from UE RRC Setup Request */
NR_UE_S_TMSI Initialue_identity_5g_s_TMSI;
uint64_t ng_5G_S_TMSI_Part1;
uint16_t ng_5G_S_TMSI_Part2;
NR_EstablishmentCause_t establishment_cause;
/* Information from UE RRC ConnectionReestablishmentRequest */
......@@ -302,8 +315,11 @@ typedef struct gNB_RRC_UE_s {
/* Information from S1AP initial_context_setup_req */
uint32_t gNB_ue_s1ap_id :24;
uint32_t gNB_ue_ngap_id;
uint64_t amf_ue_ngap_id:40;
nr_rrc_guami_t ue_guami;
security_capabilities_t security_capabilities;
ngap_security_capabilities_t security_capabilities;
/* Total number of e_rab already setup in the list */
uint8_t setup_e_rabs;
......@@ -343,6 +359,10 @@ typedef struct gNB_RRC_UE_s {
struct NR_MAC_CellGroupConfig *mac_CellGroupConfig;
struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig;
/* Nas Pdu */
uint8_t nas_pdu_flag;
ngap_nas_pdu_t nas_pdu;
} gNB_RRC_UE_t;
typedef uid_t ue_uid_t;
......
......@@ -93,6 +93,23 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2ap_ENDC_sgnb_addition_req_t *m);
void
rrc_gNB_generate_SecurityModeCommand(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP
);
uint8_t
rrc_gNB_get_next_transaction_identifier(
module_id_t gnb_mod_idP
);
void
rrc_gNB_generate_UECapabilityEnquiry(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP
);
void nr_rrc_rx_tx(void);
/**\brief RRC eNB task.
......@@ -101,3 +118,19 @@ void *rrc_gnb_task(void *args_p);
/* Trigger RRC periodic processing. To be called once per ms. */
void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe);
uint8_t
nr_rrc_data_req(
const protocol_ctxt_t *const ctxt_pP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_size,
uint8_t *const buffer_pP,
const pdcp_transmission_mode_t modeP
);
int
nr_rrc_mac_remove_ue(module_id_t mod_idP,
rnti_t rntiP);
This diff is collapsed.
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_gNB_NGAP.h
* \brief rrc NGAP procedures for gNB
* \author Yoshio INOUE, Masayuki HARADA
* \date 2020
* \version 0.1
* \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
* (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com)
*/
#ifndef RRC_GNB_NGAP_H_
#define RRC_GNB_NGAP_H_
#include "rrc_gNB_UE_context.h"
#include "nr_rrc_defs.h"
#include "nr_rrc_extern.h"
#include "NR_RRCSetupComplete-IEs.h"
#include "NR_RegisteredAMF.h"
typedef struct rrc_ue_ngap_ids_s {
/* Tree related data */
RB_ENTRY(rrc_ue_ngap_ids_s) entries;
// keys
uint16_t ue_initial_id;
uint32_t gNB_ue_ngap_id;
// value
rnti_t ue_rnti;
} rrc_ue_ngap_ids_t;
void
rrc_gNB_send_NGAP_NAS_FIRST_REQ(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP,
NR_RRCSetupComplete_IEs_t *rrcSetupComplete
);
int
rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
MessageDef *msg_p,
const char *msg_name,
instance_t instance
);
void
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP
);
int
rrc_gNB_process_security(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
ngap_security_capabilities_t *security_capabilities_pP
);
#endif
......@@ -189,7 +189,7 @@ void rrc_gNB_free_mem_UE_context(
//------------------------------------------------------------------------------
void rrc_gNB_remove_ue_context(
const protocol_ctxt_t *const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP,
gNB_RRC_INST *rrc_instance_pP,
struct rrc_gNB_ue_context_s *ue_context_pP)
//------------------------------------------------------------------------------
......@@ -220,4 +220,82 @@ void rrc_gNB_remove_ue_context(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
}
//-----------------------------------------------------------------------------
// return the ue context if there is already an UE with ue_identityP, NULL otherwise
struct rrc_gNB_ue_context_s *
rrc_gNB_ue_context_random_exist(
gNB_RRC_INST *rrc_instance_pP,
const uint64_t ue_identityP
)
//-----------------------------------------------------------------------------
{
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head) {
if (ue_context_p->ue_context.random_ue_identity == ue_identityP)
return ue_context_p;
}
return NULL;
}
//-----------------------------------------------------------------------------
// return the ue context if there is already an UE with the same S-TMSI, NULL otherwise
struct rrc_gNB_ue_context_s *
rrc_gNB_ue_context_5g_s_tmsi_exist(
gNB_RRC_INST *rrc_instance_pP,
const uint64_t s_TMSI
)
//-----------------------------------------------------------------------------
{
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head) {
LOG_I(NR_RRC,"checking for UE 5G S-TMSI %ld: rnti %d \n",
s_TMSI, ue_context_p->ue_context.rnti);
if (ue_context_p->ue_context.ng_5G_S_TMSI_Part1 == s_TMSI) {
return ue_context_p;
}
}
return NULL;
}
//-----------------------------------------------------------------------------
// return a new ue context structure if ue_identityP, ctxt_pP->rnti not found in collection
struct rrc_gNB_ue_context_s *
rrc_gNB_get_next_free_ue_context(
const protocol_ctxt_t *const ctxt_pP,
gNB_RRC_INST *rrc_instance_pP,
const uint64_t ue_identityP
)
//-----------------------------------------------------------------------------
{
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_gNB_get_ue_context(rrc_instance_pP, ctxt_pP->rnti);
if (ue_context_p == NULL) {
ue_context_p = rrc_gNB_allocate_new_UE_context(rrc_instance_pP);
if (ue_context_p == NULL) {
LOG_E(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" Cannot create new UE context, no memory\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
return NULL;
}
ue_context_p->ue_id_rnti = ctxt_pP->rnti; // here ue_id_rnti is just a key, may be something else
ue_context_p->ue_context.rnti = ctxt_pP->rnti; // yes duplicate, 1 may be removed
ue_context_p->ue_context.random_ue_identity = ue_identityP;
RB_INSERT(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_p);
LOG_D(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" Created new UE context uid %u\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_p->local_uid);
return ue_context_p;
} else {
LOG_E(NR_RRC,
PROTOCOL_NR_RRC_CTXT_UE_FMT" Cannot create new UE context, already exist\n",
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
return NULL;
}
return(ue_context_p);
}
......@@ -73,10 +73,34 @@ rrc_gNB_get_ue_context(
rnti_t rntiP
);
void rrc_gNB_free_mem_UE_context(
const protocol_ctxt_t *const ctxt_pP,
struct rrc_gNB_ue_context_s *const ue_context_pP
);
void rrc_gNB_remove_ue_context(
const protocol_ctxt_t* const ctxt_pP,
gNB_RRC_INST* rrc_instance_pP,
struct rrc_gNB_ue_context_s* ue_context_pP
);
struct rrc_gNB_ue_context_s *
rrc_gNB_ue_context_random_exist(
gNB_RRC_INST *rrc_instance_pP,
const uint64_t ue_identityP
);
struct rrc_gNB_ue_context_s *
rrc_gNB_ue_context_5g_s_tmsi_exist(
gNB_RRC_INST *rrc_instance_pP,
const uint64_t s_TMSI
);
struct rrc_gNB_ue_context_s *
rrc_gNB_get_next_free_ue_context(
const protocol_ctxt_t *const ctxt_pP,
gNB_RRC_INST *rrc_instance_pP,
const uint64_t ue_identityP
);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -39,6 +39,7 @@
#include "udp_messages_types.h"
#include "mme_app_messages_types.h"
#include "m2ap_messages_types.h"
#include "ngap_messages_types.h"
#endif /* MESSAGES_TYPES_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,8 @@
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# endif
# else
# define NUMBER_OF_UE_MAX 1
# define NUMBER_OF_UE_MAX 4
# define NUMBER_OF_NR_UE_MAX 4
# define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
......
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