Commit cee317b7 authored by Melissa Elkadi's avatar Melissa Elkadi

Removed reportConfig dump funciton

Also removed the [eNB_index + 1] saving/writing
in the process_MeasObj function. This indexing
was incorrect. Also cleaned up the code, fixed
ssRSRB -> ssbRSRP. Lastly, added assertFatals
around indexing in process_measObj function.
parent 84277425
......@@ -1007,8 +1007,8 @@ typedef struct {
/// A value indicating how the BCH payload is generated. This should match the PARAM/CONFIG TLVs. Value: 0: MAC generates the full PBCH payload, see Table 3-41, where bchPayload has 31 bits 1: PHY generates the timing PBCH bits, see Table 3-41, where the bchPayload has 24 bits 2: PHY generates the full PBCH payload
uint8_t bchPayloadFlag;
uint32_t bchPayload;
/// A value indicating the channel quality between the gNB and nrUE. Value: 0->255 dBM (ssbRSRP)
uint8_t ssRSRB;
/// A value indicating the channel quality between the gNB and nrUE. Value: 0->255 dBM
uint8_t ssbRsrp;
nfapi_nr_tx_precoding_and_beamforming_t precoding_and_beamforming;
} nfapi_nr_dl_tti_ssb_pdu_rel15_t;
......
......@@ -372,7 +372,7 @@ static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void* tlv, uint8_t **ppWritePacke
push16(value->ssbOffsetPointA, ppWritePackedMsg, end) &&
push8(value->bchPayloadFlag, ppWritePackedMsg, end) &&
push32(value->bchPayload, ppWritePackedMsg, end) &&
push8(value->ssRSRB, ppWritePackedMsg, end)
push8(value->ssbRsrp, ppWritePackedMsg, end)
// TODO: pack precoding_and_beamforming too
);
......@@ -3876,7 +3876,7 @@ static uint8_t unpack_dl_tti_ssb_pdu_rel15_value(void* tlv, uint8_t **ppReadPack
pull16(ppReadPackedMsg, &value->ssbOffsetPointA, end) &&
pull8(ppReadPackedMsg, &value->bchPayloadFlag, end) &&
pull32(ppReadPackedMsg, &value->bchPayload, end) &&
pull8(ppReadPackedMsg, &value->ssRSRB, end)
pull8(ppReadPackedMsg, &value->ssbRsrp, end)
// TODO: pack precoding_and_beamforming too
);
......
......@@ -150,8 +150,8 @@ static void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request)
pdu_list->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex,
pdu_list->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset,
pdu_list->ssb_pdu.ssb_pdu_rel15.bchPayload);
pdu_list->ssb_pdu.ssb_pdu_rel15.ssRSRB = 60;
LOG_D(NR_RRC, "Setting pdulist[%d].ssRSRB to %d\n", i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssRSRB);
pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp = 60;
LOG_D(NR_RRC, "Setting pdulist[%d].ssbRsrp to %d\n", i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp);
}
}
......
......@@ -763,26 +763,6 @@ rrc_ue_establish_drb(
return(0);
}
static void dump_report_config(const UE_RRC_INST *ue, const char *label)
{
for(int i = 0; i < NB_CNX_UE; i++) {
for(int j = 0; j < MAX_MEAS_ID; j++) {
LTE_ReportConfigToAddMod_t *rc = ue->ReportConfig[i][j];
if (rc == NULL)
{
LOG_I(RRC, "%s: %d %d = NULL\n", label, i, j);
}
else
{
LOG_I(RRC, "%s: %d %d = %d %d\n",
label, i, j,
rc->reportConfig.present,
rc->reportConfig.choice.reportConfigInterRAT.triggerType.present);
}
}
}
}
//-----------------------------------------------------------------------------
void
rrc_ue_process_measConfig(
......@@ -803,8 +783,6 @@ rrc_ue_process_measConfig(
ind = *measConfig->measObjectToRemoveList->list.array[i];
free(ue->MeasObj[eNB_index][ind-1]);
ue->MeasObj[eNB_index][ind-1] = NULL;
free(ue->MeasObj[eNB_index+1][ind-1]);
ue->MeasObj[eNB_index+1][ind-1] = NULL;
}
}
......@@ -814,52 +792,42 @@ rrc_ue_process_measConfig(
for (i = 0; i < measConfig->measObjectToAddModList->list.count; i++) {
measObj = measConfig->measObjectToAddModList->list.array[i];
ind = measConfig->measObjectToAddModList->list.array[i]->measObjectId;
if (ind < 1 || ind > MAX_MEAS_OBJ) {
LOG_E(MAC, "measObjectId is out of bounds: %ld. Setting to 1. i = %d.\n", ind, i);
//ind = 1;
}
AssertFatal(ind > 0 && ind <= MAX_MEAS_OBJ && eNB_index >= 0 && eNB_index < NB_CNX_UE,
"measObjectId is out of bounds. ind = %ld, eNB_index = %d, i = %d.\n", ind, eNB_index, i);
if (ue->MeasObj[eNB_index][ind-1]) {
LOG_D(RRC, "Modifying measurement object [%d][%ld]\n", eNB_index, ind);
memcpy((char *)ue->MeasObj[eNB_index][ind-1],
(char *)measObj,
sizeof(LTE_MeasObjectToAddMod_t));
}
if (ue->MeasObj[eNB_index+1][ind-1]) {
LOG_D(RRC, "Modifying NR measurement object [%d][%ld]\n", eNB_index + 1, ind);
memcpy((char *)ue->MeasObj[eNB_index+1][ind-1],
(char *)measObj,
sizeof(LTE_MeasObjectToAddMod_t));
}
else {
if (measObj->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectEUTRA) {
LOG_I(RRC,"EUTRA Measurement : carrierFreq %ld, allowedMeasBandwidth %ld,presenceAntennaPort1 %d, neighCellConfig %d\n",
measObj->measObject.choice.measObjectEUTRA.carrierFreq,
measObj->measObject.choice.measObjectEUTRA.allowedMeasBandwidth,
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]);
} else {
if (measObj->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectEUTRA) {
LOG_I(RRC,"EUTRA Measurement : carrierFreq %ld, allowedMeasBandwidth %ld,presenceAntennaPort1 %d, neighCellConfig %d\n",
measObj->measObject.choice.measObjectEUTRA.carrierFreq,
measObj->measObject.choice.measObjectEUTRA.allowedMeasBandwidth,
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]);
} else if (measObj->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectNR_r15) {
LOG_I(RRC, "NR_r15 Measurement: carrierFreq: %ld\n",
measObj->measObject.choice.measObjectNR_r15.carrierFreq_r15);
if (!get_softmodem_params()->nsa) {
LOG_E(RRC, "Not in NSA mode but attempting to send measurement request to NR-UE\n");
return;
}
uint8_t buffer[RRC_BUF_SIZE];
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_MeasObjectToAddMod,
NULL,
measObj,
buffer,
sizeof(buffer));
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %zu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC, "Calling nsa_sendmsg_to_nr_ue to send a RRC_MEASUREMENT_PROCEDURE\n");
nsa_sendmsg_to_nrue(buffer, (enc_rval.encoded + 7)/8, RRC_MEASUREMENT_PROCEDURE);
}
UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index][ind-1]=measObj;
LOG_D(RRC, "Adding measurement object [%d][%ld]\n", eNB_index, ind);
ue->MeasObj[eNB_index][ind-1]=measObj;
}
if (measObj->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectNR_r15) {
LOG_I(RRC, "Adding NR measurement object [%d][%ld]\n", eNB_index + 1, ind);
ue->MeasObj[eNB_index+1][ind-1] = measObj;
if (!get_softmodem_params()->nsa) {
LOG_E(RRC, "Not in NSA mode but attempting to send measurement request to NR-UE\n");
return;
}
uint8_t buffer[RRC_BUF_SIZE];
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_MeasObjectToAddMod,
NULL,
measObj,
buffer,
sizeof(buffer));
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %zu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC, "Calling nsa_sendmsg_to_nr_ue to send a RRC_MEASUREMENT_PROCEDURE\n");
nsa_sendmsg_to_nrue(buffer, (enc_rval.encoded + 7)/8, RRC_MEASUREMENT_PROCEDURE);
}
}
}
LOG_I(RRC,"call rrc_mac_config_req \n");
......@@ -897,8 +865,6 @@ rrc_ue_process_measConfig(
ind = *measConfig->reportConfigToRemoveList->list.array[i];
free(ue->ReportConfig[eNB_index][ind-1]);
ue->ReportConfig[eNB_index][ind-1] = NULL;
free(ue->ReportConfig[eNB_index+1][ind-1]);
ue->ReportConfig[eNB_index+1][ind-1] = NULL;
}
}
......@@ -907,10 +873,8 @@ rrc_ue_process_measConfig(
for (i=0; i < measConfig->reportConfigToAddModList->list.count; i++) {
ind = measConfig->reportConfigToAddModList->list.array[i]->reportConfigId;
if (ind < 1 || ind > MAX_MEAS_CONFIG) {
LOG_E(MAC, "ReportConfigId is out of bounds: %ld. Setting to 1. i = %d.\n", ind, i);
//ind = 1;
}
AssertFatal(ind > 0 && ind <= MAX_MEAS_CONFIG && eNB_index >= 0 && eNB_index < NB_CNX_UE,
"ReportConfigId is out of bounds. ind = %ld, eNB_index = %d, i = %d.\n", ind, eNB_index, i);
if (ue->ReportConfig[eNB_index][ind-1]) {
LOG_D(RRC,"Modifying ReportConfig [%d][%ld]\n", eNB_index, ind-1);
memcpy((char *)ue->ReportConfig[eNB_index][ind-1],
......@@ -920,17 +884,6 @@ rrc_ue_process_measConfig(
LOG_D(RRC,"Adding ReportConfig [%d][%ld]\n", eNB_index, ind-1);
ue->ReportConfig[eNB_index][ind-1] = measConfig->reportConfigToAddModList->list.array[i];
}
dump_report_config(ue, "W_LTE");
if (ue->ReportConfig[eNB_index+1][ind-1]) {
LOG_D(RRC,"Modifying NR ReportConfig [%d][%ld]\n", eNB_index + 1, ind-1);
memcpy((char *)ue->ReportConfig[eNB_index+1][ind-1],
(char *)measConfig->reportConfigToAddModList->list.array[i],
sizeof(LTE_ReportConfigToAddMod_t));
} else {
LOG_D(RRC,"Adding NR ReportConfig [%d][%ld]\n", eNB_index + 1, ind-1);
ue->ReportConfig[eNB_index+1][ind-1] = measConfig->reportConfigToAddModList->list.array[i];
}
dump_report_config(ue, "W_NR");
}
}
......@@ -951,18 +904,14 @@ rrc_ue_process_measConfig(
ind = *measConfig->measIdToRemoveList->list.array[i];
free(ue->MeasId[eNB_index][ind-1]);
ue->MeasId[eNB_index][ind-1] = NULL;
free(ue->MeasId[eNB_index+1][ind-1]);
ue->MeasId[eNB_index+1][ind-1] = NULL;
}
}
if (measConfig->measIdToAddModList != NULL) {
for (i=0; i<measConfig->measIdToAddModList->list.count; i++) {
ind = measConfig->measIdToAddModList->list.array[i]->measId;
if (ind < 1 || ind > MAX_MEAS_ID) {
LOG_E(MAC, "measId is out of bounds: %ld. Setting to 1. i = %d.\n", ind, i);
//ind = 1;
}
AssertFatal(ind > 0 && ind <= MAX_MEAS_ID && eNB_index >= 0 && eNB_index < NB_CNX_UE,
"measId is out of bounds. ind = %ld, eNB_index = %d, i = %d.\n", ind, eNB_index, i);
if (ue->MeasId[eNB_index][ind-1]) {
LOG_I(RRC,"Modifying Measurement ID [%d][%ld]\n", eNB_index, ind-1);
memcpy((char *)ue->MeasId[eNB_index][ind-1],
......@@ -972,15 +921,6 @@ rrc_ue_process_measConfig(
LOG_I(RRC,"Adding Measurement ID [%d][%ld]\n", eNB_index, ind-1);
ue->MeasId[eNB_index][ind-1] = measConfig->measIdToAddModList->list.array[i];
}
if (ue->MeasId[eNB_index+1][ind-1]) {
LOG_I(RRC,"Modifying NR Measurement ID [%d][%ld]\n", eNB_index+1, ind-1);
memcpy((char *)ue->MeasId[eNB_index+1][ind-1],
(char *)measConfig->measIdToAddModList->list.array[i],
sizeof(LTE_MeasIdToAddMod_t));
} else {
LOG_I(RRC,"Adding NR Measurement ID [%d][%ld]\n", eNB_index+1, ind-1);
ue->MeasId[eNB_index+1][ind-1] = measConfig->measIdToAddModList->list.array[i];
}
}
}
......@@ -4253,7 +4193,6 @@ void ue_measurement_report_triggering(protocol_ctxt_t *const ctxt_pP, const uint
* applicable when the concerned cell is not included in the blackCellsToAddModList
* defined within the VarMeasConfig for this measId */
// LOG_I(RRC,"event %d %d %p \n", measObjId,reportConfigId, ue->ReportConfig[i][reportConfigId-1]);
dump_report_config(ue, "R_LTE");
if((ue->ReportConfig[i][reportConfigId-1] != NULL) &&
(ue->ReportConfig[i][reportConfigId-1]->reportConfig.present == LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA) &&
(ue->ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.present ==
......@@ -4330,7 +4269,6 @@ void ue_measurement_report_triggering(protocol_ctxt_t *const ctxt_pP, const uint
}
if (ue->MeasObj[i][measObjId-1]->measObject.present == LTE_MeasObjectToAddMod__measObject_PR_measObjectNR_r15) {
dump_report_config(ue, "R_NR");
if((ue->ReportConfig[i][reportConfigId-1] != NULL) &&
(ue->ReportConfig[i][reportConfigId-1]->reportConfig.present ==
LTE_ReportConfigToAddMod__reportConfig_PR_reportConfigInterRAT) &&
......@@ -4338,7 +4276,6 @@ void ue_measurement_report_triggering(protocol_ctxt_t *const ctxt_pP, const uint
LTE_ReportConfigInterRAT__triggerType_PR_event)) {
LTE_ReportConfigToAddMod_t *rc = ue->ReportConfig[i][reportConfigId-1];
LOG_I(RRC, "Got to here %d\n", __LINE__);
hys = rc->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.hysteresis;
ttt_ms = timeToTrigger_ms[rc->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.timeToTrigger];
ofn = 5;
......@@ -4347,8 +4284,7 @@ void ue_measurement_report_triggering(protocol_ctxt_t *const ctxt_pP, const uint
eventId.choice.eventB1_NR_r15.b1_ThresholdNR_r15.choice.nr_RSRP_r15;
switch (rc->reportConfig.choice.reportConfigInterRAT.triggerType.choice.event.eventId.present) {
case LTE_ReportConfigInterRAT__triggerType__event__eventId_PR_eventB1_NR_r15:
LOG_I(RRC,"[UE %d] Frame %d : B1_NR_r15 event: check if serving becomes better than threshold\n",
ctxt_pP->module_id, ctxt_pP->frame);
LOG_I(RRC,"[UE %d] Frame %d : B1_NR_r15 event!\n", ctxt_pP->module_id, ctxt_pP->frame);
if ((check_trigger_meas_event(
ctxt_pP->module_id,
ctxt_pP->frame,
......@@ -4369,7 +4305,6 @@ void ue_measurement_report_triggering(protocol_ctxt_t *const ctxt_pP, const uint
LOG_I(RRC,"[UE %d] Frame %d: RSRB detected, state: %d \n",
ctxt_pP->module_id, ctxt_pP->frame, ue->Info[0].State);
} else {
LOG_I(RRC, "Got to here %d\n", __LINE__);
if(ue->measReportList[i][j] != NULL) {
free(ue->measReportList[i][j]);
}
......@@ -6378,8 +6313,8 @@ void process_nr_nsa_msg(nsa_msg_t *msg, int msg_len)
nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request.dl_tti_request_body.dl_tti_pdu_list[i];
if (pdu_list->PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE)
{
LOG_I(RRC, "Got an NR_UE_RRC_MEASUREMENT. pdulist[%d].ssRSRB = %d\n",
i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssRSRB);
LOG_I(RRC, "Got an NR_UE_RRC_MEASUREMENT. pdulist[%d].ssbRsrp = %d\n",
i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp);
}
}
break;
......
......@@ -324,9 +324,9 @@ typedef enum SL_TRIGGER_e {
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define MAX_MEAS_OBJ 7
#define MAX_MEAS_CONFIG 7
#define MAX_MEAS_ID 7
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
......
......@@ -4583,7 +4583,7 @@ rrc_eNB_process_MeasurementReport(
}
/* TODO: improve NR triggering */
if (measResults2->measId == 7) {
if (measResults2->measId == 7) { //Melissa this is where we finish step 26
if ((ue_context_pP->ue_context.Status != RRC_NR_NSA) && (ue_context_pP->ue_context.Status != RRC_NR_NSA_RECONFIGURED)) {
MessageDef *msg;
ue_context_pP->ue_context.Status = RRC_NR_NSA;
......
......@@ -122,9 +122,9 @@ typedef enum UE_STATE_NR_e {
#define RRM_CALLOC(t,n) (t *) malloc16( sizeof(t) * n)
#define RRM_CALLOC2(t,s) (t *) malloc16( s )
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define MAX_MEAS_OBJ 7
#define MAX_MEAS_CONFIG 7
#define MAX_MEAS_ID 7
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 255
......
......@@ -59,9 +59,9 @@
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
#define MAX_MEAS_OBJ 6
#define MAX_MEAS_CONFIG 6
#define MAX_MEAS_ID 6
#define MAX_MEAS_OBJ 7
#define MAX_MEAS_CONFIG 7
#define MAX_MEAS_ID 7
typedef uint32_t channel_t;
......
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