Commit 33696a4e authored by Navid Nikaein's avatar Navid Nikaein

*Update RRC RSRP/RSRQ measurement reports for multiple UEs, and add the corresponding RAN APIs

*Fix the issue with the PDCP UE ID/RNTI management
parent b74c668d
......@@ -276,9 +276,11 @@ void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t* measResults
for (i = 0; i < num; i++){
meas_stats[i].rnti = flexran_get_ue_crnti(mod_id, i);
meas_stats[i].meas_id = measResults->measId;
meas_stats[i].rsrp = measResults->measResultPCell.rsrpResult - 140;
meas_stats[i].rsrq = (measResults->measResultPCell.rsrqResult)/2 - 20;
meas_stats[i].meas_id = flexran_get_rrc_pcell_measid(mod_id,i);
meas_stats[i].rsrp = flexran_get_rrc_pcell_rsrp(mod_id,i) - 140;
// measResults->measResultPCell.rsrpResult - 140;
meas_stats[i].rsrq = flexran_get_rrc_pcell_rsrq(mod_id,i)/2 - 20;
// (measResults->measResultPCell.rsrqResult)/2 - 20;
}
// repl->neigh_meas = NULL;
......@@ -505,23 +507,21 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
if (rrc_measurements == NULL)
goto error;
protocol__flex_rrc_measurements__init(rrc_measurements);
if (triggered_rrc){
rrc_measurements->measid = meas_stats[i].meas_id;
rrc_measurements->has_measid = 1;
rrc_measurements->pcell_rsrp = meas_stats[i].rsrp;
rrc_measurements->has_pcell_rsrp = 1;
rrc_measurements->pcell_rsrq = meas_stats[i].rsrq;
rrc_measurements->has_pcell_rsrq = 1 ;
ue_report[i]->rrc_measurements = rrc_measurements;
// triggered_rrc = false; // To be decided later
}
rrc_measurements->measid = flexran_get_rrc_pcell_measid(mod_id,i);
rrc_measurements->has_measid = 1;
rrc_measurements->pcell_rsrp = flexran_get_rrc_pcell_rsrp(mod_id,i) - 140;
rrc_measurements->has_pcell_rsrp = 1;
rrc_measurements->pcell_rsrq = flexran_get_rrc_pcell_rsrq(mod_id,i)/2 - 20;
rrc_measurements->has_pcell_rsrq = 1 ;
ue_report[i]->rrc_measurements = rrc_measurements;
}
}
}
}
/* To be extended for RRC layer */
// if (report_config->nr_cc > 0) {
......
......@@ -1083,9 +1083,9 @@ void flexran_agent_set_operating_frame_type (mid_t mod_id, int cc_id, int frame_
}
/*********** PDCP *************/
/*PDCP num tx pdu status flexRAN*/
/*PDCP super frame counter flexRAN*/
uint32_t flexran_get_pdcp_sfn(const mid_t mod_id){
return Pdcp_sfn[mod_id];
return pdcp_enb[mod_id].sfn;
}
/*PDCP num tx pdu status flexRAN*/
......@@ -1166,5 +1166,67 @@ uint32_t flexran_get_pdcp_rx_oo(const mid_t mod_id, const mid_t ue_id, const lc
return Pdcp_stats_rx_outoforder[mod_id][ue_id][lcid];
}
/******************** RRC *****************************/
int flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
return ue_context_p->ue_context.measResults->measId;
} else {
return -1;
}
} else {
return -1;
}
}
int flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
return ue_context_p->ue_context.measResults->measResultPCell.rsrpResult;
} else {
return -1;
}
} else {
return -1;
}
}
int flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
return ue_context_p->ue_context.measResults->measResultPCell.rsrqResult;
} else {
return -1;
}
} else {
return -1;
}
}
/*
void* flexran_get_rrc_ncell_measresult_eutra(mid_t mod_id, mid_t ue_id) {
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
uint32_t rntiP = flexran_get_ue_crnti(mod_id,ue_id);
ue_context_p = rrc_eNB_get_ue_context(&eNB_rrc_inst[mod_id],rntiP);
if(ue_context_p != NULL) {
if(ue_context_p->ue_context.measResults != NULL) {
return &ue_context_p->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA;
} else {
return -1;
}
} else {
return -1;
}
}
*/
......@@ -391,4 +391,12 @@ uint32_t flexran_get_pdcp_rx_aiat_s(const mid_t mod_id, const mid_t ue_id, cons
/*PDCP num of received outoforder pdu status flexRAN*/
uint32_t flexran_get_pdcp_rx_oo(const mid_t mod_id, const mid_t ue_id, const lcid_t lcid);
/*********************RRC**********************/
/*Get primary cell measuremeant id flexRAN*/
int flexran_get_rrc_pcell_measid(mid_t mod_id, mid_t ue_id);
/*Get primary cell RSRP measurement flexRAN*/
int flexran_get_rrc_pcell_rsrp(mid_t mod_id, mid_t ue_id);
/*Get primary cell RSRQ measurement flexRAN*/
int flexran_get_rrc_pcell_rsrq(mid_t mod_id, mid_t ue_id);
......@@ -69,7 +69,6 @@ extern int otg_enabled;
#endif
//-----------------------------------------------------------------------------
/*
* If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken
......@@ -403,7 +402,7 @@ boolean_t pdcp_data_req(
*/
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
if (pdcp_p->rnti[pdcp_uid] == ctxt_pP->rnti )
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti )
break;
}
......@@ -414,9 +413,9 @@ boolean_t pdcp_data_req(
Pdcp_stats_tx_bytes_s[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=sdu_buffer_sizeP;
Pdcp_stats_tx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=current_sn;
Pdcp_stats_tx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (Pdcp_sfn[ctxt_pP->module_id] - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_tx_aiat_tmp_s[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (Pdcp_sfn[ctxt_pP->module_id] - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=Pdcp_sfn[ctxt_pP->module_id];
Pdcp_stats_tx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_tx_aiat_tmp_s[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
return ret;
......@@ -875,8 +874,9 @@ pdcp_data_ind(
*/
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
if (pdcp_p->rnti[pdcp_uid] == ctxt_pP->rnti )
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti ){
break;
}
}
Pdcp_stats_rx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
......@@ -889,9 +889,9 @@ pdcp_data_ind(
if (oo_flag == 1 )
Pdcp_stats_rx_outoforder[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (Pdcp_sfn[ctxt_pP->module_id] - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_aiat_tmp_s[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(Pdcp_sfn[ctxt_pP->module_id] - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=Pdcp_sfn[ctxt_pP->module_id];
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_aiat_tmp_s[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
......@@ -920,10 +920,10 @@ void pdcp_update_stats(const protocol_ctxt_t* const ctxt_pP){
uint8_t rb_id = 0;
// these stats are measured for both eNB and UE on per seond basis
if (Pdcp_sfn[ctxt_pP->module_id] % 1000 == 0){
if (pdcp_enb[ctxt_pP->module_id].sfn % 1000 == 0){
for (rb_id =0; rb_id < NB_RB_MAX; rb_id ++){
for (pdcp_uid=0; pdcp_uid< NUMBER_OF_UE_MAX;pdcp_uid++){
//printf("frame %d and subframe %d \n", Pdcp_frame[ctxt_pP->module_id], Pdcp_subframe[ctxt_pP->module_id]);
//printf("frame %d and subframe %d \n", pdcp_enb[ctxt_pP->module_id].frame, pdcp_enb[ctxt_pP->module_id].subframe);
// tx stats
Pdcp_stats_tx_rate_s[ctxt_pP->module_id][pdcp_uid][rb_id]= Pdcp_stats_tx_s[ctxt_pP->module_id][pdcp_uid][rb_id];
// unit: bit/s
......@@ -975,9 +975,9 @@ pdcp_run (
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].pdcp_run);
}
Pdcp_sfn[ctxt_pP->module_id]++; // range: 0 to 18,446,744,073,709,551,615
Pdcp_frame[ctxt_pP->module_id]=ctxt_pP->frame; // 1023
Pdcp_subframe[ctxt_pP->module_id]= ctxt_pP->subframe;
pdcp_enb[ctxt_pP->module_id].sfn++; // range: 0 to 18,446,744,073,709,551,615
pdcp_enb[ctxt_pP->module_id].frame=ctxt_pP->frame; // 1023
pdcp_enb[ctxt_pP->module_id].subframe= ctxt_pP->subframe;
pdcp_update_stats(ctxt_pP);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_IN);
......@@ -1102,6 +1102,28 @@ pdcp_run (
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_OUT);
}
void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP){
int i, ue_flag=1, ret=-1;;
for (i=0; i < NUMBER_OF_UE_MAX; i++){
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == ctxt_pP->rnti) {
ue_flag=-1;
break;
}
}
if (ue_flag == 1 ){
for (i=0; i < NUMBER_OF_UE_MAX ; i++){
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == 0 ){
pdcp_enb[ctxt_pP->module_id].rnti[i]=ctxt_pP->rnti;
pdcp_enb[ctxt_pP->module_id].uid[i]=i;
pdcp_enb[ctxt_pP->module_id].num_ues++;
printf("add new uid is %d %x\n\n", i, ctxt_pP->rnti);
ret=1;
break;
}
}
}
//return ret;
}
//-----------------------------------------------------------------------------
boolean_t
......@@ -1115,7 +1137,7 @@ pdcp_remove_UE(
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
// check and remove SRBs first
// check and remove SRBs first
for (srb_id=0; srb_id<2; srb_id++) {
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, srb_id, SRB_FLAG_YES);
......@@ -1130,6 +1152,19 @@ pdcp_remove_UE(
(void)h_rc; /* remove gcc warning "set but not used" */
// remove ue for pdcp enb inst
for (i=0; i < NUMBER_OF_UE_MAX; i++) {
if (pdcp_enb[ctxt_pP->module_id].rnti[i] == ctxt_pP->rnti ) {
LOG_I(PDCP, "remove uid is %d/%d %x\n", i,
pdcp_enb[ctxt_pP->module_id].uid[i],
pdcp_enb[ctxt_pP->module_id].rnti[i]);
pdcp_enb[ctxt_pP->module_id].uid[i]=0;
pdcp_enb[ctxt_pP->module_id].rnti[i]=0;
pdcp_enb[ctxt_pP->module_id].num_ues--;
break;
}
}
return 1;
}
......@@ -1524,7 +1559,6 @@ rrc_pdcp_config_asn1_req (
return 0;
}
//-----------------------------------------------------------------------------
boolean_t
pdcp_config_req_asn1 (
......@@ -1545,19 +1579,14 @@ pdcp_config_req_asn1 (
uint8_t *const kUPenc_pP)
//-----------------------------------------------------------------------------
{
int i;
switch (actionP) {
case CONFIG_ACTION_ADD:
DevAssert(pdcp_pP != NULL);
if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
pdcp_pP->is_ue = FALSE;
for (i=0; i < NUMBER_OF_UE_MAX; i++) {
if (pdcp_pP->rnti[i] != 0 ) continue ; // skip active ues
pdcp_pP->rnti[i]=ctxt_pP->rnti;
pdcp_pP->uid[i]=i;
Pdcp_num_ues[ctxt_pP->module_id]++;
break;
}
pdcp_add_ue(ctxt_pP);
//pdcp_eNB_UE_instance_to_rnti[ctxtP->module_id] = ctxt_pP->rnti;
pdcp_eNB_UE_instance_to_rnti[pdcp_eNB_UE_instance_to_rnti_index] = ctxt_pP->rnti;
//pdcp_eNB_UE_instance_to_rnti_index = (pdcp_eNB_UE_instance_to_rnti_index + 1) % NUMBER_OF_UE_MAX;
......@@ -1658,15 +1687,7 @@ pdcp_config_req_asn1 (
rb_idP);
if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
for (i=0; i < NUMBER_OF_UE_MAX; i++) {
if (pdcp_pP->rnti[i] == ctxt_pP->rnti ) {
pdcp_pP->rnti[i]=0;
pdcp_pP->uid[i]=0;
Pdcp_num_ues[ctxt_pP->module_id]--;
break;
}
}
// pdcp_remove_UE(ctxt_pP);
}
/* Security keys */
......@@ -2046,10 +2067,8 @@ void pdcp_layer_init(void)
pdcp_output_header_bytes_to_write=0;
pdcp_input_sdu_remaining_size_to_read=0;
memset(Pdcp_sfn, 0, sizeof(Pdcp_sfn));
memset(Pdcp_frame, 0, sizeof(Pdcp_frame));
memset(Pdcp_subframe, 0, sizeof(Pdcp_subframe));
memset(Pdcp_num_ues, 0, sizeof(Pdcp_num_ues));
memset(pdcp_enb, 0, sizeof(pdcp_enb_t));
memset(Pdcp_stats_tx, 0, sizeof(Pdcp_stats_tx));
memset(Pdcp_stats_tx_s, 0, sizeof(Pdcp_stats_tx_s));
......
......@@ -94,11 +94,12 @@ extern int pdcp_instance_cnt;
int init_pdcp_thread(void);
void cleanup_pdcp_thread(void);
/*
public_pdcp(uint64_t Pdcp_sfn[MAX_NUM_CCs]);
public_pdcp(frame_t Pdcp_frame[MAX_NUM_CCs]);
public_pdcp(sub_frame_t Pdcp_subframe[MAX_NUM_CCs]);
public_pdcp(uint16_t Pdcp_num_ues[MAX_NUM_CCs]);
*/
public_pdcp(uint32_t Pdcp_stats_tx_bytes[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
public_pdcp(uint32_t Pdcp_stats_tx_bytes_s[MAX_NUM_CCs][NUMBER_OF_UE_MAX][NB_RB_MAX]);
......@@ -131,7 +132,19 @@ public_pdcp(void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctx
/*Packet Probing for agent PDCP*/
//public_pdcp(uint64_t *pdcp_packet_counter);
//public_pdcp(uint64_t *pdcp_size_packet);
typedef struct pdcp_enb_s {
// used for eNB stats generation
uint16_t uid[NUMBER_OF_UE_MAX];
rnti_t rnti[NUMBER_OF_UE_MAX];
uint16_t num_ues;
uint64_t sfn;
frame_t frame;
sub_frame_t subframe;
} pdcp_enb_t;
public_pdcp(pdcp_enb_t pdcp_enb[MAX_NUM_CCs]);
typedef struct pdcp_stats_s {
time_stats_t pdcp_run;
......@@ -154,11 +167,7 @@ typedef struct pdcp_s {
boolean_t is_ue;
boolean_t is_srb;
// used for eNB stats generation
uint16_t uid[NUMBER_OF_UE_MAX]; // local to pdcp
rnti_t rnti[NUMBER_OF_UE_MAX];
/* Configured security algorithms */
/* Configured security algorithms */
uint8_t cipheringAlgorithm;
uint8_t integrityProtAlgorithm;
......@@ -360,9 +369,15 @@ public_pdcp(boolean_t pdcp_config_req_asn1 (
uint8_t *const kRRCint,
uint8_t *const kUPenc));
/*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function (for RRC) to add a new UE in PDCP module
* \param[in] ctxt_pP Running context.
* \return A status about the processing, OK or error code.
*/
public_pdcp(void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP));
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function for RRC to configure a Radio Bearer clear all PDCP resources for a particular UE
* \brief Function for RRC to remove UE from PDCP module hashtable
* \param[in] ctxt_pP Running context.
* \return A status about the processing, OK or error code.
*/
......
......@@ -597,10 +597,10 @@ rrc_data_ind(
rb_id_t DCCH_index = Srb_id;
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
LOG_N(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n",
LOG_D(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d 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_N(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %x\n",
LOG_D(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %x\n",
ctxt_pP->module_id,
ctxt_pP->frame,
DCCH_index,
......
......@@ -374,7 +374,8 @@ typedef struct eNB_RRC_UE_s {
SRB_INFO_TABLE_ENTRY Srb2;
MeasConfig_t* measConfig;
HANDOVER_INFO* handover_info;
MeasResults_t* measResults;
#if defined(ENABLE_SECURITY)
/* KeNB as derived from KASME received from EPC */
uint8_t kenb[32];
......
......@@ -425,7 +425,7 @@ rrc_eNB_generate_SecurityModeCommand(
void
rrc_eNB_process_MeasurementReport(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP,
rrc_eNB_ue_context_t* ue_context_pP,
const MeasResults_t* const measResults2
);
......
......@@ -2840,32 +2840,56 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell(
void
rrc_eNB_process_MeasurementReport(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP,
rrc_eNB_ue_context_t* ue_context_pP,
const MeasResults_t* const measResults2
)
//-----------------------------------------------------------------------------
{
// T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
// T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
// LOG_I(RRC, "[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)\n",
// ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId);
// if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) {
// LOG_I(RRC, "Physical Cell Id %d\n",
// (int)measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->physCellId);
// LOG_I(RRC, "RSRP of Target %d\n",
// (int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->
// measResult.rsrpResult));
// LOG_I(RRC, "RSRQ of Target %d\n",
// (int)*(measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->
// measResult.rsrqResult));
// }
int i=0;
int neighboring_cells=-1;
T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
if (measResults2 == NULL )
return;
if (measResults2->measId > 0 ){
if (ue_context_pP->ue_context.measResults == NULL) {
ue_context_pP->ue_context.measResults = CALLOC(1, sizeof(MeasResults_t));
}
ue_context_pP->ue_context.measResults->measId=measResults2->measId;
ue_context_pP->ue_context.measResults->measResultPCell.rsrpResult=measResults2->measResultPCell.rsrpResult;
ue_context_pP->ue_context.measResults->measResultPCell.rsrqResult=measResults2->measResultPCell.rsrqResult;
LOG_D(RRC, "[eNB %d]Frame %d: UE %x (Measurement Id %d): RSRP of Source %ld\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId, ue_context_pP->ue_context.measResults->measResultPCell.rsrpResult-140);
LOG_D(RRC, "[eNB %d]Frame %d: UE %x (Measurement Id %d): RSRQ of Source %ld\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId, ue_context_pP->ue_context.measResults->measResultPCell.rsrqResult/2 - 20);
}
if (measResults2->measResultNeighCells == NULL)
return;
if (measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count > 0) {
neighboring_cells=measResults2->measResultNeighCells->choice.measResultListEUTRA.list.count;
if (ue_context_pP->ue_context.measResults->measResultNeighCells == NULL) {
ue_context_pP->ue_context.measResults->measResultNeighCells = CALLOC(1, sizeof(*measResults2->measResultNeighCells)*neighboring_cells);
}
ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.count=neighboring_cells;
for (i=0; i < neighboring_cells; i++){
memcpy (ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[i],
measResults2->measResultNeighCells->choice.measResultListEUTRA.list.array[i],
sizeof(MeasResultListEUTRA_t));
LOG_D(RRC, "Physical Cell Id %d\n",
(int)ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[i]->physCellId);
LOG_D(RRC, "RSRP of Target %d\n",
(int)*(ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[i]->measResult.rsrpResult));
LOG_D(RRC, "RSRQ of Target %d\n",
(int)*(ue_context_pP->ue_context.measResults->measResultNeighCells->choice.measResultListEUTRA.list.array[i]->measResult.rsrqResult));
}
}
// #if defined(Rel10) || defined(Rel14)
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
// #else
......@@ -5109,13 +5133,6 @@ rrc_eNB_decode_dcch(
ue_context_p,
&ul_dcch_msg->message.choice.c1.choice.measurementReport.
criticalExtensions.choice.c1.choice.measurementReport_r8.measResults);
#if defined(FLEXRAN_AGENT_SB_IF)
if (rrc_agent_registered[ctxt_pP->module_id]) {
agent_rrc_xface[ctxt_pP->eNB_index]->flexran_trigger_rrc_measurements (ctxt_pP->module_id, &ul_dcch_msg->message.choice.c1.choice.measurementReport.criticalExtensions.choice.c1.choice.measurementReport_r8.measResults);
}
#endif
break;
case UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete:
......
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