Commit d14ad679 authored by Raphael Defosseux's avatar Raphael Defosseux

Applying the cppcheck fix on last files

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent db51efa8
......@@ -820,11 +820,12 @@ void
get_csi_params(COMMON_channels_t *cc,
struct LTE_CQI_ReportPeriodic *cqi_ReportPeriodic,
uint16_t *Npd, uint16_t *N_OFFSET_CQI, int *H) {
AssertFatal(cqi_ReportPeriodic != NULL,
"cqi_ReportPeriodic is null!\n");
uint16_t cqi_PMI_ConfigIndex =
cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
uint8_t Jtab[6] = { 0, 2, 2, 3, 4, 4 };
AssertFatal(cqi_ReportPeriodic != NULL,
"cqi_ReportPeriodic is null!\n");
if (cc->tdd_Config == NULL) { //FDD
if (cqi_PMI_ConfigIndex <= 1) { // 2 ms CQI_PMI period
......@@ -2601,6 +2602,7 @@ int get_nb_subband(int N_RB_DL) {
case 15:
nb_sb = 4; // sb_size =4
break;
case 25:
nb_sb = 7; // sb_size =4, 1 sb with 1PRB, 6 with 2 RBG, each has 2 PRBs
......@@ -2772,7 +2774,7 @@ dump_CCE_table(int *CCE_table, const int nCCE,
break;
}
printf("rnti %x, Yk*L = %d, nCCE %d (nCCE/L %d),nb_cand*L %d\n", rnti,
printf("rnti %x, Yk*L = %u, nCCE %d (nCCE/L %d),nb_cand*L %d\n", rnti,
Yk * L, nCCE, nCCE / L, nb_candidates * L);
}
......
......@@ -5140,7 +5140,7 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
ctxt_pP->module_id, // get_adjacent_cell_mod_id(mobilityInfo->targetPhysCellId),
ue_context_pP->ue_context.rnti);
mobilityInfo->additionalSpectrumEmission = CALLOC(1, sizeof(*mobilityInfo->additionalSpectrumEmission));
*mobilityInfo->additionalSpectrumEmission = 1; //Check this value!
*mobilityInfo->additionalSpectrumEmission = (LTE_AdditionalSpectrumEmission_t) 1; //Check this value!
mobilityInfo->t304 = LTE_MobilityControlInfo__t304_ms200; // need to configure an appropriate value here
// New UE Identity (C-RNTI) to identify an UE uniquely in a cell
mobilityInfo->newUE_Identity.size = 2;
......
......@@ -374,7 +374,11 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
/* Set proper pci */
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupRequest_IEs_t, ie, x2SetupRequest,
X2AP_ProtocolIE_ID_id_ServedCells, true);
if (ie->value.choice.ServedCells.list.count > 0) {
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
} else if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->x2ap_eNB_instance->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
......@@ -474,7 +478,11 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
/* Set proper pci */
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupResponse_IEs_t, ie, x2SetupResponse,
X2AP_ProtocolIE_ID_id_ServedCells, true);
if (ie->value.choice.ServedCells.list.count > 0) {
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
} else if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->x2ap_eNB_instance->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
......@@ -585,7 +593,12 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID, true);
//X2AP_HANDOVER_REQ(msg).source_rnti = ctxt_pP->rnti;
//X2AP_HANDOVER_REQ(m).source_x2id = x2HandoverRequest->old_eNB_UE_X2AP_ID;
X2AP_HANDOVER_REQ(msg).old_eNB_ue_x2ap_id = ie->value.choice.UE_X2AP_ID;
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
} else {
X2AP_HANDOVER_REQ(msg).old_eNB_ue_x2ap_id = ie->value.choice.UE_X2AP_ID;
}
//X2AP_HANDOVER_REQ(msg).target_physCellId = measResults2->measResultNeighCells->choice.
//measResultListEUTRA.list.array[ncell_index]->physCellId;
......@@ -600,10 +613,13 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverRequest_IEs_t, ie, x2HandoverRequest,
X2AP_ProtocolIE_ID_id_UE_ContextInformation, true);
X2AP_HANDOVER_REQ(msg).mme_ue_s1ap_id = ie->value.choice.UE_ContextInformation.mME_UE_S1AP_ID;
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
}
X2AP_HANDOVER_REQ(msg).mme_ue_s1ap_id = ie->value.choice.UE_ContextInformation.mME_UE_S1AP_ID;
X2AP_HANDOVER_REQ(msg).target_mod_id = x2ap_eNB_data->x2ap_eNB_instance->eNB_id;
X2AP_HANDOVER_REQ(msg).security_capabilities.encryption_algorithms =
BIT_STRING_to_uint16(&ie->value.choice.UE_ContextInformation.uESecurityCapabilities.encryptionAlgorithms);
X2AP_HANDOVER_REQ(msg).security_capabilities.integrity_algorithms =
......
......@@ -1542,6 +1542,12 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
return -1;
}
S1AP_PATH_SWITCH_REQ_ACK(message_p).eNB_ue_s1ap_id = ie->value.choice.ENB_UE_S1AP_ID;
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
......@@ -1556,6 +1562,13 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
return -1;
}
S1AP_PATH_SWITCH_REQ_ACK(message_p).mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
if ( ue_desc_p->mme_ue_s1ap_id != ie->value.choice.MME_UE_S1AP_ID) {
......@@ -1566,6 +1579,13 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
/* mandatory */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestAcknowledgeIEs_t, ie, pathSwitchRequestAcknowledge,
S1AP_ProtocolIE_ID_id_SecurityContext, true);
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
return -1;
}
S1AP_PATH_SWITCH_REQ_ACK(message_p).next_hop_chain_count =
ie->value.choice.SecurityContext.nextHopChainingCount;
memcpy(&S1AP_PATH_SWITCH_REQ_ACK(message_p).next_security_key,
......@@ -1676,6 +1696,12 @@ int s1ap_eNB_handle_s1_path_switch_request_failure(uint32_t assoc_
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PathSwitchRequestFailureIEs_t, ie, pathSwitchRequestFailure,
S1AP_ProtocolIE_ID_id_Cause, true);
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received S1 path switch request failure for non existing "
"ie context is NULL\n", assoc_id);
return -1;
}
switch(ie->value.choice.Cause.present) {
case S1AP_Cause_PR_NOTHING:
S1AP_WARN("Received S1 Error indication cause NOTHING\n");
......
......@@ -1683,7 +1683,7 @@ int s1ap_eNB_path_switch_req(instance_t instance,
if ((collision_p = RB_INSERT(s1ap_ue_map, &s1ap_eNB_instance_p->s1ap_ue_head, ue_context_p))
== NULL) {
S1AP_DEBUG("Found usable eNB_ue_s1ap_id: 0x%06x %d(10)\n",
S1AP_DEBUG("Found usable eNB_ue_s1ap_id: 0x%06x %u(10)\n",
ue_context_p->eNB_ue_s1ap_id,
ue_context_p->eNB_ue_s1ap_id);
/* Break the loop as the id is not already used by another UE */
......
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