Commit 180f9787 authored by Swetank Srivastava's avatar Swetank Srivastava Committed by Vijay C

sync issue fix for portman, sys task and rrc

parent 73a46650
......@@ -472,6 +472,7 @@ int logInit (void)
register_log_component("ENB_APP","log",ENB_APP);
register_log_component("ENB_SS","log",ENB_SS);
register_log_component("ENB_SS_PORTMAN","log",ENB_SS_PORTMAN);
register_log_component("ENB_SS_PORTMAN_ACP","log",ENB_SS_PORTMAN_ACP);
register_log_component("ENB_SS_SYS_TASK","log",ENB_SS_SYS_TASK);
register_log_component("ENB_SS_SRB_ACP","log",ENB_SS_SRB_ACP);
register_log_component("ENB_SS_SYSIND","log",ENB_SS_SYSIND);
......
......@@ -172,6 +172,7 @@ extern "C" {
#define DEBUG_ENB_SS_VNG (1<<30)
#define DEBUG_ENB_SS_VTP (1<<31)
#define DEBUG_ENB_SS_VT_TIMER (1<<32)
#define DEBUG_ENB_SS_PORTMAN_ACP (1<<33)
#define LOG_MASKMAP_INIT {\
{"PRACH", DEBUG_PRACH},\
......@@ -192,6 +193,7 @@ extern "C" {
{"UE_TIMING", UE_TIMING},\
{"ENB_SS", DEBUG_ENB_SS},\
{"ENB_SS_PORTMAN", DEBUG_ENB_SS_PORTMAN},\
{"ENB_SS_PORTMAN_ACP", DEBUG_ENB_SS_PORTMAN_ACP},\
{"ENB_SS_SYS_TASK", DEBUG_ENB_SS_SYS_TASK},\
{"ENB_SS_SRB_ACP", DEBUG_ENB_SS_SRB_ACP},\
{"ENB_SS_SYSIND", DEBUG_ENB_SS_SYSIND},\
......@@ -253,6 +255,7 @@ typedef enum {
ENB_APP,
ENB_SS,
ENB_SS_PORTMAN,
ENB_SS_PORTMAN_ACP,
ENB_SS_SYS_TASK,
ENB_SS_SRB_ACP,
ENB_SS_SYSIND,
......
......@@ -655,6 +655,27 @@ ID = LEGACY_ENB_SS_PORTMAN_TRACE
GROUP = ALL:LEGACY_ENB_SS_PORTMAN:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_PORTMAN_ACP_INFO
DESC = ENB_SS_PORTMAN_ACP legacy logs - info level
GROUP = ALL:LEGACY_ENB_SS_PORTMAN_ACP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_PORTMAN_ACP_ERROR
DESC = ENB_SS_PORTMAN_ACP legacy logs - error level
GROUP = ALL:LEGACY_ENB_SS_PORTMAN_ACP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_PORTMAN_ACP_WARNING
DESC = ENB_SS_PORTMAN_ACP legacy logs - warning level
GROUP = ALL:LEGACY_ENB_SS_PORTMAN_ACP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_PORTMAN_ACP_DEBUG
DESC = ENB_SS_PORTMAN_ACP legacy logs - debug level
GROUP = ALL:LEGACY_ENB_SS_PORTMAN_ACP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_PORTMAN_ACP_TRACE
DESC = ENB_SS_PORTMAN_ACP legacy logs - trace level
GROUP = ALL:LEGACY_ENB_SS_PORTMAN_ACP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_ENB_SS_SYS_TASK_INFO
DESC = ENB_SS_SYS_TASK legacy logs - info level
GROUP = ALL:LEGACY_ENB_SS_SYS_TASK:LEGACY_GROUP_INFO:LEGACY
......
......@@ -327,6 +327,7 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_PORTMAN, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_PORTMAN_ACP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_PORTMAN_GNB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SYS, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SYS_GNB, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
......@@ -62,7 +62,10 @@ int create_tasks(uint32_t enb_nb) {
if (RC.ss.mode >= SS_SOFTMODEM)
{
rc = itti_create_task(TASK_SS_PORTMAN, ss_eNB_port_man_task, NULL);
rc = itti_create_task(TASK_SS_PORTMAN, ss_eNB_port_man_eNB_task, NULL);
AssertFatal(rc >= 0, "Create task for SS manager failed\n");
rc = itti_create_task(TASK_SS_PORTMAN_ACP, ss_eNB_port_man_acp_task, NULL);
AssertFatal(rc >= 0, "Create task for SS manager failed\n");
rc = itti_create_task(TASK_SYS, ss_eNB_sys_task, NULL);
......
......@@ -54,9 +54,12 @@ MESSAGE_DEF(RRC_STATE_IND, MESSAGE_PRIORITY_MED, RrcStateInd,
//-------------------------------------------------------------------------------------------//
// eNB: ENB_APP -> RRC messages
MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigurationReq, rrc_configuration_req)
MESSAGE_DEF(RRC_CONFIGURATION_CNF, MESSAGE_PRIORITY_MED, RrcConfigurationCnf, rrc_configuration_cnf)
MESSAGE_DEF(RRC_RBLIST_CFG_REQ, MESSAGE_PRIORITY_MED, RrcRblistCfgReq, rrc_rblist_cfg_req)
MESSAGE_DEF(RRC_RBLIST_CFG_CNF, MESSAGE_PRIORITY_MED, RrcRblistCfgCnf, rrc_rblist_cfg_cnf)
MESSAGE_DEF(RRC_UE_CAT_INFO, MESSAGE_PRIORITY_MED, rrcUECatInfo, rrc_ue_cat_info)
MESSAGE_DEF(RRC_AS_SECURITY_CONFIG_REQ, MESSAGE_PRIORITY_MED, RrcAsSecurityConfigReq, rrc_as_security_config_req)
MESSAGE_DEF(RRC_AS_SECURITY_CONFIG_CNF, MESSAGE_PRIORITY_MED, RrcAsSecurityConfigCnf, rrc_as_security_config_cnf)
MESSAGE_DEF(NBIOTRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, NbIoTRrcConfigurationReq, nbiotrrc_configuration_req)
// gNB: gNB_APP -> RRC messages
......
......@@ -83,12 +83,15 @@
#define RRC_STATE_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_state_ind
#define RRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_configuration_req
#define RRC_CONFIGURATION_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_configuration_cnf
#define RRC_RBLIST_CFG_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_rblist_cfg_req
#define RRC_RBLIST_CFG_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_rblist_cfg_cnf
#define RRC_UE_CAT_INFO(mSGpTR) (mSGpTR)->ittiMsg.rrc_ue_cat_info
#define RRC_AS_SECURITY_CONFIG_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_as_security_config_req
#define RRC_AS_SECURITY_CONFIG_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_as_security_config_cnf
#define NBIOTRRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nbiotrrc_configuration_req
......@@ -167,6 +170,10 @@ typedef struct RrcAsSecurityConfigReq_s {
int rnti;
}RrcAsSecurityConfigReq;
typedef struct RrcAsSecurityConfigCnf_s {
bool status;
}RrcAsSecurityConfigCnf;
enum ue_CategoryDL_v1310_e {
ue_CategoryDL_v1310_e_n17 = 0,
ue_CategoryDL_v1310_e_m1 = 1,
......@@ -228,6 +235,10 @@ typedef struct RrcRblistCfgReq_s {
rb_info rb_list[MAX_RBS];
} RrcRblistCfgReq;
typedef struct RrcRblistCfgCnf_s {
bool status;
}RrcRblistCfgCnf;
typedef struct RrcStateInd_s {
Rrc_State_t state;
Rrc_Sub_State_t sub_state;
......@@ -575,6 +586,11 @@ typedef struct RrcConfigurationReq_s {
} RrcConfigurationReq;
typedef struct RrcConfigurationCnf_s
{
bool status;
}RrcConfigurationCnf;
#define MAX_NUM_NBIOT_CELEVELS 3
typedef struct NbIoTRrcConfigurationReq_s {
......
......@@ -48,6 +48,7 @@
#define SS_SYS_PROXY_MSG_CNF(mSGpTR) (mSGpTR)->ittiMsg.udp_data_ind
#define SS_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_paging_ind
#define SS_NR_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_nr_paging_ind
#define SS_PAGING_CNF(mSGpTR) (mSGpTR)->ittiMsg.ss_paging_cnf
#define SS_L1MACIND_CTRL(mSGpTR) (mSGpTR)->ittiMsg.ss_l1macind_ctrl
#define SS_ULGRANT_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_ulgrant_info
......
......@@ -495,7 +495,6 @@ rx_sdu(const module_id_t enb_mod_idP,
}
UE_template_ptr->ul_SR = 1;
LOG_D(MAC, "swetank: fxn:%s line:%d rnti:%d ul_SR=1\n", __FUNCTION__, __LINE__, UE_RNTI(enb_mod_idP, UE_id));
UE_scheduling_control->crnti_reconfigurationcomplete_flag = 1;
UE_info->UE_template[UE_PCCID(enb_mod_idP, UE_id)][UE_id].configured = 1;
cancel_ra_proc(enb_mod_idP,
......@@ -559,7 +558,6 @@ rx_sdu(const module_id_t enb_mod_idP,
}
UE_template_ptr->ul_SR = 1;
LOG_D(MAC, "swetank: fxn:%s line:%d rnti:%d ul_SR=1\n", __FUNCTION__, __LINE__, UE_RNTI(enb_mod_idP, UE_id));
UE_scheduling_control->crnti_reconfigurationcomplete_flag = 1;
} else {
cancel_ra_proc(enb_mod_idP, CC_idP, frameP, current_rnti);
......@@ -1897,7 +1895,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
//uint8_t aggregation = 2;
int sched_frame = frameP;
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (sched_subframeP < subframeP) {
sched_frame++;
......@@ -1924,7 +1921,6 @@ schedule_ulsch_rnti(module_id_t module_idP,
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
if (UE_info->UE_template[CC_id][UE_id].rach_resource_type > 0)
{
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
continue;
}
......@@ -2552,7 +2548,6 @@ schedule_ulsch_ss(module_id_t module_idP,
uint8_t ue_found = 0;
/* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
LOG_D(MAC, "swetank: num CC:%d\n", RC.nb_mac_CC[module_idP]);
for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
/* MultiCell: Common channels modify for multiple CC */
cc = &RC.mac[module_idP]->common_channels[CC_id];
......@@ -2568,7 +2563,7 @@ schedule_ulsch_ss(module_id_t module_idP,
if (ue_found == 0)
{
LOG_D(MAC, "%s No UE found\n", __FUNCTION__);
return;
continue;
}
/* if schedule is false, it means SFN/SF for ULGrant had not yet arrived */
......@@ -2584,7 +2579,6 @@ schedule_ulsch_ss(module_id_t module_idP,
switch (subframeP) {
case 0:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if ((tdd_sfa == 0) || (tdd_sfa == 3))
sched_subframe = 4;
else if (tdd_sfa == 6)
......@@ -2595,7 +2589,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 1:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if ((tdd_sfa == 0) || (tdd_sfa == 1))
sched_subframe = 7;
else if (tdd_sfa == 6)
......@@ -2606,11 +2599,9 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 2: // Don't schedule UL in subframe 2 for TDD
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
return;
case 3:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (tdd_sfa == 2)
sched_subframe = 7;
else
......@@ -2619,7 +2610,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 4:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (tdd_sfa == 1)
sched_subframe = 8;
else
......@@ -2628,7 +2618,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 5:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (tdd_sfa == 0)
sched_subframe = 9;
else if (tdd_sfa == 6)
......@@ -2639,7 +2628,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 6:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (tdd_sfa == 0 || tdd_sfa == 1)
sched_subframe = 2;
else if (tdd_sfa == 6)
......@@ -2650,11 +2638,9 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 7:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
return;
case 8:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if ((tdd_sfa >= 2) && (tdd_sfa <= 5))
sched_subframe = 2;
else
......@@ -2663,7 +2649,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
case 9:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if ((tdd_sfa == 1) || (tdd_sfa == 3) || (tdd_sfa == 4))
sched_subframe = 3;
else if (tdd_sfa == 6)
......@@ -2674,7 +2659,6 @@ schedule_ulsch_ss(module_id_t module_idP,
break;
default:
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
return;
}
}
......@@ -2687,9 +2671,7 @@ schedule_ulsch_ss(module_id_t module_idP,
int emtc_active[5];
memset(emtc_active, 0, 5 * sizeof(int));
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
schedule_ulsch_rnti_emtc(module_idP, frameP, subframeP, sched_subframe, emtc_active);
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
......@@ -2704,7 +2686,6 @@ schedule_ulsch_ss(module_id_t module_idP,
for (int i = 0; i < 6; i++)
cc->vrb_map_UL[start_rb + i] = 1;
}
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
/* HACK: let's remove the PUCCH from available RBs
* we suppose PUCCH size is:
......@@ -2740,7 +2721,6 @@ schedule_ulsch_ss(module_id_t module_idP,
exit(1);
}
LOG_D(MAC, "swetank: fxn:%s line:%d\n", __FUNCTION__, __LINE__);
schedule_ulsch_rnti(module_idP, CC_id, frameP, subframeP, sched_subframe);
}
......
......@@ -257,7 +257,7 @@ void free_LTE_PagingRecord_t(LTE_PagingRecord_t * ptr)
}
}
uint8_t do_MIB_FeMBMS(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t additionalNonMBSFN, uint32_t frame) {
int do_MIB_FeMBMS(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t additionalNonMBSFN, uint32_t frame) {
asn_enc_rval_t enc_rval;
LTE_BCCH_BCH_Message_MBMS_t *mib_fembms=&carrier->mib_fembms;
frame=198;
......@@ -461,7 +461,7 @@ uint8_t do_MIB_SL(const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
return((enc_rval.encoded+7)/8);
}
uint8_t do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
int do_SIB1_MBMS(rrc_eNB_carrier_data_t *carrier,
int Mod_id,int CC_id,
RrcConfigurationReq *configuration
) {
......
......@@ -136,6 +136,37 @@ pthread_mutex_t lock_ue_freelist;
uint8_t ul_sqn,dl_sqn;
void rrc_send_cnf_to_ss(MessageDef *msg_p)
{
MessageDef *message_p = NULL;
instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(msg_p);
LOG_I(RRC,"Sending confirmation to SYS_TASK for message:%s\n", ITTI_MSG_NAME(msg_p));
switch (ITTI_MSG_ID(msg_p))
{
case RRC_CONFIGURATION_REQ:
message_p = itti_alloc_new_message(TASK_RRC_ENB, instance, RRC_CONFIGURATION_CNF);
RRC_CONFIGURATION_CNF(message_p).status = 1;
break;
case RRC_AS_SECURITY_CONFIG_REQ:
message_p = itti_alloc_new_message(TASK_RRC_ENB, instance, RRC_AS_SECURITY_CONFIG_CNF);
RRC_AS_SECURITY_CONFIG_CNF(message_p).status = 1;
break;
case RRC_RBLIST_CFG_REQ:
message_p = itti_alloc_new_message(TASK_RRC_ENB, instance, RRC_RBLIST_CFG_CNF);
RRC_RBLIST_CFG_CNF(message_p).status = 1;
break;
default:
LOG_E(RRC, "fxn:%s Received invalid message type\n", __FUNCTION__);
break;
}
itti_send_msg_to_task(TASK_SYS, instance, message_p);
LOG_I(RRC, "Sent Message to SYS_TASK\n");
}
void
openair_rrc_on(
const protocol_ctxt_t *const ctxt_pP
......@@ -9741,6 +9772,8 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
case RRC_CONFIGURATION_REQ:
LOG_I(RRC, "[eNB %ld] Received %s : %p\n", instance, msg_name_p, &RRC_CONFIGURATION_REQ(msg_p));
openair_rrc_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p));
if (RC.ss.mode >= SS_SOFTMODEM)
rrc_send_cnf_to_ss(msg_p);
break;
/* Messages from F1AP task */
......@@ -9799,7 +9832,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
RLC_SDU_INDICATION(msg_p).message_id);
break;
//#ifdef ENB_SS
case SS_RRC_PDU_REQ:
if (RC.ss.mode >= SS_SOFTMODEM)
{
......@@ -10044,42 +10076,49 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
pdcp_data_req(&ctxt, SRB_FLAG_NO, SS_DRB_PDU_REQ(msg_p).drb_id, 0, 0, SS_DRB_PDU_REQ(msg_p).sdu_size, SS_DRB_PDU_REQ(msg_p).sdu, PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
break;
case RRC_AS_SECURITY_CONFIG_REQ:
LOG_A(RRC,"[eNB %ld] Received %s : %p, Integrity_Algo: %d, Ciphering_Algo: %ld \n",instance, msg_name_p, &RRC_AS_SECURITY_CONFIG_REQ(msg_p),RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.integrity_algorithm,RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ciphering_algorithm);
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isIntegrityInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint)
{
printf("kRRCint in RRC:\n");
for(int i=0;i<32;i++)
case RRC_AS_SECURITY_CONFIG_REQ:
LOG_A(RRC,"[eNB %ld] Received %s : %p, Integrity_Algo: %d, Ciphering_Algo: %ld \n",
instance,
msg_name_p,
&RRC_AS_SECURITY_CONFIG_REQ(msg_p),
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.integrity_algorithm,
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ciphering_algorithm);
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isIntegrityInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint)
{
LOG_D(RRC,"kRRCint in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[i]);
printf("kRRCint in RRC:\n");
for(int i=0;i<32;i++)
{
LOG_D(RRC,"kRRCint in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Integrity.kRRCint[i]);
}
printf("\n");
}
printf("\n");
}
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isCipheringInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc)
{
printf("kRRCenc in RRC:\n");
for(int j=0;j<16;j++)
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isCipheringInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc)
{
LOG_D(RRC,"kRRCenc in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc[j]);
printf("kRRCenc in RRC:\n");
for(int j=0;j<16;j++)
{
LOG_D(RRC,"kRRCenc in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kRRCenc[j]);
}
printf("\n");
}
printf("\n");
}
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isCipheringInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc)
{
LOG_D(RRC,"kUPenc in RRC:\n");
for(int k=0;k<16;k++)
if(RRC_AS_SECURITY_CONFIG_REQ(msg_p).isCipheringInfoPresent && RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc)
{
LOG_D(RRC,"kUPenc in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc[k]);
LOG_D(RRC,"kUPenc in RRC:\n");
for(int k=0;k<16;k++)
{
LOG_D(RRC,"kUPenc in RRC: %02x\n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc[k]);
}
LOG_D(RRC,"\n");
}
LOG_D(RRC,"\n");
}
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
instance,
ENB_FLAG_YES,
RRC_AS_SECURITY_CONFIG_REQ(msg_p).rnti,
msg_p->ittiMsgHeader.lte_time.frame,
msg_p->ittiMsgHeader.lte_time.slot);
rrc_eNB_as_security_configuration_req(&ctxt, ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_AS_SECURITY_CONFIG_REQ(msg_p));
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
instance,
ENB_FLAG_YES,
RRC_AS_SECURITY_CONFIG_REQ(msg_p).rnti,
msg_p->ittiMsgHeader.lte_time.frame,
msg_p->ittiMsgHeader.lte_time.slot);
rrc_eNB_as_security_configuration_req(&ctxt, ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_AS_SECURITY_CONFIG_REQ(msg_p));
rrc_send_cnf_to_ss(msg_p);
break;
case SS_SS_PAGING_IND:
......@@ -10092,6 +10131,7 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
case RRC_RBLIST_CFG_REQ:
LOG_A(RRC, "[eNB %ld] Received %s : %p, RB Count:%d\n", instance, msg_name_p, &RRC_RBLIST_CFG_REQ(msg_p),RRC_RBLIST_CFG_REQ(msg_p).rb_count);
rrc_eNB_rblist_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_RBLIST_CFG_REQ(msg_p));
rrc_send_cnf_to_ss(msg_p);
break;
default:
......
......@@ -22,7 +22,7 @@
#define _SS_ENB_CONTEXT_
#include "SidlCommon.h"
#include "SIDL_EUTRA_SYSTEM_PORT.h"
#if 0
#define SYS_L LOG_SYS(evId, SSConfig.sfn, SSConfig.sf, __VA_ARGS__)
#define SRB_L LOG_SRB(evId, SSConfig.sfn, SSConfig.sf, __VA_ARGS__)
......@@ -62,6 +62,15 @@ typedef struct SS_Cell_Context_s{
uint16_t ss_rnti_g;
} SS_Cell_Context_t;
typedef struct sys_cnf_info
{
enum ConfirmationResult_Type_Sel resType;
bool resVal;
enum SystemConfirm_Type_Sel cnfType;
uint8_t msg_buffer[1000];
uint8_t cnfFlag;
}sys_cnf_info_t;
typedef struct SSConfigContext_s {
/** List of Cells */
SS_Cell_Context_t SSCell_list[8];
......@@ -73,8 +82,8 @@ typedef struct SSConfigContext_s {
ss_set_timinfo_t vtinfo;
hash_table_t *vt_timer_table ; // key is SFN_SF
bool send_atten_cnf;
sys_cnf_info_t sys_cnf;
/** TODO: To add more */
} SSConfigContext_t;
typedef enum {
......
......@@ -63,6 +63,23 @@ enum MsgUserId
};
extern SSConfigContext_t SS_context;
pthread_cond_t sys_confirm_done_cond;
pthread_mutex_t sys_confirm_done_mutex;
int sys_confirm_done=-1;
static void wait_sys_confirm(char *thread_name) {
LOG_I(ENB_SS_PORTMAN_ACP, "Entry in fxn:%s\n",__FUNCTION__);
LOG_I(ENB_SS_PORTMAN_ACP, "waiting for SYS CONFRIM DONE Indication (%s)\n",thread_name);
pthread_mutex_lock( &sys_confirm_done_mutex );
while ( sys_confirm_done < 0 )
pthread_cond_wait( &sys_confirm_done_cond, &sys_confirm_done_mutex );
pthread_mutex_unlock(&sys_confirm_done_mutex );
LOG_I(ENB_SS_PORTMAN_ACP, "Received SYS CONFIRM (%s)\n", thread_name);
LOG_I(ENB_SS_PORTMAN_ACP, "Exit from fxn:%s\n",__FUNCTION__);
}
/*
* Function : ss_dumpReqMsg
* Description: Function for print the received message
......@@ -286,7 +303,7 @@ void ss_port_man_send_data(
void ss_eNB_port_man_init(void)
{
IpAddress_t ipaddr;
LOG_A(ENB_SS_PORTMAN, "Starting System Simulator Manager\n");
LOG_A(ENB_SS_PORTMAN_ACP, "Starting System Simulator Manager\n");
const char *hostIp;
hostIp = RC.ss.hostIp;
......@@ -311,11 +328,11 @@ void ss_eNB_port_man_init(void)
int ret = acpServerInitWithCtx(ipaddr, port, msgTable, aSize, &ctx_g);
if (ret < 0)
{
LOG_A(ENB_SS_PORTMAN, "Connection failure err=%d\n", ret);
LOG_A(ENB_SS_PORTMAN_ACP, "Connection failure err=%d\n", ret);
return;
}
int fd1 = acpGetSocketFd(ctx_g);
LOG_A(ENB_SS_PORTMAN, "Connection performed : %d\n", fd1);
LOG_A(ENB_SS_PORTMAN_ACP, "Connection performed : %d\n", fd1);
//itti_subscribe_event_fd(TASK_SS_PORTMAN, fd1);
......@@ -338,7 +355,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
size_t msgSize = size; //2
unsigned char *buffer = (unsigned char *)acpMalloc(size);
assert(buffer);
LOG_D(ENB_SS_PORTMAN, "Entry in fxn:%s\n", __FUNCTION__);
LOG_D(ENB_SS_PORTMAN_ACP, "Entry in fxn:%s\n", __FUNCTION__);
int userId = acpRecvMsg(ctx, &msgSize, buffer);
// Error handling
......@@ -349,23 +366,23 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
// Message not mapped to user id,
// this error should not appear on server side for the messages
// received from clients
LOG_E(GNB_APP, "Error: Message not mapped to user id\n");
LOG_E(ENB_SS_PORTMAN_ACP, "Error: Message not mapped to user id\n");
}
else if (userId == -ACP_ERR_SIDL_FAILURE)
{
// Server returned service error,
// this error should not appear on server side for the messages
// received from clients
LOG_E(GNB_APP, "Error: Server returned service error \n");
LOG_E(ENB_SS_PORTMAN_ACP, "Error: Server returned service error \n");
SidlStatus sidlStatus = -1;
acpGetMsgSidlStatus(msgSize, buffer, &sidlStatus);
acpFree(buffer);
}
else if (userId == -ACP_PEER_DISCONNECTED){
LOG_E(GNB_APP, "[SS_SRB] Error: Peer ordered shutdown\n");
LOG_E(ENB_SS_PORTMAN_ACP, "Error: Peer ordered shutdown\n");
}
else if (userId == -ACP_PEER_CONNECTED){
LOG_A(GNB_APP, "[SS_SRB] Peer connection established\n");
LOG_A(ENB_SS_PORTMAN_ACP, " Peer connection established\n");
}
else
{
......@@ -378,7 +395,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
//Send Dummy Wake up ITTI message to SRB task.
if (RC.ss.mode >= SS_SOFTMODEM && SS_context.SSCell_list[cell_index_pm].State >= SS_STATE_CELL_ACTIVE)
{
LOG_A(ENB_SS_PORTMAN,"Sending Wake up signal/SS_RRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB task \n", SS_RRC_PDU_IND);
LOG_A(ENB_SS_PORTMAN_ACP,"Sending Wake up signal/SS_RRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB task \n", SS_RRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_RRC_PDU_IND);
if (message_p)
{
......@@ -392,58 +409,62 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
int send_res = itti_send_msg_to_task(TASK_SS_SRB, 0, message_p);
if (send_res < 0)
{
LOG_E(ENB_SS_PORTMAN, "Error in sending Wake up signal /SS_RRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB\n", SS_RRC_PDU_IND);
LOG_E(ENB_SS_PORTMAN_ACP, "Error in sending Wake up signal /SS_RRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB\n", SS_RRC_PDU_IND);
}
}
}
}
else
{
LOG_A(ENB_SS_PORTMAN, "received msg %d from the client.\n", userId);
if (acpSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
LOG_A(ENB_SS_PORTMAN_ACP, "received msg %d from the client.\n", userId);
if (acpSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
{
acpFree(buffer);
return;
}
ss_dumpReqMsg(req);
if (userId == MSG_SysProcess_userId)
{
bool ret_Val = false;
struct SYSTEM_CTRL_REQ *sys_req = (struct SYSTEM_CTRL_REQ *)req;
if (sys_req->Request.d == SystemRequest_Type_EnquireTiming)
{
acpFree(buffer);
return;
LOG_I(ENB_SS_PORTMAN_ACP, "Received EnquireTiming\n");
ret_Val = ss_eNB_port_man_handle_enquiryTiming(sys_req);
if (ret_Val == false)
LOG_E(ENB_SS_PORTMAN_ACP, "Error Sending EnquiryTiming Respone to TTCN\n");
}
ss_dumpReqMsg(req);
if (userId == MSG_SysProcess_userId)
else
{
bool ret_Val = false;
struct SYSTEM_CTRL_REQ *sys_req = (struct SYSTEM_CTRL_REQ *)req;
if (sys_req->Request.d == SystemRequest_Type_EnquireTiming)
{
LOG_I(ENB_SS_PORTMAN, "Locked the mutex for enq Timing\n");
LOG_I(ENB_SS_PORTMAN, "Received EnquireTiming\n");
ret_Val = ss_eNB_port_man_handle_enquiryTiming(sys_req);
if (ret_Val == false)
LOG_E(ENB_SS_PORTMAN, "Error Sending EnquiryTiming Respone to TTCN\n");
}
else
int rc = 0;
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_SYS_PORT_MSG_IND);
if (message_p)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_SYS_PORT_MSG_IND);
if (message_p)
SS_SYS_PORT_MSG_IND(message_p).req = (struct SYSTEM_CTRL_REQ *)malloc(sizeof(struct SYSTEM_CTRL_REQ));
if (SS_SYS_PORT_MSG_IND(message_p).req == NULL)
{
LOG_E(ENB_SS_PORTMAN_ACP, "Error allocating memory for SYSTEM CTRL REQ\n");
return;
}
memset(SS_SYS_PORT_MSG_IND(message_p).req, 0, sizeof(struct SYSTEM_CTRL_REQ));
memcpy(SS_SYS_PORT_MSG_IND(message_p).req, req, sizeof(struct SYSTEM_CTRL_REQ));
SS_SYS_PORT_MSG_IND(message_p).userId = userId;
rc = itti_send_msg_to_task(TASK_SYS, 0, message_p);
if (rc == 0 )
{
SS_SYS_PORT_MSG_IND(message_p).req = (struct SYSTEM_CTRL_REQ *)malloc(sizeof(struct SYSTEM_CTRL_REQ));
if (SS_SYS_PORT_MSG_IND(message_p).req == NULL)
{
LOG_E(ENB_SS_PORTMAN, "Error allocating memory for SYSTEM CTRL REQ\n");
return;
}
memset(SS_SYS_PORT_MSG_IND(message_p).req, 0, sizeof(struct SYSTEM_CTRL_REQ));
memcpy(SS_SYS_PORT_MSG_IND(message_p).req, req, sizeof(struct SYSTEM_CTRL_REQ));
SS_SYS_PORT_MSG_IND(message_p).userId = userId;
if (SS_SYS_PORT_MSG_IND(message_p).req)
itti_send_msg_to_task(TASK_SYS, 0, message_p);
sys_confirm_done = -1;
/* wait for signal */
wait_sys_confirm("TASK_SYS");
}
}
sys_req = NULL;
}
sys_req = NULL;
}
}
acpSysProcessFreeSrv(req);
LOG_D(ENB_SS_PORTMAN, "Exit from fxn:%s\n", __FUNCTION__);
LOG_D(ENB_SS_PORTMAN_ACP, "Exit from fxn:%s\n", __FUNCTION__);
acpFree(buffer);
return;
......@@ -463,7 +484,7 @@ void *ss_port_man_process_itti_msg(void *notUsed)
MessageDef *received_msg = NULL;
int result;
LOG_D(ENB_SS_PORTMAN, "Entry in fxn:%s\n", __FUNCTION__);
itti_poll_msg(TASK_SS_PORTMAN, &received_msg);
itti_receive_msg(TASK_SS_PORTMAN, &received_msg);
if (received_msg != NULL)
{
LOG_A(ENB_SS_PORTMAN, "Received a message id : %d \n",
......@@ -502,7 +523,6 @@ void *ss_port_man_process_itti_msg(void *notUsed)
received_msg = NULL;
}
ss_eNB_read_from_socket(ctx_g);
LOG_D(ENB_SS_PORTMAN, "Exit from fxn:%s\n", __FUNCTION__);
return NULL;
}
......@@ -517,13 +537,25 @@ void *ss_port_man_process_itti_msg(void *notUsed)
* newState: No impact on state machine.
*
*/
void *ss_eNB_port_man_task(void *arg)
void *ss_eNB_port_man_eNB_task(void *arg)
{
while (1)
{
/* Now handle notifications for other sockets */
ss_port_man_process_itti_msg(NULL);
}
return NULL;
}
void *ss_eNB_port_man_acp_task(void *arg)
{
ss_eNB_port_man_init();
while (1)
{
/* Now handle notifications for other sockets */
(void)ss_port_man_process_itti_msg(NULL);
ss_eNB_read_from_socket(ctx_g);
}
return NULL;
......
......@@ -24,7 +24,7 @@
#include "acpSys.h"
void ss_eNB_port_man_init(void);
void *ss_eNB_port_man_task(void *arg);
void *ss_eNB_port_man_eNB_task(void *arg);
void *ss_eNB_port_man_acp_task(void *arg);
bool ss_eNB_port_man_handle_enquiryTiming(struct SYSTEM_CTRL_REQ *sys_req);
......
......@@ -60,6 +60,9 @@
#include "common/utils/LOG/ss-log.h"
#include "msc.h"
extern pthread_cond_t sys_confirm_done_cond;
extern pthread_mutex_t sys_confirm_done_mutex;
extern int sys_confirm_done;
extern RAN_CONTEXT_t RC;
extern uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn);
......@@ -90,6 +93,29 @@ int proxy_recv_port = 7770;
bool reqCnfFlag_g = false;
void sys_handle_pdcch_order(struct RA_PDCCH_Order_Type *pdcchOrder);
/*
* Function : sys_confirm_done_indication
* Description: Sends the sys_confirm_done_mutex signl to PORTMAN_TASK,
* as in portman_taks is waiting for the SYS confirm to be
* received . After receiving this signal only the Portman_task proceeds
* for processing next message.
*/
int sys_confirm_done_indication()
{
if (sys_confirm_done < 0)
{
LOG_I(ENB_SS_SYS_TASK,"Signal to SYS_TASK for cell config done\n");
pthread_mutex_lock(&sys_confirm_done_mutex);
sys_confirm_done = 0;
pthread_cond_broadcast(&sys_confirm_done_cond);
pthread_mutex_unlock(&sys_confirm_done_mutex);
}
return 0;
}
/*
* Utility function to convert integer to binary
*
......@@ -383,17 +409,17 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
break;
default:
/** LOG */
LOG_A(ENB_SS, "[SYS] CellConfigRequest Invalid DL Bandwidth configuration \n");
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest Invalid DL Bandwidth configuration \n");
return false;
}
LOG_A(ENB_SS, "[SYS] DL Bandwidth for cellIndex(%d):%d\n", cell_index, RRC_CONFIGURATION_REQ(msg_p).N_RB_DL[cell_index]);
LOG_A(ENB_SS_SYS_TASK, "DL Bandwidth for cellIndex(%d):%d\n", cell_index, RRC_CONFIGURATION_REQ(msg_p).N_RB_DL[cell_index]);
}
#define BCCH_CONFIG AddOrReconfigure->Basic.v.BcchConfig
if (AddOrReconfigure->Basic.v.BcchConfig.d == true)
{
LOG_A(ENB_SS, "[SYS] BCCH Config update in Cell config \n");
LOG_A(ENB_SS_SYS_TASK, "BCCH Config update in Cell config \n");
RRC_CONFIGURATION_REQ(msg_p).stopSib1Transmission[cell_index] = (AddOrReconfigure->Basic.v.BcchConfig.v.StopSib1Transmission.d) ? 1 : 0;
LOG_A(ENB_SS, "[SYS] stopSib1Transmission for cellIndex(%d) %s\n", cell_index, RRC_CONFIGURATION_REQ(msg_p).stopSib1Transmission[cell_index] ? "yes" : "no");
LOG_A(ENB_SS_SYS_TASK, "stopSib1Transmission for cellIndex(%d) %s\n", cell_index, RRC_CONFIGURATION_REQ(msg_p).stopSib1Transmission[cell_index] ? "yes" : "no");
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.d == true)
{
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.MIB.d == true)
......@@ -410,7 +436,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig[cell_index].phich_duration = LTE_PHICH_Config__phich_Duration_extended;
break;
default:
LOG_A(ENB_SS, "[SYS] CellConfigRequest Invalid PHICH Duration\n");
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest Invalid PHICH Duration\n");
return false;
}
......@@ -430,7 +456,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
RRC_CONFIGURATION_REQ(msg_p).radioresourceconfig[cell_index].phich_resource = LTE_PHICH_Config__phich_Resource_two;
break;
default:
LOG_A(ENB_SS, "[SYS] CellConfigRequest Invalid PHICH Resource\n");
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest Invalid PHICH Resource\n");
return false;
}
......@@ -444,7 +470,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
#define SIB1_CELL_Q_QUALMIN SIB1_CELL_NON_CE.v.cellSelectionInfo_v920.v.q_QualMin_r9
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIB1.d == true)
{
LOG_A(ENB_SS, "[SYS] [SIB1] q-RxLevMin: %d \n", SIB1_CELL_SEL_INFO.q_RxLevMin);
LOG_A(ENB_SS_SYS_TASK, "[SIB1] q-RxLevMin: %d \n", SIB1_CELL_SEL_INFO.q_RxLevMin);
RRC_CONFIGURATION_REQ(msg_p).q_RxLevMin[cell_index] = SIB1_CELL_SEL_INFO.q_RxLevMin;
if (SIDL_SIB1_VAL.c1.v.systemInformationBlockType1.nonCriticalExtension.d)
{
......@@ -452,7 +478,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
if (SIB1_CELL_NON_CE.v.cellSelectionInfo_v920.d)
{
LOG_A(ENB_SS, "[SYS] [SIB1] q-QualMin: %d \n", SIB1_CELL_Q_QUALMIN);
LOG_A(ENB_SS_SYS_TASK, "[SIB1] q-QualMin: %d \n", SIB1_CELL_Q_QUALMIN);
RRC_CONFIGURATION_REQ(msg_p).q_QualMin[cell_index] = SIB1_CELL_Q_QUALMIN;
}
}
......@@ -494,7 +520,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
}
if (AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.d == true)
{
LOG_A(ENB_SS, "[SYS] [SIs] size=%ld", AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.d);
LOG_A(ENB_SS_SYS_TASK, "[SIs] size=%ld", AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.d);
for (int i = 0; i < AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.d; ++i)
{
if (SQN_BCCH_DL_SCH_MessageType_c1 == AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.d)
......@@ -649,7 +675,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
RRC_CONFIGURATION_REQ(msg_p).tac[cell_index] += (SIB1_CELL_ACCESS_REL_INFO.trackingAreaCode[i] << (15 - i));
}
LOG_A(ENB_SS, "[SYS] [SIB1] tac: 0x%x\n", RRC_CONFIGURATION_REQ(msg_p).tac[cell_index]);
LOG_A(ENB_SS_SYS_TASK, "[SIB1] tac: 0x%x\n", RRC_CONFIGURATION_REQ(msg_p).tac[cell_index]);
RRC_CONFIGURATION_REQ(msg_p).cellBarred[cell_index] = SIB1_CELL_ACCESS_REL_INFO.cellBarred;
RRC_CONFIGURATION_REQ(msg_p).intraFreqReselection[cell_index] = SIB1_CELL_ACCESS_REL_INFO.intraFreqReselection;
}
......@@ -688,12 +714,12 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
switch (AddOrReconfigure->Basic.v.InitialCellPower.v.Attenuation.d)
{
case Attenuation_Type_Value:
LOG_A(ENB_SS, "[SYS] [InitialCellPower.v.Attenuation.v.Value] Attenuation turned on value: %d dBm \n",
LOG_A(ENB_SS_SYS_TASK, "[InitialCellPower.v.Attenuation.v.Value] Attenuation turned on value: %d dBm \n",
AddOrReconfigure->Basic.v.InitialCellPower.v.Attenuation.v.Value);
cellConfig->initialAttenuation = AddOrReconfigure->Basic.v.InitialCellPower.v.Attenuation.v.Value;
break;
case Attenuation_Type_Off:
LOG_A(ENB_SS, "[SYS] [InitialCellPower.v.Attenuation.v.Value] Attenuation turned off \n");
LOG_A(ENB_SS_SYS_TASK, "[InitialCellPower.v.Attenuation.v.Value] Attenuation turned off \n");
cellConfig->initialAttenuation = 80; /* attnVal hardcoded currently but Need to handle proper Attenuation_Type_Off */
break;
case Attenuation_Type_UNBOUND_VALUE:
......@@ -705,7 +731,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
cellConfig->maxRefPower = SS_context.SSCell_list[cell_index].maxRefPower;
cellConfig->dl_earfcn = SS_context.SSCell_list[cell_index].dl_earfcn;
cellConfig->header.cell_index = cell_index;
LOG_A(ENB_SS, "===Cell configuration received for cell_id: %d Initial attenuation: %d Max ref power: %d for DL_EARFCN: %d cell_index %d=== \n",
LOG_A(ENB_SS_SYS_TASK, "===Cell configuration received for cell_id: %d Initial attenuation: %d Max ref power: %d for DL_EARFCN: %d cell_index %d=== \n",
cellConfig->header.cell_id,
cellConfig->initialAttenuation, cellConfig->maxRefPower,
cellConfig->dl_earfcn, cell_index);
......@@ -715,15 +741,15 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
// Cell Config Active Param
if (AddOrReconfigure->Active.d == true)
{
LOG_A(ENB_SS, "[SYS] Cell Config Active Present\n");
LOG_A(ENB_SS_SYS_TASK, "Cell Config Active Present\n");
RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index] = true;
LOG_A(ENB_SS, "[SYS] Active.v.C_RNTI.d=%d Active.v.RachProcedureConfig.d=%d\n", AddOrReconfigure->Active.v.C_RNTI.d, AddOrReconfigure->Active.v.RachProcedureConfig.d);
LOG_A(ENB_SS_SYS_TASK, "Active.v.C_RNTI.d=%d Active.v.RachProcedureConfig.d=%d\n", AddOrReconfigure->Active.v.C_RNTI.d, AddOrReconfigure->Active.v.RachProcedureConfig.d);
if (AddOrReconfigure->Active.v.C_RNTI.d == true)
{
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].b_C_RNTI_Present = true;
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].C_RNTI = bin_to_int(AddOrReconfigure->Active.v.C_RNTI.v, 16);
SS_context.SSCell_list[cell_index].ss_rnti_g = RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].C_RNTI;
LOG_A(ENB_SS, "[SYS] C_RNTI present in Active Cell Config %d\n", RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].C_RNTI);
LOG_A(ENB_SS_SYS_TASK, "C_RNTI present in Active Cell Config %d\n", RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].C_RNTI);
} else {
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].b_C_RNTI_Present = false;
}
......@@ -735,7 +761,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
if (RandomAccessResponseConfig_Type_Ctrl == AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.d)
{
LOG_A(ENB_SS, "[SYS] RAResponse present in Active Cell Config\n");
LOG_A(ENB_SS_SYS_TASK, "RAResponse present in Active Cell Config\n");
if (RandomAccessResponse_Type_List == AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.v.Ctrl.Rar.d)
{
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].numRar = AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.v.Ctrl.Rar.v.List.d;
......@@ -743,12 +769,12 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
if (TempC_RNTI_Type_SameAsC_RNTI == AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.v.Ctrl.Rar.v.List.v[j].TempC_RNTI.d)
{
LOG_A(ENB_SS, "[SYS] RAResponse present in Active Cell Config is TempC_RNTI_Type_SameAsC_RNTI\n");
LOG_A(ENB_SS_SYS_TASK, "RAResponse present in Active Cell Config is TempC_RNTI_Type_SameAsC_RNTI\n");
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].Rar[j].Temp_C_RNTI = RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].C_RNTI;
}
else if (TempC_RNTI_Type_Explicit == AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.v.Ctrl.Rar.v.List.v[j].TempC_RNTI.d)
{
LOG_A(ENB_SS, "[SYS] RAResponse present in Active Cell Config is TempC_RNTI_Type_Explicit\n");
LOG_A(ENB_SS_SYS_TASK, "RAResponse present in Active Cell Config is TempC_RNTI_Type_Explicit\n");
RRC_CONFIGURATION_REQ(msg_p).ActiveParam[cell_index].Rar[j].Temp_C_RNTI = bin_to_int(AddOrReconfigure->Active.v.RachProcedureConfig.v.RachProcedureList.v.v[i].RAResponse.v.Ctrl.Rar.v.List.v[j].TempC_RNTI.v.Explicit, 16);
}
}
......@@ -780,10 +806,10 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
// RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index] = false;
}
LOG_A(ENB_APP, "SS: ActiveParamPresent: %d, RlcPduCCCH_Present: %d, RLC Container PDU size: %d \n", RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index], RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Present[cell_index], RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Size[cell_index]);
LOG_A(ENB_SS_SYS_TASK, "SS: ActiveParamPresent: %d, RlcPduCCCH_Present: %d, RLC Container PDU size: %d \n", RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index], RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Present[cell_index], RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Size[cell_index]);
// store the modified cell config back
memcpy(&(RC.rrc[enb_id]->configuration), &RRC_CONFIGURATION_REQ(msg_p), sizeof(RRC_CONFIGURATION_REQ(msg_p)));
LOG_A(ENB_SS, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n");
LOG_A(ENB_SS_SYS_TASK, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n");
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
/* Active Config for ULGrant Params */
......@@ -797,7 +823,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
if (AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.d == true)
{
msg_p = itti_alloc_new_message(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(enb_id), SS_ULGRANT_INFO);
LOG_I(ENB_SS_SYS_TASK, "Received ULGrant in Active State\n");
LOG_I(ENB_SS_SYS_TASK, "Received ULGrant in Active State for cell_index:%d\n", cell_index);
SS_ULGRANT_INFO(msg_p).cell_index = cell_index;
if (AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.d == UL_GrantConfig_Type_OnSR_Reception)
{
......@@ -810,7 +836,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
RC.ss.ulgrant_info[cell_index].ulGrantType = NONE_PRESENT;
SS_ULGRANT_INFO(msg_p).ulGrantType = NONE_PRESENT;
LOG_I(ENB_SS_SYS_TASK, "Received ulGrantType UL_GrantConfig_Type_None\n");
LOG_I(ENB_SS_SYS_TASK, "Received ulGrantType UL_GrantConfig_Type_None for cell_id:%d\n", cell_index);
destTaskMAC = true;
}
else if (AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.d == UL_GrantConfig_Type_Periodic)
......@@ -823,9 +849,10 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
SS_ULGRANT_INFO(msg_p).periodiGrantInfo.period.duration =
AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.v.Periodic.Period.v.Duration;
LOG_I(ENB_SS_SYS_TASK, "Received Periodic ULGrant type ULGrant_Period_Type_Duration: %d received:%d\n",
LOG_I(ENB_SS_SYS_TASK, "Received Periodic ULGrant type ULGrant_Period_Type_Duration: %d received:%d cell_index:%d\n",
SS_ULGRANT_INFO(msg_p).periodiGrantInfo.period.duration,
AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.v.Periodic.Period.v.Duration);
AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.v.Periodic.Period.v.Duration,
cell_index);
}
else if (AddOrReconfigure->Active.v.CcchDcchDtchConfig.v.UL.v.UL_GrantConfig.v.v.Periodic.Period.d == ULGrant_Period_Type_OnlyOnce)
......@@ -884,7 +911,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
{
msg_queued = vt_timer_setup(tinfo, TASK_MAC_ENB, 0, msg_p);
}
LOG_A(ENB_SS_SYS_TASK,"Enquiry Timing MSG queued for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
LOG_A(ENB_SS_SYS_TASK,"UL_Grant Configuration queued for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
}
if (!msg_queued)
......@@ -915,8 +942,8 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
/* The request has send confirm flag flase so do nothing in this funciton */
if (reqCnfFlag_g == false)
{
LOG_A(ENB_SS_SYS_TASK, "No confirm required\n");
return ;
LOG_A(ENB_SS_SYS_TASK, "No confirm required\n");
return ;
}
struct SYSTEM_CTRL_CNF *msgCnf = CALLOC(1, sizeof(struct SYSTEM_CTRL_CNF));
......@@ -931,59 +958,59 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
msgCnf->Confirm.d = cnfType;
switch (cnfType)
{
case SystemConfirm_Type_Cell:
{
LOG_A(ENB_SS_SYS_TASK, "Send confirm for cell configuration\n");
msgCnf->Confirm.v.Cell = true;
break;
}
case SystemConfirm_Type_CellAttenuationList:
{
msgCnf->Confirm.v.CellAttenuationList = true;
break;
}
case SystemConfirm_Type_RadioBearerList:
msgCnf->Confirm.v.RadioBearerList = true;
break;
case SystemConfirm_Type_AS_Security:
msgCnf->Confirm.v.AS_Security = true;
break;
case SystemConfirm_Type_UE_Cat_Info:
msgCnf->Confirm.v.UE_Cat_Info = true;
break;
case SystemConfirm_Type_PdcpCount:
if (msg)
memcpy(&msgCnf->Confirm.v.PdcpCount, msg, sizeof(struct PDCP_CountCnf_Type));
else
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
break;
case SystemConfirm_Type_Cell:
{
LOG_A(ENB_SS_SYS_TASK, "Send confirm for cell configuration\n");
msgCnf->Confirm.v.Cell = true;
break;
}
case SystemConfirm_Type_CellAttenuationList:
{
msgCnf->Confirm.v.CellAttenuationList = true;
break;
}
case SystemConfirm_Type_RadioBearerList:
msgCnf->Confirm.v.RadioBearerList = true;
break;
case SystemConfirm_Type_AS_Security:
msgCnf->Confirm.v.AS_Security = true;
break;
case SystemConfirm_Type_UE_Cat_Info:
msgCnf->Confirm.v.UE_Cat_Info = true;
break;
case SystemConfirm_Type_PdcpCount:
if (msg)
memcpy(&msgCnf->Confirm.v.PdcpCount, msg, sizeof(struct PDCP_CountCnf_Type));
else
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
break;
case SystemConfirm_Type_Paging:
msgCnf->Confirm.v.Paging = true;
break;
case SystemConfirm_Type_PdcchOrder:
{
LOG_A(ENB_SS_SYS_TASK, "Send confirm for PDCCHOrder to Port Sys \n");
msgCnf->Confirm.v.PdcchOrder = true;
break;
}
case SystemConfirm_Type_L1MacIndCtrl:
msgCnf->Confirm.v.L1MacIndCtrl = true;
break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_RlcIndCtrl:
case SystemConfirm_Type_PdcpHandoverControl:
case SystemConfirm_Type_Paging:
msgCnf->Confirm.v.Paging = true;
break;
case SystemConfirm_Type_PdcchOrder:
{
LOG_A(ENB_SS_SYS_TASK, "Send confirm for PDCCHOrder to Port Sys \n");
msgCnf->Confirm.v.PdcchOrder = true;
break;
}
case SystemConfirm_Type_L1MacIndCtrl:
msgCnf->Confirm.v.L1MacIndCtrl = true;
break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_RlcIndCtrl:
case SystemConfirm_Type_PdcpHandoverControl:
msgCnf->Confirm.v.PdcpHandoverControl = true;
break;
case SystemConfirm_Type_L1_TestMode:
case SystemConfirm_Type_ActivateScell:
case SystemConfirm_Type_MbmsConfig:
case SystemConfirm_Type_PDCCH_MCCH_ChangeNotification:
case SystemConfirm_Type_MSI_Config:
case SystemConfirm_Type_OCNG_Config:
case SystemConfirm_Type_DirectIndicationInfo:
default:
LOG_A(ENB_SS_SYS_TASK, "Error not handled CNF TYPE to [SS-PORTMAN] \n");
case SystemConfirm_Type_L1_TestMode:
case SystemConfirm_Type_ActivateScell:
case SystemConfirm_Type_MbmsConfig:
case SystemConfirm_Type_PDCCH_MCCH_ChangeNotification:
case SystemConfirm_Type_MSI_Config:
case SystemConfirm_Type_OCNG_Config:
case SystemConfirm_Type_DirectIndicationInfo:
default:
LOG_A(ENB_SS_SYS_TASK, "Error not handled CNF TYPE to [SS-PORTMAN] \n");
}
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN, 0, message_p);
......@@ -992,6 +1019,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
LOG_A(ENB_SS_SYS_TASK, "Error sending to [SS-PORTMAN] \n");
}
}
// sys_confirm_done_indication();
}
/*
* Function : sys_handle_cell_config_req
......@@ -1062,7 +1090,15 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
default:
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest INVALID Type receivied\n");
}
send_sys_cnf(resType, resVal, cnfType, NULL);
if (reqCnfFlag_g == true)
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
memset(SS_context.sys_cnf.msg_buffer, 0, 1000);
SS_context.sys_cnf.cnfFlag = 1;
}
return returnState;
}
......@@ -1456,8 +1492,16 @@ static int sys_handle_radiobearer_list(struct SYSTEM_CTRL_REQ *req)
}
}
returnState = SS_STATE_CELL_ACTIVE;
send_sys_cnf(resType, resVal, cnfType, NULL);
if (reqCnfFlag_g == true)
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
SS_context.sys_cnf.cnfFlag = 1;
memset(SS_context.sys_cnf.msg_buffer, 0, 1000);
returnState = SS_STATE_CELL_ACTIVE;
}
// send_sys_cnf(resType, resVal, cnfType, NULL);
return returnState;
}
......@@ -1565,6 +1609,7 @@ int sys_handle_pdcp_count_req(struct PDCP_CountReq_Type *PdcpCount)
PdcpCount.d = PDCP_CountCnf_Type_Set;
PdcpCount.v.Set = true;
send_sys_cnf(resType, resVal, cnfType, (void *)&PdcpCount);
sys_confirm_done_indication();
break;
case PDCP_CountReq_Type_UNBOUND_VALUE:
......@@ -1812,8 +1857,10 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s
break;
default:
LOG_A(ENB_SS_SYS_TASK, "Invalid Pging request received\n");
break;
}
send_sys_cnf(resType, resVal, cnfType, NULL);
sys_confirm_done_indication();
LOG_A(ENB_SS_SYS_TASK, "Exit sys_handle_paging_req Paging_IND processing for Cell_id %d \n", cellId);
}
......@@ -1907,6 +1954,7 @@ static void sys_handle_l1macind_ctrl(struct SYSTEM_CTRL_REQ *req)
}
}
send_sys_cnf(resType, resVal, cnfType, NULL);
sys_confirm_done_indication();
}
/*
......@@ -1986,6 +2034,7 @@ static void sys_handle_ue_cat_info_req(struct UE_CategoryInfo_Type *UE_Cat_Info)
}
}
send_sys_cnf(resType, resVal, cnfType, NULL);
sys_confirm_done_indication();
}
/*
......@@ -2073,7 +2122,7 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
for(int k=0;k<16;k++) {
LOG_A(ENB_SS_SYS_TASK,"kUPenc in SS: %02x \n",RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.kUPenc[k]);
}
LOG_A(ENB_SS, "[SYS] Ciphering ActTimeList.d = %lu\n", ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.d);
LOG_A(ENB_SS_SYS_TASK, "Ciphering ActTimeList.d = %lu\n", ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.d);
for(int i=0;i < ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.d; i++)
{
switch(ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.v[i].RadioBearerId.d)
......@@ -2099,7 +2148,7 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].DL.format = ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.v[i].DL.v.SQN.Format;
RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].DL.sqn = ASSecurity->v.StartRestart.Ciphering.v.ActTimeList.v[i].DL.v.SQN.Value;
}
LOG_A(ENB_SS, "[SYS] Ciphering ActTimeList i=%d rb_id=%d\n", i, RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].rb_id);
LOG_A(ENB_SS_SYS_TASK, "Ciphering ActTimeList i=%d rb_id=%d\n", i, RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].rb_id);
}
}
uint8_t msg_queued = 0;
......@@ -2118,7 +2167,7 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "AS Security Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
LOG_A(ENB_SS, "AS_Security Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
LOG_A(ENB_SS_SYS_TASK, "AS_Security Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
if (!msg_queued)
......@@ -2135,7 +2184,15 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "AS_Security_Type_Release received\n");
}
}
send_sys_cnf(resType, resVal, cnfType, NULL);
if (reqCnfFlag_g == true)
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
SS_context.sys_cnf.cnfFlag = 1;
memset((void *)SS_context.sys_cnf.msg_buffer, 0, 1000);
}
// send_sys_cnf(resType, resVal, cnfType, NULL);
}
/*
......@@ -2151,7 +2208,6 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
*/
static void ss_task_sys_handle_req(struct SYSTEM_CTRL_REQ *req, ss_set_timinfo_t *tinfo)
{
LOG_A(ENB_SS_SYS_TASK, "swetank1212: SFN:%d SF:%d\n", req->Common.TimingInfo.v.SubFrame.SFN.v.Number, req->Common.TimingInfo.v.SubFrame.Subframe.v.Number);
if(req->Common.CellId){
cell_index = get_cell_index(req->Common.CellId, SS_context.SSCell_list);
SS_context.SSCell_list[cell_index].eutra_cellId = req->Common.CellId;
......@@ -2163,6 +2219,8 @@ static void ss_task_sys_handle_req(struct SYSTEM_CTRL_REQ *req, ss_set_timinfo_t
int exitState = SS_context.SSCell_list[cell_index].State;
LOG_A(ENB_SS_SYS_TASK, "Current SS_STATE %d received SystemRequest_Type %d eutra_cellId %d cnf_flag %d\n",
SS_context.SSCell_list[cell_index].State, req->Request.d, SS_context.SSCell_list[cell_index].eutra_cellId, req->Common.ControlInfo.CnfFlag);
memset(&SS_context.sys_cnf, 0, sizeof(SS_context.sys_cnf));
switch (SS_context.SSCell_list[cell_index].State)
{
case SS_STATE_NOT_CONFIGURED:
......@@ -2227,11 +2285,12 @@ static void ss_task_sys_handle_req(struct SYSTEM_CTRL_REQ *req, ss_set_timinfo_t
sys_handle_pdcp_count_req(&(req->Request.v.PdcpCount));
break;
case SystemRequest_Type_PdcpHandoverControl:
LOG_A(ENB_SS, "[SYS] SystemRequest_Type PdcpHandoverControl received\n");
LOG_A(ENB_SS_SYS_TASK, "[SYS] SystemRequest_Type PdcpHandoverControl received\n");
enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_PdcpHandoverControl;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true;
send_sys_cnf(resType, resVal, cnfType, NULL);
sys_confirm_done_indication();
break;
case SystemRequest_Type_AS_Security:
LOG_A(ENB_SS_SYS_TASK, "SystemRequest_Type_AS_Security received\n");
......@@ -2410,6 +2469,7 @@ bool valid_sys_msg(struct SYSTEM_CTRL_REQ *req)
send_sys_cnf(resType, resVal, cnfType, NULL);
LOG_A(ENB_SS_SYS_TASK, "Sending Dummy OK Req %d cnTfype %d ResType %d ResValue %d\n",
req->Request.d, cnfType, resType, resVal);
sys_confirm_done_indication();
}
return valid;
}
......@@ -2439,168 +2499,192 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
{
switch (ITTI_MSG_ID(received_msg))
{
case SS_UPD_TIM_INFO:
{
tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf;
tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn;
SS_context.sfn = tinfo.sfn;
SS_context.sf = tinfo.sf;
// SS_context.hsfn = tinfo.hsfn;
g_log->sfn = tinfo.sfn;
g_log->sf = (uint32_t)tinfo.sf;
LOG_A(ENB_SS_SYS_TASK, "[SYS] received SS_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
}
break;
case SS_GET_TIM_INFO:
{
LOG_A(ENB_SS_SYS_TASK, "received GET_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
ss_task_sys_handle_timing_info(&tinfo);
}
break;
case SS_SYS_PORT_MSG_IND:
{
if (valid_sys_msg(SS_SYS_PORT_MSG_IND(received_msg).req))
{
ss_task_sys_handle_req(SS_SYS_PORT_MSG_IND(received_msg).req, &tinfo);
}
else
{
LOG_A(ENB_SS_SYS_TASK, "Not hanled SYS_PORT message received \n");
}
if (SS_SYS_PORT_MSG_IND(received_msg).req)
free(SS_SYS_PORT_MSG_IND(received_msg).req);
}
break;
case SS_VNG_PROXY_REQ: {
LOG_A(ENB_SS_SYS_TASK, "received %s from %s \n", ITTI_MSG_NAME(received_msg),
ITTI_MSG_ORIGIN_NAME(received_msg));
VngCmdReq_t *req = (VngCmdReq_t *)malloc(sizeof(VngCmdReq_t));
req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VNG_CMD_REQ;
req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_VNG_PROXY_REQ(received_msg).cell_id;
req->header.cell_index = get_cell_index_pci(req->header.cell_id , SS_context.SSCell_list);
printf("VNG send to proxy cell_index %d\n",req->header.cell_index);
req->bw = SS_VNG_PROXY_REQ(received_msg).bw;
req->cmd = SS_VNG_PROXY_REQ(received_msg).cmd;
req->NocLevel = SS_VNG_PROXY_REQ(received_msg).Noc_level;
LOG_A(ENB_SS_SYS_TASK,"VNG Command for cell_id: %d CMD %d ",
req->header.cell_id, req->cmd);
ss_set_timinfo_t timer_tinfo= {0};
sys_send_proxy((void *)req, sizeof(VngCmdReq_t), 0, timer_tinfo);
}
break;
case SS_GET_PDCP_CNT: /** FIXME */
{
LOG_A(ENB_SS_SYS_TASK, "received SS_GET_PDCP_CNT Count from PDCP size %d\n",
SS_GET_PDCP_CNT(received_msg).size);
enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_PdcpCount;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true;
struct PDCP_CountCnf_Type PdcpCount;
PdcpCount.d = PDCP_CountCnf_Type_Get;
PdcpCount.v.Get.d = SS_GET_PDCP_CNT(received_msg).size;
const size_t size = sizeof(struct PdcpCountInfo_Type) * PdcpCount.v.Get.d;
PdcpCount.v.Get.v =(struct PdcpCountInfo_Type *)acpMalloc(size);
for (int i = 0; i < PdcpCount.v.Get.d; i++)
{
if (SS_GET_PDCP_CNT(received_msg).rb_info[i].is_srb == true)
case RRC_CONFIGURATION_CNF:
case RRC_RBLIST_CFG_CNF:
case RRC_AS_SECURITY_CONFIG_CNF:
{
PdcpCount.v.Get.v[i].RadioBearerId.d = RadioBearerId_Type_Srb;
PdcpCount.v.Get.v[i].RadioBearerId.v.Srb = SS_GET_PDCP_CNT(received_msg).rb_info[i].rb_id;
LOG_I(ENB_SS_SYS_TASK, "Received msg:%s\n", ITTI_MSG_NAME(received_msg));
if (RRC_CONFIGURATION_CNF(received_msg).status == 1 && SS_context.sys_cnf.cnfFlag == 1)
{
LOG_A(ENB_SS_SYS_TASK, "Signalling main thread for cell config done indication\n");
send_sys_cnf(SS_context.sys_cnf.resType,
SS_context.sys_cnf.resVal,
SS_context.sys_cnf.cnfType,
(void *)SS_context.sys_cnf.msg_buffer);
sys_confirm_done_indication();
}
break;
}
else
case SS_UPD_TIM_INFO:
{
PdcpCount.v.Get.v[i].RadioBearerId.d = RadioBearerId_Type_Drb;
PdcpCount.v.Get.v[i].RadioBearerId.v.Drb = SS_GET_PDCP_CNT(received_msg).rb_info[i].rb_id - 3;
}
PdcpCount.v.Get.v[i].UL.d = true;
PdcpCount.v.Get.v[i].DL.d = true;
tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf;
tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn;
PdcpCount.v.Get.v[i].UL.v.Format = SS_GET_PDCP_CNT(received_msg).rb_info[i].ul_format;
PdcpCount.v.Get.v[i].DL.v.Format = SS_GET_PDCP_CNT(received_msg).rb_info[i].dl_format;
SS_context.sfn = tinfo.sfn;
SS_context.sf = tinfo.sf;
// SS_context.hsfn = tinfo.hsfn;
int_to_bin(SS_GET_PDCP_CNT(received_msg).rb_info[i].ul_count, 32, PdcpCount.v.Get.v[i].UL.v.Value);
int_to_bin(SS_GET_PDCP_CNT(received_msg).rb_info[i].dl_count, 32, PdcpCount.v.Get.v[i].DL.v.Value);
}
g_log->sfn = tinfo.sfn;
g_log->sf = (uint32_t)tinfo.sf;
LOG_A(ENB_SS_SYS_TASK, "[SYS] received SS_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
send_sys_cnf(resType, resVal, cnfType, (void *)&PdcpCount);
}
break;
case UDP_DATA_IND:
{
proxy_ss_header_t hdr;
attenuationConfigCnf_t attnCnf;
VngCmdResp_t VngResp;
LOG_A(ENB_SS_SYS_TASK, "received UDP_DATA_IND \n");
enum SystemConfirm_Type_Sel cnfType;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true;
//if (attnCnf.header.preamble != 0xF00DC0DE ) break; /** TODO Log ! */
memcpy(&hdr, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(proxy_ss_header_t));
switch (hdr.msg_id)
{
case SS_ATTN_LIST_CNF:
cnfType = SystemConfirm_Type_CellAttenuationList;
memcpy(&attnCnf, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(attenuationConfigCnf_t));
if(false == SS_context.send_atten_cnf) {
LOG_A(ENB_SS_SYS_TASK, "received Cell_Attenuation_Cnf from Proxy for cell : %d \n", attnCnf.header.cell_id);
SS_context.send_atten_cnf = true;
send_sys_cnf(resType, resVal, cnfType, NULL);
}
break;
case SS_VNG_CMD_RESP:
memcpy(&VngResp, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(VngCmdResp_t));
MessageDef *vng_resp_p = itti_alloc_new_message(TASK_SYS, 0, SS_VNG_PROXY_RESP);
assert(vng_resp_p);
}
break;
SS_VNG_PROXY_RESP(vng_resp_p).cell_id = VngResp.header.cell_id;
SS_VNG_PROXY_RESP(vng_resp_p).sfn_sf = (tinfo.sfn << 4 | tinfo.sf);
SS_VNG_PROXY_RESP(vng_resp_p).status = VngResp.status;
case SS_GET_TIM_INFO:
{
LOG_A(ENB_SS_SYS_TASK, "received GET_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
ss_task_sys_handle_timing_info(&tinfo);
}
break;
LOG_A(ENB_SS_SYS_TASK, "Sending CMD_RESP for CNF @ sfn: %d sf: %d\n", tinfo.sfn, tinfo.sf);
case SS_SYS_PORT_MSG_IND:
{
int res = itti_send_msg_to_task(TASK_VNG, 0, vng_resp_p);
if (res < 0)
if (valid_sys_msg(SS_SYS_PORT_MSG_IND(received_msg).req))
{
LOG_A(ENB_SS_SYS_TASK, "[SS-VNG] Error in itti_send_msg_to_task\n");
ss_task_sys_handle_req(SS_SYS_PORT_MSG_IND(received_msg).req, &tinfo);
}
else
{
LOG_A(ENB_SS_SYS_TASK, "[SS-VNG] Send ITTI message to %s\n", ITTI_MSG_DESTINATION_NAME(vng_resp_p));
LOG_A(ENB_SS_SYS_TASK, "Not hanled SYS_PORT message received \n");
}
default:
break;
}
break;
}
case TERMINATE_MESSAGE:
{
itti_exit_task();
break;
}
default:
LOG_A(ENB_SS_SYS_TASK, "Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
if (SS_SYS_PORT_MSG_IND(received_msg).req)
free(SS_SYS_PORT_MSG_IND(received_msg).req);
if (SS_SYS_PORT_MSG_IND(received_msg).req->Common.ControlInfo.CnfFlag == false)
sys_confirm_done_indication();
LOG_A(ENB_SS_SYS_TASK, "Signalling main thread for cell config done indication\n");
}
break;
case SS_VNG_PROXY_REQ: {
LOG_A(ENB_SS_SYS_TASK, "received %s from %s \n", ITTI_MSG_NAME(received_msg),
ITTI_MSG_ORIGIN_NAME(received_msg));
VngCmdReq_t *req = (VngCmdReq_t *)malloc(sizeof(VngCmdReq_t));
req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VNG_CMD_REQ;
req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_VNG_PROXY_REQ(received_msg).cell_id;
req->header.cell_index = get_cell_index_pci(req->header.cell_id , SS_context.SSCell_list);
printf("VNG send to proxy cell_index %d\n",req->header.cell_index);
req->bw = SS_VNG_PROXY_REQ(received_msg).bw;
req->cmd = SS_VNG_PROXY_REQ(received_msg).cmd;
req->NocLevel = SS_VNG_PROXY_REQ(received_msg).Noc_level;
LOG_A(ENB_SS_SYS_TASK,"VNG Command for cell_id: %d CMD %d ",
req->header.cell_id, req->cmd);
ss_set_timinfo_t timer_tinfo= {0};
sys_send_proxy((void *)req, sizeof(VngCmdReq_t), 0, timer_tinfo);
}
break;
case SS_GET_PDCP_CNT: /** FIXME */
{
LOG_A(ENB_SS_SYS_TASK, "received SS_GET_PDCP_CNT Count from PDCP size %d\n",
SS_GET_PDCP_CNT(received_msg).size);
enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_PdcpCount;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true;
struct PDCP_CountCnf_Type PdcpCount;
PdcpCount.d = PDCP_CountCnf_Type_Get;
PdcpCount.v.Get.d = SS_GET_PDCP_CNT(received_msg).size;
const size_t size = sizeof(struct PdcpCountInfo_Type) * PdcpCount.v.Get.d;
PdcpCount.v.Get.v =(struct PdcpCountInfo_Type *)acpMalloc(size);
for (int i = 0; i < PdcpCount.v.Get.d; i++)
{
if (SS_GET_PDCP_CNT(received_msg).rb_info[i].is_srb == true)
{
PdcpCount.v.Get.v[i].RadioBearerId.d = RadioBearerId_Type_Srb;
PdcpCount.v.Get.v[i].RadioBearerId.v.Srb = SS_GET_PDCP_CNT(received_msg).rb_info[i].rb_id;
}
else
{
PdcpCount.v.Get.v[i].RadioBearerId.d = RadioBearerId_Type_Drb;
PdcpCount.v.Get.v[i].RadioBearerId.v.Drb = SS_GET_PDCP_CNT(received_msg).rb_info[i].rb_id - 3;
}
PdcpCount.v.Get.v[i].UL.d = true;
PdcpCount.v.Get.v[i].DL.d = true;
PdcpCount.v.Get.v[i].UL.v.Format = SS_GET_PDCP_CNT(received_msg).rb_info[i].ul_format;
PdcpCount.v.Get.v[i].DL.v.Format = SS_GET_PDCP_CNT(received_msg).rb_info[i].dl_format;
int_to_bin(SS_GET_PDCP_CNT(received_msg).rb_info[i].ul_count, 32, PdcpCount.v.Get.v[i].UL.v.Value);
int_to_bin(SS_GET_PDCP_CNT(received_msg).rb_info[i].dl_count, 32, PdcpCount.v.Get.v[i].DL.v.Value);
}
send_sys_cnf(resType, resVal, cnfType, (void *)&PdcpCount);
sys_confirm_done_indication();
}
break;
case UDP_DATA_IND:
{
proxy_ss_header_t hdr;
attenuationConfigCnf_t attnCnf;
VngCmdResp_t VngResp;
LOG_A(ENB_SS_SYS_TASK, "received UDP_DATA_IND \n");
enum SystemConfirm_Type_Sel cnfType;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true;
//if (attnCnf.header.preamble != 0xF00DC0DE ) break; /** TODO Log ! */
memcpy(&hdr, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(proxy_ss_header_t));
switch (hdr.msg_id)
{
case SS_ATTN_LIST_CNF:
cnfType = SystemConfirm_Type_CellAttenuationList;
memcpy(&attnCnf, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(attenuationConfigCnf_t));
if(false == SS_context.send_atten_cnf) {
LOG_A(ENB_SS_SYS_TASK, "received Cell_Attenuation_Cnf from Proxy for cell : %d \n", attnCnf.header.cell_id);
SS_context.send_atten_cnf = true;
send_sys_cnf(resType, resVal, cnfType, NULL);
sys_confirm_done_indication();
}
break;
case SS_VNG_CMD_RESP:
memcpy(&VngResp, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(VngCmdResp_t));
MessageDef *vng_resp_p = itti_alloc_new_message(TASK_SYS, 0, SS_VNG_PROXY_RESP);
assert(vng_resp_p);
SS_VNG_PROXY_RESP(vng_resp_p).cell_id = VngResp.header.cell_id;
SS_VNG_PROXY_RESP(vng_resp_p).sfn_sf = (tinfo.sfn << 4 | tinfo.sf);
SS_VNG_PROXY_RESP(vng_resp_p).status = VngResp.status;
LOG_A(ENB_SS_SYS_TASK, "Sending CMD_RESP for CNF @ sfn: %d sf: %d\n", tinfo.sfn, tinfo.sf);
int res = itti_send_msg_to_task(TASK_VNG, 0, vng_resp_p);
if (res < 0)
{
LOG_A(ENB_SS_SYS_TASK, "[SS-VNG] Error in itti_send_msg_to_task\n");
}
else
{
LOG_A(ENB_SS_SYS_TASK, "[SS-VNG] Send ITTI message to %s\n", ITTI_MSG_DESTINATION_NAME(vng_resp_p));
}
default:
break;
}
break;
}
case TERMINATE_MESSAGE:
{
itti_exit_task();
break;
}
default:
LOG_A(ENB_SS_SYS_TASK, "Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
}
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
......@@ -2665,7 +2749,6 @@ void sys_handle_pdcch_order(struct RA_PDCCH_Order_Type *pdcchOrder)
else
{
send_sys_cnf(resType, resVal, SystemConfirm_Type_PdcchOrder, NULL);
sys_confirm_done_indication();
}
}
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