Commit ceef53c5 authored by francescomani's avatar francescomani Committed by Jaroslava Fiedlerova

improvements in ITTI for multi-ue instances

parent 8cd2d446
...@@ -159,7 +159,6 @@ typedef struct RrcMacCcchDataInd_s { ...@@ -159,7 +159,6 @@ typedef struct RrcMacCcchDataInd_s {
} RrcMacCcchDataInd; } RrcMacCcchDataInd;
typedef struct NRRrcMacCcchDataInd_s { typedef struct NRRrcMacCcchDataInd_s {
uint16_t rnti;
uint32_t sdu_size; uint32_t sdu_size;
uint8_t sdu[CCCH_SDU_SIZE]; uint8_t sdu[CCCH_SDU_SIZE];
} NRRrcMacCcchDataInd; } NRRrcMacCcchDataInd;
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
\param module_id module id */ \param module_id module id */
void nr_ue_init_mac(module_id_t module_idP); void nr_ue_init_mac(module_id_t module_idP);
void send_srb0_rrc(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data); void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data);
/**\brief apply default configuration values in nr_mac instance /**\brief apply default configuration values in nr_mac instance
\param mac mac instance */ \param mac mac instance */
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "openair2/LAYER2/RLC/rlc.h" #include "openair2/LAYER2/RLC/rlc.h"
static NR_UE_MAC_INST_t *nr_ue_mac_inst; static NR_UE_MAC_INST_t *nr_ue_mac_inst;
void send_srb0_rrc(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data) void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
{ {
AssertFatal(sdu_len > 0 && sdu_len < CCCH_SDU_SIZE, "invalid CCCH SDU size %d\n", sdu_len); AssertFatal(sdu_len > 0 && sdu_len < CCCH_SDU_SIZE, "invalid CCCH SDU size %d\n", sdu_len);
...@@ -50,8 +50,7 @@ void send_srb0_rrc(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data) ...@@ -50,8 +50,7 @@ void send_srb0_rrc(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
memset(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, 0, sdu_len); memset(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, 0, sdu_len);
memcpy(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, sdu, sdu_len); memcpy(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, sdu, sdu_len);
NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu_size = sdu_len; NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu_size = sdu_len;
NR_RRC_MAC_CCCH_DATA_IND(message_p).rnti = rnti; itti_send_msg_to_task(TASK_RRC_NRUE, ue_id, message_p);
itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p);
} }
void send_msg3_rrc_request(module_id_t mod_id, int rnti) void send_msg3_rrc_request(module_id_t mod_id, int rnti)
......
...@@ -750,8 +750,8 @@ srb_found: ...@@ -750,8 +750,8 @@ srb_found:
NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id; NR_RRC_DCCH_DATA_IND(message_p).dcch_index = srb_id;
NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p; NR_RRC_DCCH_DATA_IND(message_p).sdu_p = rrc_buffer_p;
NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size; NR_RRC_DCCH_DATA_IND(message_p).sdu_size = size;
NR_RRC_DCCH_DATA_IND(message_p).rnti = ue->rntiMaybeUEid; ue_id_t ue_id = ue->rntiMaybeUEid;
itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p); itti_send_msg_to_task(TASK_RRC_NRUE, ue_id, message_p);
} }
} }
......
...@@ -101,7 +101,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, ...@@ -101,7 +101,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
return(0); return(0);
} }
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, int rnti) void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti)
{ {
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_MSG3_IND); MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_MSG3_IND);
NR_RRC_MAC_MSG3_IND (message_p).rnti = rnti; NR_RRC_MAC_MSG3_IND (message_p).rnti = rnti;
......
...@@ -565,11 +565,12 @@ static int nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si) ...@@ -565,11 +565,12 @@ static int nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si)
return 0; return 0;
} }
void nr_rrc_ue_generate_ra_msg(NR_UE_RRC_INST_t *rrc, RA_trigger_t trigger) void nr_rrc_ue_generate_ra_msg(NR_UE_RRC_INST_t *rrc, RA_trigger_t trigger, int rnti)
{ {
switch (trigger) { switch (trigger) {
case INITIAL_ACCESS_FROM_RRC_IDLE: case INITIAL_ACCESS_FROM_RRC_IDLE:
// After SIB1 is received, prepare RRCConnectionRequest // After SIB1 is received, prepare RRCConnectionRequest
rrc->rnti = rnti;
nr_rrc_ue_generate_RRCSetupRequest(rrc); nr_rrc_ue_generate_RRCSetupRequest(rrc);
break; break;
case RRC_CONNECTION_REESTABLISHMENT: case RRC_CONNECTION_REESTABLISHMENT:
...@@ -865,7 +866,6 @@ static void rrc_ue_generate_RRCSetupComplete(instance_t instance, const uint8_t ...@@ -865,7 +866,6 @@ static void rrc_ue_generate_RRCSetupComplete(instance_t instance, const uint8_t
} }
static void nr_rrc_process_rrcsetup(const instance_t instance, static void nr_rrc_process_rrcsetup(const instance_t instance,
const rnti_t rnti,
const uint8_t gNB_index, const uint8_t gNB_index,
const NR_RRCSetup_t *rrcSetup) const NR_RRCSetup_t *rrcSetup)
{ {
...@@ -876,7 +876,6 @@ static void nr_rrc_process_rrcsetup(const instance_t instance, ...@@ -876,7 +876,6 @@ static void nr_rrc_process_rrcsetup(const instance_t instance,
// TODO none of the procedures implemented yet // TODO none of the procedures implemented yet
// perform the cell group configuration procedure in accordance with the received masterCellGroup // perform the cell group configuration procedure in accordance with the received masterCellGroup
rrc->rnti = rnti;
nr_rrc_ue_process_masterCellGroup(instance, nr_rrc_ue_process_masterCellGroup(instance,
rrc->perNB + gNB_index, rrc->perNB + gNB_index,
&rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup, &rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup,
...@@ -914,7 +913,6 @@ static void nr_rrc_process_rrcsetup(const instance_t instance, ...@@ -914,7 +913,6 @@ static void nr_rrc_process_rrcsetup(const instance_t instance,
} }
static int8_t nr_rrc_ue_decode_ccch(const instance_t instance, static int8_t nr_rrc_ue_decode_ccch(const instance_t instance,
const rnti_t rnti,
const NRRrcMacCcchDataInd *ind, const NRRrcMacCcchDataInd *ind,
const uint8_t gNB_index) const uint8_t gNB_index)
{ {
...@@ -950,8 +948,8 @@ static int8_t nr_rrc_ue_decode_ccch(const instance_t instance, ...@@ -950,8 +948,8 @@ static int8_t nr_rrc_ue_decode_ccch(const instance_t instance,
break; break;
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup: case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
LOG_I(NR_RRC, "[UE%ld][RAPROC] Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup RNTI %x\n", instance, rnti); LOG_I(NR_RRC, "[UE%ld][RAPROC] Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup\n", instance);
nr_rrc_process_rrcsetup(instance, rnti, gNB_index, dl_ccch_msg->message.choice.c1->choice.rrcSetup); nr_rrc_process_rrcsetup(instance, gNB_index, dl_ccch_msg->message.choice.c1->choice.rrcSetup);
rval = 0; rval = 0;
break; break;
...@@ -1459,7 +1457,7 @@ void *rrc_nrue(void *notUsed) ...@@ -1459,7 +1457,7 @@ void *rrc_nrue(void *notUsed)
break; break;
case NR_RRC_MAC_MSG3_IND: case NR_RRC_MAC_MSG3_IND:
nr_rrc_ue_generate_ra_msg(rrc, INITIAL_ACCESS_FROM_RRC_IDLE); nr_rrc_ue_generate_ra_msg(rrc, INITIAL_ACCESS_FROM_RRC_IDLE, NR_RRC_MAC_MSG3_IND(msg_p).rnti);
break; break;
case NR_RRC_MAC_RA_IND: case NR_RRC_MAC_RA_IND:
...@@ -1483,7 +1481,7 @@ void *rrc_nrue(void *notUsed) ...@@ -1483,7 +1481,7 @@ void *rrc_nrue(void *notUsed)
case NR_RRC_MAC_CCCH_DATA_IND: { case NR_RRC_MAC_CCCH_DATA_IND: {
NRRrcMacCcchDataInd *ind = &NR_RRC_MAC_CCCH_DATA_IND(msg_p); NRRrcMacCcchDataInd *ind = &NR_RRC_MAC_CCCH_DATA_IND(msg_p);
nr_rrc_ue_decode_ccch(instance, ind->rnti, ind, 0); nr_rrc_ue_decode_ccch(instance, ind, 0);
} break; } break;
case NR_RRC_DCCH_DATA_IND: case NR_RRC_DCCH_DATA_IND:
......
...@@ -88,7 +88,7 @@ void nr_rrc_going_to_IDLE(instance_t instance, ...@@ -88,7 +88,7 @@ void nr_rrc_going_to_IDLE(instance_t instance,
NR_RRCRelease_t *RRCRelease); NR_RRCRelease_t *RRCRelease);
void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success); void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success);
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, int rnti); void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti);
/**\brief RRC UE task. /**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */ \param void *args_p Pointer on arguments to start the task. */
......
...@@ -549,12 +549,12 @@ static void generateAuthenticationResp(nr_ue_nas_t *nas, as_nas_info_t *initialN ...@@ -549,12 +549,12 @@ static void generateAuthenticationResp(nr_ue_nas_t *nas, as_nas_info_t *initialN
initialNasMsg->length = mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data), size); initialNasMsg->length = mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data), size);
} }
int nas_itti_kgnb_refresh_req(const uint8_t kgnb[32]) int nas_itti_kgnb_refresh_req(instance_t instance, const uint8_t kgnb[32])
{ {
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_KENB_REFRESH_REQ); message_p = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_KENB_REFRESH_REQ);
memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kgnb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb)); memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kgnb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb));
return itti_send_msg_to_task(TASK_RRC_NRUE, 0, message_p); return itti_send_msg_to_task(TASK_RRC_NRUE, instance, message_p);
} }
static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg) static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg)
...@@ -1219,7 +1219,7 @@ void *nas_nrue(void *args_p) ...@@ -1219,7 +1219,7 @@ void *nas_nrue(void *args_p)
generateAuthenticationResp(nas, &initialNasMsg, pdu_buffer); generateAuthenticationResp(nas, &initialNasMsg, pdu_buffer);
break; break;
case FGS_SECURITY_MODE_COMMAND: case FGS_SECURITY_MODE_COMMAND:
nas_itti_kgnb_refresh_req(nas->security.kgnb); nas_itti_kgnb_refresh_req(instance, nas->security.kgnb);
generateSecurityModeComplete(nas, &initialNasMsg); generateSecurityModeComplete(nas, &initialNasMsg);
break; break;
case FGS_DOWNLINK_NAS_TRANSPORT: case FGS_DOWNLINK_NAS_TRANSPORT:
......
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