Merge branch 'issue255_256_257_paging_reesta_release' into develop_integration_2018_w03
Conflicts: targets/RT/USER/lte-softmodem.c
This commit is contained in:
@@ -249,6 +249,44 @@ mac_rrc_data_req(
|
||||
return (Sdu_size);
|
||||
}
|
||||
|
||||
if( (Srb_id & RAB_OFFSET ) == PCCH) {
|
||||
LOG_T(RRC,"[eNB %d] Frame %d PCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
|
||||
|
||||
// check if data is there for MAC
|
||||
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer
|
||||
LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area],
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
|
||||
|
||||
#if 0 //defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
int pcch_size = RC.rrc[Mod_idP]->arrier[CC_id].sizeof_paging[mbsfn_sync_area];
|
||||
int sdu_size = sizeof(RRC_MAC_PCCH_DATA_REQ (message_p).sdu);
|
||||
|
||||
if (pcch_size > sdu_size) {
|
||||
LOG_E(RRC, "SDU larger than PCCH SDU buffer size (%d, %d)", pcch_size, sdu_size);
|
||||
pcch_size = sdu_size;
|
||||
}
|
||||
|
||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_PCCH_DATA_REQ);
|
||||
RRC_MAC_PCCH_DATA_REQ (message_p).frame = frameP;
|
||||
RRC_MAC_PCCH_DATA_REQ (message_p).sdu_size = pcch_size;
|
||||
memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE);
|
||||
memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size);
|
||||
RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index;
|
||||
|
||||
itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p);
|
||||
}
|
||||
#endif
|
||||
|
||||
memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
|
||||
Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area];
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0;
|
||||
}
|
||||
|
||||
return (Sdu_size);
|
||||
}
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
|
||||
if((Srb_id & RAB_OFFSET) == MCCH) {
|
||||
@@ -770,12 +808,34 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
|
||||
if (ue_context_p != NULL) {
|
||||
LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
|
||||
ue_context_p->ue_context.ul_failure_timer=1;
|
||||
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
||||
ue_context_p->ue_context.ul_failure_timer=1;
|
||||
}
|
||||
else {
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||
}
|
||||
rrc_mac_remove_ue(Mod_instP,rntiP);
|
||||
// rrc_mac_remove_ue(Mod_instP,rntiP);
|
||||
}
|
||||
|
||||
void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP)
|
||||
{
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
RC.rrc[Mod_instP],
|
||||
rntiP);
|
||||
if (ue_context_p != NULL) {
|
||||
LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP);
|
||||
|
||||
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
||||
ue_context_p->ue_context.ul_failure_timer=19999;
|
||||
}
|
||||
else {
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: U-Plane failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||
}
|
||||
}
|
||||
|
||||
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
#include "UL-DCCH-Message.h"
|
||||
#include "DL-CCCH-Message.h"
|
||||
#include "DL-DCCH-Message.h"
|
||||
#include "PCCH-Message.h"
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
#include "EstablishmentCause.h"
|
||||
#include "RRCConnectionSetup.h"
|
||||
#include "SRB-ToAddModList.h"
|
||||
@@ -89,6 +91,7 @@
|
||||
#endif
|
||||
|
||||
#include "common/ran_context.h"
|
||||
#include "secu_defs.h"
|
||||
|
||||
//#include "PHY/defs.h"
|
||||
#ifndef USER_MODE
|
||||
@@ -230,7 +233,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich
|
||||
|
||||
AssertFatal(phich_Resource <= PHICH_Config__phich_Resource_two,"Illegal phich_Resource\n");
|
||||
mib->message.phich_Config.phich_Resource = phich_Resource;
|
||||
AssertFatal(phich_Resource <= PHICH_Config__phich_Duration_extended,"Illegal phich_Duration\n");
|
||||
AssertFatal(phich_duration <= PHICH_Config__phich_Duration_extended,"Illegal phich_Duration\n");
|
||||
mib->message.phich_Config.phich_Duration = phich_duration;
|
||||
LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n",
|
||||
(uint32_t)mib->message.dl_Bandwidth,
|
||||
@@ -1964,6 +1967,214 @@ do_RRCConnectionReconfiguration(
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
do_RRCConnectionReestablishment(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
int CC_id,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t transmission_mode,
|
||||
const uint8_t Transaction_id,
|
||||
SRB_ToAddModList_t **SRB_configList,
|
||||
struct PhysicalConfigDedicated **physicalConfigDedicated)
|
||||
{
|
||||
asn_enc_rval_t enc_rval;
|
||||
|
||||
long* logicalchannelgroup = NULL;
|
||||
struct SRB_ToAddMod* SRB1_config = NULL;
|
||||
struct SRB_ToAddMod* SRB2_config = NULL;
|
||||
struct SRB_ToAddMod__rlc_Config* SRB1_rlc_config = NULL;
|
||||
struct SRB_ToAddMod__logicalChannelConfig* SRB1_lchan_config = NULL;
|
||||
struct LogicalChannelConfig__ul_SpecificParameters* SRB1_ul_SpecificParameters = NULL;
|
||||
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
|
||||
|
||||
#ifdef CBA
|
||||
struct PUSCH_CBAConfigDedicated_vlola* pusch_CBAConfigDedicated_vlola = NULL;
|
||||
long* betaOffset_CBA_Index = NULL;
|
||||
long* cShift_CBA = NULL;
|
||||
#endif
|
||||
PhysicalConfigDedicated_t* physicalConfigDedicated2 = NULL;
|
||||
|
||||
DL_CCCH_Message_t dl_ccch_msg;
|
||||
|
||||
RRCConnectionReestablishment_t* rrcConnectionReestablishment = NULL;
|
||||
|
||||
int i = 0;
|
||||
SRB_ToAddModList_t **SRB_configList2 = NULL;
|
||||
SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[Transaction_id];
|
||||
if (*SRB_configList2) {
|
||||
free(*SRB_configList2);
|
||||
}
|
||||
*SRB_configList2 = CALLOC(1, sizeof(SRB_ToAddModList_t));
|
||||
|
||||
memset((void *)&dl_ccch_msg, 0, sizeof(DL_CCCH_Message_t));
|
||||
dl_ccch_msg.message.present = DL_CCCH_MessageType_PR_c1;
|
||||
dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishment;
|
||||
rrcConnectionReestablishment = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionReestablishment;
|
||||
|
||||
// RRCConnectionReestablishment
|
||||
// Configure SRB1
|
||||
|
||||
|
||||
// get old configuration of SRB2
|
||||
if (*SRB_configList != NULL) {
|
||||
for (i = 0; (i < (*SRB_configList)->list.count) && (i < 3); i++) {
|
||||
LOG_D(RRC, "(*SRB_configList)->list.array[%d]->srb_Identity=%ld\n",
|
||||
i, (*SRB_configList)->list.array[i]->srb_Identity);
|
||||
if ((*SRB_configList)->list.array[i]->srb_Identity == 2 ){
|
||||
SRB2_config = (*SRB_configList)->list.array[i];
|
||||
} else if ((*SRB_configList)->list.array[i]->srb_Identity == 1 ){
|
||||
SRB1_config = (*SRB_configList)->list.array[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SRB1_config == NULL) {
|
||||
// default SRB1 configuration
|
||||
LOG_W(RRC,"SRB1 configuration does not exist in SRB configuration list, use default\n");
|
||||
/// SRB1
|
||||
SRB1_config = CALLOC(1, sizeof(*SRB1_config));
|
||||
|
||||
SRB1_config->srb_Identity = 1;
|
||||
SRB1_rlc_config = CALLOC(1, sizeof(*SRB1_rlc_config));
|
||||
SRB1_config->rlc_Config = SRB1_rlc_config;
|
||||
|
||||
SRB1_rlc_config->present = SRB_ToAddMod__rlc_Config_PR_explicitValue;
|
||||
SRB1_rlc_config->choice.explicitValue.present=RLC_Config_PR_am;
|
||||
#if defined(ENABLE_ITTI)
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = rrc->srb1_timer_poll_retransmit;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = rrc->srb1_poll_pdu;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = rrc->srb1_poll_byte;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = rrc->srb1_max_retx_threshold;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = rrc->srb1_timer_reordering;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = rrc->srb1_timer_status_prohibit;
|
||||
#else
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms20;;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = PollPDU_p4;;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = PollByte_kBinfinity;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = UL_AM_RLC__maxRetxThreshold_t8;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = T_Reordering_ms35;
|
||||
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = T_StatusProhibit_ms0;
|
||||
#endif
|
||||
|
||||
SRB1_lchan_config = CALLOC(1, sizeof(*SRB1_lchan_config));
|
||||
SRB1_config->logicalChannelConfig = SRB1_lchan_config;
|
||||
|
||||
SRB1_lchan_config->present = SRB_ToAddMod__logicalChannelConfig_PR_explicitValue;
|
||||
SRB1_ul_SpecificParameters = CALLOC(1, sizeof(*SRB1_ul_SpecificParameters));
|
||||
|
||||
SRB1_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB1_ul_SpecificParameters;
|
||||
SRB1_ul_SpecificParameters->priority = 1;
|
||||
|
||||
//assign_enum(&SRB1_ul_SpecificParameters->prioritisedBitRate,LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity);
|
||||
SRB1_ul_SpecificParameters->prioritisedBitRate=LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
|
||||
//assign_enum(&SRB1_ul_SpecificParameters->bucketSizeDuration,LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50);
|
||||
SRB1_ul_SpecificParameters->bucketSizeDuration=LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
|
||||
|
||||
logicalchannelgroup = CALLOC(1, sizeof(long));
|
||||
*logicalchannelgroup = 0;
|
||||
SRB1_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup;
|
||||
}
|
||||
|
||||
if (SRB2_config == NULL) {
|
||||
LOG_W(RRC,"SRB2 configuration does not exist in SRB configuration list\n");
|
||||
} else {
|
||||
ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config);
|
||||
}
|
||||
|
||||
if (*SRB_configList) {
|
||||
free(*SRB_configList);
|
||||
}
|
||||
|
||||
*SRB_configList = CALLOC(1, sizeof(SRB_ToAddModList_t));
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config);
|
||||
|
||||
physicalConfigDedicated2 = *physicalConfigDedicated;
|
||||
|
||||
rrcConnectionReestablishment->rrc_TransactionIdentifier = Transaction_id;
|
||||
rrcConnectionReestablishment->criticalExtensions.present = RRCConnectionReestablishment__criticalExtensions_PR_c1;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.present = RRCConnectionReestablishment__criticalExtensions__c1_PR_rrcConnectionReestablishment_r8;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.srb_ToAddModList = *SRB_configList;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.drb_ToAddModList = NULL;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.drb_ToReleaseList = NULL;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.sps_Config = NULL;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.physicalConfigDedicated = physicalConfigDedicated2;
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.radioResourceConfigDedicated.mac_MainConfig = NULL;
|
||||
|
||||
uint8_t KeNB_star[32] = { 0 };
|
||||
uint16_t pci = rrc->carrier[CC_id].physCellId;
|
||||
uint32_t earfcn_dl = (uint32_t)freq_to_arfcn10(RC.mac[ctxt_pP->module_id]->common_channels[CC_id].eutra_band,
|
||||
rrc->carrier[CC_id].dl_CarrierFreq);
|
||||
bool is_rel8_only = true;
|
||||
if (earfcn_dl > 65535) {
|
||||
is_rel8_only = false;
|
||||
}
|
||||
|
||||
LOG_D(RRC, "pci=%d, eutra_band=%d, downlink_frequency=%d, earfcn_dl=%u, is_rel8_only=%s\n",
|
||||
pci,
|
||||
RC.mac[ctxt_pP->module_id]->common_channels[CC_id].eutra_band,
|
||||
rrc->carrier[CC_id].dl_CarrierFreq,
|
||||
earfcn_dl,
|
||||
is_rel8_only == true ? "true": "false");
|
||||
#if defined(ENABLE_SECURITY)
|
||||
if (ue_context_pP->ue_context.nh_ncc >= 0) {
|
||||
derive_keNB_star(ue_context_pP->ue_context.nh, pci, earfcn_dl, is_rel8_only, KeNB_star);
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nextHopChainingCount = ue_context_pP->ue_context.nh_ncc;
|
||||
} else { // first HO
|
||||
derive_keNB_star (ue_context_pP->ue_context.kenb, pci, earfcn_dl, is_rel8_only, KeNB_star);
|
||||
// LG: really 1
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nextHopChainingCount = 0;
|
||||
}
|
||||
|
||||
// copy KeNB_star to ue_context_pP->ue_context.kenb
|
||||
memcpy (ue_context_pP->ue_context.kenb, KeNB_star, 32);
|
||||
ue_context_pP->ue_context.kenb_ncc = 0;
|
||||
#else
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nextHopChainingCount = 0;
|
||||
#endif
|
||||
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nonCriticalExtension = NULL;
|
||||
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
#endif
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
|
||||
(void*)&dl_ccch_msg,
|
||||
buffer,
|
||||
100);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# if !defined(DISABLE_XER_SPRINT)
|
||||
{
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size;
|
||||
memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size);
|
||||
|
||||
itti_send_msg_to_task(TASK_UNKNOWN, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USER_MODE
|
||||
LOG_D(RRC,"RRCConnectionReestablishment Encoded %zd bits (%zd bytes)\n",
|
||||
enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
#endif
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
do_RRCConnectionReestablishmentReject(
|
||||
@@ -2451,6 +2662,73 @@ uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t trans
|
||||
return encoded;
|
||||
}
|
||||
|
||||
uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, ue_paging_identity_t ue_paging_identity, cn_domain_t cn_domain)
|
||||
{
|
||||
LOG_D(RRC, "[eNB %d] do_Paging start\n", Mod_id);
|
||||
asn_enc_rval_t enc_rval;
|
||||
|
||||
PCCH_Message_t pcch_msg;
|
||||
PagingRecord_t *paging_record_p;
|
||||
int j;
|
||||
|
||||
pcch_msg.message.present = PCCH_MessageType_PR_c1;
|
||||
pcch_msg.message.choice.c1.present = PCCH_MessageType__c1_PR_paging;
|
||||
|
||||
pcch_msg.message.choice.c1.choice.paging.pagingRecordList = CALLOC(1,sizeof(*pcch_msg.message.choice.c1.choice.paging.pagingRecordList));
|
||||
|
||||
pcch_msg.message.choice.c1.choice.paging.systemInfoModification = NULL;
|
||||
pcch_msg.message.choice.c1.choice.paging.etws_Indication = NULL;
|
||||
pcch_msg.message.choice.c1.choice.paging.nonCriticalExtension = NULL;
|
||||
|
||||
asn_set_empty(&pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list);
|
||||
pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count = 0;
|
||||
|
||||
if ((paging_record_p = calloc(1, sizeof(PagingRecord_t))) == NULL) {
|
||||
/* Possible error on calloc */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(paging_record_p, 0, sizeof(PagingRecord_t));
|
||||
|
||||
/* convert ue_paging_identity_t to PagingUE_Identity_t */
|
||||
if (ue_paging_identity.presenceMask == UE_PAGING_IDENTITY_s_tmsi) {
|
||||
paging_record_p->ue_Identity.present = PagingUE_Identity_PR_s_TMSI;
|
||||
MME_CODE_TO_OCTET_STRING(ue_paging_identity.choice.s_tmsi.mme_code,
|
||||
&paging_record_p->ue_Identity.choice.s_TMSI.mmec);
|
||||
paging_record_p->ue_Identity.choice.s_TMSI.mmec.bits_unused = 0;
|
||||
M_TMSI_TO_OCTET_STRING(ue_paging_identity.choice.s_tmsi.m_tmsi,
|
||||
&paging_record_p->ue_Identity.choice.s_TMSI.m_TMSI);
|
||||
paging_record_p->ue_Identity.choice.s_TMSI.m_TMSI.bits_unused = 0;
|
||||
} else if (ue_paging_identity.presenceMask == UE_PAGING_IDENTITY_imsi) {
|
||||
IMSI_Digit_t imsi_digit[21];
|
||||
for (j = 0; j< ue_paging_identity.choice.imsi.length; j++) { /* IMSI size */
|
||||
imsi_digit[j] = (IMSI_Digit_t)ue_paging_identity.choice.imsi.buffer[j];
|
||||
ASN_SEQUENCE_ADD(&paging_record_p->ue_Identity.choice.imsi.list, &imsi_digit[j]);
|
||||
}
|
||||
}
|
||||
|
||||
/* set cn_domain */
|
||||
if (cn_domain == CN_DOMAIN_PS) {
|
||||
paging_record_p->cn_Domain = PagingRecord__cn_Domain_ps;
|
||||
} else {
|
||||
paging_record_p->cn_Domain = PagingRecord__cn_Domain_cs;
|
||||
}
|
||||
/* add to list */
|
||||
ASN_SEQUENCE_ADD(&pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list, paging_record_p);
|
||||
LOG_D(RRC, "[eNB %d] do_Paging paging_record: cn_Domain %ld, ue_paging_identity.presenceMask %d, PagingRecordList.count %d\n",
|
||||
Mod_id, paging_record_p->cn_Domain, ue_paging_identity.presenceMask, pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, (void*)&pcch_msg, buffer, RRC_BUF_SIZE);
|
||||
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_PCCH_Message, (void*)&pcch_msg);
|
||||
#endif
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer)
|
||||
{
|
||||
ssize_t encoded;
|
||||
|
||||
@@ -195,6 +195,28 @@ do_RRCConnectionReconfiguration(
|
||||
, SCellToAddMod_r10_t *SCell_config
|
||||
#endif
|
||||
);
|
||||
/**
|
||||
\brief Generate an RRCConnectionReestablishment DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and
|
||||
PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS.
|
||||
@param ctxt_pP Running context
|
||||
@param ue_context_pP UE context
|
||||
@param CC_id Component Carrier ID
|
||||
@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
|
||||
@param transmission_mode Transmission mode for UE (1-9)
|
||||
@param Transaction_id Transaction_ID for this message
|
||||
@param SRB_configList Pointer (returned) to SRB1_config/SRB2_config(later) IEs for this UE
|
||||
@param physicalConfigDedicated Pointer (returned) to PhysicalConfigDedicated IE for this UE
|
||||
@returns Size of encoded bit stream in bytes*/
|
||||
uint8_t
|
||||
do_RRCConnectionReestablishment(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
int CC_id,
|
||||
uint8_t* const buffer,
|
||||
const uint8_t transmission_mode,
|
||||
const uint8_t Transaction_id,
|
||||
SRB_ToAddModList_t **SRB_configList,
|
||||
struct PhysicalConfigDedicated **physicalConfigDedicated);
|
||||
|
||||
/**
|
||||
\brief Generate an RRCConnectionReestablishmentReject DL-CCCH-Message (eNB).
|
||||
@@ -249,6 +271,8 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
|
||||
|
||||
uint8_t do_DLInformationTransfer(uint8_t Mod_id, uint8_t **buffer, uint8_t transaction_id, uint32_t pdu_length, uint8_t *pdu_buffer);
|
||||
|
||||
uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, ue_paging_identity_t ue_paging_identity, cn_domain_t cn_domain);
|
||||
|
||||
uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t *pdu_buffer);
|
||||
|
||||
OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer);
|
||||
|
||||
@@ -296,12 +296,15 @@ typedef enum e_rab_satus_e {
|
||||
E_RAB_STATUS_DONE, // from the eNB perspective
|
||||
E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE
|
||||
E_RAB_STATUS_FAILED,
|
||||
E_RAB_STATUS_TORELEASE // to release DRB between eNB and UE
|
||||
} e_rab_status_t;
|
||||
|
||||
typedef struct e_rab_param_s {
|
||||
e_rab_t param;
|
||||
uint8_t status;
|
||||
uint8_t xid; // transaction_id
|
||||
s1ap_Cause_t cause;
|
||||
uint8_t cause_value;
|
||||
} __attribute__ ((__packed__)) e_rab_param_t;
|
||||
#endif
|
||||
|
||||
@@ -379,6 +382,7 @@ typedef struct eNB_RRC_UE_s {
|
||||
SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
DRB_ToAddModList_t* DRB_configList;
|
||||
DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
DRB_ToReleaseList_t* DRB_Release_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
uint8_t DRB_active[8];
|
||||
struct PhysicalConfigDedicated* physicalConfigDedicated;
|
||||
struct SPS_Config* sps_Config;
|
||||
@@ -398,6 +402,9 @@ typedef struct eNB_RRC_UE_s {
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* KeNB as derived from KASME received from EPC */
|
||||
uint8_t kenb[32];
|
||||
int8_t kenb_ncc;
|
||||
uint8_t nh[32];
|
||||
int8_t nh_ncc;
|
||||
#endif
|
||||
/* Used integrity/ciphering algorithms */
|
||||
CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
@@ -427,9 +434,15 @@ typedef struct eNB_RRC_UE_s {
|
||||
uint8_t setup_e_rabs;
|
||||
/* Number of e_rab to be setup in the list */
|
||||
uint8_t nb_of_e_rabs;
|
||||
/* Number of e_rab to be modified in the list */
|
||||
uint8_t nb_of_modify_e_rabs;
|
||||
uint8_t nb_of_failed_e_rabs;
|
||||
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
|
||||
//release e_rabs
|
||||
uint8_t nb_release_of_e_rabs;
|
||||
e_rab_failed_t e_rabs_release_failed[S1AP_MAX_E_RAB];
|
||||
// LG: For GTPV1 TUNNELS
|
||||
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
|
||||
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||
@@ -438,6 +451,13 @@ typedef struct eNB_RRC_UE_s {
|
||||
uint32_t ul_failure_timer;
|
||||
uint32_t ue_release_timer;
|
||||
uint32_t ue_release_timer_thres;
|
||||
uint32_t ue_release_timer_s1;
|
||||
uint32_t ue_release_timer_thres_s1;
|
||||
uint32_t ue_release_timer_rrc;
|
||||
uint32_t ue_release_timer_thres_rrc;
|
||||
uint32_t ue_reestablishment_timer;
|
||||
uint32_t ue_reestablishment_timer_thres;
|
||||
uint8_t e_rab_release_command_flag;
|
||||
} eNB_RRC_UE_t;
|
||||
|
||||
typedef uid_t ue_uid_t;
|
||||
@@ -501,6 +521,8 @@ typedef struct {
|
||||
#endif
|
||||
SRB_INFO SI;
|
||||
SRB_INFO Srb0;
|
||||
uint8_t *paging[NUMBER_OF_UE_MAX];
|
||||
uint32_t sizeof_paging[NUMBER_OF_UE_MAX];
|
||||
} rrc_eNB_carrier_data_t;
|
||||
|
||||
typedef struct eNB_RRC_INST_s {
|
||||
@@ -628,6 +650,8 @@ typedef struct UE_RRC_INST_s {
|
||||
#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 */
|
||||
@@ -635,6 +659,14 @@ typedef struct UE_RRC_INST_s {
|
||||
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
} UE_RRC_INST;
|
||||
|
||||
typedef struct UE_PF_PO_s {
|
||||
boolean_t enable_flag; /* flag indicate whether current object is used */
|
||||
uint16_t ue_index_value; /* UE index value */
|
||||
uint8_t PF_min; /* minimal value of Paging Frame (PF) */
|
||||
uint8_t PO; /* Paging Occasion (PO) */
|
||||
uint32_t T; /* DRX cycle */
|
||||
} UE_PF_PO_t;
|
||||
|
||||
#include "proto.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -77,6 +77,11 @@ extern uint32_t timeToTrigger_ms[16];
|
||||
extern float RSRP_meas_mapping[100];
|
||||
extern float RSRQ_meas_mapping[33];
|
||||
|
||||
extern UE_PF_PO_t UE_PF_PO[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
extern pthread_mutex_t ue_pf_po_mutex;
|
||||
|
||||
extern uint16_t reestablish_rnti_map[NUMBER_OF_UE_MAX][2];
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -254,6 +254,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
int freq_to_arfcn10(int band, unsigned long freq);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
@@ -261,6 +263,18 @@ rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
/**\brief release Data Radio Bearer between ENB and UE
|
||||
\param ctxt_pP Running context
|
||||
\param ue_context_pP UE context of UE receiving the message*/
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t xid,
|
||||
uint32_t nas_length,
|
||||
uint8_t* nas_buffer
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP);
|
||||
@@ -324,6 +338,12 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
|
||||
void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
|
||||
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
|
||||
@@ -333,26 +333,58 @@ rrc_rx_tx(
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
|
||||
if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) {
|
||||
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
|
||||
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n",
|
||||
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/8\n",
|
||||
ue_context_p->ue_context.rnti,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
|
||||
ue_context_p->ue_context.ul_failure_timer);
|
||||
}
|
||||
else {
|
||||
LOG_I(RRC,"UE rnti %x failure timer %d/20000\n",
|
||||
LOG_I(RRC,"UE rnti %x failure timer %d/8\n",
|
||||
ue_context_p->ue_context.rnti,
|
||||
ue_context_p->ue_context.ul_failure_timer);
|
||||
}
|
||||
}
|
||||
if (ue_context_p->ue_context.ul_failure_timer>0) {
|
||||
ue_context_p->ue_context.ul_failure_timer++;
|
||||
if (ue_context_p->ue_context.ul_failure_timer >= 20000) {
|
||||
if (ue_context_p->ue_context.ul_failure_timer >= 8) {
|
||||
// remove UE after 20 seconds after MAC has indicated UL failure
|
||||
LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti);
|
||||
ue_to_be_removed = ue_context_p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ue_context_p->ue_context.ue_release_timer_s1>0) {
|
||||
ue_context_p->ue_context.ue_release_timer_s1++;
|
||||
if (ue_context_p->ue_context.ue_release_timer_s1 >=
|
||||
ue_context_p->ue_context.ue_release_timer_thres_s1) {
|
||||
LOG_I(RRC,"Removing UE %x instance Because of UE_CONTEXT_RELEASE_COMMAND not received after %d ms from sending request\n",
|
||||
ue_context_p->ue_context.rnti, ue_context_p->ue_context.ue_release_timer_thres_s1);
|
||||
ue_to_be_removed = ue_context_p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.ue_release_timer_rrc>0) {
|
||||
ue_context_p->ue_context.ue_release_timer_rrc++;
|
||||
if (ue_context_p->ue_context.ue_release_timer_rrc >=
|
||||
ue_context_p->ue_context.ue_release_timer_thres_rrc) {
|
||||
LOG_I(RRC,"Removing UE %x instance After UE_CONTEXT_RELEASE_Complete\n", ue_context_p->ue_context.rnti);
|
||||
ue_to_be_removed = ue_context_p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.ue_reestablishment_timer>0) {
|
||||
ue_context_p->ue_context.ue_reestablishment_timer++;
|
||||
if (ue_context_p->ue_context.ue_reestablishment_timer >=
|
||||
ue_context_p->ue_context.ue_reestablishment_timer_thres) {
|
||||
LOG_I(RRC,"UE %d reestablishment_timer max\n",ue_context_p->ue_context.rnti);
|
||||
ue_context_p->ue_context.ul_failure_timer = 20000;
|
||||
ue_to_be_removed = ue_context_p;
|
||||
ue_context_p->ue_context.ue_reestablishment_timer = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ue_context_p->ue_context.ue_release_timer>0) {
|
||||
ue_context_p->ue_context.ue_release_timer++;
|
||||
if (ue_context_p->ue_context.ue_release_timer >=
|
||||
@@ -363,9 +395,18 @@ rrc_rx_tx(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ue_to_be_removed)
|
||||
if (ue_to_be_removed) {
|
||||
if(ue_to_be_removed->ue_context.ul_failure_timer >= 8) {
|
||||
ue_to_be_removed->ue_context.ue_release_timer_s1 = 1;
|
||||
ue_to_be_removed->ue_context.ue_release_timer_thres_s1 = 100;
|
||||
ue_to_be_removed->ue_context.ue_release_timer = 0;
|
||||
ue_to_be_removed->ue_context.ue_reestablishment_timer = 0;
|
||||
}
|
||||
rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed);
|
||||
|
||||
if(ue_to_be_removed->ue_context.ul_failure_timer >= 8){
|
||||
ue_to_be_removed->ue_context.ul_failure_timer = 0;
|
||||
}
|
||||
}
|
||||
#ifdef RRC_LOCALIZATION
|
||||
|
||||
/* for the localization, only primary CC_id might be relevant*/
|
||||
|
||||
+1634
-23
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,8 @@ extern RAN_CONTEXT_t RC;
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
)
|
||||
{
|
||||
rnti_t rnti;
|
||||
@@ -66,15 +67,18 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
|
||||
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
|
||||
|
||||
ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
ue_context_p->ue_context.enb_gtp_addrs[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_addr;
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
// ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
// ue_context_p->ue_context.enb_gtp_addrs[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_addr;
|
||||
// ue_context_p->ue_context.enb_gtp_ebi[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
ue_context_p->ue_context.enb_gtp_addrs[inde_list[i]] = create_tunnel_resp_pP->enb_addr;
|
||||
ue_context_p->ue_context.enb_gtp_ebi[inde_list[i]] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
create_tunnel_resp_pP->enb_S1u_teid[i],
|
||||
ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs],
|
||||
i+ue_context_p->ue_context.setup_e_rabs,
|
||||
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]],
|
||||
inde_list[i],
|
||||
i,
|
||||
create_tunnel_resp_pP->eps_bearer_id[i],
|
||||
create_tunnel_resp_pP->enb_addr.length);
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
);
|
||||
|
||||
# endif
|
||||
|
||||
@@ -342,6 +342,8 @@ static void process_eNB_security_key (
|
||||
|
||||
/* Saves the security key */
|
||||
memcpy (ue_context_pP->ue_context.kenb, security_key_pP, SECURITY_KEY_LENGTH);
|
||||
memset (ue_context_pP->ue_context.nh, 0, SECURITY_KEY_LENGTH);
|
||||
ue_context_pP->ue_context.nh_ncc = -1;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
sprintf(&ascii_buffer[2 * i], "%02X", ue_context_pP->ue_context.kenb[i]);
|
||||
@@ -355,7 +357,7 @@ static void process_eNB_security_key (
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
static void
|
||||
void
|
||||
rrc_pdcp_config_security(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
@@ -892,6 +894,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
//MessageDef *message_gtpv1u_p = NULL;
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
uint8_t inde_list[NB_RB_MAX - 3]={0};
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
@@ -937,10 +940,12 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
memcpy(&create_tunnel_req.sgw_addr[i],
|
||||
&S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).e_rab_param[i].sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
inde_list[create_tunnel_req.num_tunnels]= i;
|
||||
create_tunnel_req.num_tunnels++;
|
||||
}
|
||||
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = i;
|
||||
// create_tunnel_req.num_tunnels = i;
|
||||
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
instance,
|
||||
@@ -949,7 +954,8 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp);
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
ue_context_p->ue_context.setup_e_rabs=ue_context_p->ue_context.nb_of_e_rabs;
|
||||
}
|
||||
|
||||
@@ -1191,6 +1197,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
|
||||
}
|
||||
return (-1);
|
||||
} else {
|
||||
ue_context_p->ue_context.ue_release_timer_s1 = 0;
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
rrc_eNB_generate_RRCConnectionRelease(&ctxt, ue_context_p);
|
||||
/*
|
||||
@@ -1265,9 +1272,12 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
uint8_t inde_list[NB_RB_MAX - 3]={0};
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
uint8_t e_rab_done;
|
||||
|
||||
ue_initial_id = S1AP_E_RAB_SETUP_REQ (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_E_RAB_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
@@ -1298,35 +1308,46 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
|
||||
memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
uint8_t nb_e_rabs_tosetup = S1AP_E_RAB_SETUP_REQ (msg_p).nb_e_rabs_tosetup;
|
||||
e_rab_done = 0;
|
||||
|
||||
// keep the previous bearer
|
||||
// the index for the rec
|
||||
for (i = 0;
|
||||
i < nb_e_rabs_tosetup;
|
||||
// i < nb_e_rabs_tosetup;
|
||||
i < NB_RB_MAX - 3; // loop all e-rabs in e_rab[]
|
||||
i++) {
|
||||
if (ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status == E_RAB_STATUS_DONE)
|
||||
LOG_W(RRC,"E-RAB already configured, reconfiguring\n");
|
||||
ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].param = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i];
|
||||
//if (ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status == E_RAB_STATUS_DONE)
|
||||
// LOG_W(RRC,"E-RAB already configured, reconfiguring\n");
|
||||
// check e-rab status, if e rab status is greater than E_RAB_STATUS_DONE, don't not config this one
|
||||
if(ue_context_p->ue_context.e_rab[i].status >= E_RAB_STATUS_DONE)
|
||||
continue;
|
||||
//ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status = E_RAB_STATUS_NEW;
|
||||
//ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].param = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i];
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.e_rab[i].param = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[e_rab_done];
|
||||
|
||||
create_tunnel_req.eps_bearer_id[e_rab_done] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[e_rab_done].e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[e_rab_done] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[e_rab_done].gtp_teid;
|
||||
|
||||
create_tunnel_req.eps_bearer_id[i] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[i] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].gtp_teid;
|
||||
|
||||
memcpy(&create_tunnel_req.sgw_addr[i],
|
||||
& S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].sgw_addr,
|
||||
memcpy(&create_tunnel_req.sgw_addr[e_rab_done],
|
||||
& S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[e_rab_done].sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
|
||||
LOG_I(RRC,"E_RAB setup REQ: local index %d teid %u, eps id %d \n",
|
||||
i+ue_context_p->ue_context.setup_e_rabs,
|
||||
create_tunnel_req.sgw_S1u_teid[i],
|
||||
i,
|
||||
create_tunnel_req.sgw_S1u_teid[e_rab_done],
|
||||
create_tunnel_req.eps_bearer_id[i] );
|
||||
inde_list[e_rab_done] = i;
|
||||
e_rab_done++;
|
||||
if(e_rab_done >= nb_e_rabs_tosetup){
|
||||
break;
|
||||
}
|
||||
}
|
||||
ue_context_p->ue_context.nb_of_e_rabs=nb_e_rabs_tosetup;
|
||||
|
||||
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = i;
|
||||
create_tunnel_req.num_tunnels = e_rab_done;
|
||||
|
||||
// NN: not sure if we should create a new tunnel: need to check teid, etc.
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
@@ -1336,7 +1357,8 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp);
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
|
||||
ue_context_p->ue_context.setup_e_rabs+=nb_e_rabs_tosetup;
|
||||
|
||||
@@ -1400,12 +1422,17 @@ int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs_failed[e_rabs_failed].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
e_rabs_failed++;
|
||||
// TODO add cause when it will be integrated
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
|
||||
// NN: add conditions for e_rabs_failed
|
||||
} else {
|
||||
/*debug info for the xid */
|
||||
LOG_D(RRC,"xid does not corresponds (context e_rab index %d, status %d, xid %d/%d) \n ",
|
||||
e_rab, ue_context_pP->ue_context.e_rab[e_rab].status, xid, ue_context_pP->ue_context.e_rab[e_rab].xid);
|
||||
}
|
||||
}
|
||||
if ((e_rabs_done > 0) ){
|
||||
|
||||
LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: sending the message: nb_of_erabs %d, total e_rabs %d, index %d\n",
|
||||
@@ -1424,17 +1451,528 @@ int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
} else {
|
||||
/*debug info for the xid */
|
||||
LOG_D(RRC,"xid does not corresponds (context e_rab index %d, status %d, xid %d/%d) \n ",
|
||||
e_rab, ue_context_pP->ue_context.e_rab[e_rab].status, xid, ue_context_pP->ue_context.e_rab[e_rab].xid);
|
||||
}
|
||||
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
ue_context_pP->ue_context.e_rab[i].xid = -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
{
|
||||
int i;
|
||||
uint16_t ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
ue_initial_id = S1AP_E_RAB_MODIFY_REQ (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_E_RAB_MODIFY_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
LOG_D(RRC, "[eNB %d] Received %s: ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d\n",
|
||||
instance, msg_name, ue_initial_id, eNB_ue_s1ap_id, S1AP_E_RAB_MODIFY_REQ (msg_p).nb_e_rabs_tomodify);
|
||||
|
||||
if (ue_context_p == NULL) {
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_E_RAB_MODIFY_REQ: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
int nb_of_e_rabs_failed = 0;
|
||||
MessageDef *msg_fail_p = NULL;
|
||||
|
||||
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
||||
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).eNB_ue_s1ap_id = S1AP_E_RAB_MODIFY_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).nb_of_e_rabs = 0;
|
||||
|
||||
for (nb_of_e_rabs_failed = 0; nb_of_e_rabs_failed < S1AP_E_RAB_MODIFY_REQ (msg_p).nb_e_rabs_tomodify; nb_of_e_rabs_failed++) {
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs_failed[nb_of_e_rabs_failed].e_rab_id =
|
||||
S1AP_E_RAB_MODIFY_REQ (msg_p).e_rab_modify_params[nb_of_e_rabs_failed].e_rab_id;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs_failed[nb_of_e_rabs_failed].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = 31;//S1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances;
|
||||
}
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed;
|
||||
|
||||
itti_send_msg_to_task(TASK_S1AP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
|
||||
} else {
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
int j;
|
||||
boolean_t is_treated[S1AP_MAX_E_RAB] = {FALSE};
|
||||
uint8_t nb_of_failed_e_rabs = 0;
|
||||
|
||||
// keep the previous bearer
|
||||
// the index for the rec
|
||||
for (i = 0; i < S1AP_E_RAB_MODIFY_REQ (msg_p).nb_e_rabs_tomodify; i++) {
|
||||
if (is_treated[i] == TRUE) {
|
||||
// already treated
|
||||
continue;
|
||||
}
|
||||
for (j = i+1; j < S1AP_E_RAB_MODIFY_REQ (msg_p).nb_e_rabs_tomodify; j++) {
|
||||
if (is_treated[j] == FALSE &&
|
||||
S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[j].e_rab_id == S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id) {
|
||||
// handle multiple E-RAB ID
|
||||
ue_context_p->ue_context.modify_e_rab[j].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_e_rab[j].param.e_rab_id = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[j].e_rab_id;
|
||||
ue_context_p->ue_context.modify_e_rab[j].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_e_rab[j].cause_value = 31;//S1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances;
|
||||
nb_of_failed_e_rabs++;
|
||||
is_treated[i] = TRUE;
|
||||
is_treated[j] = TRUE;
|
||||
}
|
||||
}
|
||||
if (is_treated[i] == TRUE) {
|
||||
// handle multiple E-RAB ID
|
||||
ue_context_p->ue_context.modify_e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.e_rab_id = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause_value = 31;//S1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances;
|
||||
nb_of_failed_e_rabs++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].nas_pdu.length == 0) {
|
||||
// nas_pdu.length == 0
|
||||
ue_context_p->ue_context.modify_e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.e_rab_id = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause = S1AP_CAUSE_NAS;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause_value = 3;//S1ap_CauseNas_unspecified;
|
||||
nb_of_failed_e_rabs++;
|
||||
is_treated[i] = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < NB_RB_MAX-3; j++) {
|
||||
if (ue_context_p->ue_context.e_rab[j].param.e_rab_id == S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id) {
|
||||
if(ue_context_p->ue_context.e_rab[j].status == E_RAB_STATUS_TORELEASE || ue_context_p->ue_context.e_rab[j].status == E_RAB_STATUS_DONE){
|
||||
break;
|
||||
}
|
||||
ue_context_p->ue_context.modify_e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause = S1AP_CAUSE_NOTHING;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.e_rab_id = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.qos = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].qos;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.nas_pdu.length = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].nas_pdu.length;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.nas_pdu.buffer = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].nas_pdu.buffer;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.sgw_addr = ue_context_p->ue_context.e_rab[j].param.sgw_addr;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.gtp_teid = ue_context_p->ue_context.e_rab[j].param.gtp_teid;
|
||||
|
||||
is_treated[i] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_treated[i] == FALSE) {
|
||||
// handle Unknown E-RAB ID
|
||||
ue_context_p->ue_context.modify_e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.modify_e_rab[i].param.e_rab_id = S1AP_E_RAB_MODIFY_REQ(msg_p).e_rab_modify_params[i].e_rab_id;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.modify_e_rab[i].cause_value = 30;//S1ap_CauseRadioNetwork_unknown_E_RAB_ID;
|
||||
nb_of_failed_e_rabs++;
|
||||
is_treated[i] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.nb_of_modify_e_rabs = S1AP_E_RAB_MODIFY_REQ (msg_p).nb_e_rabs_tomodify;
|
||||
ue_context_p->ue_context.nb_of_failed_e_rabs = nb_of_failed_e_rabs;
|
||||
}
|
||||
|
||||
/* TODO parameters yet to process ... */
|
||||
{
|
||||
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.nb_of_failed_e_rabs < ue_context_p->ue_context.nb_of_modify_e_rabs) {
|
||||
if (0 == rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(&ctxt, ue_context_p, 0)) {
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int nb_of_e_rabs_failed = 0;
|
||||
MessageDef *msg_fail_p = NULL;
|
||||
|
||||
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
||||
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).eNB_ue_s1ap_id = S1AP_E_RAB_MODIFY_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
// S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs[S1AP_MAX_E_RAB];
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).nb_of_e_rabs = 0;
|
||||
|
||||
for(nb_of_e_rabs_failed = 0; nb_of_e_rabs_failed < ue_context_p->ue_context.nb_of_failed_e_rabs; nb_of_e_rabs_failed++) {
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs_failed[nb_of_e_rabs_failed].e_rab_id =
|
||||
ue_context_p->ue_context.modify_e_rab[nb_of_e_rabs_failed].param.e_rab_id;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).e_rabs_failed[nb_of_e_rabs_failed].cause = ue_context_p->ue_context.modify_e_rab[nb_of_e_rabs_failed].cause;
|
||||
}
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_fail_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed;
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
|
||||
|
||||
ue_context_p->ue_context.nb_of_modify_e_rabs = 0;
|
||||
ue_context_p->ue_context.nb_of_failed_e_rabs = 0;
|
||||
memset(ue_context_p->ue_context.modify_e_rab, 0, sizeof(ue_context_p->ue_context.modify_e_rab));
|
||||
|
||||
return (0);
|
||||
}
|
||||
} // end of ue_context_p != NULL
|
||||
}
|
||||
|
||||
/*NN: careful about the typcast of xid (long -> uint8_t*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t xid ) {
|
||||
|
||||
MessageDef *msg_p = NULL;
|
||||
int i;
|
||||
int e_rab;
|
||||
int e_rabs_done = 0;
|
||||
int e_rabs_failed = 0;
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
for (e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_modify_e_rabs; e_rab++) {
|
||||
|
||||
/* only respond to the corresponding transaction */
|
||||
if (xid == ue_context_pP->ue_context.modify_e_rab[e_rab].xid) {
|
||||
if (ue_context_pP->ue_context.modify_e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
for (i = 0; i < ue_context_pP->ue_context.setup_e_rabs; i++) {
|
||||
if (ue_context_pP->ue_context.modify_e_rab[e_rab].param.e_rab_id == ue_context_pP->ue_context.e_rab[i].param.e_rab_id) {
|
||||
// Update ue_context_pP->ue_context.e_rab
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_ESTABLISHED;
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos = ue_context_pP->ue_context.modify_e_rab[e_rab].param.qos;
|
||||
ue_context_pP->ue_context.e_rab[i].cause = S1AP_CAUSE_NOTHING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i < ue_context_pP->ue_context.setup_e_rabs) {
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id = ue_context_pP->ue_context.modify_e_rab[e_rab].param.e_rab_id;
|
||||
// TODO add other information from S1-U when it will be integrated
|
||||
|
||||
LOG_D (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d, xid %d): nb_of_modify_e_rabs %d, e_rab_id %d \n ",
|
||||
e_rabs_done, e_rab, ue_context_pP->ue_context.modify_e_rab[e_rab].status, xid,
|
||||
ue_context_pP->ue_context.nb_of_modify_e_rabs,
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id);
|
||||
|
||||
e_rabs_done++;
|
||||
} else {
|
||||
// unexpected
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs_failed[e_rabs_failed].e_rab_id = ue_context_pP->ue_context.modify_e_rab[e_rab].param.e_rab_id;
|
||||
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs_failed[e_rabs_failed].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs_failed[e_rabs_failed].cause_value = 30;//S1ap_CauseRadioNetwork_unknown_E_RAB_ID;
|
||||
|
||||
e_rabs_failed++;
|
||||
}
|
||||
} else if ((ue_context_pP->ue_context.modify_e_rab[e_rab].status == E_RAB_STATUS_NEW) ||
|
||||
(ue_context_pP->ue_context.modify_e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED)){
|
||||
LOG_D (RRC,"E-RAB is NEW or already ESTABLISHED\n");
|
||||
} else { /* status == E_RAB_STATUS_FAILED; */
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs_failed[e_rabs_failed].e_rab_id = ue_context_pP->ue_context.modify_e_rab[e_rab].param.e_rab_id;
|
||||
// add failure cause when defined
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).e_rabs_failed[e_rabs_failed].cause = ue_context_pP->ue_context.modify_e_rab[e_rab].cause;
|
||||
|
||||
e_rabs_failed++;
|
||||
}
|
||||
} else {
|
||||
/*debug info for the xid */
|
||||
LOG_D(RRC,"xid does not corresponds (context e_rab index %d, status %d, xid %d/%d) \n ",
|
||||
e_rab, ue_context_pP->ue_context.modify_e_rab[e_rab].status, xid, ue_context_pP->ue_context.modify_e_rab[e_rab].xid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
|
||||
// NN: add conditions for e_rabs_failed
|
||||
if (e_rabs_done > 0 || e_rabs_failed > 0) {
|
||||
LOG_D(RRC,"S1AP_E_RAB_MODIFY_RESP: sending the message: nb_of_modify_e_rabs %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_modify_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_E_RAB_SETUP_RESP (msg_p),
|
||||
sizeof(s1ap_e_rab_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" E_RAB_MODIFY_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance){
|
||||
uint16_t mme_ue_s1ap_id;
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
e_rab_release_t e_rab_release_params[S1AP_MAX_E_RAB];
|
||||
uint8_t nb_e_rabs_torelease;
|
||||
int erab;
|
||||
int i;
|
||||
uint8_t b_existed,is_existed;
|
||||
uint8_t xid;
|
||||
uint8_t e_rab_release_drb;
|
||||
MessageDef * msg_delete_tunnels_p = NULL;
|
||||
e_rab_release_drb = 0;
|
||||
memcpy(&e_rab_release_params[0], &(S1AP_E_RAB_RELEASE_COMMAND (msg_p).e_rab_release_params[0]), sizeof(e_rab_release_t)*S1AP_MAX_E_RAB);
|
||||
|
||||
mme_ue_s1ap_id = S1AP_E_RAB_RELEASE_COMMAND (msg_p).mme_ue_s1ap_id;
|
||||
eNB_ue_s1ap_id = S1AP_E_RAB_RELEASE_COMMAND (msg_p).eNB_ue_s1ap_id;
|
||||
nb_e_rabs_torelease = S1AP_E_RAB_RELEASE_COMMAND (msg_p).nb_e_rabs_torelease;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, UE_INITIAL_ID_INVALID, eNB_ue_s1ap_id);
|
||||
if(ue_context_p != NULL){
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
|
||||
xid = rrc_eNB_get_next_transaction_identifier(ctxt.module_id);
|
||||
|
||||
LOG_D(RRC,"S1AP-E-RAB Release Command: MME_UE_S1AP_ID %d ENB_UE_S1AP_ID %d release_e_rabs %d \n",
|
||||
mme_ue_s1ap_id, eNB_ue_s1ap_id,nb_e_rabs_torelease);
|
||||
for(erab = 0; erab < nb_e_rabs_torelease; erab++){
|
||||
b_existed = 0;
|
||||
is_existed = 0;
|
||||
for ( i = erab-1; i>= 0; i--){
|
||||
if (e_rab_release_params[erab].e_rab_id == e_rab_release_params[i].e_rab_id){
|
||||
is_existed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(is_existed == 1){
|
||||
//e_rab_id is existed
|
||||
continue;
|
||||
}
|
||||
for ( i = 0; i < NB_RB_MAX; i++){
|
||||
if (e_rab_release_params[erab].e_rab_id == ue_context_p->ue_context.e_rab[i].param.e_rab_id){
|
||||
b_existed = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(b_existed == 0) {
|
||||
//no e_rab_id
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].e_rab_id = e_rab_release_params[erab].e_rab_id;
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].cause_value = 30;
|
||||
ue_context_p->ue_context.nb_release_of_e_rabs++;
|
||||
} else {
|
||||
if(ue_context_p->ue_context.e_rab[i].status == E_RAB_STATUS_FAILED){
|
||||
ue_context_p->ue_context.e_rab[i].xid = xid;
|
||||
continue;
|
||||
} else if(ue_context_p->ue_context.e_rab[i].status == E_RAB_STATUS_ESTABLISHED){
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE;
|
||||
ue_context_p->ue_context.e_rab[i].xid = xid;
|
||||
e_rab_release_drb++;
|
||||
}else{
|
||||
//e_rab_id status NG
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].e_rab_id = e_rab_release_params[erab].e_rab_id;
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].cause = S1AP_CAUSE_RADIO_NETWORK;
|
||||
ue_context_p->ue_context.e_rabs_release_failed[ue_context_p->ue_context.nb_release_of_e_rabs].cause_value = 0;
|
||||
ue_context_p->ue_context.nb_release_of_e_rabs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(e_rab_release_drb > 0) {
|
||||
//RRCConnectionReconfiguration To UE
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release(&ctxt, ue_context_p, xid, S1AP_E_RAB_RELEASE_COMMAND (msg_p).nas_pdu.length, S1AP_E_RAB_RELEASE_COMMAND (msg_p).nas_pdu.buffer);
|
||||
} else {
|
||||
//gtp tunnel delete
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
for(i = 0; i < NB_RB_MAX; i++){
|
||||
if(xid == ue_context_p->ue_context.e_rab[i].xid){
|
||||
GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = ue_context_p->ue_context.enb_gtp_ebi[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[i] = 0;
|
||||
memset(&ue_context_p->ue_context.enb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[i]));
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p);
|
||||
|
||||
//S1AP_E_RAB_RELEASE_RESPONSE
|
||||
rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(&ctxt, ue_context_p, xid);
|
||||
}
|
||||
} else {
|
||||
LOG_E(RRC,"S1AP-E-RAB Release Command: MME_UE_S1AP_ID %d ENB_UE_S1AP_ID %d Error ue_context_p NULL \n",
|
||||
S1AP_E_RAB_RELEASE_COMMAND (msg_p).mme_ue_s1ap_id, S1AP_E_RAB_RELEASE_COMMAND (msg_p).eNB_ue_s1ap_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid){
|
||||
int e_rabs_released = 0;
|
||||
MessageDef *msg_p;
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_RELEASE_RESPONSE);
|
||||
S1AP_E_RAB_RELEASE_RESPONSE (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
for (int i = 0; i < NB_RB_MAX; i++){
|
||||
if (xid == ue_context_pP->ue_context.e_rab[i].xid){
|
||||
S1AP_E_RAB_RELEASE_RESPONSE (msg_p).e_rab_release[e_rabs_released].e_rab_id = ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
|
||||
e_rabs_released++;
|
||||
//clear
|
||||
memset(&ue_context_pP->ue_context.e_rab[i],0,sizeof(e_rab_param_t));
|
||||
}
|
||||
}
|
||||
S1AP_E_RAB_RELEASE_RESPONSE (msg_p).nb_of_e_rabs_released = e_rabs_released;
|
||||
S1AP_E_RAB_RELEASE_RESPONSE (msg_p).nb_of_e_rabs_failed = ue_context_pP->ue_context.nb_release_of_e_rabs;
|
||||
memcpy(&(S1AP_E_RAB_RELEASE_RESPONSE (msg_p).e_rabs_failed[0]),&ue_context_pP->ue_context.e_rabs_release_failed[0],sizeof(e_rab_failed_t)*ue_context_pP->ue_context.nb_release_of_e_rabs);
|
||||
|
||||
ue_context_pP->ue_context.setup_e_rabs -= e_rabs_released;
|
||||
LOG_I(RRC,"S1AP-E-RAB RELEASE RESPONSE: ENB_UE_S1AP_ID %d release_e_rabs %d setup_e_rabs %d \n",
|
||||
S1AP_E_RAB_RELEASE_RESPONSE (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_released, ue_context_pP->ue_context.setup_e_rabs);
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
//clear xid
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
ue_context_pP->ue_context.e_rab[i].xid = -1;
|
||||
}
|
||||
//clear release e_rabs
|
||||
ue_context_pP->ue_context.nb_release_of_e_rabs = 0;
|
||||
memset(&ue_context_pP->ue_context.e_rabs_release_failed[0],0,sizeof(e_rab_failed_t)*S1AP_MAX_E_RAB);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
{
|
||||
const unsigned int Ttab[4] = {32,64,128,256};
|
||||
uint8_t Tc,Tue; /* DRX cycle of UE */
|
||||
uint32_t pcch_nB; /* 4T, 2T, T, T/2, T/4, T/8, T/16, T/32 */
|
||||
uint32_t N; /* N: min(T,nB). total count of PF in one DRX cycle */
|
||||
uint32_t Ns = 0; /* Ns: max(1,nB/T) */
|
||||
uint8_t i_s; /* i_s = floor(UE_ID/N) mod Ns */
|
||||
uint32_t T; /* DRX cycle */
|
||||
for (uint16_t tai_size = 0; tai_size < S1AP_PAGING_IND(msg_p).tai_size; tai_size++) {
|
||||
LOG_D(RRC,"[eNB %d] In S1AP_PAGING_IND: MCC %d, MNC %d, TAC %d\n", instance, S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc,
|
||||
S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc, S1AP_PAGING_IND(msg_p).tac[tai_size]);
|
||||
if (RC.rrc[instance]->configuration.mcc == S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc
|
||||
&& RC.rrc[instance]->configuration.mnc == S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc
|
||||
&& RC.rrc[instance]->configuration.tac == S1AP_PAGING_IND(msg_p).tac[tai_size]) {
|
||||
for (uint8_t CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
lte_frame_type_t frame_type = RC.eNB[instance][CC_id]->frame_parms.frame_type;
|
||||
/* get nB from configuration */
|
||||
/* get default DRX cycle from configuration */
|
||||
Tc = (uint8_t)RC.rrc[instance]->configuration.pcch_defaultPagingCycle[CC_id];
|
||||
if (Tc < PCCH_Config__defaultPagingCycle_rf32 || Tc > PCCH_Config__defaultPagingCycle_rf256) {
|
||||
continue;
|
||||
}
|
||||
Tue = (uint8_t)S1AP_PAGING_IND(msg_p).paging_drx;
|
||||
/* set T = min(Tc,Tue) */
|
||||
T = Tc < Tue ? Ttab[Tc] : Ttab[Tue];
|
||||
/* set pcch_nB = PCCH-Config->nB */
|
||||
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.pcch_nB[CC_id];
|
||||
switch (pcch_nB) {
|
||||
case PCCH_Config__nB_fourT:
|
||||
Ns = 4;
|
||||
break;
|
||||
case PCCH_Config__nB_twoT:
|
||||
Ns = 2;
|
||||
break;
|
||||
default:
|
||||
Ns = 1;
|
||||
break;
|
||||
}
|
||||
/* set N = min(T,nB) */
|
||||
if (pcch_nB > PCCH_Config__nB_oneT) {
|
||||
switch (pcch_nB) {
|
||||
case PCCH_Config__nB_halfT:
|
||||
N = T/2;
|
||||
break;
|
||||
case PCCH_Config__nB_quarterT:
|
||||
N = T/4;
|
||||
break;
|
||||
case PCCH_Config__nB_oneEighthT:
|
||||
N = T/8;
|
||||
break;
|
||||
case PCCH_Config__nB_oneSixteenthT:
|
||||
N = T/16;
|
||||
break;
|
||||
case PCCH_Config__nB_oneThirtySecondT:
|
||||
N = T/32;
|
||||
break;
|
||||
default:
|
||||
/* pcch_nB error */
|
||||
LOG_E(RRC, "[eNB %d] In S1AP_PAGING_IND: pcch_nB error (pcch_nB %d) \n",
|
||||
instance, pcch_nB);
|
||||
return (-1);
|
||||
}
|
||||
} else {
|
||||
N = T;
|
||||
}
|
||||
|
||||
/* insert data to UE_PF_PO or update data in UE_PF_PO */
|
||||
pthread_mutex_lock(&ue_pf_po_mutex);
|
||||
uint8_t i = 0;
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
if ((UE_PF_PO[CC_id][i].enable_flag == TRUE && UE_PF_PO[CC_id][i].ue_index_value == (uint16_t)(S1AP_PAGING_IND(msg_p).ue_index_value))
|
||||
|| (UE_PF_PO[CC_id][i].enable_flag != TRUE)) {
|
||||
/* set T = min(Tc,Tue) */
|
||||
UE_PF_PO[CC_id][i].T = T;
|
||||
/* set UE_ID */
|
||||
UE_PF_PO[CC_id][i].ue_index_value = (uint16_t)S1AP_PAGING_IND(msg_p).ue_index_value;
|
||||
/* calculate PF and PO */
|
||||
/* set PF_min : SFN mod T = (T div N)*(UE_ID mod N) */
|
||||
UE_PF_PO[CC_id][i].PF_min = (T / N) * (UE_PF_PO[CC_id][i].ue_index_value % N);
|
||||
/* set PO */
|
||||
/* i_s = floor(UE_ID/N) mod Ns */
|
||||
i_s = (uint8_t)((UE_PF_PO[CC_id][i].ue_index_value / N) % Ns);
|
||||
if (Ns == 1) {
|
||||
UE_PF_PO[CC_id][i].PO = (frame_type==FDD) ? 9 : 0;
|
||||
} else if (Ns==2) {
|
||||
UE_PF_PO[CC_id][i].PO = (frame_type==FDD) ? (4+(5*i_s)) : (5*i_s);
|
||||
} else if (Ns==4) {
|
||||
UE_PF_PO[CC_id][i].PO = (frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1)));
|
||||
}
|
||||
if (UE_PF_PO[CC_id][i].enable_flag == TRUE) {
|
||||
//paging exist UE log
|
||||
LOG_D(RRC,"[eNB %d] CC_id %d In S1AP_PAGING_IND: Update exist UE %d, T %d, PF %d, PO %d\n", instance, CC_id, UE_PF_PO[CC_id][i].ue_index_value, T, UE_PF_PO[CC_id][i].PF_min, UE_PF_PO[CC_id][i].PO);
|
||||
} else {
|
||||
/* set enable_flag */
|
||||
UE_PF_PO[CC_id][i].enable_flag = TRUE;
|
||||
//paging new UE log
|
||||
LOG_D(RRC,"[eNB %d] CC_id %d In S1AP_PAGING_IND: Insert a new UE %d, T %d, PF %d, PO %d\n", instance, CC_id, UE_PF_PO[CC_id][i].ue_index_value, T, UE_PF_PO[CC_id][i].PF_min, UE_PF_PO[CC_id][i].PO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&ue_pf_po_mutex);
|
||||
|
||||
uint32_t length;
|
||||
uint8_t buffer[RRC_BUF_SIZE];
|
||||
uint8_t *message_buffer;
|
||||
/* Transfer data to PDCP */
|
||||
MessageDef *message_p;
|
||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_PCCH_DATA_REQ);
|
||||
/* Create message for PDCP (DLInformationTransfer_t) */
|
||||
length = do_Paging (instance,
|
||||
buffer,
|
||||
S1AP_PAGING_IND(msg_p).ue_paging_identity,
|
||||
S1AP_PAGING_IND(msg_p).cn_domain);
|
||||
message_buffer = itti_malloc (TASK_RRC_ENB, TASK_PDCP_ENB, length);
|
||||
/* Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). */
|
||||
memcpy (message_buffer, buffer, length);
|
||||
RRC_PCCH_DATA_REQ (message_p).sdu_size = length;
|
||||
RRC_PCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
RRC_PCCH_DATA_REQ (message_p).mode = PDCP_TRANSMISSION_MODE_TRANSPARENT; /* not used */
|
||||
RRC_PCCH_DATA_REQ (message_p).rnti = P_RNTI;
|
||||
RRC_PCCH_DATA_REQ (message_p).ue_index = i;
|
||||
RRC_PCCH_DATA_REQ (message_p).CC_id = CC_id;
|
||||
LOG_D(RRC, "[eNB %d] CC_id %d In S1AP_PAGING_IND: send encdoed buffer to PDCP buffer_size %d\n", instance, CC_id, length);
|
||||
itti_send_msg_to_task (TASK_PDCP_ENB, instance, message_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
# endif /* defined(ENABLE_ITTI) */
|
||||
#endif /* defined(ENABLE_USE_MME) */
|
||||
|
||||
@@ -79,6 +79,11 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
int
|
||||
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
/*! \fn void rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(uint8_t mod_id, uint8_t ue_index)
|
||||
*\brief create a S1AP_INITIAL_CONTEXT_SETUP_RESP for S1AP.
|
||||
@@ -186,6 +191,24 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
*\brief process a S1AP dedicated E_RAB modify request message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
*\param msg_name Message name.
|
||||
*\param instance Message instance.
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
/*! \fn rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid )
|
||||
*\brief send a S1AP dedicated E_RAB modify response
|
||||
*\param ctxt_pP contxt infirmation
|
||||
*\param e_contxt_pP ue specific context at the eNB
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
*\brief process a S1AP_UE_CTXT_MODIFICATION_REQ message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
@@ -213,6 +236,39 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_REQ (MessageDef *msg_p, const char *
|
||||
*/
|
||||
int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
/*! \fn rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
*\brief process a S1AP_PAGING_IND message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
*\param msg_name Message name.
|
||||
*\param instance Message instance.
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
void
|
||||
rrc_pdcp_config_security(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t send_security_mode_command
|
||||
);
|
||||
/*! \fn rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
*\brief process a S1AP dedicated E_RAB release command message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
*\param msg_name Message name.
|
||||
*\param instance Message instance.
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
/*! \fn rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid )
|
||||
*\brief send a S1AP dedicated E_RAB release response
|
||||
*\param ctxt_pP contxt infirmation
|
||||
*\param e_contxt_pP ue specific context at the eNB
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
|
||||
# endif
|
||||
# endif /* defined(ENABLE_USE_MME) */
|
||||
#endif /* RRC_ENB_S1AP_H_ */
|
||||
|
||||
@@ -136,6 +136,10 @@ rrc_eNB_allocate_new_UE_context(
|
||||
|
||||
memset(new_p, 0, sizeof(struct rrc_eNB_ue_context_s));
|
||||
new_p->local_uid = uid_linear_allocator_new(rrc_instance_pP);
|
||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||
new_p->ue_context.e_rab[i].xid = -1;
|
||||
new_p->ue_context.modify_e_rab[i].xid = -1;
|
||||
}
|
||||
return new_p;
|
||||
}
|
||||
|
||||
@@ -151,7 +155,21 @@ rrc_eNB_get_ue_context(
|
||||
memset(&temp, 0, sizeof(struct rrc_eNB_ue_context_s));
|
||||
/* eNB ue rrc id = 24 bits wide */
|
||||
temp.ue_id_rnti = rntiP;
|
||||
#if 0
|
||||
return RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp);
|
||||
#endif
|
||||
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||
ue_context_p = RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp);
|
||||
if ( ue_context_p != NULL) {
|
||||
return ue_context_p;
|
||||
} else {
|
||||
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(rrc_instance_pP->rrc_ue_head)) {
|
||||
if (ue_context_p->ue_context.rnti == rntiP) {
|
||||
return ue_context_p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -184,6 +202,7 @@ void rrc_eNB_remove_ue_context(
|
||||
rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP);
|
||||
uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid);
|
||||
free(ue_context_pP);
|
||||
rrc_instance_pP->Nb_ue --;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" Removed UE context\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
|
||||
UE_PF_PO_t UE_PF_PO[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
pthread_mutex_t ue_pf_po_mutex;
|
||||
UE_RRC_INST *UE_rrc_inst;
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#define MAX_U32 0xFFFFFFFF
|
||||
@@ -236,4 +238,10 @@ float RSRQ_meas_mapping[35] = {
|
||||
-2
|
||||
};
|
||||
|
||||
// only used for RRC connection re-establishment procedure TS36.331 5.3.7
|
||||
// [0]: current C-RNTI, [1]: prior C-RNTI
|
||||
// insert one when eNB received RRCConnectionReestablishmentRequest message
|
||||
// delete one when eNB received RRCConnectionReestablishmentComplete message
|
||||
uint16_t reestablish_rnti_map[NUMBER_OF_UE_MAX][2] = {{0}};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user