Commit 75a18c33 authored by laurent's avatar laurent

change name of single var that may be corenetwork ue id or RAN rnti

parent 4fe3599a
......@@ -185,8 +185,7 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s {
ue_id_t ue_id;
int num_tunnels;
teid_t gnb_NGu_teid[NR_GTPV1U_MAX_BEARERS_PER_UE]; ///< Tunnel Endpoint Identifier
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
int bearer_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t gnb_addr;
} gtpv1u_gnb_create_tunnel_resp_t;
typedef struct gtpv1u_gnb_delete_tunnel_req_s {
......
......@@ -215,7 +215,7 @@ typedef struct protocol_ctxt_s {
module_id_t module_id; /*!< \brief Virtualized module identifier */
eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */
instance_t instance; /*!< \brief ITTI or OTG module identifier */
rnti_t rnti;
ue_id_t rntiMaybeUEid;
frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
......@@ -252,36 +252,27 @@ typedef struct protocol_ctxt_s {
#define PROTOCOL_CTXT_COMPUTE_INSTANCE(CtXt_h) \
MODULE_ID_TO_INSTANCE( (CtXt_h)->module_id , (CtXt_h)->instance , (CtXt_h)->enb_flag )
#define PROTOCOL_CTXT_SET_BY_MODULE_ID(Ctxt_Pp, mODULE_iD, eNB_fLAG, rNTI, fRAME, sUBfRAME, eNB_iNDEX) \
(Ctxt_Pp)->module_id = mODULE_iD; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
(Ctxt_Pp)->eNB_index = eNB_iNDEX; \
(Ctxt_Pp)->module_id = mODULE_iD; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rntiMaybeUEid = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
(Ctxt_Pp)->eNB_index = eNB_iNDEX; \
PROTOCOL_CTXT_COMPUTE_INSTANCE(Ctxt_Pp)
#define PROTOCOL_CTXT_SET_BY_INSTANCE(Ctxt_Pp, iNSTANCE, eNB_fLAG, rNTI, fRAME, sUBfRAME) \
(Ctxt_Pp)->instance = iNSTANCE; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rnti = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
(Ctxt_Pp)->instance = iNSTANCE; \
(Ctxt_Pp)->enb_flag = eNB_fLAG; \
(Ctxt_Pp)->rntiMaybeUEid = rNTI; \
(Ctxt_Pp)->frame = fRAME; \
(Ctxt_Pp)->subframe = sUBfRAME; \
PROTOCOL_CTXT_COMPUTE_MODULE_ID(Ctxt_Pp)
#define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02d][RNTI %" PRIx16 "]"
#define PROTOCOL_CTXT_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \
((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB":" UE", \
(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 PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02d][RNTI %" PRIx64 "]"
#define PROTOCOL_CTXT_ARGS(CTXT_Pp) (CTXT_Pp)->frame, ((CTXT_Pp)->enb_flag == ENB_FLAG_YES) ? "eNB" : " UE", (CTXT_Pp)->module_id, (CTXT_Pp)->rntiMaybeUEid
#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)->rntiMaybeUEid
#define CHECK_CTXT_ARGS(CTXT_Pp)
......
......@@ -40,7 +40,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
#include "sctp_eNB_task.h"
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
......
......@@ -294,12 +294,12 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
protocol_ctxt_t ctxt={0};
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.rnti = f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id);
ctxt.rntiMaybeUEid = f1ap_get_rnti_by_cu_id(CUtype, instance, cu_ue_f1ap_id);
ctxt.enb_flag = 1;
ctxt.eNB_index = 0;
mem_block_t *mb = get_free_mem_block(ie->value.choice.RRCContainer.size,__func__);
memcpy((void *)mb->data,(void *)ie->value.choice.RRCContainer.buf,ie->value.choice.RRCContainer.size);
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %x srb_id %lu with size %ld (DCCH) \n", ctxt.rnti, srb_id, ie->value.choice.RRCContainer.size);
LOG_I(F1AP, "Calling pdcp_data_ind for UE RNTI %lx srb_id %lu with size %ld (DCCH) \n", ctxt.rntiMaybeUEid, srb_id, ie->value.choice.RRCContainer.size);
//LOG_I(F1AP, "%s() RRCContainer size %lu: ", __func__, ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", mb->data[i]);
......
......@@ -164,13 +164,11 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
protocol_ctxt_t ctxt;
ctxt.rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
ctxt.rntiMaybeUEid = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[ctxt.instance],
ctxt.rnti);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rntiMaybeUEid);
if (srb_id == 0) {
LTE_DL_CCCH_Message_t *dl_ccch_msg=NULL;
......@@ -257,7 +255,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
if (radioResourceConfigDedicated->mac_MainConfig)
mac_MainConfig = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
rrc_mac_config_req_eNB_t tmp = {0};
tmp.rnti = ctxt.rnti;
tmp.rnti = ctxt.rntiMaybeUEid;
tmp.physicalConfigDedicated = radioResourceConfigDedicated->physicalConfigDedicated;
tmp.mac_MainConfig = mac_MainConfig;
tmp.logicalChannelIdentity = 1;
......@@ -358,7 +356,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
MessageDef *message_p = NULL;
/* Send DRX configuration to MAC task to configure timers of local UE context */
message_p = itti_alloc_new_message(TASK_DU_F1, 0, RRC_MAC_DRX_CONFIG_REQ);
RRC_MAC_DRX_CONFIG_REQ(message_p).rnti = ctxt.rnti;
RRC_MAC_DRX_CONFIG_REQ(message_p).rnti = ctxt.rntiMaybeUEid;
RRC_MAC_DRX_CONFIG_REQ(message_p).drx_Configuration = mac_MainConfig->drx_Config;
itti_send_msg_to_task(TASK_MAC_ENB, ctxt.instance, message_p);
LOG_D(F1AP, "DRX configured in MAC Main Configuration for RRC Connection Reconfiguration\n");
......@@ -396,9 +394,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
if (DRB_configList->list.array[i]) {
drb_id = (int)DRB_configList->list.array[i]->drb_Identity;
LOG_I(F1AP,
"[DU %ld] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %x, reconfiguring DRB %d/LCID %d\n",
"[DU %ld] Logical Channel UL-DCCH, Received RRCConnectionReconfiguration for UE rnti %lx, reconfiguring DRB %d/LCID %d\n",
ctxt.instance,
ctxt.rnti,
ctxt.rntiMaybeUEid,
(int)DRB_configList->list.array[i]->drb_Identity,
(int)*DRB_configList->list.array[i]->logicalChannelIdentity);
......
......@@ -834,7 +834,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
f1ap_ue_context_release_cmd->rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
}
else{
ctxt.rnti = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.rntiMaybeUEid = f1ap_get_rnti_by_cu_id(DUtype, instance, ie->value.choice.GNB_CU_UE_F1AP_ID);
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
......@@ -850,9 +850,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
rnti, f1ap_ue_context_release_cmd->rnti);
}
else{
AssertFatal(ctxt.rnti == rnti,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)\n",
rnti, ctxt.rnti);
AssertFatal(ctxt.rntiMaybeUEid == rnti, "RNTI obtained through DU ID (%x) is different from CU ID (%lx)\n", rnti, ctxt.rntiMaybeUEid);
}
int UE_out_of_sync = 0;
......@@ -946,7 +944,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
return 0;
} else {
struct rrc_eNB_ue_context_s *ue_context_p;
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rnti);
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.instance], ctxt.rntiMaybeUEid);
if (ue_context_p && !UE_out_of_sync) {
// UE exists and is in sync so we start a timer before releasing the
......@@ -960,13 +958,12 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
else
rrc_release_info.RRC_release_ctrl[release_num].flag = 2;
rrc_release_info.RRC_release_ctrl[release_num].rnti = ctxt.rnti;
LOG_D(F1AP, "add rrc_release_info RNTI %x\n", ctxt.rnti);
rrc_release_info.RRC_release_ctrl[release_num].rnti = ctxt.rntiMaybeUEid;
LOG_D(F1AP, "add rrc_release_info RNTI %lx\n", ctxt.rntiMaybeUEid);
// TODO: how to provide the correct MUI?
rrc_release_info.RRC_release_ctrl[release_num].rrc_eNB_mui = 0;
rrc_release_info.num_UEs++;
LOG_D(RRC,"Generate DLSCH Release send: index %d rnti %x mui %d flag %d \n",release_num,
ctxt.rnti, 0, rrc_release_info.RRC_release_ctrl[release_num].flag);
LOG_D(RRC, "Generate DLSCH Release send: index %d rnti %lx mui %d flag %d \n", release_num, ctxt.rntiMaybeUEid, 0, rrc_release_info.RRC_release_ctrl[release_num].flag);
break;
}
}
......@@ -982,7 +979,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
// TODO send this once the connection has really been released
f1ap_ue_context_release_cplt_t cplt;
cplt.rnti = ctxt.rnti;
cplt.rnti = ctxt.rntiMaybeUEid;
DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt);
return 0;
}
......@@ -1248,7 +1245,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
ieRRC->value.choice.RRCContainer.buf, ieRRC->value.choice.RRCContainer.size);
protocol_ctxt_t ctxt;
// decode RRC Container and act on the message type
ctxt.rnti = f1ap_ue_context_modification_req->rnti;
ctxt.rntiMaybeUEid = f1ap_ue_context_modification_req->rnti;
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
......
......@@ -117,7 +117,7 @@ int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *
nr_rlc_srb0_recv_sdu(dl_rrc->rnti, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
protocol_ctxt_t ctxt = { .module_id = module_id, .rnti = dl_rrc->rnti };
protocol_ctxt_t ctxt = {.module_id = module_id, .rntiMaybeUEid = dl_rrc->rnti};
nr_rrc_rlc_config_asn1_req(&ctxt,
ue_context_p->ue_context.SRB_configList,
NULL,
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,11 +20,12 @@
*/
#include <stdint.h>
#include "openair2/COMMON/platform_types.h"
#ifndef _NR_PDCP_H_
#define _NR_PDCP_H_
void nr_pdcp_layer_init_ue(void);
void nr_DRB_preconfiguration(uint16_t crnti);
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
#endif /* _NR_PDCP_H_ */
......@@ -24,6 +24,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "openair2/COMMON/platform_types.h"
#include "nr_pdcp_sdu.h"
#include "openair2/RRC/NR/rrc_gNB_radio_bearers.h"
......@@ -184,6 +185,6 @@ nr_pdcp_entity_t *new_nr_pdcp_entity(
unsigned char *ciphering_key,
unsigned char *integrity_key);
void nr_DRB_preconfiguration(uint16_t crnti);
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
#endif /* _NR_PDCP_ENTITY_H_ */
This diff is collapsed.
......@@ -76,17 +76,17 @@ void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *_m)
}
/* must be called with lock acquired */
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t rntiMaybeUEid)
{
/* TODO: optimze */
nr_pdcp_ue_manager_internal_t *m = _m;
int i;
for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->ue_id == ue_id)
if (m->ue_list[i]->rntiMaybeUEid == rntiMaybeUEid)
return m->ue_list[i];
LOG_D(PDCP, "%s:%d:%s: new UE 0x%"PRIx64"\n", __FILE__, __LINE__, __FUNCTION__, ue_id);
LOG_D(PDCP, "%s:%d:%s: new UE ID/RNTI 0x%" PRIx64 "\n", __FILE__, __LINE__, __FUNCTION__, rntiMaybeUEid);
m->ue_count++;
m->ue_list = realloc(m->ue_list, sizeof(nr_pdcp_ue_t *) * m->ue_count);
......@@ -100,13 +100,13 @@ nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
exit(1);
}
m->ue_list[m->ue_count-1]->ue_id = ue_id;
m->ue_list[m->ue_count - 1]->rntiMaybeUEid = rntiMaybeUEid;
return m->ue_list[m->ue_count-1];
}
/* must be called with lock acquired */
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, ue_id_t rntiMaybeUEid)
{
nr_pdcp_ue_manager_internal_t *m = _m;
nr_pdcp_ue_t *ue;
......@@ -114,13 +114,11 @@ void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, ue_id_t ue_id)
int j;
for (i = 0; i < m->ue_count; i++)
if (m->ue_list[i]->ue_id == ue_id)
if (m->ue_list[i]->rntiMaybeUEid == rntiMaybeUEid)
break;
if (i == m->ue_count) {
LOG_D(PDCP, "%s:%d:%s: warning: ue 0x%"PRIx64" not found\n",
__FILE__, __LINE__, __FUNCTION__,
ue_id);
LOG_D(PDCP, "%s:%d:%s: warning: UE ID/RNTI 0x%" PRIx64 " not found\n", __FILE__, __LINE__, __FUNCTION__, rntiMaybeUEid);
return;
}
......@@ -204,11 +202,11 @@ int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m)
return m->ue_count;
}
int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *_m, ue_id_t *ret)
bool nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *_m, ue_id_t *ret)
{
nr_pdcp_ue_manager_internal_t *m = _m;
if (m->ue_count == 0)
return 0;
*ret = m->ue_list[0]->ue_id;
return 1;
return false;
*ret = m->ue_list[0]->rntiMaybeUEid;
return true;
}
......@@ -29,7 +29,7 @@
typedef void nr_pdcp_ue_manager_t;
typedef struct nr_pdcp_ue_t {
ue_id_t ue_id;
ue_id_t rntiMaybeUEid;
nr_pdcp_entity_t *srb[3];
nr_pdcp_entity_t *drb[MAX_DRBS_PER_UE];
} nr_pdcp_ue_t;
......@@ -45,8 +45,8 @@ int nr_pdcp_manager_get_enb_flag(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_lock(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *m);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, ue_id_t ue_id);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, ue_id_t rntiMaybeUEid);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, ue_id_t rntiMaybeUEid);
nr_pdcp_ue_t **nr_pdcp_manager_get_ue_list(nr_pdcp_ue_manager_t *_m);
int nr_pdcp_manager_get_ue_count(nr_pdcp_ue_manager_t *_m);
......@@ -65,6 +65,6 @@ void nr_pdcp_ue_add_drb_pdcp_entity(nr_pdcp_ue_t *ue, int drb_id,
/***********************************************************************/
/* returns 0 if no UE, 1 otherwise */
int nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *m, ue_id_t *ret);
bool nr_pdcp_get_first_ue_id(nr_pdcp_ue_manager_t *m, ue_id_t *ret);
#endif /* _NR_PDCP_UE_MANAGER_H_ */
......@@ -361,7 +361,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
const uint32_t *const destinationL2Id
)
{
int rnti = ctxt_pP->rnti;
int rnti = ctxt_pP->rntiMaybeUEid;
nr_rlc_ue_t *ue;
nr_rlc_entity_t *rb;
......@@ -370,8 +370,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
MBMS_flagP);
if (ctxt_pP->enb_flag)
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id),
T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rntiMaybeUEid), T_INT(rb_idP), T_INT(sdu_sizeP));
nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti);
......@@ -506,7 +505,7 @@ rb_found:
/* used fields? */
ctx.module_id = 0;
ctx.rnti = ue->rnti;
ctx.rntiMaybeUEid = ue->rnti;
is_enb = nr_rlc_manager_get_enb_flag(nr_rlc_ue_manager);
ctx.enb_flag = is_enb;
......@@ -961,7 +960,7 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list)
{
int rnti = ctxt_pP->rnti;
int rnti = ctxt_pP->rntiMaybeUEid;
int i;
int j;
......@@ -1109,8 +1108,8 @@ rlc_op_status_t rrc_rlc_config_req (
exit(1);
}
nr_rlc_manager_lock(nr_rlc_ue_manager);
LOG_D(RLC, "%s:%d:%s: remove rb %ld (is_srb %d) for UE RNTI %x\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP, ctxt_pP->rnti);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ctxt_pP->rnti);
LOG_D(RLC, "%s:%d:%s: remove rb %ld (is_srb %d) for UE RNTI %lx\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP, ctxt_pP->rntiMaybeUEid);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
if (srb_flagP) {
if (ue->srb[rb_idP-1] != NULL) {
ue->srb[rb_idP-1]->delete(ue->srb[rb_idP-1]);
......@@ -1133,7 +1132,7 @@ rlc_op_status_t rrc_rlc_config_req (
if (ue->drb[i] != NULL)
break;
if (i == MAX_DRBS_PER_UE)
nr_rlc_manager_remove_ue(nr_rlc_ue_manager, ctxt_pP->rnti);
nr_rlc_manager_remove_ue(nr_rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
}
nr_rlc_manager_unlock(nr_rlc_ue_manager);
return RLC_OP_STATUS_OK;
......@@ -1154,7 +1153,7 @@ void nr_rlc_remove_ue(int rnti)
rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
{
nr_rlc_remove_ue(x->rnti);
nr_rlc_remove_ue(x->rntiMaybeUEid);
return RLC_OP_STATUS_OK;
}
......
......@@ -278,7 +278,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
const uint32_t *const destinationL2Id
)
{
int rnti = ctxt_pP->rnti;
int rnti = ctxt_pP->rntiMaybeUEid;
rlc_ue_t *ue;
rlc_entity_t *rb;
......@@ -290,8 +290,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
MBMS_flagP);
if (ctxt_pP->enb_flag)
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id),
T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rntiMaybeUEid), T_INT(rb_idP), T_INT(sdu_sizeP));
rlc_manager_lock(rlc_ue_manager);
ue = rlc_manager_get_ue(rlc_ue_manager, rnti);
......@@ -404,7 +403,7 @@ rb_found:
/* used fields? */
ctx.module_id = ue->module_id;
ctx.rnti = ue->rnti;
ctx.rntiMaybeUEid = ue->rnti;
is_enb = rlc_manager_get_enb_flag(rlc_ue_manager);
ctx.enb_flag = is_enb;
......@@ -834,7 +833,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
const uint32_t destinationL2Id
)
{
int rnti = ctxt_pP->rnti;
int rnti = ctxt_pP->rntiMaybeUEid;
int module_id = ctxt_pP->module_id;
int i;
int j;
......@@ -979,8 +978,8 @@ rlc_op_status_t rrc_rlc_config_req (
exit(1);
}
rlc_manager_lock(rlc_ue_manager);
LOG_D(RLC, "%s:%d:%s: remove rb %d (is_srb %d) for UE %d\n", __FILE__, __LINE__, __FUNCTION__, (int)rb_idP, srb_flagP, ctxt_pP->rnti);
ue = rlc_manager_get_ue(rlc_ue_manager, ctxt_pP->rnti);
LOG_D(RLC, "%s:%d:%s: remove rb %d (is_srb %d) for UE %ld\n", __FILE__, __LINE__, __FUNCTION__, (int)rb_idP, srb_flagP, ctxt_pP->rntiMaybeUEid);
ue = rlc_manager_get_ue(rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
if (srb_flagP) {
if (ue->srb[rb_idP-1] != NULL) {
ue->srb[rb_idP-1]->delete(ue->srb[rb_idP-1]);
......@@ -1003,7 +1002,7 @@ rlc_op_status_t rrc_rlc_config_req (
if (ue->drb[i] != NULL)
break;
if (i == 5)
rlc_manager_remove_ue(rlc_ue_manager, ctxt_pP->rnti);
rlc_manager_remove_ue(rlc_ue_manager, ctxt_pP->rntiMaybeUEid);
}
rlc_manager_unlock(rlc_ue_manager);
return RLC_OP_STATUS_OK;
......@@ -1016,9 +1015,9 @@ void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t r
rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
{
LOG_D(RLC, "%s:%d:%s: remove UE %d\n", __FILE__, __LINE__, __FUNCTION__, x->rnti);
LOG_D(RLC, "%s:%d:%s: remove UE %ld\n", __FILE__, __LINE__, __FUNCTION__, x->rntiMaybeUEid);
rlc_manager_lock(rlc_ue_manager);
rlc_manager_remove_ue(rlc_ue_manager, x->rnti);
rlc_manager_remove_ue(rlc_ue_manager, x->rntiMaybeUEid);
rlc_manager_unlock(rlc_ue_manager);
return RLC_OP_STATUS_OK;
......
......@@ -40,7 +40,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
#include "sctp_eNB_task.h"
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
......
......@@ -80,7 +80,7 @@ rrc_data_req(
//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).rnti = ctxt_pP->rntiMaybeUEid;
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,
......@@ -113,13 +113,7 @@ rrc_data_ind(
LOG_I(RRC, "[UE %x] Frame %d: received a DCCH %ld message on SRB %ld with Size %d from eNB %d\n",
ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index);
} else {
LOG_D(RRC, "[eNB %d] Frame %d: received a DCCH %ld message on SRB %ld with Size %d from UE %x\n",
ctxt_pP->module_id,
ctxt_pP->frame,
DCCH_index,
Srb_id,
sdu_sizeP,
ctxt_pP->rnti);
LOG_D(RRC, "[eNB %d] Frame %d: received a DCCH %ld message on SRB %ld with Size %d from UE %lx\n", ctxt_pP->module_id, ctxt_pP->frame, DCCH_index, Srb_id, sdu_sizeP, ctxt_pP->rntiMaybeUEid);
}
{
......@@ -133,7 +127,7 @@ rrc_data_ind(
RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
RRC_DCCH_DATA_IND (message_p).sdu_size = sdu_sizeP;
RRC_DCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_IND (message_p).rnti = ctxt_pP->rnti;
RRC_DCCH_DATA_IND(message_p).rnti = ctxt_pP->rntiMaybeUEid;
RRC_DCCH_DATA_IND (message_p).module_id = ctxt_pP->module_id;
RRC_DCCH_DATA_IND (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, ctxt_pP->instance, message_p);
......
......@@ -292,7 +292,7 @@ rrc_data_req_ue(
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
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).rnti = ctxt_pP->rntiMaybeUEid;
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (
TASK_PDCP_UE,
......@@ -326,7 +326,7 @@ rrc_data_ind_ue(
RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
RRC_DCCH_DATA_IND (message_p).sdu_size = sdu_sizeP;
RRC_DCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_IND (message_p).rnti = ctxt_pP->rnti;
RRC_DCCH_DATA_IND(message_p).rnti = ctxt_pP->rntiMaybeUEid;
RRC_DCCH_DATA_IND (message_p).module_id = ctxt_pP->module_id;
RRC_DCCH_DATA_IND (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (TASK_RRC_UE, ctxt_pP->instance, message_p);
......
......@@ -3211,16 +3211,10 @@ uint8_t do_SecurityModeCommand(
return -1;
}
LOG_D(RRC,"[eNB %d] securityModeCommand for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(RRC, "[eNB %d] securityModeCommand for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[eNB %d] ASN1 : securityModeCommand encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(RRC, "[eNB %d] ASN1 : securityModeCommand encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -3334,16 +3328,10 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
return -1;
}
LOG_D(RRC,"[eNB %d] UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(RRC, "[eNB %d] UECapabilityRequest for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(RRC, "[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -3455,16 +3443,10 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
return -1;
}
LOG_D(RRC,"[eNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(RRC, "[eNB %d] NR UECapabilityRequest for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[eNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(RRC, "[eNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......
......@@ -758,16 +758,10 @@ uint8_t do_SecurityModeCommand_NB_IoT(
enc_rval.failed_type->name, enc_rval.encoded);
}
LOG_D(RRC,"[NB-IoT %d] securityModeCommand-NB for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(RRC, "[NB-IoT %d] securityModeCommand-NB for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[NB-IoT %d] ASN1 : securityModeCommand-NB encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(RRC, "[NB-IoT %d] ASN1 : securityModeCommand-NB encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -811,17 +805,10 @@ uint8_t do_UECapabilityEnquiry_NB_IoT(
enc_rval.failed_type->name, enc_rval.encoded);
}
LOG_D(RRC,"[NB-IoT %d] UECapabilityEnquiry-NB for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(RRC, "[NB-IoT %d] UECapabilityEnquiry-NB for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[NB-IoT %d] ASN1 : UECapabilityEnquiry-NB encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(RRC, "[NB-IoT %d] ASN1 : UECapabilityEnquiry-NB encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......
......@@ -548,7 +548,7 @@ static void rrc_ue_generate_RRCConnectionSetupComplete(
LOG_D(RLC,
"[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH);
ctxt_pP_local.rnti = ctxt_pP->rnti;
ctxt_pP_local.rntiMaybeUEid = ctxt_pP->rntiMaybeUEid;
rrc_data_req_ue (
ctxt_pP,
DCCH,
......@@ -648,11 +648,7 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *co
break;
case LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionSetup:
LOG_A(RRC,
"[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup RNTI %x\n",
ctxt_pP->module_id,
ctxt_pP->frame,
ctxt_pP->rnti);
LOG_A(RRC, "[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup RNTI %lx\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rntiMaybeUEid);
// Get configuration
// Release T300 timer
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].T300_active = 0;
......@@ -662,7 +658,7 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *co
&dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated);
rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].rnti = ctxt_pP->rnti;
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].rnti = ctxt_pP->rntiMaybeUEid;
rrc_ue_generate_RRCConnectionSetupComplete(
ctxt_pP,
eNB_index,
......@@ -1546,8 +1542,7 @@ rrc_ue_process_securityModeCommand(
pdcp_t *pdcp_p = NULL;
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti,
ctxt_pP->enb_flag, DCCH, SRB_FLAG_YES);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, ctxt_pP->enb_flag, DCCH, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void **) &pdcp_p);
if (h_rc == HASH_TABLE_OK) {
......@@ -2047,7 +2042,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
message_ral_p = itti_alloc_new_message (TASK_RRC_UE, 0, RRC_RAL_CONNECTION_REESTABLISHMENT_IND);
memset(&connection_reestablishment_ind, 0, sizeof(rrc_ral_connection_reestablishment_ind_t));
// TO DO ral_si_ind.plmn_id = 0;
connection_reestablishment_ind.ue_id = ctxt_pP->rnti;
connection_reestablishment_ind.ue_id = ctxt_pP->rntiMaybeUEid;
if (rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList != NULL) {
connection_reestablishment_ind.num_drb =
......
This diff is collapsed.
......@@ -58,9 +58,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->num_tunnels);
rnti = create_tunnel_resp_pP->rnti;
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[ctxt_pP->module_id],
ctxt_pP->rnti);
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], ctxt_pP->rntiMaybeUEid);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
......@@ -99,7 +97,7 @@ bool gtpv_data_req(const protocol_ctxt_t* const ctxt_pP,
LOG_I(GTPU,"gtpv_data_req sdu_sizeP == 0");
return false;
}
LOG_D(GTPU,"gtpv_data_req ue rnti %x sdu_sizeP %d rb id %ld", ctxt_pP->rnti, sdu_sizeP, rb_idP);
LOG_D(GTPU, "gtpv_data_req ue rnti %lx sdu_sizeP %d rb id %ld", ctxt_pP->rntiMaybeUEid, sdu_sizeP, rb_idP);
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;
......@@ -122,7 +120,7 @@ bool gtpv_data_req(const protocol_ctxt_t* const ctxt_pP,
GTPV1U_ENB_DATA_FORWARDING_IND (message_p).sdu_p = message_buffer;
GTPV1U_ENB_DATA_FORWARDING_IND (message_p).mode = modeP;
GTPV1U_ENB_DATA_FORWARDING_IND (message_p).module_id = ctxt_pP->module_id;
GTPV1U_ENB_DATA_FORWARDING_IND (message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_DATA_FORWARDING_IND(message_p).rnti = ctxt_pP->rntiMaybeUEid;
GTPV1U_ENB_DATA_FORWARDING_IND (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (TASK_DATA_FORWARDING, ctxt_pP->instance, message_p);
......@@ -145,7 +143,7 @@ bool gtpv_data_req(const protocol_ctxt_t* const ctxt_pP,
GTPV1U_ENB_END_MARKER_IND (message_p).sdu_p = message_buffer;
GTPV1U_ENB_END_MARKER_IND (message_p).mode = modeP;
GTPV1U_ENB_END_MARKER_IND (message_p).module_id = ctxt_pP->module_id;
GTPV1U_ENB_END_MARKER_IND (message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_END_MARKER_IND(message_p).rnti = ctxt_pP->rntiMaybeUEid;
GTPV1U_ENB_END_MARKER_IND (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (TASK_END_MARKER, ctxt_pP->instance, message_p);
......@@ -171,8 +169,8 @@ bool gtpv_data_req_new(protocol_ctxt_t *ctxt,
task=TASK_END_MARKER;
else
task=TASK_DATA_FORWARDING;
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt->module_id], ctxt->rnti);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt->module_id], ctxt->rntiMaybeUEid);
if(ue_context_p == NULL || ue_context_p->ue_context.handover_info == NULL ||
ue_context_p->ue_context.StatusRrc != RRC_HO_EXECUTION) {
LOG_E(RRC,"incoming GTP-U for X2 in non HO context\n");
......@@ -191,7 +189,7 @@ bool gtpv_data_req_new(protocol_ctxt_t *ctxt,
GTPV1U_ENB_END_MARKER_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + sdu_buffer_sizeP);
memcpy(&GTPV1U_ENB_END_MARKER_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], sdu_buffer_pP, sdu_buffer_sizeP);
GTPV1U_ENB_END_MARKER_REQ(msg).length = sdu_buffer_sizeP;
GTPV1U_ENB_END_MARKER_REQ(msg).rnti = ctxt->rnti;
GTPV1U_ENB_END_MARKER_REQ(msg).rnti = ctxt->rntiMaybeUEid;
GTPV1U_ENB_END_MARKER_REQ(msg).rab_id = rb_idP;
GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX;
LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt->frame,ctxt->subframe);
......@@ -210,7 +208,7 @@ bool gtpv_data_req_new(protocol_ctxt_t *ctxt,
ue_context_p->ue_context.handover_info->state = HO_END_MARKER;
gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req;
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
delete_tunnel_req.rnti = ctxt->rnti;
delete_tunnel_req.rnti = ctxt->rntiMaybeUEid;
gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req);
return true;
} else {
......
......@@ -520,7 +520,7 @@ rrc_pdcp_config_security(
}
}
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, DCCH, SRB_FLAG_YES);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, ctxt_pP->enb_flag, DCCH, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
if (h_rc == HASH_TABLE_OK) {
......@@ -691,7 +691,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
rrc_ue_s1ap_ids_p = malloc(sizeof(*rrc_ue_s1ap_ids_p));
rrc_ue_s1ap_ids_p->ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rntiMaybeUEid;
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
rrc_ue_s1ap_ids_p);
......@@ -1901,7 +1901,7 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
rrc_ue_s1ap_ids_p = malloc(sizeof(*rrc_ue_s1ap_ids_p));
rrc_ue_s1ap_ids_p->ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rntiMaybeUEid;
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
rrc_ue_s1ap_ids_p);
......
......@@ -90,7 +90,7 @@ nr_rrc_data_req(
//memcpy (NR_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).rnti = ctxt_pP->rntiMaybeUEid;
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,
......
......@@ -1311,16 +1311,10 @@ uint8_t do_NR_SecurityModeCommand(
return -1;
}
LOG_D(NR_RRC,"[gNB %d] securityModeCommand for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(NR_RRC, "[gNB %d] securityModeCommand for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(NR_RRC,"[gNB %d] ASN1 : securityModeCommand encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(NR_RRC, "[gNB %d] ASN1 : securityModeCommand encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -1406,16 +1400,10 @@ uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
return -1;
}
LOG_D(NR_RRC,"[gNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
LOG_D(NR_RRC, "[gNB %d] NR UECapabilityRequest for UE %lx Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(NR_RRC,"[gNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x\n",
ctxt_pP->module_id,
ctxt_pP->rnti);
LOG_E(NR_RRC, "[gNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %lx\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......
......@@ -210,17 +210,13 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
void nr_pdcp_add_srbs(eNB_flag_t enb_flag, rnti_t rnti,
NR_SRB_ToAddModList_t *const srb2add_list,
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kUPint);
void nr_pdcp_add_drbs(eNB_flag_t enb_flag, rnti_t rnti,
NR_DRB_ToAddModList_t *const drb2add_list,
const uint8_t security_modeP,
uint8_t *const kUPenc,
uint8_t *const kUPint,
void nr_pdcp_add_srbs(eNB_flag_t enb_flag, ue_id_t rntiMaybeUEid, NR_SRB_ToAddModList_t *const srb2add_list, const uint8_t security_modeP, uint8_t *const kRRCenc, uint8_t *const kUPint);
void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
ue_id_t rntiMaybeUEid,
NR_DRB_ToAddModList_t *const drb2add_list,
const uint8_t security_modeP,
uint8_t *const kUPenc,
uint8_t *const kUPint,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
#endif
This diff is collapsed.
......@@ -58,9 +58,7 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->num_tunnels);
rnti = create_tunnel_resp_pP->rnti;
ue_context_p = rrc_gNB_get_ue_context(
RC.nrrrc[ctxt_pP->module_id],
ctxt_pP->rnti);
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rntiMaybeUEid);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
ue_context_p->ue_context.gnb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
......@@ -98,9 +96,7 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->num_tunnels);
rnti = create_tunnel_resp_pP->ue_id;
ue_context_p = rrc_gNB_get_ue_context(
RC.nrrrc[ctxt_pP->module_id],
ctxt_pP->rnti);
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rntiMaybeUEid);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
ue_context_p->ue_context.gnb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->gnb_NGu_teid[i];
......
......@@ -372,7 +372,7 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ(
rrc_ue_ngap_ids_p = malloc(sizeof(rrc_ue_ngap_ids_t));
rrc_ue_ngap_ids_p->ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
rrc_ue_ngap_ids_p->gNB_ue_ngap_id = UE_INITIAL_ID_INVALID;
rrc_ue_ngap_ids_p->ue_rnti = ctxt_pP->rnti;
rrc_ue_ngap_ids_p->ue_rnti = ctxt_pP->rntiMaybeUEid;
h_rc = hashtable_insert(RC.nrrrc[ctxt_pP->module_id]->initial_id2_ngap_ids,
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
......
......@@ -210,7 +210,7 @@ rrc_gNB_get_next_free_ue_context(
//-----------------------------------------------------------------------------
{
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_gNB_get_ue_context(rrc_instance_pP, ctxt_pP->rnti);
ue_context_p = rrc_gNB_get_ue_context(rrc_instance_pP, ctxt_pP->rntiMaybeUEid);
if (ue_context_p == NULL) {
ue_context_p = rrc_gNB_allocate_new_UE_context(rrc_instance_pP);
......@@ -222,8 +222,8 @@ rrc_gNB_get_next_free_ue_context(
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_id_rnti = ctxt_pP->rntiMaybeUEid; // here ue_id_rnti is just a key, may be something else
ue_context_p->ue_context.rnti = ctxt_pP->rntiMaybeUEid; // 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,
......
......@@ -375,16 +375,17 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0, rrc->module_id);
LOG_W(RRC,
"Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %x, frame %d, subframe %d eNB_index %d \n",
"Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %lx, frame %d, subframe %d eNB_index %d \n",
&ctxt,
ctxt.module_id,
ctxt.rnti,
ctxt.rntiMaybeUEid,
ctxt.frame,
ctxt.subframe,
ctxt.eNB_index);
nr_pdcp_add_drbs(ctxt.enb_flag, ctxt.rnti,
ue_context_p->ue_context.rb_config->drb_ToAddModList ,
nr_pdcp_add_drbs(ctxt.enb_flag,
ctxt.rntiMaybeUEid,
ue_context_p->ue_context.rb_config->drb_ToAddModList,
(ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm,
kUPenc,
kUPint,
......@@ -394,10 +395,10 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : NULL,
ue_context_p->ue_context.rb_config->drb_ToAddModList,
ue_context_p->ue_context.rb_config->drb_ToReleaseList,
(LTE_PMCH_InfoList_r9_t *) NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti);
LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %lx\n", __FUNCTION__, __LINE__, ctxt.rntiMaybeUEid);
}
void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
......
......@@ -176,7 +176,7 @@ rrc_data_req_nr_ue(
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
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).rnti = ctxt_pP->rntiMaybeUEid;
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task (
TASK_PDCP_UE,
......
......@@ -1403,33 +1403,20 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
break;
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
LOG_I(NR_RRC,
"[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup RNTI %x\n",
ctxt_pP->module_id,
ctxt_pP->frame,
ctxt_pP->rnti);
// Get configuration
// Release T300 timer
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
nr_rrc_ue_process_masterCellGroup(
ctxt_pP,
gNB_index,
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
nr_rrc_ue_process_RadioBearerConfig(ctxt_pP,
gNB_index,
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
nr_rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED_NR);
nr_rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED_NR);
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rnti;
rrc_ue_generate_RRCSetupComplete(
ctxt_pP,
gNB_index,
dl_ccch_msg->message.choice.c1->choice.rrcSetup->rrc_TransactionIdentifier,
NR_UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
rval = 0;
break;
LOG_I(NR_RRC, "[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup RNTI %lx\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rntiMaybeUEid);
// Get configuration
// Release T300 timer
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
nr_rrc_ue_process_masterCellGroup(ctxt_pP, gNB_index, &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
nr_rrc_ue_process_RadioBearerConfig(ctxt_pP, gNB_index, &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
nr_rrc_set_state(ctxt_pP->module_id, RRC_STATE_CONNECTED_NR);
nr_rrc_set_sub_state(ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED_NR);
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rntiMaybeUEid;
rrc_ue_generate_RRCSetupComplete(ctxt_pP, gNB_index, dl_ccch_msg->message.choice.c1->choice.rrcSetup->rrc_TransactionIdentifier, NR_UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
rval = 0;
break;
default:
LOG_E(NR_RRC, "[UE%d] Frame %d : Unknown message\n",
......@@ -1970,10 +1957,10 @@ nr_rrc_ue_establish_srb2(
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, &kRRCint);
// Refresh SRBs
nr_pdcp_add_srbs(ctxt_pP->enb_flag, ctxt_pP->rnti,
nr_pdcp_add_srbs(ctxt_pP->enb_flag,
ctxt_pP->rntiMaybeUEid,
radioBearerConfig->srb_ToAddModList,
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm |
(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
kRRCenc,
kRRCint);
// Refresh SRBs
......@@ -2068,21 +2055,15 @@ nr_rrc_ue_establish_srb2(
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, &kUPint);
// Refresh DRBs
nr_pdcp_add_drbs(ctxt_pP->enb_flag, ctxt_pP->rnti,
nr_pdcp_add_drbs(ctxt_pP->enb_flag,
ctxt_pP->rntiMaybeUEid,
radioBearerConfig->drb_ToAddModList,
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm
| (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
kUPenc,
kUPint,
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList);
// Refresh DRBs
nr_rrc_rlc_config_asn1_req(ctxt_pP,
NULL,
radioBearerConfig->drb_ToAddModList,
NULL,
NULL,
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList
);
nr_rrc_rlc_config_asn1_req(ctxt_pP, NULL, radioBearerConfig->drb_ToAddModList, NULL, NULL, NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList);
} // drb_ToAddModList //
if (radioBearerConfig->drb_ToReleaseList != NULL) {
......
......@@ -73,8 +73,8 @@ void sdap_data_ind(rb_id_t pdcp_entity,
nr_sdap_entity_t *sdap_entity;
sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
if(sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found for ue rnti: %lu and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ue_id, pdusession_id);
if (sdap_entity == NULL) {
LOG_E(SDAP, "%s:%d:%s: Entity not found for ue rnti/ue_id: %lx and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ue_id, pdusession_id);
return;
}
......
......@@ -37,11 +37,12 @@ static nr_sdap_entity_info sdap_info;
nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager(void);
void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){
void nr_pdcp_submit_sdap_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu)
{
nr_pdcp_ue_t *ue;
nr_pdcp_ue_manager_t *nr_pdcp_ue_manager;
nr_pdcp_ue_manager = nr_pdcp_sdap_get_ue_manager();
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, ue_id);
ue->drb[sdap_ctrl_pdu_drb-1]->recv_sdu(ue->drb[sdap_ctrl_pdu_drb-1], (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED);
LOG_D(SDAP, "Control PDU - Submitting Control PDU to DRB ID: %ld\n", sdap_ctrl_pdu_drb);
LOG_D(SDAP, "QFI: %u\n R: %u\n D/C: %u\n", ctrl_pdu.QFI, ctrl_pdu.R, ctrl_pdu.DC);
......@@ -365,19 +366,15 @@ rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int
return drb_of_endmarker;
}
void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){
void nr_sdap_submit_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu)
{
if(sdap_ctrl_pdu_drb){
nr_pdcp_submit_sdap_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, ctrl_pdu);
nr_pdcp_submit_sdap_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, ctrl_pdu);
LOG_D(SDAP, "Sent Control PDU to PDCP Layer.\n");
}
}
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
rb_id_t pdcp_entity,
uint16_t rnti,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount,
uint8_t drb_identity)
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, rb_id_t pdcp_entity, ue_id_t ue_id, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount, uint8_t drb_identity)
{
LOG_D(SDAP, "RRC Configuring SDAP Entity\n");
uint8_t qfi = 0;
......@@ -388,33 +385,26 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi].drb_id == SDAP_NO_MAPPING_RULE){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi);
rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi);
existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
existing_sdap_entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
if(existing_sdap_entity->qfi2drb_table[qfi].drb_id != drb_identity && existing_sdap_entity->qfi2drb_table[qfi].hasSdap){
nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi);
rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi);
existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
existing_sdap_entity->sdap_submit_ctrl_pdu(ue_id, sdap_ctrl_pdu_drb, sdap_ctrl_pdu);
}
LOG_D(SDAP, "Storing the configured QoS flow to DRB mapping rule\n");
existing_sdap_entity->qfi2drb_map_update(existing_sdap_entity, qfi, drb_identity, hasSdap);
}
}
nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb,
int has_sdap,
uint16_t rnti,
int pdusession_id,
bool is_defaultDRB,
uint8_t drb_identity,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount)
nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb, int has_sdap, ue_id_t ue_id, int pdusession_id, bool is_defaultDRB, uint8_t drb_identity, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount)
{
if(nr_sdap_get_entity(rnti, pdusession_id)) {
LOG_E(SDAP, "SDAP Entity for UE already exists with RNTI: %u and PDU SESSION ID: %d\n", rnti, pdusession_id);
nr_sdap_entity_t *existing_sdap_entity = nr_sdap_get_entity(rnti, pdusession_id);
if (nr_sdap_get_entity(ue_id, pdusession_id)) {
LOG_E(SDAP, "SDAP Entity for UE already exists with RNTI/UE ID: %lu and PDU SESSION ID: %d\n", ue_id, pdusession_id);
nr_sdap_entity_t *existing_sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id);
rb_id_t pdcp_entity = existing_sdap_entity->default_drb;
if(!is_gnb)
nr_sdap_ue_qfi2drb_config(existing_sdap_entity, pdcp_entity, rnti, mapped_qfi_2_add, mappedQFIs2AddCount, drb_identity);
nr_sdap_ue_qfi2drb_config(existing_sdap_entity, pdcp_entity, ue_id, mapped_qfi_2_add, mappedQFIs2AddCount, drb_identity);
return existing_sdap_entity;
}
......@@ -426,7 +416,7 @@ nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb,
exit(1);
}
sdap_entity->rnti = rnti;
sdap_entity->ue_id = ue_id;
sdap_entity->pdusession_id = pdusession_id;
sdap_entity->tx_entity = nr_sdap_tx_entity;
......@@ -458,38 +448,39 @@ nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb,
return sdap_entity;
}
nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) {
nr_sdap_entity_t *nr_sdap_get_entity(ue_id_t ue_id, int pdusession_id)
{
nr_sdap_entity_t *sdap_entity;
sdap_entity = sdap_info.sdap_entity_llist;
if(sdap_entity == NULL)
return NULL;
while(( sdap_entity->rnti != rnti || sdap_entity->pdusession_id != pdusession_id ) && sdap_entity->next_entity != NULL) {
while ((sdap_entity->ue_id != ue_id || sdap_entity->pdusession_id != pdusession_id) && sdap_entity->next_entity != NULL) {
sdap_entity = sdap_entity->next_entity;
}
if (sdap_entity->rnti == rnti && sdap_entity->pdusession_id == pdusession_id)
if (sdap_entity->ue_id == ue_id && sdap_entity->pdusession_id == pdusession_id)
return sdap_entity;
return NULL;
}
void delete_nr_sdap_entity(uint16_t rnti) {
void delete_nr_sdap_entity(ue_id_t ue_id)
{
nr_sdap_entity_t *entityPtr, *entityPrev = NULL;
entityPtr = sdap_info.sdap_entity_llist;
if(entityPtr->rnti == rnti) {
if (entityPtr->ue_id == ue_id) {
sdap_info.sdap_entity_llist = sdap_info.sdap_entity_llist->next_entity;
free(entityPtr);
} else {
while(entityPtr->rnti != rnti && entityPtr->next_entity != NULL) {
while (entityPtr->ue_id != ue_id && entityPtr->next_entity != NULL) {
entityPrev = entityPtr;
entityPtr = entityPtr->next_entity;
}
if(entityPtr->rnti != rnti) {
if (entityPtr->ue_id != ue_id) {
entityPrev->next_entity = entityPtr->next_entity;
free(entityPtr);
}
......
......@@ -68,10 +68,10 @@ typedef struct qfi2drb_s {
bool hasSdap;
} qfi2drb_t;
void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
void nr_pdcp_submit_sdap_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
typedef struct nr_sdap_entity_s {
uint16_t rnti;
ue_id_t ue_id;
rb_id_t default_drb;
int pdusession_id;
qfi2drb_t qfi2drb_table[SDAP_MAX_QFI];
......@@ -82,8 +82,7 @@ typedef struct nr_sdap_entity_s {
nr_sdap_ul_hdr_t (*sdap_construct_ctrl_pdu)(uint8_t qfi);
rb_id_t (*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi);
void (*sdap_submit_ctrl_pdu)(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
void (*sdap_submit_ctrl_pdu)(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
bool (*tx_entity)(struct nr_sdap_entity_s *entity,
protocol_ctxt_t *ctxt_p,
......@@ -148,36 +147,24 @@ rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int
* TS 37.324 5.3 QoS flow to DRB Mapping
* Submit the end-marker control PDU to the lower layer.
*/
void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
void nr_sdap_submit_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu);
/*
* TS 37.324 5.3 QoS flow to DRB Mapping
* 5.3.1 Configuration Procedures
*/
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity,
rb_id_t pdcp_entity,
uint16_t rnti,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount,
uint8_t drb_identity);
void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, rb_id_t pdcp_entity, ue_id_t ue_id, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount, uint8_t drb_identity);
/*
* TS 37.324 4.4 5.1.1 SDAP entity establishment
* Establish an SDAP entity.
*/
nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb,
int has_sdap,
uint16_t rnti,
int pdusession_id,
bool is_defaultDRB,
uint8_t default_DRB,
NR_QFI_t *mapped_qfi_2_add,
uint8_t mappedQFIs2AddCount);
nr_sdap_entity_t *new_nr_sdap_entity(int is_gnb, int has_sdap, ue_id_t ue_id, int pdusession_id, bool is_defaultDRB, uint8_t default_DRB, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount);
/* Entity Handling Related Functions */
nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id);
nr_sdap_entity_t *nr_sdap_get_entity(ue_id_t ue_id, int pdusession_id);
/* Entity Handling Related Functions */
void delete_nr_sdap_entity(uint16_t rnti);
void delete_nr_sdap_entity(ue_id_t ue_id);
#endif
......@@ -40,7 +40,7 @@
# include "intertask_interface.h"
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
#include "sctp_eNB_task.h"
# include "x2ap_eNB.h"
# include "x2ap_messages_types.h"
......
......@@ -921,7 +921,7 @@ static int Gtpv1uHandleEndMarker(int h,
ctxt.module_id = 0;
ctxt.enb_flag = 1;
ctxt.instance = inst->addr.originInstance;
ctxt.rnti = tunnel->second.ue_id;
ctxt.rntiMaybeUEid = tunnel->second.ue_id;
ctxt.frame = 0;
ctxt.subframe = 0;
ctxt.eNB_index = 0;
......@@ -1054,7 +1054,7 @@ static int Gtpv1uHandleGpdu(int h,
ctxt.module_id = 0;
ctxt.enb_flag = 1;
ctxt.instance = inst->addr.originInstance;
ctxt.rnti = tunnel->second.ue_id;
ctxt.rntiMaybeUEid = tunnel->second.ue_id;
ctxt.frame = 0;
ctxt.subframe = 0;
ctxt.eNB_index = 0;
......@@ -1104,7 +1104,7 @@ static int Gtpv1uHandleGpdu(int h,
if(NR_PDCP_PDU_SN > 0 && NR_PDCP_PDU_SN %5 ==0){
LOG_D (GTPU, "Create and send DL DATA Delivery status for the previously received PDU, NR_PDCP_PDU_SN: %u \n", NR_PDCP_PDU_SN);
int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(ctxt.rnti, rb_id + 3);
int rlc_tx_buffer_space = nr_rlc_get_available_tx_space(ctxt.rntiMaybeUEid, rb_id + 3);
LOG_D(GTPU, "Available buffer size in RLC for Tx: %d \n", rlc_tx_buffer_space);
/*Total size of DDD_status PDU = 1 octet to report extension header length
* size of mandatory part + 3 octets for highest transmitted/delivered PDCP SN
......
......@@ -499,7 +499,7 @@ int main ( int argc, char **argv )
protocol_ctxt_t ctxt;
ctxt.module_id = 0 ;
ctxt.instance = 0;
ctxt.rnti = 0;
ctxt.rntiMaybeUEid = 0;
ctxt.enb_flag = 1;
ctxt.frame = 0;
ctxt.subframe = 0;
......
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